[PATCH] D48807: Add llvm::Any

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 09:53:56 PDT 2018


Hey Zach - what's your initial use case/motivation for this?

On Sat, Jun 30, 2018 at 3:43 PM Zachary Turner via Phabricator <
reviews at reviews.llvm.org> wrote:

> zturner created this revision.
> zturner added reviewers: chandlerc, dblaikie, timshen.
> Herald added subscribers: dexonsmith, mgorny.
>
> This is a replacement for `std::any` until such time that we have C++17.
> While I generally agree it should not be used, and usually you want
> something like a variant, there are still occasions where it can be
> useful.  One example is where a user wants to attach some user data to a
> structure that passes through library code and comes back around through a
> callback or similar mechanism.  Another is when porting old-style C code
> that uses `void*`.  I'm sure we can come up with plenty of other uses as
> well.
>
>
> https://reviews.llvm.org/D48807
>
> Files:
>   llvm/include/llvm/ADT/Any.h
>   llvm/unittests/ADT/AnyTest.cpp
>   llvm/unittests/ADT/CMakeLists.txt
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180702/ab676038/attachment.html>


More information about the llvm-commits mailing list