[libc-commits] [PATCH] D148971: [libc] Adjust the `cpp:function` type to support lambdas

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 24 11:04:41 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/src/__support/CPP/type_traits.h:173
+template <typename T>
+decltype(void(static_cast<T (*)()>(nullptr)), true_type{}) returnable(int);
+template <typename> false_type returnable(...);
----------------
Can you add commentary to explain what is going on here?


================
Comment at: libc/src/__support/CPP/type_traits.h:176
+template <typename F, typename T>
+decltype(void(declval<void (&)(T)>()(declval<F>())), true_type{})
+implicitly_convertible(int);
----------------
Ditto.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148971/new/

https://reviews.llvm.org/D148971



More information about the libc-commits mailing list