Skip to content

Commit 0cc6ae5

Browse files
committed
LWG4027 possibly-const-range should prefer returning const R&
1 parent 63bf48b commit 0cc6ae5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/ranges.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
// \ref{range.as.const}, as const view
397397
template<@\libconcept{input_range}@ R>
398398
constexpr auto& @\exposid{possibly-const-range}@(R& r) noexcept { // \expos
399-
if constexpr (@\libconcept{constant_range}@<const R> && !@\libconcept{constant_range}@<R>) {
399+
if constexpr (@\libconcept{input_range}@<const R>) {
400400
return const_cast<const R&>(r);
401401
} else {
402402
return r;

0 commit comments

Comments
 (0)