This is a follow up to Why aren't fields from constant POD object constants themselves?
A header from a library declares class GUIDs like
static const GUID CLSID_EH264VD =
{ 0x96b9d0ed, 0x8d13, 0x4171, { 0xa9, 0x83, 0xb8, 0x4d, 0x88, 0xd6, 0x27, 0xbe } };
I want to write a function that creates an object directly from the dll, without requiring the dll to be registered, so I need to map each CLSID to the dll name. Something like
Create<CLSID_EH264VD>()
which would depend on a specialization such as
template<>
struct dll<CLSID_EH264VD>
{
char const* filename = ""mc_dec_avc_ds.ax";
}
so that it's a compile time error to try to instantiate an unregistered class with an unknown dll.
The problem is that templates can't be specialized for GUIDs. The linked question says that constexpr would allow to declare the GUID in a way that allows specialization, but Visual C++ doesn't support constexpr in the latest version (2012). Any workaround?