183 Commits

Author SHA1 Message Date
Andrey Semashev
ae5d7d8c0c Added a CMake test. 2023-11-17 17:47:20 +03:00
Andrey Semashev
a9dabd3c65 Removed dependency on Boost.Conversion in tests.
This reduces the minimum supported compilers versions.
2023-11-17 04:25:29 +03:00
Andrey Semashev
85b542e1b6 Extracted is_iterator trait to a separate header.
Also, reworked is_iterator to be more robust against various corner cases
and added dedicated tests for the type trait.
2023-05-21 15:18:54 +03:00
Alexander Grund
e8fbd92a61 Use BOOST_STATIC_ASSERT instead of BOOST_MPL_ASSERT (#78)
The MPL version is slower to compile and `BOOST_STATIC_ASSERT` is
already used in some places. So unify that.

This also fixes `Wzero-as-null-pointer-constant` warnings, see https://github.com/boostorg/mpl/pull/75
2023-05-07 15:23:16 +03:00
Andrey Semashev
7c9b4296a1 Fixed accessing members of the dereferenced value after iterator post-increment.
The recent commit 5777e9944b broke code such as
(*it++).foo(), where the result of dereferencing would be convertible to
the value type but did not provide the members of the value type. To mitigate
this, return a reference to the value instead of a proxy object. This will only
work for non-writable iterators (and it didn't work for writable iterators
before either) because in that case a proxy is needed to be able to intercept
operator=.

Also fix a similar issue with (it++)->foo() by adding operator-> overloads
to the post-increment result proxies.

Added tests for the fixes.
2022-11-18 00:46:21 +03:00
Andrey Semashev
0a95636faf Added test for converting func_input_iter increment results to the iterator type. 2022-11-09 21:19:00 +03:00
Andrey Semashev
129245a985 Added tests for function_output_iterator. 2022-07-01 00:14:14 +03:00
Andrey Semashev
eb0d01126a Added support for int128 to counting_iterator. 2022-01-13 16:59:46 +03:00
Andrey Semashev
abe6fbfd4b Converted counting_iterator to rely on TypeTraits instead of MPL. 2022-01-13 16:57:52 +03:00
Andrey Semashev
1c6f85d4f9 Fixed a preprocessor condition. 2021-09-12 23:36:59 +03:00
Andrey Semashev
0a59f555ca Added libc++ 12 to the list of standard libs implementing C++20 std::ostream_iterator. 2021-09-12 22:52:55 +03:00
Andrey Semashev
18337e990b Disable zip_iterator test with std::tuple on gcc 4.4.
libstdc++ from gcc 4.4 has a broken std::tuple that fails to compile
a constructor from a compatible tuple:

/usr/include/c++/4.4/tuple: In constructor 'std::_Head_base<_Idx, _Head, false>::_Head_base(_UHead&&) [with _UHead = std::_Head_base<0ul, const int&, false>, long unsigned int _Idx = 0ul, _Head = int]':
/usr/include/c++/4.4/tuple:179:   instantiated from 'std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _UElements ...>&&) [with _UElements = const int&, double&, long unsigned int _Idx = 0ul, _Head = int, _Tail = double]'
/usr/include/c++/4.4/tuple:338:   instantiated from 'std::tuple<_T1, _T2>::tuple(std::tuple<_U1, _U2>&&) [with _U1 = const int&, _U2 = double&, _T1 = int, _T2 = double]'
libs/iterator/test/detail/zip_iterator_test_original.ipp:137:   instantiated from here
/usr/include/c++/4.4/tuple:94: error: cannot convert 'std::_Head_base<0ul, const int&, false>' to 'int' in initialization
2021-09-12 22:40:19 +03:00
Glen Fernandes
f4b47fd266 Switch from deprecated test to Lightweight Test 2021-06-07 22:03:32 -04:00
Casey Carter
32f4f4d086 MSVC also has C++20 output_iterator
Tell iterator_traits_test not to fail on MSVC when `std::output_iterator` has `difference_type` of `std::ptrdiff_t`.
2020-10-13 19:23:49 -07:00
Andrey Semashev
72f0ebe8d0 Adjusted the check for C++20 on gcc 10.
The compiler defines __cplusplus to a non-standard value less than 202002
in C++20 mode.
2020-05-24 00:29:51 +03:00
Andrey Semashev
d7ad43a925 Updated to support C++20 ostream_iterator::difference_type on gcc 10. 2020-05-23 19:57:54 +03:00
Andrey Semashev
5b18ae976e Updated code to use distance and iterator_traits from std. 2020-05-10 23:08:14 +03:00
Andrey Semashev
da8604615e Removed the use of deprecated header boost/detail/iterator.hpp 2020-05-10 23:02:42 +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
Andrey Semashev
80ec58bb3b Trim trailing spaces. 2020-03-04 01:06:45 +03:00
Andrey Semashev
c2929ea6c6 Updated to use boost/bind/bind.hpp to avoid warnings and compliance with C++20.
boost/bind.hpp emits warnings about deprecating global placeholder argument
keywords. C++20 removes std::bind1st/bind2nd, so replaced their usage with
boost::bind.
2020-03-04 01:02:52 +03:00
Andrey Semashev
4fe679bb0d Updated lightweight_test.hpp includes to the new location. 2020-03-04 00:52:58 +03:00
Andrey Semashev
3cc4107d01 Added a test for compatibility of boost::distance between Range and Iterator.
This functionality is used in core Boost components, so it is preferable
to test it in Boost.Iterator, even if it's already tested in Boost.Range,
to discover problems as early as possible.

The test verifies that boost::distance implemented in Boost.Range can invoke
boost::distance in Boost.Iterator (i.e. the function lookup succeeds).
2018-09-23 12:37:21 +03:00
morinmorin
194087e8ca Merge branch 'develop' into fix/unwanted_adl 2018-09-22 20:47:10 +09:00
morinmorin
b5edc8b64f Add test for ADL issues. 2018-09-22 20:44:29 +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
Peter Dimov
0013c5c4f0 Skip zip_iterator_test_std_pair on g++ in C++03 mode 2017-12-24 04:56:47 +02:00
Peter Dimov
386dbf1054 Skip zip_iterator_test_std_pair on msvc-9.0 and below 2017-12-24 04:38:07 +02:00
Peter Dimov
adecfd94f3 Use lightweight_test in shared_iterator_test.cpp 2017-12-23 23:45:59 +02:00
Peter Dimov
affe7e6d84 Add shared_iterator_test to test/Jamfile 2017-12-23 23:45:33 +02:00
Peter Dimov
91b392a478 Move test files to test/ 2017-12-23 22:05:35 +02:00
Peter Dimov
81faa161cf Add #include <boost/next_prior.hpp>; no longer in utility.hpp 2017-12-02 04:04:32 +02: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
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
479898d9d5 Remove unnecessary headers in test. 2017-09-06 19:41:24 +09: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
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
210633c08c Silenced warnings about signed/unsigned mismatch in comparisons. 2017-08-27 13:59:09 +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
a48de6a8b8 Added tests for next/prior to the Jamfile. Ported tests to lightweight_test.hpp. 2017-08-26 15:31:38 +03:00
Brian Minard
bab02bb82e Add test cases for std::reverse_iterator 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