2.10.0
Freundlich's C++ toolkit
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.
TagA unique tag type

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

Public Types

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

Public Member Functions

template<typename U >
 strong_typedef (U const &)
 Constructs the strong typedef from a given value using fcppt::safe_cast. More...
 
 strong_typedef (fcppt::no_init const &)
 Creates an uninitialized strong typedef. More...
 
 strong_typedef (T &&)
 Constructs a strong typedef by moving. More...
 
T & get ()
 Return the strong typedef's value. More...
 
T const & get () const
 Return the strong typedef's value. More...
 
void swap (strong_typedef &)
 Swap the contents of another strong typedef. More...
 

Member Typedef Documentation

◆ tag_type

template<typename T, typename Tag>
typedef Tag fcppt::strong_typedef< T, Tag >::tag_type

typedef for the Tag template parameter

◆ value_type

template<typename T, typename Tag>
typedef T fcppt::strong_typedef< T, Tag >::value_type

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

Constructor & Destructor Documentation

◆ strong_typedef() [1/3]

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

Constructs the strong typedef from a given value using fcppt::safe_cast.

◆ strong_typedef() [2/3]

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

Creates an uninitialized strong typedef.

◆ strong_typedef() [3/3]

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

Constructs a strong typedef by moving.

Member Function Documentation

◆ get() [1/2]

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

Return the strong typedef's value.

◆ get() [2/2]

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

Return the strong typedef's value.

◆ swap()

template<typename T, typename Tag>
void fcppt::strong_typedef< T, Tag >::swap ( strong_typedef< T, Tag > &  )

Swap the contents of another strong typedef.