In .h file
class X{
private:
std::chrono::minutes A;
public:
X(std::chrono::minutes& a = std::chrono::minutes {5});
}
In .CPP file
X::X(std::chrono::minutes& a): A(a){}
Can std::chrono::minutes {5} go out of scope before getting assigned to A
for example,
void main()
{
X x;
}
Is it guaranteed that object x will have member A with value std::chrono::minutes {5} always?
Aucun commentaire:
Enregistrer un commentaire