LeechCraft  0.6.70-6645-gcd10d7e
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.

Note
Using this class (and this header) requires pretty decent C++14 support for now provided only by clang 3.4+.
Template Parameters
TThe type for which to create the params for.

Definition at line 56 of file newtype.h.

Constructor & Destructor Documentation

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

Definition at line 63 of file newtype.h.

References LeechCraft::Util::detail::NewTypeHash().

+ Here is the call graph for this function:


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