Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanups #40

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion libcxx/include/__memory/uninitialized_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ class _AllocatorDestroyRangeReverse {
_Iter& __last_;
};

#if _LIBCPP_STD_VER >= 20
#if _LIBCPP_STD_VER >= 26

template <class _Tp>
constexpr
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__utility/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void swap_value_representations(_Tp& __a, _Tp& __b) {
// TODO: research better memswap algorithms
char __buffer[__size];
if constexpr (__chunk) {
for (std::size_t n = 0; n < __chunk; n++, __aptr += __size, __bptr += __size) {
for (std::size_t __n = 0; n < __chunk; __n++, __aptr += __size, __bptr += __size) {
__builtin_memcpy(__buffer, __aptr, __size);
__builtin_memmove(__aptr, __bptr, __size);
__builtin_memmove(__bptr, __buffer, __size);
Expand Down
10 changes: 5 additions & 5 deletions libcxx/include/vector
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ vector<_Tp, _Allocator>::erase(const_iterator __position) {
__position != end(), "vector::erase(iterator) called with a non-dereferenceable iterator");
difference_type __ps = __position - cbegin();
pointer __p = this->__begin_ + __ps;
#if _LIBCPP_STD_VER >= 20
#if _LIBCPP_STD_VER >= 26
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
size_type __old_size = size();
// destroy the element at __p
Expand All @@ -1599,7 +1599,7 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) {
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__first <= __last, "vector::erase(first, last) called with invalid range");
pointer __p = this->__begin_ + (__first - begin());
if (__first != __last) {
#if _LIBCPP_STD_VER >= 20
#if _LIBCPP_STD_VER >= 26
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
size_type __old_size = size();
size_type __count = __last - __first;
Expand Down Expand Up @@ -1643,7 +1643,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
if (__p == this->__end_) {
__construct_one_at_end(__x);
} else {
#if _LIBCPP_STD_VER >= 20
#if _LIBCPP_STD_VER >= 26
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
// Make space by trivially relocating everything
_ConstructTransaction __tx(*this, 1);
Expand Down Expand Up @@ -1683,7 +1683,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {
if (__p == this->__end_) {
__construct_one_at_end(std::move(__x));
} else {
#if _LIBCPP_STD_VER >= 20
#if _LIBCPP_STD_VER >= 26
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
// Make space by trivially relocating everything
_ConstructTransaction __tx(*this, 1);
Expand Down Expand Up @@ -1718,7 +1718,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {
if (__p == this->__end_) {
__construct_one_at_end(std::forward<_Args>(__args)...);
} else {
#if _LIBCPP_STD_VER >= 20
#if _LIBCPP_STD_VER >= 26
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
// Make space by trivially relocating everything
_ConstructTransaction __tx(*this, 1);
Expand Down