|
Boost : |
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-04-04 04:00:14
Mat Marcus skrev:
> On Wed, Apr 2, 2008 at 2:54 PM, Thorsten Ottosen
> <thorsten.ottosen_at_[hidden]> wrote:
>> Mat Marcus skrev:
>>
>>> In 1.34.1 we rely on boost::range::begin/end for const char* . That is
>>> we can invoke something like:
>>>
>>> const char* range= "foo";
>>> std::copy(boost::begin(range), boost::end(range), result);
>>>
>>> In 1.35.0, under MSVC 9.0, code similar to the above. Are there known
>>> issues with range::end(const char*) in 1.35.0 (e.g. no longer
>>> supported), or do I need to explore further?
>> There are a number of changes to boost.range. I guess they should be
>> written in the "updated libraries" section of the announcement. Is
>> it still possible to update that section, Beman?
>>
>> -Thorsten
>
> Could you please say a bit more about the rationale for the 1.35
> changes? I have been unable to use the 1.35.0 version of
> boost::begin/end/size on ranges due to failures of the type
> calulcation metacode. Instead I've replaced a number of instances of
> boost::size(some_range) with std::distance(boost::begin(some_range),
> boost::end(some_range)), since the use of - operationstogether with
> the current versions of begin/end causes deduction failures, etc.
First, let me enumerate the changes:
1. no default support for null-terminated char pointers
2. boost::end( T (&array)[N] ) always return array + N, also for string
literals
(these behaviors should be got by using as_literal())
3. boost_range_begin() is renamed range_begin(), and similar for
boost_range_end().
4. boost::size() requires random access and is guaranteed O(1),
boost::distance() has the old behavior
5. There is also some new naming of the metafunctions, but see the docs
for how it is
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk