boost/python/to_python_value.hpp

クラス

to_python_value クラステンプレート

template<class T>
struct to_python_value

to_python_value は、引数を新しい Python オブジェクトにコピーする ResultConverter モデルである。

to_python_value クラステンプレートの概要1

namespace boost { namespace python
{
   template <class T>
   struct to_python_value
   {
      typedef typename add_reference<
         typename add_const<T>::type
      >::type argument_type;

      static bool convertible();
      PyObject* operator()(argument_type) const;
   };
}}

to_python_value クラステンプレートのオブザーバ関数

static bool convertible()
戻り値

T から Python へ値による変換が可能な変換器が登録されていれば true

PyObject *operator()(argument_type x) const
要件

convertible() == true

効果

x を Python に変換する。

戻り値

T の変換器が登録されていれば、その結果の Python オブジェクト。それ以外の場合は 0

1

訳注 boost::add_constboost::add_reference