Skip to content

Commit 4045aa2

Browse files
committed
PatchRecordComponent: Match Identical Types
1 parent 0636ce5 commit 4045aa2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ 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()))
167+
)
164168
{
165169
std::ostringstream oss;
166170
oss << "Datatypes of patch data (" << dtype << ") and dataset ("
@@ -187,7 +191,11 @@ template <typename T>
187191
inline void PatchRecordComponent::store(T data)
188192
{
189193
Datatype dtype = determineDatatype<T>();
190-
if (dtype != getDatatype())
194+
if (dtype != getDatatype() && !isSameInteger<T>(getDatatype()) &&
195+
!isSameFloatingPoint<T>(getDatatype()) &&
196+
!isSameComplexFloatingPoint<T>(getDatatype()) &&
197+
!isSameChar<T>(getDatatype()))
198+
)
191199
{
192200
std::ostringstream oss;
193201
oss << "Datatypes of patch data (" << dtype << ") and dataset ("

0 commit comments

Comments
 (0)