1 // Copyright 2020 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 #ifndef BASE_FUNCTIONAL_IDENTITY_H_
6 #define BASE_FUNCTIONAL_IDENTITY_H_
12 // Implementation of C++20's std::identity.
15 // - https://en.cppreference.com/w/cpp/utility/functional/identity
16 // - https://wg21.link/func.identity
19 constexpr T&& operator()(T&& t) const noexcept {
20 return std::forward<T>(t);
23 using is_transparent = void;
28 #endif // BASE_FUNCTIONAL_IDENTITY_H_