ChoreoLib
Choreo support library.
Loading...
Searching...
No Matches
choreo::util::Map< Key, Value, Size > Class Template Reference

#include <choreo/util/Map.h>

Public Member Functions

constexpr Map (const std::array< std::pair< Key, Value >, Size > &data)
 
constexpr const Value & at (const Key &key) const
 

Detailed Description

template<typename Key, typename Value, size_t Size>
class choreo::util::Map< Key, Value, Size >

A compile-time associative container.

Template Parameters
KeyThe key type.
ValueThe value type.
SizeThe number of elements in the container.

Constructor & Destructor Documentation

◆ Map()

template<typename Key , typename Value , size_t Size>
constexpr choreo::util::Map< Key, Value, Size >::Map ( const std::array< std::pair< Key, Value >, Size > &  data)
inlineexplicitconstexpr

Construct the map from an array of key-value pairs.

Parameters
dataThe key-value pairs.

Member Function Documentation

◆ at()

template<typename Key , typename Value , size_t Size>
constexpr const Value & choreo::util::Map< Key, Value, Size >::at ( const Key &  key) const
inlineconstexpr

Returns the value associated with the given key.

Parameters
keyThe key.
Returns
The value.
Exceptions
std::range_errorif the key wasn't found.

The documentation for this class was generated from the following file: