修改pods

This commit is contained in:
2025-09-20 17:13:38 +08:00
parent 7787b3ee30
commit 28ff2b0264
5251 changed files with 345029 additions and 285168 deletions

View File

@@ -34,6 +34,7 @@
#define ABSL_FUNCTIONAL_ANY_INVOCABLE_H_
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <type_traits>
#include <utility>
@@ -98,9 +99,9 @@ ABSL_NAMESPACE_BEGIN
// `AnyInvocable` also properly respects `const` qualifiers, reference
// qualifiers, and the `noexcept` specification (only in C++ 17 and beyond) as
// part of the user-specified function type (e.g.
// `AnyInvocable<void()&& const noexcept>`). These qualifiers will be applied to
// the `AnyInvocable` object's `operator()`, and the underlying invocable must
// be compatible with those qualifiers.
// `AnyInvocable<void() const && noexcept>`). These qualifiers will be applied
// to the `AnyInvocable` object's `operator()`, and the underlying invocable
// must be compatible with those qualifiers.
//
// Comparison of const and non-const function types:
//
@@ -151,6 +152,12 @@ ABSL_NAMESPACE_BEGIN
//
// Attempting to call `absl::AnyInvocable` multiple times in such a case
// results in undefined behavior.
//
// Invoking an empty `absl::AnyInvocable` results in undefined behavior:
//
// // Create an empty instance using the default constructor.
// AnyInvocable<void()> empty;
// empty(); // WARNING: Undefined behavior!
template <class Sig>
class AnyInvocable : private internal_any_invocable::Impl<Sig> {
private:
@@ -167,6 +174,7 @@ class AnyInvocable : private internal_any_invocable::Impl<Sig> {
// Constructors
// Constructs the `AnyInvocable` in an empty state.
// Invoking it results in undefined behavior.
AnyInvocable() noexcept = default;
AnyInvocable(std::nullptr_t) noexcept {} // NOLINT
@@ -277,6 +285,8 @@ class AnyInvocable : private internal_any_invocable::Impl<Sig> {
// In other words:
// std::function<void()> f; // empty
// absl::AnyInvocable<void()> a = std::move(f); // not empty
//
// Invoking an empty `AnyInvocable` results in undefined behavior.
explicit operator bool() const noexcept { return this->HasValue(); }
// Invokes the target object of `*this`. `*this` must not be empty.

View File

@@ -34,6 +34,8 @@
#include <functional> // For std::bind_front.
#endif // defined(__cpp_lib_bind_front) && __cpp_lib_bind_front >= 201907L
#include <utility>
#include "absl/functional/internal/front_binder.h"
#include "absl/utility/utility.h"
@@ -182,8 +184,7 @@ template <class F, class... BoundArgs>
constexpr functional_internal::bind_front_t<F, BoundArgs...> bind_front(
F&& func, BoundArgs&&... args) {
return functional_internal::bind_front_t<F, BoundArgs...>(
absl::in_place, absl::forward<F>(func),
absl::forward<BoundArgs>(args)...);
absl::in_place, std::forward<F>(func), std::forward<BoundArgs>(args)...);
}
#endif // defined(__cpp_lib_bind_front) && __cpp_lib_bind_front >= 201907L

View File

@@ -19,11 +19,11 @@
////////////////////////////////////////////////////////////////////////////////
// //
// This implementation of the proposed `any_invocable` uses an approach that //
// chooses between local storage and remote storage for the contained target //
// object based on the target object's size, alignment requirements, and //
// whether or not it has a nothrow move constructor. Additional optimizations //
// are performed when the object is a trivially copyable type [basic.types]. //
// This implementation chooses between local storage and remote storage for //
// the contained target object based on the target object's size, alignment //
// requirements, and whether or not it has a nothrow move constructor. //
// Additional optimizations are performed when the object is a trivially //
// copyable type [basic.types]. //
// //
// There are three datamembers per `AnyInvocable` instance //
// //
@@ -39,7 +39,7 @@
// target object, directly returning the result. //
// //
// When in the logically empty state, the manager function is an empty //
// function and the invoker function is one that would be undefined-behavior //
// function and the invoker function is one that would be undefined behavior //
// to call. //
// //
// An additional optimization is performed when converting from one //
@@ -58,12 +58,12 @@
#include <cstring>
#include <exception>
#include <functional>
#include <initializer_list>
#include <memory>
#include <new>
#include <type_traits>
#include <utility>
#include "absl/base/attributes.h"
#include "absl/base/config.h"
#include "absl/base/internal/invoke.h"
#include "absl/base/macros.h"

View File

@@ -34,8 +34,8 @@ namespace functional_internal {
template <class R, class Tuple, size_t... Idx, class... Args>
R Apply(Tuple&& bound, absl::index_sequence<Idx...>, Args&&... free) {
return base_internal::invoke(
absl::forward<Tuple>(bound).template get<Idx>()...,
absl::forward<Args>(free)...);
std::forward<Tuple>(bound).template get<Idx>()...,
std::forward<Args>(free)...);
}
template <class F, class... BoundArgs>
@@ -48,13 +48,13 @@ class FrontBinder {
public:
template <class... Ts>
constexpr explicit FrontBinder(absl::in_place_t, Ts&&... ts)
: bound_args_(absl::forward<Ts>(ts)...) {}
: bound_args_(std::forward<Ts>(ts)...) {}
template <class... FreeArgs, class R = base_internal::invoke_result_t<
F&, BoundArgs&..., FreeArgs&&...>>
R operator()(FreeArgs&&... free_args) & {
return functional_internal::Apply<R>(bound_args_, Idx(),
absl::forward<FreeArgs>(free_args)...);
std::forward<FreeArgs>(free_args)...);
}
template <class... FreeArgs,
@@ -62,7 +62,7 @@ class FrontBinder {
const F&, const BoundArgs&..., FreeArgs&&...>>
R operator()(FreeArgs&&... free_args) const& {
return functional_internal::Apply<R>(bound_args_, Idx(),
absl::forward<FreeArgs>(free_args)...);
std::forward<FreeArgs>(free_args)...);
}
template <class... FreeArgs, class R = base_internal::invoke_result_t<
@@ -70,8 +70,8 @@ class FrontBinder {
R operator()(FreeArgs&&... free_args) && {
// This overload is called when *this is an rvalue. If some of the bound
// arguments are stored by value or rvalue reference, we move them.
return functional_internal::Apply<R>(absl::move(bound_args_), Idx(),
absl::forward<FreeArgs>(free_args)...);
return functional_internal::Apply<R>(std::move(bound_args_), Idx(),
std::forward<FreeArgs>(free_args)...);
}
template <class... FreeArgs,
@@ -80,8 +80,8 @@ class FrontBinder {
R operator()(FreeArgs&&... free_args) const&& {
// This overload is called when *this is an rvalue. If some of the bound
// arguments are stored by value or rvalue reference, we move them.
return functional_internal::Apply<R>(absl::move(bound_args_), Idx(),
absl::forward<FreeArgs>(free_args)...);
return functional_internal::Apply<R>(std::move(bound_args_), Idx(),
std::forward<FreeArgs>(free_args)...);
}
};