#include <iostream>
#include <functional>

using namespace std;

#define RO_PROP(T, N, G) ro_prop<T> N = ro_prop<T>([this]() { return G; })

template <typename T> class ro_prop
{
  private:
    const function<T()> get;

  public:
    ro_prop(const function<T()> &&get) : get(get) {}
    operator T() { return get(); }
};

struct rect
{
  int width, height;
  RO_PROP(int, area, width * height);
};

int main()
{
  rect a { 2, 3 };
  int s = a.area;
  
  cout << s << endl;
  
  return 0;
}