From 249203127d1ae989785978024ef0ad25bc994384 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 11 Jul 2009 16:54:58 +0000 Subject: Allow Array's of non-POD types through specialized Array_Element class. --- libdimensionxx/dimensionxx/object.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libdimensionxx/dimensionxx/object.hpp') diff --git a/libdimensionxx/dimensionxx/object.hpp b/libdimensionxx/dimensionxx/object.hpp index 8283c9c..30dadf8 100644 --- a/libdimensionxx/dimensionxx/object.hpp +++ b/libdimensionxx/dimensionxx/object.hpp @@ -78,6 +78,25 @@ namespace Dimension virtual Array intersections(const Line& l) = 0; virtual bool inside(const Vector& point) = 0; }; + + // Array_Element specialization + template <> + class Array_Element + : public Polymorphic_Array_Element + { + public: + typedef dmnsn_object* C_Type; + + Array_Element() { } + Array_Element(Object& object) + : Polymorphic_Array_Element(object) { } + Array_Element(C_Type c) + : Polymorphic_Array_Element(c) { } + // Array_Element(const Array_Element& ae); + // ~Array_Element(); + + // Array_Element& operator=(const Array_Element& ae); + }; } #endif /* DIMENSIONXX_OBJECT_HPP */ -- cgit v1.2.3