Код: Выделить всё
#include
#include "Nix.h"
int main( int , char ** )
{
Nix *nix1 = new Nix(1, "Hello, I'm one");
Nix *nix2 = new Nix();
nix2 = nix1;
nix2->add(2, "Hello, I'm two");
Nix *nix3 = new Nix(*nix2);
nix3->add(3, "Hello, I'm three");
qWarning() myMap.contains(x))
{
return d->myMap.value(x);
}
else
{
return "not found";
}
}
void Nix::add(int a, QString b)
{
d->myMap[a] = b;
}
< /code>
Похоже, что оператор назначения движения называется:
QSharedDataPointer &QSharedDataPointer::operator=(QSharedDataPointer &&other)< /code> < /p>
Если документация верна, мне понадобится другой:
QSharedDataPointer &QSharedDataPointer::operator=(const QSharedDataPointer &o)Я попытался использовать актерский оператор, но без успеха.
Подробнее здесь: https://stackoverflow.com/questions/794 ... -where-a-c
Мобильная версия