2
0
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:
Raoul Gough
2003-10-15 16:18:55 +00:00
parent 3847f1d455
commit 43e1dc9d5b
5 changed files with 5 additions and 65 deletions

View File

@@ -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)
;