2015년 5월 19일 화요일

[Grind Away] C++ template 상수TYPE

C++ · 2015/05/19

작업하다 필요해 짧게 정리해 둔다.

template <class TYPE, int MAXSIZE> 1 class Stack { 2 private: TYPE elems[MAXSIZE]; 3 ... 4 }; 5 Colored by Color Scripter cs 형태로 template의 매개변수를 전달할시 int형은 상수로 동작한다.

같은 상황에 부딪힌 분에게 도움이 되길.

#Cpp #C언어 #객체지향 #개발자

댓글 없음:

댓글 쓰기