Search code examples
c++rangestdstl-algorithmrange-v3

Ranges TS breaking changes?


It is said that the injection of the Ranges TS into the std namespace would cause a number of breaking changes to the standard library (e.g. this link). Does anybody know what those changes are?


Solution

  • From N4569 Annex B (as linked by @Holt in the comments above):

    • Algorithm Return Types -- modified to include the end iterator

    • Stronger Constraints -- algorithms that used to require just < now require all comparison operators

    • Constrained Functional Objects -- Constraints added to std::less's type and the like.

    • Iterators and Default-Constructibility -- Ranges_v3 assumes iterators can be default constructed (in a useful way). This is not currently required.

    • iterator_traits cannot be specialized -- in Range_v3, it is an alias template.

    • N3351 -- it is also incompatible with the N3351 proposal in a number of ways, which I won't get into here.

    This is just a summary. Follow the link to the paper or find it for more details.