Foundation
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
Container.hpp File Reference
#include <array>
#include <bitset>
#include <list>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include <ranges>
#include <algorithm>
#include "Allocator.hpp"

Go to the source code of this file.

Classes

struct  Foundation::Core::Ranges::ContainedBy< Range >
 Range predicate that checks if a value is contained within a given range. More...
 

Namespaces

namespace  Foundation
 
namespace  Foundation::Core
 Lock-free atomic primitives and implementations of data structures.
 
namespace  Foundation::Core::Ranges
 STL Ranges extensions.
 
namespace  Foundation::Core::Views
 STL Views extensions.
 

Typedefs

template<typename T >
using Foundation::Core::Optional = std::optional< T >
 Alias for std::optional
 
template<typename First , typename Second >
using Foundation::Core::Pair = std::pair< First, Second >
 Alias for std::pair
 
template<typename ... Args>
using Foundation::Core::Tuple = std::tuple< Args... >
 Alias for std::tuple
 
template<typename T , size_t Size>
using Foundation::Core::Array = std::array< T, Size >
 Alias for std::array
 
template<size_t Size>
using Foundation::Core::Bitset = std::bitset< Size >
 Alias for std::bitset
 
using Foundation::Core::StringView = std::basic_string_view< char >
 Alias for std::basic_string_view<char>
 
template<typename T >
using Foundation::Core::Span = std::span< T >
 Alias for std::span
 
using Foundation::Core::String = std::basic_string< char >
 Alias for std::basic_string<char>, without an explicit allocator constructor.
 
using Foundation::Core::StringAlloc = std::basic_string< char, std::char_traits< char >, StlAllocator< char > >
 std::basic_string<char> with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::Vector = std::vector< T, StlAllocator< T > >
 std::vector with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Predicate = std::less<T>>
using Foundation::Core::Set = std::set< T, Predicate, StlAllocator< T > >
 std::set with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Predicate = std::less<T>>
using Foundation::Core::MultiSet = std::multiset< T, Predicate, StlAllocator< T > >
 std::multiset with explicit Foundation::Core::StlAllocator constructor
 
template<typename K , typename V , typename Predicate = std::less<K>>
using Foundation::Core::Map = std::map< K, V, Predicate, StlAllocator< Pair< const K, V > > >
 std::map with explicit Foundation::Core::StlAllocator constructor
 
template<typename K , typename V , typename Predicate = std::less<K>>
using Foundation::Core::MultiMap = std::multimap< K, V, Predicate, StlAllocator< Pair< const K, V > > >
 std::multimap with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::Deque = std::deque< T, StlAllocator< T > >
 std::deque with explicit Foundation::Core::StlAllocator constructor
 
template<typename T >
using Foundation::Core::List = std::list< T, StlAllocator< T > >
 std::list with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Container = Deque<T>>
using Foundation::Core::Queue = std::queue< T, Container >
 std::queue with explicit Foundation::Core::StlAllocator constructor
 
template<typename T , typename Predicate = std::less<T>, typename Container = Vector<T>>
using Foundation::Core::PriorityQueue = std::priority_queue< T, Container, Predicate >
 std::priority_queue with explicit Foundation::Core::StlAllocator constructor
 

Functions

template<typename T >
Span< const charFoundation::Core::AsBytes (Span< T > data)
 
template<typename T >
requires std::is_trivially_copyable_v<T>
Span< const TFoundation::Core::AsSpan (T const &data)
 Helper to construct one const r-value as a single element span.
 
template<typename T , typename ... Args>
Span< TFoundation::Core::ConstructSpan (Allocator *resource, size_t size, Args &&...args)
 Convenience function for constructing a Span with memory allocated from a Foundation::Core::Allocator. Possibly constructs objects in-place if they are not trivially constructible (e.g. non-PODs)
 
template<typename T >
void Foundation::Core::DestructSpan (Allocator *resource, Span< T > span)
 Convenience function for destructing a Span allocated with ConstructSpan. Calls destructors in-place if the type is not trivially destructible (e.g. non-PODs)
 
template<typename T >
constexpr Optional< range_value_t< T > > Foundation::Core::Ranges::FirstOf (T &&range)
 Returns the first element of a range, or an empty Optional if the range is empty.