You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But obviously push_many can't be this-const, as it calls push which isn't const:
In file included from ../src/bounded_buffer_student_suite.cpp:4:
../src/BoundedBuffer.h: In instantiation of ‘void BoundedBuffer<T>::push_many(Head&&, Tail&& ...) const [with Head = int; Tail = {int, int}; T = int]’:
../src/bounded_buffer_student_suite.cpp:17:26: required from here
../src/BoundedBuffer.h:112:3: error: passing ‘const BoundedBuffer<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
112 | push(std::forward<Head>(head));
| ^~~~
../src/BoundedBuffer.h:150:7: note: in call to ‘void BoundedBuffer<T>::push(E&&) [with E = int; T = int]’
150 | void push(E && element) {
| ^~~~
The text was updated successfully, but these errors were encountered:
fmorgner
changed the title
Constificator suggests this-const for BoundedBuffer::push_many
Constificator: suggests this-const for BoundedBuffer::push_many
Feb 23, 2021
I'm using Archlinux, with Cevelop 1.12.1-201907081203 and Constificator 1.12.2.20190710144.
With this source code (from BoundedBuffer):
I'm getting:
But obviously
push_many
can't be this-const, as it callspush
which isn'tconst
:The text was updated successfully, but these errors were encountered: