Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <int age>
- class Parent {
- };
- class Child : public Parent<33> {
- };
- template <char *text>
- class Parent {
- };
- class Child : public Parent<"ololo"> {
- };
- template<const char* const text>
- class Test
- {
- public:
- void out() { cout << text << endl; }
- };
- const char * const text = "abcd";
- int main(int argc, const char * argv[])
- {
- Test<text> t;
- t.out();
- }
- template<char* text>
- class Test
- {
- public:
- void out() { cout << text << endl; }
- };
- char * text = "abcd";
- char& i = text[0];
- int main(int argc, const char * argv[])
- {
- Test<&i> t;
- t.out();
- }
- template <const char *text>
- class Parent {
- };
- char text[] = "Ololo";
- class Child : public Parent<text> {
- };
Add Comment
Please, Sign In to add comment