diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/spirit/home/lex/lexer/lexertl/token.hpp | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2 boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/spirit/home/lex/lexer/lexertl/token.hpp')
-rw-r--r-- | boost/spirit/home/lex/lexer/lexertl/token.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/boost/spirit/home/lex/lexer/lexertl/token.hpp b/boost/spirit/home/lex/lexer/lexertl/token.hpp index 9f4bdb3872..f795bcacac 100644 --- a/boost/spirit/home/lex/lexer/lexertl/token.hpp +++ b/boost/spirit/home/lex/lexer/lexertl/token.hpp @@ -33,6 +33,7 @@ #include <boost/mpl/vector.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/or.hpp> +#include <boost/type_traits/integral_promotion.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/range/iterator_range.hpp> #include <boost/static_assert.hpp> @@ -155,10 +156,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl // this default conversion operator is needed to allow the direct // usage of tokens in conjunction with the primitive parsers defined // in Qi - operator id_type() const { return id_; } + operator id_type() const { return static_cast<id_type>(id_); } // Retrieve or set the token id of this token instance. - id_type id() const { return id_; } + id_type id() const { return static_cast<id_type>(id_); } void id(id_type newid) { id_ = newid; } std::size_t state() const { return 0; } // always '0' (INITIAL state) @@ -187,7 +188,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl #endif protected: - id_type id_; // token id, 0 if nothing has been matched + typename boost::integral_promotion<id_type>::type id_; // token id, 0 if nothing has been matched }; #if defined(BOOST_SPIRIT_DEBUG) |