1 | // (C) Copyright 2009-2011 Frederic Bron. |
---|---|
2 | // |
3 | // Use, modification and distribution are subject to the Boost Software License, |
4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
5 | // http://www.boost.org/LICENSE_1_0.txt). |
6 | // |
7 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
8 | |
9 | #ifndef BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED |
10 | #define BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED |
11 | |
12 | #include <boost/type_traits/is_array.hpp> |
13 | |
14 | #define BOOST_TT_TRAIT_NAME has_post_decrement |
15 | #define BOOST_TT_TRAIT_OP -- |
16 | #define BOOST_TT_FORBIDDEN_IF\ |
17 | (\ |
18 | /* bool */\ |
19 | ::boost::is_same< bool, Lhs_nocv >::value || \ |
20 | /* void* */\ |
21 | (\ |
22 | ::boost::is_pointer< Lhs_noref >::value && \ |
23 | ::boost::is_void< Lhs_noptr >::value\ |
24 | ) || \ |
25 | /* (fundamental or pointer) and const */\ |
26 | (\ |
27 | ( \ |
28 | ::boost::is_fundamental< Lhs_nocv >::value || \ |
29 | ::boost::is_pointer< Lhs_noref >::value\ |
30 | ) && \ |
31 | ::boost::is_const< Lhs_noref >::value\ |
32 | )||\ |
33 | /* Arrays */ \ |
34 | ::boost::is_array<Lhs_noref>::value\ |
35 | ) |
36 | |
37 | |
38 | #include <boost/type_traits/detail/has_postfix_operator.hpp> |
39 | |
40 | #undef BOOST_TT_TRAIT_NAME |
41 | #undef BOOST_TT_TRAIT_OP |
42 | #undef BOOST_TT_FORBIDDEN_IF |
43 | |
44 | #if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) |
45 | |
46 | namespace boost { |
47 | |
48 | template <class R> |
49 | struct has_post_decrement<bool, R> : public false_type {}; |
50 | template <> |
51 | struct has_post_decrement<bool, boost::binary_op_detail::dont_care> : public false_type {}; |
52 | template <> |
53 | struct has_post_decrement<bool, void> : public false_type {}; |
54 | |
55 | template <class R> |
56 | struct has_post_decrement<bool&, R> : public false_type {}; |
57 | template <> |
58 | struct has_post_decrement<bool&, boost::binary_op_detail::dont_care> : public false_type {}; |
59 | template <> |
60 | struct has_post_decrement<bool&, void> : public false_type {}; |
61 | |
62 | } |
63 | |
64 | #endif |
65 | #endif |
66 |