From 8fa17e0f15330cb1ce169fb3660845d0b2f03ea7 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 6 Feb 2025 14:28:41 +0100 Subject: [PATCH] Tell C++11 compilers to generate default copy operator Recent compilers complain about using memcpy on a class with non-trivial copy-assignment operator. However, this is used in the the impementation of that operator. Avoid in C++11 in favor of explicitly asking for the default. --- src/gdd/gddI.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gdd/gddI.h b/src/gdd/gddI.h index ef13f66bd..406785fa0 100644 --- a/src/gdd/gddI.h +++ b/src/gdd/gddI.h @@ -114,7 +114,11 @@ inline void gdd::setStatSevr(aitInt16 stat, aitInt16 sevr) { status.s.aitStat = stat; status.s.aitSevr = sevr; } inline gdd& gdd::operator=(const gdd& v) +#if __cplusplus >= 201103L + = default; +#else { memcpy(this,&v,sizeof(gdd)); return *this; } +#endif inline int gdd::isScalar(void) const { return dimension()==0?1:0; } inline int gdd::isContainer(void) const