Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] invalid initialization of non-const type with adaptors
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-05-11 08:42:37


Neil Groves skrev:

> I have infrequently have abstract types that are assignable. I don't
> think this alters your key point about the forwarding but I think we
> should probably have this instead:
>
> template< class Range, class Value >
> void fill( Rng&& rng, const Value& x );
>
> Where 'Value' is required to be convertible to one of the right-hand
> side arguments of an assignment to a range_value<Rng>::type.
>
> Does this look sensible to you?

I'm slightly against a template argument here as it means more code
being generated. I would rather see the conversion to happen before
the function is called. Would

   const typename range_value<Range>::type&

not work?

-Thorsten


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