c++ Programming Glossary: scoped
What is a smart pointer and when should I use one? http://stackoverflow.com/questions/106508/what-is-a-smart-pointer-and-when-should-i-use-one smart pointer wrapper object such as implemented by boost scoped_ptr or std unique_ptr . void f boost scoped_ptr MyObject ptr.. by boost scoped_ptr or std unique_ptr . void f boost scoped_ptr MyObject ptr new MyObject ptr DoSomethingUseful boost scopted_ptr.. ptr not defined since it is no longer in scope. Note that scoped_ptr instances cannot be copied. This prevents the pointer from..
static const vs #define http://stackoverflow.com/questions/1637332/static-const-vs-define warnings. Advantages of const s are that they can be scoped and they can be used in situations where a pointer to an object..
Why don't STL containers have virtual destructors? http://stackoverflow.com/questions/1647298/why-dont-stl-containers-have-virtual-destructors do. Just make functions Use bare possibly templated file scoped functions instead of trying to add member functions. In some..
pure virtual function with implementation http://stackoverflow.com/questions/2089083/pure-virtual-function-with-implementation if access permissions are allow it by using a fully scoped name by calling A f in your example if A f were public or protected..
are C functions declared in <c____> headers guaranteed to be in the global namespace as well as std? http://stackoverflow.com/questions/2587445/are-c-functions-declared-in-c-headers-guaranteed-to-be-in-the-global-names std. says they are in std but doesn't specify any other scoped they are in . c c namespaces share improve this question..
Unsigned and signed comparison http://stackoverflow.com/questions/3384911/unsigned-and-signed-comparison which are defined as follows If either operand is of scoped enumeration type 7.2 no conversions are performed if the other..
Pointers, smart pointers or shared pointers? http://stackoverflow.com/questions/417481/pointers-smart-pointers-or-shared-pointers a blanket term that cover many types I'll assume you meant scoped pointer which uses the RAII pattern. It is a stack allocated.. when you should use them You will either make heavy use of scoped pointers or shared pointers. How many threads are running in.. in a large code base. There are two reasons to use scoped pointers. The first is for simple exception safety and cleanup..
return statement vs exit() in main() http://stackoverflow.com/questions/461449/return-statement-vs-exit-in-main return in main destructors will be called for my locally scoped objects. If I call exit no destructor will be called for my.. If I call exit no destructor will be called for my locally scoped objects Re read that. exit does not return . That means that..
“enum class” emulation or solid alternative for MSVC 10.0 http://stackoverflow.com/questions/4980280/enum-class-emulation-or-solid-alternative-for-msvc-10-0 specified by an enum base the underlying type of a scoped enumeration is int . Explicit conversions to and from the underlying.. enumerate the values twice. I'm hoping compilers without scoped enum support rapidly become extinct share improve this answer..
Mutex example / tutorial? http://stackoverflow.com/questions/4989451/mutex-example-tutorial just by looking at the simple code could've shown scoped locking by not using acquire and release which also is exception.. static myMutex sm int i 0 void someFunction myMutex scoped_lock lock create a lock lock.acquire sm Method acquire waits..
What C++ Smart Pointer Implementations are available? http://stackoverflow.com/questions/5026197/what-c-smart-pointer-implementations-are-available counts will hang and objects will not be destroyed. boost scoped_ptr This is a simple smart pointer class with little overhead.. the ability to use boost weak_ptr for references. boost scoped_array This is a boost scoped_ptr for arrays. As with boost shared_array.. for references. boost scoped_array This is a boost scoped_ptr for arrays. As with boost shared_array all the necessary..
Why is there no base class in C++? http://stackoverflow.com/questions/5697328/why-is-there-no-base-class-in-c support copy semantics. Heap objects don't support simple scoped behavior which complicates resource management . A universal..
Object destruction in C++ http://stackoverflow.com/questions/6403055/object-destruction-in-c In the following text I will distinguish between scoped objects whose time of destruction is statically determined by..
|