Программы на C++. Форум разработчиков
-
Гость
Std::atomic ошибка: для постфикса «++» не объявлен оператор «++(int)» [-fpermissive]
Сообщение
Гость »
Я пытаюсь обновить
variable through different threads and getting this error.
This is my code.
Код: Выделить всё
class counter {
public:
std::atomic done;
bool fn_write (int size) const {
static int count = 0;
if (count == size) {
done++;
count = 0;
return false;
} else {
count++;
return true;
}
}
};
int main() {
counter c1;
for (int i=0; i
Источник: [url]https://stackoverflow.com/questions/48533476/stdatomic-error-no-operatorint-declared-for-postfix-fpermissive[/url]
1710181022
Гость
Я пытаюсь обновить[code]atomic[/code] variable through different threads and getting this error.
This is my code.
[code]class counter {
public:
std::atomic done;
bool fn_write (int size) const {
static int count = 0;
if (count == size) {
done++;
count = 0;
return false;
} else {
count++;
return true;
}
}
};
int main() {
counter c1;
for (int i=0; i
Источник: [url]https://stackoverflow.com/questions/48533476/stdatomic-error-no-operatorint-declared-for-postfix-fpermissive[/url]