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

using NegativeType = NegativeInfinity< Infinity >
 The negative infinity type.
 

Public Member Functions

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

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

◆ equal()

template<typename T >
constexpr 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.

◆ operator char()

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

Conversion operator to the char built-in type.

The conversion operator returns the largest possible char value.

◆ operator double()

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

Conversion operator to the double built-in type.

The conversion operator returns the largest possible double value.

◆ operator float()

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

Conversion operator to the float built-in type.

The conversion operator returns the largest possible float value.

◆ operator int()

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

Conversion operator to the int built-in type.

The conversion operator returns the largest possible int value.

◆ operator long()

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

Conversion operator to the long built-in type.

The conversion operator returns the largest possible long value.

◆ operator long double()

constexpr 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.

◆ operator short()

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

Conversion operator to the short built-in type.

The conversion operator returns the largest possible short value.

◆ operator signed char()

constexpr 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.

◆ operator unsigned char()

constexpr 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.

◆ operator unsigned int()

constexpr 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.

◆ operator unsigned long()

constexpr 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.

◆ operator unsigned short()

constexpr 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.

◆ operator wchar_t()

constexpr 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.

◆ operator+()

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

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

Returns
The positive infinity value.

◆ operator-()

constexpr 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: