MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / operator+

Method operator+

src/Dynamic.cpp:471–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469
470
471Dynamic Dynamic::operator+(const Dynamic &inRHS) const
472{
473 int t1 = mPtr ? mPtr->__GetType() : vtNull;
474 int t2 = inRHS.mPtr ? inRHS.mPtr->__GetType() : vtNull;
475
476 if ( (t1==vtInt || t1==vtFloat) && (t2==vtInt || t2==vtFloat) )
477 {
478 return mPtr->__ToDouble() + inRHS.mPtr->__ToDouble();
479 }
480 if (!mPtr)
481 return String() + inRHS;
482 if (!inRHS.mPtr)
483 return *this + String();
484
485 return const_cast<hx::Object*>(mPtr)->toString() + const_cast<Dynamic&>(inRHS)->toString();
486}
487
488#define DYN_OP_ADD(TYPE) \
489Dynamic Dynamic::operator+(const TYPE &i) const \

Callers

nothing calls this directly

Calls 6

asStringMethod · 0.80
asDoubleMethod · 0.80
StringClass · 0.50
__GetTypeMethod · 0.45
__ToDoubleMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected