constexpr 이랑 macro, class 를 써 보아요~


template< class T >s

constexpr   bool    size8() { return  sizeof( T ) == 8; }


template< class T >

constexpr   bool    size4() { return  sizeof( T ) == 4; }


template< class T >

constexpr   bool    size2() { return  sizeof( T ) == 2; }


#define stab( cond, rt ) typename enable_if< cond(), rt >::type


using namespace std;


template< class T >

stab( size8< T >, void ) func( T v )

{

    ...

}


template< class T >

stab( size4< T >, void ) func( T v )

{

    ...

}


template< class T >

stab( size2< T >, void ) func( T v )

{

    ...

}