diff --git a/include/snipplib/containers/snplib_hmap.h b/include/snipplib/containers/snplib_hmap.h index 1021f91..e38d177 100644 --- a/include/snipplib/containers/snplib_hmap.h +++ b/include/snipplib/containers/snplib_hmap.h @@ -457,37 +457,17 @@ protected: inline static std::vector> _containsFunc{}; +public: // trivial conversional functions template requires requires(VT v, UT u) { v = u; } - inline static std::function(VT const&)> trivial_conv_from = - [](VT const& val) -> hmap_expected_t { - // inline static std::function(hmap_expected_t const&)> trivial_conv_from = - // [](hmap_expected_t const& val) -> hmap_expected_t { - return static_cast(val); - // if (val) { - // return static_cast(val.value()); - // } else { - // return val.error(); - // } - }; + inline static auto trivial_conv_from = [](VT const& val) -> hmap_expected_t { return static_cast(val); }; template requires requires(VT v, UT u) { u = v; } - inline static std::function(UT const&)> trivial_conv_to = - [](UT const& uval) -> hmap_expected_t { - // inline static std::function(hmap_expected_t const&)> trivial_conv_to = - // [](hmap_expected_t const& uval) -> hmap_expected_t { - return static_cast(uval); - // if (uval) { - // return static_cast(uval.value()); - // } else { - // return uval.error(); - // } - }; + inline static auto trivial_conv_to = [](UT const& uval) -> hmap_expected_t { return static_cast(uval); }; -public: hmap() = default; virtual ~hmap()