From ef1318907dfdd34981cc990d80d6a54cea35042b Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Sat, 28 Sep 2019 01:47:28 +0300 Subject: [PATCH 1/2] Clean up remnants Usages were removed in: - ebbfe6559541eef5c63da1de1da463de0535bd85 for detail/collection_traits.hpp - c08103b1c5012e47af6eac20d1d720ca2a4437e9 for detail/difference_type.hpp - 901266b76a05b0afd8e2bd461febbac797a7d1d9 for detail/empty.hpp - detail/sizer.hpp has been never used --- .../boost/range/detail/collection_traits.hpp | 237 ---------- .../range/detail/collection_traits_detail.hpp | 447 ------------------ .../boost/range/detail/difference_type.hpp | 121 ----- include/boost/range/detail/empty.hpp | 120 ----- include/boost/range/detail/sizer.hpp | 35 -- 5 files changed, 960 deletions(-) delete mode 100644 include/boost/range/detail/collection_traits.hpp delete mode 100644 include/boost/range/detail/collection_traits_detail.hpp delete mode 100644 include/boost/range/detail/difference_type.hpp delete mode 100644 include/boost/range/detail/empty.hpp delete mode 100644 include/boost/range/detail/sizer.hpp diff --git a/include/boost/range/detail/collection_traits.hpp b/include/boost/range/detail/collection_traits.hpp deleted file mode 100644 index 75b2b2b8d..000000000 --- a/include/boost/range/detail/collection_traits.hpp +++ /dev/null @@ -1,237 +0,0 @@ -// Boost string_algo library collection_traits.hpp header file -------------// - -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is subject to 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) - -// (C) Copyright Thorsten Ottosen 2002-2003. Use, modification and -// distribution is subject to 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) - -// (C) Copyright Jeremy Siek 2001. Use, modification and -// distribution is subject to 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) - -// Original idea of container traits was proposed by Jeremy Siek and -// Thorsten Ottosen. This implementation is lightweighted version -// of container_traits adapter for usage with string_algo library - -#ifndef BOOST_RANGE_STRING_COLLECTION_TRAITS_HPP -#define BOOST_RANGE_STRING_COLLECTION_TRAITS_HPP - -#include -#include -#include - -// Implementation -#include - -/*! \file - Defines collection_traits class and related free-standing functions. - This facility is used to unify the access to different types of collections. - It allows the algorithms in the library to work with STL collections, c-style - array, null-terminated c-strings (and more) using the same interface. -*/ - -namespace boost { - namespace algorithm { - -// collection_traits template class -----------------------------------------// - - //! collection_traits class - /*! - Collection traits provide uniform access to different types of - collections. This functionality allows to write generic algorithms - which work with several different kinds of collections. - - Currently following collection types are supported: - - containers with STL compatible container interface ( see ContainerConcept ) - ( i.e. \c std::vector<>, \c std::list<>, \c std::string<> ... ) - - c-style array - ( \c char[10], \c int[15] ... ) - - null-terminated c-strings - ( \c char*, \c wchar_T* ) - - std::pair of iterators - ( i.e \c std::pair::iterator,vector::iterator> ) - - Collection traits provide an external collection interface operations. - All are accessible using free-standing functions. - - The following operations are supported: - - \c size() - - \c empty() - - \c begin() - - \c end() - - Container traits have somewhat limited functionality on compilers not - supporting partial template specialization and partial template ordering. - */ - template< typename T > - struct collection_traits - { - private: - typedef typename ::boost::mpl::eval_if< - ::boost::algorithm::detail::is_pair, - detail::pair_container_traits_selector, - typename ::boost::mpl::eval_if< - ::boost::is_array, - detail::array_container_traits_selector, - typename ::boost::mpl::eval_if< - ::boost::is_pointer, - detail::pointer_container_traits_selector, - detail::default_container_traits_selector - > - > - >::type container_helper_type; - public: - //! Function type - typedef container_helper_type function_type; - //! Value type - typedef typename - container_helper_type::value_type value_type; - //! Size type - typedef typename - container_helper_type::size_type size_type; - //! Iterator type - typedef typename - container_helper_type::iterator iterator; - //! Const iterator type - typedef typename - container_helper_type::const_iterator const_iterator; - //! Result iterator type ( iterator of const_iterator, depending on the constness of the container ) - typedef typename - container_helper_type::result_iterator result_iterator; - //! Difference type - typedef typename - container_helper_type::difference_type difference_type; - - }; // 'collection_traits' - -// collection_traits metafunctions -----------------------------------------// - - //! Container value_type trait - /*! - Extract the type of elements contained in a container - */ - template< typename C > - struct value_type_of - { - typedef typename collection_traits::value_type type; - }; - - //! Container difference trait - /*! - Extract the container's difference type - */ - template< typename C > - struct difference_type_of - { - typedef typename collection_traits::difference_type type; - }; - - //! Container iterator trait - /*! - Extract the container's iterator type - */ - template< typename C > - struct iterator_of - { - typedef typename collection_traits::iterator type; - }; - - //! Container const_iterator trait - /*! - Extract the container's const_iterator type - */ - template< typename C > - struct const_iterator_of - { - typedef typename collection_traits::const_iterator type; - }; - - - //! Container result_iterator - /*! - Extract the container's result_iterator type. This type maps to \c C::iterator - for mutable container and \c C::const_iterator for const containers. - */ - template< typename C > - struct result_iterator_of - { - typedef typename collection_traits::result_iterator type; - }; - -// collection_traits related functions -----------------------------------------// - - //! Free-standing size() function - /*! - Get the size of the container. Uses collection_traits. - */ - template< typename C > - inline typename collection_traits::size_type - size( const C& c ) - { - return collection_traits::function_type::size( c ); - } - - //! Free-standing empty() function - /*! - Check whether the container is empty. Uses container traits. - */ - template< typename C > - inline bool empty( const C& c ) - { - return collection_traits::function_type::empty( c ); - } - - //! Free-standing begin() function - /*! - Get the begin iterator of the container. Uses collection_traits. - */ - template< typename C > - inline typename collection_traits::iterator - begin( C& c ) - { - return collection_traits::function_type::begin( c ); - } - - //! Free-standing begin() function - /*! - \overload - */ - template< typename C > - inline typename collection_traits::const_iterator - begin( const C& c ) - { - return collection_traits::function_type::begin( c ); - } - - //! Free-standing end() function - /*! - Get the begin iterator of the container. Uses collection_traits. - */ - template< typename C > - inline typename collection_traits::iterator - end( C& c ) - { - return collection_traits::function_type::end( c ); - } - - //! Free-standing end() function - /*! - \overload - */ - template< typename C > - inline typename collection_traits::const_iterator - end( const C& c ) - { - return collection_traits::function_type::end( c ); - } - - } // namespace algorithm -} // namespace boost - -#endif // BOOST_STRING_COLLECTION_TRAITS_HPP diff --git a/include/boost/range/detail/collection_traits_detail.hpp b/include/boost/range/detail/collection_traits_detail.hpp deleted file mode 100644 index 5a3124b54..000000000 --- a/include/boost/range/detail/collection_traits_detail.hpp +++ /dev/null @@ -1,447 +0,0 @@ -// Boost string_algo library collection_traits.hpp header file -----------------------// - -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is subject to 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) - -// See http://www.boost.org for updates, documentation, and revision history. - -#ifndef BOOST_RANGE_STRING_DETAIL_COLLECTION_TRAITS_HPP -#define BOOST_RANGE_STRING_DETAIL_COLLECTION_TRAITS_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Container traits implementation --------------------------------------------------------- - -namespace boost { - namespace algorithm { - namespace detail { - -// Default collection traits ----------------------------------------------------------------- - - // Default collection helper - /* - Wraps std::container compliant containers - */ - template< typename ContainerT > - struct default_container_traits - { - typedef typename ContainerT::value_type value_type; - typedef typename ContainerT::iterator iterator; - typedef typename ContainerT::const_iterator const_iterator; - typedef typename - ::boost::mpl::if_< ::boost::is_const, - const_iterator, - iterator - >::type result_iterator; - typedef typename ContainerT::difference_type difference_type; - typedef typename ContainerT::size_type size_type; - - // static operations - template< typename C > - static size_type size( const C& c ) - { - return c.size(); - } - - template< typename C > - static bool empty( const C& c ) - { - return c.empty(); - } - - template< typename C > - static iterator begin( C& c ) - { - return c.begin(); - } - - template< typename C > - static const_iterator begin( const C& c ) - { - return c.begin(); - } - - template< typename C > - static iterator end( C& c ) - { - return c.end(); - } - - template< typename C > - static const_iterator end( const C& c ) - { - return c.end(); - } - - }; - - template - struct default_container_traits_selector - { - typedef default_container_traits type; - }; - -// Pair container traits --------------------------------------------------------------------- - - typedef double yes_type; - typedef char no_type; - - // pair selector - template< typename T, typename U > - yes_type is_pair_impl( const std::pair* ); - no_type is_pair_impl( ... ); - - template struct is_pair - { - private: - static T* t; - public: - BOOST_STATIC_CONSTANT( bool, value= - sizeof(is_pair_impl(t))==sizeof(yes_type) ); - }; - - // pair helper - template< typename PairT > - struct pair_container_traits - { - typedef typename PairT::first_type element_type; - - typedef typename - std::iterator_traits::value_type value_type; - typedef std::size_t size_type; - typedef typename - std::iterator_traits::difference_type difference_type; - - typedef element_type iterator; - typedef element_type const_iterator; - typedef element_type result_iterator; - - // static operations - template< typename P > - static size_type size( const P& p ) - { - difference_type diff = std::distance( p.first, p.second ); - if ( diff < 0 ) - return 0; - else - return diff; - } - - template< typename P > - static bool empty( const P& p ) - { - return p.first==p.second; - } - - template< typename P > - static const_iterator begin( const P& p ) - { - return p.first; - } - - template< typename P > - static const_iterator end( const P& p ) - { - return p.second; - } - }; // 'pair_container_helper' - - template - struct pair_container_traits_selector - { - typedef pair_container_traits type; - }; - -// Array container traits --------------------------------------------------------------- - - // array traits ( partial specialization ) - template< typename T > - struct array_traits; - - template< typename T, std::size_t sz > - struct array_traits - { - // typedef - typedef T* iterator; - typedef const T* const_iterator; - typedef T value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - - // size of the array ( static ); - BOOST_STATIC_CONSTANT( size_type, array_size = sz ); - }; - - - // array length resolving - /* - Lenght of string contained in a static array could - be different from the size of the array. - For string processing we need the length without - terminating 0. - - Therefore, the length is calculated for char and wchar_t - using char_traits, rather then simply returning - the array size. - */ - template< typename T > - struct array_length_selector - { - template< typename TraitsT > - struct array_length - { - typedef typename - TraitsT::size_type size_type; - - BOOST_STATIC_CONSTANT( - size_type, - array_size=TraitsT::array_size ); - - template< typename A > - static size_type length( const A& ) - { - return array_size; - } - - template< typename A > - static bool empty( const A& ) - { - return array_size==0; - } - }; - }; - - // specialization for char - template<> - struct array_length_selector - { - template< typename TraitsT > - struct array_length - { - typedef typename - TraitsT::size_type size_type; - - template< typename A > - static size_type length( const A& a ) - { - if ( a==0 ) - return 0; - else - return std::char_traits::length(a); - } - - template< typename A > - static bool empty( const A& a ) - { - return a==0 || a[0]==0; - } - }; - }; - - // specialization for wchar_t - template<> - struct array_length_selector - { - template< typename TraitsT > - struct array_length - { - typedef typename - TraitsT::size_type size_type; - - template< typename A > - static size_type length( const A& a ) - { - if ( a==0 ) - return 0; - else - return std::char_traits::length(a); - } - - template< typename A > - static bool empty( const A& a ) - { - return a==0 || a[0]==0; - } - }; - }; - - template< typename T > - struct array_container_traits - { - private: - // resolve array traits - typedef array_traits traits_type; - - public: - typedef typename - traits_type::value_type value_type; - typedef typename - traits_type::iterator iterator; - typedef typename - traits_type::const_iterator const_iterator; - typedef typename - traits_type::size_type size_type; - typedef typename - traits_type::difference_type difference_type; - - typedef typename - ::boost::mpl::if_< ::boost::is_const, - const_iterator, - iterator - >::type result_iterator; - - private: - // resolve array size - typedef typename - ::boost::remove_cv::type char_type; - typedef typename - array_length_selector:: - BOOST_NESTED_TEMPLATE array_length array_length_type; - - public: - BOOST_STATIC_CONSTANT( size_type, array_size = traits_type::array_size ); - - // static operations - template< typename A > - static size_type size( const A& a ) - { - return array_length_type::length(a); - } - - template< typename A > - static bool empty( const A& a ) - { - return array_length_type::empty(a); - } - - - template< typename A > - static iterator begin( A& a ) - { - return a; - } - - template< typename A > - static const_iterator begin( const A& a ) - { - return a; - } - - template< typename A > - static iterator end( A& a ) - { - return a+array_length_type::length(a); - } - - template< typename A > - static const_iterator end( const A& a ) - { - return a+array_length_type::length(a); - } - - }; - - template - struct array_container_traits_selector - { - typedef array_container_traits type; - }; - -// Pointer container traits --------------------------------------------------------------- - - template - struct pointer_container_traits - { - typedef typename - ::boost::remove_pointer::type value_type; - - typedef typename - ::boost::remove_cv::type char_type; - typedef ::std::char_traits char_traits; - - typedef value_type* iterator; - typedef const value_type* const_iterator; - typedef std::ptrdiff_t difference_type; - typedef std::size_t size_type; - - typedef typename - ::boost::mpl::if_< ::boost::is_const, - const_iterator, - iterator - >::type result_iterator; - - // static operations - template< typename P > - static size_type size( const P& p ) - { - if ( p==0 ) - return 0; - else - return char_traits::length(p); - } - - template< typename P > - static bool empty( const P& p ) - { - return p==0 || p[0]==0; - } - - template< typename P > - static iterator begin( P& p ) - { - return p; - } - - template< typename P > - static const_iterator begin( const P& p ) - { - return p; - } - - template< typename P > - static iterator end( P& p ) - { - if ( p==0 ) - return p; - else - return p+char_traits::length(p); - } - - template< typename P > - static const_iterator end( const P& p ) - { - if ( p==0 ) - return p; - else - return p+char_traits::length(p); - } - - }; - - template - struct pointer_container_traits_selector - { - typedef pointer_container_traits type; - }; - - } // namespace detail - } // namespace algorithm -} // namespace boost - - -#endif // BOOST_STRING_DETAIL_COLLECTION_HPP diff --git a/include/boost/range/detail/difference_type.hpp b/include/boost/range/detail/difference_type.hpp deleted file mode 100644 index c6415160f..000000000 --- a/include/boost/range/detail/difference_type.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// Boost.Range library -// -// Copyright Thorsten Ottosen 2003-2004. Use, modification and -// distribution is subject to 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) -// -// For more information, see http://www.boost.org/libs/range/ -// - -#ifndef BOOST_RANGE_DETAIL_DIFFERENCE_TYPE_HPP -#define BOOST_RANGE_DETAIL_DIFFERENCE_TYPE_HPP - -#include -#include - -////////////////////////////////////////////////////////////////////////////// -// missing partial specialization workaround. -////////////////////////////////////////////////////////////////////////////// - -namespace boost -{ - namespace range_detail - { - template< typename T > - struct range_difference_type_; - - template<> - struct range_difference_type_ - { - template< typename C > - struct pts - { - typedef BOOST_DEDUCED_TYPENAME C::difference_type type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename P > - struct pts - { - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::iterator_difference< BOOST_DEDUCED_TYPENAME P::first_type>::type type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename A > - struct pts - { - typedef std::ptrdiff_t type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename A > - struct pts - { - typedef std::ptrdiff_t type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename S > - struct pts - { - typedef std::ptrdiff_t type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename S > - struct pts - { - typedef std::ptrdiff_t type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename S > - struct pts - { - typedef std::ptrdiff_t type; - }; - }; - - template<> - struct range_difference_type_ - { - template< typename S > - struct pts - { - typedef std::ptrdiff_t type; - }; - }; - - } - - template< typename C > - class range_difference - { - typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range::type c_type; - public: - typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range_difference_type_::BOOST_NESTED_TEMPLATE pts::type type; - }; - -} - -#endif - diff --git a/include/boost/range/detail/empty.hpp b/include/boost/range/detail/empty.hpp deleted file mode 100644 index b098705d1..000000000 --- a/include/boost/range/detail/empty.hpp +++ /dev/null @@ -1,120 +0,0 @@ -// Boost.Range library -// -// Copyright Thorsten Ottosen 2003-2004. Use, modification and -// distribution is subject to 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) -// -// For more information, see http://www.boost.org/libs/range/ -// - -#ifndef BOOST_RANGE_DETAIL_EMPTY_HPP -#define BOOST_RANGE_DETAIL_EMPTY_HPP - -#include - -namespace boost -{ - namespace range_detail - { - template< typename T > - struct range_empty; - - ////////////////////////////////////////////////////////////////////// - // default - ////////////////////////////////////////////////////////////////////// - - template<> - struct range_empty - { - template< typename C > - static bool fun( C& c ) - { - return c.empty(); - }; - }; - - ////////////////////////////////////////////////////////////////////// - // pair - ////////////////////////////////////////////////////////////////////// - - template<> - struct range_empty - { - template< typename P > - static bool fun( const P& p ) - { - return p.first == p.second; - } - }; - - ////////////////////////////////////////////////////////////////////// - // array - ////////////////////////////////////////////////////////////////////// - - template<> - struct range_empty - { - template< typename T, std::size_t sz > - static bool fun( T BOOST_ARRAY_REF[sz] ) - { - if( boost_range_array == 0 ) - return true; - return false; - } - }; - - ////////////////////////////////////////////////////////////////////// - // string - ////////////////////////////////////////////////////////////////////// - - template<> - struct range_empty - { - static bool fun( const char* s ) - { - return s == 0 || s[0] == 0; - } - }; - - template<> - struct range_empty - { - static bool fun( const char* s ) - { - return s == 0 || s[0] == 0; - } - }; - - template<> - struct range_empty - { - static bool fun( const wchar_t* s ) - { - return s == 0 || s[0] == 0; - } - }; - - template<> - struct range_empty - { - static bool fun( const wchar_t* s ) - { - return s == 0 || s[0] == 0; - } - }; - - } // namespace 'range_detail' - - - template< typename C > - inline bool - empty( const C& c ) - { - return range_detail::range_empty< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); - } - -} // namespace 'boost' - - -#endif diff --git a/include/boost/range/detail/sizer.hpp b/include/boost/range/detail/sizer.hpp deleted file mode 100644 index cd6679c24..000000000 --- a/include/boost/range/detail/sizer.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// Boost.Range library -// -// Copyright Thorsten Ottosen 2003-2004. Use, modification and -// distribution is subject to 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) -// -// For more information, see http://www.boost.org/libs/range/ -// - -#ifndef BOOST_RANGE_DETAIL_SIZER_HPP -#define BOOST_RANGE_DETAIL_SIZER_HPP - -#if defined(_MSC_VER) -# pragma once -#endif - -#include -#include - -namespace boost -{ - ////////////////////////////////////////////////////////////////////// - // constant array size - ////////////////////////////////////////////////////////////////////// - - template< typename T, std::size_t sz > - char (& sizer( const T BOOST_RANGE_ARRAY_REF()[sz] ) )[sz]; - - template< typename T, std::size_t sz > - char (& sizer( T BOOST_RANGE_ARRAY_REF()[sz] ) )[sz]; - -} // namespace 'boost' - -#endif From 3a39077380e26f73c35f50f42a84be60056592d4 Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Thu, 13 Feb 2020 18:01:57 +0300 Subject: [PATCH 2/2] Remove unused include and headers chain --- include/boost/range/detail/common.hpp | 116 ------------------ .../range/detail/implementation_help.hpp | 1 - include/boost/range/detail/sfinae.hpp | 77 ------------ 3 files changed, 194 deletions(-) delete mode 100644 include/boost/range/detail/common.hpp delete mode 100644 include/boost/range/detail/sfinae.hpp diff --git a/include/boost/range/detail/common.hpp b/include/boost/range/detail/common.hpp deleted file mode 100644 index 2cbc55411..000000000 --- a/include/boost/range/detail/common.hpp +++ /dev/null @@ -1,116 +0,0 @@ -// Boost.Range library -// -// Copyright Thorsten Ottosen 2003-2004. Use, modification and -// distribution is subject to 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) -// -// For more information, see http://www.boost.org/libs/range/ -// - -#ifndef BOOST_RANGE_DETAIL_COMMON_HPP -#define BOOST_RANGE_DETAIL_COMMON_HPP - -#if defined(_MSC_VER) -# pragma once -#endif - -#include -#include -#include -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////// -// missing partial specialization workaround. -////////////////////////////////////////////////////////////////////////////// - -namespace boost -{ - namespace range_detail - { - // 1 = std containers - // 2 = std::pair - // 3 = const std::pair - // 4 = array - // 5 = const array - // 6 = char array - // 7 = wchar_t array - // 8 = char* - // 9 = const char* - // 10 = whar_t* - // 11 = const wchar_t* - // 12 = string - - typedef mpl::int_<1>::type std_container_; - typedef mpl::int_<2>::type std_pair_; - typedef mpl::int_<3>::type const_std_pair_; - typedef mpl::int_<4>::type array_; - typedef mpl::int_<5>::type const_array_; - typedef mpl::int_<6>::type char_array_; - typedef mpl::int_<7>::type wchar_t_array_; - typedef mpl::int_<8>::type char_ptr_; - typedef mpl::int_<9>::type const_char_ptr_; - typedef mpl::int_<10>::type wchar_t_ptr_; - typedef mpl::int_<11>::type const_wchar_t_ptr_; - typedef mpl::int_<12>::type string_; - - template< typename C > - struct range_helper - { - static C* c; - static C ptr; - - BOOST_STATIC_CONSTANT( bool, is_pair_ = sizeof( boost::range_detail::is_pair_impl( c ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_char_ptr_ = sizeof( boost::range_detail::is_char_ptr_impl( ptr ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_const_char_ptr_ = sizeof( boost::range_detail::is_const_char_ptr_impl( ptr ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_wchar_t_ptr_ = sizeof( boost::range_detail::is_wchar_t_ptr_impl( ptr ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_const_wchar_t_ptr_ = sizeof( boost::range_detail::is_const_wchar_t_ptr_impl( ptr ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_char_array_ = sizeof( boost::range_detail::is_char_array_impl( ptr ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_wchar_t_array_ = sizeof( boost::range_detail::is_wchar_t_array_impl( ptr ) ) == sizeof( yes_type ) ); - BOOST_STATIC_CONSTANT( bool, is_string_ = (is_const_char_ptr_ || is_const_wchar_t_ptr_)); - BOOST_STATIC_CONSTANT( bool, is_array_ = boost::is_array::value ); - - }; - - template< typename C > - class range - { - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_pair_, - boost::range_detail::std_pair_, - void >::type pair_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_array_, - boost::range_detail::array_, - pair_t >::type array_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_string_, - boost::range_detail::string_, - array_t >::type string_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_const_char_ptr_, - boost::range_detail::const_char_ptr_, - string_t >::type const_char_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_char_ptr_, - boost::range_detail::char_ptr_, - const_char_ptr_t >::type char_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_const_wchar_t_ptr_, - boost::range_detail::const_wchar_t_ptr_, - char_ptr_t >::type const_wchar_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_wchar_t_ptr_, - boost::range_detail::wchar_t_ptr_, - const_wchar_ptr_t >::type wchar_ptr_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_wchar_t_array_, - boost::range_detail::wchar_t_array_, - wchar_ptr_t >::type wchar_array_t; - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::range_detail::range_helper::is_char_array_, - boost::range_detail::char_array_, - wchar_array_t >::type char_array_t; - public: - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< ::boost::is_void::value, - boost::range_detail::std_container_, - char_array_t >::type type; - }; // class 'range' - } -} - -#endif - diff --git a/include/boost/range/detail/implementation_help.hpp b/include/boost/range/detail/implementation_help.hpp index 59a3ade83..0af4155a4 100644 --- a/include/boost/range/detail/implementation_help.hpp +++ b/include/boost/range/detail/implementation_help.hpp @@ -12,7 +12,6 @@ #define BOOST_RANGE_DETAIL_IMPLEMENTATION_HELP_HPP #include -#include #include #include #include diff --git a/include/boost/range/detail/sfinae.hpp b/include/boost/range/detail/sfinae.hpp deleted file mode 100644 index 5b2c61e71..000000000 --- a/include/boost/range/detail/sfinae.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// Boost.Range library -// -// Copyright Thorsten Ottosen 2003-2004. Use, modification and -// distribution is subject to 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) -// -// For more information, see http://www.boost.org/libs/range/ -// - -#ifndef BOOST_RANGE_DETAIL_SFINAE_HPP -#define BOOST_RANGE_DETAIL_SFINAE_HPP - -#include -#include -#include -#include - - -namespace boost -{ - namespace range_detail - { - using type_traits::yes_type; - using type_traits::no_type; - - ////////////////////////////////////////////////////////////////////// - // string - ////////////////////////////////////////////////////////////////////// - - yes_type is_string_impl( const char* const ); - yes_type is_string_impl( const wchar_t* const ); - no_type is_string_impl( ... ); - - template< std::size_t sz > - yes_type is_char_array_impl( char BOOST_RANGE_ARRAY_REF()[sz] ); - template< std::size_t sz > - yes_type is_char_array_impl( const char BOOST_RANGE_ARRAY_REF()[sz] ); - no_type is_char_array_impl( ... ); - - template< std::size_t sz > - yes_type is_wchar_t_array_impl( wchar_t BOOST_RANGE_ARRAY_REF()[sz] ); - template< std::size_t sz > - yes_type is_wchar_t_array_impl( const wchar_t BOOST_RANGE_ARRAY_REF()[sz] ); - no_type is_wchar_t_array_impl( ... ); - - yes_type is_char_ptr_impl( char* const ); - no_type is_char_ptr_impl( ... ); - - yes_type is_const_char_ptr_impl( const char* const ); - no_type is_const_char_ptr_impl( ... ); - - yes_type is_wchar_t_ptr_impl( wchar_t* const ); - no_type is_wchar_t_ptr_impl( ... ); - - yes_type is_const_wchar_t_ptr_impl( const wchar_t* const ); - no_type is_const_wchar_t_ptr_impl( ... ); - - ////////////////////////////////////////////////////////////////////// - // pair - ////////////////////////////////////////////////////////////////////// - - template< typename Iterator > - yes_type is_pair_impl( const std::pair* ); - no_type is_pair_impl( ... ); - - ////////////////////////////////////////////////////////////////////// - // tags - ////////////////////////////////////////////////////////////////////// - - struct char_or_wchar_t_array_tag {}; - - } // namespace 'range_detail' - -} // namespace 'boost' - -#endif