Post

Replies

Boosts

Views

Activity

Reply to how to support user-defined C++ types inside <complex>?
Thank you for the confirmation that a plugin type should NOT provide a std::is_arithmetic<> implementation. I take it that std::is_arithmetic is designed to identify native language types, not the concept of an arithmetic type. Everything lives in namespace sw::universal. We have: namespace sw { namespace universal { // STD LIB function for IEEE floats: Determines if the given floating point number arg is a positive or negative infinity. // specialized for fixpnts template<unsigned nbits, unsigned rbits, bool arithmetic, typename BlockType> inline constexpr bool isinf(const fixpnt<nbits, rbits, arithmetic, BlockType>& a) { return false; } } } The lib and its regression suite passes on msvc, ICC, GCC, and Clang, on Windows, Linux, and worked on MacOS prior to Xcode 15, but since GitHub Actions has progressed 'macos-latest' to Xcode 15, the CI is failing for MacOS/Xcode 15. It passes in OS Version: macOS 12.7.5 (21H1222) Kernel Version: Darwin 21.6.0 Image Version: 20240630.1 and OS Version: macOS 13.6.7 (22G807) Kernel Version: Darwin 22.6.0 Image Version: 20240630.1 started failing in OS Version: macOS 14.5 (23F79) Kernel Version: Darwin 23.5.0 Image Version: 20240701.1
Jul ’24
Reply to how to support user-defined C++ types inside <complex>?
Good suggestion but that has not resolved the issue: still the same error. I would like to understand this error message: /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:417:80: note: candidate template ignored: requirement 'std::is_arithmetic<sw::universal::fixpnt<4, 0, true, unsigned char>>::value' was not satisfied [with _A1 = sw::universal::fixpnt<4, 0>] _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT { ^ /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:424:5: note: candidate template ignored: requirement 'std::is_arithmetic<sw::universal::fixpnt<4, 0, true, unsigned char>>::value' was not satisfied [with _A1 = sw::universal::fixpnt<4, 0>] isinf(_A1) _NOEXCEPT { ^ It would make sense that as an plugin-type author you would want to support this overload, but it is the first time I am seeing this, so need to do some research on why this dependency is injected.
Jul ’24
Reply to how to support user-defined C++ types inside <complex>?
Yes, it does through this mechanism: #pragma once // math_classify.hpp: classification functions for fixpnts // // Copyright (C) 2017 Stillwater Supercomputing, Inc. // SPDX-License-Identifier: MIT // // This file is part of the universal numbers project, which is released under an MIT Open Source license. namespace sw { namespace universal { // STD LIB function for IEEE floats: Categorizes floating point value arg into the following categories: zero, subnormal, normal, infinite, NAN, or implementation-defined category. template<unsigned nbits, unsigned rbits, bool arithmetic, typename BlockType> int fpclassify(const fixpnt<nbits, rbits, arithmetic, BlockType>& a) { return std::fpclassify((long double)(a)); } // STD LIB function for IEEE floats: Determines if the given floating point number arg has finite value i.e. it is normal, subnormal or zero, but not infinite or NaN. // specialized for fixpnts template<unsigned nbits, unsigned rbits, bool arithmetic, typename BlockType> inline bool isfinite(const fixpnt<nbits, rbits, arithmetic, BlockType>& a) { return true; } // STD LIB function for IEEE floats: Determines if the given floating point number arg is a positive or negative infinity. // specialized for fixpnts template<unsigned nbits, unsigned rbits, bool arithmetic, typename BlockType> inline bool isinf(const fixpnt<nbits, rbits, arithmetic, BlockType>& a) { return false; } // STD LIB function for IEEE floats: Determines if the given floating point number arg is a not-a-number (NaN) value. // specialized for fixpnts template<unsigned nbits, unsigned rbits, bool arithmetic, typename BlockType> inline bool isnan(const fixpnt<nbits, rbits, arithmetic, BlockType>& a) { return false; } // STD LIB function for IEEE floats: Determines if the given floating point number arg is normal, i.e. is neither zero, subnormal, infinite, nor NaN. // specialized for fixpnts template<unsigned nbits, unsigned rbits, bool arithmetic, typename BlockType> inline bool isnormal(const fixpnt<nbits, rbits, arithmetic, BlockType>& a) { return true; } }} // namespace sw::universal
Jul ’24