Question from the C++ test

Write a C++17 program that uses lambda and fold expressions.

Expert

Lambda and fold expressions

In C++17 what is the ouput and the return value of this program:

int main() {
    auto const& x = 10;
    auto const& t = std::make_tuple(1,20,3,42);
    auto f = [&x](auto&&... elem){ return ((elem < x) and ...);};
    std::cout << std::boolalpha << "result is: " << std::apply(f, t) << std::endl;
    return f(66.6);
}
Author: ezStatus: PublishedQuestion passed 117 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!