I need a template-of-template class, but the issue is, that I can't access the type of nested template:
template<template<class TParamPayload> class TMsg>
class ParameterBasedFilter : public IMsgFilter
{
public:
typedef TMsg<TParamPayload> ExpectedMessage;
typedef TParamPayload::otherType SomeOtherType;
};
And here is a usage (I want to pass only one template argument, without comma)
ParameterBasedFilter<SomeMessage<SomePayload>> filter;
There is an error inside ParameterBasedFilter:
error: 'TParamPayload' was not declared in this scope
typedef TMsg<TParamPayload> ExpectedMessage;
^
Is it possible at all to get the nested template type? I know, that code below will work
template<class TParamPayload, template<class> class TMsg>
class ParameterBasedFilter : public IMsgFilter
{
public:
typedef TMsg<TParamPayload> ExpectedMessage;
typedef TParamPayload::otherType SomeOtherType;
};
but then I have to pass 2 types to the template arguments:
ParameterBasedFilter<SomePayload, SomeMessage<SomePayload>> filter;
and it looks weird, because SomePayload is used twice.