class TCurrency {
TCurrency();
TCurrency(long);
TCurrency(const std::string);
...
};
與Boost.Python的包裹:
class_<TCurrency>("TCurrency")
.def(init<long>)
.def(init<const std::string&>)
...
;
是否有可能創建一個顯示爲構造一個工廠方法在Python:
TCurrency TCurrency_from_Foo(const Foo&) { return TCurrency(); }
使得在python:
bar = TCurrency(foo)