GG
Namespaces | Defines | Functions

StrongTypedef.h File Reference

Contains macros used to create "strong typedefs", that is value types that are not mutually interoperable with each other or with builtin types for extra type safety. More...

#include <boost/static_assert.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/serialization/nvp.hpp>
#include <iostream>

Go to the source code of this file.

Namespaces

namespace  GG

Defines

#define GG_STRONG_INTEGRAL_TYPEDEF(name, type)
#define GG_STRONG_SIZE_TYPEDEF(name)

Functions

int GG::Value (int i)
double GG::Value (double d)
std::size_t GG::Value (std::size_t s)

Detailed Description

Contains macros used to create "strong typedefs", that is value types that are not mutually interoperable with each other or with builtin types for extra type safety.

Definition in file StrongTypedef.h.


Define Documentation

#define GG_STRONG_INTEGRAL_TYPEDEF (   name,
  type 
)

Creates a new type name, based on underlying type type, which is not interconvertible with any other numeric type. type must be an integral type. The resulting type has most of the operations of the underlying integral type. Specifically, the type is totally ordered, incrementable, decrementable, and arithmetic. The type is also interarithemtic with and comparable to objects of types type and double. Note that the free functions accepting doubles return GG_STRONG_DOUBLE_TYPEDEF's called name_d. This allows name objects to be used in floating point math.

Definition at line 261 of file StrongTypedef.h.

#define GG_STRONG_SIZE_TYPEDEF (   name)

Creates a new type name, based on underlying type std::size_t, which is not interconvertible with any other numeric type. The resulting type has most of the operations of std::size_t. Specifically, the type is totally ordered, incrementable, decrementable, and arithmetic. The type is also interarithemtic with and comparable to objects of type std::size_t.

Definition at line 379 of file StrongTypedef.h.