Part 3, 테크닉 3-11 Typelist의 한 원소를 다른 자료형으로 바꾸기
Erase를 구현했을 때와 별 차이가 없다. 지우지 말고 자료형만 바꾸면 된다. 이건 바로 코딩으로 만들어도 될 듯하여, 제목만 보고 코딩을 했다. 다음 소스코드를 보자 template struct Replace; template struct Replace { typedef NullType Result; }; template struct Replace { typedef typelist Result; }; template struct Replace { typedef typelist Result; }; 생각 할 것도 없었기 때문에 굳이 정리는 하지 않고, ReplaceAll 을 한번 만들어 보기 바란다. ReplaceAll 소스코드 template struct ReplaceAll; template struc..
책 정리/Modern C++ Design
2009. 9. 4. 15:48
최근댓글