fork download
  1. #include <stdio.h>
  2.  
  3. template< typename T >
  4. class A
  5. {
  6. public:
  7. void Func( void );
  8. template< typename U >
  9. void FuncT( const U& value );
  10.  
  11. template< typename V >
  12. class AA
  13. {
  14. public:
  15. void Func( void );
  16. template< typename W >
  17. void FuncT( const W& value );
  18. };
  19. };
  20.  
  21. template< typename T >
  22. void A<T>::Func( void ){ printf( "Func\n" ); }
  23.  
  24. template< typename T >
  25. template< typename U >
  26. void A<T>::FuncT( const U& value ){ printf( "FuncT : U is %d byte\n", sizeof(U) ); }
  27.  
  28. template< typename T >
  29. template< typename V >
  30. void A<T>::AA<V>::Func( void ){ printf( "Func\n" ); }
  31.  
  32. template< typename T >
  33. template< typename V >
  34. template< typename W >
  35. void A<T>::AA<V>::FuncT( const W& value ){ printf( "FuncT : W is %d byte\n", sizeof(W) ); }
  36.  
  37. int main( void )
  38. {
  39. A<int> a;
  40. a.Func();
  41. a.FuncT( true );
  42.  
  43. A<int>::AA<int> aa;
  44. aa.Func();
  45. aa.FuncT( true );
  46.  
  47. return 0;
  48. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
Func
FuncT : U is 1 byte
Func
FuncT : W is 1 byte