The cpp boost scoped_ptr library provides a way to manage dynamically allocated objects with automatic destruction when they are no longer needed. The scoped_ptr get function retrieves the raw pointer held by a scoped_ptr object. Here are some examples:
This code creates a scoped_ptr object that points to an integer with value 42. The get function is then used to retrieve the raw pointer held by the scoped_ptr object, which is stored in the raw_ptr variable. Finally, an assertion is used to check that the value pointed to by the raw pointer is indeed 42.
This code creates a scoped_ptr object that points to a dynamically allocated instance of MyClass. The arrow operator (->) is used to call the foo method of the MyClass instance through the scoped_ptr object. The get function is then used to retrieve the raw pointer held by the scoped_ptr object, which is stored in the raw_ptr variable. Finally, the foo method is called again through the raw pointer.
The cpp boost scoped_ptr library is part of the Boost C++ Libraries, a set of free, peer-reviewed, cross-platform libraries for the C++ programming language.
C++ (Cpp) scoped_ptr::get - 30 examples found. These are the top rated real world C++ (Cpp) examples of boost::scoped_ptr::get extracted from open source projects. You can rate examples to help us improve the quality of examples.