Botan 3.5.0
Crypto and TLS for C&
|
#include <strong_type.h>
Public Types | |
using | const_iterator = typename T::const_iterator |
using | const_pointer = typename T::const_pointer |
using | iterator = typename T::iterator |
using | pointer = typename T::pointer |
using | size_type = typename T::size_type |
using | value_type = typename T::value_type |
using | wrapped_type = T |
Public Member Functions | |
decltype(auto) | begin () const noexcept(noexcept(this->get().begin())) |
decltype(auto) | begin () noexcept(noexcept(this->get().begin())) |
decltype(auto) | cbegin () const noexcept(noexcept(this->get().cbegin())) |
decltype(auto) | cbegin () noexcept(noexcept(this->get().cbegin())) |
decltype(auto) | cend () const noexcept(noexcept(this->get().cend())) |
decltype(auto) | cend () noexcept(noexcept(this->get().cend())) |
decltype(auto) | data () const noexcept(noexcept(this->get().data())) |
decltype(auto) | data () noexcept(noexcept(this->get().data())) |
bool | empty () const noexcept(noexcept(this->get().empty())) |
decltype(auto) | end () const noexcept(noexcept(this->get().end())) |
decltype(auto) | end () noexcept(noexcept(this->get().end())) |
T & | get () |
const T & | get () const |
decltype(auto) | operator[] (size_type i) const noexcept(noexcept(this->get().operator[](i))) |
decltype(auto) | operator[] (size_type i) noexcept(noexcept(this->get().operator[](i))) |
void | reserve (size_type size) noexcept(noexcept(this->get().reserve(size))) |
void | resize (size_type size) noexcept(noexcept(this->get().resize(size))) |
size_type | size () const noexcept(noexcept(this->get().size())) |
Static Public Member Functions | |
template<typename CapabilityT > | |
static constexpr bool | has_capability () |
Strong types can be used as wrappers around common types to provide compile time semantics. They usually contribute to more maintainable and less error-prone code especially when dealing with function parameters.
Internally, this provides adapters so that the wrapping strong type behaves as much as the underlying type as possible and desirable.
This implementation was inspired by: https://stackoverflow.com/a/69030899
Definition at line 168 of file strong_type.h.
|
inherited |
Definition at line 73 of file strong_type.h.
|
inherited |
Definition at line 75 of file strong_type.h.
|
inherited |
Definition at line 72 of file strong_type.h.
|
inherited |
Definition at line 74 of file strong_type.h.
|
inherited |
Definition at line 71 of file strong_type.h.
|
inherited |
Definition at line 70 of file strong_type.h.
|
inherited |
Definition at line 39 of file strong_type.h.
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
Definition at line 99 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Referenced by Botan::encode_point(), Botan::Kyber_PrivateKey::Kyber_PrivateKey(), and Botan::wots_sign_and_pkgen().
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
Definition at line 123 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inlinenoexceptinherited |
Definition at line 117 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Referenced by Botan::FrodoMatrix::serialize().
|
inlinenoexceptinherited |
Definition at line 129 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
Definition at line 103 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Referenced by Botan::encode_point().
|
inlineinherited |
Definition at line 50 of file strong_type.h.
Referenced by Botan::detail::Strong_Adapter< T >::begin(), Botan::detail::Strong_Adapter< T >::begin(), Botan::detail::Strong_Adapter< T >::cbegin(), Botan::detail::Strong_Adapter< T >::cbegin(), Botan::detail::Strong_Adapter< T >::cend(), Botan::detail::Strong_Adapter< T >::cend(), Botan::chain_lengths(), Botan::compute_root(), Botan::detail::Strong_Adapter< T >::data(), Botan::detail::Strong_Adapter< T >::data(), Botan::detail::Strong_Adapter< T >::empty(), Botan::detail::Strong_Adapter< T >::end(), Botan::detail::Strong_Adapter< T >::end(), Botan::ht_sign(), Botan::ht_verify(), Botan::LMOTS_Private_Key::LMOTS_Private_Key(), Botan::operator&(), Botan::operator&(), Botan::operator&(), Botan::operator&=(), Botan::operator&=(), Botan::operator*(), Botan::operator*(), Botan::operator*(), Botan::operator*=(), Botan::operator*=(), Botan::operator+(), Botan::operator+(), Botan::operator+(), Botan::operator++(), Botan::operator++(), Botan::operator+=(), Botan::operator+=(), Botan::operator-(), Botan::operator-(), Botan::operator-(), Botan::operator--(), Botan::operator--(), Botan::operator-=(), Botan::operator-=(), Botan::operator/(), Botan::operator/(), Botan::operator/(), Botan::operator/=(), Botan::operator/=(), Botan::operator<<(), Botan::operator<<(), Botan::operator<<(), Botan::operator<<(), Botan::operator<<=(), Botan::operator<<=(), Botan::operator<=>(), Botan::operator<=>(), Botan::operator<=>(), Botan::operator==(), Botan::operator==(), Botan::operator==(), Botan::operator>>(), Botan::operator>>(), Botan::operator>>(), Botan::operator>>=(), Botan::operator>>=(), Botan::detail::Strong_Adapter< T >::operator[](), Botan::detail::Strong_Adapter< T >::operator[](), Botan::operator^(), Botan::operator^(), Botan::operator^(), Botan::operator^=(), Botan::operator^=(), Botan::operator|(), Botan::operator|(), Botan::operator|(), Botan::operator|=(), Botan::operator|=(), Botan::HSS_LMS_Params::params_at_level(), Botan::TLS::Cipher_State::psk(), Botan::detail::Strong_Adapter< T >::reserve(), Botan::detail::Strong_Adapter< T >::resize(), Botan::TLS::New_Session_Ticket_12::serialize(), Botan::TLS::New_Session_Ticket_13::serialize(), Botan::Sphincs_Address::set_chain(), Botan::Sphincs_Address::set_hash(), Botan::Sphincs_Address::set_keypair(), Botan::Sphincs_Address::set_layer(), Botan::Sphincs_Address::set_tree(), Botan::Sphincs_Address::set_tree_height(), Botan::Sphincs_Address::set_tree_index(), Botan::HSS_LMS_PrivateKeyInternal::sign(), Botan::LMS_PrivateKey::sign_and_get_pk(), Botan::HSS_Signature::signed_pub_key(), Botan::detail::Strong_Adapter< T >::size(), Botan::treehash(), Botan::wots_public_key_from_signature(), and Botan::x448().
|
inlineinherited |
Definition at line 52 of file strong_type.h.
|
inlinestaticconstexpr |
Definition at line 173 of file strong_type.h.
|
inlinenoexceptinherited |
Definition at line 147 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
Definition at line 141 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inlinenoexceptinherited |
Definition at line 135 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
|
inlinenoexceptinherited |
Definition at line 115 of file strong_type.h.
References Botan::detail::Strong_Base< T >::get().
Referenced by Botan::Kyber_PrivateKey::Kyber_PrivateKey().