// This source code is released into the public domain. export module nihil.core:construct; import nihil.std; namespace nihil { // A functor that constructs objects of an arbitrary type. // Useful for std::views::transform. template struct construct_fn final { [[nodiscard]] auto operator()(this construct_fn const &, auto &&...args) -> T { return T(std::forward(args)...); } }; export template inline constexpr auto construct = construct_fn{}; } // namespace nihil