mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
fix for obviously broken class Rational example
[SVN r27457]
This commit is contained in:
@@ -661,13 +661,13 @@ similar set of intuitive interfaces can also be used to wrap C++ functions
|
||||
that correspond to these Python ['special functions]. Example:
|
||||
|
||||
class Rational
|
||||
{ operator double() const; };
|
||||
{ public: operator double() const; };
|
||||
|
||||
Rational pow(Rational, Rational);
|
||||
Rational abs(Rational);
|
||||
ostream& operator<<(ostream&,Rational);
|
||||
|
||||
class_<Rational>()
|
||||
class_<Rational>("Rational")
|
||||
.def(float_(self)) // __float__
|
||||
.def(pow(self, other<Rational>)) // __pow__
|
||||
.def(abs(self)) // __abs__
|
||||
|
||||
Reference in New Issue
Block a user