Flow
Documentation for the Flow C++ Library
Loading...
Searching...
No Matches
flow_memory_algorithm.h File Reference
#include <cassert>
#include <iterator>
#include <memory>

Go to the source code of this file.

Namespaces

namespace  flow

Functions

template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedForward (AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
 Forward elements from a source range to uninitialized memory.
template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedMove (AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest) noexcept
 Moves elements from a source range to uninitialized memory.
template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
OutputIt flow::uninitializedEmplace (AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
 Constructs objects in uninitialized memory by copying arguments to their constructor. Intentional copy of arguments to prevent reuse of moved objects.
template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
OutputIt flow::uninitializedFill (AllocatorType &allocator, OutputIt first, OutputIt last, const T &value)
 Fills uninitialized memory with copies of a value.
template<typename AllocatorType, std::forward_iterator InputIt>
void flow::destroyElements (AllocatorType &allocator, InputIt first, InputIt last) noexcept
 Destroys a range of constructed objects in memory.
template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedForwardN (AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
 Forward count elements from a source range to uninitialized memory.
template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedMoveN (AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest) noexcept
 Moves count elements from a source range to uninitialized memory.
template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
OutputIt flow::uninitializedEmplaceN (AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
 Constructs a specified number of objects in uninitialized memory by copying constructor arguments. Intentional copy of arguments to prevent reuse of moved objects.
template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
OutputIt flow::uninitializedFillN (AllocatorType &allocator, OutputIt first, std::size_t count, const T &value)
 Fills count elements in uninitialized memory with a value.
template<typename AllocatorType, std::forward_iterator InputIt>
void flow::destroyElementsN (AllocatorType &allocator, InputIt first, std::size_t count) noexcept
 Destroys count objects in a range.
template<typename AllocatorType, typename T>
void flow::deleteBuffer (AllocatorType &allocator, T *buffer, std::size_t size, std::size_t capacity) noexcept
 Destroys and deallocates the buffer.
template<typename T, typename U>
std::size_t flow::pointerDistance (const T *first, const U *last)
 Calculate the distance in bytes from the first pointer to the last pointer.
template<typename Header>
Header * flow::alignWithHeader (std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
 Align the header + buffer to their corresponding alignments. If the capacity is not big enough, returns nullptr.