Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2004-04-12 10:23:52


On Tue, Apr 13, 2004 at 12:26:35AM +1000, Thorsten Ottosen wrote:
> I think I have found a safe way to bind a temporary to a const reference
> and cast away the constness.
>
> This means that a temporary can be passed (relatively) safely to an
> algorithm with a prototype like
...
> Comments are welcome.

Cute use of compile-time ambiguity to ensure that you don't try to
mutate const objects.

Offhand it seems like it is "safe", in the sense of
lifetime-of-the-temporary issues.

What's an example use-case? I don't recall ever needing/wanting this.

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk