diff options
Diffstat (limited to '3rdparty/asio/src/tests/properties/cpp14')
57 files changed, 2193 insertions, 0 deletions
diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp new file mode 100644 index 00000000000..f7f2854233c --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_prefer.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_free_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp new file mode 100644 index 00000000000..a2a01e4d739 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_free_require.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_free_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp new file mode 100644 index 00000000000..b0d9622bd5b --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_prefer.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_member_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp new file mode 100644 index 00000000000..9d1146ad323 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_member_require.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_member_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp new file mode 100644 index 00000000000..1a305fc3ae6 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_prefer.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_prefer_not_applicable_free_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp new file mode 100644 index 00000000000..c5d732441d7 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_free_require.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_prefer_not_applicable_free_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp new file mode 100644 index 00000000000..66af105ead3 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_prefer.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_prefer_not_applicable_member_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp new file mode 100644 index 00000000000..a2bf20b6e89 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_member_require.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_prefer_not_applicable_member_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp new file mode 100644 index 00000000000..123fd863f48 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_static.cpp @@ -0,0 +1,35 @@ +// +// cpp14/can_prefer_not_applicable_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_preferable = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<1>, prop<1>, prop<1>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..ed67b39d6a2 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_applicable_unsupported.cpp @@ -0,0 +1,32 @@ +// +// cpp14/can_prefer_not_applicable_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp new file mode 100644 index 00000000000..99cb8074746 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_prefer.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_not_preferable_free_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp new file mode 100644 index 00000000000..0e3329de423 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_free_require.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_not_preferable_free_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp new file mode 100644 index 00000000000..12213cd57e9 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_prefer.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_not_preferable_member_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp new file mode 100644 index 00000000000..d801a808b4d --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_member_require.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_prefer_not_preferable_member_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp new file mode 100644 index 00000000000..cbaf4eecc46 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_static.cpp @@ -0,0 +1,34 @@ +// +// cpp14/can_prefer_not_preferable_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = false; +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<1>, prop<1>, prop<1>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp new file mode 100644 index 00000000000..aa37aedd3c6 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_not_preferable_unsupported.cpp @@ -0,0 +1,34 @@ +// +// cpp14/can_prefer_not_preferable_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = false; +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp new file mode 100644 index 00000000000..3933a78839b --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_static.cpp @@ -0,0 +1,36 @@ +// +// cpp14/can_prefer_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(asio::can_prefer_v<object<1>, prop<1>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<1>, prop<1>>, ""); + static_assert(asio::can_prefer_v<object<1>, prop<1>, prop<1>, prop<1>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<1>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<1>, prop<1>>, ""); + static_assert(asio::can_prefer_v<const object<1>, prop<1>, prop<1>, prop<1>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp new file mode 100644 index 00000000000..09ce8e02f18 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_prefer_unsupported.cpp @@ -0,0 +1,42 @@ +// +// cpp14/can_prefer_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static constexpr bool value = true; +}; + +} // namespace asio + +int main() +{ + static_assert(!asio::can_prefer_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_prefer_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp new file mode 100644 index 00000000000..7654a78a06a --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_free.cpp @@ -0,0 +1,28 @@ +// +// cpp14/can_query_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; +}; + +struct object +{ + friend constexpr int query(const object&, prop) { return 123; } +}; + +int main() +{ + static_assert(asio::can_query_v<object, prop>, ""); + static_assert(asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp new file mode 100644 index 00000000000..6bd6c02c98b --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_member.cpp @@ -0,0 +1,28 @@ +// +// cpp14/can_query_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; +}; + +struct object +{ + constexpr int query(prop) const { return 123; } +}; + +int main() +{ + static_assert(asio::can_query_v<object, prop>, ""); + static_assert(asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp new file mode 100644 index 00000000000..bda1770699b --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_free.cpp @@ -0,0 +1,27 @@ +// +// cpp14/can_query_not_applicable_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ +}; + +struct object +{ + friend constexpr int query(const object&, prop) { return 123; } +}; + +int main() +{ + static_assert(!asio::can_query_v<object, prop>, ""); + static_assert(!asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp new file mode 100644 index 00000000000..25b6ab9c793 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_member.cpp @@ -0,0 +1,27 @@ +// +// cpp14/can_query_not_applicable_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ +}; + +struct object +{ + constexpr int query(prop) const { return 123; } +}; + +int main() +{ + static_assert(!asio::can_query_v<object, prop>, ""); + static_assert(!asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp new file mode 100644 index 00000000000..299a5e1f2a5 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_static.cpp @@ -0,0 +1,27 @@ +// +// cpp14/can_query_not_applicable_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr int static_query_v = 123; +}; + +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_query_v<object, prop>, ""); + static_assert(!asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..cec0aea9167 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_not_applicable_unsupported.cpp @@ -0,0 +1,26 @@ +// +// cpp14/can_query_not_applicable_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ +}; + +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_query_v<object, prop>, ""); + static_assert(!asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp new file mode 100644 index 00000000000..67b19ac74ed --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_static.cpp @@ -0,0 +1,28 @@ +// +// cpp14/can_query_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + template <typename> static constexpr int static_query_v = 123; +}; + +struct object +{ +}; + +int main() +{ + static_assert(asio::can_query_v<object, prop>, ""); + static_assert(asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp new file mode 100644 index 00000000000..7e8f63f1405 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_query_unsupported.cpp @@ -0,0 +1,27 @@ +// +// cpp14/can_query_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; +}; + +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_query_v<object, prop>, ""); + static_assert(!asio::can_query_v<const object, prop>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp new file mode 100644 index 00000000000..e0dea96edf0 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_free.cpp @@ -0,0 +1,35 @@ +// +// cpp14/can_require_concept_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require_concept(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_require_concept_v<object<1>, prop<2>>, ""); + static_assert(asio::can_require_concept_v<const object<1>, prop<2>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp new file mode 100644 index 00000000000..7da0a580a6f --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_member.cpp @@ -0,0 +1,35 @@ +// +// cpp14/can_require_concept_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require_concept(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_require_concept_v<object<1>, prop<2>>, ""); + static_assert(asio::can_require_concept_v<const object<1>, prop<2>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp new file mode 100644 index 00000000000..f6d48165356 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_free.cpp @@ -0,0 +1,34 @@ +// +// cpp14/can_require_concept_not_applicable_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require_concept(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_require_concept_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_concept_v<const object<1>, prop<2>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp new file mode 100644 index 00000000000..5252cb77447 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_member.cpp @@ -0,0 +1,34 @@ +// +// cpp14/can_require_concept_not_applicable_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require_concept(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_require_concept_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_concept_v<const object<1>, prop<2>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp new file mode 100644 index 00000000000..7da83a988fb --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_static.cpp @@ -0,0 +1,31 @@ +// +// cpp14/can_require_concept_not_applicable_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_requirable_concept = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_require_concept_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_concept_v<const object<1>, prop<2>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..939b450be73 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_not_applicable_unsupported.cpp @@ -0,0 +1,28 @@ +// +// cpp14/can_require_concept_not_applicable_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_require_concept_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_concept_v<const object<1>, prop<2>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp new file mode 100644 index 00000000000..577363a0eea --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_static.cpp @@ -0,0 +1,32 @@ +// +// cpp14/can_require_concept_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable_concept = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(asio::can_require_concept_v<object<1>, prop<1>>, ""); + static_assert(asio::can_require_concept_v<const object<1>, prop<1>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp new file mode 100644 index 00000000000..2bcdc6c7606 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_concept_unsupported.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_require_concept_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static constexpr bool value = true; +}; + +} // namespace asio + +int main() +{ + static_assert(!asio::can_require_concept<object<1>, prop<2>>::value, ""); + static_assert(!asio::can_require_concept<const object<1>, prop<2>>::value, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp new file mode 100644 index 00000000000..f0bda074d5a --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_free.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_require_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_require_v<object<1>, prop<2>>, ""); + static_assert(asio::can_require_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_require_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<2>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp new file mode 100644 index 00000000000..0eeb0aa45c5 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_member.cpp @@ -0,0 +1,39 @@ +// +// cpp14/can_require_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(asio::can_require_v<object<1>, prop<2>>, ""); + static_assert(asio::can_require_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_require_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<2>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp new file mode 100644 index 00000000000..f68576e2f1c --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_free.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_require_not_applicable_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_require_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp new file mode 100644 index 00000000000..1c7aa953aeb --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_member.cpp @@ -0,0 +1,38 @@ +// +// cpp14/can_require_not_applicable_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + static_assert(!asio::can_require_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp new file mode 100644 index 00000000000..ba7b5a80ccc --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_static.cpp @@ -0,0 +1,35 @@ +// +// cpp14/can_require_not_applicable_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + static constexpr bool is_requirable = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_require_v<object<1>, prop<1>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<1>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<1>, prop<1>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<1>, prop<1>, prop<1>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..25d71e35d48 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_not_applicable_unsupported.cpp @@ -0,0 +1,32 @@ +// +// cpp14/can_require_not_applicable_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(!asio::can_require_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp new file mode 100644 index 00000000000..f92c0b56c8a --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_static.cpp @@ -0,0 +1,36 @@ +// +// cpp14/can_require_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + static_assert(asio::can_require_v<object<1>, prop<1>>, ""); + static_assert(asio::can_require_v<object<1>, prop<1>, prop<1>>, ""); + static_assert(asio::can_require_v<object<1>, prop<1>, prop<1>, prop<1>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<1>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<1>, prop<1>>, ""); + static_assert(asio::can_require_v<const object<1>, prop<1>, prop<1>, prop<1>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp new file mode 100644 index 00000000000..4cf2756d40b --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/can_require_unsupported.cpp @@ -0,0 +1,42 @@ +// +// cpp14/can_require_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static constexpr bool value = true; +}; + +} // namespace asio + +int main() +{ + static_assert(!asio::can_require_v<object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<object<1>, prop<2>, prop<3>, prop<4>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>>, ""); + static_assert(!asio::can_require_v<const object<1>, prop<2>, prop<3>, prop<4>>, ""); +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp new file mode 100644 index 00000000000..fce83ed6b9f --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_prefer.cpp @@ -0,0 +1,55 @@ +// +// cpp14/prefer_free_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::prefer(o1, prop<2>()); + object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>()); + object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<2> o6 = asio::prefer(o5, prop<2>()); + object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>()); + object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<2> o9 = asio::prefer(object<1>(), prop<2>()); + constexpr object<3> o10 = asio::prefer(object<1>(), prop<2>(), prop<3>()); + constexpr object<4> o11 = asio::prefer(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp new file mode 100644 index 00000000000..349aebeb515 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_free_require.cpp @@ -0,0 +1,55 @@ +// +// cpp14/prefer_free_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::prefer(o1, prop<2>()); + object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>()); + object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<2> o6 = asio::prefer(o5, prop<2>()); + object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>()); + object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<2> o9 = asio::prefer(object<1>(), prop<2>()); + constexpr object<3> o10 = asio::prefer(object<1>(), prop<2>(), prop<3>()); + constexpr object<4> o11 = asio::prefer(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp new file mode 100644 index 00000000000..56d29efd34c --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_prefer.cpp @@ -0,0 +1,55 @@ +// +// cpp14/prefer_member_prefer.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::prefer(o1, prop<2>()); + object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>()); + object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<2> o6 = asio::prefer(o5, prop<2>()); + object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>()); + object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<2> o9 = asio::prefer(object<1>(), prop<2>()); + constexpr object<3> o10 = asio::prefer(object<1>(), prop<2>(), prop<3>()); + constexpr object<4> o11 = asio::prefer(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp new file mode 100644 index 00000000000..7b88df406e8 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_member_require.cpp @@ -0,0 +1,55 @@ +// +// cpp14/prefer_member_require.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::prefer(o1, prop<2>()); + object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>()); + object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<2> o6 = asio::prefer(o5, prop<2>()); + object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>()); + object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<2> o9 = asio::prefer(object<1>(), prop<2>()); + constexpr object<3> o10 = asio::prefer(object<1>(), prop<2>(), prop<3>()); + constexpr object<4> o11 = asio::prefer(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp new file mode 100644 index 00000000000..8fd537ae74b --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_static.cpp @@ -0,0 +1,52 @@ +// +// cpp14/prefer_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + object<1> o1 = {}; + object<1> o2 = asio::prefer(o1, prop<1>()); + object<1> o3 = asio::prefer(o1, prop<1>(), prop<1>()); + object<1> o4 = asio::prefer(o1, prop<1>(), prop<1>(), prop<1>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<1> o6 = asio::prefer(o5, prop<1>()); + object<1> o7 = asio::prefer(o5, prop<1>(), prop<1>()); + object<1> o8 = asio::prefer(o5, prop<1>(), prop<1>(), prop<1>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<1> o9 = asio::prefer(object<1>(), prop<1>()); + constexpr object<1> o10 = asio::prefer(object<1>(), prop<1>(), prop<1>()); + constexpr object<1> o11 = asio::prefer(object<1>(), prop<1>(), prop<1>(), prop<1>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp new file mode 100644 index 00000000000..50b8da0f9d3 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/prefer_unsupported.cpp @@ -0,0 +1,50 @@ +// +// cpp14/prefer_unsupported.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/prefer.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +int main() +{ + object<1> o1 = {}; + object<1> o2 = asio::prefer(o1, prop<2>()); + object<1> o3 = asio::prefer(o1, prop<2>(), prop<3>()); + object<1> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<1> o6 = asio::prefer(o5, prop<2>()); + object<1> o7 = asio::prefer(o5, prop<2>(), prop<3>()); + object<1> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<1> o9 = asio::prefer(object<1>(), prop<2>()); + constexpr object<1> o10 = asio::prefer(object<1>(), prop<2>(), prop<3>()); + constexpr object<1> o11 = asio::prefer(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp new file mode 100644 index 00000000000..24be8dbe945 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/query_free.cpp @@ -0,0 +1,40 @@ +// +// cpp14/query_free.cpp +// ~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; +}; + +struct object +{ + friend constexpr int query(const object&, prop) { return 123; } +}; + +int main() +{ + object o1 = {}; + int result1 = asio::query(o1, prop()); + assert(result1 == 123); + (void)result1; + + const object o2 = {}; + int result2 = asio::query(o2, prop()); + assert(result2 == 123); + (void)result2; + + constexpr object o3 = {}; + constexpr int result3 = asio::query(o3, prop()); + assert(result3 == 123); + (void)result3; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp new file mode 100644 index 00000000000..fab0bed9d03 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/query_member.cpp @@ -0,0 +1,40 @@ +// +// cpp14/query_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; +}; + +struct object +{ + constexpr int query(prop) const { return 123; } +}; + +int main() +{ + object o1 = {}; + int result1 = asio::query(o1, prop()); + assert(result1 == 123); + (void)result1; + + const object o2 = {}; + int result2 = asio::query(o2, prop()); + assert(result2 == 123); + (void)result2; + + constexpr object o3 = {}; + constexpr int result3 = asio::query(o3, prop()); + assert(result3 == 123); + (void)result3; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp new file mode 100644 index 00000000000..d13ad85c3c6 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/query_static.cpp @@ -0,0 +1,40 @@ +// +// cpp14/query_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/query.hpp" +#include <cassert> + +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + template <typename> static constexpr int static_query_v = 123; +}; + +struct object +{ +}; + +int main() +{ + object o1 = {}; + int result1 = asio::query(o1, prop()); + assert(result1 == 123); + (void)result1; + + const object o2 = {}; + int result2 = asio::query(o2, prop()); + assert(result2 == 123); + (void)result2; + + constexpr object o3 = {}; + constexpr int result3 = asio::query(o3, prop()); + assert(result3 == 123); + (void)result3; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp new file mode 100644 index 00000000000..d7323db95ba --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/require_concept_free.cpp @@ -0,0 +1,43 @@ +// +// cpp14/require_concept_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require_concept(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::require_concept(o1, prop<2>()); + (void)o2; + + const object<1> o3 = {}; + object<2> o4 = asio::require_concept(o3, prop<2>()); + (void)o4; + + constexpr object<2> o5 = asio::require_concept(object<1>(), prop<2>()); + (void)o5; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp new file mode 100644 index 00000000000..e21dda3f6e4 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/require_concept_member.cpp @@ -0,0 +1,43 @@ +// +// cpp14/require_concept_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require_concept(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::require_concept(o1, prop<2>()); + (void)o2; + + const object<1> o3 = {}; + object<2> o4 = asio::require_concept(o3, prop<2>()); + (void)o4; + + constexpr object<2> o5 = asio::require_concept(object<1>(), prop<2>()); + (void)o5; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp new file mode 100644 index 00000000000..523ed758061 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/require_concept_static.cpp @@ -0,0 +1,42 @@ +// +// cpp14/require_concept_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require_concept.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable_concept = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + object<1> o1 = {}; + const object<1>& o2 = asio::require_concept(o1, prop<1>()); + assert(&o1 == &o2); + (void)o2; + + const object<1> o3 = {}; + const object<1>& o4 = asio::require_concept(o3, prop<1>()); + assert(&o3 == &o4); + (void)o4; + + constexpr object<1> o5 = asio::require_concept(object<1>(), prop<1>()); + (void)o5; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp new file mode 100644 index 00000000000..32893ff26ee --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/require_free.cpp @@ -0,0 +1,55 @@ +// +// cpp14/require_free.cpp +// ~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + friend constexpr object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::require(o1, prop<2>()); + object<3> o3 = asio::require(o1, prop<2>(), prop<3>()); + object<4> o4 = asio::require(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<2> o6 = asio::require(o5, prop<2>()); + object<3> o7 = asio::require(o5, prop<2>(), prop<3>()); + object<4> o8 = asio::require(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<2> o9 = asio::require(object<1>(), prop<2>()); + constexpr object<3> o10 = asio::require(object<1>(), prop<2>(), prop<3>()); + constexpr object<4> o11 = asio::require(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp new file mode 100644 index 00000000000..f2e58aa2f76 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/require_member.cpp @@ -0,0 +1,55 @@ +// +// cpp14/require_member.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + constexpr object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +int main() +{ + object<1> o1 = {}; + object<2> o2 = asio::require(o1, prop<2>()); + object<3> o3 = asio::require(o1, prop<2>(), prop<3>()); + object<4> o4 = asio::require(o1, prop<2>(), prop<3>(), prop<4>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<2> o6 = asio::require(o5, prop<2>()); + object<3> o7 = asio::require(o5, prop<2>(), prop<3>()); + object<4> o8 = asio::require(o5, prop<2>(), prop<3>(), prop<4>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<2> o9 = asio::require(object<1>(), prop<2>()); + constexpr object<3> o10 = asio::require(object<1>(), prop<2>(), prop<3>()); + constexpr object<4> o11 = asio::require(object<1>(), prop<2>(), prop<3>(), prop<4>()); + (void)o9; + (void)o10; + (void)o11; +} diff --git a/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp b/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp new file mode 100644 index 00000000000..acdd7fbf499 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp14/require_static.cpp @@ -0,0 +1,52 @@ +// +// cpp14/require_static.cpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include "asio/require.hpp" +#include <cassert> + +template <int> +struct prop +{ + template <typename> static constexpr bool is_applicable_property_v = true; + static constexpr bool is_requirable = true; + template <typename> static constexpr bool static_query_v = true; + static constexpr bool value() { return true; } +}; + +template <int> +struct object +{ +}; + +int main() +{ + object<1> o1 = {}; + object<1> o2 = asio::require(o1, prop<1>()); + object<1> o3 = asio::require(o1, prop<1>(), prop<1>()); + object<1> o4 = asio::require(o1, prop<1>(), prop<1>(), prop<1>()); + (void)o2; + (void)o3; + (void)o4; + + const object<1> o5 = {}; + object<1> o6 = asio::require(o5, prop<1>()); + object<1> o7 = asio::require(o5, prop<1>(), prop<1>()); + object<1> o8 = asio::require(o5, prop<1>(), prop<1>(), prop<1>()); + (void)o6; + (void)o7; + (void)o8; + + constexpr object<1> o9 = asio::require(object<1>(), prop<1>()); + constexpr object<1> o10 = asio::require(object<1>(), prop<1>(), prop<1>()); + constexpr object<1> o11 = asio::require(object<1>(), prop<1>(), prop<1>(), prop<1>()); + (void)o9; + (void)o10; + (void)o11; +} |