Boost logo

Boost :

From: Lee Brown (lee_at_[hidden])
Date: 2002-02-16 23:56:37


What about something that worked like this?

-----------------------------------

#include <property.hpp>
#include <algorithm>

struct mm : public PROPERTIED(mm) {
public:
   int get_i() const { return i; }
   void set_i(int i_) { i = i_; }

private:
   int i;
  PROPERTY(mm, i);
};

DEF_PROPERTIED(mm);
DEF_PROPERTY(mm, int, i);

void print_prop_name(const string& n)
{
   cout << "property is " << n << "\n";
}

int main()
{
   list<string> ret = mm::list_property_names();
   for_each(ret.begin(), ret.end(), &print_prop_name);

   mm some_mm;
   some_mm.set_property_value("i", "2");
   int i_val;
   istrstream(some_mm.get_property_value("i").c_str()) >> ival;

}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk