LWG-3211 std::tuple<> should be trivially constructible (#1460)

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
This commit is contained in:
futuarmo 2020-12-02 02:00:49 +03:00 коммит произвёл GitHub
Родитель d06561f891
Коммит a92064eeca
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -204,7 +204,7 @@ class tuple;
template <>
class tuple<> { // empty tuple
public:
constexpr tuple() noexcept /* strengthened */ {}
constexpr tuple() noexcept = default; /* strengthened */
constexpr tuple(const tuple&) noexcept /* strengthened */ {} // TRANSITION, ABI: should be defaulted

Просмотреть файл

@ -209,6 +209,9 @@ int main() {
assert(make_from_tuple<int>(tuple<>{}) == 0);
#endif // _HAS_CXX17
}
// LWG-3211 std::tuple<> should be trivially constructible
STATIC_ASSERT(is_trivially_default_constructible_v<tuple<>>);
}
// Also test DevDiv-1205400 "C++ compiler: static_assert in std::tuple_element prevents SFINAE".