This commit is contained in:
2026-09-04 10:02:29 +03:00
parent d35d356784
commit b8816d5561

View File

@@ -457,37 +457,17 @@ protected:
inline static std::vector<std::function<bool(KeyT const&, const hmap*)>> _containsFunc{};
public:
// trivial conversional functions
template <typename VT, typename UT>
requires requires(VT v, UT u) { v = u; }
inline static std::function<hmap_expected_t<UT>(VT const&)> trivial_conv_from =
[](VT const& val) -> hmap_expected_t<UT> {
// inline static std::function<hmap_expected_t<UT>(hmap_expected_t<VT> const&)> trivial_conv_from =
// [](hmap_expected_t<VT> const& val) -> hmap_expected_t<UT> {
return static_cast<UT>(val);
// if (val) {
// return static_cast<UT>(val.value());
// } else {
// return val.error();
// }
};
inline static auto trivial_conv_from = [](VT const& val) -> hmap_expected_t<UT> { return static_cast<UT>(val); };
template <typename VT, typename UT>
requires requires(VT v, UT u) { u = v; }
inline static std::function<hmap_expected_t<VT>(UT const&)> trivial_conv_to =
[](UT const& uval) -> hmap_expected_t<VT> {
// inline static std::function<hmap_expected_t<VT>(hmap_expected_t<UT> const&)> trivial_conv_to =
// [](hmap_expected_t<UT> const& uval) -> hmap_expected_t<VT> {
return static_cast<VT>(uval);
// if (uval) {
// return static_cast<VT>(uval.value());
// } else {
// return uval.error();
// }
};
inline static auto trivial_conv_to = [](UT const& uval) -> hmap_expected_t<VT> { return static_cast<VT>(uval); };
public:
hmap() = default;
virtual ~hmap()