Rename the library stl_interfaces; iterator_facade.hpp ->

iterator_interface.hpp.
This commit is contained in:
Zach Laine
2019-08-12 18:07:23 -05:00
parent 542f9debc5
commit 97ca350172
26 changed files with 175 additions and 175 deletions

View File

@@ -54,18 +54,18 @@ include(dependencies)
##################################################
# iterator_facade library
# stl_interfaces library
##################################################
add_library(iterator_facade INTERFACE)
add_library(stl_interfaces INTERFACE)
target_include_directories(iterator_facade INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(iterator_facade INTERFACE boost)
target_include_directories(stl_interfaces INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(stl_interfaces INTERFACE boost)
if (link_flags)
target_link_libraries(iterator_facade INTERFACE ${link_flags})
target_compile_options(iterator_facade INTERFACE ${compile_flags})
target_link_libraries(stl_interfaces INTERFACE ${link_flags})
target_compile_options(stl_interfaces INTERFACE ${compile_flags})
endif ()
if (NOT MSVC)
target_compile_options(iterator_facade INTERFACE -Wall)
target_compile_options(stl_interfaces INTERFACE -Wall)
endif ()

View File

@@ -1,10 +1,12 @@
# iterator_facade
# stl_interfaces
An updated C++20-friendly version of the iterator_facade part of
Boost.Iterator, targeting standardization. This library requires at least
C++14.
An updated C++20-friendly version of the `iterator_facade` part of
Boost.Iterator (now called `iterator_interface`); a pre-C++20 version of
C++20's `view_interface`; and a new template called `container_interface`,
meant to aid the creation of new containers; all targeting standardization.
This library requires at least C++14.
In short, if you need to write an iterator, iterator_facade turns this:
In short, if you need to write an iterator, iterator_iterface turns this:
```c++
struct repeated_chars_iterator
@@ -140,11 +142,11 @@ In short, if you need to write an iterator, iterator_facade turns this:
into this:
```c++
struct repeated_chars_iterator : boost::iterator_facade::iterator_facade<
struct repeated_chars_iterator : boost::stl_interfaces::iterator_interface<
repeated_chars_iterator,
std::random_access_iterator_tag,
char,
char const>
char>
{
constexpr repeated_chars_iterator() noexcept :
first_(nullptr),
@@ -158,28 +160,28 @@ struct repeated_chars_iterator : boost::iterator_facade::iterator_facade<
n_(n)
{}
private:
friend boost::iterator_facade::access;
constexpr char const dereference() const noexcept
constexpr char operator*() const noexcept { return first_[n_ % size_]; }
constexpr repeated_chars_iterator & operator+=(std::ptrdiff_t i) noexcept
{
return first_[n_ % size_];
n_ += i;
return *this;
}
constexpr void advance(std::ptrdiff_t i) noexcept { n_ += i; }
constexpr auto compare(repeated_chars_iterator other) const noexcept
constexpr auto operator-(repeated_chars_iterator other) const noexcept
{
return n_ - other.n_;
}
private:
char const * first_;
difference_type size_;
difference_type n_;
};
```
If you don't ever write iterators, this is not for you.
If you don't ever write iterators, range views, or containers, this is not for you.
Online docs: https://tzlaine.github.io/iterator_facade.
Online docs: https://tzlaine.github.io/stl_interfaces.
[![Build Status](https://travis-ci.org/tzlaine/iterator_facade.svg?branch=master)](https://travis-ci.org/tzlaine/iterator_facade)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/tzlaine/iterator_facade?branch=master&svg=true)](https://ci.appveyor.com/project/tzlaine/iterator_facade)
[![Build Status](https://travis-ci.org/tzlaine/stl_interfaces.svg?branch=master)](https://travis-ci.org/tzlaine/stl_interfaces)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/tzlaine/stl_interfaces?branch=master&svg=true)](https://ci.appveyor.com/project/tzlaine/stl_interfaces)
[![License](https://img.shields.io/badge/license-boost-brightgreen.svg)](LICENSE_1_0.txt)

View File

@@ -16,14 +16,14 @@ rule run_doxygen ( files * : name : expand ? )
expand ?= <doxygen:param>EXPAND_ONLY_PREDEF=YES ;
doxygen iterator_facade_reference
doxygen stl_interfaces_reference
:
$(files)
:
<doxygen:param>EXTRACT_ALL=YES
# note that there is no detail::unspecified -- this is a hack to get all
# the SFINAE code out of the API docs.
<doxygen:param>"PREDEFINED=\"BOOST_ITERATOR_FACADE_DOXYGEN=1\" \\
<doxygen:param>"PREDEFINED=\"BOOST_STL_INTERFACES_DOXYGEN=1\" \\
\"enable_if=detail::unspecified\""
<doxygen:param>HIDE_UNDOC_MEMBERS=NO
<doxygen:param>EXTRACT_PRIVATE=NO
@@ -37,21 +37,21 @@ doxygen iterator_facade_reference
}
run_doxygen [ glob ../include/boost/iterator_facade/*.hpp ] : "Reference" ;
run_doxygen [ glob ../include/boost/stl_interfaces/*.hpp ] : "Reference" ;
xml iterator_facade
xml stl_interfaces
:
iterator_facade.qbk
stl_interfaces.qbk
;
boostbook standalone
:
iterator_facade
stl_interfaces
:
<dependency>css
<dependency>images
<dependency>iterator_facade_reference
<dependency>stl_interfaces_reference
# HTML options first:
# Use graphics not text for navigation:
@@ -93,7 +93,7 @@ boostbook standalone
<auto-index>on
<auto-index-verbose>on
<auto-index-internal>on
<auto-index-script>iterator_facade.idx
<auto-index-script>stl_interfaces.idx
<quickbook-define>enable_index
<auto-index-prefix>..
<xsl:param>index.on.type=1

View File

@@ -151,7 +151,7 @@ Ah, that's better. Both of these definitions for `repeated_chars_iterator`
have the same semantics and performance profile. It's just a lot less code to
write the second one, and writing the second one is more novice-friendly.
[note _Facade_'s `iterator_interface` implements iterators that model the
[note _IFaces_'s `iterator_interface` implements iterators that model the
C++20 iterator concepts.]
[endsect]

View File

@@ -1,3 +0,0 @@
!scan-path "include/boost/iterator_facade" ".*\.hpp" true
!scan-path "example" ".*\.cpp"

3
doc/stl_interfaces.idx Normal file
View File

@@ -0,0 +1,3 @@
!scan-path "include/boost/stl_interfaces" ".*\.hpp" true
!scan-path "example" ".*\.cpp"

View File

@@ -3,13 +3,13 @@
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[library Boost.IteratorFacade (Proposed)
[library Boost.STLInterfaces (Proposed)
[quickbook 1.3]
[authors [Laine, Zach]]
[copyright 2019 T. Zachary Laine]
[category template]
[id iterator_facade]
[dirname iterator_facade]
[id stl_interfaces]
[dirname stl_interfaces]
[purpose
A string and rope library targeting standardization.
]
@@ -42,11 +42,11 @@
[/ Links ]
[def _Facade_ Boost.IteratorFacade]
[def _IFaces_ Boost.STLInterfaces]
[def _iter_iface_ [classref boost::iterator_interface::iterator_interface `iterator_interface`]]
[def _concept_m_ [macroref BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT]]
[def _traits_m_ [macroref BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS]]
[def _concept_m_ [macroref BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT]]
[def _traits_m_ [macroref BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS]]
[def _CRTP_ [@https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern CRTP]]
[def _Iterator_ [@https://www.boost.org/doc/libs/release/libs/iterator/doc/index.html Boost.Iterator]]
@@ -59,14 +59,14 @@
[section Compiler Support]
_Facade_ is written against the C++14 standard. It is targetting
_IFaces_ is written against the C++14 standard. It is targetting
standardization, and the changes required to make it C++11-compatible were
considered too great.
_Facade_ should work with any conforming C++14 compiler.
_IFaces_ should work with any conforming C++14 compiler.
[endsect]
[xinclude iterator_facade_reference.xml]
[xinclude stl_interfaces_reference.xml]
[include rationale.qbk]

View File

@@ -250,9 +250,9 @@ Here's how we might use the forward iterator we just defined:
[heading Checking Your Work]
_Facade_ is able to check that some of the code that you write is compatible
_IFaces_ is able to check that some of the code that you write is compatible
with the concept for the iterator you're writing. It cannot check everything.
For instance, _Facade_ does not know if your derived type includes a default
For instance, _IFaces_ does not know if your derived type includes a default
constructor, which is required by all the iterators. In particular,
_iter_iface_ cannot `static_assert` on the wellformedness of `Derived()`,
since `Derived` is an incomplete type within the body of _iter_iface_

View File

@@ -8,7 +8,7 @@ add_custom_target(run_examples COMMAND ${CMAKE_CTEST_COMMAND} -VV -C ${CMAKE_CFG
macro(add_sample name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name} iterator_facade)
target_link_libraries(${name} stl_interfaces)
set_property(TARGET ${name} PROPERTY CXX_STANDARD ${CXX_STD})
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
if (clang_on_linux)

View File

@@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[ back_insert_iterator
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <algorithm>
#include <vector>
@@ -16,9 +16,9 @@
// push_back() on that container when it is written to, just like
// std::back_insert_iterator. This is not a lot less code to write than the
// implementation of std::back_insert_iterator, but it demonstrates that
// iterator_facade is flexible enough to handle this odd kind of iterator.
// iterator_interface is flexible enough to handle this odd kind of iterator.
template<typename Container>
struct back_insert_iterator : boost::iterator_facade::iterator_interface<
struct back_insert_iterator : boost::stl_interfaces::iterator_interface<
back_insert_iterator<Container>,
std::output_iterator_tag,
typename Container::value_type,
@@ -50,7 +50,7 @@ struct back_insert_iterator : boost::iterator_facade::iterator_interface<
// nowhere to go in next(). Do nothing.
back_insert_iterator & operator++() { return *this; }
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
back_insert_iterator<Container>,
std::output_iterator_tag,
typename Container::value_type,

View File

@@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[ interoperability
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <algorithm>
#include <array>
@@ -16,7 +16,7 @@
// template parameter allows us easily to define const and non-const iterators
// from the same template.
template<typename ValueType>
struct random_access_iterator : boost::iterator_facade::iterator_interface<
struct random_access_iterator : boost::stl_interfaces::iterator_interface<
random_access_iterator<ValueType>,
std::random_access_iterator_tag,
ValueType>

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <algorithm>
#include <array>
@@ -24,7 +24,7 @@ struct node
//[ node_iterator_class_head
template<typename T>
struct node_iterator
: boost::iterator_facade::
: boost::stl_interfaces::
iterator_interface<node_iterator<T>, std::forward_iterator_tag, T>
//]
{
@@ -48,7 +48,7 @@ struct node_iterator
//]
//[ node_iterator_using_declaration
using base_type = boost::iterator_facade::
using base_type = boost::stl_interfaces::
iterator_interface<node_iterator<T>, std::forward_iterator_tag, T>;
using base_type::operator++;
//]
@@ -60,8 +60,7 @@ private:
//[ node_iterator_concept_check Equivalent to
// static_assert(std::forward_iterator<node_iterator>, ""), or nothing in
// C++17 and earlier.
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
node_iterator, std::forward_iterator)
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(node_iterator, std::forward_iterator)
//]

View File

@@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[ random_access_iterator
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <algorithm>
#include <array>
@@ -13,9 +13,9 @@
// This is a minimal random access iterator. It uses default template
// parameters for most iterator_facade template parameters.
// parameters for most stl_interfaces template parameters.
struct simple_random_access_iterator
: boost::iterator_facade::iterator_interface<
: boost::stl_interfaces::iterator_interface<
simple_random_access_iterator,
std::random_access_iterator_tag,
int>

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <string>
@@ -11,7 +11,7 @@
//[ repeated_chars_iterator
struct repeated_chars_iterator : boost::iterator_facade::iterator_interface<
struct repeated_chars_iterator : boost::stl_interfaces::iterator_interface<
repeated_chars_iterator,
std::random_access_iterator_tag,
char,

View File

@@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[ reverse_iterator
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <algorithm>
#include <list>
@@ -20,7 +20,7 @@
// the basis operations that might be needed.
template<typename BidiIter>
struct reverse_iterator
: boost::iterator_facade::iterator_interface<
: boost::stl_interfaces::iterator_interface<
reverse_iterator<BidiIter>,
#if 201703L < __cplusplus && defined(__cpp_lib_ranges)
typename std::iterator_traits<BidiIter>::iterator_concept,

View File

@@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[ zip_proxy_iterator
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <algorithm>
#include <array>
@@ -18,7 +18,7 @@
// iterator writable, it needs to have a reference type that is not actually a
// reference -- the reference type is a pair of references, std::tuple<int &,
// int &>.
struct zip_iterator : boost::iterator_facade::proxy_iterator_interface<
struct zip_iterator : boost::stl_interfaces::proxy_iterator_interface<
zip_iterator,
std::random_access_iterator_tag,
std::tuple<int, int>,

View File

@@ -3,13 +3,13 @@
// 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)
#ifndef BOOST_ITERATOR_FACADE_CONTAINER_INTERFACE_HPP
#define BOOST_ITERATOR_FACADE_CONTAINER_INTERFACE_HPP
#ifndef BOOST_STL_INTERFACES_CONTAINER_INTERFACE_HPP
#define BOOST_STL_INTERFACES_CONTAINER_INTERFACE_HPP
#include <boost/iterator_facade/fwd.hpp>
#include <boost/stl_interfaces/fwd.hpp>
namespace boost { namespace iterator_facade {
namespace boost { namespace stl_interfaces {
namespace detail {
template<typename T, typename = void>

View File

@@ -3,22 +3,22 @@
// 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)
#ifndef BOOST_ITERATOR_FACADE_FWD_HPP
#define BOOST_ITERATOR_FACADE_FWD_HPP
#ifndef BOOST_STL_INTERFACES_FWD_HPP
#define BOOST_STL_INTERFACES_FWD_HPP
#ifndef BOOST_ITERATOR_FACADE_DOXYGEN
#ifndef BOOST_STL_INTERFACES_DOXYGEN
#if defined(_MSC_VER) || defined(__GNUC__) && __GNUC__ < 8
#define BOOST_ITERATOR_FACADE_HIDDEN_FRIEND_CONSTEXPR
#define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR
#else
#define BOOST_ITERATOR_FACADE_HIDDEN_FRIEND_CONSTEXPR constexpr
#define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR constexpr
#endif
#endif
namespace boost { namespace iterator_facade {
namespace boost { namespace stl_interfaces {
/** A tag-type that may be passed to `view_interface` and
`container_interface` to indicate that the underlying data have a

View File

@@ -3,23 +3,23 @@
// 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)
#ifndef BOOST_ITERATOR_FACADE_ITERATOR_FACADE_HPP
#define BOOST_ITERATOR_FACADE_ITERATOR_FACADE_HPP
#ifndef BOOST_STL_INTERFACES_ITERATOR_INTERFACE_HPP
#define BOOST_STL_INTERFACES_ITERATOR_INTERFACE_HPP
#include <boost/iterator_facade/fwd.hpp>
#include <boost/stl_interfaces/fwd.hpp>
#include <utility>
#include <iterator>
#include <type_traits>
namespace boost { namespace iterator_facade {
namespace boost { namespace stl_interfaces {
/** The return type of `operator->()` in a proxy iterator.
This template is used as the default `Pointer` template parameter in
the `proxy_iterator_facade` template alias. Note that the use of this
template implies a copy or move of the underlying object of type
the `proxy_iterator_interface` template alias. Note that the use of
this template implies a copy or move of the underlying object of type
`T`. */
template<typename T>
struct proxy_arrow_result
@@ -191,7 +191,7 @@ namespace boost { namespace iterator_facade {
retval += i;
return retval;
}
friend BOOST_ITERATOR_FACADE_HIDDEN_FRIEND_CONSTEXPR Derived
friend BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR Derived
operator+(difference_type i, Derived it) noexcept(noexcept(it + i))
{
return it + i;
@@ -227,7 +227,7 @@ namespace boost { namespace iterator_facade {
return derived();
}
friend BOOST_ITERATOR_FACADE_HIDDEN_FRIEND_CONSTEXPR Derived operator-(
friend BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR Derived operator-(
Derived it,
difference_type i) noexcept(noexcept(Derived(it), it += -i))
{
@@ -354,47 +354,46 @@ namespace boost { namespace iterator_facade {
}}
#ifdef BOOST_ITERATOR_FACADE_DOXYGEN
#ifdef BOOST_STL_INTERFACES_DOXYGEN
/** `static_asserts` that iterator type `iter` models concept `concept_name`.
This is useful for checking that an iterator you write using
`iterator_facade` models the right C++ concept.
`iterator_interface` models the right C++ concept.
For example: `BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(my_iter,
For example: `BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(my_iter,
std::input_iterator)`.
\note This macro exapnds to nothing when `__cpp_lib_concepts` is not
defined. */
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(iter, concept_name)
#define BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(iter, concept_name)
/** `static_asserts` that the types of all typedefs in
`std::iterator_traits<iter>` match the remaining macro parameters. This
is useful for checking that an iterator you write using `iterator_facade`
has the correct iterator traits.
is useful for checking that an iterator you write using
`iterator_interface` has the correct iterator traits.
For example: `BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(my_iter,
For example: `BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(my_iter,
std::input_iterator_tag, std::input_iterator_tag, int, int &, int *, std::ptrdiff_t)`.
\note This macro ignores the `concept` parameter when `__cpp_lib_concepts`
is not defined. */
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS( \
#define BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS( \
iter, category, concept, value_type, reference, pointer, difference_type)
#else
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_CONCEPT_IMPL( \
#define BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_CONCEPT_IMPL( \
iter, concept_name) \
static_assert(concept_name<iter>, "");
#if 201703L < __cplusplus && defined(__cpp_lib_concepts)
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(iter, concept_name) \
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_CONCEPT_IMPL( \
iter, concept_name)
#define BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(iter, concept_name) \
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_CONCEPT_IMPL(iter, concept_name)
#else
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(iter, concept_name)
#define BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(iter, concept_name)
#endif
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS_IMPL( \
#define BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS_IMPL( \
iter, category, value_t, ref, ptr, diff_t) \
static_assert( \
std::is_same< \
@@ -421,19 +420,19 @@ namespace boost { namespace iterator_facade {
"");
#if 201703L < __cplusplus && defined(__cpp_lib_ranges)
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS( \
#define BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS( \
iter, category, concept, value_type, reference, pointer, difference_type) \
static_assert( \
std::is_same< \
typename std::iterator_traits<iter>::iterator_concept, \
concept>::value, \
""); \
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS_IMPL( \
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS_IMPL( \
iter, category, value_type, reference, pointer, difference_type)
#else
#define BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS( \
#define BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS( \
iter, category, concept, value_type, reference, pointer, difference_type) \
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS_IMPL( \
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS_IMPL( \
iter, category, value_type, reference, pointer, difference_type)
#endif

View File

@@ -3,13 +3,13 @@
// 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)
#ifndef BOOST_ITERATOR_FACADE_VIEW_INTERFACE_HPP
#define BOOST_ITERATOR_FACADE_VIEW_INTERFACE_HPP
#ifndef BOOST_STL_INTERFACES_VIEW_INTERFACE_HPP
#define BOOST_STL_INTERFACES_VIEW_INTERFACE_HPP
#include <boost/iterator_facade/fwd.hpp>
#include <boost/stl_interfaces/fwd.hpp>
namespace boost { namespace iterator_facade {
namespace boost { namespace stl_interfaces {
namespace detail {
template<typename T, typename = void>

View File

@@ -17,7 +17,7 @@ endif ()
macro(add_test_executable name)
add_executable(${name} ${name}.cpp)
target_compile_options(${name} PRIVATE ${warnings_flag})
target_link_libraries(${name} iterator_facade gtest gtest_main)
target_link_libraries(${name} stl_interfaces gtest gtest_main)
if (MSVC)
target_compile_options(${name} PRIVATE /source-charset:utf-8)
endif ()

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <gtest/gtest.h>
@@ -12,7 +12,7 @@
#include <type_traits>
struct basic_bidirectional_iter : boost::iterator_facade::iterator_interface<
struct basic_bidirectional_iter : boost::stl_interfaces::iterator_interface<
basic_bidirectional_iter,
std::bidirectional_iterator_tag,
int>
@@ -37,7 +37,7 @@ struct basic_bidirectional_iter : boost::iterator_facade::iterator_interface<
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
basic_bidirectional_iter,
std::bidirectional_iterator_tag,
int>;
@@ -48,9 +48,9 @@ private:
int * it_;
};
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
basic_bidirectional_iter, std::bidirectional_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
basic_bidirectional_iter,
std::bidirectional_iterator_tag,
std::bidirectional_iterator_tag,
@@ -60,7 +60,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
template<typename ValueType>
struct bidirectional_iter : boost::iterator_facade::iterator_interface<
struct bidirectional_iter : boost::stl_interfaces::iterator_interface<
bidirectional_iter<ValueType>,
std::bidirectional_iterator_tag,
ValueType>
@@ -92,7 +92,7 @@ struct bidirectional_iter : boost::iterator_facade::iterator_interface<
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
bidirectional_iter<ValueType>,
std::bidirectional_iterator_tag,
ValueType>;
@@ -109,9 +109,9 @@ private:
using bidirectional = bidirectional_iter<int>;
using const_bidirectional = bidirectional_iter<int const>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
bidirectional, std::bidirectional_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
bidirectional,
std::bidirectional_iterator_tag,
std::bidirectional_iterator_tag,
@@ -120,9 +120,9 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
int *,
std::ptrdiff_t)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
const_bidirectional, std::bidirectional_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
const_bidirectional,
std::bidirectional_iterator_tag,
std::bidirectional_iterator_tag,
@@ -132,7 +132,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
#if 0 // TODO: Call ranges algorithms with this.
struct basic_proxy_bidirectional_iter : boost::iterator_facade::iterator_interface<
struct basic_proxy_bidirectional_iter : boost::stl_interfaces::iterator_interface<
basic_proxy_bidirectional_iter,
std::bidirectional_iterator_tag,
int,
@@ -151,7 +151,7 @@ struct basic_proxy_bidirectional_iter : boost::iterator_facade::iterator_interfa
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
basic_proxy_bidirectional_iter,
std::bidirectional_iterator_tag,
int,

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <gtest/gtest.h>
@@ -13,7 +13,7 @@
struct basic_forward_iter
: boost::iterator_facade::
: boost::stl_interfaces::
iterator_interface<basic_forward_iter, std::forward_iterator_tag, int>
{
basic_forward_iter() : it_(nullptr) {}
@@ -31,7 +31,7 @@ struct basic_forward_iter
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::
using base_type = boost::stl_interfaces::
iterator_interface<basic_forward_iter, std::forward_iterator_tag, int>;
using base_type::operator++;
@@ -39,9 +39,9 @@ private:
int * it_;
};
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
basic_forward_iter, std::forward_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
basic_forward_iter,
std::forward_iterator_tag,
std::forward_iterator_tag,
@@ -51,7 +51,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
template<typename ValueType>
struct forward_iter : boost::iterator_facade::iterator_interface<
struct forward_iter : boost::stl_interfaces::iterator_interface<
forward_iter<ValueType>,
std::forward_iterator_tag,
ValueType>
@@ -77,7 +77,7 @@ struct forward_iter : boost::iterator_facade::iterator_interface<
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
forward_iter<ValueType>,
std::forward_iterator_tag,
ValueType>;
@@ -93,9 +93,9 @@ private:
using forward = forward_iter<int>;
using const_forward = forward_iter<int const>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
forward, std::forward_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
forward,
std::forward_iterator_tag,
std::forward_iterator_tag,
@@ -104,9 +104,9 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
int *,
std::ptrdiff_t)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
const_forward, std::forward_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
const_forward,
std::forward_iterator_tag,
std::forward_iterator_tag,
@@ -116,7 +116,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
#if 0 // TODO: Call ranges algorithms with this.
struct basic_proxy_forward_iter : boost::iterator_facade::iterator_interface<
struct basic_proxy_forward_iter : boost::stl_interfaces::iterator_interface<
basic_proxy_forward_iter,
std::forward_iterator_tag,
int,
@@ -133,7 +133,7 @@ struct basic_proxy_forward_iter : boost::iterator_facade::iterator_interface<
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
basic_proxy_forward_iter,
std::forward_iterator_tag,
int,

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <gtest/gtest.h>
@@ -13,7 +13,7 @@
struct basic_input_iter
: boost::iterator_facade::
: boost::stl_interfaces::
iterator_interface<basic_input_iter, std::input_iterator_tag, int>
{
basic_input_iter() : it_(nullptr) {}
@@ -30,7 +30,7 @@ struct basic_input_iter
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::
using base_type = boost::stl_interfaces::
iterator_interface<basic_input_iter, std::input_iterator_tag, int>;
using base_type::operator++;
@@ -38,9 +38,9 @@ private:
int * it_;
};
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
basic_input_iter, std::input_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
basic_input_iter,
std::input_iterator_tag,
std::input_iterator_tag,
@@ -50,7 +50,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
template<typename ValueType>
struct input_iter : boost::iterator_facade::iterator_interface<
struct input_iter : boost::stl_interfaces::iterator_interface<
input_iter<ValueType>,
std::input_iterator_tag,
ValueType>
@@ -76,7 +76,7 @@ struct input_iter : boost::iterator_facade::iterator_interface<
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
input_iter<ValueType>,
std::input_iterator_tag,
ValueType>;
@@ -89,9 +89,9 @@ private:
friend struct input_iter;
};
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
input_iter<int>, std::input_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
input_iter<int>,
std::input_iterator_tag,
std::input_iterator_tag,
@@ -106,7 +106,7 @@ using pair_input = input_iter<std::pair<int, int>>;
using const_pair_input = input_iter<std::pair<int, int> const>;
template<typename ValueType>
struct proxy_input_iter : boost::iterator_facade::proxy_iterator_interface<
struct proxy_input_iter : boost::stl_interfaces::proxy_iterator_interface<
proxy_input_iter<ValueType>,
std::input_iterator_tag,
ValueType>
@@ -132,7 +132,7 @@ struct proxy_input_iter : boost::iterator_facade::proxy_iterator_interface<
return lhs.it_ == rhs.it_;
}
using base_type = boost::iterator_facade::proxy_iterator_interface<
using base_type = boost::stl_interfaces::proxy_iterator_interface<
proxy_input_iter<ValueType>,
std::input_iterator_tag,
ValueType>;
@@ -146,15 +146,15 @@ private:
};
using int_pair = std::pair<int, int>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
proxy_input_iter<int_pair>, std::input_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
proxy_input_iter<int_pair>,
std::input_iterator_tag,
std::input_iterator_tag,
int_pair,
int_pair,
boost::iterator_facade::proxy_arrow_result<int_pair>,
boost::stl_interfaces::proxy_arrow_result<int_pair>,
std::ptrdiff_t)
std::array<int, 10> ints = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}};

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <gtest/gtest.h>
@@ -13,7 +13,7 @@
struct basic_output_iter
: boost::iterator_facade::
: boost::stl_interfaces::
iterator_interface<basic_output_iter, std::output_iterator_tag, int>
{
basic_output_iter() : it_(nullptr) {}
@@ -26,7 +26,7 @@ struct basic_output_iter
return *this;
}
using base_type = boost::iterator_facade::
using base_type = boost::stl_interfaces::
iterator_interface<basic_output_iter, std::output_iterator_tag, int>;
using base_type::operator++;
@@ -36,8 +36,8 @@ private:
using output = basic_output_iter;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(output, std::output_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(output, std::output_iterator)
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
output,
std::output_iterator_tag,
std::output_iterator_tag,
@@ -47,7 +47,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
template<typename Container>
struct back_insert_iter : boost::iterator_facade::iterator_interface<
struct back_insert_iter : boost::stl_interfaces::iterator_interface<
back_insert_iter<Container>,
std::output_iterator_tag,
typename Container::value_type,
@@ -70,7 +70,7 @@ struct back_insert_iter : boost::iterator_facade::iterator_interface<
return *this;
}
using base_type = boost::iterator_facade::iterator_interface<
using base_type = boost::stl_interfaces::iterator_interface<
back_insert_iter<Container>,
std::output_iterator_tag,
typename Container::value_type,
@@ -83,8 +83,8 @@ private:
using back_insert = back_insert_iter<std::vector<int>>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(back_insert, std::output_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(back_insert, std::output_iterator)
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
back_insert,
std::output_iterator_tag,
std::output_iterator_tag,

View File

@@ -3,7 +3,7 @@
// 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)
#include <boost/iterator_facade/iterator_facade.hpp>
#include <boost/stl_interfaces/iterator_interface.hpp>
#include <gtest/gtest.h>
@@ -12,7 +12,7 @@
#include <type_traits>
struct basic_random_access_iter : boost::iterator_facade::iterator_interface<
struct basic_random_access_iter : boost::stl_interfaces::iterator_interface<
basic_random_access_iter,
std::random_access_iterator_tag,
int>
@@ -36,9 +36,9 @@ private:
int * it_;
};
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
basic_random_access_iter, std::random_access_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
basic_random_access_iter,
std::random_access_iterator_tag,
std::random_access_iterator_tag,
@@ -48,7 +48,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
template<typename ValueType>
struct random_access_iter : boost::iterator_facade::iterator_interface<
struct random_access_iter : boost::stl_interfaces::iterator_interface<
random_access_iter<ValueType>,
std::random_access_iterator_tag,
ValueType>
@@ -85,9 +85,9 @@ private:
using random_access = random_access_iter<int>;
using const_random_access = random_access_iter<int const>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
random_access, std::random_access_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
random_access,
std::random_access_iterator_tag,
std::random_access_iterator_tag,
@@ -96,9 +96,9 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
int *,
std::ptrdiff_t)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
const_random_access, std::random_access_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
const_random_access,
std::random_access_iterator_tag,
std::random_access_iterator_tag,
@@ -108,7 +108,7 @@ BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
std::ptrdiff_t)
// TODO: Call ranges algorithms with this.
struct zip_iter : boost::iterator_facade::proxy_iterator_interface<
struct zip_iter : boost::stl_interfaces::proxy_iterator_interface<
zip_iter,
std::random_access_iterator_tag,
std::tuple<int, int>,
@@ -140,15 +140,15 @@ private:
using int_pair = std::tuple<int, int>;
using int_refs_pair = std::tuple<int &, int &>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
zip_iter, std::random_access_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
zip_iter,
std::random_access_iterator_tag,
std::random_access_iterator_tag,
int_pair,
int_refs_pair,
boost::iterator_facade::proxy_arrow_result<int_refs_pair>,
boost::stl_interfaces::proxy_arrow_result<int_refs_pair>,
std::ptrdiff_t)
struct int_t
@@ -168,7 +168,7 @@ struct int_t
friend bool operator<(int lhs, int_t rhs) { return lhs < rhs.value_; }
};
struct udt_zip_iter : boost::iterator_facade::proxy_iterator_interface<
struct udt_zip_iter : boost::stl_interfaces::proxy_iterator_interface<
udt_zip_iter,
std::random_access_iterator_tag,
std::tuple<int_t, int>,
@@ -200,15 +200,15 @@ private:
using int_t_int_pair = std::tuple<int_t, int>;
using int_t_int_refs_pair = std::tuple<int_t &, int &>;
BOOST_ITERATOR_FACADE_STATIC_ASSERT_CONCEPT(
BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(
udt_zip_iter, std::random_access_iterator)
BOOST_ITERATOR_FACADE_STATIC_ASSERT_ITERATOR_TRAITS(
BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS(
udt_zip_iter,
std::random_access_iterator_tag,
std::random_access_iterator_tag,
int_t_int_pair,
int_t_int_refs_pair,
boost::iterator_facade::proxy_arrow_result<int_t_int_refs_pair>,
boost::stl_interfaces::proxy_arrow_result<int_t_int_refs_pair>,
std::ptrdiff_t)
namespace std {