//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. // //===----------------------------------------------------------------------===// // template // concept copyable = see below; #include "type_classification/copyable.h" #include #include #include "test_macros.h" using cuda::std::copyable; static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); struct S {}; static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() & noexcept >, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() && noexcept >, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() const& noexcept >, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() const&& noexcept >, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() volatile & noexcept >, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() volatile && noexcept >, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() const volatile& noexcept >, ""); static_assert(copyable, ""); static_assert(copyable < int(S::*)() const volatile&& noexcept >, ""); static_assert(copyable, ""); static_assert(copyable, ""); // Not objects static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); // Not assignable static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(copyable, ""); static_assert(!copyable, ""); static_assert(copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); #if !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 // MSVC chokes on multiple definitions // of SMF static_assert(cuda::std::is_copy_assignable_v, ""); static_assert(!copyable, ""); #endif // !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert(!copyable, ""); static_assert( !cuda::std::assignable_from, ""); static_assert(!copyable, ""); int main(int, char**) { return 0; }