From 1ee5f374ed986333d5cdbbf41390f1c4c755a8e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 12 Oct 2010 06:09:48 +0000 Subject: This commit has a minor tweak to the variant class to make it easier to use, and introduces the parser and lexer classes. I also made a test for parser and put it in the tools directory. That is silly, it shouldn't be. However, it's necesarry right now, because I don't want to do a full build to compile all the parser tests. However, this commit doesn't actually build yet. It will soon, I just wanted to get it all committed. --- src/variant.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/variant.h') diff --git a/src/variant.h b/src/variant.h index 809aab9..5482ee3 100644 --- a/src/variant.h +++ b/src/variant.h @@ -98,9 +98,15 @@ namespace Bu public: Variant(); Variant( const Variant &v ); + template + Variant( const t &v ) : + pCore( new VariantType() ) + { + (*dynamic_cast *>(pCore)) = v; + } virtual ~Variant(); - bool isSet(); + bool isSet() const; Bu::FString toString() const; const std::type_info &getType() const; -- cgit v1.2.3