Skip to content

Commit 085ef1c

Browse files
committed
PatchRecordComponent: Match Identical Types
1 parent 0636ce5 commit 085ef1c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ template <typename T>
160160
inline void PatchRecordComponent::store(uint64_t idx, T data)
161161
{
162162
Datatype dtype = determineDatatype<T>();
163-
if (dtype != getDatatype())
163+
if (dtype != getDatatype() && !isSameInteger<T>(getDatatype()) &&
164+
!isSameFloatingPoint<T>(getDatatype()) &&
165+
!isSameComplexFloatingPoint<T>(getDatatype()) &&
166+
!isSameChar<T>(getDatatype()))
164167
{
165168
std::ostringstream oss;
166169
oss << "Datatypes of patch data (" << dtype << ") and dataset ("
@@ -187,7 +190,10 @@ template <typename T>
187190
inline void PatchRecordComponent::store(T data)
188191
{
189192
Datatype dtype = determineDatatype<T>();
190-
if (dtype != getDatatype())
193+
if (dtype != getDatatype() && !isSameInteger<T>(getDatatype()) &&
194+
!isSameFloatingPoint<T>(getDatatype()) &&
195+
!isSameComplexFloatingPoint<T>(getDatatype()) &&
196+
!isSameChar<T>(getDatatype()))
191197
{
192198
std::ostringstream oss;
193199
oss << "Datatypes of patch data (" << dtype << ") and dataset ("

0 commit comments

Comments
 (0)