Using Boost adaptors with C++11 lambdas

后端 未结 4 1268
我在风中等你
我在风中等你 2020-12-01 15:53

I tried to compile this code:

#include 
#include 
#include 

int main() {
             


        
4条回答
  •  我在风中等你
    2020-12-01 16:52

    With C++17 feature class template argument deduction you can wrap with std::function simplier, like this:

    *boost::min_element(
        v | boost::adaptors::transformed(std::function(
            [](int i) { return -i; })));
    

提交回复
热议问题