Initial Commit

This commit is contained in:
2025-11-06 15:51:56 +01:00
commit 0f7191ad54
648 changed files with 170981 additions and 0 deletions

View File

@@ -0,0 +1,100 @@
//
// traits/equality_comparable.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_EQUALITY_COMPARABLE_HPP
#define ASIO_TRAITS_EQUALITY_COMPARABLE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
namespace asio {
namespace traits {
template <typename T, typename = void>
struct equality_comparable_default;
template <typename T, typename = void>
struct equality_comparable;
} // namespace traits
namespace detail {
struct no_equality_comparable
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename T, typename = void>
struct equality_comparable_trait : no_equality_comparable
{
};
template <typename T>
struct equality_comparable_trait<T,
void_t<
decltype(
static_cast<void>(
static_cast<bool>(declval<const T>() == declval<const T>())
),
static_cast<void>(
static_cast<bool>(declval<const T>() != declval<const T>())
)
)
>>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept =
noexcept(declval<const T>() == declval<const T>())
&& noexcept(declval<const T>() != declval<const T>());
};
#else // defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename T, typename = void>
struct equality_comparable_trait :
conditional_t<
is_same<T, decay_t<T>>::value,
no_equality_comparable,
traits::equality_comparable<decay_t<T>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename>
struct equality_comparable_default : detail::equality_comparable_trait<T>
{
};
template <typename T, typename>
struct equality_comparable : equality_comparable_default<T>
{
};
} // namespace traits
} // namespace asio
#endif // ASIO_TRAITS_EQUALITY_COMPARABLE_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/execute_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_EXECUTE_MEMBER_HPP
#define ASIO_TRAITS_EXECUTE_MEMBER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename F, typename = void>
struct execute_member_default;
template <typename T, typename F, typename = void>
struct execute_member;
} // namespace traits
namespace detail {
struct no_execute_member
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename T, typename F, typename = void>
struct execute_member_trait : no_execute_member
{
};
template <typename T, typename F>
struct execute_member_trait<T, F,
void_t<
decltype(declval<T>().execute(declval<F>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().execute(declval<F>()));
static constexpr bool is_noexcept =
noexcept(declval<T>().execute(declval<F>()));
};
#else // defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename T, typename F, typename = void>
struct execute_member_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<F, decay_t<F>>::value,
no_execute_member,
traits::execute_member<
decay_t<T>,
decay_t<F>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename F, typename>
struct execute_member_default :
detail::execute_member_trait<T, F>
{
};
template <typename T, typename F, typename>
struct execute_member :
execute_member_default<T, F>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_EXECUTE_MEMBER_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/prefer_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_PREFER_FREE_HPP
#define ASIO_TRAITS_PREFER_FREE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct prefer_free_default;
template <typename T, typename Property, typename = void>
struct prefer_free;
} // namespace traits
namespace detail {
struct no_prefer_free
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct prefer_free_trait : no_prefer_free
{
};
template <typename T, typename Property>
struct prefer_free_trait<T, Property,
void_t<
decltype(prefer(declval<T>(), declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
prefer(declval<T>(), declval<Property>()));
static constexpr bool is_noexcept =
noexcept(prefer(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct prefer_free_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_prefer_free,
traits::prefer_free<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct prefer_free_default :
detail::prefer_free_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct prefer_free :
prefer_free_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_PREFER_FREE_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/prefer_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_PREFER_MEMBER_HPP
#define ASIO_TRAITS_PREFER_MEMBER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct prefer_member_default;
template <typename T, typename Property, typename = void>
struct prefer_member;
} // namespace traits
namespace detail {
struct no_prefer_member
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct prefer_member_trait : no_prefer_member
{
};
template <typename T, typename Property>
struct prefer_member_trait<T, Property,
void_t<
decltype(declval<T>().prefer(declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().prefer(declval<Property>()));
static constexpr bool is_noexcept =
noexcept(declval<T>().prefer(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct prefer_member_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_prefer_member,
traits::prefer_member<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct prefer_member_default :
detail::prefer_member_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct prefer_member :
prefer_member_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_PREFER_MEMBER_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/query_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_QUERY_FREE_HPP
#define ASIO_TRAITS_QUERY_FREE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct query_free_default;
template <typename T, typename Property, typename = void>
struct query_free;
} // namespace traits
namespace detail {
struct no_query_free
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct query_free_trait : no_query_free
{
};
template <typename T, typename Property>
struct query_free_trait<T, Property,
void_t<
decltype(query(declval<T>(), declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
query(declval<T>(), declval<Property>()));
static constexpr bool is_noexcept =
noexcept(query(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct query_free_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_query_free,
traits::query_free<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct query_free_default :
detail::query_free_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct query_free :
query_free_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_QUERY_FREE_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/query_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_QUERY_MEMBER_HPP
#define ASIO_TRAITS_QUERY_MEMBER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct query_member_default;
template <typename T, typename Property, typename = void>
struct query_member;
} // namespace traits
namespace detail {
struct no_query_member
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct query_member_trait : no_query_member
{
};
template <typename T, typename Property>
struct query_member_trait<T, Property,
void_t<
decltype(declval<T>().query(declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().query(declval<Property>()));
static constexpr bool is_noexcept =
noexcept(declval<T>().query(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct query_member_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_query_member,
traits::query_member<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct query_member_default :
detail::query_member_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct query_member :
query_member_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_QUERY_MEMBER_HPP

View File

@@ -0,0 +1,101 @@
//
// traits/query_static_constexpr_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_QUERY_STATIC_CONSTEXPR_MEMBER_HPP
#define ASIO_TRAITS_QUERY_STATIC_CONSTEXPR_MEMBER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE) \
&& defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT 1
#endif // defined(ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
// && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct query_static_constexpr_member_default;
template <typename T, typename Property, typename = void>
struct query_static_constexpr_member;
} // namespace traits
namespace detail {
struct no_query_static_constexpr_member
{
static constexpr bool is_valid = false;
};
template <typename T, typename Property, typename = void>
struct query_static_constexpr_member_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_query_static_constexpr_member,
traits::query_static_constexpr_member<
decay_t<T>,
decay_t<Property>>
>
{
};
#if defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename T, typename Property>
struct query_static_constexpr_member_trait<T, Property,
enable_if_t<
(static_cast<void>(T::query(Property{})), true)
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(T::query(Property{}));
static constexpr bool is_noexcept = noexcept(T::query(Property{}));
static constexpr result_type value() noexcept(is_noexcept)
{
return T::query(Property{});
}
};
#endif // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct query_static_constexpr_member_default :
detail::query_static_constexpr_member_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct query_static_constexpr_member :
query_static_constexpr_member_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_QUERY_STATIC_CONSTEXPR_MEMBER_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/require_concept_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_REQUIRE_CONCEPT_FREE_HPP
#define ASIO_TRAITS_REQUIRE_CONCEPT_FREE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct require_concept_free_default;
template <typename T, typename Property, typename = void>
struct require_concept_free;
} // namespace traits
namespace detail {
struct no_require_concept_free
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct require_concept_free_trait : no_require_concept_free
{
};
template <typename T, typename Property>
struct require_concept_free_trait<T, Property,
void_t<
decltype(require_concept(declval<T>(), declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
require_concept(declval<T>(), declval<Property>()));
static constexpr bool is_noexcept =
noexcept(require_concept(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct require_concept_free_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_require_concept_free,
traits::require_concept_free<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_FREE_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct require_concept_free_default :
detail::require_concept_free_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct require_concept_free :
require_concept_free_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_REQUIRE_CONCEPT_FREE_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/require_concept_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_REQUIRE_CONCEPT_MEMBER_HPP
#define ASIO_TRAITS_REQUIRE_CONCEPT_MEMBER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct require_concept_member_default;
template <typename T, typename Property, typename = void>
struct require_concept_member;
} // namespace traits
namespace detail {
struct no_require_concept_member
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct require_concept_member_trait : no_require_concept_member
{
};
template <typename T, typename Property>
struct require_concept_member_trait<T, Property,
void_t<
decltype(declval<T>().require_concept(declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().require_concept(declval<Property>()));
static constexpr bool is_noexcept =
noexcept(declval<T>().require_concept(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct require_concept_member_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_require_concept_member,
traits::require_concept_member<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_REQUIRE_CONCEPT_MEMBER_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct require_concept_member_default :
detail::require_concept_member_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct require_concept_member :
require_concept_member_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_REQUIRE_CONCEPT_MEMBER_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/require_free.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_REQUIRE_FREE_HPP
#define ASIO_TRAITS_REQUIRE_FREE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct require_free_default;
template <typename T, typename Property, typename = void>
struct require_free;
} // namespace traits
namespace detail {
struct no_require_free
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct require_free_trait : no_require_free
{
};
template <typename T, typename Property>
struct require_free_trait<T, Property,
void_t<
decltype(require(declval<T>(), declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
require(declval<T>(), declval<Property>()));
static constexpr bool is_noexcept =
noexcept(require(declval<T>(), declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename T, typename Property, typename = void>
struct require_free_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_require_free,
traits::require_free<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct require_free_default :
detail::require_free_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct require_free :
require_free_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_REQUIRE_FREE_HPP

View File

@@ -0,0 +1,104 @@
//
// traits/require_member.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_REQUIRE_MEMBER_HPP
#define ASIO_TRAITS_REQUIRE_MEMBER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT 1
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct require_member_default;
template <typename T, typename Property, typename = void>
struct require_member;
} // namespace traits
namespace detail {
struct no_require_member
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
#if defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct require_member_trait : no_require_member
{
};
template <typename T, typename Property>
struct require_member_trait<T, Property,
void_t<
decltype(declval<T>().require(declval<Property>()))
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
declval<T>().require(declval<Property>()));
static constexpr bool is_noexcept =
noexcept(declval<T>().require(declval<Property>()));
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename T, typename Property, typename = void>
struct require_member_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_require_member,
traits::require_member<
decay_t<T>,
decay_t<Property>>
>
{
};
#endif // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct require_member_default :
detail::require_member_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct require_member :
require_member_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_REQUIRE_MEMBER_HPP

View File

@@ -0,0 +1,102 @@
//
// traits/static_query.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_STATIC_QUERY_HPP
#define ASIO_TRAITS_STATIC_QUERY_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_HAS_VARIABLE_TEMPLATES) \
&& defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
# define ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT 1
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
// && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct static_query_default;
template <typename T, typename Property, typename = void>
struct static_query;
} // namespace traits
namespace detail {
struct no_static_query
{
static constexpr bool is_valid = false;
static constexpr bool is_noexcept = false;
};
template <typename T, typename Property, typename = void>
struct static_query_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_static_query,
traits::static_query<
decay_t<T>,
decay_t<Property>>
>
{
};
#if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
template <typename T, typename Property>
struct static_query_trait<T, Property,
void_t<
decltype(decay_t<Property>::template static_query_v<T>)
>>
{
static constexpr bool is_valid = true;
using result_type = decltype(
decay_t<Property>::template static_query_v<T>);
static constexpr bool is_noexcept =
noexcept(decay_t<Property>::template static_query_v<T>);
static constexpr result_type value() noexcept(is_noexcept)
{
return decay_t<Property>::template static_query_v<T>;
}
};
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct static_query_default : detail::static_query_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct static_query : static_query_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_STATIC_QUERY_HPP

View File

@@ -0,0 +1,115 @@
//
// traits/static_require.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_STATIC_REQUIRE_HPP
#define ASIO_TRAITS_STATIC_REQUIRE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/traits/static_query.hpp"
#define ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT 1
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct static_require_default;
template <typename T, typename Property, typename = void>
struct static_require;
} // namespace traits
namespace detail {
struct no_static_require
{
static constexpr bool is_valid = false;
};
template <typename T, typename Property, typename = void>
struct static_require_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_static_require,
traits::static_require<
decay_t<T>,
decay_t<Property>>
>
{
};
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
template <typename T, typename Property>
struct static_require_trait<T, Property,
enable_if_t<
decay_t<Property>::value() == traits::static_query<T, Property>::value()
>>
{
static constexpr bool is_valid = true;
};
#else // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
false_type static_require_test(...);
template <typename T, typename Property>
true_type static_require_test(T*, Property*,
enable_if_t<
Property::value() == traits::static_query<T, Property>::value()
>* = 0);
template <typename T, typename Property>
struct has_static_require
{
static constexpr bool value =
decltype((static_require_test)(
static_cast<T*>(0), static_cast<Property*>(0)))::value;
};
template <typename T, typename Property>
struct static_require_trait<T, Property,
enable_if_t<
has_static_require<decay_t<T>,
decay_t<Property>>::value
>>
{
static constexpr bool is_valid = true;
};
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct static_require_default : detail::static_require_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct static_require : static_require_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_STATIC_REQUIRE_HPP

View File

@@ -0,0 +1,116 @@
//
// traits/static_require_concept.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2025 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)
//
#ifndef ASIO_TRAITS_STATIC_REQUIRE_CONCEPT_HPP
#define ASIO_TRAITS_STATIC_REQUIRE_CONCEPT_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/traits/static_query.hpp"
#define ASIO_HAS_DEDUCED_STATIC_REQUIRE_CONCEPT_TRAIT 1
#include "asio/detail/push_options.hpp"
namespace asio {
namespace traits {
template <typename T, typename Property, typename = void>
struct static_require_concept_default;
template <typename T, typename Property, typename = void>
struct static_require_concept;
} // namespace traits
namespace detail {
struct no_static_require_concept
{
static constexpr bool is_valid = false;
};
template <typename T, typename Property, typename = void>
struct static_require_concept_trait :
conditional_t<
is_same<T, decay_t<T>>::value
&& is_same<Property, decay_t<Property>>::value,
no_static_require_concept,
traits::static_require_concept<
decay_t<T>,
decay_t<Property>>
>
{
};
#if defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
template <typename T, typename Property>
struct static_require_concept_trait<T, Property,
enable_if_t<
decay_t<Property>::value() == traits::static_query<T, Property>::value()
>>
{
static constexpr bool is_valid = true;
};
#else // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
false_type static_require_concept_test(...);
template <typename T, typename Property>
true_type static_require_concept_test(T*, Property*,
enable_if_t<
Property::value() == traits::static_query<T, Property>::value()
>* = 0);
template <typename T, typename Property>
struct has_static_require_concept
{
static constexpr bool value =
decltype((static_require_concept_test)(
static_cast<T*>(0), static_cast<Property*>(0)))::value;
};
template <typename T, typename Property>
struct static_require_concept_trait<T, Property,
enable_if_t<
has_static_require_concept<decay_t<T>,
decay_t<Property>>::value
>>
{
static constexpr bool is_valid = true;
};
#endif // defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE)
} // namespace detail
namespace traits {
template <typename T, typename Property, typename>
struct static_require_concept_default :
detail::static_require_concept_trait<T, Property>
{
};
template <typename T, typename Property, typename>
struct static_require_concept : static_require_concept_default<T, Property>
{
};
} // namespace traits
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_TRAITS_STATIC_REQUIRE_CONCEPT_HPP