EnTT 4.0.0
Loading...
Searching...
No Matches
functional.hpp
1#ifndef ENTT_STL_FUNCTIONAL_HPP
2#define ENTT_STL_FUNCTIONAL_HPP
3
5#if __has_include(<entt/ext/stl/functional.hpp>)
6# include <entt/ext/stl/functional.hpp>
7#else
8# include <functional>
9# include <version>
10# include "../config/config.h"
11
12namespace entt::stl {
13
14using std::equal_to;
15using std::function;
16using std::hash;
17using std::invoke;
18using std::less;
19
20} // namespace entt::stl
21
22# ifndef ENTT_FORCE_STL
23# if defined(__cpp_lib_ranges)
24# define ENTT_HAS_IDENTITY
25namespace entt::stl {
26
27using std::identity;
28
29} // namespace entt::stl
30# endif
31# endif
32
33# ifndef ENTT_HAS_IDENTITY
34# include <utility>
35
36namespace entt::stl {
37
38struct identity {
39 using is_transparent = void;
40
41 template<typename Type>
42 [[nodiscard]] constexpr Type &&operator()(Type &&value) const noexcept {
43 return std::forward<Type>(value);
44 }
45};
46
47} // namespace entt::stl
48# endif
49
50#endif
52
53#undef ENTT_HAS_IDENTITY
54
55#endif
Custom EnTT namespace for the standard template library.
Definition entt.hpp:5