Boost logo

Boost :

From: Noel Yap (Noel.Yap_at_[hidden])
Date: 2003-05-04 17:30:23


"Justin M. Lewis" wrote:
> > Can we agree, then, that there's no need for c_out?
> >
>
> Of course not, because you haven't yet addressed the issue of non-copyable
> objects, OR polymorphic types, OR large structs that can't be copyed into a
> retrun value, OR a function where you have a lot of return types.

Yes, we have. One more time:

  T f(); // if T has a cheap copy
  T const& f(); // if f owns the return value, can handle polymorphic
types
  dumb_ref< T > f(); // if T doesn't have a cheap copy, f has to own the
return value, can handle polymorphic types
  dumb_ptr< T > f(); // if the return value can be NULL, f has to own
the return value, can handle polymorphic types
  result< T > f(); // if the return value is gotten from an asynchronous
call
  tuple< T, U > f(); // if f has many return values, I think one can use
bind, too

Did I miss anything? BTW, one can probably combine some of the above to
get the exact flavor of return one wants.

Noel


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