Using
auto __begin = begin_expr, __end = end_expr;
requires both begin_expr and end_expr to return the same type. This means you cannot have a sentinel iterator type that is different from the beginning type. Using
auto __begin = begin_expr ;
auto __end = end_expr ;
fixes that issue while proving full backwards compatibility with C++14.