I have a function declaration where one argument is a class constructor default parameter like shown:
int someFunction(int seed, int x, Metrics& metrics = Metrics(size));
where size is a const double initialized to 41.64
I'm porting this function to Linux, and am running into problems with GCC (v4.8.5). The code compiles fine in MS Visual Studio 2008, but not with GCC.
I've tried dynamic_cast<Metrics&>(Metrics(size))
but that doesn't work.
The error I'm getting from GCC is:
error: could not convert 'Metrics(4.164e+1)' from 'Metrics' to 'Metrics&'