diff --git a/CMakeLists.txt b/CMakeLists.txt index a0dcf84..bedf55b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ target_link_libraries(boost_iterator Boost::mpl Boost::optional Boost::smart_ptr - Boost::static_assert Boost::type_traits Boost::utility ) diff --git a/example/node_iterator2.hpp b/example/node_iterator2.hpp index 1f5d834..86bfc9e 100644 --- a/example/node_iterator2.hpp +++ b/example/node_iterator2.hpp @@ -6,11 +6,7 @@ # include "node.hpp" # include - -# ifndef BOOST_NO_SFINAE -# include -# include -# endif +# include template class node_iter @@ -33,21 +29,13 @@ class node_iter template node_iter( node_iter const& other -# ifndef BOOST_NO_SFINAE - , typename boost::enable_if< - boost::is_convertible + , typename std::enable_if< + std::is_convertible::value , enabler >::type = enabler() -# endif ) : m_node(other.m_node) {} - -# if !BOOST_WORKAROUND(__GNUC__, == 2) - private: // GCC2 can't grant friendship to template member functions - friend class boost::iterator_core_access; -# endif - template bool equal(node_iter const& other) const { diff --git a/example/node_iterator3.hpp b/example/node_iterator3.hpp index 3ae7bec..9d224b4 100644 --- a/example/node_iterator3.hpp +++ b/example/node_iterator3.hpp @@ -6,11 +6,7 @@ # include "node.hpp" # include - -# ifndef BOOST_NO_SFINAE -# include -# include -# endif +# include template class node_iter @@ -38,12 +34,10 @@ class node_iter template node_iter( node_iter const& other -# ifndef BOOST_NO_SFINAE - , typename boost::enable_if< - boost::is_convertible + , typename std::enable_if< + std::is_convertible::value , enabler >::type = enabler() -# endif ) : super_t(other.base()) {} diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp index 3279cd0..21f0904 100644 --- a/include/boost/indirect_reference.hpp +++ b/include/boost/indirect_reference.hpp @@ -13,7 +13,6 @@ # include # include -# include # include # include diff --git a/include/boost/iterator/counting_iterator.hpp b/include/boost/iterator/counting_iterator.hpp index 65c11e9..9af9e77 100644 --- a/include/boost/iterator/counting_iterator.hpp +++ b/include/boost/iterator/counting_iterator.hpp @@ -5,19 +5,14 @@ #ifndef COUNTING_ITERATOR_DWA200348_HPP # define COUNTING_ITERATOR_DWA200348_HPP +# include + # include -# include +# include # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # include -# elif !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) -# include -# else -# include # endif -# include # include -# include -# include # include # include @@ -39,7 +34,7 @@ namespace detail struct is_numeric_impl { // For a while, this wasn't true, but we rely on it below. This is a regression assert. - BOOST_STATIC_ASSERT(::boost::is_integral::value); + static_assert(std::is_integral::value, ""); # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS @@ -50,11 +45,11 @@ namespace detail # if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) BOOST_STATIC_CONSTANT( bool, value = ( - boost::is_convertible::value - && boost::is_convertible::value + std::is_convertible::value + && std::is_convertible::value )); # else - BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic::value); + BOOST_STATIC_CONSTANT(bool, value = std::is_arithmetic::value); # endif # endif @@ -62,7 +57,7 @@ namespace detail template struct is_numeric - : boost::integral_constant::value> + : std::integral_constant::value> {}; # if defined(BOOST_HAS_LONG_LONG) @@ -116,7 +111,7 @@ namespace detail { typedef typename detail::ia_dflt_help< CategoryOrTraversal - , typename boost::conditional< + , typename std::conditional< is_numeric::value , boost::type_identity , iterator_traversal @@ -125,7 +120,7 @@ namespace detail typedef typename detail::ia_dflt_help< Difference - , typename boost::conditional< + , typename std::conditional< is_numeric::value , numeric_difference , iterator_difference @@ -225,7 +220,7 @@ class counting_iterator difference_type distance_to(counting_iterator const& y) const { - typedef typename boost::conditional< + typedef typename std::conditional< detail::is_numeric::value , detail::number_distance , detail::iterator_distance diff --git a/include/boost/iterator/detail/config_def.hpp b/include/boost/iterator/detail/config_def.hpp index bd04b75..75d2198 100644 --- a/include/boost/iterator/detail/config_def.hpp +++ b/include/boost/iterator/detail/config_def.hpp @@ -46,9 +46,7 @@ #endif -#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x5A0)) \ - || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \ - || BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) \ +#if (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) # define BOOST_NO_LVALUE_RETURN_DETECTION @@ -83,46 +81,4 @@ #endif -#if BOOST_WORKAROUND(__MWERKS__, <=0x2407) -# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types" -#endif - -#if BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__) \ - || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) -# define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile: - -# if 0 // test code - #include - template - struct foo - { - foo(T); - - template - foo(foo const& other) : p(other.p) { } - - T p; - }; - - bool x = boost::is_convertible, foo >::value; -# endif - -#endif - - -#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE)) -# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY -#endif - -# if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) - -// GCC-2.95 (obsolete) eagerly instantiates templated constructors and conversion -// operators in convertibility checks, causing premature errors. -// -// Borland's problems are harder to diagnose due to lack of an -// instantiation stack backtrace. They may be due in part to the fact -// that it drops cv-qualification willy-nilly in templates. -# define BOOST_NO_ONE_WAY_ITERATOR_INTEROP -# endif - // no include guard; multiple inclusion intended diff --git a/include/boost/iterator/detail/config_undef.hpp b/include/boost/iterator/detail/config_undef.hpp index a32529c..6a0c3ab 100644 --- a/include/boost/iterator/detail/config_undef.hpp +++ b/include/boost/iterator/detail/config_undef.hpp @@ -11,11 +11,7 @@ // 23/02/03 thw // -#undef BOOST_NO_IS_CONVERTIBLE -#undef BOOST_NO_IS_CONVERTIBLE_TEMPLATE -#undef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY #undef BOOST_NO_LVALUE_RETURN_DETECTION -#undef BOOST_NO_ONE_WAY_ITERATOR_INTEROP #ifdef BOOST_ITERATOR_CONFIG_DEF # undef BOOST_ITERATOR_CONFIG_DEF diff --git a/include/boost/iterator/detail/enable_if.hpp b/include/boost/iterator/detail/enable_if.hpp deleted file mode 100644 index dcc9adb..0000000 --- a/include/boost/iterator/detail/enable_if.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// (C) Copyright David Abrahams 2002. -// (C) Copyright Jeremy Siek 2002. -// (C) Copyright Thomas Witt 2002. -// 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_ENABLE_IF_23022003THW_HPP -#define BOOST_ENABLE_IF_23022003THW_HPP - -#include -#include -#if defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) -#include -#endif - -// -// Boost iterators uses its own enable_if cause we need -// special semantics for deficient compilers. -// 23/02/03 thw -// - -namespace boost -{ - - namespace iterators - { - // - // Base machinery for all kinds of enable if - // - template - struct enabled - { - template - struct base - { - typedef T type; - }; - }; - - // - // For compilers that don't support "Substitution Failure Is Not An Error" - // enable_if falls back to always enabled. See comments - // on operator implementation for consequences. - // - template<> - struct enabled - { - template - struct base - { -#ifdef BOOST_NO_SFINAE - typedef T type; - - // This way to do it would give a nice error message containing - // invalid overload, but has the big disadvantage that - // there is no reference to user code in the error message. - // - // struct invalid_overload; - // typedef invalid_overload type; - // -#endif - }; - }; - - - template - struct enable_if -# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE) - : enabled<(Cond::value)>::template base -# else - : boost::type_identity -# endif - { - }; - - } // namespace iterators - -} // namespace boost - -#include - -#endif // BOOST_ENABLE_IF_23022003THW_HPP diff --git a/include/boost/iterator/detail/facade_iterator_category.hpp b/include/boost/iterator/detail/facade_iterator_category.hpp index 9d41320..5e7cef1 100644 --- a/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/include/boost/iterator/detail/facade_iterator_category.hpp @@ -10,16 +10,10 @@ # include // used in iterator_tag inheritance logic # include -# include # include # include -# include - -# include -# include -# include -# include +# include # include // try to keep this last @@ -84,24 +78,24 @@ template struct iterator_facade_default_category : mpl::eval_if< mpl::and_< - is_reference - , is_convertible + std::is_reference + , std::is_convertible > , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::if_< - is_convertible + std::is_convertible , std::bidirectional_iterator_tag , std::forward_iterator_tag > > , typename mpl::eval_if< mpl::and_< - is_convertible + std::is_convertible // check for readability - , is_convertible + , std::is_convertible > , mpl::identity , mpl::identity @@ -114,15 +108,15 @@ struct iterator_facade_default_category template struct is_iterator_category : mpl::or_< - is_convertible - , is_convertible + std::is_convertible + , std::is_convertible > { }; template struct is_iterator_traversal - : is_convertible + : std::is_convertible {}; // @@ -138,17 +132,17 @@ struct iterator_category_with_traversal // Make sure this isn't used to build any categories where // convertibility to Traversal is redundant. Should just use the // Category element in that case. - BOOST_STATIC_ASSERT(( - !is_convertible< + static_assert( + !std::is_convertible< typename iterator_category_to_traversal::type , Traversal - >::value)); + >::value, ""); - BOOST_STATIC_ASSERT(is_iterator_category::value); - BOOST_STATIC_ASSERT(!is_iterator_category::value); - BOOST_STATIC_ASSERT(!is_iterator_traversal::value); + static_assert(is_iterator_category::value, ""); + static_assert(!is_iterator_category::value, ""); + static_assert(!is_iterator_traversal::value, ""); # if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) - BOOST_STATIC_ASSERT(is_iterator_traversal::value); + static_assert(is_iterator_traversal::value, ""); # endif }; @@ -157,17 +151,17 @@ struct iterator_category_with_traversal template struct facade_iterator_category_impl { - BOOST_STATIC_ASSERT(!is_iterator_category::value); + static_assert(!is_iterator_category::value, ""); typedef typename iterator_facade_default_category< Traversal,ValueParam,Reference >::type category; - typedef typename mpl::if_< - is_same< + typedef typename std::conditional< + std::is_same< Traversal , typename iterator_category_to_traversal::type - > + >::value , category , iterator_category_with_traversal >::type type; diff --git a/include/boost/iterator/filter_iterator.hpp b/include/boost/iterator/filter_iterator.hpp index 18c6186..44ac1e7 100644 --- a/include/boost/iterator/filter_iterator.hpp +++ b/include/boost/iterator/filter_iterator.hpp @@ -7,20 +7,14 @@ #ifndef BOOST_FILTER_ITERATOR_23022003THW_HPP #define BOOST_FILTER_ITERATOR_23022003THW_HPP +#include + #include #include -#include -#include #include #include -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -#define BOOST_ITERATOR_DETAIL_MOVE(_type, _value) static_cast< _type&& >(_value) -#else -#define BOOST_ITERATOR_DETAIL_MOVE(_type, _value) _value -#endif - namespace boost { namespace iterators { @@ -37,7 +31,7 @@ namespace iterators { , Iterator , use_default , typename mpl::if_< - is_convertible< + std::is_convertible< typename iterator_traversal::type , random_access_traversal_tag > @@ -62,20 +56,20 @@ namespace iterators { filter_iterator() { } filter_iterator(Predicate f, Iterator x, Iterator end_ = Iterator()) - : super_t(BOOST_ITERATOR_DETAIL_MOVE(Iterator, x)), m_predicate(BOOST_ITERATOR_DETAIL_MOVE(Predicate, f)), m_end(BOOST_ITERATOR_DETAIL_MOVE(Iterator, end_)) + : super_t(std::move(x)), m_predicate(std::move(f)), m_end(std::move(end_)) { satisfy_predicate(); } filter_iterator(Iterator x, Iterator end_ = Iterator()) - : super_t(BOOST_ITERATOR_DETAIL_MOVE(Iterator, x)), m_predicate(), m_end(BOOST_ITERATOR_DETAIL_MOVE(Iterator, end_)) + : super_t(std::move(x)), m_predicate(), m_end(std::move(end_)) { // Pro8 is a little too aggressive about instantiating the // body of this function. #if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // Don't allow use of this constructor if Predicate is a // function pointer type, since it will be 0. - BOOST_STATIC_ASSERT(is_class::value); + static_assert(std::is_class::value, ""); #endif satisfy_predicate(); } @@ -119,19 +113,19 @@ namespace iterators { inline filter_iterator make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator()) { - return filter_iterator(BOOST_ITERATOR_DETAIL_MOVE(Predicate, f), BOOST_ITERATOR_DETAIL_MOVE(Iterator, x), BOOST_ITERATOR_DETAIL_MOVE(Iterator, end)); + return filter_iterator(std::move(f), std::move(x), std::move(end)); } template inline filter_iterator make_filter_iterator( - typename iterators::enable_if< - is_class + typename std::enable_if< + is_class::value , Iterator >::type x , Iterator end = Iterator()) { - return filter_iterator(BOOST_ITERATOR_DETAIL_MOVE(Iterator, x), BOOST_ITERATOR_DETAIL_MOVE(Iterator, end)); + return filter_iterator(std::move(x), std::move(end)); } } // namespace iterators diff --git a/include/boost/iterator/function_input_iterator.hpp b/include/boost/iterator/function_input_iterator.hpp index 610c133..15175b2 100644 --- a/include/boost/iterator/function_input_iterator.hpp +++ b/include/boost/iterator/function_input_iterator.hpp @@ -9,10 +9,10 @@ #ifndef BOOST_FUNCTION_INPUT_ITERATOR #define BOOST_FUNCTION_INPUT_ITERATOR +#include +#include + #include -#include -#include -#include #include #include #include @@ -20,10 +20,6 @@ #include #include -#ifdef BOOST_RESULT_OF_USE_TR1 -#include -#endif - namespace boost { namespace iterators { @@ -41,7 +37,7 @@ namespace iterators { { typedef typename result_of< #ifdef BOOST_RESULT_OF_USE_TR1 - typename boost::conditional::value, F&, F>::type() + typename std::conditional::value, F&, F>::type() #else F&() #endif @@ -60,7 +56,7 @@ namespace iterators { public: function_object_input_iterator() {} function_object_input_iterator(Function & f_, Input state_ = Input()) - : f(boost::addressof(f_)), state(state_) {} + : f(std::addressof(f_)), state(state_) {} void increment() { if (value) @@ -130,13 +126,13 @@ namespace iterators { template class function_input_iterator : - public boost::conditional< + public std::conditional< function_types::is_function_pointer::value, impl::function_pointer_input_iterator, impl::function_object_input_iterator >::type { - typedef typename boost::conditional< + typedef typename std::conditional< function_types::is_function_pointer::value, impl::function_pointer_input_iterator, impl::function_object_input_iterator diff --git a/include/boost/iterator/function_output_iterator.hpp b/include/boost/iterator/function_output_iterator.hpp index ea2a668..ad4adc3 100644 --- a/include/boost/iterator/function_output_iterator.hpp +++ b/include/boost/iterator/function_output_iterator.hpp @@ -13,13 +13,9 @@ #include #include +#include + #include -#include -#include -#include -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -#include -#endif namespace boost { namespace iterators { @@ -31,29 +27,19 @@ namespace iterators { class output_proxy { public: - explicit output_proxy(UnaryFunction& f) BOOST_NOEXCEPT : m_f(f) { } + explicit output_proxy(UnaryFunction& f) noexcept : m_f(f) { } -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES template - typename boost::disable_if_c< - boost::is_same< typename boost::remove_cv< T >::type, output_proxy >::value, - output_proxy const& - >::type operator=(const T& value) const { - m_f(value); - return *this; - } -#else - template - typename boost::disable_if_c< - boost::is_same< typename boost::remove_cv< typename boost::remove_reference< T >::type >::type, output_proxy >::value, + + typename std::enable_if< + !std::is_same< typename std::remove_cv< typename std::remove_reference< T >::type >::type, output_proxy >::value, output_proxy const& >::type operator=(T&& value) const { m_f(static_cast< T&& >(value)); return *this; } -#endif - BOOST_DEFAULTED_FUNCTION(output_proxy(output_proxy const& that), BOOST_NOEXCEPT : m_f(that.m_f) {}) + BOOST_DEFAULTED_FUNCTION(output_proxy(output_proxy const& that), noexcept : m_f(that.m_f) {}) BOOST_DELETED_FUNCTION(output_proxy& operator=(output_proxy const&)) private: diff --git a/include/boost/iterator/indirect_iterator.hpp b/include/boost/iterator/indirect_iterator.hpp index e15ac87..f670839 100644 --- a/include/boost/iterator/indirect_iterator.hpp +++ b/include/boost/iterator/indirect_iterator.hpp @@ -14,16 +14,13 @@ #include -#include -#include - #include #include #include -#include #include #include +#include #ifdef BOOST_MPL_CFG_NO_HAS_XXX # include @@ -57,9 +54,9 @@ namespace iterators { , typename ia_dflt_help< Reference , mpl::eval_if< - is_same + std::is_same , indirect_reference - , add_reference + , std::add_lvalue_reference > >::type , Difference diff --git a/include/boost/iterator/interoperable.hpp b/include/boost/iterator/interoperable.hpp index 6f3c872..4bb8c89 100644 --- a/include/boost/iterator/interoperable.hpp +++ b/include/boost/iterator/interoperable.hpp @@ -7,11 +7,11 @@ #ifndef BOOST_INTEROPERABLE_23022003THW_HPP # define BOOST_INTEROPERABLE_23022003THW_HPP +# include + # include # include -# include - # include // must appear last namespace boost { @@ -33,13 +33,10 @@ namespace iterators { // template struct is_interoperable -# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY - : mpl::true_ -# else - : mpl::or_< - is_convertible< A, B > - , is_convertible< B, A > > -# endif + : std::integral_constant< + bool + , std::is_convertible< A, B >::value || std::is_convertible< B, A >::value + > { }; diff --git a/include/boost/iterator/is_iterator.hpp b/include/boost/iterator/is_iterator.hpp index 5740b19..37cf197 100644 --- a/include/boost/iterator/is_iterator.hpp +++ b/include/boost/iterator/is_iterator.hpp @@ -16,15 +16,13 @@ #include #include -#include -#include -#include #include -#include #if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS) #include #endif +#include + #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif @@ -68,10 +66,10 @@ struct is_iterator_impl : template< typename T > struct is_iterator_impl< T* > : - public boost::conjunction< - boost::is_complete< T >, - boost::negation< boost::is_function< T > > - >::type + std::integral_constant< + bool + , boost::is_complete::value && !std::is_function::value + > { }; diff --git a/include/boost/iterator/is_lvalue_iterator.hpp b/include/boost/iterator/is_lvalue_iterator.hpp index 46f0483..26eccb2 100644 --- a/include/boost/iterator/is_lvalue_iterator.hpp +++ b/include/boost/iterator/is_lvalue_iterator.hpp @@ -6,19 +6,16 @@ #include -#include #include #include #include #include +#include // should be the last #includes -#include #include -#ifndef BOOST_NO_IS_CONVERTIBLE - namespace boost { namespace iterators { @@ -39,11 +36,11 @@ namespace detail # define BOOST_LVALUE_PRESERVER(expr) detail::lvalue_preserver(expr,0) -#else +#else // BOOST_NO_LVALUE_RETURN_DETECTION # define BOOST_LVALUE_PRESERVER(expr) expr -#endif +#endif // BOOST_NO_LVALUE_RETURN_DETECTION // Guts of is_lvalue_iterator. Value is the iterator's value_type // and the result is computed in the nested rebind template. @@ -54,7 +51,7 @@ namespace detail // convertible to Value const& struct conversion_eater { - conversion_eater(typename add_lvalue_reference::type); + conversion_eater(typename std::add_lvalue_reference::type); }; static char tester(conversion_eater, int); @@ -137,14 +134,14 @@ namespace detail } // namespace detail template< typename T > struct is_lvalue_iterator -: public ::boost::integral_constant::value> +: public std::integral_constant::value> { public: BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_lvalue_iterator,(T)) }; template< typename T > struct is_non_const_lvalue_iterator -: public ::boost::integral_constant::value> +: public std::integral_constant::value> { public: BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_non_const_lvalue_iterator,(T)) @@ -157,8 +154,6 @@ using iterators::is_non_const_lvalue_iterator; } // namespace boost -#endif - #include #endif // IS_LVALUE_ITERATOR_DWA2003112_HPP diff --git a/include/boost/iterator/is_readable_iterator.hpp b/include/boost/iterator/is_readable_iterator.hpp index 26827c4..ed6db05 100644 --- a/include/boost/iterator/is_readable_iterator.hpp +++ b/include/boost/iterator/is_readable_iterator.hpp @@ -6,18 +6,15 @@ #include #include -#include #include #include +#include // should be the last #include -#include #include -#ifndef BOOST_NO_IS_CONVERTIBLE - namespace boost { namespace iterators { @@ -29,7 +26,7 @@ namespace detail template struct is_readable_iterator_impl { - static char tester(typename add_lvalue_reference::type, int); + static char tester(typename std::add_lvalue_reference::type, int); static char (& tester(any_conversion_eater, ...) )[2]; template @@ -100,7 +97,7 @@ namespace detail } // namespace detail template< typename T > struct is_readable_iterator -: public ::boost::integral_constant::value> +: public std::integral_constant::value> { public: BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_readable_iterator,(T)) @@ -112,8 +109,6 @@ using iterators::is_readable_iterator; } // namespace boost -#endif - #include #endif // IS_READABLE_ITERATOR_DWA2003112_HPP diff --git a/include/boost/iterator/iterator_adaptor.hpp b/include/boost/iterator/iterator_adaptor.hpp index db1c4da..2fcecb3 100644 --- a/include/boost/iterator/iterator_adaptor.hpp +++ b/include/boost/iterator/iterator_adaptor.hpp @@ -7,28 +7,13 @@ #ifndef BOOST_ITERATOR_ADAPTOR_23022003THW_HPP #define BOOST_ITERATOR_ADAPTOR_23022003THW_HPP -#include - #include +#include + #include #include -#include - -#include -#include -#include - -#include -#include - -#ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY -# include -#endif - -#include #include - #include namespace boost { @@ -41,13 +26,6 @@ namespace iterators { } // namespace iterators -// the incompleteness of use_default causes massive problems for -// is_convertible (naturally). This workaround is fortunately not -// needed for vc6/vc7. -template -struct is_convertible - : mpl::false_ {}; - namespace iterators { namespace detail @@ -102,41 +80,14 @@ namespace iterators { // false positives for user/library defined iterator types. See comments // on operator implementation for consequences. // -# if defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE) - - template - struct enable_if_convertible - { - typedef boost::iterators::detail::enable_type type; - }; - -# elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) - - // For some reason vc7.1 needs us to "cut off" instantiation - // of is_convertible in a few cases. template struct enable_if_convertible - : iterators::enable_if< - mpl::or_< - is_same - , is_convertible - > - , boost::iterators::detail::enable_type - > - {}; - -# else - - template - struct enable_if_convertible - : iterators::enable_if< - is_convertible + : std::enable_if< + std::is_convertible::value , boost::iterators::detail::enable_type > {}; -# endif - // // Default template argument handling for iterator_adaptor // @@ -147,7 +98,7 @@ namespace iterators { template struct ia_dflt_help : mpl::eval_if< - is_same + std::is_same , DefaultNullaryFn , mpl::identity > @@ -173,9 +124,9 @@ namespace iterators { , typename boost::iterators::detail::ia_dflt_help< Value , mpl::eval_if< - is_same + std::is_same , iterator_value - , remove_reference + , std::remove_reference > >::type # else @@ -192,9 +143,9 @@ namespace iterators { , typename boost::iterators::detail::ia_dflt_help< Reference , mpl::eval_if< - is_same + std::is_same , iterator_reference - , add_reference + , std::add_lvalue_reference > >::type @@ -209,7 +160,7 @@ namespace iterators { template inline void iterator_adaptor_assert_traversal () { - BOOST_STATIC_ASSERT((is_convertible::value)); + static_assert(std::is_convertible::value, ""); } } @@ -220,7 +171,7 @@ namespace iterators { // versions of iterator_adaptor The idea is that when the user needs // to fiddle with the reference type it is highly likely that the // iterator category has to be adjusted as well. Any of the - // following four template arguments may be ommitted or explicitly + // following four template arguments may be committed or explicitly // replaced by use_default. // // Value - if supplied, the value_type of the resulting iterator, unless diff --git a/include/boost/iterator/iterator_archetypes.hpp b/include/boost/iterator/iterator_archetypes.hpp index 1d25915..d46f277 100644 --- a/include/boost/iterator/iterator_archetypes.hpp +++ b/include/boost/iterator/iterator_archetypes.hpp @@ -8,23 +8,17 @@ #include #include -#include #include -#include -#include -#include -#include +#include #include #include #include #include -#include #include -#include #include #include @@ -119,18 +113,18 @@ namespace detail template struct operator_brackets : mpl::eval_if< - is_convertible + std::is_convertible , mpl::eval_if< archetypes::has_access< AccessCategory , archetypes::writable_iterator_t > , mpl::identity > - , mpl::if_< + , std::conditional< archetypes::has_access< AccessCategory , archetypes::readable_iterator_t - > + >::value , readable_operator_brackets , no_operator_brackets > @@ -280,9 +274,9 @@ namespace detail template struct convertible_type - : mpl::if_< is_const, - typename remove_const::type, - bogus_type > + : std::conditional< std::is_const::value, + typename std::remove_const::type, + bogus_type > {}; } // namespace detail @@ -312,9 +306,9 @@ struct iterator_access_archetype_impl< template struct archetype { - typedef typename remove_cv::type value_type; - typedef Value reference; - typedef Value* pointer; + typedef typename std::remove_cv::type value_type; + typedef Value reference; + typedef Value* pointer; value_type operator*() const { return static_object::get(); } @@ -330,7 +324,7 @@ struct iterator_access_archetype_impl< template struct archetype { - BOOST_STATIC_ASSERT(!is_const::value); + static_assert(!std::is_const::value, ""); typedef void value_type; typedef void reference; typedef void pointer; @@ -381,7 +375,7 @@ struct iterator_access_archetype_impl Value, archetypes::readable_lvalue_iterator_t > { - BOOST_STATIC_ASSERT((!is_const::value)); + static_assert(!std::is_const::value, ""); }; }; @@ -392,7 +386,7 @@ struct iterator_archetype; template struct traversal_archetype_base : detail::operator_brackets< - typename remove_cv::type + typename std::remove_cv::type , AccessCategory , TraversalCategory > @@ -419,8 +413,8 @@ namespace detail archetypes::has_access< AccessCategory, archetypes::writable_iterator_t > - , remove_const - , add_const + , std::remove_const + , std::add_const >::type , typename access::reference >::type iterator_category; diff --git a/include/boost/iterator/iterator_categories.hpp b/include/boost/iterator/iterator_categories.hpp index baf805a..1fc53e6 100644 --- a/include/boost/iterator/iterator_categories.hpp +++ b/include/boost/iterator/iterator_categories.hpp @@ -16,10 +16,7 @@ # include # include -# include - -# include - +#include #include namespace boost { @@ -77,19 +74,19 @@ namespace detail template struct old_category_to_traversal : mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , void > @@ -107,7 +104,7 @@ namespace detail template struct iterator_category_to_traversal : mpl::eval_if< // if already convertible to a traversal tag, we're done. - is_convertible + std::is_convertible , mpl::identity , boost::iterators::detail::old_category_to_traversal > @@ -146,19 +143,19 @@ struct iterator_traversal template struct pure_traversal_tag : mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , mpl::eval_if< - is_convertible + std::is_convertible , mpl::identity , void > diff --git a/include/boost/iterator/iterator_concepts.hpp b/include/boost/iterator/iterator_concepts.hpp index 3c65553..ff039be 100644 --- a/include/boost/iterator/iterator_concepts.hpp +++ b/include/boost/iterator/iterator_concepts.hpp @@ -9,15 +9,7 @@ #include #include -#include -#include - -#include -#include -#include -#include - -#include +#include // Use boost/limits to work around missing limits headers on some compilers #include @@ -144,8 +136,8 @@ namespace boost_concepts { typedef typename std::iterator_traits::difference_type difference_type; - BOOST_STATIC_ASSERT(boost::is_integral::value); - BOOST_STATIC_ASSERT(std::numeric_limits::is_signed); + static_assert(std::is_integral::value, ""); + static_assert(std::numeric_limits::is_signed, ""); BOOST_CONCEPT_ASSERT(( boost::Convertible< diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index c4b5ae4..46bcf62 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -13,30 +13,19 @@ #include #include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include #include #include #include #include #include +#include #include +#include +#include #include // this goes last @@ -64,7 +53,7 @@ namespace iterators { // The type trait checks if the category or traversal is at least as advanced as the specified required traversal template< typename CategoryOrTraversal, typename Required > struct is_traversal_at_least : - public boost::is_convertible< typename iterator_category_to_traversal< CategoryOrTraversal >::type, Required > + public std::is_convertible< typename iterator_category_to_traversal< CategoryOrTraversal >::type, Required > {}; // @@ -76,8 +65,8 @@ namespace iterators { , class Return > struct enable_if_interoperable : - public boost::iterators::enable_if< - is_interoperable< Facade1, Facade2 > + public std::enable_if< + is_interoperable::value , Return > {}; @@ -91,12 +80,12 @@ namespace iterators { , class Return > struct enable_if_interoperable_and_random_access_traversal : - public boost::iterators::enable_if< + public std::enable_if< mpl::and_< is_interoperable< Facade1, Facade2 > , is_traversal_at_least< typename iterator_category< Facade1 >::type, random_access_traversal_tag > , is_traversal_at_least< typename iterator_category< Facade2 >::type, random_access_traversal_tag > - > + >::value , Return > {}; @@ -117,13 +106,13 @@ namespace iterators { CategoryOrTraversal, ValueParam, Reference >::type iterator_category; - typedef typename remove_const::type value_type; + typedef typename std::remove_const::type value_type; // Not the real associated pointer type typedef typename mpl::eval_if< boost::iterators::detail::iterator_writability_disabled - , add_pointer - , add_pointer + , std::add_pointer + , std::add_pointer >::type pointer; # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ @@ -180,7 +169,7 @@ namespace iterators { // Provides (r++)->foo() value_type* operator->() const { - return boost::addressof(stored_value); + return std::addressof(stored_value); } private: @@ -240,38 +229,15 @@ namespace iterators { } // Provides writability of *r++ -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - typename iterators::enable_if< - is_not_writable_postfix_increment_dereference_proxy< T >, + typename std::enable_if< + is_not_writable_postfix_increment_dereference_proxy::value, writable_postfix_increment_dereference_proxy const& >::type operator=(T&& x) const { *this->stored_iterator = static_cast< T&& >(x); return *this; } -#else - template - typename iterators::enable_if< - is_not_writable_postfix_increment_dereference_proxy< T >, - writable_postfix_increment_dereference_proxy const& - >::type operator=(T const& x) const - { - *this->stored_iterator = x; - return *this; - } - - // This overload just in case only non-const objects are writable - template - typename iterators::enable_if< - is_not_writable_postfix_increment_dereference_proxy< T >, - writable_postfix_increment_dereference_proxy const& - >::type operator=(T& x) const - { - *this->stored_iterator = x; - return *this; - } -#endif private: Iterator stored_iterator; @@ -303,7 +269,7 @@ namespace iterators { // Provides (r++)->foo() value_type* operator->() const { - return boost::addressof(dereference_proxy.stored_value); + return std::addressof(dereference_proxy.stored_value); } private: @@ -318,11 +284,11 @@ namespace iterators { static Reference r; template - static typename mpl::if_< - is_convertible< + static typename std::conditional< + std::is_convertible< R const volatile* , Value const volatile* - > + >::value , char[1] , char[2] >::type& helper(R const&); @@ -339,8 +305,8 @@ namespace iterators { # else template struct is_non_proxy_reference - : is_convertible< - typename remove_reference::type + : std::is_convertible< + typename std::remove_reference::type const volatile* , Value const volatile* > @@ -367,20 +333,20 @@ namespace iterators { : mpl::eval_if< mpl::and_< // A proxy is only needed for readable iterators - is_convertible< + std::is_convertible< Reference // Use add_lvalue_reference to form `reference to Value` due to // some (strict) C++03 compilers (e.g. `gcc -std=c++03`) reject // 'reference-to-reference' in the template which described in CWG // DR106. // http://www.open-std.org/Jtc1/sc22/wg21/docs/cwg_defects.html#106 - , typename add_lvalue_reference::type + , typename std::add_lvalue_reference::type > // No multipass iterator can have values that disappear // before positions can be re-visited , mpl::not_< - is_convertible< + std::is_convertible< typename iterator_category_to_traversal::type , forward_traversal_tag > @@ -405,10 +371,10 @@ namespace iterators { struct proxy { explicit proxy(Reference const & x) : m_ref(x) {} - Reference* operator->() { return boost::addressof(m_ref); } + Reference* operator->() { return std::addressof(m_ref); } // This function is needed for MWCW and BCC, which won't call // operator-> again automatically per 13.3.1.2 para 8 - operator Reference*() { return boost::addressof(m_ref); } + operator Reference*() { return std::addressof(m_ref); } Reference m_ref; }; typedef proxy result_type; @@ -424,7 +390,7 @@ namespace iterators { typedef Pointer result_type; static result_type apply(T& x) { - return boost::addressof(x); + return std::addressof(x); } }; @@ -467,7 +433,8 @@ namespace iterators { mpl::and_< // Really we want an is_copy_constructible trait here, // but is_POD will have to suffice in the meantime. - boost::is_POD + std::is_standard_layout + , std::is_trivial , iterator_writability_disabled > > @@ -476,8 +443,8 @@ namespace iterators { template struct operator_brackets_result { - typedef typename mpl::if_< - use_operator_brackets_proxy + typedef typename std::conditional< + use_operator_brackets_proxy::value , operator_brackets_proxy , Value >::type type; @@ -498,19 +465,12 @@ namespace iterators { struct choose_difference_type { template - struct apply - : -# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP - iterator_difference -# else - mpl::eval_if< - is_convertible - , iterator_difference - , iterator_difference - > -# endif + struct apply : mpl::eval_if< + std::is_convertible + , iterator_difference + , iterator_difference + > {}; - }; template < @@ -528,17 +488,6 @@ namespace iterators { // Macros which describe the declarations of binary operators -# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY -# define BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, enabler) \ - template < \ - class Derived1, class V1, class TC1, class Reference1, class Difference1 \ - , class Derived2, class V2, class TC2, class Reference2, class Difference2 \ - > \ - prefix typename mpl::apply2::type \ - operator op( \ - iterator_facade const& lhs \ - , iterator_facade const& rhs) -# else # define BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, enabler) \ template < \ class Derived1, class V1, class TC1, class Reference1, class Difference1 \ @@ -551,7 +500,6 @@ namespace iterators { operator op( \ iterator_facade const& lhs \ , iterator_facade const& rhs) -# endif # define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \ BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, boost::iterators::detail::enable_if_interoperable) @@ -561,9 +509,12 @@ namespace iterators { # define BOOST_ITERATOR_FACADE_PLUS_HEAD(prefix,args) \ template \ - prefix typename boost::iterators::enable_if< \ - boost::iterators::detail::is_traversal_at_least< TC, boost::iterators::random_access_traversal_tag >, \ - Derived \ + prefix typename std::enable_if< \ + boost::iterators::detail::is_traversal_at_least< \ + TC \ + , boost::iterators::random_access_traversal_tag \ + >::value \ + , Derived \ >::type operator+ args // @@ -644,13 +595,13 @@ namespace iterators { } template - static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::true_) + static bool equal(Facade1 const& f1, Facade2 const& f2, std::true_type) { return f1.equal(f2); } template - static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::false_) + static bool equal(Facade1 const& f1, Facade2 const& f2, std::false_type) { return f2.equal(f1); } @@ -663,14 +614,14 @@ namespace iterators { template static typename Facade1::difference_type distance_from( - Facade1 const& f1, Facade2 const& f2, mpl::true_) + Facade1 const& f1, Facade2 const& f2, std::true_type) { return -f1.distance_to(f2); } template static typename Facade2::difference_type distance_from( - Facade1 const& f1, Facade2 const& f2, mpl::false_) + Facade1 const& f1, Facade2 const& f2, std::false_type) { return f2.distance_to(f1); } @@ -950,19 +901,13 @@ namespace iterators { // ---------------- // -# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP -# define BOOST_ITERATOR_CONVERTIBLE(a,b) mpl::true_() -# else -# define BOOST_ITERATOR_CONVERTIBLE(a,b) is_convertible() -# endif +# define BOOST_ITERATOR_CONVERTIBLE(a,b) std::is_convertible() # define BOOST_ITERATOR_FACADE_INTEROP(op, result_type, return_prefix, base_op) \ BOOST_ITERATOR_FACADE_INTEROP_HEAD(inline, op, result_type) \ { \ /* For those compilers that do not support enable_if */ \ - BOOST_STATIC_ASSERT(( \ - is_interoperable< Derived1, Derived2 >::value \ - )); \ + static_assert(is_interoperable::value, ""); \ return_prefix iterator_core_access::base_op( \ *static_cast(&lhs) \ , *static_cast(&rhs) \ @@ -973,7 +918,7 @@ namespace iterators { # define BOOST_ITERATOR_FACADE_RELATION(op, return_prefix, base_op) \ BOOST_ITERATOR_FACADE_INTEROP( \ op \ - , boost::iterators::detail::always_bool2 \ + , boost::iterators::detail::always_bool2 \ , return_prefix \ , base_op \ ) @@ -988,11 +933,12 @@ namespace iterators { BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(inline, op, result_type) \ { \ /* For those compilers that do not support enable_if */ \ - BOOST_STATIC_ASSERT(( \ + static_assert( \ is_interoperable< Derived1, Derived2 >::value && \ boost::iterators::detail::is_traversal_at_least< typename iterator_category< Derived1 >::type, random_access_traversal_tag >::value && \ - boost::iterators::detail::is_traversal_at_least< typename iterator_category< Derived2 >::type, random_access_traversal_tag >::value \ - )); \ + boost::iterators::detail::is_traversal_at_least< typename iterator_category< Derived2 >::type, random_access_traversal_tag >::value, \ + "" \ + ); \ return_prefix iterator_core_access::base_op( \ *static_cast(&lhs) \ , *static_cast(&rhs) \ @@ -1002,10 +948,10 @@ namespace iterators { # define BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(op, return_prefix, base_op) \ BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS( \ - op \ - , boost::iterators::detail::always_bool2 \ - , return_prefix \ - , base_op \ + op \ + , boost::iterators::detail::always_bool2 \ + , return_prefix \ + , base_op \ ) BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(<, return 0 >, distance_from) diff --git a/include/boost/iterator/minimum_category.hpp b/include/boost/iterator/minimum_category.hpp index 15679bc..03720d9 100644 --- a/include/boost/iterator/minimum_category.hpp +++ b/include/boost/iterator/minimum_category.hpp @@ -4,9 +4,7 @@ #ifndef BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ # define BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ -# include -# include -# include +# include # include # include @@ -44,7 +42,7 @@ struct minimum_category_impl { template struct apply { - BOOST_STATIC_ASSERT((is_same::value)); + static_assert(std::is_same::value, ""); typedef T1 type; }; }; @@ -68,8 +66,8 @@ template struct minimum_category { typedef boost::iterators::detail::minimum_category_impl< - ::boost::is_convertible::value - , ::boost::is_convertible::value + std::is_convertible::value + , std::is_convertible::value > outer; typedef typename outer::template apply inner; diff --git a/include/boost/iterator/new_iterator_tests.hpp b/include/boost/iterator/new_iterator_tests.hpp index 2091e59..eb87573 100644 --- a/include/boost/iterator/new_iterator_tests.hpp +++ b/include/boost/iterator/new_iterator_tests.hpp @@ -29,13 +29,11 @@ // (David Abrahams) # include -# include +# include # include // for detail::dummy_constructor # include # include # include -# include -# include # include # include @@ -90,7 +88,7 @@ void readable_iterator_test(const Iterator i1, T v) // I think we don't really need this as it checks the same things as // the above code. - BOOST_STATIC_ASSERT(is_readable_iterator::value); + static_assert(is_readable_iterator::value, ""); # endif } @@ -125,12 +123,12 @@ void constant_lvalue_iterator_test(Iterator i, T v1) Iterator i2(i); typedef typename std::iterator_traits::value_type value_type; typedef typename std::iterator_traits::reference reference; - BOOST_STATIC_ASSERT((is_same::value)); + static_assert(std::is_same::value, ""); const T& v2 = *i2; BOOST_TEST(v1 == v2); # ifndef BOOST_NO_LVALUE_RETURN_DETECTION - BOOST_STATIC_ASSERT(is_lvalue_iterator::value); - BOOST_STATIC_ASSERT(!is_non_const_lvalue_iterator::value); + static_assert(is_lvalue_iterator::value, ""); + static_assert(!is_non_const_lvalue_iterator::value, ""); # endif } @@ -140,19 +138,19 @@ void non_const_lvalue_iterator_test(Iterator i, T v1, T v2) Iterator i2(i); typedef typename std::iterator_traits::value_type value_type; typedef typename std::iterator_traits::reference reference; - BOOST_STATIC_ASSERT((is_same::value)); + static_assert(std::is_same::value, ""); T& v3 = *i2; BOOST_TEST(v1 == v3); - // A non-const lvalue iterator is not neccessarily writable, but we + // A non-const lvalue iterator is not necessarily writable, but we // are assuming the value_type is assignable here *i = v2; T& v4 = *i2; BOOST_TEST(v2 == v4); # ifndef BOOST_NO_LVALUE_RETURN_DETECTION - BOOST_STATIC_ASSERT(is_lvalue_iterator::value); - BOOST_STATIC_ASSERT(is_non_const_lvalue_iterator::value); + static_assert(is_lvalue_iterator::value, ""); + static_assert(is_non_const_lvalue_iterator::value, ""); # endif } diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index 5b2b810..cab87bc 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -9,28 +9,13 @@ #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) -#include -#endif - -#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) -#include -#endif - #include @@ -103,7 +88,7 @@ namespace iterators { #if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // don't provide this constructor if UnaryFunc is a // function pointer type, since it will be 0. Too dangerous. - BOOST_STATIC_ASSERT(is_class::value); + static_assert(std::is_class::value, ""); #endif } @@ -149,8 +134,8 @@ namespace iterators { // function pointer in the iterator be 0, leading to a runtime // crash. template - inline typename iterators::enable_if< - is_class // We should probably find a cheaper test than is_class<> + inline typename std::enable_if< + std::is_class::value // We should probably find a cheaper test than is_class<> , transform_iterator >::type make_transform_iterator(Iterator it) diff --git a/include/boost/iterator/zip_iterator.hpp b/include/boost/iterator/zip_iterator.hpp index f5780ae..f97fb29 100644 --- a/include/boost/iterator/zip_iterator.hpp +++ b/include/boost/iterator/zip_iterator.hpp @@ -8,7 +8,6 @@ #ifndef BOOST_ZIP_ITERATOR_TMB_07_13_2003_HPP_ # define BOOST_ZIP_ITERATOR_TMB_07_13_2003_HPP_ -#include #include #include #include // for enable_if_convertible @@ -19,9 +18,6 @@ #include // for std::pair #include // for backward compatibility -#include -#include - #include #include #include @@ -83,7 +79,7 @@ namespace iterators { struct result { typedef typename - remove_cv::type>::type + std::remove_cv::type>::type iterator; typedef typename iterator_reference::type type; diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index a683683..a810a3b 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -20,13 +20,10 @@ // (David Abrahams) # include -# include +# include # include // for detail::dummy_constructor # include # include -# include -# include -# include namespace boost { @@ -143,10 +140,9 @@ template struct lvalue_test typedef typename Iterator::reference reference; typedef typename Iterator::value_type value_type; # endif - BOOST_STATIC_ASSERT(boost::is_reference::value); - BOOST_STATIC_ASSERT((boost::is_same::value - || boost::is_same::value - )); + static_assert(std::is_reference::value, ""); + static_assert(std::is_same::value + || std::is_same::value, ""); } }; @@ -180,7 +176,7 @@ void forward_iterator_test(Iterator i, T v1, T v2) // borland doesn't allow non-type template parameters # if !defined(BOOST_BORLANDC) || (BOOST_BORLANDC > 0x551) - lvalue_test<(boost::is_pointer::value)>::check(i); + lvalue_test::value>::check(i); #endif } diff --git a/include/boost/pointee.hpp b/include/boost/pointee.hpp index 69efa94..b177e73 100644 --- a/include/boost/pointee.hpp +++ b/include/boost/pointee.hpp @@ -15,12 +15,10 @@ # include # include -# include -# include -# include # include #include +#include namespace boost { @@ -49,13 +47,13 @@ namespace detail BOOST_STATIC_CONSTANT(bool, is_constant = sizeof(impl::test(*impl::x)) == 1); - typedef typename mpl::if_c< + typedef typename std::conditional< # if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) ::boost::detail::iterator_pointee::is_constant # else is_constant # endif - , typename add_const::type + , typename std::add_const::type , value_type >::type type; }; diff --git a/test/counting_iterator_test.cpp b/test/counting_iterator_test.cpp index 09d4295..d26938a 100644 --- a/test/counting_iterator_test.cpp +++ b/test/counting_iterator_test.cpp @@ -30,13 +30,12 @@ #include #include -#include #include #include #include -#include #include +#include #include #ifndef BOOST_BORLANDC # include @@ -68,7 +67,7 @@ struct unsigned_assert_nonnegative template struct assert_nonnegative - : boost::conditional< + : std::conditional< std::numeric_limits::is_signed , signed_assert_nonnegative , unsigned_assert_nonnegative diff --git a/test/detail/zip_iterator_test.ipp b/test/detail/zip_iterator_test.ipp index 7e0d2f7..39c223c 100644 --- a/test/detail/zip_iterator_test.ipp +++ b/test/detail/zip_iterator_test.ipp @@ -8,6 +8,7 @@ #include +#include #include #include #include diff --git a/test/filter_iterator_test.cpp b/test/filter_iterator_test.cpp index cf850bc..b0b1caf 100644 --- a/test/filter_iterator_test.cpp +++ b/test/filter_iterator_test.cpp @@ -7,15 +7,14 @@ #include #include #include -#include #include #include #include #include #include +#include #include -#include using boost::dummyT; @@ -229,12 +228,12 @@ int main() filter_iter(one_or_four(), array, array+N) , dummyT(1), dummyT(4)); - BOOST_STATIC_ASSERT( - (!boost::is_convertible< + static_assert( + !std::is_convertible< boost::iterator_traversal::type , boost::random_access_traversal_tag - >::value - )); + >::value, + ""); //# endif diff --git a/test/function_input_iterator_test.cpp b/test/function_input_iterator_test.cpp index f64e9f5..6668d83 100644 --- a/test/function_input_iterator_test.cpp +++ b/test/function_input_iterator_test.cpp @@ -11,14 +11,12 @@ #include -#if !defined(BOOST_NO_CXX11_DECLTYPE) // Force boost::result_of use decltype, even on compilers that don't support N3276. // This enables this test to also verify if the iterator works with lambdas // on such compilers with this config macro. Note that without the macro result_of // (and consequently the iterator) is guaranteed to _not_ work, so this case is not // worth testing anyway. #define BOOST_RESULT_OF_USE_DECLTYPE -#endif #include #include @@ -108,8 +106,6 @@ int main() BOOST_TEST_EQ(*it3, 54); } -#if !defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) \ - && defined(BOOST_RESULT_OF_USE_DECLTYPE) // test the iterator with lambda expressions int num = 42; auto lambda_generator = [&num] { return num++; }; @@ -123,7 +119,6 @@ int main() BOOST_TEST_EQ(generated.size(), 10u); for(std::size_t i = 0; i != 10; ++i) BOOST_TEST_EQ(generated[i], static_cast(42 + i)); -#endif // BOOST_NO_CXX11_LAMBDAS return boost::report_errors(); } diff --git a/test/function_output_iterator_test.cpp b/test/function_output_iterator_test.cpp index c18592d..c55c160 100644 --- a/test/function_output_iterator_test.cpp +++ b/test/function_output_iterator_test.cpp @@ -44,7 +44,6 @@ int main() BOOST_TEST_EQ(n, 6); } -#if !defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) { int n = 0; auto it = boost::iterators::make_function_output_iterator([&n](int x) { n -= x; }); @@ -57,7 +56,6 @@ int main() BOOST_TEST_EQ(n, -6); } -#endif #if defined(__cpp_lib_concepts) && ( __cpp_lib_concepts >= 202002L ) { diff --git a/test/indirect_iter_member_types.cpp b/test/indirect_iter_member_types.cpp index 240e664..261a510 100644 --- a/test/indirect_iter_member_types.cpp +++ b/test/indirect_iter_member_types.cpp @@ -9,12 +9,10 @@ #include -#include #include -#include #include "static_assert_same.hpp" -#include +#include struct zow { }; @@ -40,10 +38,12 @@ int main() STATIC_ASSERT_SAME(Iter::pointer, int*); STATIC_ASSERT_SAME(Iter::difference_type, std::ptrdiff_t); - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - BOOST_STATIC_ASSERT((boost::is_convertible::type, - boost::random_access_traversal_tag>::value)); + static_assert(std::is_convertible::value, + ""); + static_assert(std::is_convertible::type, + boost::random_access_traversal_tag>::value, + ""); } { typedef boost::indirect_iterator Iter; @@ -71,10 +71,12 @@ int main() STATIC_ASSERT_SAME(Iter::difference_type, std::ptrdiff_t); - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - BOOST_STATIC_ASSERT((boost::is_convertible::type, - boost::random_access_traversal_tag>::value)); + static_assert(std::is_convertible::value, + ""); + static_assert(std::is_convertible::type, + boost::random_access_traversal_tag>::value, + ""); } { typedef boost::indirect_iterator Iter; diff --git a/test/is_convertible_fail.cpp b/test/is_convertible_fail.cpp index 757b5c6..89255fc 100644 --- a/test/is_convertible_fail.cpp +++ b/test/is_convertible_fail.cpp @@ -8,12 +8,13 @@ // #include #include +#include int main() { typedef boost::reverse_iterator rev_iter1; typedef boost::reverse_iterator rev_iter2; - return boost::is_convertible::value + return std::is_convertible::value ? boost::exit_failure : boost::exit_success; } diff --git a/test/is_lvalue_iterator.cpp b/test/is_lvalue_iterator.cpp index 16de014..a0eea82 100644 --- a/test/is_lvalue_iterator.cpp +++ b/test/is_lvalue_iterator.cpp @@ -4,9 +4,7 @@ #include #include -#include #include // std::ptrdiff_t -#include #include #include @@ -91,58 +89,58 @@ struct constant_lvalue_iterator int main() { - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::iterator>::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::const_iterator>::value); - BOOST_STATIC_ASSERT(!boost::is_lvalue_iterator > >::value); - BOOST_STATIC_ASSERT(!boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_lvalue_iterator >::value); + static_assert(boost::is_lvalue_iterator::value, ""); + static_assert(boost::is_lvalue_iterator::value, ""); + static_assert(boost::is_lvalue_iterator::iterator>::value, ""); + static_assert(boost::is_lvalue_iterator::const_iterator>::value, ""); + static_assert(!boost::is_lvalue_iterator > >::value, ""); + static_assert(!boost::is_lvalue_iterator >::value, ""); + static_assert(!boost::is_lvalue_iterator >::value, ""); + static_assert(!boost::is_lvalue_iterator >::value, ""); #ifndef BOOST_NO_LVALUE_RETURN_DETECTION - BOOST_STATIC_ASSERT(!boost::is_lvalue_iterator::value); + static_assert(!boost::is_lvalue_iterator::value, ""); #endif // Make sure inaccessible copy constructor doesn't prevent // reference binding - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); + static_assert(boost::is_lvalue_iterator::value, ""); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); + static_assert(boost::is_lvalue_iterator >::value, ""); + static_assert(boost::is_lvalue_iterator >::value, ""); + static_assert(boost::is_lvalue_iterator >::value, ""); + static_assert(boost::is_lvalue_iterator >::value, ""); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator >::value); + static_assert(boost::is_lvalue_iterator >::value, ""); + static_assert(boost::is_lvalue_iterator >::value, ""); + static_assert(boost::is_lvalue_iterator >::value, ""); + static_assert(boost::is_lvalue_iterator >::value, ""); - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::value); - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator::iterator>::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::const_iterator>::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator > >::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); + static_assert(boost::is_non_const_lvalue_iterator::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator::value, ""); + static_assert(boost::is_non_const_lvalue_iterator::iterator>::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator::const_iterator>::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator > >::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); #ifndef BOOST_NO_LVALUE_RETURN_DETECTION - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::value); + static_assert(!boost::is_non_const_lvalue_iterator::value, ""); #endif - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator::value); + static_assert(!boost::is_non_const_lvalue_iterator::value, ""); - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); + static_assert(boost::is_non_const_lvalue_iterator >::value, ""); #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); + static_assert(boost::is_non_const_lvalue_iterator >::value, ""); #endif - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator >::value); + static_assert(boost::is_non_const_lvalue_iterator >::value, ""); + static_assert(boost::is_non_const_lvalue_iterator >::value, ""); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); - BOOST_STATIC_ASSERT(!boost::is_non_const_lvalue_iterator >::value); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); + static_assert(!boost::is_non_const_lvalue_iterator >::value, ""); return 0; } diff --git a/test/is_readable_iterator.cpp b/test/is_readable_iterator.cpp index 1d33a64..39c4d75 100644 --- a/test/is_readable_iterator.cpp +++ b/test/is_readable_iterator.cpp @@ -4,9 +4,7 @@ #include #include -#include #include // std::ptrdiff_t -#include #include #include @@ -78,19 +76,19 @@ struct proxy_iterator2 int main() { - BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); - BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); - BOOST_STATIC_ASSERT(boost::is_readable_iterator::iterator>::value); - BOOST_STATIC_ASSERT(boost::is_readable_iterator::const_iterator>::value); - BOOST_STATIC_ASSERT(!boost::is_readable_iterator > >::value); - BOOST_STATIC_ASSERT(!boost::is_readable_iterator >::value); - BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); - BOOST_STATIC_ASSERT(!boost::is_readable_iterator::value); - BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); + static_assert(boost::is_readable_iterator::value, ""); + static_assert(boost::is_readable_iterator::value, ""); + static_assert(boost::is_readable_iterator::iterator>::value, ""); + static_assert(boost::is_readable_iterator::const_iterator>::value, ""); + static_assert(!boost::is_readable_iterator > >::value, ""); + static_assert(!boost::is_readable_iterator >::value, ""); + static_assert(boost::is_readable_iterator::value, ""); + static_assert(!boost::is_readable_iterator::value, ""); + static_assert(boost::is_readable_iterator::value, ""); // Make sure inaccessible copy constructor doesn't prevent // readability - BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); + static_assert(boost::is_readable_iterator::value, ""); return 0; } diff --git a/test/iterator_adaptor_cc.cpp b/test/iterator_adaptor_cc.cpp index 2ea7582..6b0b73c 100644 --- a/test/iterator_adaptor_cc.cpp +++ b/test/iterator_adaptor_cc.cpp @@ -27,7 +27,7 @@ int main() #if defined(__SGI_STL_PORT) \ || !BOOST_WORKAROUND(__GNUC__, <= 2) \ && !(BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 1)) \ - && !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) \ + && !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) \ && !BOOST_WORKAROUND(__LIBCOMO_VERSION__, BOOST_TESTED_AT(29)) \ && !BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 1) { diff --git a/test/iterator_adaptor_test.cpp b/test/iterator_adaptor_test.cpp index 4b37c14..ef5b9a4 100644 --- a/test/iterator_adaptor_test.cpp +++ b/test/iterator_adaptor_test.cpp @@ -209,7 +209,7 @@ main() test = static_assert_same::value; test = static_assert_same::value; #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - BOOST_STATIC_ASSERT((boost::is_convertible::value)); + static_assert(std::is_convertible::value, ""); #endif } @@ -220,9 +220,9 @@ main() test = static_assert_same::value; #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - BOOST_STATIC_ASSERT(boost::is_readable_iterator::value); + static_assert(boost::is_readable_iterator::value, ""); # ifndef BOOST_NO_LVALUE_RETURN_DETECTION - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); + static_assert(boost::is_lvalue_iterator::value, ""); # endif #endif @@ -243,8 +243,8 @@ main() #endif #ifndef BOOST_NO_LVALUE_RETURN_DETECTION - BOOST_STATIC_ASSERT(boost::is_non_const_lvalue_iterator::value); - BOOST_STATIC_ASSERT(boost::is_lvalue_iterator::value); + static_assert(boost::is_non_const_lvalue_iterator::value, ""); + static_assert(boost::is_lvalue_iterator::value, ""); #endif typedef modify_traversal IncrementableIter; diff --git a/test/iterator_facade.cpp b/test/iterator_facade.cpp index 7351dd3..09fd88e 100644 --- a/test/iterator_facade.cpp +++ b/test/iterator_facade.cpp @@ -8,8 +8,7 @@ #include #include -#include -#include +#include // This is a really, really limited test so far. All we're doing // right now is checking that the postfix++ proxy for single-pass @@ -120,7 +119,7 @@ struct wrapper { } template wrapper(const wrapper& other, - typename boost::enable_if< boost::is_convertible >::type* = 0) + typename std::enable_if< std::is_convertible::value >::type* = 0) : m_x(other.m_x) { } }; @@ -146,7 +145,7 @@ struct iterator_with_proxy_reference template void same_type(U const&) -{ BOOST_STATIC_ASSERT((boost::is_same::value)); } +{ static_assert(std::is_same::value, ""); } template struct abstract_iterator diff --git a/test/iterator_traits_test.cpp b/test/iterator_traits_test.cpp index 40da049..d2b84c3 100644 --- a/test/iterator_traits_test.cpp +++ b/test/iterator_traits_test.cpp @@ -20,15 +20,13 @@ // reference type from operator* (David Abrahams) // 19 Jan 2001 Initial version with iterator operators (David Abrahams) -#include #include -#include #include #include #include #include #include -#include +#include // A UDT for which we can specialize std::iterator_traits on // compilers which don't support partial specialization. There's no @@ -98,7 +96,7 @@ template <> struct assertion template struct assert_same - : assertion<(::boost::is_same::value)> + : assertion<(std::is_same::value)> { }; diff --git a/test/minimum_category.cpp b/test/minimum_category.cpp index 3f89d6c..54f7e7a 100644 --- a/test/minimum_category.cpp +++ b/test/minimum_category.cpp @@ -6,10 +6,10 @@ #include #include -#include #include +#include -using boost::is_same; +using std::is_same; using boost::iterators::minimum_category; int main(int, char*[]) diff --git a/test/permutation_iterator_test.cpp b/test/permutation_iterator_test.cpp index 81cdefe..ac82701 100644 --- a/test/permutation_iterator_test.cpp +++ b/test/permutation_iterator_test.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -44,7 +43,7 @@ void permutation_test() const int element_range_size = 10; const int index_size = 7; - BOOST_STATIC_ASSERT(index_size <= element_range_size); + static_assert(index_size <= element_range_size, ""); element_range_type elements( element_range_size ); for( element_range_type::iterator el_it = elements.begin(); el_it != elements.end(); ++el_it ) { *el_it = std::distance(elements.begin(), el_it); } diff --git a/test/pointee.cpp b/test/pointee.cpp index 32e3496..4e54599 100644 --- a/test/pointee.cpp +++ b/test/pointee.cpp @@ -3,10 +3,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include "static_assert_same.hpp" #include #include +#include template struct proxy_ptr @@ -27,7 +27,7 @@ struct proxy_ref_ptr : proxy_ptr template struct proxy_value_ptr : proxy_ptr { - typedef typename boost::add_const::type element_type; + typedef typename std::add_const::type element_type; }; struct X { diff --git a/test/range_distance_compat_test.cpp b/test/range_distance_compat_test.cpp index ef7e301..5501810 100644 --- a/test/range_distance_compat_test.cpp +++ b/test/range_distance_compat_test.cpp @@ -5,6 +5,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include diff --git a/test/reverse_iterator_test.cpp b/test/reverse_iterator_test.cpp index c2e4a41..4be9734 100644 --- a/test/reverse_iterator_test.cpp +++ b/test/reverse_iterator_test.cpp @@ -161,7 +161,7 @@ int main() #if defined(__SGI_STL_PORT) \ || !BOOST_WORKAROUND(__GNUC__, <= 2) \ && !(BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 1)) \ - && !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) \ + && !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) \ && !BOOST_WORKAROUND(__LIBCOMO_VERSION__, BOOST_TESTED_AT(29)) \ && !BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 1) diff --git a/test/static_assert_same.hpp b/test/static_assert_same.hpp index 5d96da9..2911845 100644 --- a/test/static_assert_same.hpp +++ b/test/static_assert_same.hpp @@ -5,10 +5,9 @@ #ifndef STATIC_ASSERT_SAME_DWA2003530_HPP # define STATIC_ASSERT_SAME_DWA2003530_HPP -#include -#include +#include -#define STATIC_ASSERT_SAME( T1,T2 ) BOOST_STATIC_ASSERT((::boost::is_same< T1, T2 >::value)) +#define STATIC_ASSERT_SAME( T1,T2 ) static_assert(std::is_same::value, "") template struct static_assert_same diff --git a/test/transform_iterator_test.cpp b/test/transform_iterator_test.cpp index b22cb16..3fd788e 100644 --- a/test/transform_iterator_test.cpp +++ b/test/transform_iterator_test.cpp @@ -172,20 +172,20 @@ main() { { typedef boost::transform_iterator iter_t; - BOOST_STATIC_ASSERT((boost::is_same::value)); - BOOST_STATIC_ASSERT((boost::is_same::value)); + static_assert(boost::is_same::value, ""); + static_assert(boost::is_same::value, ""); } { typedef boost::transform_iterator iter_t; - BOOST_STATIC_ASSERT((boost::is_same::value)); - BOOST_STATIC_ASSERT((boost::is_same::value)); + static_assert(boost::is_same::value, ""); + static_assert(boost::is_same::value, ""); } { typedef boost::transform_iterator iter_t; - BOOST_STATIC_ASSERT((boost::is_same::value)); - BOOST_STATIC_ASSERT((boost::is_same::value)); + static_assert(boost::is_same::value, ""); + static_assert(boost::is_same::value, ""); } } diff --git a/test/unit_tests.cpp b/test/unit_tests.cpp index 656e72f..bbb4bb8 100644 --- a/test/unit_tests.cpp +++ b/test/unit_tests.cpp @@ -3,10 +3,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include -#include #include "static_assert_same.hpp" +#include #include struct X { int a; }; @@ -38,32 +38,41 @@ void category_test() using namespace boost::iterators; using namespace boost::iterators::detail; - BOOST_STATIC_ASSERT(( - !boost::is_convertible< + static_assert( + !std::is_convertible< std::input_iterator_tag - , input_output_iterator_tag>::value)); + , input_output_iterator_tag>::value, + ""); - BOOST_STATIC_ASSERT(( - !boost::is_convertible< + static_assert( + !std::is_convertible< std::output_iterator_tag - , input_output_iterator_tag>::value)); + , input_output_iterator_tag + >::value, + ""); - BOOST_STATIC_ASSERT(( - boost::is_convertible< + static_assert( + std::is_convertible< input_output_iterator_tag - , std::input_iterator_tag>::value)); + , std::input_iterator_tag + >::value, + ""); - BOOST_STATIC_ASSERT(( - boost::is_convertible< + static_assert( + std::is_convertible< input_output_iterator_tag - , std::output_iterator_tag>::value)); + , std::output_iterator_tag + >::value, + ""); #if 0 // This seems wrong; we're not advertising // input_output_iterator_tag are we? - BOOST_STATIC_ASSERT(( + static_assert( boost::is_convertible< std::forward_iterator_tag - , input_output_iterator_tag>::value)); + , input_output_iterator_tag + >::value, + ""); #endif int test = static_assert_min_cat<