Default function that just returns the passed value?

前端 未结 6 1515
礼貌的吻别
礼貌的吻别 2020-12-31 08:24

As a lazy developer, I like to use this trick to specify a default function:

template 

        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 09:17

    There is the following variant with boost:

    template >
    void index(std::array &x, Function&& f = boost::bind(std::plus(), 0, _1))
    

提交回复
热议问题