Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- template<class T>
- struct foo {};
- template<>
- struct foo<int> {
- static constexpr char value[] = "abcde";
- };
- template<class T>
- struct bar {
- static constexpr char value[] = "abcde";
- };
- template<class T>
- struct baz {
- static constexpr int value = 12345;
- };
- int main() {
- char c = foo<int>::value[2];
- char d = bar<int>::value[2];
- int e = baz<int>::value;
- std::cout << c << d << e << "n";
- }
Add Comment
Please, Sign In to add comment