mirror of
https://github.com/boostorg/python.git
synced 2026-01-21 17:12:22 +00:00
Move repr into int_wrapper, remove some unneeded header includes
[SVN r20391]
This commit is contained in:
@@ -19,11 +19,6 @@
|
||||
|
||||
#include <boost/python/suite/indexing/container_suite.hpp>
|
||||
#include <boost/python/suite/indexing/iterator_pair.hpp>
|
||||
#include <boost/python/suite/indexing/container_proxy.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
#include <boost/python/class.hpp>
|
||||
#include <boost/python/module.hpp>
|
||||
#include <boost/python/def.hpp>
|
||||
@@ -54,13 +49,6 @@ boost::python::indexing::iterator_pair<int_wrapper *> get_array_wrap()
|
||||
, boost::python::indexing::end(array));
|
||||
}
|
||||
|
||||
std::string repr (int_wrapper const &i)
|
||||
{
|
||||
std::stringstream temp;
|
||||
temp << i;
|
||||
return temp.str();
|
||||
}
|
||||
|
||||
BOOST_PYTHON_MODULE(test_array_ext)
|
||||
{
|
||||
boost::python::implicitly_convertible <int, int_wrapper>();
|
||||
@@ -69,7 +57,7 @@ BOOST_PYTHON_MODULE(test_array_ext)
|
||||
|
||||
boost::python::class_<int_wrapper>("int_wrapper", boost::python::init<int>())
|
||||
.def ("increment", &int_wrapper::increment)
|
||||
.def ("__repr__", repr)
|
||||
.def ("__repr__", &int_wrapper::repr)
|
||||
.def ("__cmp__", compare)
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user