diff options
Diffstat (limited to '3rdparty/asio/src/tests/properties/cpp03')
57 files changed, 2947 insertions, 0 deletions
diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp new file mode 100644 index 00000000000..e9784f60661 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct prefer_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_prefer<object<1>, prop<2> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_prefer<const object<1>, prop<2> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp new file mode 100644 index 00000000000..693a46150d1 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_prefer<object<1>, prop<2> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_prefer<const object<1>, prop<2> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp new file mode 100644 index 00000000000..011a34764dc --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct prefer_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_prefer<object<1>, prop<2> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_prefer<const object<1>, prop<2> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp new file mode 100644 index 00000000000..9364391c935 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_prefer<object<1>, prop<2> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_prefer<const object<1>, prop<2> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp new file mode 100644 index 00000000000..8fd11c6f659 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct prefer_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp new file mode 100644 index 00000000000..5c205ada2e7 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp new file mode 100644 index 00000000000..15e93fd3a51 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct prefer_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp new file mode 100644 index 00000000000..0a0f1f6ecf0 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp new file mode 100644 index 00000000000..f564d2fae01 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp @@ -0,0 +1,45 @@ +// +// cpp03/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 const bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<1> >::value)); + assert((!asio::can_prefer<object<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_prefer<object<1>, prop<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_prefer<const object<1>, prop<1> >::value)); + assert((!asio::can_prefer<const object<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_prefer<const object<1>, prop<1>, prop<1>, prop<1> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..0711d7c4a4d --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp @@ -0,0 +1,33 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp new file mode 100644 index 00000000000..3a522e5bed4 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct prefer_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp new file mode 100644 index 00000000000..39ea91fefcb --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp new file mode 100644 index 00000000000..e61f89872d0 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct prefer_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp new file mode 100644 index 00000000000..0052cc3ee50 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_preferable = false; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp new file mode 100644 index 00000000000..f3428066587 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 +{ + static const bool is_preferable = false; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<1> >::value)); + assert((!asio::can_prefer<object<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_prefer<object<1>, prop<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_prefer<const object<1>, prop<1> >::value)); + assert((!asio::can_prefer<const object<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_prefer<const object<1>, prop<1>, prop<1>, prop<1> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp new file mode 100644 index 00000000000..14695938c99 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp @@ -0,0 +1,43 @@ +// +// cpp03/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 +{ + static const bool is_preferable = false; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +} // namespace asio + +int main() +{ + assert((!asio::can_prefer<object<1>, prop<2> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp new file mode 100644 index 00000000000..ac1f5c186aa --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_static.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_prefer<object<1>, prop<1> >::value)); + assert((asio::can_prefer<object<1>, prop<1>, prop<1> >::value)); + assert((asio::can_prefer<object<1>, prop<1>, prop<1>, prop<1> >::value)); + assert((asio::can_prefer<const object<1>, prop<1> >::value)); + assert((asio::can_prefer<const object<1>, prop<1>, prop<1> >::value)); + assert((asio::can_prefer<const object<1>, prop<1>, prop<1>, prop<1> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp new file mode 100644 index 00000000000..e59e5d098f8 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp @@ -0,0 +1,43 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +} // namespace asio + +int main() +{ + assert((asio::can_prefer<object<1>, prop<2> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_prefer<const object<1>, prop<2> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp new file mode 100644 index 00000000000..d0d42fe7bdd --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_free.cpp @@ -0,0 +1,48 @@ +// +// cpp03/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 +{ +}; + +struct object +{ + friend int query(const object&, prop) { return 123; } +}; + +namespace asio { + +template<> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +namespace traits { + +template<> +struct query_free<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_query<object, prop>::value)); + assert((asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp new file mode 100644 index 00000000000..9ead9be9751 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_member.cpp @@ -0,0 +1,48 @@ +// +// cpp03/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 +{ +}; + +struct object +{ + int query(prop) const { return 123; } +}; + +namespace asio { + +template<> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +namespace traits { + +template<> +struct query_member<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_query<object, prop>::value)); + assert((asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp new file mode 100644 index 00000000000..b360327c132 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp @@ -0,0 +1,41 @@ +// +// cpp03/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 int query(const object&, prop) { return 123; } +}; + +namespace asio { +namespace traits { + +template<> +struct query_free<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_query<object, prop>::value)); + assert((!asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp new file mode 100644 index 00000000000..be339d05522 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp @@ -0,0 +1,41 @@ +// +// cpp03/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 +{ + int query(prop) const { return 123; } +}; + +namespace asio { +namespace traits { + +template<> +struct query_member<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_query<object, prop>::value)); + assert((!asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp new file mode 100644 index 00000000000..127e2ace42e --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp @@ -0,0 +1,41 @@ +// +// cpp03/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 +{ +}; + +struct object +{ +}; + +namespace asio { +namespace traits { + +template<> +struct static_query<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; + static int value() { return 123; } +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_query<object, prop>::value)); + assert((!asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..ec1c07affc1 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp @@ -0,0 +1,26 @@ +// +// cpp03/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() +{ + assert((!asio::can_query<object, prop>::value)); + assert((!asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp new file mode 100644 index 00000000000..9a305712f1d --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_static.cpp @@ -0,0 +1,48 @@ +// +// cpp03/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 +{ +}; + +struct object +{ +}; + +namespace asio { + +template<> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +namespace traits { + +template<> +struct static_query<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; + static int value() { return 123; } +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_query<object, prop>::value)); + assert((asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp new file mode 100644 index 00000000000..8eefbe9bd14 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_query_unsupported.cpp @@ -0,0 +1,36 @@ +// +// cpp03/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 +{ +}; + +struct object +{ +}; + +namespace asio { + +template <> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +} // namespace asio + +int main() +{ + assert((!asio::can_query<object, prop>::value)); + assert((!asio::can_query<const object, prop>::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp new file mode 100644 index 00000000000..810dfc240a2 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_free.cpp @@ -0,0 +1,55 @@ +// +// cpp03/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 +{ + static const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require_concept(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_concept_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_require_concept<object<1>, prop<2> >::value)); + assert((asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp new file mode 100644 index 00000000000..615e8a09cd7 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_member.cpp @@ -0,0 +1,55 @@ +// +// cpp03/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 +{ + static const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require_concept(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_concept_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_require_concept<object<1>, prop<2> >::value)); + assert((asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp new file mode 100644 index 00000000000..c076dd416cd --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp @@ -0,0 +1,48 @@ +// +// cpp03/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 const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require_concept(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct require_concept_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_require_concept<object<1>, prop<2> >::value)); + assert((!asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp new file mode 100644 index 00000000000..e6e258e8424 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp @@ -0,0 +1,48 @@ +// +// cpp03/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 const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require_concept(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct require_concept_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_require_concept<object<1>, prop<2> >::value)); + assert((!asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp new file mode 100644 index 00000000000..c42a1b3fca4 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp @@ -0,0 +1,41 @@ +// +// cpp03/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 const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { +namespace traits { + +template<int N> +struct static_require_concept<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_require_concept<object<1>, prop<2> >::value)); + assert((!asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..261c4be3728 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp @@ -0,0 +1,28 @@ +// +// cpp03/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() +{ + assert((!asio::can_require_concept<object<1>, prop<2> >::value)); + assert((!asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp new file mode 100644 index 00000000000..3c7d7bf4508 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_static.cpp @@ -0,0 +1,48 @@ +// +// cpp03/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 +{ + static const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require_concept<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_require_concept<object<1>, prop<1> >::value)); + assert((asio::can_require_concept<const object<1>, prop<1> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp new file mode 100644 index 00000000000..0fbcbd36525 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp @@ -0,0 +1,38 @@ +// +// cpp03/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 const bool value = true; +}; + +} // namespace asio + +int main() +{ + assert((!asio::can_require_concept<object<1>, prop<2> >::value)); + assert((!asio::can_require_concept<const object<1>, prop<2> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp new file mode 100644 index 00000000000..fdd9241efa0 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_free.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_require<object<1>, prop<2> >::value)); + assert((asio::can_require<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_require<const object<1>, prop<2> >::value)); + assert((asio::can_require<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp new file mode 100644 index 00000000000..3f9a427333a --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_member.cpp @@ -0,0 +1,59 @@ +// +// cpp03/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 +{ + static const bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_require<object<1>, prop<2> >::value)); + assert((asio::can_require<object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((asio::can_require<const object<1>, prop<2> >::value)); + assert((asio::can_require<const object<1>, prop<2>, prop<3> >::value)); + assert((asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp new file mode 100644 index 00000000000..4bf8ca32a2c --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 const bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_require<object<1>, prop<2> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_require<const object<1>, prop<2> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp new file mode 100644 index 00000000000..842c8d4bee9 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 const bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_require<object<1>, prop<2> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_require<const object<1>, prop<2> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp new file mode 100644 index 00000000000..e8d9ac63aa2 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp @@ -0,0 +1,45 @@ +// +// cpp03/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 const bool is_requirable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((!asio::can_require<object<1>, prop<1> >::value)); + assert((!asio::can_require<object<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_require<object<1>, prop<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_require<const object<1>, prop<1> >::value)); + assert((!asio::can_require<const object<1>, prop<1>, prop<1> >::value)); + assert((!asio::can_require<const object<1>, prop<1>, prop<1>, prop<1> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp new file mode 100644 index 00000000000..6fe234731dc --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp @@ -0,0 +1,32 @@ +// +// cpp03/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() +{ + assert((!asio::can_require<object<1>, prop<2> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_require<const object<1>, prop<2> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp new file mode 100644 index 00000000000..5d4a65749b2 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_static.cpp @@ -0,0 +1,52 @@ +// +// cpp03/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 +{ + static const bool is_requirable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +int main() +{ + assert((asio::can_require<object<1>, prop<1> >::value)); + assert((asio::can_require<object<1>, prop<1>, prop<1> >::value)); + assert((asio::can_require<object<1>, prop<1>, prop<1>, prop<1> >::value)); + assert((asio::can_require<const object<1>, prop<1> >::value)); + assert((asio::can_require<const object<1>, prop<1>, prop<1> >::value)); + assert((asio::can_require<const object<1>, prop<1>, prop<1>, prop<1> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp new file mode 100644 index 00000000000..f3bf74b0499 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/can_require_unsupported.cpp @@ -0,0 +1,42 @@ +// +// cpp03/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 const bool value = true; +}; + +} // namespace asio + +int main() +{ + assert((!asio::can_require<object<1>, prop<2> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value)); + assert((!asio::can_require<const object<1>, prop<2> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value)); + assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value)); +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp new file mode 100644 index 00000000000..dcf89c7f4af --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp @@ -0,0 +1,68 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> prefer(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct prefer_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp new file mode 100644 index 00000000000..223d3a60921 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_free_require.cpp @@ -0,0 +1,68 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp new file mode 100644 index 00000000000..538f7b2662a --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp @@ -0,0 +1,68 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> prefer(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct prefer_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp new file mode 100644 index 00000000000..f659b6fc2bd --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_member_require.cpp @@ -0,0 +1,68 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp new file mode 100644 index 00000000000..f5fcb7f89a0 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_static.cpp @@ -0,0 +1,61 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp b/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp new file mode 100644 index 00000000000..25e0f308a4a --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/prefer_unsupported.cpp @@ -0,0 +1,46 @@ +// +// cpp03/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 +{ + static const bool is_preferable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +} // namespace asio + +int main() +{ + object<1> o1 = {}; + const object<1>& o2 = asio::prefer(o1, prop<1>()); + assert(&o1 == &o2); + (void)o2; + + const object<1> o3 = {}; + const object<1>& o4 = asio::prefer(o3, prop<1>()); + assert(&o3 == &o4); + (void)o4; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp new file mode 100644 index 00000000000..a9aae563293 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/query_free.cpp @@ -0,0 +1,55 @@ +// +// cpp03/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 +{ +}; + +struct object +{ + friend int query(const object&, prop) { return 123; } +}; + +namespace asio { + +template<> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +namespace traits { + +template<> +struct query_free<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp new file mode 100644 index 00000000000..a1ab83e0200 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/query_member.cpp @@ -0,0 +1,55 @@ +// +// cpp03/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 +{ +}; + +struct object +{ + int query(prop) const { return 123; } +}; + +namespace asio { + +template<> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +namespace traits { + +template<> +struct query_member<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp new file mode 100644 index 00000000000..b0e0b4040e4 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/query_static.cpp @@ -0,0 +1,55 @@ +// +// cpp03/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 +{ +}; + +struct object +{ +}; + +namespace asio { + +template<> +struct is_applicable_property<object, prop> +{ + static const bool value = true; +}; + +namespace traits { + +template<> +struct static_query<object, prop> +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef int result_type; + static int value() { return 123; } +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp new file mode 100644 index 00000000000..6cccdd2774e --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/require_concept_free.cpp @@ -0,0 +1,60 @@ +// +// cpp03/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 +{ + static const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require_concept(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_concept_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp new file mode 100644 index 00000000000..673493292be --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/require_concept_member.cpp @@ -0,0 +1,60 @@ +// +// cpp03/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 +{ + static const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require_concept(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_concept_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp new file mode 100644 index 00000000000..e92ffa1ef61 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/require_concept_static.cpp @@ -0,0 +1,55 @@ +// +// cpp03/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 +{ + static const bool is_requirable_concept = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require_concept<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp new file mode 100644 index 00000000000..04734ac3192 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/require_free.cpp @@ -0,0 +1,68 @@ +// +// cpp03/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 +{ + static const bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + friend object<N> require(const object&, prop<N>) + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_free<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp new file mode 100644 index 00000000000..fc6bdc2c9c9 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/require_member.cpp @@ -0,0 +1,68 @@ +// +// cpp03/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 +{ + static const bool is_requirable = true; +}; + +template <int> +struct object +{ + template <int N> + object<N> require(prop<N>) const + { + return object<N>(); + } +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N, int M> +struct require_member<object<N>, prop<M> > +{ + static const bool is_valid = true; + static const bool is_noexcept = true; + typedef object<M> result_type; +}; + +} // namespace traits +} // namespace asio + +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; +} diff --git a/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp b/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp new file mode 100644 index 00000000000..33512b32924 --- /dev/null +++ b/3rdparty/asio/src/tests/properties/cpp03/require_static.cpp @@ -0,0 +1,61 @@ +// +// cpp03/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 +{ + static const bool is_requirable = true; +}; + +template <int> +struct object +{ +}; + +namespace asio { + +template<int N, int M> +struct is_applicable_property<object<N>, prop<M> > +{ + static const bool value = true; +}; + +namespace traits { + +template<int N> +struct static_require<object<N>, prop<N> > +{ + static const bool is_valid = true; +}; + +} // namespace traits +} // namespace asio + +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; +} |