Asked • 06/29/19

Force all && to be executed?

Consider the following variadic function template <typename Type, typename... Types> bool f(Type& arg, Types&... args) { return f(arg) && f(args...); } template <typename Type> bool f(Type& arg) { // Do something } If one level of recursion is `false`, then I suspect that the following will not be executed. Is there a trick to force the recursion on all arguments even if one of them returns `false` ?

2 Answers By Expert Tutors


Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.