expressions - add "bool(expr)" explicit conversion operator
This commit is contained in:
parent
2e175a16fe
commit
dfdeda17fd
2 changed files with 7 additions and 0 deletions
|
@ -217,6 +217,7 @@ struct unary_function_types_ : x3::symbols<unary_function_impl>
|
||||||
("log", log_impl()) //
|
("log", log_impl()) //
|
||||||
("abs", abs_impl()) //
|
("abs", abs_impl()) //
|
||||||
("length", length_impl()) //
|
("length", length_impl()) //
|
||||||
|
("bool", bool_impl()) //
|
||||||
("int", int_impl()) //
|
("int", int_impl()) //
|
||||||
("float", float_impl()) //
|
("float", float_impl()) //
|
||||||
("str", str_impl()) //
|
("str", str_impl()) //
|
||||||
|
|
|
@ -95,6 +95,12 @@ struct str_impl
|
||||||
value_type operator()(value_type const& val) const { return val.to_unicode(); }
|
value_type operator()(value_type const& val) const { return val.to_unicode(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// bool
|
||||||
|
struct bool_impl
|
||||||
|
{
|
||||||
|
value_type operator()(value_type const& val) const { return val.to_bool(); }
|
||||||
|
};
|
||||||
|
|
||||||
// int
|
// int
|
||||||
struct int_impl
|
struct int_impl
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue