diff --git a/include/utempl/utils.hpp b/include/utempl/utils.hpp index fbc4e55..2d7343b 100644 --- a/include/utempl/utils.hpp +++ b/include/utempl/utils.hpp @@ -92,20 +92,22 @@ namespace impl { template struct Getter { - friend consteval bool Magic(Getter); + friend consteval auto Magic(Getter); }; -template +template struct Inserter { - friend consteval bool Magic(Getter) {return true;}; + friend consteval auto Magic(Getter) -> decltype(auto) { + return Insert; + }; }; template struct SafeTupleChecker { consteval SafeTupleChecker(SafeTupleChecker&&) { - std::ignore = Inserter>{}; + std::ignore = Inserter, false>{}; }; consteval SafeTupleChecker(const SafeTupleChecker&) = default; consteval SafeTupleChecker() = default; @@ -123,7 +125,8 @@ struct IsSafeTuple { }; template -struct IsSafeTuple(MakeTuple(0, kSafeTupleChecker))) && !Magic(Getter>{})) ? false : false> { +struct IsSafeTuple(std::move(Get<0>(Tuple{MakeTuple(0, kSafeTupleChecker)})))) + && Magic(Getter>{})) ? false : false> { static constexpr bool value = false; };