https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109242

--- Comment #2 from Peter Kasting <pkasting at google dot com> ---
(In reply to TC from comment #1)
> The missing remove_cv_t is real, but this example is invalid. As the linked
> cppreference page notes, you cannot pass a PMD to transform.

Ah, true! How about this then: https://godbolt.org/z/TaccPEsY1

#include <optional>

struct S {
  int& i() const;
};

void foo() {
  std::optional<S>().transform(&S::i);
}

Reply via email to