template<class T> struct is_bind_expression;
template<class T> struct is_placeholder;
+ // See C++14 20.9.9, Function object binders
+template <class T> constexpr bool is_bind_expression_v
+ = is_bind_expression<T>::value; // C++17
+template <class T> constexpr int is_placeholder_v
+ = is_placeholder<T>::value; // C++17
+
+
template<class Fn, class... BoundArgs>
unspecified bind(Fn&&, BoundArgs&&...);
template<class R, class Fn, class... BoundArgs>
template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_bind_expression
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
+#endif
+
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_placeholder
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
+#endif
+
namespace placeholders
{
typedef int allocator_type;
};
+template <bool Expected, class T, class A>
+void
+test()
+{
+ static_assert(std::uses_allocator<T, A>::value == Expected, "");
+#if TEST_STD_VER > 14
+ static_assert(std::uses_allocator_v<T, A> == Expected, "");
+#endif
+}
+
int main()
{
- static_assert((!std::uses_allocator<int, std::allocator<int> >::value), "");
- static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), "");
- static_assert((!std::uses_allocator<A, std::allocator<int> >::value), "");
- static_assert((!std::uses_allocator<B, std::allocator<int> >::value), "");
- static_assert(( std::uses_allocator<B, double>::value), "");
- static_assert((!std::uses_allocator<C, decltype(C::allocator_type)>::value), "");
- static_assert((!std::uses_allocator<D, decltype(D::allocator_type)>::value), "");
+ test<false, int, std::allocator<int> >();
+ test<true, std::vector<int>, std::allocator<int> >();
+ test<false, A, std::allocator<int> >();
+ test<false, B, std::allocator<int> >();
+ test<true, B, double>();
+ test<false, C, decltype(C::allocator_type)>();
+ test<false, D, decltype(D::allocator_type)>();
#if TEST_STD_VER >= 11
- static_assert((!std::uses_allocator<E, int>::value), "");
+ test<false, E, int>();
#endif
+
+
+// static_assert((!std::uses_allocator<int, std::allocator<int> >::value), "");
+// static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), "");
+// static_assert((!std::uses_allocator<A, std::allocator<int> >::value), "");
+// static_assert((!std::uses_allocator<B, std::allocator<int> >::value), "");
+// static_assert(( std::uses_allocator<B, double>::value), "");
+// static_assert((!std::uses_allocator<C, decltype(C::allocator_type)>::value), "");
+// static_assert((!std::uses_allocator<D, decltype(D::allocator_type)>::value), "");
+// #if TEST_STD_VER >= 11
+// static_assert((!std::uses_allocator<E, int>::value), "");
+// #endif
}