0

I'm getting explicit specialization in non-namespace scopeerror from this define:

#define DECLARE_INTERNAL_LINK_SPECIALIZATION(T, Counter) template<> struct T<Counter>

This is how the define is used, which triggers the error:

#define DECLARE_INTERNAL_LINK_BASE(T) template<int Counter> struct T
#define DECLARE_INTERNAL_LINK_SPECIALIZATION(T, Counter) template<> struct T<Counter>

namespace TestBugFix
{
    struct FPlatformTypeLayoutParameters
    {
        DECLARE_INTERNAL_LINK_BASE(InternalLinkType);
        DECLARE_INTERNAL_LINK_SPECIALIZATION(InternalLinkType, __COUNTER__);
    };
}

I believe I'm getting this as defines do not have namespace scope. This works fine for clang, but not GCC. How may I implement the same functionality within namespace scope?

ZeroPhase
  • 649
  • 4
  • 21

0 Answers0