Quote Originally Posted by monarch_dodra View Post
Those work for me though, as you can always pass a const expression to functions taking const refs.
uhm, unless I'm missing something, no, because a reference to an automatic const int is not a constant expression ( triggering an implicit capture and hence an error ). Are you using a c++14 standard library ? ( std::max is constexpr from c++14 on ... in this case no error would happen of course )