From dc112bd6c152174bb44c6e475486f30987594d20 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Tue, 12 Mar 2019 20:43:07 +0900 Subject: [PATCH] feat: add is_[boolean|integer|...]() member func it is an alias to is --- toml/value.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/toml/value.hpp b/toml/value.hpp index 03812c7..fc38dbf 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -537,6 +537,18 @@ class value bool is() const noexcept {return value_traits::type_index == this->type_;} bool is(value_t t) const noexcept {return t == this->type_;} + bool is_uninitialized() const noexcept {return this->is(value_t::Empty );} + bool is_boolean() const noexcept {return this->is(value_t::Boolean );} + bool is_integer() const noexcept {return this->is(value_t::Integer );} + bool is_float() const noexcept {return this->is(value_t::Float );} + bool is_string() const noexcept {return this->is(value_t::String );} + bool is_offset_datetime() const noexcept {return this->is(value_t::OffsetDatetime);} + bool is_local_datetime() const noexcept {return this->is(value_t::LocalDatetime );} + bool is_local_date() const noexcept {return this->is(value_t::LocalDate );} + bool is_local_time() const noexcept {return this->is(value_t::LocalTime );} + bool is_array() const noexcept {return this->is(value_t::Array );} + bool is_table() const noexcept {return this->is(value_t::Table );} + value_t type() const {return type_;} template