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

Class NumberLike

07-Operators/operators.cpp:4–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <string>
3
4class NumberLike
5{
6public:
7 NumberLike(int n = 0) : mN(n) {}
8 NumberLike& operator+= (int i)
9 {
10 mN += i;
11 return *this;
12 }
13 std::string str() const
14 {
15 std::stringstream s;
16 s << mN;
17 return s.str();
18 }
19 std::string repr() const
20 {
21 std::stringstream s;
22 s << "NumberLike("<< mN << ")";
23 return s.str();
24 }
25private:
26 int mN;
27};
28
29NumberLike operator+(NumberLike n, int i)
30{

Callers 1

operators.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected