26 Array<std::remove_const_t<T>> holder;
31 ArrayRef(ArrayView<T> data, const RefEnum type) {
36 for (
Size i = 0; i < data.size(); ++i) {
44 : holder(
std::move(other.holder)) {
49 holder = std::move(other.holder);
72 return !holder.
empty();
82 for (
Size i = 0; i < ref.size(); ++i) {
108 copy.holder = std::move(holder);
137 template <
typename T>
142 template <
typename T>
147 template <
typename T>
ArrayRef< T > makeArrayRef(Array< T > &data, const RefEnum type)
Generic dynamically allocated resizable storage.
uint32_t Size
Integral type used to index arrays (by default).
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
INLINE bool empty() const
INLINE T & operator[](const Size idx)
ArrayRef(ArrayRef &&other)
INLINE bool owns() const
Returns true if the referenced data are held by the object.
Iterator< const T > end() const
ArrayRef & operator=(ArrayRef &&other)
INLINE const T & operator[](const Size idx) const
Iterator< const T > begin() const
void seize()
Copies the referenced buffer into the internal storage, if not already owning the buffer.
Object providing safe access to continuous memory of data.
Generic dynamically allocated resizable storage.
void reserve(const TCounter newMaxSize)
Allocates enough memory to store the given number of elements.
StorageType & emplaceBack(TArgs &&... args)
Constructs a new element at the end of the array in place, using the provided arguments.
INLINE bool empty() const noexcept
Simple (forward) iterator over continuous array of objects of type T.
Overload of std::swap for Sph::Array.