23 #ifndef COM_DAFER45_TBTK_BOOLEAN
24 #define COM_DAFER45_TBTK_BOOLEAN
28 #ifndef TBTK_DISABLE_NLOHMANN_JSON
29 # include "TBTK/json.hpp"
34 #if TBTK_WRAP_PRIMITIVE_TYPES
45 constexpr
Boolean(
bool value) : value(value) {}
56 constexpr
operator bool()
const{
return value; };
78 #ifndef TBTK_DISABLE_NLOHMANN_JSON
84 nlohmann::to_json(j,
boolean.value);
92 nlohmann::from_json(j,
boolean.value);
101 const std::string &serialization,
105 case Serializable::Mode::JSON:
106 value = stoi(serialization);
110 "Boolean::Boolean()",
111 "Only Serializable::Mode::JSON is supported yet.",
119 case Serializable::Mode::JSON:
120 return std::to_string(value);
123 "Boolean::serialize()",
124 "Only Serializable::Mode::JSON is supported yet.",