diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index 174291230..8796fb288 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -111,6 +111,27 @@ struct Pointer uint64_t val; }; +// ------------------------------------------------------------------------------- +/** Dummy derivate of std::vector to be able to use it in templates simultaenously + * with boost::shared_ptr, which takes only one template argument + * while std::vector takes three. Also we need to provide some special member + * functions of shared_ptr */ +// ------------------------------------------------------------------------------- +template +class vector : public std::vector +{ +public: + using std::vector::resize; + using std::vector::empty; + + void reset() { + resize(0); + } + + operator bool () const { + return !empty(); + } +}; // ------------------------------------------------------------------------------- /** Mixed flags for use in #Field */ @@ -181,7 +202,7 @@ public: // publicly accessible members std::string name; - std::vector< Field > fields; + vector< Field > fields; std::map indices; size_t size; @@ -255,6 +276,11 @@ private: void ResolvePointer(TOUT& out, const Pointer & ptrval, const FileDatabase& db, const Field& f) const; + // -------------------------------------------------------- + template