Advertisement
Guest User

expected ‘;’ before ‘...’ token

a guest
Aug 17th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <string>
  4.  
  5. template <typename ... TParent>
  6. class Parent {
  7.     public:
  8.    
  9.     class Child {
  10.     public:
  11.         template <typename ... T>
  12.         void childDummyFunction() {
  13.         }
  14.     };
  15.    
  16.     template <typename ... TFunctionParameters>
  17.     void parentFunction() {
  18.         Child child;
  19.         child.childDummyFunction<TFunctionParameters...>();    
  20.     }
  21. };
  22.  
  23. int main()
  24. {
  25.     Parent<int> sys;
  26.    
  27.     sys.parentFunction<float>();
  28.    
  29.   std::cout << "Hello, " << "!\n";
  30. }
  31.  
  32. /*
  33. main.cpp: In member function ‘void Parent<TParent>::parentFunction()’:
  34. main.cpp:19:47: error: expected primary-expression before ‘...’ token
  35.    child.childDummyFunction<TFunctionParameters...>();  
  36.                                                ^~~
  37. main.cpp:19:47: error: expected ‘;’ before ‘...’ token
  38. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement