Skip to content

Commit

Permalink
fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
CLIDragon committed Jan 6, 2025
1 parent 14664ae commit cb62e04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define CATA_SRC_ENUMS_H

#include <type_traits>
#include <cstdint>

template<typename T> struct enum_traits;

Expand Down
14 changes: 7 additions & 7 deletions src/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem
nodes = std::move( source.nodes );
free_list_head = std::move( source.free_list_head );
beyond_end = std::move( source.beyond_end );
number_of_elements = source.number_of_elements;
number_of_elements = std::move( source.number_of_elements );
source.nodes = nullptr;
source.beyond_end = nullptr;
return *this;
Expand Down Expand Up @@ -764,7 +764,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem
return node_pointer == rh.node_pointer;
}

inline LIST_FORCE_INLINE bool operator!=( const list_iterator &rh ) const noexcept {
inline LIST_FORCE_INLINE bool operator!=( const list_iterator rh ) const noexcept {
return node_pointer != rh.node_pointer;
}

Expand Down Expand Up @@ -1210,7 +1210,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem

public:

iterator insert( const iterator &it, const element_type &element ) {
iterator insert( const iterator it, const element_type &element ) {
// ie. list is not empty
if( last_endpoint != nullptr ) {
// No erased nodes available for reuse
Expand Down Expand Up @@ -1396,7 +1396,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem

// This is almost identical to the insert implementations above with the only changes being std::forward of element parameters
template<typename... arguments>
iterator emplace( const iterator &it, arguments &&... parameters ) {
iterator emplace( const iterator it, arguments &&... parameters ) {
if( last_endpoint != nullptr ) {
if( node_allocator_pair.number_of_erased_nodes == 0 ) {
if( last_endpoint == groups.last_endpoint_group->beyond_end ) {
Expand Down Expand Up @@ -1657,7 +1657,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem

// Range insert
template <class iterator_type>
iterator insert( const iterator &it,
iterator insert( const iterator it,
typename plf_enable_if_c < !std::numeric_limits<iterator_type>::is_integer,
iterator_type >::type first, const iterator_type last ) {
if( first == last ) {
Expand All @@ -1674,7 +1674,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem
}

// Initializer-list insert
inline iterator insert( const iterator &it,
inline iterator insert( const iterator it,
const std::initializer_list<element_type> &element_list ) {
// use range insert:
return insert( it, element_list.begin(), element_list.end() );
Expand All @@ -1697,7 +1697,7 @@ template <class element_type, class element_allocator_type = std::allocator<elem

// Single erase:
// if uninitialized/invalid iterator supplied, function could generate an exception, hence no noexcept
iterator erase( const const_iterator &it ) {
iterator erase( const const_iterator it ) {
cata_assert( node_pointer_allocator_pair.total_number_of_elements != 0 );
cata_assert( it.node_pointer != nullptr );
cata_assert( it.node_pointer != end_iterator.node_pointer );
Expand Down

0 comments on commit cb62e04

Please sign in to comment.