У меня есть класс, как ниже. < /p>
#include
static const long myValue = 0;
class Sequence
{
public:
Sequence(long initial_value = myValue) : value_(initial_value) {}
private:
std::atomic value_;
};
int main()
{
Sequence firstSequence;
Sequence secondSequence = firstSequence;
return 0;
}
< /code>
Я получаю подобную ошибку компиляции, < /p>
test.cpp:21:36: error: use of deleted function ‘Sequence::Sequence(const Sequence&)’
test.cpp:5:7: error: ‘Sequence::Sequence(const Sequence&)’ is implicitly deleted because the default definition would be ill-formed:
test.cpp:5:7: error: use of deleted function ‘std::atomic::atomic(const std::atomic&)’
< /code>
это то, что конструктор копии по умолчанию и назначение Opertaor не работают в таком случае? < /p>
ps: я использую версию GCC 4.6.3 < /p>
Подробнее здесь: https://stackoverflow.com/questions/120 ... s-stdatomi