963 Commits

Author SHA1 Message Date
Andrey Semashev
eb90ad7a99 Merge pull request #30 from morinmorin/port_rst_to_quickbook
Port rst docs changeset to quickbook
2017-08-28 15:56:05 +03:00
morinmorin
de07014e9a Port rst docs changeset to quickbook (230d47e).
Move difference_type from the Forward Traversal Iterator concept to
the Single Pass Traversal concept.
2017-08-28 20:47:09 +09:00
morinmorin
25dc5c6c9c Port rst docs changeset to quickbook (6368d38).
Fix base class for const_node_iterator.
2017-08-28 20:42:43 +09:00
morinmorin
048c3dfa72 Port rst docs changeset to quickbook (daac0f2).
The argument order is flipped in the documentation.
2017-08-28 20:40:47 +09:00
morinmorin
f7dfc36a9c Port rst docs changeset to quickbook (ad90dac).
UnaryFunction is treated as a const object, but the documentation was missing
the const qualification.
2017-08-28 20:39:10 +09:00
Andrey Semashev
c529399fb1 Reworked the test to avoid bogus warnings from gcc. 2017-08-27 17:48:47 +03:00
Andrey Semashev
6faa3a942b Merge branch 'develop' of github.com:boostorg/iterator into develop 2017-08-27 17:31:54 +03:00
Andrey Semashev
0c6b09ef6a Workaround MSVC 14.1 problem with template specialization partial ordering that caused compilation failure when next/prior is used with pointers. Added a test. 2017-08-27 17:31:34 +03:00
Andrey Semashev
83220e7aea Merge branch 'develop' 2017-08-27 14:02:11 +03:00
Andrey Semashev
991ea534ee Silenced warnings about signed/unsigned mismatch in comparisons. 2017-08-27 13:59:52 +03:00
Andrey Semashev
210633c08c Silenced warnings about signed/unsigned mismatch in comparisons. 2017-08-27 13:59:09 +03:00
Edward Diener
3275ee3c82 Updated examples to use unique_ptr when available rather than auto_ptr, which is being deprecated. 2017-08-26 15:04:47 -04:00
Andrey Semashev
a72deda3ac Merge branch 'develop' 2017-08-26 20:39:41 +03:00
Andrey Semashev
2b6b6bf8ad Silence warnings in tests about unused variables and local typedefs. 2017-08-26 20:39:26 +03:00
Marcel Raad
0107df44ab 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.
2017-08-26 20:23:14 +03:00
Andrey Semashev
011288c2c8 Merge branch 'develop' 2017-08-26 20:07:54 +03:00
Andrey Semashev
eaf1a48583 Added documentation for advance and distance. Various cleanup and fixes.
- Fixed multiple broken links to the documentation. Converted some of the
  links to internal references to the QuickBook documentation. Not all
  links converted because some of the QuickBook pages are not completely
  converted.
- Renamed utilities.qbk to type_traits.qbk and removed the part duplicated
  by concept_checking.qbk.
- Renamed traits.qbk to iterator_traits.qbk to better disambiguate with
  other type traits documented in type_traits.qbk.
- Converted some of the headings in iterator concepts to sections to be
  able to give those sections ids. This allows to reference those sections
  from other places in the documentation.
- In order to preserve the more compact pagination of the new sections
  (i.e. to have multiple sections on one page, like it was with headings)
  set chunk.section.depth=2 in the docs Jamfile.
2017-08-26 19:56:23 +03:00
Andrey Semashev
52fbe950ec Minor next/prior docs corrections to better fit the rest of the docs. 2017-08-26 17:48:38 +03:00
Andrey Semashev
6a672cecbd Replaced non-functional list syntax with direct wording. 2017-08-26 17:36:28 +03:00
Andrey Semashev
577203bee8 Merge branch 'develop' 2017-08-26 17:25:35 +03:00
Andrey Semashev
5f6ac9c020 Added next/prior documentation. 2017-08-26 16:27:55 +03:00
Andrey Semashev
a48de6a8b8 Added tests for next/prior to the Jamfile. Ported tests to lightweight_test.hpp. 2017-08-26 15:31:38 +03:00
Andrey Semashev
5f6fd2dec6 Use std::iterator_traits to detect iterators, when possible.
This allows next/prior to detect user's iterators that do not
define iterator_category nested type but specialize
std::iterator_traits instead.
2017-08-26 15:23:36 +03:00
Andrey Semashev
e3577e7687 Use Boost.Iterator to advance iterators.
By using Boost.Iterator we rely on the separate traversal category instead of
the standard iterator category to advance iterators efficiently. For instance,
this allows to advance transform iterators over a random access sequence
in constant time, despite that they are formally input iterators.

Also, std::reverse_iterator formally requires at least bidirectional iterator
as the underlying iterator type. Transform iterators from the example above
don't qualify, so potentially std::reverse_iterator could fail to compile.
2017-08-26 15:23:36 +03:00
Andrey Semashev
5ba36b063e Changed iterator_category nested type detection to work with MSVC and different versions of gcc. 2017-08-26 15:23:36 +03:00
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
ed027c2cce Merge branch 'develop'
# Conflicts:
#	include/boost/iterator/reverse_iterator.hpp
boost-1.65.1 boost-1.65.0
2017-07-17 12:03:38 -04: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