
21 Apr
2004
21 Apr
'04
3:07 p.m.
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 www.boost-consulting.com