May I use double colons in #define
? I'd like to save some writing in the implementation files, e.g. like this:
// foo.h
#define template template <class T>
#define foo:: foo<T>::
template class foo {
T& baz();
};
#include "foo.tpp"
#undef template
#undef foo::
// foo.tpp
template T& foo::baz() {
// do stuff.
}
But I get syntax errors I don't really understand. (See an example on codepad ):
Line 11: error: missing whitespace after the macro name
Line 10: error: extra tokens at end of #undef directive
Line 4: error: 'foo' is not a template
compilation terminated due to -Wfatal-errors.