Error in C++ game mode Atomic.h "E0018 Expected a')'

Hi,

Im using UE4 4.20.3
Visual Studio 17
I’m new to C++, so I’m not sure what the error code is that I’m getting when a set up the C++ GameMode. not sure if its it should point to some other class or var?
E0018 expected a’)’ UE4 Atomic.h line 188

// Basic storage and implementation - only allows getting and setting via platform atomics.
template
struct alignas(UE4Atomic_Private::TIsSupportedSize::Value ? alignof(UE4Atomic_Private::TUnderlyingIntegerType_T) : alignof(T)) TAtomicBase_Basic
{
public:
/**

  • Gets a copy of the current value of the element.
  • @anonymous_user_64fde8e1 Order The memory ordering semantics to apply to the operation.
  • @anonymous_user_b2e972a1 The current value.
    */
    FORCEINLINE T Load(EMemoryOrder Order = EMemoryOrder::SequentiallyConsistent) const
    {
    switch (Order)
    {
    case EMemoryOrder::relaxed:
    return UE4Atomic_Private::LoadRelaxed(&Element);
    }

return UE4Atomic_Private::Load(&Element);
}

You can actually format the code you write, as actual code. It’ll make it a lot easier for us to read. If I format your code in a code editor, it looks like you’re missing a curly bracket in the end of the struct?

Please correct the contents of 188 line as follows.

struct alignas((UE4Atomic_Private::TIsSupportedSize::Value) ? alignof(UE4Atomic_Private::TUnderlyingIntegerType_T) : alignof(T)) TAtomicBase_Basic

i think this is a VS Intellisense issue. and, no problems with other compilers.

ngcbbs’s solution didn’t work for me. In my case, I had to use this line:

struct alignas((UE4Atomic_Private::TIsSupportedSize<sizeof(T)>::Value) ? alignof(UE4Atomic_Private::TUnderlyingIntegerType_T<T>) : alignof(T)) TAtomicBase_Basic

Reference: https://www.reddit.com/r/unrealengine/comments/b1cp1m/building_from_source_e0018_expected_a_atomich/