blob: 0febe4f67c93c47b4c958819294da590115838e8 [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// 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 Thompson3d613fd2013-10-15 15:39:04 -070011#ifndef NDNBOOST_RANGE_DETAIL_VALUE_TYPE_HPP
12#define NDNBOOST_RANGE_DETAIL_VALUE_TYPE_HPP
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070013
14#include <ndnboost/range/detail/common.hpp>
15#include <ndnboost/range/detail/remove_extent.hpp>
16#include <ndnboost/iterator/iterator_traits.hpp>
17
18//////////////////////////////////////////////////////////////////////////////
19// missing partial specialization workaround.
20//////////////////////////////////////////////////////////////////////////////
21
22namespace ndnboost
23{
24 namespace range_detail
25 {
26 template< typename T >
27 struct range_value_type_;
28
29 template<>
30 struct range_value_type_<std_container_>
31 {
32 template< typename C >
33 struct pts
34 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070035 typedef NDNBOOST_RANGE_DEDUCED_TYPENAME C::value_type type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070036 };
37 };
38
39 template<>
40 struct range_value_type_<std_pair_>
41 {
42 template< typename P >
43 struct pts
44 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045 typedef NDNBOOST_RANGE_DEDUCED_TYPENAME ndnboost::iterator_value< NDNBOOST_RANGE_DEDUCED_TYPENAME P::first_type >::type type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070046 };
47 };
48
49 template<>
50 struct range_value_type_<array_>
51 {
52 template< typename T >
53 struct pts
54 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055 typedef NDNBOOST_DEDUCED_TYPENAME remove_extent<T>::type type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070056 };
57 };
58
59 }
60
61 template< typename C >
62 class range_value
63 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070064 typedef NDNBOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070065 public:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070066 typedef NDNBOOST_DEDUCED_TYPENAME range_detail::range_value_type_<c_type>::NDNBOOST_NESTED_TEMPLATE pts<C>::type type;
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070067 };
68
69}
70
71#endif
72