Compare commits

..

7 Commits

Author SHA1 Message Date
Andrey Semashev
4b40364d6d Work around compilation errors on clang-10 through 12. 2024-10-11 01:04:21 +03:00
Andrey Semashev
7c55a6cef8 Marked output_proxy assignment as const.
This is also required for compliance with std::output_iterator concept.
2024-10-11 00:34:28 +03:00
Georgiy Guminov
1ea8087623 Check for compliance with output_iterator in function_output_iterator_test. 2024-10-11 00:29:20 +03:00
Andrey Semashev
e4eaeeac44 Make function_output_iterator compliant with std::output_iterator concept.
Fixes https://github.com/boostorg/iterator/issues/85.
Closes https://github.com/boostorg/iterator/pull/87.
2024-10-11 00:26:30 +03:00
Andrey Semashev
46ffe06b3d Removed MSVC-12 job from AppVeyor CI.
This compiler is no longer supported by Boost.SmartPtr that is
used in tests.
2024-10-11 00:21:46 +03:00
Andrey Semashev
8b83324682 Removed gcc 4.6 and 4.7 from GitHub Actions CI.
These compilers are not supported by Boost.SmartPtr and Boost.Optional,
which are used in tests.
2024-10-11 00:13:00 +03:00
René Ferdinand Rivera Morell
ce030ab2c3 Add support for modular build structure. (#84)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Remove not-needed reference to Conversion dependency.

* Add missing b2 testing module import.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
2024-08-19 01:22:08 +03:00
6 changed files with 61 additions and 29 deletions

View File

@@ -33,20 +33,6 @@ jobs:
matrix:
include:
# Linux, gcc
- toolset: gcc-4.6
cxxstd: "0x"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.6
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.7
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.7
- toolset: gcc-4.8
cxxstd: "11"
os: ubuntu-latest

View File

@@ -15,9 +15,6 @@ branches:
environment:
matrix:
- TOOLSET: msvc-12.0
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.0
CXXSTD: 14,latest
ADDRMD: 32,64

35
build.jam Normal file
View File

@@ -0,0 +1,35 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.2 ;
constant boost_dependencies :
/boost/assert//boost_assert
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/core//boost_core
/boost/detail//boost_detail
/boost/function_types//boost_function_types
/boost/fusion//boost_fusion
/boost/mpl//boost_mpl
/boost/optional//boost_optional
/boost/smart_ptr//boost_smart_ptr
/boost/static_assert//boost_static_assert
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility ;
project /boost/iterator
: common-requirements
<include>include
;
explicit
[ alias boost_iterator : : : : <library>$(boost_dependencies) ]
[ alias all : boost_iterator test ]
;
call-if : boost-library iterator
;

View File

@@ -11,6 +11,7 @@
#ifndef BOOST_ITERATOR_FUNCTION_OUTPUT_ITERATOR_HPP
#define BOOST_ITERATOR_FUNCTION_OUTPUT_ITERATOR_HPP
#include <cstddef>
#include <iterator>
#include <boost/config.hpp>
#include <boost/core/enable_if.hpp>
@@ -36,8 +37,8 @@ namespace iterators {
template <class T>
typename boost::disable_if_c<
boost::is_same< typename boost::remove_cv< T >::type, output_proxy >::value,
output_proxy&
>::type operator=(const T& value) {
output_proxy const&
>::type operator=(const T& value) const {
m_f(value);
return *this;
}
@@ -45,8 +46,8 @@ namespace iterators {
template <class T>
typename boost::disable_if_c<
boost::is_same< typename boost::remove_cv< typename boost::remove_reference< T >::type >::type, output_proxy >::value,
output_proxy&
>::type operator=(T&& value) {
output_proxy const&
>::type operator=(T&& value) const {
m_f(static_cast< T&& >(value));
return *this;
}
@@ -62,7 +63,7 @@ namespace iterators {
public:
typedef std::output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef std::ptrdiff_t difference_type;
typedef void pointer;
typedef void reference;

View File

@@ -2,6 +2,10 @@
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import testing ;
project : requirements <library>/boost/iterator//boost_iterator ;
test-suite iterator
:
# These first two tests will run last, and are expected to fail
@@ -22,9 +26,9 @@ test-suite iterator
[ run zip_iterator_test2_fusion_vector.cpp ]
[ run zip_iterator_test2_fusion_list.cpp ]
# [ run zip_iterator_test2_fusion_deque.cpp ] // See bug report for fusion https://svn.boost.org/trac/boost/ticket/11572
[ run zip_iterator_test_fusion.cpp ]
[ run zip_iterator_test_std_tuple.cpp ]
[ run zip_iterator_test_std_pair.cpp ]
[ run zip_iterator_test_fusion.cpp : : : <library>/boost/assign//boost_assign ]
[ run zip_iterator_test_std_tuple.cpp : : : <library>/boost/assign//boost_assign ]
[ run zip_iterator_test_std_pair.cpp : : : <library>/boost/assign//boost_assign ]
[ run is_iterator.cpp ]
@@ -61,10 +65,10 @@ test-suite iterator
[ compile-fail minimum_category_compile_fail.cpp ]
[ run next_prior_test.cpp ]
[ run advance_test.cpp ]
[ run distance_test.cpp ]
[ compile adl_test.cpp ]
[ compile range_distance_compat_test.cpp ]
[ run advance_test.cpp : : : <library>/boost/container//boost_container ]
[ run distance_test.cpp : : : <library>/boost/container//boost_container ]
[ compile adl_test.cpp : <library>/boost/array//boost_array ]
[ compile range_distance_compat_test.cpp : <library>/boost/range//boost_range ]
[ run shared_iterator_test.cpp ]
;

View File

@@ -8,6 +8,8 @@
#include <boost/core/lightweight_test.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <iterator>
namespace {
struct sum_func
@@ -57,5 +59,12 @@ int main()
}
#endif
#if defined(__cpp_lib_concepts) && ( __cpp_lib_concepts >= 202002L )
{
auto func = [](int) {};
static_assert(std::output_iterator< boost::iterators::function_output_iterator< decltype(func) >, int >);
}
#endif
return boost::report_errors();
}