Listing 4

// sample.h
struct sample : reflectable_properties_object<sample> {
    int a() const           { return m_a; }
    void b(bool v)          { m_b = v; notify(&me::b); }
    long c() const          { return m_c; }
    void c(long l)          { m_c = l; notify(&me::c); }
    ...
};
// sample.cpp
// get-only
register_reflect r1("a", &sample::a);
// set-only
register_reflect r2("b", &sample::b);
// get/set
register_reflect r3("c", &sample::c, &sample::c);