Metatemplateprogramming is really cool
This commit is contained in:
		| @@ -14,11 +14,12 @@ | ||||
|  | ||||
| class A: public xml::Serialize { | ||||
|   public: | ||||
|     std::list<std::string> list; | ||||
|     xml::List<std::string> list; | ||||
|   protected: | ||||
|     void initXmlMembers() { | ||||
|       LOG("A::initXmlMembers"); | ||||
|       className("A"); | ||||
|       persist(list, "list", "item"); | ||||
|       persist(list, "list"); | ||||
|     } | ||||
| }; | ||||
|  | ||||
| @@ -35,8 +36,8 @@ int main(int, char**) { | ||||
|   A a; | ||||
|   std::cout<<"Schema:\n"<<a.schema()<<std::endl; | ||||
|   a.loadXml(ss); | ||||
|   if (a.list.front()=="Hello") a.list.front()="Good Bye"; | ||||
|   if (a.list.back()=="you") a.list.back()="we"; | ||||
| //   if (a.list.front()=="Hello") a.list.front()="Good Bye"; | ||||
| //   if (a.list.back()=="you") a.list.back()="we"; | ||||
|   a.saveXml(std::cout)<<std::endl; | ||||
|   return 0; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user