In the following code:
class Class
{
private:
LUID luid;
public:
Class()
{
luid = { 0, 0}; // A. Does not compile
LUID test = {0, 0}; // B. Compiles
test = {1,1}; // C. Does not compile
}
Why are A and C not right, but B is fine?
The error I get for A and C is:
error C2059: syntax error : '{'
error C2143: syntax error : missing ';' before '{'
error C2143: syntax error : missing ';' before '}'
I think it has to do with the C++ version, although I am not sure which version this is using besides it not being very new.
LUIDdefined? Do you have C++11 or higher turned on?