From eec78fce81e81ed3386af841083ab17dee6f1a85 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Thu, 22 Sep 2011 00:18:58 +0200 Subject: [PATCH] Add a C++0x attribute test. Does not pass yet. --- c++0x/Makefile | 3 +++ c++0x/attribute.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 c++0x/attribute.cpp diff --git a/c++0x/Makefile b/c++0x/Makefile index 939c748..ee41b66 100644 --- a/c++0x/Makefile +++ b/c++0x/Makefile @@ -11,3 +11,6 @@ simple: simple.o $(LIBS) clone: clone.o $(LIBS) $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) + +attribute: attribute.o $(LIBS) + $(CXX) -o $@ $< $(LIBS) $(LDFLAGS) diff --git a/c++0x/attribute.cpp b/c++0x/attribute.cpp new file mode 100644 index 0000000..70b2391 --- /dev/null +++ b/c++0x/attribute.cpp @@ -0,0 +1,33 @@ +#include + +#include "xml-template.h" + +using namespace std; + +int main(int argc, char **argv) +{ + Substitute master_directive = { + make_pair("color", new Replace("blue")), + make_pair("#things", new Clone { + new Substitute { + make_pair("li", new Replace("Raindrops on roses")), + make_pair("li/class", new Replace("odd")), + }, + new Substitute { + make_pair("li", new Replace("Whiskers on kittens")), + make_pair("li/class", new Replace("even")), + }, + new Substitute { + make_pair("li", new Replace("Bright copper kettles")), + make_pair("li/class", new Replace("odd")), + }, + new Substitute { + make_pair("li", new Replace("Warm, woolen mittens")), + make_pair("li/class", new Replace("even")), + }, + }), + }; + + process_file("../xml/clone.xml", argv[1], &master_directive); + return(0); +} -- 2.39.2