Skip to content
Snippets Groups Projects
Commit 2fe506b5 authored by Oliver Sander's avatar Oliver Sander
Browse files

implement get()

[[Imported from SVN: r5749]]
parent 632e0507
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,11 @@ namespace Dune
/** \brief Dereference as const pointer */
inline const element_type* operator->() const;
/** \brief Access to the raw pointer, if you really want it */
element_type* get() const {
return rep_->rep_;
}
/** \brief Decrease the reference count by one and free the memory if the
reference count has reached 0
*/
......
......@@ -38,6 +38,10 @@ int main(){
assert(bar);
assert(bar.use_count()==1);
// test get()
double* barPtr = bar.get();
assert(barPtr);
// test constructor from a given pointer
shared_ptr<double> b(new double(42.0));
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment