#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // A 'NewUsing' block ensures the expression is automatically released at the end of the scope. // This is the safest pattern to prevent memory leaks. { uCalc::Expression expr("5 * 10"); expr.Owned(); // Causes expr to be released when it goes out of scope cout << "Result within scope: " << expr.Evaluate() << endl; } // The 'expr' object is now released and its handle is invalid. cout << "Expression has been automatically released." << endl; }