Добавил shared_from_this как основной способ создать умный указатель на "себя". Добавил пример работы с ним

This commit is contained in:
Jiga228
2026-06-28 15:44:58 +07:00
parent 311772cca4
commit ad881a97a9
13 changed files with 77 additions and 47 deletions
+2 -2
View File
@@ -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;