Original Post
Hello,
Can someone tell me why line (1) does not generate a compiler error while line (2) does?
mAtlasList.push_back(std::unique_ptr(new Atlas(MASTER_ATLAS_MAINMENU)) );
(1)mAtlasList.begin()->operator*().GetName();
(2)auto IsLevel1Atlas = [](std::unique_ptr atlas) -> bool { return atlas->GetName() == L"Level1Atlas"; };
auto tempAtlasPtr = std::find_if(mAtlasList.begin(), mAtlasList.end(), IsLevel1Atlas);
const Sprite * tempSpritePtr = &(tempAtlasPtr->operator*().GetSpriteList().find(L"Background")->second);
The error generated is: error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'
Thanks.
Can someone tell me why line (1) does not generate a compiler error while line (2) does?
mAtlasList.push_back(std::unique_ptr
(1)mAtlasList.begin()->operator*().GetName();
(2)auto IsLevel1Atlas = [](std::unique_ptr
auto tempAtlasPtr = std::find_if(mAtlasList.begin(), mAtlasList.end(), IsLevel1Atlas);
const Sprite * tempSpritePtr = &(tempAtlasPtr->operator*().GetSpriteList().find(L"Background")->second);
The error generated is: error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'
Thanks.