Adding an STL-like type trait that is duplicated in multiple places in Clang.

This trait is used by several AST visitor classes to control whether the AST is visiting const nodes or non-const nodes. These uses cannot be easily replaced with the STL traits directly due to use of an unspecialized templated when a type is expected (due to the template template parameter involved).

llvm-svn: 348729
This commit is contained in:
Aaron Ballman 2018-12-09 19:53:15 +00:00
parent 7ca55323ce
commit 39af9ba544
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ template <typename B1, typename... Bn>
struct conjunction<B1, Bn...>
: std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
template <typename T> struct make_const_ptr {
using type = std::add_pointer_t<std::add_const_t<T>>;
};
//===----------------------------------------------------------------------===//
// Extra additions to <functional>
//===----------------------------------------------------------------------===//