#pragma once #include #include //#include //----------------------------------------------------------------------------- // VectorOfPtr //----------------------------------------------------------------------------- template class VectorOfPtr : public std::vector > { typedef std::vector > inherited; public: // using inherited::inherited; VectorOfPtr () { } VectorOfPtr (VectorOfPtr && from) : inherited (std::move (from)) { } VectorOfPtr (const VectorOfPtr & from) = delete; ~VectorOfPtr () { __noop; } public: inline void Attach (T * value) { std::unique_ptr ptr (value); push_back (std::move (ptr)); } inline int GetSize () const { return (int)size (); } inline bool IsEmpty () const { return inherited::empty (); } inline void Reset () { clear (); } inline std::vector ToVector () { std::vector to; for (const auto & Item : *this) { to.push_back (Item.get ()); } return to; } // int IndexOf (const T * t) const; };