blob: f5c919b0f22800439e745e826806f2ffcee51a96 [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
11#ifndef BOOST_RANGE_DETAIL_VALUE_TYPE_HPP
12#define BOOST_RANGE_DETAIL_VALUE_TYPE_HPP
13
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 {
35 typedef BOOST_RANGE_DEDUCED_TYPENAME C::value_type type;
36 };
37 };
38
39 template<>
40 struct range_value_type_<std_pair_>
41 {
42 template< typename P >
43 struct pts
44 {
45 typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::iterator_value< BOOST_RANGE_DEDUCED_TYPENAME P::first_type >::type type;
46 };
47 };
48
49 template<>
50 struct range_value_type_<array_>
51 {
52 template< typename T >
53 struct pts
54 {
55 typedef BOOST_DEDUCED_TYPENAME remove_extent<T>::type type;
56 };
57 };
58
59 }
60
61 template< typename C >
62 class range_value
63 {
64 typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
65 public:
66 typedef BOOST_DEDUCED_TYPENAME range_detail::range_value_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
67 };
68
69}
70
71#endif
72