]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/xpressive/include/boost/xpressive/detail/static/type_traits.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / xpressive / include / boost / xpressive / detail / static / type_traits.hpp
CommitLineData
7c673cae
FG
1///////////////////////////////////////////////////////////////////////////////
2// type_traits.hpp
3//
4// Copyright 2008 Eric Niebler. Distributed under the Boost
5// Software License, Version 1.0. (See accompanying file
6// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
8#ifndef BOOST_XPRESSIVE_DETAIL_STATIC_TYPE_TRAITS_HPP_EAN_10_04_2005
9#define BOOST_XPRESSIVE_DETAIL_STATIC_TYPE_TRAITS_HPP_EAN_10_04_2005
10
11// MS compatible compilers support #pragma once
12#if defined(_MSC_VER)
13# pragma once
14#endif
15
16#include <string>
17#include <boost/config.hpp>
18#include <boost/mpl/bool.hpp>
19#include <boost/iterator/iterator_traits.hpp>
20#include <boost/type_traits/is_convertible.hpp>
21#include <boost/xpressive/detail/detail_fwd.hpp>
22
23namespace boost { namespace xpressive { namespace detail
24{
25
26///////////////////////////////////////////////////////////////////////////////
27// is_static_xpression
28//
29template<typename T>
30struct is_static_xpression
31 : mpl::false_
32{
33};
34
35template<typename Matcher, typename Next>
36struct is_static_xpression<static_xpression<Matcher, Next> >
37 : mpl::true_
38{
39};
40
41template<typename Top, typename Next>
42struct is_static_xpression<stacked_xpression<Top, Next> >
43 : mpl::true_
44{
45};
46
47//////////////////////////////////////////////////////////////////////////
48// is_random
49//
50template<typename BidiIter>
51struct is_random
52 : is_convertible
53 <
54 typename iterator_category<BidiIter>::type
55 , std::random_access_iterator_tag
56 >
57{
58};
59
60//////////////////////////////////////////////////////////////////////////
61// is_string_iterator
62//
63template<typename Iter>
64struct is_string_iterator
65 : mpl::false_
66{
67};
68
69template<>
70struct is_string_iterator<std::string::iterator>
71 : mpl::true_
72{
73};
74
75template<>
76struct is_string_iterator<std::string::const_iterator>
77 : mpl::true_
78{
79};
80
81#ifndef BOOST_NO_STD_WSTRING
82template<>
83struct is_string_iterator<std::wstring::iterator>
84 : mpl::true_
85{
86};
87
88template<>
89struct is_string_iterator<std::wstring::const_iterator>
90 : mpl::true_
91{
92};
93#endif
94
95///////////////////////////////////////////////////////////////////////////////
96// is_char
97//
98template<typename T>
99struct is_char
100 : mpl::false_
101{};
102
103template<>
104struct is_char<char>
105 : mpl::true_
106{};
107
108template<>
109struct is_char<wchar_t>
110 : mpl::true_
111{};
112
113}}} // namespace boost::xpressive::detail
114
115#endif