diff options
Diffstat (limited to 'boost/spirit/home/x3/char/any_char.hpp')
-rw-r--r-- | boost/spirit/home/x3/char/any_char.hpp | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/boost/spirit/home/x3/char/any_char.hpp b/boost/spirit/home/x3/char/any_char.hpp index 7ff769b8b2..380645d2ff 100644 --- a/boost/spirit/home/x3/char/any_char.hpp +++ b/boost/spirit/home/x3/char/any_char.hpp @@ -7,11 +7,9 @@ #if !defined(BOOST_SPIRIT_X3_ANY_CHAR_APRIL_16_2006_1051AM) #define BOOST_SPIRIT_X3_ANY_CHAR_APRIL_16_2006_1051AM -#if defined(_MSC_VER) -#pragma once -#endif - +#include <boost/type_traits/extent.hpp> #include <boost/spirit/home/x3/char/literal_char.hpp> +#include <boost/spirit/home/x3/char/char_set.hpp> namespace boost { namespace spirit { namespace x3 { @@ -30,10 +28,39 @@ namespace boost { namespace spirit { namespace x3 } template <typename Char> - literal_char<Encoding> - operator()(Char ch) const + literal_char<Encoding> operator()(Char ch) const + { + return { ch }; + } + + template <typename Char> + literal_char<Encoding> operator()(const Char (&ch)[2]) const + { + return { ch[0] }; + } + + template <typename Char, std::size_t N> + char_set<Encoding> operator()(const Char (&ch)[N]) const + { + return { ch }; + } + + template <typename Char> + char_range<Encoding> operator()(Char from, Char to) const + { + return { from, to }; + } + + template <typename Char> + char_range<Encoding> operator()(Char (&from)[2], Char (&to)[2]) const + { + return { from[0], to[0] }; + } + + template <typename Char> + char_set<Encoding> operator()(std::basic_string<Char> const& s) const { - return literal_char<Encoding>(ch); + return { s }; } }; }}} |