Category : shared-ptr

which one of singleton implementation is better and what are advantages and disadvantages? //first class singleton_SharedPtr{ public: singleton_SharedPtr(const singleton_SharedPtr&) = delete; singleton_SharedPtr& operator=(const singleton_SharedPtr&) = delete; ~singleton_SharedPtr(){} //is it normal to return weak_ptr instead of share_ptr in the getInstance method???? static std::shared_ptr<int> getInstance(){ std::cout<<"referenced before if condfition, use_count : "<<instance.use_count()<<std::endl; if(instance==nullptr){ instance=std::make_shared<int>(); } std::cout<<"referenced after ..

Read more

I can’t understand how i can create expr object from double in expr.cpp file. expr_base: The base class of all expressions. Note that all expression classes (including this base) are private to the implementation and should not be exposed to other code. The rest of the program should use expressions only via expr. This subclasses ..

Read more