Skip to content

Commit 4f19015

Browse files
authored
Merge pull request #4335 from romainbrenguier/as-const-rvalue
Delete as_const on rvalue
2 parents 611b910 + 9cd1e56 commit 4f19015

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/as_const.h

+4
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ const T &as_const(T &value)
1616
return static_cast<const T &>(value);
1717
}
1818

19+
/// Deleted to avoid calling as_const on an xvalue
20+
template <typename T>
21+
void as_const(T &&) = delete;
22+
1923
#endif // CPROVER_UTIL_AS_CONST_H

0 commit comments

Comments
 (0)