From: sgunderson@bigfoot.com <> Date: Wed, 21 Sep 2011 22:46:15 +0000 (+0200) Subject: Add structure test for C++0x. Passes. X-Git-Url: https://git.sesse.net/?p=xml-template;a=commitdiff_plain;h=9479feb34459b0d1fcdaa6a6545827f3243cb513 Add structure test for C++0x. Passes. --- diff --git a/c++0x/Makefile b/c++0x/Makefile index f79d37a..b2528df 100644 --- a/c++0x/Makefile +++ b/c++0x/Makefile @@ -20,3 +20,6 @@ namespace: namespace.o $(LIBS) namespace2: namespace2.o $(LIBS) $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) + +structure: structure.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) diff --git a/c++0x/structure.cpp b/c++0x/structure.cpp new file mode 100644 index 0000000..2447feb --- /dev/null +++ b/c++0x/structure.cpp @@ -0,0 +1,19 @@ +#include + +#include "xml-template.h" + +using namespace std; + +int main(int argc, char **argv) +{ + Substitute master_directive = { + make_pair("#outer", new Clone { + new Substitute { make_pair("#inner", new Replace("One")) }, + new Substitute { make_pair("#inner", new Replace("Two")) }, + new Substitute { make_pair("#inner", new Replace("Three")) }, + }), + }; + + process_file("../xml/structure.xml", argv[1], &master_directive); + return(0); +}