[PATCH] D17325: Introduce llvm/ADT/OptionSet.h utility class

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 14:16:15 PST 2016


chandlerc added inline comments.

================
Comment at: include/llvm/ADT/OptionSet.h:74
@@ +73,3 @@
+      std::intptr_t>::type () const {
+    return static_cast<intptr_t>(Storage);
+  }
----------------
reames wrote:
> Should this be a static_cast<T>?  Otherwise, why have the type param?
It causes 'sizeof(T)' to be dependent for the purpose of SFINAE.

At the point you've done this though, you might as well also tuck the enable_if into a template argument. You're already using the feature with an optional template argument here...


http://reviews.llvm.org/D17325





More information about the llvm-commits mailing list