LeechCraft  0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
LeechCraft::Util::NewType< T, size_t, size_t > Class Template Reference

A somewhat "strong" typedef. More...

#include "newtype.h"

+ Inheritance diagram for LeechCraft::Util::NewType< T, size_t, size_t >:
+ Collaboration diagram for LeechCraft::Util::NewType< T, size_t, size_t >:

Public Member Functions

 NewType ()=default
 
 NewType (const T &t)
 

Detailed Description

template<typename T, size_t, size_t>
class LeechCraft::Util::NewType< T, size_t, size_t >

A somewhat "strong" typedef.

NewType provides Haskell's newtype-like semantics.

Typical usage is as follows:

using FirstAlias = Util::NewType<BaseType, NewTypeTag>;
using SecondAlias = Util::NewType<BaseType, NewTypeTag>;

After this, FirstAlias and SecondAlias become more or less independent from C++'s type system point of view.

Template Parameters
TThe type for which to create the params for.

Definition at line 53 of file newtype.h.

Constructor & Destructor Documentation

◆ NewType() [1/2]

template<typename T , size_t , size_t >
LeechCraft::Util::NewType< T, size_t, size_t >::NewType ( )
default

◆ NewType() [2/2]

template<typename T , size_t , size_t >
LeechCraft::Util::NewType< T, size_t, size_t >::NewType ( const T &  t)
inline

Definition at line 60 of file newtype.h.


The documentation for this class was generated from the following file: