[PATCH] D48807: Add llvm::Any
Zachary Turner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 10 10:48:31 PDT 2018
zturner added inline comments.
================
Comment at: llvm/include/llvm/ADT/Any.h:108
+ using DecayedT =
+ typename std::remove_cv<typename std::decay<const T>::type>::type;
+ if (!Value.Storage)
----------------
dblaikie wrote:
> Why add the 'const' here - if cv qualifiers are being removed anyway? Maybe I'm missing something about how std::decay/other parts of this are working?
>
> (also std::decay says it removes cv qualifiers - so is it necessary to then explicitly remove them after that?)
I need to think about this some. I "borrowed" this line from MSVC's implementation of `std::any`, and without it I was getting mysterious errors. But it wouldn't hurt for me to understand exactly why.
https://reviews.llvm.org/D48807
More information about the llvm-commits
mailing list