// { dg-do compile { target c++17 } } #include #include struct Two { Two(const char*, int); }; void test_pair() { auto two = std::make_from_tuple(std::pair("one", 2)); static_assert(std::is_same_v, "make from pair"); } #include struct Three { Three(int, int, int); }; void test_array() { Three three = std::make_from_tuple(std::array{{1, 2, 3}}); static_assert(std::is_same_v, "make from array"); } #if __cplusplus >= 202002L #include #include void test_subrange() // PR libstdc++/102301 { auto r = std::views::iota(0, 5); auto v = std::make_from_tuple>(std::ranges::subrange(r)); static_assert(std::is_same_v>, "from subrange"); } #endif