Home · All Classes · alphabetical Classes List · Modules · Functions ·

QxtNullable< T > Class Template Reference
[Core]

distinct null value compatible with any data type. More...

Public Member Functions

Related Functions

(Note that these are not member functions.)

Detailed Description

template<typename T>
class QxtNullable< T >

distinct null value compatible with any data type.

in general it's a templated abstraction to allow any data type to be expressed with a null value distinct from any real value.

you can use it for skipable arguments.
prepare a function for argument skipping:

void  somefunction( qxtNull(int,a) , qxtNull(int,b) )
{
 
if (!a.isNull())
        {
        int i = a.value();
        //do something with i
        }
 if (!b.isNull())
        {
        int x = b.value();
        //do something with x
        }
}

usage:

somefunction(SKIP,1,2);
somefunction(3,4);
somefunction(3,SKIP,6);
somefunction(1);


Friends And Related Function Documentation

template<typename T>
qxtNull ( t, ) [related]

defines a skipable argument with type t and variable name n



(c) 2007A.Picciani and A.Higerd LGPL
libqxt 0.2