Advertisement
Guest User

expected ‘;’ before ‘...’ token

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