diff --git a/include/openPMD/RecordComponent.hpp b/include/openPMD/RecordComponent.hpp index c3c5a3dbc0..0c9ead0263 100644 --- a/include/openPMD/RecordComponent.hpp +++ b/include/openPMD/RecordComponent.hpp @@ -388,7 +388,7 @@ class RecordComponent : public BaseRecordComponent * @param extent Extent within the dataset, counted from the offset. */ template - void storeChunkRaw(T *data, Offset offset, Extent extent); + void storeChunkRaw(T const *data, Offset offset, Extent extent); /** Store a chunk of data from a contiguous container. * diff --git a/include/openPMD/auxiliary/ShareRawInternal.hpp b/include/openPMD/auxiliary/ShareRawInternal.hpp index b26f0b59f9..5014a8cdbb 100644 --- a/include/openPMD/auxiliary/ShareRawInternal.hpp +++ b/include/openPMD/auxiliary/ShareRawInternal.hpp @@ -61,16 +61,14 @@ std::shared_ptr shareRaw(T const *x) } template -auto shareRaw(T &c) - -> std::shared_ptr::type> +auto shareRaw(T &c) -> std::shared_ptr { using value_type = typename std::remove_pointer::type; return std::shared_ptr(c.data(), [](value_type *) {}); } template -auto shareRaw(T const &c) - -> std::shared_ptr::type> +auto shareRaw(T const &c) -> std::shared_ptr { using value_type = typename std::remove_pointer::type; return std::shared_ptr(c.data(), [](value_type *) {}); diff --git a/src/RecordComponent.cpp b/src/RecordComponent.cpp index a57f1d8f97..a2ffdfb43f 100644 --- a/src/RecordComponent.cpp +++ b/src/RecordComponent.cpp @@ -820,13 +820,13 @@ template void RecordComponent::storeChunk(std::shared_ptr data, Offset o, Extent e) { storeChunk( - std::static_pointer_cast(std::move(data)), + std::static_pointer_cast(std::move(data)), std::move(o), std::move(e)); } template -void RecordComponent::storeChunkRaw(T *ptr, Offset offset, Extent extent) +void RecordComponent::storeChunkRaw(T const *ptr, Offset offset, Extent extent) { storeChunk(auxiliary::shareRaw(ptr), std::move(offset), std::move(extent)); } @@ -864,15 +864,15 @@ void RecordComponent::verifyChunk(Offset const &o, Extent const &e) const template void RecordComponent::verifyChunk( \ Offset const &o, Extent const &e) const; \ template DynamicMemoryView RecordComponent::storeChunk( \ - Offset offset, Extent extent); + Offset offset, Extent extent); \ + template void RecordComponent::storeChunkRaw( \ + OPENPMD_PTR(type const) ptr, Offset offset, Extent extent); #define OPENPMD_INSTANTIATE_CONST_AND_NONCONST(type) \ template void RecordComponent::storeChunk( \ std::shared_ptr data, Offset o, Extent e); \ template void RecordComponent::storeChunk( \ - std::shared_ptr data, Offset o, Extent e); \ - template void RecordComponent::storeChunkRaw( \ - OPENPMD_PTR(type) ptr, Offset offset, Extent extent); + std::shared_ptr data, Offset o, Extent e); #define OPENPMD_INSTANTIATE_WITH_AND_WITHOUT_EXTENT(type) \ template std::shared_ptr RecordComponent::loadChunk( \