
20 Dec
2008
20 Dec
'08
2:13 p.m.
Daniel Oberhoff wrote:
HasPropertiesBase<VariantTypes> * foo = new Foo; foo->set_property("a", 1); int a = get<int>( foo->get_property( "a" ) );
And I suppose if it's not an int, it throws? For proprieties, it might be better to provide lexical conversion to the target type, so that it always succeeds (modulo allocation errors). Anyway, I'm not too sure this is very useful. It's just a std::map<std::string, some_variant_type>. Does that really deserve its own class?