grandinj added a subscriber: grandinj.

================
Comment at: include/experimental/optional:524
@@ -521,1 +523,3 @@
+            assert(!"bad optional access");
+#endif
         return this->__val_;
----------------
If this kind of code is going to show up in lots of places, then maybe wrap it 
up in a macro:

   _LIBCPP_THROW_OR_ASSERT(bad_optional_access(), "bad optional access")

?

With some extra preprocessor magic, and if LLVM didn't care about the string in 
the assert, could even leave out the second parameter


http://reviews.llvm.org/D21673



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to