Skip to content

Commit 818550f

Browse files
authored
Added copy constructor to ResourceLimitedVector. [6247] (eProsima#681)
* Refs #6244. Added copy constructor to ResourceLimitedVector. * Refs #6244. Fixed use of c++14. * Refs #6244. Applying coding style.
1 parent 554d6ae commit 818550f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/fastrtps/utils/collections/ResourceLimitedVector.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ class ResourceLimitedVector
9595
collection_.reserve(cfg.initial);
9696
}
9797

98+
ResourceLimitedVector(
99+
const ResourceLimitedVector& other)
100+
: configuration_(other.configuration_)
101+
, collection_(other.collection_.get_allocator())
102+
{
103+
collection_.reserve(other.collection_.capacity());
104+
collection_.assign(other.collection_.begin(), other.collection_.end());
105+
}
106+
98107
ResourceLimitedVector& operator = (const ResourceLimitedVector& other)
99108
{
100109
clear();

0 commit comments

Comments
 (0)