Commit Graph

985 Commits

Author SHA1 Message Date
Andrey Semashev
685b3fe855 Re-added executable permissions for scripts.
The executable bit was removed previously because the files have no extension
and were not considered as scripts by the search command.
2017-09-18 00:30:45 +03:00
Edward Diener
a653a39cf4 Removed executable tags. 2017-09-16 07:19:04 -04:00
morinmorin
c338572735 Fix usage of decltype-based result_of in transform_iterator.
Regardless of value categories of a transform_iterator object, its
dereference operator calls m_f as an lvalue. Thus, correct usage of
decltype-based result_of is result_of<const UnaryFunc&(...)>.
2017-09-16 18:01:03 +09:00
Andrey Semashev
07afd26ca2 Merge pull request #34 from morinmorin/fix_result_of_usage
Fix result_of usage
2017-09-11 23:44:36 +03:00
morinmorin
d058933767 Correct the result_of usage. 2017-09-12 02:54:50 +09:00
Andrey Semashev
e2f81e9b48 Silenced signed/unsigned mismatch warning. 2017-09-08 18:12:58 +03:00
Andrey Semashev
379200dfd1 Force result_of use decltype whenever possible to maximize testing of function input iterator with lambdas. 2017-09-08 18:12:02 +03:00
Andrey Semashev
a26314dfb9 Added a check for BOOST_RESULT_OF_USE_DECLTYPE in case if tests are run with forced use of decltype in result_of. 2017-09-07 18:51:36 +03:00
Andrey Semashev
e61592c553 Merge pull request #32 from morinmorin/clean_up_function_input_iterator
Clean up function_input_iterator
2017-09-07 18:46:07 +03:00
Andrey Semashev
a3751006db Merge pull request #33 from morinmorin/fix_lambda_test
Fix lambda test
2017-09-07 18:36:10 +03:00
morinmorin
40da532a4d Suppress signed-unsigned comparison warning. 2017-09-07 20:17:35 +09:00
morinmorin
7ce9f87954 Add more feature checks; lambda test needs decltype-based result_of. 2017-09-07 20:14:39 +09:00
morinmorin
553b9713ac Remove dead class template (i.e. function_reference_input_iterator).
Both make_function_input_iterator(function) and make...(&function)
do not depend on function_reference_input_iterator. Actually, passing a
function reference as a template argument to function_input_iterator is
not supported. Doing so results in compiler errors.
2017-09-06 23:12:18 +09:00
morinmorin
ba32745e80 Replace ugly BOOST_DEDUCED_TYPENAME with typename. 2017-09-06 19:50:15 +09:00
morinmorin
282b28e51f Use boost::addressof instead of &. 2017-09-06 19:47:55 +09:00
morinmorin
479898d9d5 Remove unnecessary headers in test. 2017-09-06 19:41:24 +09:00
Edward Diener
c1a375284d Merge pull request #31 from morinmorin/clean_up_test
Clean up function_input_iterator_test.cpp
2017-09-04 12:02:15 -04:00
morinmorin
24d2f58f98 Use lightweight_test.hpp instead of <cassert> 2017-09-05 00:32:15 +09:00
Andrey Semashev
25a91d5981 Silenced gcc warnings about unused parameters. 2017-09-01 20:51:07 +03:00
Andrey Semashev
9b78dc1006 Replaced vector::data() with &v[0] for compatibility with older compilers that don't provide this function. 2017-08-30 17:09:19 +03:00
Andrey Semashev
89ca2fd1ae Shortened internal ids of qbk sections regarding iterator concepts. 2017-08-28 21:48:24 +03:00
Andrey Semashev
79277b78d2 Added references to generator_iterator docs to rst and qbk docs. 2017-08-28 21:45:03 +03:00
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