Disabling implicit conversions.
This commit is contained in:
parent
618dad7df1
commit
340a4516dd
@ -97,6 +97,8 @@ option(SPDLOG_NO_ATOMIC_LEVELS "prevent spdlog from using of std::atomic log lev
|
|||||||
add_subdirectory(external/spdlog)
|
add_subdirectory(external/spdlog)
|
||||||
|
|
||||||
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||||
|
option(JSON_ImplicitConversions "Enable implicit conversions." OFF)
|
||||||
|
option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)." ON)
|
||||||
add_subdirectory(external/json)
|
add_subdirectory(external/json)
|
||||||
|
|
||||||
option(CATCH_INSTALL_DOCS "Install documentation alongside library" OFF)
|
option(CATCH_INSTALL_DOCS "Install documentation alongside library" OFF)
|
||||||
|
@ -41,10 +41,10 @@ namespace character::characteristic {
|
|||||||
[[nodiscard]] std::uint32_t get_additional() const { return additional; }
|
[[nodiscard]] std::uint32_t get_additional() const { return additional; }
|
||||||
|
|
||||||
friend void from_json(const json &j, Characteristic &charac) {
|
friend void from_json(const json &j, Characteristic &charac) {
|
||||||
const_cast<std::uint32_t &>(charac.base) = j.at("base");
|
const_cast<std::uint32_t &>(charac.base) = j.at("base").get<std::uint32_t>();
|
||||||
charac.carac = j.at("carac");
|
charac.carac = j.at("carac").get<std::uint32_t>();
|
||||||
charac.materiel = j.at("materiel");
|
charac.materiel = j.at("materiel").get<std::uint32_t>();
|
||||||
charac.additional = j.at("additional");
|
charac.additional = j.at("additional").get<std::uint32_t>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user