Creating a template based on an inner class

I am trying to create a class whose template is set to one of its built-in classes.

I thought that by promoting the declaration of the corresponding classes, I would be fine. But I keep getting errors during compilation, for example:

use of undefined type QueryGetCustomer
Reply uses undefined class QueryGetCustomer

Is there a way to pattern QueryGetCustomerin a class Replywhen the class Replyis internal to QueryCustomer, as shown in this code?

class QueryGetCustomer;
class QueryGetCustomer::Reply; // error: use of undefined type QueryGetCustomer
                               // error: Reply uses undefined class QueryGetCustomer

class QueryGetCustomer :
   public BaseQuery<QueryGetCustomer::Reply>
{
public:
    class Reply { [....] };
};

PS I have this template structure that works when the class Replyis an external (global) class QueryGetCustomer.

However, it Replyreally makes sense in the request, so I would really like it to be an inner class.

+4
1

.

. .

+2

Source: https://habr.com/ru/post/1533237/


All Articles