diff options
Diffstat (limited to 'amalgamate')
-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 2294438..30129f7 100644 --- a/amalgamate/crow_all.h +++ b/amalgamate/crow_all.h @@ -1048,6 +1048,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)) |