Horizon
Loading...
Searching...
No Matches
identity.hpp
Go to the documentation of this file.
1
2// Range v3 library
3//
4// Copyright Eric Niebler 2013-present
5//
6// Use, modification and distribution is subject to the
7// Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at
9// http://www.boost.org/LICENSE_1_0.txt)
10//
11// Project home: https://github.com/ericniebler/range-v3
12//
13#ifndef RANGES_V3_FUNCTIONAL_IDENTITY_HPP
14#define RANGES_V3_FUNCTIONAL_IDENTITY_HPP
15
16#include <range/v3/detail/config.hpp>
17
18#include <range/v3/detail/prologue.hpp>
19
20namespace ranges
21{
24 struct identity
25 {
26 template<typename T>
27 constexpr T && operator()(T && t) const noexcept
28 {
29 return (T &&) t;
30 }
31 using is_transparent = void;
32 };
33
35 using ident RANGES_DEPRECATED("Replace uses of ranges::ident with ranges::identity") =
38
39 namespace cpp20
40 {
41 using ranges::identity;
42 }
44} // namespace ranges
45
46#include <range/v3/detail/epilogue.hpp>
47
48#endif
Definition identity.hpp:25