+// TEST =====================================================================
+// Test constructibility and non-constructibility for some tricky conversions
+static_assert(
+ !std::is_assignable<Function<void()>, CallableButNotCopyable>::value,
+ "");
+static_assert(
+ !std::is_constructible<Function<void()>, CallableButNotCopyable&>::value,
+ "");
+static_assert(
+ !std::is_constructible<Function<void() const>, CallableButNotCopyable>::
+ value,
+ "");
+static_assert(
+ !std::is_constructible<Function<void() const>, CallableButNotCopyable&>::
+ value,
+ "");
+
+static_assert(
+ !std::is_assignable<Function<void()>, CallableButNotCopyable>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<void()>, CallableButNotCopyable&>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<void() const>, CallableButNotCopyable>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<void() const>, CallableButNotCopyable&>::value,
+ "");
+
+static_assert(
+ std::is_constructible<Function<int(int)>, Function<int(int) const>>::value,
+ "");
+static_assert(
+ !std::is_constructible<Function<int(int) const>, Function<int(int)>>::value,
+ "");
+static_assert(
+ std::is_constructible<Function<int(short)>, Function<short(int) const>>::
+ value,
+ "");
+static_assert(
+ !std::is_constructible<Function<int(short) const>, Function<short(int)>>::
+ value,
+ "");
+static_assert(
+ !std::is_constructible<Function<int(int)>, Function<int(int) const>&>::
+ value,
+ "");
+static_assert(
+ !std::is_constructible<Function<int(int) const>, Function<int(int)>&>::
+ value,
+ "");
+static_assert(
+ !std::is_constructible<Function<int(short)>, Function<short(int) const>&>::
+ value,
+ "");
+static_assert(
+ !std::is_constructible<Function<int(short) const>, Function<short(int)>&>::
+ value,
+ "");
+
+static_assert(
+ std::is_assignable<Function<int(int)>, Function<int(int) const>>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<int(int) const>, Function<int(int)>>::value,
+ "");
+static_assert(
+ std::is_assignable<Function<int(short)>, Function<short(int) const>>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<int(short) const>, Function<short(int)>>::
+ value,
+ "");
+static_assert(
+ !std::is_assignable<Function<int(int)>, Function<int(int) const>&>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<int(int) const>, Function<int(int)>&>::value,
+ "");
+static_assert(
+ !std::is_assignable<Function<int(short)>, Function<short(int) const>&>::
+ value,
+ "");
+static_assert(
+ !std::is_assignable<Function<int(short) const>, Function<short(int)>&>::
+ value,
+ "");
+
+static_assert(
+ std::is_nothrow_constructible<
+ Function<int(int)>,
+ Function<int(int) const>>::value,
+ "");
+static_assert(
+ !std::is_nothrow_constructible<
+ Function<int(short)>,
+ Function<short(int) const>>::value,
+ "");
+static_assert(
+ std::is_nothrow_assignable<Function<int(int)>, Function<int(int) const>>::
+ value,
+ "");
+static_assert(
+ !std::is_nothrow_assignable<
+ Function<int(short)>,
+ Function<short(int) const>>::value,
+ "");
+
+static_assert(
+ !std::is_constructible<Function<int const&()>, int (*)()>::value,
+ "");
+
+static_assert(
+ !std::is_constructible<Function<int const&() const>, int (*)()>::value,
+ "");
+
+#if FOLLY_HAVE_NOEXCEPT_FUNCTION_TYPE
+static_assert(
+ !std::is_constructible<Function<int const&() noexcept>, int (*)()>::value,
+ "");
+
+static_assert(
+ !std::is_constructible<Function<int const&() const noexcept>, int (*)()>::
+ value,
+ "");
+#endif
+