SuperDex Physics C++ API
Loading...
Searching...
No Matches
dynamic_array.h File Reference
#include <mochi_core/memory/allocator.h>
#include <mochi_core/mochi_config.h>
#include <mochi_core/utils/reflection.h>
#include <concepts>
#include <algorithm>
#include <cstddef>
#include <iterator>
#include <limits>
#include <tuple>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

class  superdex::DynamicArray< T >
 A dynamically resizable array with syntax and behavior similar to std::pmr::vector. More...
struct  superdex::IsResizeNoInitSafe< T >
 Trait to determine if a type is safe for use with DynamicArray::resize_noinit. More...

Namespaces

namespace  superdex

Concepts

concept  superdex::ConvertibleTo
concept  superdex::HasDistance

Macros

#define MOCHI_DARRAY_ASSERT(cond, ...)
#define MOCHI_DARRAY_ASSERT_FORWARD_ITERATOR(IteratorType)
#define MOCHI_DARRAY_DEBUG   MOCHI_DEBUG

Functions

template<typename T, typename InBeginIterator, typename InEndIterator>
void superdex::Append (DynamicArray< T > &out, InBeginIterator const &inBegin, InEndIterator const &inEnd)
 Utility Functions.
template<typename T, typename InContainer>
void superdex::Append (DynamicArray< T > &out, InContainer const &inContainer)
template<typename T, typename ContainerIn>
void superdex::AppendSum (DynamicArray< T > &out, ContainerIn const &in, T valueToAdd)
template<typename InputIt, std::enable_if_t<(std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits< InputIt >::iterator_category >), superdex::ConceptMatch > = superdex::ConceptMatch::True>
 superdex::DynamicArray (InputIt, InputIt, Allocator *=GetDefaultAllocator()) -> DynamicArray< typename std::iterator_traits< InputIt >::value_type >

Variables

template<typename T>
constexpr bool superdex::kIsResizeNoInitSafe = IsResizeNoInitSafe<T>::value
 Helper variable template for IsResizeNoInitSafe.

Macro Definition Documentation

◆ MOCHI_DARRAY_ASSERT

#define MOCHI_DARRAY_ASSERT ( cond,
... )
Value:
MOCHI_ASSERT(cond, __VA_ARGS__)
#define MOCHI_ASSERT(condition_without_side_effects,...)
Definition debug.h:81

Definition at line 42 of file dynamic_array.h.

◆ MOCHI_DARRAY_ASSERT_FORWARD_ITERATOR

#define MOCHI_DARRAY_ASSERT_FORWARD_ITERATOR ( IteratorType)
Value:
static_assert( \
HasDistance<IteratorType>, \
"This type of input iterator is not supported by DynamicArray because there is no way to " \
"reserve sufficient memory up front. We would have to loop calling emplace_back, which " \
"would be inefficient. Consider initializing this DynamicArray in a different way.");

Definition at line 57 of file dynamic_array.h.

◆ MOCHI_DARRAY_DEBUG

#define MOCHI_DARRAY_DEBUG   MOCHI_DEBUG

Definition at line 38 of file dynamic_array.h.