checkXPtr | R Documentation |
XPtr
's SignatureCheck the signature (i.e., arguments and return type) of the output of
cppXPtr
, which is an external pointer wrapped in an object of
class XPtr
. If the user-supplied C++ function does not match the
signature, the wrapper throws an informative error.
checkXPtr(ptr, type, args = character(), call. = TRUE)
ptr |
an object of class |
type |
the return type. |
args |
a list of argument types. |
call. |
logical, indicating if the call should become part of the error message. |
cppXPtr
# takes time to compile ptr <- cppXPtr("double foo(int a, double b) { return a + b; }") checkXPtr(ptr, "double", c("int", "double")) # returns silently try(checkXPtr(ptr, "int", c("double", "std::string"))) # throws error
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.