Brian Silverman | 598d029 | 2018-08-04 23:56:47 -0700 | [diff] [blame^] | 1 | [/ |
| 2 | Copyright 2010 Neil Groves |
| 3 | Distributed under the Boost Software License, Version 1.0. |
| 4 | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | /] |
| 6 | [section:upgrade Upgrade version of Boost.Range] |
| 7 | |
| 8 | [section:upgrade_from_1_55 Upgrade from version 1.55] |
| 9 | # __iterator_range__ is now implemented by implementing the member functions |
| 10 | `size()`, `operator[]` via inheritance of base-classes specialized by the |
| 11 | traversal type of the underlying iterator. This is normally requires no |
| 12 | alteration of code. It does mean that types that derive from iterator_range may |
| 13 | need to prefix `this->` to the various member functions. Additionally it has |
| 14 | been noted that some calling code was relying on member functions such as |
| 15 | `size()` being present despite the underlying iterators not being random-access |
| 16 | due to `iterator_reference<Iter>::type` not being a reference. The suggested |
| 17 | refactoring is to use `boost::size(rng)`. |
| 18 | # The undocumented __iterator_range__ `pop_front()` has been deprecated and is |
| 19 | replaced by `drop_front(). Similarly `pop_back()` has been replaced by |
| 20 | `drop_back()`. |
| 21 | |
| 22 | [endsect] |
| 23 | |
| 24 | [section:upgrade_from_1_49 Upgrade from version 1.49] |
| 25 | |
| 26 | # __size__ now returns the type Rng::size_type if the range has size_type; |
| 27 | otherwise range_size<Rng>::type is used. This is the distance type promoted to |
| 28 | an unsigned type. |
| 29 | |
| 30 | [endsect] |
| 31 | |
| 32 | [section:upgrade_from_1_45 Upgrade from version 1.45] |
| 33 | |
| 34 | # __size__ in addition to supporting __random_access_range__ now also supports extensibility via calls to the unqualified `range_calculate_size(rng)` function. |
| 35 | # __range_adaptors_strided__ now in addition to working with any RandomAccessRange additionally works for any SinglePassRange for which `boost::size(rng)` is valid. |
| 36 | # __range_adaptors_strided__ no longer requires `distance(rng) % stride_size == 0` or `stride_size < distance(rng)` |
| 37 | |
| 38 | [endsect] |
| 39 | |
| 40 | [section:upgrade_from_1_42 Upgrade from version 1.42] |
| 41 | |
| 42 | New features: |
| 43 | |
| 44 | # __range_adaptors__ |
| 45 | # __range_algorithms__ |
| 46 | |
| 47 | Removed: |
| 48 | |
| 49 | # `iterator_range` no longer has a `is_singular` member function. The singularity restrictions have been removed from the `iterator_range` class since this added restrictions to ranges of iterators whose default constructors were not singular. Previously the `is_singular` member function always returned `false` in release build configurations, hence it is not anticipated that this interface change will produce difficulty in upgrading. |
| 50 | |
| 51 | |
| 52 | [endsect] |
| 53 | |
| 54 | [section:upgrade_from_1_34 Upgrade from version 1.34] |
| 55 | |
| 56 | Boost version 1.35 introduced some larger refactorings of the library: |
| 57 | |
| 58 | # Direct support for character arrays was abandoned in favor of uniform treatment of all arrays. Instead string algorithms can use the new function __as_literal__`()`. |
| 59 | # __size__ now requires a __random_access_range__. The old behavior is provided as __distance__`()`. |
| 60 | # `range_size<T>::type` has been completely removed in favor of `range_difference<T>::type` |
| 61 | # `boost_range_begin()` and `boost_range_end()` have been renamed `range_begin()` and `range_end()` respectively. |
| 62 | # `range_result_iterator<T>::type` and `range_reverse_result_iterator<T>::type` have been renamed `range_iterator<T>::type` and `range_reverse_iterator<T>::type`. |
| 63 | # The procedure that makes a custom type work with the library has been greatly simplified. See __extending_for_udts__ for details. |
| 64 | |
| 65 | [endsect] |
| 66 | |
| 67 | [endsect] |