if (this->m_moved) throw std::logic_error("Content already moved");\
this->m_moved=true; \
temp.makeDouble(); \
if( temp.m_type == SE_DOUBLE ) { \
temp.m_doubleVal = BASEFUNC( temp.m_doubleVal ); \
return temp; \
} else if( temp.m_type == SE_VECDOUBLE ) { \
for( double& value : temp.m_vecDoubleVal ) { \
value = BASEFUNC( value ); \
} \
return temp; \
} else { \
\
return temp; \
} \
}
Helper macro for implementing many of the mathematical functions.
640#define UNARY_MATH_FUNCTION( FUNC, BASEFUNC ) \
641 StackElement StackElement::FUNC() { \
642 if (this->m_moved) throw std::logic_error("Content already moved");\
643 StackElement temp( std::move(*this) ); \
644 this->m_moved=true; \
645 temp.makeDouble(); \
646 if( temp.m_type == SE_DOUBLE ) { \
647 temp.m_doubleVal = BASEFUNC( temp.m_doubleVal ); \
648 return temp; \
649 } else if( temp.m_type == SE_VECDOUBLE ) { \
650 for( double& value : temp.m_vecDoubleVal ) { \
651 value = BASEFUNC( value ); \
652 } \
653 return temp; \
654 } else { \
655 \
656 return temp; \
657 } \
658 }