Say I have a type edge:
struct edge
{
long long weight;
int dest;
inline bool operator<(const edge& other) const
{
return weight > other.weight;
}
};
In G++ 4.1.2 (CentOS) I can safely do:
edge e = (edge){0, 1};
But on MSVC++ 2010, the same code causes:
test.cpp(57) : error C2059: syntax error : '{'
test.cpp(57) : error C2143: syntax error : missing ';' before '{'
test.cpp(57) : error C2143: syntax error : missing ';' before '}'
Is there a way to do this in MSVC++ compiler?
I suggest having a constructor:
then use