Comments (4)
비주얼 스튜디오에서는 컴파일에 전혀 문제가 없는데 고쳐야 할까요?
경고 역시 뜨지 않습니다.
from cpp-study.
두 가지 가능성이 있습니다.
- 위 코드는 단순
friend
선언이기 때문에 안쪽T
를 사용할 일이 없어Visual Studio
컴파일러가 영리하게 처리했다. Visual Studio
컴파일러는 변수의 이름이 겹치는 경우처럼, 안쪽 범위의typename
을 우선 사용하는 규칙이 있다.
중첩 template
을 사용할 때 바깥 범위의 typename
과 안쪽 범위의 typename
을 같은 것을 써서 좋을 것이 없습니다.
-
코드를 읽을 때 어떤
typename
을 말하는 것인지 모호하게 느껴집니다. -
저는
gdb online debugger
IDE
를 사용해 작업했는데, 이것은 컴파일러로gcc
를 이용합니다.
C/C++
의 대표적인 컴파일러gcc
로 컴파일이 불가능하다면, 코드 수정을 고려해봐야겠죠.- 웬만하면 어떤 컴파일러를 쓰는 지와 무관하게 컴파일 가능한 게 좋습니다.
from cpp-study.
수정 완료하였습니다. 템플릿을 쓴다는 것은 무척이나 까다롭군요.
이슈는 꼭 제가 닫아야 하는건가요?
from cpp-study.
그걸 처음에는 Issue
를 작성한 사람(지금이라면 저)이 닫도록 해야겠다고 생각했는데,
Commit Message
로 Close #32
과 같이 작성하면 Issue
를 닫을 수 있다는 사실을 발견해서,
이 경우엔 Commit
작성자가 Issue
를 닫는 게 효율적이니 어떻게 해야할지 고민입니다.
일단 이 Issue
는 제가 닫겠습니다.
from cpp-study.
Related Issues (17)
- Go001. Issue 사용법
- En001 코드 리팩터링 - assert와 if를 동시에 쓰지 않기를 권장합니다. HOT 1
- Bu002. 템플릿 변수를 함수의 매개변수로 전달 HOT 4
- En002 - fstream으로부터 데이터 입력 & 컨테이너에 원소를 입력하는 효율적인 방법 HOT 1
- En003 - 조건부 컴파일문과 포함문의 순서 변경 HOT 1
- Do001 - 5th assignment 오타 HOT 2
- Do002 - 멤버 함수 선언 과제 수정 HOT 2
- Bu003 std::cout 일치하는 피연산자를 찾을 수 없음 HOT 2
- Bu004. mystring.inl에 정의된 operator>> 오류 HOT 1
- Bu005. test case 작성 중 예기치 못한 오류? HOT 1
- BU006 string_benchmark - ret과 std::getline 오류 HOT 1
- Do003 - 오타 HOT 2
- Do004. 멤버 함수 선언 과제 수정 HOT 3
- En004. 코드 중복을 줄이는 것이 좋습니다. HOT 1
- En005. 함수의 선언에서 함수의 동작을 유추할 수 있어야 합니다. HOT 2
- In001. 동적 할당 과제의 변경 내용을 코드에 반영해야 합니다. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-study.