Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StrongType< WeakType, typename > Struct Template Reference

#include <Meta.hxx>

+ Inheritance diagram for StrongType< WeakType, typename >:
+ Collaboration diagram for StrongType< WeakType, typename >:

Public Member Functions

 StrongType ()=default
 
 StrongType (const StrongType &)=default
 
 StrongType (StrongType &&)=default
 
StrongTypeoperator= (const StrongType &)=default
 
StrongTypeoperator= (StrongType &&)=default
 
StrongTypeoperator= (const WeakType &weak)
 
StrongTypeoperator= (WeakType &&weak)
 
template<typename... Args, typename = std::enable_if_t<std::is_constructible_v<WeakType, Args...>>>
 StrongType (Args &&...args)
 
WeakType & get () noexcept
 
const WeakType & get () const noexcept
 

Private Attributes

WeakType m_Data
 

Friends

bool operator== (const StrongType &s1, const StrongType &s2) noexcept
 
std::ostream & operator<< (std::ostream &os, const StrongType &obj)
 
std::istream & operator>> (std::istream &is, StrongType &obj)
 

Detailed Description

template<typename WeakType, typename>
struct StrongType< WeakType, typename >

Definition at line 103 of file Meta.hxx.

Constructor & Destructor Documentation

◆ StrongType() [1/4]

template<typename WeakType , typename >
StrongType< WeakType, typename >::StrongType ( )
default

◆ StrongType() [2/4]

template<typename WeakType , typename >
StrongType< WeakType, typename >::StrongType ( const StrongType< WeakType, typename > &  )
default

◆ StrongType() [3/4]

template<typename WeakType , typename >
StrongType< WeakType, typename >::StrongType ( StrongType< WeakType, typename > &&  )
default

◆ StrongType() [4/4]

template<typename WeakType , typename >
template<typename... Args, typename = std::enable_if_t<std::is_constructible_v<WeakType, Args...>>>
StrongType< WeakType, typename >::StrongType ( Args &&...  args)
inlineexplicit

Definition at line 122 of file Meta.hxx.

122  : m_Data(std::forward<Args>(args)...)
123  {
124  }

Member Function Documentation

◆ get() [1/2]

template<typename WeakType , typename >
const WeakType& StrongType< WeakType, typename >::get ( ) const
inlinenoexcept

Definition at line 127 of file Meta.hxx.

127 { return m_Data; }

◆ get() [2/2]

template<typename WeakType , typename >
WeakType& StrongType< WeakType, typename >::get ( )
inlinenoexcept

Definition at line 126 of file Meta.hxx.

126 { return m_Data; }
+ Here is the caller graph for this function:

◆ operator=() [1/4]

template<typename WeakType , typename >
StrongType& StrongType< WeakType, typename >::operator= ( const StrongType< WeakType, typename > &  )
default

◆ operator=() [2/4]

template<typename WeakType , typename >
StrongType& StrongType< WeakType, typename >::operator= ( const WeakType &  weak)
inline

Definition at line 110 of file Meta.hxx.

111  {
112  m_Data = weak;
113  return *this;
114  }

◆ operator=() [3/4]

template<typename WeakType , typename >
StrongType& StrongType< WeakType, typename >::operator= ( StrongType< WeakType, typename > &&  )
default

◆ operator=() [4/4]

template<typename WeakType , typename >
StrongType& StrongType< WeakType, typename >::operator= ( WeakType &&  weak)
inline

Definition at line 115 of file Meta.hxx.

116  {
117  m_Data = weak;
118  return *this;
119  }

Friends And Related Function Documentation

◆ operator<<

template<typename WeakType , typename >
std::ostream& operator<< ( std::ostream &  os,
const StrongType< WeakType, typename > &  obj 
)
friend

Definition at line 131 of file Meta.hxx.

131 { return os << obj.m_Data; }

◆ operator==

template<typename WeakType , typename >
bool operator== ( const StrongType< WeakType, typename > &  s1,
const StrongType< WeakType, typename > &  s2 
)
friend

Definition at line 129 of file Meta.hxx.

129 { return s1.m_Data == s2.m_Data; }

◆ operator>>

template<typename WeakType , typename >
std::istream& operator>> ( std::istream &  is,
StrongType< WeakType, typename > &  obj 
)
friend

Definition at line 133 of file Meta.hxx.

133 { return is >> obj.m_Data; }

Member Data Documentation

◆ m_Data

template<typename WeakType , typename >
WeakType StrongType< WeakType, typename >::m_Data
private

Definition at line 136 of file Meta.hxx.


The documentation for this struct was generated from the following file:
StrongType::m_Data
WeakType m_Data
Definition: Meta.hxx:136