Boost logo

Boost Users :

Subject: Re: [Boost-users] Covariant return type, method hiding, and shared_ptr advice
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2009-04-16 12:26:32


On Wed, Apr 15, 2009 at 8:35 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> Try passing the argument to ident_of by reference instead of by pointer
> and dereference the (smart) pointer at the call site.

As usual, thank you Steven. Works great with raw and smart pointers now.

I initially thought about overloading ident_of for pointers and
references, assuming pointers were raw pointers and references were
smart pointers, but then I couldn't deduce the return type anymore (at
least not easily, I would have had to deduce the constness as well
just like in ObjectPtr, but via a meta-function this time I guess).
Forcing the deref at the call site is much cleaner and not much of a
burden. I'll try to remember than "traversing" a smart pointer chain
is much easier at the call site that way. --DD


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net