fork download
  1. #include <iostream>
  2.  
  3. template<class T>
  4. struct Either {
  5. template<class U>
  6. struct Or {};
  7. };
  8.  
  9.  
  10. template<typename U,template<class> class T>
  11. struct specialize_me_2 {};
  12.  
  13. template<class T>
  14. struct specialize_me_2<T,Either<T>::template Or> {
  15. static const int foo = 3;
  16. };
  17.  
  18.  
  19. int main() {
  20.  
  21. std::cout << specialize_me_2<int,Either<int>::Or >::foo; // Does compile
  22.  
  23. }
Success #stdin #stdout 0s 4252KB
stdin
Standard input is empty
stdout
3