fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T> struct AArgSelector;
  5. template<> struct AArgSelector<int> { typedef void* Type; };
  6. template<> struct AArgSelector<void*> { typedef int Type; };
  7.  
  8.  
  9. template<typename T>
  10. class A {
  11. public:
  12. A( typename AArgSelector<T>::Type ) {}
  13. };
  14.  
  15. int main() {
  16. A<void *> a0( 5 );
  17. //A<int> a1(5);
  18. A<int> a2(&a0);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 2724KB
stdin
Standard input is empty
stdout
Standard output is empty