#include #include #include #include using namespace std ; struct Calculator { // A simple member function int add( int x1 , int x2 ) { return x1 + x2 ; } }; int main() { Calculator obj1{}; // Initialize struct with value = 10 // Call the member function directly using std::invoke int result1 = std::invoke( &Calculator::add, obj1, 5 , 6 ); std::cout << "Result with object: " << result1 << '\n'; // Outputs 15 return 1 ; }