Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I thought about making the ternary like that. But is there a common type for 2 different lambdas if they have different return types (like int in one branch and double in the other)? And even if there are the same, they still have different types. Is the common type function<> in this case? If it is then it's extra overhead and I'm not sure how it would work with non-copyable captured objects. (Just some thoughts, I didn't really investigate it, so I'm not sure if there's some aspect I missed.)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution