FreePOOMA  2.4.1
Public Member Functions
MinusOne< 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 minus one. More...

#include <One.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 minus one.
bool operator== (const MinusOne< T > &) const
 MinusOne ()
 Give it empty ctors and assignment operators to try and keep purify happy.
 MinusOne (const One< T > &)
MinusOne< T > & operator= (const MinusOne< T > &)

Detailed Description

template<class T>
struct MinusOne< T >

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

This is reflected in the operations like multiplication and division that use it. If you return a MinusOne object, the compiler should be able to make better optimizations than if you just return minus one. MinusOne is templated on type T, to represent a one object of type T. Type T is required to be constructable from an integer minus one.


Constructor & Destructor Documentation

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

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

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

Member Function Documentation

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

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

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

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

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