the overload of the assignment operator ( operator= ) returns a *this pointer (basic); | |
contains examples of Unicode strings (intermediate); | |
uses typeid() to determine correct methods to call (advanced). |
// inline operator methods // inline Boolean& operator= (boolean arg) { value_d = arg; return *this; } |
#include <typeinfo> //not <typeinfo.h> |
// test rms // if (typeid(TIntegral) != typeid(byte)) { dval = arg_mat1.rms();   val_res.assign((TIntegral)MMAT_RMS_RES[mat1]);   if (typeid(TIntegral) != typeid(float)) {     if (!val_res.almostEqual(dval, (long)42)) {       Console::put(arg1_str);       dval.debug(L"out rms");       val_res.debug(L"res rms");       Error::handle(name(), L"rms", Error::TEST, __FILE__, __LINE__);     }  } |
// we define non-integral constants in the default constructor // const String Boolean::CLASS_NAME(L"Boolean"); const String Boolean::DEF_PARAM(L"value"); |