//===----------------------------------------------------------------------===// // // 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 movable = see below; #include "type_classification/movable.h" #include #include "test_macros.h" #include "type_classification/moveconstructible.h" using cuda::std::movable; // Movable types static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); struct S {}; static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() & noexcept >, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() && noexcept >, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() const& noexcept >, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() const&& noexcept >, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() volatile & noexcept >, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() volatile && noexcept >, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() const volatile& noexcept >, ""); static_assert(movable, ""); static_assert(movable < int(S::*)() const volatile&& noexcept >, ""); static_assert(movable, ""); static_assert(movable, ""); // Not objects static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); // Core non-move assignable. static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); static_assert(!movable, ""); #if !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 // MSVC chokes on multiple definitions // of SMF static_assert(!cuda::std::assignable_from, ""); static_assert(!movable, ""); #endif // !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 static_assert(!movable, ""); static_assert(movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); #if !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 // MSVC chokes on multiple definitions // of SMF static_assert(movable, ""); static_assert(movable, ""); static_assert(movable, ""); #endif // !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 // MSVC chokes on multiple // definitions of SMF static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(!movable, ""); static_assert(movable, ""); // `move_constructible and assignable_from` implies `swappable`, // so there's nothing to test for the case of non-swappable. int main(int, char**) { return 0; }