#include <gtopt/strong_index_vector.hpp>
template<typename Index Index, typename T>
StrongIndexVector class
A vector that enforces access through a strongly-typed index. Inherits privately from std::vector to ensure type safety. Implements efficient move operations marked with noexcept to enable compiler optimizations.
Constructors, destructors, conversion operators
- StrongIndexVector() defaulted constexpr noexcept
-
template<class InputIt>StrongIndexVector(InputIt first, InputIt last) constexpr
- StrongIndexVector(std::initializer_list<T> init) constexpr
- StrongIndexVector(std::vector<T>::size_type count) explicit constexpr
- StrongIndexVector(std::vector<T>::size_type count, const T& value) explicit constexpr
- StrongIndexVector(StrongIndexVector&& other) defaulted constexpr noexcept
- StrongIndexVector(StrongIndexVector const& other) defaulted constexpr
- ~StrongIndexVector() defaulted constexpr
Public functions
- auto at(Index pos) -> std::vector<T>::reference
- auto at(Index pos) const -> std::vector<T>::const_reference
- auto operator=(StrongIndexVector&& other) -> StrongIndexVector& defaulted noexcept
- auto operator=(StrongIndexVector const& other) -> StrongIndexVector& defaulted
- auto operator[](Index pos) const -> std::vector<T>::const_reference noexcept
- auto operator[](Index pos) -> std::vector<T>::reference noexcept