Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 905
metalfox Avatar asked Mar 18 '26 13:03

metalfox


1 Answers

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.

like image 199
Yakk - Adam Nevraumont Avatar answered Mar 21 '26 08:03

Yakk - Adam Nevraumont