All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | List of all members
blaze::Infinity Class Reference

Positive infinity for built-in data types.The Infinity class is a wrapper class around the functionality of the blaze::Limits class to provide the possiblity to assign a positive infinity value to built-in data types. As positive infinity value, the largest possible positive value of the corresponding data type is used. In order to assign the positive infinity value, the Infinity class can be implicitly converted to the following 13 built-in integral and floating point data types: More...

#include <Infinity.h>

Public Types

typedef NegativeInfinity
< Infinity
NegativeType
 The negative infinity type.
 

Public Member Functions

Constructor
 Infinity ()
 The default constructor of the Infinity class.
 
Conversion operators
 operator unsigned char () const
 Conversion operator to the unsigned char built-in type. More...
 
 operator signed char () const
 Conversion operator to the signed char built-in type. More...
 
 operator char () const
 Conversion operator to the char built-in type. More...
 
 operator wchar_t () const
 Conversion operator to the wchar_t built-in type. More...
 
 operator unsigned short () const
 Conversion operator to the unsigned short built-in type. More...
 
 operator short () const
 Conversion operator to the short built-in type. More...
 
 operator unsigned int () const
 Conversion operator to the unsigned int built-in type. More...
 
 operator int () const
 Conversion operator to the int built-in type. More...
 
 operator unsigned long () const
 Conversion operator to the unsigned long built-in type. More...
 
 operator long () const
 Conversion operator to the long built-in type. More...
 
 operator float () const
 Conversion operator to the float built-in type. More...
 
 operator double () const
 Conversion operator to the double built-in type. More...
 
 operator long double () const
 Conversion operator to the long double built-in type. More...
 
Arithmetic operators
const Infinityoperator+ () const
 Returns the positive infinity value for all built-in data types. More...
 
const NegativeType operator- () const
 Returns the negative infinity value for all built-in data types. More...
 
Utility functions
template<typename T >
bool equal (const T &rhs) const
 Equality comparison to a built-in data type. More...
 

Private Member Functions

Forbidden operations
Infinityoperator= (const Infinity &inf)
 Copy assignment operator (private & undefined)
 
void * operator& () const
 Address operator (private & undefined)
 

Detailed Description

Positive infinity for built-in data types.

The Infinity class is a wrapper class around the functionality of the blaze::Limits class to provide the possiblity to assign a positive infinity value to built-in data types. As positive infinity value, the largest possible positive value of the corresponding data type is used. In order to assign the positive infinity value, the Infinity class can be implicitly converted to the following 13 built-in integral and floating point data types:

In order to be able to assign infinity values, the global Infinity instance blaze::inf is provided, which can be used wherever a built-in data type is required.

int i = inf; // Assigns a positive infinity value
double d = -inf; // Assigns a negative infinity value
...

Member Function Documentation

template<typename T >
bool blaze::Infinity::equal ( const T &  rhs) const
inline

Equality comparison to a built-in data type.

This function compares built-in data types with their largest possible value. The function only works for built-in data types. The attempt to compare user-defined class types will result in a compile time error.

blaze::Infinity::operator char ( ) const
inline

Conversion operator to the char built-in type.

The conversion operator returns the largest possible char value.

blaze::Infinity::operator double ( ) const
inline

Conversion operator to the double built-in type.

The conversion operator returns the largest possible double value.

blaze::Infinity::operator float ( ) const
inline

Conversion operator to the float built-in type.

The conversion operator returns the largest possible float value.

blaze::Infinity::operator int ( ) const
inline

Conversion operator to the int built-in type.

The conversion operator returns the largest possible int value.

blaze::Infinity::operator long ( ) const
inline

Conversion operator to the long built-in type.

The conversion operator returns the largest possible long value.

blaze::Infinity::operator long double ( ) const
inline

Conversion operator to the long double built-in type.

The conversion operator returns the largest possible long double value.

blaze::Infinity::operator short ( ) const
inline

Conversion operator to the short built-in type.

The conversion operator returns the largest possible short value.

blaze::Infinity::operator signed char ( ) const
inline

Conversion operator to the signed char built-in type.

The conversion operator returns the largest possible signed char value.

blaze::Infinity::operator unsigned char ( ) const
inline

Conversion operator to the unsigned char built-in type.

The conversion operator returns the largest possible unsigned char value.

blaze::Infinity::operator unsigned int ( ) const
inline

Conversion operator to the unsigned int built-in type.

The conversion operator returns the largest possible unsigned int value.

blaze::Infinity::operator unsigned long ( ) const
inline

Conversion operator to the unsigned long built-in type.

The conversion operator returns the largest possible unsigned long value.

blaze::Infinity::operator unsigned short ( ) const
inline

Conversion operator to the unsigned short built-in type.

The conversion operator returns the largest possible unsigned short value.

blaze::Infinity::operator wchar_t ( ) const
inline

Conversion operator to the wchar_t built-in type.

The conversion operator returns the largest possible wchar_t value.

const Infinity & blaze::Infinity::operator+ ( ) const
inline

Returns the positive infinity value for all built-in data types.

Returns
The positive infinity value.
const Infinity::NegativeType blaze::Infinity::operator- ( ) const
inline

Returns the negative infinity value for all built-in data types.

Returns
The negative infinity value.

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