MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / checked_get

Method checked_get

inst/include/Rcpp/XPtr.h:146–151  ·  view source on GitHub ↗

* Access underlying pointer throwing an exception if the ptr is NULL */

Source from the content-addressed store, hash-verified

144 * Access underlying pointer throwing an exception if the ptr is NULL
145 */
146 inline T* checked_get() const {
147 T* ptr = get();
148 if (ptr == NULL)
149 throw ::Rcpp::exception("external pointer is not valid"); // #nocov
150 return ptr;
151 }
152
153 /**
154 * Returns a reference to the object wrapped. This allows this

Callers

nothing calls this directly

Calls 2

getFunction · 0.85
exceptionClass · 0.85

Tested by

no test coverage detected