Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2004-04-21 10:07:55

Alexander Nasonov wrote:

> Another idea. The any_pointer could be made lightweighted. ScopedGuard trick
> can help, on one hand, to hide ugly container type behind typedef'd
> reference, and, on another hand, to let the compiler remember the "origin".
> I suspect the compiler have to be very very clever.
> // aka ScopedGuard; library code
> typedef crange_base const& crange_base_ref;
> // user code
> for(crange_base_ref r = make_crange(cont); r; ++r)
> *r += 2;

Ah, but what is the type is *r ? And how would you implement operator* ?

Eric Niebler
Boost Consulting

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