Commit Graph

412 Commits

Author SHA1 Message Date
Andrey Semashev abe6fbfd4b Converted counting_iterator to rely on TypeTraits instead of MPL. 2022-01-13 16:57:52 +03:00
Andrey Semashev 7a200905dd Added an assignment operator to counting_iterator.
This should silence gcc warnings about deprecated implicit copy assignment
operator because of the explicitly defined copy constructor. Also, changed
constructor definitions to be defaulted when possible and added missing
includes.

Closes https://github.com/boostorg/iterator/pull/69.
2022-01-13 16:34:47 +03:00
joaquintides 6dfb175cef supressed spurious type-limits warning
See https://github.com/boostorg/iterator/pull/66 for details.
2021-08-31 19:19:57 +02:00
Andrey Semashev 9649d42392 Merge pull request #51 from Kojoley/add-deprecation-warning-for-boost-function_output_iterator
Add deprecation warning in `boost/function_output_iterator.hpp`
2020-05-02 02:01:07 +03:00
Edward Diener dc7bf5cc05 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 11:21:59 -04:00
Glen Fernandes fdcd8439c0 BOOST_ prefix include guard macro 2019-12-18 08:40:35 -05:00
Nikita Kniazev bfe2a004d2 Add deprecation warning in boost/function_output_iterator.hpp 2019-11-23 16:47:06 +03:00
Glen Fernandes 2af5a16539 Use use_default from Boost.Core
boost::use_default is now defined in Core for multiple Boost libraries.
2019-02-22 17:17:52 -05:00
Andrey Semashev bb1efd3370 Updated addressof.hpp include path. 2018-11-14 12:42:24 +03:00
Andrey Semashev 6ab148be01 Revert "Revert "Replace using-declarations with using-directives to avoid ADL issues.""
This reverts commit 06875a754d.

The suggested fix for build failures need to be applied to Boost.Range:

https://github.com/boostorg/range/pull/75
2018-09-23 12:28:03 +03:00
Andrey Semashev 06875a754d Revert "Replace using-declarations with using-directives to avoid ADL issues."
This reverts commit 44cee00831.

The commit reportedly broke building Boost and quickbook.

https://github.com/boostorg/iterator/commit/b844c8df530c474ec1856870b9b0de5f487b84d4#commitcomment-30603668
2018-09-22 18:46:36 +03:00
morinmorin 194087e8ca Merge branch 'develop' into fix/unwanted_adl 2018-09-22 20:47:10 +09:00
morinmorin 44cee00831 Replace using-declarations with using-directives to avoid ADL issues. 2018-09-22 20:20:59 +09:00
Daniela Engert e16f2de233 Inheriting std::iterator is deprecated in c++17.
Boost's iterator.hpp is deprecated, too. Therefore get rid of all of that and replace inheritance by lifting std::iterator's members into the derived class.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-12-27 09:32:51 +01:00
Andrey Semashev 8b5e92a0c4 Converted asserts in tests to tests using lightweight_test.hpp. 2017-10-02 01:26:39 +03:00
Andrey Semashev a36ed0f35d Replaced type_traits.hpp with more fine-grained includes. Replaced assert with BOOST_ASSERT. 2017-10-02 01:18:17 +03:00
Andrey Semashev 0a08203107 Replaced type_traits.hpp with more fine grained includes.
This should work around compilation failures on gcc 4.6, which apparently
cannot handle all headers in Boost.TypeTraits.
2017-09-30 15:56:53 +03:00
Andrey Semashev 38ef552209 Add the new path to the header to the comment. 2017-09-18 01:50:55 +03:00
Andrey Semashev a85dfaa7f2 Added a forwarding header for function_output_iterator.hpp 2017-09-18 01:43:24 +03:00
Andrey Semashev 2af60e066d Move function_output_iterator.hpp into the iterator directory. 2017-09-18 01:39:00 +03: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
morinmorin d058933767 Correct the result_of usage. 2017-09-12 02:54:50 +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
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 2b6b6bf8ad Silence warnings in tests about unused variables and local typedefs. 2017-08-26 20:39:26 +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
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
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 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
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
Andrey Semashev 26ee5ba754 Remove dependency on boost::prior. 2017-07-09 18:31:06 +03:00
morinmorin 663a30f659 Implement BoostIteratorTraversalConcepts-aware boost::advance/distance 2017-06-29 22:06:12 +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 89d3ec7662 Add inclusion of config.hpp 2016-12-17 19:32:52 -05:00
nekko1119 c09c8ca2b2 Support lambda expressions in function_input_iterator 2015-12-28 02:45:49 +09: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 2283f084d9 Merge pull request #2 from Flast/pr/zip_iterator/fusionize
Fusion based zip_iterator, close #7526
2015-08-23 23:37:38 -04:00
Edward Diener b62dc6ba9d Remove unneeded header file for undefines. 2015-05-22 00:54:44 -04:00
Edward Diener 0dbbb61bec Put back MPL auxiliary lambda support. 2015-05-21 23:15:31 -04:00
Edward Diener 2de2111db2 Remove dependency on deprecated type_traits headers. 2015-05-21 23:14:42 -04:00
Edward Diener db04fafe21 Merge pull request #12 from Lastique/patch-1
Remove unused pure_traversal_tag import into boost::iterators::detail
2015-05-21 16:52:07 -04:00