#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; // Succinct (Quick Start) // Create two separate uCalc instances uCalc uc1; uCalc uc2; // Parse the same expression string in both instances auto expr1 = uc1.Parse("1 + 1"); auto expr2 = uc2.Parse("1 + 1"); // Use the .uCalc() method and MemoryIndex to verify ownership cout << "expr1 belongs to uc1: " << tf(expr1.uCalc().MemoryIndex() == uc1.MemoryIndex()) << endl; cout << "expr2 belongs to uc2: " << tf(expr2.uCalc().MemoryIndex() == uc2.MemoryIndex()) << endl; cout << "expr1 does not belong to uc2: " << tf(expr1.uCalc().MemoryIndex() != uc2.MemoryIndex()) << endl; }