[ADT] Support const-qualified unique_functions
authorSam McCall <sam.mccall@gmail.com>
Thu, 25 Jun 2020 16:25:53 +0000 (18:25 +0200)
committerSam McCall <sam.mccall@gmail.com>
Mon, 29 Jun 2020 18:13:42 +0000 (20:13 +0200)
commit01bf8cdf5fa9bc71869e15e5e351b2b68c39feb6
tree7325bdf7040abedebb50bde55a595a39b9d0d8c5
parent0da1e7ebf9a82e49858e77a5bbe1a14f08ef00d7
[ADT] Support const-qualified unique_functions

Summary:
This technique should extend to rvalue-qualified etc, but I didn't add any.
I removed "volatile" from the future plans, which seems... speculative at best.

While here I moved the callbacks object out of the constructor into a
variable template, which I believe addresses the fixme there about unused
objects.

(I'm not a template guru, so it's always possible the old version was designed
for compile-time performance in a way I'm missing)

Reviewers: kadircet

Subscribers: dexonsmith, llvm-commits, chandlerc

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82581
llvm/include/llvm/ADT/FunctionExtras.h
llvm/unittests/ADT/FunctionExtrasTest.cpp