mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 06:42:27 +00:00
Move repr into int_wrapper, remove some unneeded header includes
[SVN r20391]
This commit is contained in:
@@ -20,13 +20,8 @@
|
||||
#include "int_wrapper.hpp"
|
||||
|
||||
#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 <vector>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
#include <boost/python/class.hpp>
|
||||
#include <boost/python/module.hpp>
|
||||
#include <boost/python/def.hpp>
|
||||
@@ -36,13 +31,6 @@
|
||||
bool int_wrapper::our_trace_flag = true;
|
||||
unsigned int_wrapper::our_object_counter = 0;
|
||||
|
||||
std::string repr (int_wrapper const &i)
|
||||
{
|
||||
std::stringstream temp;
|
||||
temp << i;
|
||||
return temp.str();
|
||||
}
|
||||
|
||||
BOOST_PYTHON_MODULE(test_vector_ext)
|
||||
{
|
||||
boost::python::implicitly_convertible <int, int_wrapper>();
|
||||
@@ -51,7 +39,7 @@ BOOST_PYTHON_MODULE(test_vector_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