Commit ba6f878f authored by mattijs's avatar mattijs
Browse files

added copy constructor since List copy constructor does not know about allocated size

parent 2998f15d
......@@ -101,6 +101,12 @@ public:
//- Construct given size.
explicit inline DynamicList(const label);
//- Construct copy.
explicit inline DynamicList
(
const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
);
//- Construct from UList. Size set to UList size.
explicit inline DynamicList(const UList<T>&);
......
......@@ -49,6 +49,17 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
)
:
List<T>(lst),
capacity_(lst.size())
{}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment