Skip to content

sgns::base::Wrapper

Make strongly typed structures from different concepts of the equal types. E.g. block height and round number are both uint64_t, but better to be different types. Or, ID and Signature both vectors. More...

#include <wrapper.hpp>

Public Functions

Name
Wrapper(T && t)
T unwrap()
const T & unwrap() const
T & unwrap_mutable()
bool operator==(const Wrapper< T, Tag > & other) const

Detailed Description

template <typename T ,
typename Tag >
struct sgns::base::Wrapper;

Make strongly typed structures from different concepts of the equal types. E.g. block height and round number are both uint64_t, but better to be different types. Or, ID and Signature both vectors.

Template Parameters:

  • T wrapped type
  • Tag unique tag

Public Functions Documentation

function Wrapper

inline explicit Wrapper(
    T && t
)

function unwrap

inline T unwrap()

function unwrap

inline const T & unwrap() const

function unwrap_mutable

inline T & unwrap_mutable()

function operator==

inline bool operator==(
    const Wrapper< T, Tag > & other
) const

Updated on 2026-03-04 at 13:10:43 -0800