kehuadong

c++ stl function

// 一元函数
template <typename _Arg, typename _Result>
struct unary_function
{
    /// @c argument_type is the type of the argument
    typedef _Arg argument_type;

    /// @c result_type is the return type
    typedef _Result result_type;
};

// 二元函数
template <typename _Arg1, typename _Arg2, typename _Result>
struct binary_function
{
    /// @c first_argument_type is the type of the first argument
    typedef _Arg1 first_argument_type;

    /// @c second_argument_type is the type of the second argument
    typedef _Arg2 second_argument_type;

    /// @c result_type is the return type
    typedef _Result result_type;
};

 

posted on 2024-09-12 20:09  kehuadong  阅读(2)  评论(0编辑  收藏  举报

导航