Guest User

Untitled

a guest
Nov 25th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. template <int age>
  2. class Parent {
  3.  
  4. };
  5.  
  6.  
  7. class Child : public Parent<33> {
  8.  
  9. };
  10.  
  11. template <char *text>
  12. class Parent {
  13.  
  14. };
  15.  
  16.  
  17. class Child : public Parent<"ololo"> {
  18.  
  19. };
  20.  
  21. template<const char* const text>
  22. class Test
  23. {
  24. public:
  25. void out() { cout << text << endl; }
  26. };
  27.  
  28. const char * const text = "abcd";
  29.  
  30. int main(int argc, const char * argv[])
  31. {
  32. Test<text> t;
  33. t.out();
  34. }
  35.  
  36. template<char* text>
  37. class Test
  38. {
  39. public:
  40. void out() { cout << text << endl; }
  41. };
  42.  
  43. char * text = "abcd";
  44. char& i = text[0];
  45.  
  46. int main(int argc, const char * argv[])
  47. {
  48. Test<&i> t;
  49. t.out();
  50. }
  51.  
  52. template <const char *text>
  53. class Parent {
  54.  
  55. };
  56.  
  57. char text[] = "Ololo";
  58. class Child : public Parent<text> {
  59.  
  60. };
Add Comment
Please, Sign In to add comment