Passing any function as template parameter

前端 未结 3 1706
天涯浪人
天涯浪人 2021-01-31 03:10

I want to pass a function value as a template parameter to a function. Currently the best I managed to do is :

template< typename F, F f >         


        
3条回答
  •  日久生厌
    2021-01-31 03:40

    I believe shortening this is currently impossible. A year ago, the C++ committee looked at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3601.html to fix this, and they encouraged the authors to pursue it further after C++14 was released.

提交回复
热议问题