Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 1 | // Boost.Range library |
| 2 | // |
| 3 | // Copyright Thorsten Ottosen 2003-2004. Use, modification and |
| 4 | // distribution is subject to the Boost Software License, Version |
| 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | // For more information, see http://www.boost.org/libs/range/ |
| 9 | // |
| 10 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 11 | #ifndef NDNBOOST_RANGE_DETAIL_SFINAE_HPP |
| 12 | #define NDNBOOST_RANGE_DETAIL_SFINAE_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 13 | |
| 14 | #include <ndnboost/range/config.hpp> |
| 15 | #include <ndnboost/type_traits/is_array.hpp> |
| 16 | #include <ndnboost/type_traits/detail/yes_no_type.hpp> |
| 17 | #include <utility> |
| 18 | |
| 19 | |
| 20 | namespace ndnboost |
| 21 | { |
| 22 | namespace range_detail |
| 23 | { |
| 24 | using type_traits::yes_type; |
| 25 | using type_traits::no_type; |
| 26 | |
| 27 | ////////////////////////////////////////////////////////////////////// |
| 28 | // string |
| 29 | ////////////////////////////////////////////////////////////////////// |
| 30 | |
| 31 | yes_type is_string_impl( const char* const ); |
| 32 | yes_type is_string_impl( const wchar_t* const ); |
| 33 | no_type is_string_impl( ... ); |
| 34 | |
| 35 | template< std::size_t sz > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 36 | yes_type is_char_array_impl( char NDNBOOST_RANGE_ARRAY_REF()[sz] ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 37 | template< std::size_t sz > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 38 | yes_type is_char_array_impl( const char NDNBOOST_RANGE_ARRAY_REF()[sz] ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 39 | no_type is_char_array_impl( ... ); |
| 40 | |
| 41 | template< std::size_t sz > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 42 | yes_type is_wchar_t_array_impl( wchar_t NDNBOOST_RANGE_ARRAY_REF()[sz] ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 43 | template< std::size_t sz > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 44 | yes_type is_wchar_t_array_impl( const wchar_t NDNBOOST_RANGE_ARRAY_REF()[sz] ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 45 | no_type is_wchar_t_array_impl( ... ); |
| 46 | |
| 47 | yes_type is_char_ptr_impl( char* const ); |
| 48 | no_type is_char_ptr_impl( ... ); |
| 49 | |
| 50 | yes_type is_const_char_ptr_impl( const char* const ); |
| 51 | no_type is_const_char_ptr_impl( ... ); |
| 52 | |
| 53 | yes_type is_wchar_t_ptr_impl( wchar_t* const ); |
| 54 | no_type is_wchar_t_ptr_impl( ... ); |
| 55 | |
| 56 | yes_type is_const_wchar_t_ptr_impl( const wchar_t* const ); |
| 57 | no_type is_const_wchar_t_ptr_impl( ... ); |
| 58 | |
| 59 | ////////////////////////////////////////////////////////////////////// |
| 60 | // pair |
| 61 | ////////////////////////////////////////////////////////////////////// |
| 62 | |
| 63 | template< typename Iterator > |
| 64 | yes_type is_pair_impl( const std::pair<Iterator,Iterator>* ); |
| 65 | no_type is_pair_impl( ... ); |
| 66 | |
| 67 | ////////////////////////////////////////////////////////////////////// |
| 68 | // tags |
| 69 | ////////////////////////////////////////////////////////////////////// |
| 70 | |
| 71 | struct char_or_wchar_t_array_tag {}; |
| 72 | |
| 73 | } // namespace 'range_detail' |
| 74 | |
| 75 | } // namespace 'boost' |
| 76 | |
| 77 | #endif |