std::unique_ptr<ContentData> ContentData::clone() const { auto result = cloneInternal(); ContentData* lastNewData = result.get(); for (const ContentData* contentData = next(); contentData; contentData = contentData->next()) { auto newData = contentData->cloneInternal(); lastNewData->setNext(std::move(newData)); lastNewData = lastNewData->next(); } return result; }
PassOwnPtr<ContentData> ContentData::clone() const { OwnPtr<ContentData> result = cloneInternal(); ContentData* lastNewData = result.get(); for (const ContentData* contentData = next(); contentData; contentData = contentData->next()) { OwnPtr<ContentData> newData = contentData->cloneInternal(); lastNewData->setNext(newData.release()); lastNewData = lastNewData->next(); } return result.release(); }
ContentData* ContentData::clone() const { ContentData* result = cloneInternal(); ContentData* lastNewData = result; for (const ContentData* contentData = next(); contentData; contentData = contentData->next()) { ContentData* newData = contentData->cloneInternal(); lastNewData->setNext(newData); lastNewData = lastNewData->next(); } return result; }