diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 5b916be..9526b3c 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -914,23 +914,23 @@ template > namespace fusion_detail { template -constexpr std::optional fuse_one_enum(std::optional hash, E value) noexcept { +constexpr optional fuse_one_enum(optional hash, E value) noexcept { if (hash.has_value()) { if (const auto index = enum_index(value); index.has_value()) { // Add 1 to prevent matching 2D fusions with 3D fusions etc. return (hash.value() << detail::log2(enum_count() + 1)) | (index.value() + 1); } } - return std::nullopt; + return {}; } template -constexpr std::optional fuse_enum(E value) noexcept { +constexpr optional fuse_enum(E value) noexcept { return fuse_one_enum(0, value); } template -constexpr std::optional fuse_enum(E head, Es... tail) noexcept { +constexpr optional fuse_enum(E head, Es... tail) noexcept { return fuse_one_enum(fuse_enum(tail...), head); }