Guest User

Untitled

a guest
Dec 18th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. template<int num>
  2. struct Foo
  3. {
  4. static constexpr int blarg = num;
  5. };
  6.  
  7. template<Foo<int> foo> // Error: Template argument for non-type template parameter must be an expression
  8. struct Bar
  9. {
  10. static constexpr Foo<int> bar = foo; // Error: Template argument for non-type template parameter must be an expression
  11. };
  12.  
  13. struct MyStruct
  14. {
  15. static constexpr Foo<5> myFoo();
  16. static constexpr Bar<myFoo> myBar(); // Error: Value of type 'Foo<5> ()' is not implicitly convertible to 'int'
  17. };
Add Comment
Please, Sign In to add comment