I have one class with a constructor that takes another struct as a parameter, and that has a default value. Something like this:
class A
{
public:
A(someStruct st = someStruct::defaultStruct());
};
I've run a static analyzer on my code and it says that this parameter should be const ref. But it's kinda ref to a temporary, though I'm making a copy of it the the constructor, but still I'm confused should I do it const ref.
someStruct::defaultStruct() is something like
static someStruct someStruct::defaultStruct()
{
return { 0, 0 };
}