tetl 0.1.0
Embedded Template Library
|
The template specialization of etl::hash for the etl::optional class allows users to obtain hashes of the values contained in optional objects. More...
#include <etl/optional.hpp>
Public Member Functions | |
constexpr auto | operator() (etl::optional< T > const &opt) const -> etl::size_t |
The template specialization of etl::hash for the etl::optional class allows users to obtain hashes of the values contained in optional objects.
The specialization etl::hash<optional<T>> is enabled (see etl::hash) if etl::hash<etl::remove_const_t<T>> is enabled, and is disabled otherwise.
When enabled, for an object opt of type etl::optional<T> that contains a value, etl::hash<etl::optional<T>>()(opt) evaluates to the same value as etl::hash<etl::remove_const_t<T>>()(*opt). For an optional that does not contain a value, the hash is unspecified.
The member functions of this specialization are not guaranteed to be noexcept because the hash of the underlying type might throw.
|
inlinenodiscardconstexpr |