[libcxx-commits] [PATCH] D116570: [libc++] Eliminate the `__function_like` helper.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 4 09:37:48 PST 2022


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

Arthur and I just spoke offline, and I explained my opinion about what I think are the possible outcomes:

1. The specification keeps making a bunch of stuff IFNDR about Niebloids, and so we keep the protections we currently have (basically we keep `__function_like` under one form or another). This prevents users from starting to depend on implementation details, and that's important.

2. The specification says what all implementations are actually doing, i.e. implement Niebloids the same way CPOs are specified (as function objects). Then, we could actually provide those guarantees to users in a portable way, which would be even better IMO. We could guarantee that those function objects are copyable, etc. That would make it possible to use them with higher order functions and a bunch of other interesting things that users can't do portably right now, but will clearly all fall in the trap of using.

I don't have a super strong preference for (1) or (2), but I think (2) provides more usefulness to users in a portable way without really removing any freedom from implementers -- concretely, I doubt we're ever going to implement Niebloids differently than using a function object. Arthur is going to file a LWG issue to discuss the possibility of specifying Niebloids more strictly in the standard so as to resolve the implementation divergence we currently have.

Requesting changes until we have a LWG discussion going.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116570/new/

https://reviews.llvm.org/D116570



More information about the libcxx-commits mailing list