Commit Graph
878 Commits
Author SHA1 Message Date
Brian Minard bab02bb82e Add test cases for std::reverse_iterator 2017-08-26 15:23:36 +03:00
Andrey Semashev d251a6f515 Reworked iterator handling in next/prior helpers.
The new implementation tries to detect if the incremented/decremented type
is an iterator first and if not falls back to operator probing. This way
iterators that are not SFINAE-friendly (i.e. unconditionally define
arithmetic operators regardless of the iterator category) are still treated
as iterators through std::advance and do not fail the compilation.

The iterator detection is based on probing for the nested iterator_category
type that is expected to be present in class-type iterators. This heuristic
is not flawless since iterators are not required to defined this type.
User-defined iterators may not have it and instead specialize
std::iterator_traits. This use case is not covered by the current implementation
and will likely fail to compile. With C++17 SFINAE-friendly std::iterator_traits
this can be fixed, but currently Boost.Config lacks the macro to detect
availability of this feature. Support for it can be added by a later commit.

Also simplified boost::prior for iterators, removing the possibility of
integer overflow caused by negation of the distance value.
2017-08-26 15:23:36 +03:00
Andrey Semashev 9d054b25ce Reworked next() and prior() taking the distance arguments.
The new version should provide the expected behavior in the case (prior(v.end(), v.size()) == v.begin()). It should also work with integers now, as was originally intended by David Abrahams. Added tests to verify these new use cases.
2017-08-26 15:23:36 +03:00
Andrey Semashev d1b22ac8e8 Remove executable bit from the file. 2017-08-26 15:23:36 +03:00
John Maddock abe77db3e0 Added Daryle Walker's copyrights as requested.
[SVN r24481]
2017-08-26 15:23:36 +03:00
John Maddock 398819237e Removed Boost.org copyrights and replaced with originating authors copyright instead.
[SVN r24372]
2017-08-26 15:23:36 +03:00
Dave Abrahams a4bacb5077 Extended next/prior using patch from Daniel Walker (Daniel.Walker-at-bowneglobal.com)
[SVN r21382]
2017-08-26 15:23:36 +03:00
Aleksey Gurtovoy 5ba5f2c2d4 split utility.hpp header
[SVN r17472]
2017-08-26 15:23:36 +03:00
Edward Diener 6c1b356be1 Merge pull request #29 from morinmorin/add_doc_for_advance_and_distance
Add doc for advance and distance
2017-07-23 12:38:00 -04:00
morinmorin bfcf52ace6 Add links to advance and distance 2017-07-23 23:49:30 +09:00
morinmorin e2c927628c Add documentation for advance and distance 2017-07-23 23:46:26 +09:00
Edward Diener 4791425000 Merge pull request #27 from Lastique/advance_generic_distance
Use a separate template parameter for distance in advance().
2017-07-12 12:20:34 -04:00
Edward Diener b7e7e83a11 Merge pull request #28 from Lastique/patch-2
Avoid integer overflow on negating distance in reverse_iterator
2017-07-12 12:17:22 -04:00
Andrey Semashev c148962bd9 Avoid integer overflow on negating distance 2017-07-10 14:57:40 +03:00
Andrey Semashev 5bfbfb7716 Use a separate template parameter for distance in advance().
This follows std::advance interface and also allows to use distance types
other than iterator's difference_type (if the iterator supports that).
2017-07-10 14:51:07 +03:00
Edward Diener af5f6e49e0 Merge pull request #26 from Lastique/patch-2
Remove dependency on boost::prior.
2017-07-09 11:59:18 -04:00
Andrey Semashev 26ee5ba754 Remove dependency on boost::prior. 2017-07-09 18:31:06 +03:00
Edward Diener 67a2336cf4 Merge pull request #25 from morinmorin/add_readable_iterator_tests
Add more ReabableIterator tests for advance/distance
2017-07-09 11:14:04 -04:00
morinmorin 029277f3ed Add more tests for ReabableIterator 2017-07-08 13:30:28 +09:00
Edward Diener 847b2a1be3 Added Travis testing 2017-06-30 20:29:49 -04:00
Edward Diener 18268069d9 Merge pull request #24 from morinmorin/add_advance_and_distance
Add boost::advance and boost::distance
2017-06-29 15:02:38 -04:00
morinmorin bb54ee7900 Update Jamfile.v2 for new tests 2017-06-29 22:49:05 +09:00
morinmorin d5b67c7fab Add tests for boost::advance/distance 2017-06-29 22:09:26 +09:00
morinmorin 663a30f659 Implement BoostIteratorTraversalConcepts-aware boost::advance/distance 2017-06-29 22:06:12 +09:00
Edward Diener cccbd8c6aa Test needs both std::typle support and variadic template support. 2017-04-08 16:53:02 -04:00
Edward Diener d6cfed4b20 Merge pull request #23 from morinmorin/testcase_for_trac_12895
Testcase for PR #22 (trac ticket 12895)
2017-03-15 12:19:13 -04:00
Edward Diener 514ac53326 Merge pull request #22 from Dani-Hub/develop
Bug fix for ticket #12895: Apply remove_reference before remove_cv
2017-03-15 12:12:12 -04:00
morinmorin ca3b7505ce Add a testcase for trac ticket 12895 2017-03-15 20:41:24 +09:00
drgler d7c8cccd64 Bug fix for ticket #12895: Apply remove_reference before remove_cv 2017-03-14 20:45:48 +01:00
Edward Diener 760da84f9c Merge branch 'develop' of https://github.com/eldiener/iterator into nekko1119-support-lambda-expression 2016-12-17 19:34:48 -05:00
Edward Diener 89d3ec7662 Add inclusion of config.hpp 2016-12-17 19:32:52 -05:00
Edward Diener c86db2ec8a Merge branch 'support-lambda-expression' of https://github.com/nekko1119/iterator into nekko1119-support-lambda-expression 2016-12-16 04:22:44 -05:00
Edward Diener 0a18cfb255 Merge pull request #21 from Wilson-N/feature-bug-fix-8010
Remove incorrect documentation stating iterator_facade and iterator_a…
2016-12-01 08:53:05 -05:00
Edward Diener 11e3715f37 Updated to use unique_ptr instead of auto_ptr when appropriate. Removed unnecessary structs. 2016-11-07 14:01:19 -05:00
Rene Rivera 53e8ac401f Add, and update, documentation build targets. 2016-10-07 23:07:34 -05:00
Nathan Wilson 434818cce7 Remove incorrect documentation stating iterator_facade and iterator_adapter had
been accepted into the TR1.

Fixes #8010
2016-01-27 22:22:55 -06:00
nekko1119 c09c8ca2b2 Support lambda expressions in function_input_iterator 2015-12-28 02:45:49 +09:00
Edward Diener 711a0232f8 Merge pull request #19 from MarcelRaad/patch-1
Fix test compilation
2015-09-22 18:03:05 -07:00
Marcel Raad 443dfb9901 Fix test compilation
boost/iterator.hpp was implicitly dragged in via boost/operators.hpp, from which it was removed in https://github.com/boostorg/utility/commit/cb6500161b682a66438604e75ab901c46e42430d. It's not needed anyway, all it does is map boost::iterator to std::iterator.
2015-09-22 00:33:50 +02:00
Edward Diener c734f3bfa3 Merge pull request #18 from MarcelRaad/remove-deprecated-includes
Remove deprecated includes
2015-09-14 12:06:20 -04:00
Marcel Raad b2b9ab1568 Remove unused deprecated includes
A comment in boost/iterator.hpp and boost/detail/iterator.hpp mentions that
the files are obsolete and will be deprecated. All they do is pull some types
from namespace std into namespace boost.
2015-09-14 14:28:38 +02:00
Edward Diener 8b23342969 Merge pull request #17 from boostorg/revert-16-remove-deprecated-includes
Revert "Remove unused deprecated includes"
2015-09-14 08:17:35 -04:00
Edward Diener 922296f8c8 Revert "Remove unused deprecated includes" 2015-09-14 08:16:43 -04:00
Edward Diener c9a91a1fba Merge pull request #16 from MarcelRaad/remove-deprecated-includes
Remove unused deprecated includes
2015-09-14 08:08:53 -04:00
Marcel Raad 80e6f4a3bf Remove unused deprecated includes
A comment in boost/iterator.hpp and boost/detail/iterator.hpp mentions that
the files are obsolete and will be deprecated. All they do is pull some types
from namespace std into namespace boost.
2015-09-14 10:57:16 +02:00
Edward Diener 398bbe63bb Updated quickbook docs just fix problems exposed by upgrading to quickbook 1.6 2015-08-24 12:49:59 -04:00
Edward Diener 87d82527b1 Updated zip iterator abstract adds information about the iterator 'tuple'. 2015-08-24 07:18:03 -04:00
Edward Diener b9448b5fae Updated with an explanation of the new 'tuple' type for a zip_iterator based on Boost fusion sequences. 2015-08-24 00:24:09 -04:00
Edward Diener 76519ea4a7 Merge branch 'Flast-pr/zip_iterator/fusionize' into develop 2015-08-23 23:56:13 -04:00
Edward Diener 878812c42f More tests with fusion sequence as tuple 2015-08-23 23:46:44 -04:00