[all-commits] [llvm/llvm-project] 48c805: [libcxx] replaces SFINAE with requires-expressions...

Christopher Di Bella via All-commits all-commits at lists.llvm.org
Thu Oct 5 10:32:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 48c805bafdfd6b2ece12d809c67b887b39bd739f
      https://github.com/llvm/llvm-project/commit/48c805bafdfd6b2ece12d809c67b887b39bd739f
  Author: Christopher Di Bella <cjdb at google.com>
  Date:   2023-10-05 (Thu, 05 Oct 2023)

  Changed paths:
    M libcxx/include/__functional/bind_back.h
    M libcxx/include/__functional/bind_front.h

  Log Message:
  -----------
  [libcxx] replaces SFINAE with requires-expressions in `bind_front` and `bind_back` (#68249)

The diagnostics for `enable_if_t` are extremely opaque:

```
error: no matching function for call to 'bind_front'
note: candidate template ignored: requirement 'integral_constant<bool, false>::value' was not satisfied
```

Using requires-expressions gives us a little more context:

```
error: no matching function for call to 'bind_front'
note: candidate template ignored: constraints not satisfied
note: because 'is_constructible_v<decay_t<T &>, T &>' evaluated to false
```

Pull request: #68249




More information about the All-commits mailing list