1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This defines helpful tags for dealing with Callbacks. Those tags can be used
6 // to construct special callbacks. This lives in its own file to avoid circular
9 #ifndef BASE_FUNCTIONAL_CALLBACK_TAGS_H_
10 #define BASE_FUNCTIONAL_CALLBACK_TAGS_H_
12 namespace base::internal {
14 struct NullCallbackTag {
15 template <typename Signature>
16 struct WithSignature {};
19 struct DoNothingCallbackTag {
20 template <typename Signature>
21 struct WithSignature {};
23 template <typename... BoundArgs>
24 struct WithBoundArguments {
25 std::tuple<BoundArgs...> bound_args;
27 constexpr explicit WithBoundArguments(BoundArgs... args)
28 : bound_args(std::forward<BoundArgs>(args)...) {}
32 } // namespace base::internal
34 #endif // BASE_FUNCTIONAL_CALLBACK_TAGS_H_