1 //===-------- stl_extras.h - Useful STL related functions-------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of the ORC runtime support library.
11 //===----------------------------------------------------------------------===//
13 #ifndef ORC_RT_STL_EXTRAS_H
14 #define ORC_RT_STL_EXTRAS_H
21 /// Substitute for std::identity.
22 /// Switch to std::identity once we can use c++20.
23 template <class Ty
> struct identity
{
24 using is_transparent
= void;
25 using argument_type
= Ty
;
27 Ty
&operator()(Ty
&self
) const { return self
; }
28 const Ty
&operator()(const Ty
&self
) const { return self
; }
31 } // namespace __orc_rt
33 #endif // ORC_RT_STL_EXTRAS