|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2003-03-18 12:16:29
"David Abrahams" <dave_at_[hidden]> wrote in message
news:u7kaw7h88.fsf_at_boost-consulting.com...
> "David B. Held" <dheld_at_[hidden]> writes:
>
> > Is this is a worthwhile idea to pursue? Am I missing any critical
> > details? I realize there is still a problem with const vs. non-const
> > references, but I won't even try to solve that. ;)
>
> That's a pretty major problem, though. Your idea also cuts off
> implicit conversions.
Do you mean user-defined conversions, because it consumes one
from by_ref->T? It's more awkward, but wouldn't calling a named
member to get T solve that? I realize the const/non-const& problem
is big, but my solution is no worse than the current one using
boost::ref(), but eliminates the need for explicitly specifying
boost::ref(), doesn't it? The main showstopper I see is that by using
size as the switch, you might get small non-copyable objects that
try to get passed by value. I suppose allowing user-defined
specializations would fix that, though it would be tedious.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk