[PATCH] D40915: Always evaluate the second argument for CHECK() lazily.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 12:56:43 PST 2017


On Wed, Dec 6, 2017 at 12:55 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:
>
>
> > -template <class T> T check(ErrorOr<T> E, const Twine &Prefix) {
> > +template <class T> T check2(ErrorOr<T> E, std::function<std::string()>
> Prefix) {
>
> Why do you need a std::function, a function_ref should work, no?
>

I guess it'd work, but why do you prefer llvm::function_ref over
std::function?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171206/5534b83a/attachment.html>


More information about the llvm-commits mailing list