IntFloat32 Struct Reference

#include <intfloat.h>

详细描述

This structure is used to map an integer and a floating point value to the same memory location. A stucture is used since gcc outputs a warning if you do something like *((Int32*)&myFloat32Value).

公共成员函数

  IntFloat32 ()=default
  IntFloat32 ( Int32 a)
  IntFloat32 ( UInt32 a)
  IntFloat32 ( Float32 a)
const IntFloat32 operator= (const IntFloat32 &other)
UInt32   GetUInt () const

Public Attributes

union {
    Int32     i
    Float32     f
}; 

Friends

Bool   operator== (const IntFloat32 &a, const IntFloat32 &b)
Bool   operator!= (const IntFloat32 &a, const IntFloat32 &b)

构造函数 & 析构函数文档编制

◆  IntFloat32() [1/4]

IntFloat32 ( )
default

◆  IntFloat32() [2/4]

IntFloat32 ( Int32   a )
explicit

◆  IntFloat32() [3/4]

IntFloat32 ( UInt32   a )
explicit

◆  IntFloat32() [4/4]

IntFloat32 ( Float32   a )
explicit

成员函数文档编制

◆  operator=()

const IntFloat32 & operator= ( const IntFloat32 other )

◆  GetUInt()

UInt32 GetUInt ( ) const

Friends And Related Function Documentation

◆  operator==

Bool operator== ( const IntFloat32 a ,
const IntFloat32 b  
)
friend

◆  operator!=

Bool operator!= ( const IntFloat32 a ,
const IntFloat32 b  
)
friend

Member Data Documentation

◆  i

Int32 i

◆  f

Float32 f

◆  @1045

union { ... }