0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 04:38:52 +02:00

ircd: Add non-standard explicit bool operator to string_view.

This commit is contained in:
Jason Volk 2017-09-24 16:58:58 -07:00
parent 2a579390be
commit fd53e5589a

View file

@ -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.