4.4.1
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
Public Types | Public Member Functions
fcppt::strong_typedef< T, Tag > Class Template Reference

Detailed Description

template<typename T, typename Tag>
class fcppt::strong_typedef< T, Tag >

Used to create strong typedefs.

Template Parameters
TThe underlying type to be wrapped.
TagSome unique type.

A strong typedef is a wrapper around a type. It has an explicit constructor and a get member function.

Public Types

using value_type = T
 A type that represents the data stored in the strong typedef.
 
using tag_type = Tag
 typedef for the Tag template parameter
 

Public Member Functions

constexpr strong_typedef (T) noexcept(std::is_nothrow_move_constructible_v< T >)
 Constructs a strong typedef by copying.
 
 strong_typedef (fcppt::no_init const &)
 Creates an uninitialized strong typedef.
 
constexpr T & get ()
 Return the strong typedef's value.
 
constexpr T const & get () const
 Return the strong typedef's value.
 

Member Typedef Documentation

◆ tag_type

template<typename T , typename Tag >
using fcppt::strong_typedef< T, Tag >::tag_type = Tag

typedef for the Tag template parameter

◆ value_type

template<typename T , typename Tag >
using fcppt::strong_typedef< T, Tag >::value_type = T

A type that represents the data stored in the strong typedef.

Constructor & Destructor Documentation

◆ strong_typedef() [1/2]

template<typename T , typename Tag >
constexpr fcppt::strong_typedef< T, Tag >::strong_typedef ( ) const
explicitconstexprnoexcept

Constructs a strong typedef by copying.

◆ strong_typedef() [2/2]

template<typename T , typename Tag >
fcppt::strong_typedef< T, Tag >::strong_typedef ( fcppt::no_init const &  )
explicit

Creates an uninitialized strong typedef.

Member Function Documentation

◆ get() [1/2]

template<typename T , typename Tag >
constexpr T & fcppt::strong_typedef< T, Tag >::get ( )
constexpr

Return the strong typedef's value.

◆ get() [2/2]

template<typename T , typename Tag >
constexpr T const & fcppt::strong_typedef< T, Tag >::get ( ) const
constexpr

Return the strong typedef's value.