Skip to content
Snippets Groups Projects
Commit 96c3a090 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: provide direct access to raw pointer/reference from autoPtr (issue #252)

All of the access methods for autoPtr include validity checks and will
fail if the underlying point is NULL. In some cases, however, we'd
like to retain the automatic deletion mechanism, but still address a
nullptr. This is mostly for cases in which a file-stream should be
allocated, but only on the master process. For these cases we'd still
like to pass through and reference the underlying pointer (eg, to
obtain the correct method call) without tripping the pointer check
mechanism. If we attempt to use the ptr() method, the autoPtr memory
management is bypassed and we risk memory leaks.

Instead provide an alternative mechanism to obtain the raw underlying
pointers/references. Use rawPtr() and rawRef() for these potentially
useful, but also potentially dangerous, operations.
parent 598da1ac
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment