The second idea putting everything into a struct like:
struct NAMESPACE_myMath { float add(float a, b) { return a + b; } float sub(float a, b) { return this->add(a, -b); } } #define myMath NAMESPACE_myMath()
While this technically works, I find it ugly for several reasons, first, I dont know the performance/memory footprint (could be just fine, or not?) and second, referring to other functions using
this->doesnt sit right with me.The third idea would be to just prefix every function:
float myMath__add(float a, b) { return a + b; } float myMath__sub(float a, b) { return myMath__add(a, -b); }
Is there something I missed? A suggested workflow? Another workaround?
Thanks in advance!
Edit: formatting
