Modern C++ Design勉強日記 似ているようで違う型
template< int T > struct Int2Type { enum { value = T }; }; #ifdef __TEST_TMP1_1 AUTO_TEST( tmp1_1 ) { Int2Type< true > t; Int2Type< false > f; // tとfは、別の型です。 // それぞの値を表示 cout << t.value << endl; cout << f.value << endl; //t = f // 別々の型なので代入できない。 } #endif