ORNL / cpp-proposals-pub

Collaborating on papers for the ISO C++ committee - public repo
26 stars 27 forks source link

P3050R2: LEWG review 2024-08-27 and 2024-09-03 #471

Open mhoemmen opened 2 months ago

mhoemmen commented 2 months ago

LEWG review of P3050R2

LEWG started reviewing P3050R2 (Fix C++26 by optimizing linalg::conjugated for noncomplex value types) on 2024-08-27 but didn't finish.

Summary of LEWG's 2024-08-27 discussion

Definition of a (non)complex number type

P3050 follows [linalg], specifically conj-if-needed(E), which is defined as

  1. ADL-found conj(E) if type of E is not an arithmetic type, else
  2. E.

conj already is not ADL-findable for double, etc., which is what we want anyway.

Custom real types and conj

What happens if a user defines conj for their custom real type?

Results will be mathematically correct if user defined it mathematically correctly.

Consider a follow-on proposal to deprecate and replace std::conj

I am not bothered if users write a custom real number type and they define ADL-findable conj to return the custom complex of their real type because that’s weird.... The existing behavior of the Standard is broken. Anyone who works with complex numbers hates this.