Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-11-22 15:07:32


In message <0011221508360W.17834_at_[hidden]>, Jose
Orlando Pereira <jop_at_[hidden]> writes
>Using a syntax such as:
>
> descriptor << optional(i) << required(j);
>
>how do you ensure that for different instantiations of the descritor
>type you select corresponding instantiations of optional() and other
>annotations. Notice that in the current XTL syntax this is easy as
>annotations are methods of the stream/descritpor class.
>
>On the other hand, if we manage to do this wihtout killing
>optimization it would be very nice. I'll think about this.

I think this would be worth pursuing and I don't see any problems as
something like optional and required would be functions returning a
wrappered object of appropriate type:

        template<typename T>
        optional_ptr<T> optional(T * p)
        {
                return optional_ptr<T>(p);
        }

The result can then overload correctly on the corresponding member
template operator<<.

Kevlin
____________________________________________________________

  Kevlin Henney phone: +44 117 942 2990
  Curbralan Limited mobile: +44 7801 073 508
  mailto:kevlin_at_[hidden] fax: +44 870 052 2289
  http://www.curbralan.com
____________________________________________________________


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