diff options
Diffstat (limited to 'amalgamate/crow_all.h')
-rw-r--r-- | amalgamate/crow_all.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h index b84a43e..a2f9cc0 100644 --- a/amalgamate/crow_all.h +++ b/amalgamate/crow_all.h @@ -628,6 +628,15 @@ namespace crow return boost::lexical_cast<double>(start_, end_-start_); } + bool b() const + { +#ifndef CROW_JSON_NO_ERROR_CHECK + if (t() != type::True && t() != type::False) + throw std::runtime_error("value is not boolean"); +#endif + return t() == type::True; + } + void unescape() const { if (*(start_-1)) |