Skip to content

Commit 5b955bc

Browse files
committed
inline ambiguous concepts
1 parent c16ccb5 commit 5b955bc

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

include/beman/inplace_vector/inplace_vector.hpp

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -323,18 +323,6 @@ static constexpr void __assert_failure(char const *__file, int __line,
323323
using namespace std;
324324
using namespace beman::__iv_detail;
325325

326-
template <typename __T>
327-
concept __trivial_copy_assignment =
328-
(std::is_trivially_destructible_v<__T> &&
329-
std::is_trivially_copy_constructible_v<__T> &&
330-
std::is_trivially_copy_assignable_v<__T>);
331-
332-
template <typename __T>
333-
concept __trivial_move_assignment =
334-
(std::is_trivially_destructible_v<__T> &&
335-
std::is_trivially_move_constructible_v<__T> &&
336-
std::is_trivially_move_assignable_v<__T>);
337-
338326
// clang-format off
339327
// Smallest unsigned integer that can represent values in [0, N].
340328
template <size_t __N>
@@ -975,12 +963,15 @@ struct inplace_vector : private __iv_detail::__storage::_t<__T, __N> {
975963
}
976964

977965
constexpr inplace_vector &operator=(const inplace_vector &__x)
978-
requires(__N == 0 || __iv_detail::__trivial_copy_assignment<__T>)
966+
requires(__N == 0 || (std::is_trivially_destructible_v<__T> &&
967+
std::is_trivially_copy_constructible_v<__T> &&
968+
std::is_trivially_copy_assignable_v<__T>))
979969
= default;
980970

981971
constexpr inplace_vector &operator=(const inplace_vector &__x)
982-
requires(__N != 0 && !__iv_detail::__trivial_copy_assignment<__T> &&
983-
copyable<__T>)
972+
requires(__N != 0 && !(std::is_trivially_destructible_v<__T> &&
973+
std::is_trivially_copy_constructible_v<__T> &&
974+
std::is_trivially_copy_assignable_v<__T>) && copyable<__T>)
984975
{
985976
clear();
986977
for (auto &&__e : __x)
@@ -989,12 +980,15 @@ struct inplace_vector : private __iv_detail::__storage::_t<__T, __N> {
989980
}
990981

991982
constexpr inplace_vector &operator=(inplace_vector &&__x)
992-
requires(__N == 0 || __iv_detail::__trivial_move_assignment<__T>)
983+
requires(__N == 0 || (std::is_trivially_destructible_v<__T> &&
984+
std::is_trivially_move_constructible_v<__T> &&
985+
std::is_trivially_move_assignable_v<__T>))
993986
= default;
994987

995988
constexpr inplace_vector &operator=(inplace_vector &&__x)
996-
requires(__N != 0 && !__iv_detail::__trivial_move_assignment<__T> &&
997-
movable<__T>)
989+
requires(__N != 0 && !(std::is_trivially_destructible_v<__T> &&
990+
std::is_trivially_move_constructible_v<__T> &&
991+
std::is_trivially_move_assignable_v<__T>) && movable<__T>)
998992
{
999993
clear();
1000994
for (auto &&__e : __x)

0 commit comments

Comments
 (0)