fork(1) download
  1. struct Value
  2. {
  3. template<class T>
  4. static constexpr T value{0};
  5. };
  6.  
  7. template<typename TValue>
  8. struct Something
  9. {
  10. void x()
  11. {
  12. static_assert(TValue::template value<int> == 0, "");
  13. }
  14. };
  15.  
  16. int main() { Something<Value>{}.x(); return 0; }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of 'void Something<TValue>::x() [with TValue = Value]':
prog.cpp:16:35:   required from here
prog.cpp:12:51: error: 'template<class T> constexpr const T Value::value<T>' is not a function template
         static_assert(TValue::template value<int> == 0, "");
                                                   ^
prog.cpp:12:51: error: 'value<int>' is not a member of 'Value'
stdout
Standard output is empty