Commit 2814b2e6 authored by Dave Moxey's avatar Dave Moxey

Fix issue with incorrect lambda capture

parent 0dcd57d7
......@@ -33,7 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_ARRAY_POLICIES_HPP
#define NEKTAR_LIB_UTILITIES_BASIC_UTILS_ARRAY_POLICIES_HPP
......@@ -106,14 +105,14 @@ namespace Nektar
{
DoInitialization(
data, itemsToCreate,
[&initValue](ObjectType *element) { new (element) ObjectType(initValue); });
[&](ObjectType *element) { new (element) ObjectType(initValue); });
}
static void Initialize(ObjectType* data, unsigned int itemsToCreate, const ObjectType* initValue)
{
DoInitialization(
data, itemsToCreate,
[&initValue](ObjectType *element) { new (element) ObjectType(*initValue); initValue++; });
[&](ObjectType *element) { new (element) ObjectType(*initValue); initValue++; });
}
private:
......@@ -170,7 +169,7 @@ namespace Nektar
}
}
};
template<typename Dim, typename DataType, typename ExtentListType>
std::shared_ptr<boost::multi_array_ref<DataType, Dim::Value> >
CreateStorage(const ExtentListType& extent)
......@@ -180,7 +179,7 @@ namespace Nektar
std::multiplies<unsigned int>());
DataType* storage = MemoryManager<DataType>::RawAllocate(size);
return MemoryManager<ArrayType>::AllocateSharedPtrD(
[storage, size](DataType *ptr) {
[=](boost::multi_array_ref<DataType, Dim::Value> *ptr) {
ArrayDestructionPolicy<DataType>::Destroy(storage, size);
MemoryManager<DataType>::RawDeallocate(storage, size);
},
......
......@@ -168,7 +168,7 @@ public:
{
DataType* data = Allocate(args...);
return std::shared_ptr<DataType>(
data, [&d](DataType *ptr){
data, [=](DataType *ptr){
d(ptr);
MemoryManager<DataType>::Deallocate(ptr);
});
......
Markdown is supported
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