File indexing completed on 2025-01-18 09:53:49
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_XPRESSIVE_DETAIL_CORE_QUANT_STYLE_HPP_EAN_10_04_2005
0009 #define BOOST_XPRESSIVE_DETAIL_CORE_QUANT_STYLE_HPP_EAN_10_04_2005
0010
0011
0012 #if defined(_MSC_VER)
0013 # pragma once
0014 #endif
0015
0016 #include <boost/config.hpp>
0017 #include <boost/mpl/has_xxx.hpp>
0018 #include <boost/xpressive/detail/utility/width.hpp>
0019 #include <boost/xpressive/detail/detail_fwd.hpp>
0020
0021 namespace boost { namespace xpressive { namespace detail
0022 {
0023
0024 BOOST_MPL_HAS_XXX_TRAIT_DEF(is_boost_xpressive_xpression_)
0025
0026
0027
0028
0029 template<typename Xpr>
0030 struct is_xpr
0031 : has_is_boost_xpressive_xpression_<Xpr>
0032 {};
0033
0034
0035
0036
0037 enum quant_enum
0038 {
0039 quant_none,
0040 quant_fixed_width,
0041 quant_variable_width
0042 };
0043
0044
0045
0046
0047 template<quant_enum QuantStyle, std::size_t Width = unknown_width::value, bool Pure = true>
0048 struct quant_style
0049 {
0050 typedef void is_boost_xpressive_xpression_;
0051
0052
0053 BOOST_STATIC_CONSTANT(int, quant = QuantStyle);
0054
0055
0056 BOOST_STATIC_CONSTANT(std::size_t, width = Width);
0057
0058
0059 BOOST_STATIC_CONSTANT(bool, pure = Pure);
0060
0061 static detail::width get_width()
0062 {
0063 return width;
0064 }
0065 };
0066
0067 #define BOOST_XPR_QUANT_STYLE(Style, Width, Pure) \
0068 typedef void is_boost_xpressive_xpression_; \
0069 BOOST_STATIC_CONSTANT(int, quant = Style); \
0070 BOOST_STATIC_CONSTANT(std::size_t, width = Width); \
0071 BOOST_STATIC_CONSTANT(bool, pure = Pure); \
0072 static detail::width get_width() { return width; } \
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 typedef quant_style<quant_none> quant_style_none;
0088
0089
0090
0091
0092
0093
0094 typedef quant_style<quant_fixed_width> quant_style_fixed_unknown_width;
0095
0096
0097
0098
0099 typedef quant_style<quant_variable_width> quant_style_variable_width;
0100
0101
0102
0103
0104 template<std::size_t Width>
0105 struct quant_style_fixed_width
0106 : quant_style<quant_fixed_width, Width>
0107 {
0108 };
0109
0110
0111
0112
0113 struct quant_style_assertion
0114 : quant_style<quant_none, 0>
0115 {
0116 };
0117
0118
0119
0120
0121 template<typename Matcher>
0122 struct quant_type
0123 : mpl::int_<Matcher::quant>
0124 {
0125 };
0126
0127 }}}
0128
0129 #endif