This is the error I get from make:
In file included from ui/graphical/game/control/chatcommand/chatcommand.cpp:20:
ui/graphical/game/control/chatcommand/chatcommand.h:67:41: error:
implicit instantiation of undefined template 'cChatCommandParser<>'
return cChatCommandParser<NewArgument>(cChatCommandParser<>(std::move(*thi...
^
ui/graphical/game/control/chatcommand/chatcommand.h:27:7: note:
template is declared here
class cChatCommandParser;
^
chatcommand.h:
...
template<typename... Arguments>
class cChatCommandParser;
...
class cChatCommand
{
public:
...
template<typename NewArgument, typename... Args>
cChatCommandParser<NewArgument> addArgument(Args&&... args);
...
};
template<typename NewArgument, typename... Args>
cChatCommandParser<NewArgument> cChatCommand::addArgument(Args&&... args)
{
return cChatCommandParser<NewArgument>(cChatCommandParser<>(std::move(*this)), NewArgument(std::forward<Args>(args)...));
}
The obvious solution would be to #include chatcommandparser.h
. Unfortunately chatcommandparser.h already includes chatcommand.h.
What is the most conservative way to untangle this? I don't really know what this code is doing and just want to compile it.
Note that GNUs gcc compiles this without a problem. I'm trying to compile this with Apples gcc.