Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cde9f44
add basic gtest framework
wusatosi Dec 11, 2024
5eb8151
add outline for spec test
wusatosi Dec 11, 2024
0d29b77
Update CMakeLists.txt
wusatosi Dec 11, 2024
d953f95
Added tests for [container.reqmts]
jbab Dec 16, 2024
d33b8e8
Added second spec test suite (experimental, suggestion), added tests …
jbab Dec 17, 2024
97345e6
update trivial type wording
wusatosi Dec 25, 2024
6b35bbc
format
wusatosi Dec 25, 2024
c854038
expand test structure
wusatosi Dec 25, 2024
73dee7b
add erase checks
wusatosi Jan 4, 2025
caa14ad
complete more erasure
wusatosi Jan 4, 2025
b8d30f8
complete modifiers/erasesingle modifier/popback
wusatosi Jan 4, 2025
f73c4fe
Add minimal for reserve shrink
wusatosi Jan 14, 2025
3b74798
Fix PopBack test
wusatosi Jan 14, 2025
e970fa2
Include Reserve and shrink
wusatosi Jan 14, 2025
b883947
lint
wusatosi Jan 14, 2025
e75d44b
Implement erase tests
wusatosi Jan 14, 2025
9ca550e
add pushback/ emplaceback tests
wusatosi Jan 14, 2025
2a8b99e
Fix emplace back
wusatosi Jan 15, 2025
70cad6c
fold spec.test2 into spec.test
wusatosi Jan 15, 2025
0d146a7
refactor triviality tests
wusatosi Jan 15, 2025
ef169f9
Fix destructor
wusatosi Jan 15, 2025
81903c2
Fix Triviality/ZeroSized
wusatosi Jan 15, 2025
ddb19ac
lint
wusatosi Jan 15, 2025
c1bdbac
fix triviality
wusatosi Jan 16, 2025
f238186
Fix Tests
wusatosi Jan 16, 2025
c16ccb5
lint
wusatosi Jan 16, 2025
5b955bc
inline ambiguous concepts
wusatosi Jan 16, 2025
fb2bf93
lint
wusatosi Jan 16, 2025
1c1eb86
fix werror
wusatosi Jan 16, 2025
ab82c73
remove false positive werror check
wusatosi Jan 16, 2025
cbfe0c4
add tests for insert
wusatosi Jan 17, 2025
0d37485
implement insert ranges series
wusatosi Jan 17, 2025
bb97f12
add data tests
wusatosi Jan 17, 2025
2bec84a
Add testcase for size and resize
wusatosi Jan 17, 2025
f7a3b74
minor addition for resize test
wusatosi Jan 17, 2025
955e9f2
fix test
wusatosi Jan 17, 2025
d135f4a
dump [sequence.reqmts]
wusatosi Jan 17, 2025
30cb4a0
remove #if 0 chuck
wusatosi Jan 17, 2025
634b185
Fix compile
wusatosi Jan 17, 2025
c300258
Added SizedDefault Test
wusatosi Jan 17, 2025
d446946
Split test file
wusatosi Jan 17, 2025
2c9c721
Format Fix
wusatosi Jan 18, 2025
e9d8635
Finish constructor test suite
wusatosi Jan 18, 2025
fea9b08
Finish [sequence.reqmts]
wusatosi Jan 19, 2025
451f0c5
use uz
wusatosi Jan 20, 2025
e0ff597
adopt suggestion
wusatosi Jan 20, 2025
5b23f5a
beman::bad_alloc => std::bad_alloc
wusatosi Jan 20, 2025
212c829
Revert "use uz"
wusatosi Jan 20, 2025
d1f1705
allow c++20
wusatosi Jan 20, 2025
fa0eacb
Improvements to tests
jbab Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions include/beman/inplace_vector/inplace_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,18 @@ static constexpr void __assert_failure(char const *__file, int __line,
using namespace std;
using namespace beman::__iv_detail;

template <typename __T>
concept __trivial_copy_assignment =
(std::is_trivially_destructible_v<__T> &&
std::is_trivially_copy_constructible_v<__T> &&
std::is_trivially_copy_assignable_v<__T>);

template <typename __T>
concept __trivial_move_assignment =
(std::is_trivially_destructible_v<__T> &&
std::is_trivially_move_constructible_v<__T> &&
std::is_trivially_move_assignable_v<__T>);

// clang-format off
// Smallest unsigned integer that can represent values in [0, N].
template <size_t __N>
Expand Down Expand Up @@ -939,30 +951,36 @@ struct inplace_vector : private __iv_detail::__storage::_t<__T, __N> {
}

constexpr inplace_vector(const inplace_vector &__x)
requires(__N == 0)
requires(__N == 0 || is_trivially_copy_constructible_v<__T>)
= default;

constexpr inplace_vector(const inplace_vector &__x)
requires(__N != 0 && copyable<__T>)
requires(__N != 0 && !is_trivially_copy_constructible_v<__T> &&
copyable<__T>)
{
for (auto &&__e : __x)
emplace_back(__e);
}

constexpr inplace_vector(inplace_vector &&__x)
requires(__N == 0)
requires(__N == 0 || is_trivially_move_constructible_v<__T>)
= default;

constexpr inplace_vector(inplace_vector &&__x)
requires(__N != 0 && movable<__T>)
requires(__N != 0 && !is_trivially_move_constructible_v<__T> &&
movable<__T>)
{
for (auto &&__e : __x)
emplace_back(::std::move(__e));
}

constexpr inplace_vector &operator=(const inplace_vector &__x)
requires(__N == 0)
requires(__N == 0 || __iv_detail::__trivial_copy_assignment<__T>)
= default;

constexpr inplace_vector &operator=(const inplace_vector &__x)
requires(__N != 0 && copyable<__T>)
requires(__N != 0 && !__iv_detail::__trivial_copy_assignment<__T> &&
copyable<__T>)
{
clear();
for (auto &&__e : __x)
Expand All @@ -971,10 +989,12 @@ struct inplace_vector : private __iv_detail::__storage::_t<__T, __N> {
}

constexpr inplace_vector &operator=(inplace_vector &&__x)
requires(__N == 0)
requires(__N == 0 || __iv_detail::__trivial_move_assignment<__T>)
= default;

constexpr inplace_vector &operator=(inplace_vector &&__x)
requires(__N != 0 && movable<__T>)
requires(__N != 0 && !__iv_detail::__trivial_move_assignment<__T> &&
movable<__T>)
{
clear();
for (auto &&__e : __x)
Expand Down
Loading