Guest User

Untitled

a guest
Jan 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. template<class T>
  4. struct foo {};
  5.  
  6. template<>
  7. struct foo<int> {
  8. static constexpr char value[] = "abcde";
  9. };
  10.  
  11. template<class T>
  12. struct bar {
  13. static constexpr char value[] = "abcde";
  14. };
  15.  
  16. template<class T>
  17. struct baz {
  18. static constexpr int value = 12345;
  19. };
  20.  
  21. int main() {
  22. char c = foo<int>::value[2];
  23. char d = bar<int>::value[2];
  24. int e = baz<int>::value;
  25.  
  26. std::cout << c << d << e << "n";
  27.  
  28. }
Add Comment
Please, Sign In to add comment