/* Copyright 2021-2023 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BHO_CORE_IDENTITY_HPP #define BHO_CORE_IDENTITY_HPP #include #if !defined(BHO_NO_CXX11_RVALUE_REFERENCES) #include #endif namespace bho { struct identity { typedef void is_transparent; #if !defined(BHO_NO_CXX11_RVALUE_REFERENCES) template BHO_CONSTEXPR T&& operator()(T&& value) const BHO_NOEXCEPT { return std::forward(value); } #else template BHO_CONSTEXPR const T& operator()(const T& value) const BHO_NOEXCEPT { return value; } template BHO_CONSTEXPR T& operator()(T& value) const BHO_NOEXCEPT { return value; } #endif template struct result { }; template struct result { typedef T& type; }; #if !defined(BHO_NO_CXX11_RVALUE_REFERENCES) template struct result { typedef T&& type; }; template struct result { typedef T&& type; }; #endif }; } /* boost */ #endif