diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseData.h b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseData.h index f136100ced0..0e3a4c7d894 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseData.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseData.h @@ -291,11 +291,14 @@ class SOFA_CORE_API BaseData : public DDGNode template static std::string typeName() { - if (defaulttype::DataTypeInfo::ValidInfo) + if constexpr (defaulttype::DataTypeInfo::ValidInfo) { return defaulttype::DataTypeName::name(); } - return decodeTypeName(typeid(T)); + else + { + return decodeTypeName(typeid(T)); + } } protected: diff --git a/Sofa/framework/DefaultType/src/sofa/defaulttype/typeinfo/models/FixedArrayTypeInfo.h b/Sofa/framework/DefaultType/src/sofa/defaulttype/typeinfo/models/FixedArrayTypeInfo.h index f4e55f12ead..f8d3bb3eac7 100644 --- a/Sofa/framework/DefaultType/src/sofa/defaulttype/typeinfo/models/FixedArrayTypeInfo.h +++ b/Sofa/framework/DefaultType/src/sofa/defaulttype/typeinfo/models/FixedArrayTypeInfo.h @@ -65,7 +65,7 @@ struct FixedArrayTypeInfo static sofa::Size size(const DataType& data) { - if (FixedSize) + if constexpr (FixedSize) return size(); else { @@ -78,11 +78,14 @@ struct FixedArrayTypeInfo static bool setSize(DataType& data, sofa::Size size) { - if (!FixedSize) + if constexpr (!FixedSize) { size /= data.size(); - for (sofa::Size i=0; i static void getValue(const DataType &data, sofa::Size index, T& value) { - if (BaseTypeInfo::FixedSize) + if constexpr (BaseTypeInfo::FixedSize) { typename DataType::const_iterator it = data.begin(); for (sofa::Size i=0; i