K
kaede
Hi all,
I would like to know if the following code is valid and not
ill-formed.
Data getData()
{
return Data(1, 2, 3);
}
void processData(const Data& data)
{
// ... work with data ...
}
// ... in some code somewhere ...
processData( getData() );
Will this const reference initialized with getData() [temporaries]
make that temporary value live for the lifetime of the reference
itself?
Thanks,
Kaede
I would like to know if the following code is valid and not
ill-formed.
Data getData()
{
return Data(1, 2, 3);
}
void processData(const Data& data)
{
// ... work with data ...
}
// ... in some code somewhere ...
processData( getData() );
Will this const reference initialized with getData() [temporaries]
make that temporary value live for the lifetime of the reference
itself?
Thanks,
Kaede