explicit_t< T > Struct Template Reference

#include <Types.hh>

Collaboration diagram for explicit_t< T >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<typename T>
struct explicit_t< T >

Kills implicit conversions.

Original template Copyright (c) 2006 Michal 'Sektor' Malecki Pawel Sikora Distributed under the Boost Software License, Version 1.0. ( See at http://www.boost.org/LICENSE_1_0.txt )

template<class T> struct explicit_t { private: T value; template< class V > explicit_t( V t ); public: operator T & () { return value; } explicit_t( const T& c ): value( c ) { } };

Author:
Michal 'Sektor' Malecki

Pawel Sikora

Tomasz bla Fortuna

Date:
2006, 2008
Original license: Distributed under the Boost Software License, Version 1.0. ( See at http://www.boost.org/LICENSE_1_0.txt )

Template allows us to kill any implicit conversions of built-in types. Especially int, short, unsigned * and double. Modifications allows to initialize arrays in classes and allows us creating T types from const T types.

Definition at line 58 of file Types.hh.


Public Member Functions

 operator T & ()
 operator const T & () const
 explicit_t (const T &c)
 explicit_t ()

Private Member Functions

template<typename V>
 explicit_t (const V &t)

Private Attributes

value

Constructor & Destructor Documentation

template<typename T>
template<typename V>
explicit_t< T >::explicit_t ( const V &  t  )  [inline, private]

Private constructor from any other type

template<typename T>
explicit_t< T >::explicit_t ( const T &  c  )  [inline]

Constructor from allowed types

Definition at line 68 of file Types.hh.

template<typename T>
explicit_t< T >::explicit_t (  )  [inline]

Constructor from allowed types

Definition at line 69 of file Types.hh.


Member Function Documentation

template<typename T>
explicit_t< T >::operator T & (  )  [inline]

Returns reference

Definition at line 73 of file Types.hh.

References explicit_t< T >::value.

template<typename T>
explicit_t< T >::operator const T & (  )  const [inline]

In case we have const this pointer return const reference

Definition at line 77 of file Types.hh.

References explicit_t< T >::value.


Member Data Documentation

template<typename T>
T explicit_t< T >::value [private]

Real hidden in template value

Definition at line 64 of file Types.hh.

Referenced by explicit_t< T >::operator const T &(), and explicit_t< T >::operator T &().


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

Generated on Wed Mar 12 00:35:04 2008 for blaRAY by  doxygen 1.5.5