Skip to content

Instantly share code, notes, and snippets.

@minamiyama1994
Created February 13, 2014 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minamiyama1994/8975184 to your computer and use it in GitHub Desktop.
Save minamiyama1994/8975184 to your computer and use it in GitHub Desktop.
templateの概念からTMPの応用まで ref: http://qiita.com/minamiyama1994/items/1b1b72d6c8a0aa61c6f6
void abc(int arg)
void abc(char arg)
template < typename T >
struct vector { /* ... */ } ;
template < >
struct vector < int > { /* ... */ } ;
template < typename T >
struct vector { /* ... */ } ;
template < typename T >
struct vector < hoge < T > > { /* ... */ } ;
struct some_struct
{
typedef hoge_type hogehoge_type ;
} ;
typedef int my_type ;
struct some_struct
{
typedef hoge_type hogehoge_type ;
} ;
template < typename T >
struct some_struct
{
typedef hoge_type hogehoge_type ;
} ;
template < typename T >
struct some_struct
{
typedef T hogehoge_type ;
} ;
template < typename T >
struct vector { /* ... */ } ;
template < >
struct vector < int > { /* ... */ } ;
template < typename T >
struct vector { /* ... */ } ;
template < typename T >
struct vector < hoge < T > > { /* ... */ } ;
template < typename T1 , typename T2 >
HogeType < T1 , T2 > operator + ( T1 t1 , T2 t2 ) ;
int add ( int x , int y )
{
return x + y ;
}
double add ( double x , double y )
{
return x + y ;
}
int add ( int x , int y )
{
return x + y ;
}
double add ( double x , double y )
{
return x + y ;
}
float add ( float x , float y )
{
return x + y ;
}
int add ( int x , int y )
{
return x + y ;
}
double add ( double x , double y )
{
return x + y ;
}
float add ( float x , float y )
{
return x + y ;
}
long add ( long x , long y )
{
return x + y ;
}
template < typename T >
T add ( T x , T y )
{
return x + y ;
}
class vector_int { /* ... */ } ;
class vector_long { /* ... */ } ;
class vector_double { /* ... */ } ;
template < typename T >
class vector { /* ... */ } ;
struct vector_int { /* ... */ } ;
struct vector_long { /* ... */ } ;
struct vector_double { /* ... */ } ;
template < typename T >
struct vector { /* ... */ } ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment