From 5cf6e0ec3fb49f0cd360e08f1e7d08dee1590f32 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Fri, 13 Nov 2009 15:57:24 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@94 ed2142bd-67ad-457f-ba7c-d818d4011675 --- misc/optvec.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 misc/optvec.hpp diff --git a/misc/optvec.hpp b/misc/optvec.hpp new file mode 100644 index 0000000..5cb78c1 --- /dev/null +++ b/misc/optvec.hpp @@ -0,0 +1,31 @@ +#include + +namespace opt_utilities +{ + template + class optvec + :public std::vector + { + public: + optvec() + {} + + optvec(size_t s) + :std::vector(s) + {} + + optvec(const std::vector& rhs) + :std::vector(rhs) + {} + public: + operator std::vector& () + { + return dynamic_cast&>(*this); + } + + operator const std::vector& ()const + { + return dynamic_cast&>(*this); + } + }; +}; -- cgit v1.2.2