STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

first_class_promoter Class Template Reference

Promotes a basic type to a first-class type. More...

#include <stlsoft_first_class_promoter.h>

List of all members.

Public Types

typedef T value_type
 The value type.

typedef first_class_promoter<
T > 
class_type
 The type of the current parameterisation.

typedef T * pointer
 The pointer type.

typedef T const * const_pointer
 The non-mutating (const) pointer type.

typedef T & reference
 The reference type.

typedef T const & const_reference
 The non-mutating (const) reference type.


Public Methods

 first_class_promoter ()
 Default constructor.

 first_class_promoter (class_type const &rhs)
 Copy constructor.

template<typename U>  first_class_promoter (U &value)
 Initialise an instance from an instance of the promoted type.

 ~first_class_promoter ()
 Destructor.

class_typeoperator= (class_type const &rhs)
 Copy assignment operator.

class_typeoperator= (value_type const &value)
 Assignment operator, taking an instance of the promoted type.

const_reference base_type_value () const
 Provides a non-mutable (const) reference to the promoted type member.

reference base_type_value ()
 Provides a mutable reference to the promoted type member.

 operator reference ()
 Implicit conversion operator to a reference to the promoted type member.

 operator const_reference () const
 Implicit conversion operator to a non-mutable(const) reference to the promoted type member.

pointer operator & ()
 Address-of operator, providing pointer access to the promoted type member.

const_pointer operator & () const
 Address-of operator, providing non-mutable (const) pointer access to the promoted type member.


Detailed Description

template<typename T>
class stlsoft::first_class_promoter< T >

Promotes a basic type to a first-class type.

This type can be used to promote a basic type (e.g. int) or a type that cannot be used as the base of an inheritance relationship (such as a union) to first class status.

Parameters:
T  The basic type


Member Typedef Documentation

typedef first_class_promoter<T> class_type
 

The type of the current parameterisation.

typedef T const* const_pointer
 

The non-mutating (const) pointer type.

typedef T const& const_reference
 

The non-mutating (const) reference type.

typedef T* pointer
 

The pointer type.

typedef T& reference
 

The reference type.

typedef T value_type
 

The value type.


Constructor & Destructor Documentation

first_class_promoter   [inline]
 

Default constructor.

Note:
The internal member of the value_type is not initialised, for efficiency

first_class_promoter class_type const &    rhs [inline]
 

Copy constructor.

first_class_promoter U &    value [inline, explicit]
 

Initialise an instance from an instance of the promoted type.

~first_class_promoter   [inline]
 

Destructor.


Member Function Documentation

reference base_type_value   [inline]
 

Provides a mutable reference to the promoted type member.

const_reference base_type_value   const [inline]
 

Provides a non-mutable (const) reference to the promoted type member.

const_pointer operator &   const [inline]
 

Address-of operator, providing non-mutable (const) pointer access to the promoted type member.

pointer operator &   [inline]
 

Address-of operator, providing pointer access to the promoted type member.

operator const_reference   const [inline]
 

Implicit conversion operator to a non-mutable(const) reference to the promoted type member.

operator reference   [inline]
 

Implicit conversion operator to a reference to the promoted type member.

class_type& operator= value_type const &    value [inline]
 

Assignment operator, taking an instance of the promoted type.

class_type& operator= class_type const &    rhs [inline]
 

Copy assignment operator.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004