The following is a snippet from Boost.Python source code :
template <class T> struct null_ok;
template <class T>
inline null_ok<T>* allow_null(T* p)
{
return (null_ok<T>*)p;
}
He combined that there is no definition for the declared struct null_ok, but null_okhas nothing to do with the template argument T.
In the Python wiki, some tips:
handle <> y (null_ok (x)) allows y to become NULL
handle <> y (x) , where x is not the result of null_ok, never yields NULL y. An exception will be thrown if x is NULL
I can’t understand how a declaration (without a definition) of a structure template null_okcould achieve the goal mentioned above?