#include <iostream>
#include <functional>

using namespace std;

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 = ro_prop<int>([this]() { return width * height; });
};

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