[libcxx-commits] [libcxx] Make std::nullopt_t comparable (PR #195549)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 4 18:31:05 PDT 2026


frederick-vs-ja wrote:

> Hey @frederick-vs-ja, why doesn't [this](https://github.com/elhewaty/llvm-project/blob/748eaa99ffcb499fa4ef42655d5ff892af913067/libcxx/include/optional#L1496-L1563) piece of code solve this issue?

These operators require one operand to be of an `optional` type or some class type derived from `optional`, so they can't be used for comparing two `nullopt_t` values.

https://github.com/llvm/llvm-project/pull/195549


More information about the libcxx-commits mailing list