I have a simple struct:
struct Test
{
int a;
Test(int b, int c)
{
a = b * c;
}
};
I need to declare CT TransformData
variable. It works with #define
:
#define testDefault = Test(1, 2)
But I need to separate this variable to a separate namespace. If I use consexpr
I get the error:
the type «const Test» of «constexpr» variable «test» is not literal
I've googled about constexpr and seems constexpr limits don't allow declare such class instance as constexpr. Which are there ways to declare such constant?