[libc-commits] [libc] [libc][complex] Implement different flavors of the `conj` function (PR #118671)
Shourya Goel via libc-commits
libc-commits at lists.llvm.org
Mon Dec 9 10:06:20 PST 2024
================
@@ -16,5 +16,12 @@ template <typename T> struct Complex {
T real;
T imag;
};
+
+template <typename T, typename U> T conjugate(T c) {
----------------
Sh0g0-1758 wrote:
True, but I think that it would be trivial for anyone using this function to deduce the order of complex and real type while using the templated form. Regarding cluttering, I don't think 2 parameters is too much cluttering. And my point regarding extra guards, the extra guards in complex_types.h would be redundnant because we would have only called the template form with cfloat16 if it existed.
https://github.com/llvm/llvm-project/pull/118671
More information about the libc-commits
mailing list