~ubuntu-branches/ubuntu/wily/bombono-dvd/wily

« back to all changes in this revision

Viewing changes to libs/boost-lib/boost/range/detail/size_type.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-11-04 11:46:25 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20101104114625-8xfdhvhpsm51i0nu
Tags: upstream-0.8.0
ImportĀ upstreamĀ versionĀ 0.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
11
#ifndef BOOST_RANGE_DETAIL_SIZE_TYPE_HPP
 
12
#define BOOST_RANGE_DETAIL_SIZE_TYPE_HPP
 
13
 
 
14
#include <boost/range/detail/common.hpp>
 
15
 
 
16
//////////////////////////////////////////////////////////////////////////////
 
17
// missing partial specialization  workaround.
 
18
//////////////////////////////////////////////////////////////////////////////
 
19
 
 
20
namespace boost 
 
21
{
 
22
    namespace range_detail 
 
23
    {        
 
24
        template< typename T >
 
25
        struct range_size_type_;
 
26
 
 
27
        template<>
 
28
        struct range_size_type_<std_container_>
 
29
        {
 
30
            template< typename C >
 
31
            struct pts
 
32
            {
 
33
                typedef BOOST_RANGE_DEDUCED_TYPENAME C::size_type type;
 
34
            };
 
35
        };
 
36
 
 
37
        template<>
 
38
        struct range_size_type_<std_pair_>
 
39
        {
 
40
            template< typename P >
 
41
            struct pts
 
42
            {
 
43
                typedef std::size_t type;
 
44
            };
 
45
        };
 
46
 
 
47
        template<>
 
48
        struct range_size_type_<array_>
 
49
        {
 
50
            template< typename A >
 
51
            struct pts
 
52
            {
 
53
                typedef std::size_t type;
 
54
            };
 
55
        };
 
56
 
 
57
  
 
58
    } 
 
59
    
 
60
    template< typename C >
 
61
    class range_size
 
62
    {
 
63
        typedef typename range_detail::range<C>::type c_type;
 
64
    public:
 
65
        typedef typename range_detail::range_size_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type; 
 
66
    };
 
67
}
 
68
 
 
69
#endif
 
70