I found the following code (auto-generated, but it does not compile) and now I whant to know what it means:
template<> struct topic_type_support<UnboundedStringWithKey>
{
typedef UnboundedStringWithKey##TypeSupport type;
};
As some persons pointed out ## is meant for macros and indeed the code was inside a macro. I wasn't aware of this and tried to put it directly into the code to get a clearer error message. The original macro was:
#define REGISTER_TOPIC_TRAITS(TOPIC) \
namespace dds { namespace topic { \
template<> struct topic_type_support<TOPIC> { \
typedef TOPIC##TypeSupport type; \
}; \
template<> struct is_topic_type<TOPIC> { enum {value = 1 }; }; \
template<> struct topic_type_name<TOPIC> { \
static std::string value() { \
static topic_type_support<TOPIC>::type ts; \
return ts.get_type_name(); \
} \
}; \
} }
The original compiler error is: syntax error : missing ';' before identifier 'type'
I manually inserted the macro and applied ##:
template<> struct topic_type_support<UnboundedStringWithKey>
{
typedef UnboundedStringWithKeyTypeSupport type;
};
but it says directly in the line with the typedef: missing ';' before identifier 'type' (compiler is VS2010 with SP1 installed)
can anybody tell me? (the code is generated by idlpp.exe from OpenSplice)
the reason is now clear (I forgot the #pragma keylist entry in the idl) - there is no UnboundedStringWithKeyTypeSupport generated. But that's a different question.
Regards Tobias