I need to write a class whose constructor takes a permalink to an object and stores it locally.
To avoid most of the common mistakes that I can foresee, I would only like to accept links to non-temporary (i.e. links to lvalues).
How can I write a function that accepts permalinks to non-temporary only?
Of course, not even temporary ones can go out of scope and thus violate the behavior of my class, but I believe that by banning temporary references, I will avoid most errors.
c ++ reference const temporary
peoro Dec 28 2018-10-12T00: 00Z
source share