Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Util::NullCheckDereferencer< ArgType, ResType > Struct Template Reference

An unary functor for the dereferenciation of pointers with null pointer checking. More...

#include <Dereferencer.hpp>

Public Types

typedef ResType result_type
 

Public Member Functions

ResType operator() (const ArgType &ptr) const
 Returns a reference to or copy of the pointed-to argument object. More...
 

Detailed Description

template<typename ArgType, typename ResType>
struct CDPL::Util::NullCheckDereferencer< ArgType, ResType >

An unary functor for the dereferenciation of pointers with null pointer checking.

Template Parameters
ArgTypeThe pointer type.
ResTypeThe type of the pointer dereferenciation result.
Note
The type resulting from dereferencing ArgType must be convertible to ResType. If ResType is a not a reference, a copy of the pointed-to object will be returned.

Member Typedef Documentation

◆ result_type

template<typename ArgType , typename ResType >
typedef ResType CDPL::Util::NullCheckDereferencer< ArgType, ResType >::result_type

Member Function Documentation

◆ operator()()

template<typename ArgType , typename ResType >
ResType CDPL::Util::NullCheckDereferencer< ArgType, ResType >::operator() ( const ArgType &  ptr) const

Returns a reference to or copy of the pointed-to argument object.

Parameters
ptrA pointer of type ArgType to an object.
Returns
A copy of or reference to the object.
Exceptions
Base::NullPointerExceptionif ptr is null.

The documentation for this struct was generated from the following file: