From 676f97eafc095843d51c2fdee803319064c15959 Mon Sep 17 00:00:00 2001 From: Denis Yaroshevskiy Date: Fri, 2 Aug 2024 04:03:55 -0700 Subject: [PATCH] folly concepts #1 (#2249) Summary: Pull Request resolved: https://github.com/facebook/folly/pull/2249 We have a need for some common concepts that are used in many places. This is a proposal, please let me know what you think. Differential Revision: D59396081 --- folly/Traits.h | 34 ++++++++++++++++++++++++++++- folly/test/PortabilityTest.cpp | 4 ---- folly/test/TraitsTest.cpp | 40 ++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 5 deletions(-) diff --git a/folly/Traits.h b/folly/Traits.h index 3c6b86e1301..c1d550a823f 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -159,13 +159,17 @@ struct is_bounded_array : std::bool_constant> {}; /// is_instantiation_of_v /// is_instantiation_of +/// instantiated_from +/// uncvref_instantiated_from /// /// A trait variable and type to check if a given type is an instantiation of a -/// class template. +/// class template. And corresponding concepts. /// /// Note that this only works with type template parameters. It does not work /// with non-type template parameters, template template parameters, or alias /// templates. +/// +/// NOTE: there is also `instantiation_of` concept template