FreePOOMA  2.4.1
Public Member Functions
Zero< T > Struct Template Reference

The point of this class is to be a number of type T which is known at compile time to be zero. More...

#include <Zero.h>

List of all members.

Public Member Functions

 operator T () const
 If you need to convert to an object of type T, just build one from zero.
bool operator== (const Zero< T > &) const
 Zero ()
 Give it empty ctors and assignment operators to try and keep purify happy.
 Zero (const Zero< T > &)
Zero< T > & operator= (const Zero< T > &)

Detailed Description

template<class T>
struct Zero< T >

The point of this class is to be a number of type T which is known at compile time to be zero.

This is reflected in the operations like addition and subtraction that use it. If you return a Zero object, the compiler should be able to make better optimizations than if you just return zero.

Zero is templated on type T, to represent a zero object of type T. Type T is required to be constructable from an integer zero.


Constructor & Destructor Documentation

template<class T >
Zero< T >::Zero ( ) [inline]

Give it empty ctors and assignment operators to try and keep purify happy.

template<class T >
Zero< T >::Zero ( const Zero< T > &  ) [inline]

Member Function Documentation

template<class T >
Zero< T >::operator T ( ) const [inline]

If you need to convert to an object of type T, just build one from zero.

This will be used in the cases where the operators below don't match.

template<class T >
bool Zero< T >::operator== ( const Zero< T > &  ) const [inline]
template<class T >
Zero<T>& Zero< T >::operator= ( const Zero< T > &  ) [inline]

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