mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd: Add non-standard explicit bool operator to string_view.
This commit is contained in:
parent
2a579390be
commit
fd53e5589a
1 changed files with 6 additions and 0 deletions
|
@ -46,6 +46,12 @@ namespace ircd
|
||||||
struct ircd::string_view
|
struct ircd::string_view
|
||||||
:std::string_view
|
:std::string_view
|
||||||
{
|
{
|
||||||
|
// (non-standard)
|
||||||
|
explicit operator bool() const
|
||||||
|
{
|
||||||
|
return !empty();
|
||||||
|
}
|
||||||
|
|
||||||
// (non-standard) our faux insert stub
|
// (non-standard) our faux insert stub
|
||||||
// Tricks boost::spirit into thinking this is mutable string (hint: it's not).
|
// Tricks boost::spirit into thinking this is mutable string (hint: it's not).
|
||||||
// Instead, the raw[] directive in Qi grammar will use the iterator constructor only.
|
// Instead, the raw[] directive in Qi grammar will use the iterator constructor only.
|
||||||
|
|
Loading…
Reference in a new issue