Program Listing for File constant.hpp

Return to documentation for file (include/pinocchio/bindings/python/utils/constant.hpp)

//
// Copyright (c) 2018 CNRS
//

#ifndef __pinocchio_python_utils_constant_hpp__
#define __pinocchio_python_utils_constant_hpp__

#include <boost/python/scope.hpp>

namespace boost
{
  namespace python
  {

    template<typename T>
    void def_constant(const char * name, const T & value)
    {
      namespace bp = boost::python;
      bp::scope().attr(name) = value;
    }

  } // namespace python
} // namespace boost

#endif // ifndef __pinocchio_python_utils_constant_hpp__