fork download
  1. enum E {
  2. x
  3. };
  4.  
  5. template <typename T>
  6. struct traits {
  7. static const E val = x;
  8. };
  9.  
  10. template <E e>
  11. struct S {
  12. S(){};
  13. };
  14.  
  15. template <typename T>
  16. S<traits<T>::val> foo(T t);
  17.  
  18. int main() {
  19. char c = 0;
  20. foo(c);
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/d5fYLf/ccr6BBwh.o: In function `main':
prog.cpp:(.text.startup+0x20): undefined reference to `S<traits<char>::val> foo<char>(char)'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty