//! @copyright *this file is freware. //! @warning Use it at your own risk. //! @file identity.hpp //! @author Dejan D. M. Milosavljevic //! @version 1.0 //! @date 2003 //! @please "Do not remove or change this comments" //! @description indentity classes. //! @bug //! @warning Use it at your own risk. //! @copyright *this file is freware. #ifndef Dh_DDMRM_identyty_function_HPP_ #define Dh_DDMRM_identyty_function_HPP_ #include namespace stl_ext { template< typename N_argument, typename N_return = N_argument> class identity_copy : std::unary_function< N_argument const&, N_return > { public: typedef N_return result_type; typedef N_argument argument_type; result_type operator()( argument_type P_argument ) { return P_argument; } }; template< typename N_argument, typename N_return = N_argument > class identity_original : public std::unary_function< N_argument &, N_return& > { public: typedef N_return & result_type; typedef N_argument & argument_type; result_type operator()( argument_type P_argument ) { return P_argument; } }; template< typename N_return > class identity_convert : public std::unary_function< N_return, N_return > { public: typedef N_return result_type; template < typename N1_argument > result_type operator()( N1_argument const & P_argument ) { return P_argument; } }; } #endif