std_pair.cpp
Go to the documentation of this file.
1 
4 #include <eigenpy/eigenpy.hpp>
5 #include <eigenpy/std-pair.hpp>
6 
7 namespace bp = boost::python;
8 
9 template <typename T1, typename T2>
10 bp::tuple std_pair_to_tuple(const std::pair<T1, T2>& pair) {
11  return bp::make_tuple(pair.first, pair.second);
12 }
13 
14 template <typename T1, typename T2>
15 std::pair<T1, T2> copy(const std::pair<T1, T2>& pair) {
16  return pair;
17 }
18 
19 template <typename T1, typename T2>
20 const std::pair<T1, T2>& passthrough(const std::pair<T1, T2>& pair) {
21  return pair;
22 }
23 
26 
27  typedef std::pair<int, double> PairType;
29 
30  bp::def("std_pair_to_tuple", std_pair_to_tuple<int, double>);
31  bp::def("copy", copy<int, double>);
32  bp::def("passthrough", passthrough<int, double>,
33  bp::return_value_policy<bp::copy_const_reference>());
34 }
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(std_pair)
Definition: std_pair.cpp:24
boost::python
Definition: alignment.hpp:49
eigenpy::enableEigenPy
void EIGENPY_DLLAPI enableEigenPy()
Definition: eigenpy.cpp:43
copy
std::pair< T1, T2 > copy(const std::pair< T1, T2 > &pair)
Definition: std_pair.cpp:15
eigenpy::StdPairConverter::registration
static void registration()
Definition: std-pair.hpp:55
std-pair.hpp
eigenpy.hpp
std_pair_to_tuple
bp::tuple std_pair_to_tuple(const std::pair< T1, T2 > &pair)
Definition: std_pair.cpp:10
passthrough
const std::pair< T1, T2 > & passthrough(const std::pair< T1, T2 > &pair)
Definition: std_pair.cpp:20


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45