such as the below code, EmbedderEngine has some members, what question I asked is when using a raw object as a member and when using a smart pointer as a member of a class. why not always use a smart pointer? can you help me?
> using a raw object as a member and when using a smart pointer as a member of a class.
> why not always use a smart pointer?
Prefer scoped objects, don’t heap-allocate unnecessarily
Reason A scoped object is a local object, a global object, or a member. This implies that there is no separate allocation and deallocation cost in excess of that already used for the containing scope or object. The members of a scoped object are themselves scoped and the scoped object’s constructor and destructor manage the members’ lifetimes. http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-scoped