Qore Programming Language 2.3.0
Loading...
Searching...
No Matches
QoreSimpleValue hashdecl Reference

Minimal value type with uninitialized default constructor for use in unions. More...

#include <QoreValue.h>

Public Member Methods

 QoreSimpleValue () noexcept=default
 Default constructor - leaves bits UNINITIALIZED (required for unions)
 
 QoreSimpleValue (const QoreSimpleValue &) noexcept=default
 Copy constructor - trivial.
 
DLLLOCAL QoreSimpleValue (const QoreValue &v) noexcept
 Construct from QoreValue (implicit conversion)
 
DLLLOCAL operator bool () const noexcept
 Explicit bool conversion - true if not Nothing (bits != 0) and not Null.
 
QoreSimpleValueoperator= (const QoreSimpleValue &) noexcept=default
 Copy assignment - trivial.
 
DLLLOCAL QoreSimpleValueoperator= (const QoreValue &v) noexcept
 Assignment from QoreValue.
 
DLLLOCAL uint64_t rawBits () const noexcept
 Returns the raw bits for debugging/serialization.
 
DLLLOCAL void setRawBits (uint64_t b) noexcept
 Set raw bits directly (for deserialization)
 

Public Attributes

uint64_t bits
 The raw 64-bit NaN-boxed value - PUBLIC for direct access in parser.
 

Detailed Description

Minimal value type with uninitialized default constructor for use in unions.

This hashdecl is designed for use in:

  • C unions (requires trivial default constructor)
  • varargs passing (requires trivial copy)

WARNING: Default constructor leaves bits UNINITIALIZED. Convert to QoreValue before calling any methods.

// In union:
union { QoreSimpleValue qv; ... };
// When using:
QoreValue(u.qv).someMethod(); // Convert first!
The main value class in Qore, designed to be passed by value.
Definition QoreValue.h:263
Minimal value type with uninitialized default constructor for use in unions.
Definition QoreValue.h:100
See also
QoreValue for the safe version with initialized default constructor

Member Function Documentation

◆ operator bool()

DLLLOCAL QoreSimpleValue::operator bool ( ) const
inlineexplicitnoexcept

Explicit bool conversion - true if not Nothing (bits != 0) and not Null.

Note: This is a quick check, not a full type analysis

References bits.


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