// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*- // vim: ts=8 sw=2 smarttab expandtab #pragma once #include namespace _impl { template struct always_false : std::false_type {}; }; template void assert_moveable(T& t) { // It's fine } template void assert_moveable(const T& t) { static_assert(_impl::always_false::value, "unable to move-out from T"); } namespace internal { template static auto _apply_method_to_tuple( Obj &obj, Method method, ArgTuple &&tuple, std::index_sequence) { return (obj.*method)(std::get(std::forward(tuple))...); } } template auto apply_method_to_tuple(Obj &obj, Method method, ArgTuple &&tuple) { constexpr auto tuple_size = std::tuple_size_v; return internal::_apply_method_to_tuple( obj, method, std::forward(tuple), std::make_index_sequence()); }