Добавил shared_from_this как основной способ создать умный указатель на "себя". Добавил пример работы с ним
This commit is contained in:
@@ -13,7 +13,7 @@ GENERATE_META(Actor)
|
||||
|
||||
class Actor : public ISave, public IRTTI
|
||||
{
|
||||
World* world_;
|
||||
std::shared_ptr<World> world_;
|
||||
std::string name_;
|
||||
|
||||
std::shared_ptr<Vector3D> loc_, rot_, scale_;
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
void RemoveTag(const std::string& tag) noexcept;
|
||||
const std::list<std::string>& GetTags() const { return tags; }
|
||||
|
||||
World* GetWorld() const { return world_; }
|
||||
std::shared_ptr<World> GetWorld() const { return world_; }
|
||||
const std::string& GetName() const { return name_; }
|
||||
|
||||
friend class World;
|
||||
|
||||
Reference in New Issue
Block a user