MCPcopy Create free account
hub / github.com/TNG/boost-python-examples / Example

Class Example

09-Overloading/overload.cpp:4–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <string>
3
4class Example {
5public:
6 Example()
7 {}
8
9 void doit() { mS = "void"; }
10 std::string doit(unsigned int i)
11 {
12 std::stringstream s;
13 s << i;
14 mS = s.str();
15 return mS;
16 }
17 void doit(std::string s) { mS = s; }
18
19 int makeIt(std::string s, int n=1, std::string t="")
20 {
21 std::stringstream u;
22 for (unsigned int i=0; i<n; ++i)
23 u << s;
24 mS = u.str() + t;
25 return n + ( t.size() > 0 ? 1 : 0 );
26 }
27
28 std::string print() const { return mS; }
29private:
30 std::string mS;
31};
32
33#include <boost/python.hpp>
34using namespace boost::python;

Callers 1

overload.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected