Currently, if ranges::to cannot create the result, the error message just says "the program is ill-formed per N4950 [range.utility.conv.to]/2.3".
|
static_assert(_Always_false<_Container>, "the program is ill-formed per N4950 [range.utility.conv.to]/2.3");
|
This doesn't help an average user to understand the problem.
It should be possible to give a more detailed message. What I have in mind:
if constexpr (_Ref_converts<_Rng, _Container>) {
static_assert(false, "cannot find a way to create the result: "
"neither constructor call nor insertion at the end works");
} else {
static_assert(
false, "elements of the destination container must be "
"implicitly convertible from elements of the source range");
}
Currently, if
ranges::tocannot create the result, the error message just says "the program is ill-formed per N4950 [range.utility.conv.to]/2.3".STL/stl/inc/ranges
Line 10377 in be81252
This doesn't help an average user to understand the problem.
It should be possible to give a more detailed message. What I have in mind: