Reputation: 4505
I have
template <typename ConcContainer>
class WebBrowsingPolicyData
{
public:
typedef ConcContainer<std::shared_ptr<WBRuleDetails>>::iterator iterator;
...
private:
ConcContainer<std::shared_ptr<WBRuleDetails>> usersData_;
CRITICAL_SECTION critSection
I get a compile error at line (Error 6 error C2238: unexpected token(s) preceding ';')
typedef ConcContainer<std::shared_ptr<WBRuleDetails>>::iterator iterator
How can I make a typedef inside the template ? I must be missing something..
Upvotes: 1
Views: 154
Reputation: 122011
ConContainer is itself a template so it needs to be a template template parameter:
template <template <typename T> class ConcContainer>
class WebBrowsingPolicyData
{
public:
typedef typename ConcContainer<std::shared_ptr<WBRuleDetails>>::iterator iterator;
};
Upvotes: 3
Reputation: 101506
Two possibilities:
>>
. Insert a space. Note that if you're using a C++11-conformant compiler, this should not be an issue.example:
typedef ConcContainer<std::shared_ptr<WBRuleDetails> >::iterator iterator;
ConcContainer
doesn't have a member or typedef iterator
. Check to make sure that it really does.EDIT: This is not the most vexing parse.
Upvotes: 0