Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] invalid initialization of non-const type with adaptors
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-05-11 10:18:18


AMDG

Thorsten Ottosen wrote:
> 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?

The standard has

template<class ForwardIterator, class T>
void fill(ForwardIterator first, ForwardIterator last, const T& value);

I don't think we should do it differently.

In Christ,
Steven Watanabe


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