union_caster Union Template Reference
[Conversion Library]

#include <stlsoft/conversion/union_cast.hpp>

List of all members.


Detailed Description

template<typename TO, typename FROM, bool B_CHECK_ALIGN = true>
union stlsoft::union_caster< TO, FROM, B_CHECK_ALIGN >

Cast class used by the union_cast cast function.

This class (union) effects conversion from one type to another, without the use of casts.

Parameters:
TO The type to cast to
FROM The type to cast from
B_CHECK_ALIGN Determines the default checking behaviour. If 0, no checking on alignment is conducted
Note:
This technique is non-portable, and you use this class at your own risk. Notwithstanding that, the TO and FROM types have to be the same size, so the technique is widely usable.

Public Types

Member Types
typedef TO to_type
 The type to cast to.
typedef FROM from_type
 The type to cast from.
typedef union_caster< TO, FROM,
B_CHECK_ALIGN > 
class_type
 The current instantiation of the type.

Public Member Functions

Construction
 union_caster (from_type const from, bool bCheckAlign=B_CHECK_ALIGN)
 Conversion constructor.
Conversion
 operator to_type () const
 Implicit conversion operator.

Member Typedef Documentation

typedef TO to_type

The type to cast to.

typedef FROM from_type

The type to cast from.

typedef union_caster<TO, FROM, B_CHECK_ALIGN> class_type

The current instantiation of the type.


Constructor & Destructor Documentation

union_caster ( from_type const   from,
bool  bCheckAlign = B_CHECK_ALIGN 
) [inline, explicit]

Conversion constructor.

or a change of type, but not both.

References ss_typename_type_k, STLSOFT_MESSAGE_ASSERT, STLSOFT_STATIC_ASSERT, and STLSOFT_SUPPRESS_UNUSED.


Member Function Documentation

operator to_type (  )  const [inline]

Implicit conversion operator.


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

Generated on Thu Jun 10 08:58:45 2010 for STLSoft by  doxygen 1.5.6