Boost logo

Boost :

Subject: [boost] [c++ question] detecting reference to temporaries
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2018-10-24 22:53:19

I have a stupid question related to a bug in boost.test. A piece of code
is doing something like:

const value& get() {
   return *internal_iterator; // can be a ref or not to value or another

The fix is trivial, *but* I want to test it.

Is there any technique that would let me test for reference to
temporaries? The only option I see would be to promote compiler warnings
into error, but maybe there is something there?


(complete example here:

Boost list run by bdawes at, gregod at, cpdaniel at, john at