« first day (2221 days earlier)      last day (615 days later) » 

9:27 AM
is it possible that a property tree when calling get() to not return anything at all ?
from boost
 
Hello, cpp buddies!
I have found controversial information about rvalues passed as const reference parameters. There is one opinion that you can pass a rvalue by reference, but only if it's const and indeed I can reproduce that.
But here in this blog: https://www.fluentcpp.com/2022/05/16/how-to-store-an-lvalue-or-an-rvalue-in-the-same-object/
the argument is that you cannot - the destructor is called and the object is in undefined land.
Which is correct?
 
The lifetime of the rvalue will be extended when you pass it by const reference.
https://stackoverflow.com/a/36103786/3049315
 
Oh ok, so it lives until the end of the constructor in the blog example and then it is gone :O
 
But this only applies to stack-based references. It doesn’t work for references that are members of objects.
 
I see, that's mind-boggling!
 
nwp
10:33 AM
5 messages moved from Lounge<C++>
 

« first day (2221 days earlier)      last day (615 days later) »