koutil
Loading...
Searching...
No Matches
koutil::container Namespace Reference

Classes

class  ComptimeMap
 A compile-time map implementation. More...
 
class  hash_array
 A hash array with open addressing and linear probing. More...
 
class  multi_vector
 Class representing a multi_vector. More...
 
class  template_hash_array
 

Concepts

concept  is_hash
 Concept to check if a type is a valid hash function for a given Key type.
 
concept  is_key_adapter
 Concept to check if a type is a valid key adapter.
 
concept  is_multi_vector_element
 Concept to check if a type is a valid multi_vector element.
 
concept  is_template_hash
 Concept to check if a type is a valid hash function for a given Key type.
 
concept  is_bucket
 Concept to check if a type is a valid bucket type.
 
concept  is_template_key_adapter
 Concept to check if a type is a valid key adapter.
 
concept  is_allocator
 Concept to check if a type is a valid allocator for a given bucket type.
 

Functions

template<typename Key , typename Value , std::size_t Size>
consteval ComptimeMap< Key, Value, Size > to_map (std::array< std::pair< Key, Value >, Size > pairs)
 Converts an array of pairs to a compile-time map.
 
template<typename Key , typename Value , std::size_t Size>
consteval ComptimeMap< Key, Value, Size > to_map (std::pair< Key, Value >(&&pairs)[Size])
 Converts an array of pairs to a compile-time map.
 

Function Documentation

◆ to_map() [1/2]

template<typename Key , typename Value , std::size_t Size>
ComptimeMap< Key, Value, Size > koutil::container::to_map ( std::array< std::pair< Key, Value >, Size > pairs)
consteval

Converts an array of pairs to a compile-time map.

Template Parameters
KeyThe key type.
ValueThe value type.
SizeThe size of the array.
Parameters
pairsThe array of key-value pairs.
Returns
The compile-time map.

◆ to_map() [2/2]

template<typename Key , typename Value , std::size_t Size>
ComptimeMap< Key, Value, Size > koutil::container::to_map ( std::pair< Key, Value >(&&) pairs[Size])
consteval

Converts an array of pairs to a compile-time map.

Template Parameters
KeyThe key type.
ValueThe value type.
SizeThe size of the array.
Parameters
pairsThe array of key-value pairs.
Returns
The compile-time map.