[all-commits] [llvm/llvm-project] 1462d6: [libc++][NFC] Remove `optional::__get` (#217218)

A. Jiang via All-commits all-commits at lists.llvm.org
Tue Sep 8 16:18:37 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1462d6f99a0cdf8c99108cb32eb020efe6ba5f89
      https://github.com/llvm/llvm-project/commit/1462d6f99a0cdf8c99108cb32eb020efe6ba5f89
  Author: A. Jiang <de34 at live.cn>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M libcxx/include/__optional/optional.h
    M libcxx/include/__optional/optional_ref.h

  Log Message:
  -----------
  [libc++][NFC] Remove `optional::__get` (#217218)

Internal communicating functions `optional::__get` can be superseded by
either `value`, `operator*()`, or direct use of data member. Even though
`value()` is checked, checks are already performed before internal calls
to it, so compilers should be able to remove duplicated checks.

It is intended to use `opt.value()` instead of `*opt` to avoid undesired
argument-dependent lookup.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list