Skip to content
Snippets Groups Projects
Commit b60d6b7f authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Change constructor in copy function

The previous implementation would allocate an array that would be
destroyed immediately, since the (deep)copy of the array allocates it
properly.
parent 9c8a7c44
No related branches found
No related tags found
1 merge request!84Add SubArray class
......@@ -37,16 +37,17 @@ class ItemValue
// Allow const std:weak_ptr version to access our data
friend ItemValue<std::add_const_t<DataType>, item_type, ConnectivityWeakPtr>;
public:
friend PUGS_INLINE ItemValue<std::remove_const_t<DataType>, item_type, ConnectivityPtr>
copy(const ItemValue<DataType, item_type, ConnectivityPtr>& source)
{
ItemValue<std::remove_const_t<DataType>, item_type, ConnectivityPtr> image(*source.connectivity_ptr());
ItemValue<std::remove_const_t<DataType>, item_type, ConnectivityPtr> image;
image.m_connectivity_ptr = source.m_connectivity_ptr;
image.m_values = copy(source.m_values);
return image;
}
public:
PUGS_INLINE
bool
isBuilt() const noexcept
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment