|
Boost : |
From: Xavier Warin (xavier.warin_at_[hidden])
Date: 2001-08-14 03:26:29
rwgk_at_[hidden] wrote:
> --- In boost_at_y..., Xavier Warin <xavier.warin_at_d...> wrote:
> > The only point that didn't compile was this kind of stuff.
> > class toto {
> > double get(double t) {return t :}
> > double get(double t,double u) {return u;}
> > }
>
> This is supported by Boost.Python:
> http://www.boost.org/libs/python/doc/overloading.html
>
Yes it's true but it doesn't work with KCC. I'm not an expert in programmation and i
don't know if 's a KCC bug or a non conformity of
boost ....
>
> Having said that, I always get lost with the casts.
> Here is an alternative:
>
> SgOps has a method isCentric with two overloads. To bind
> this to Python define free functions:
>
> bool SgOps_isCentric_0(const SgOps& sgo) {
> return sgo.isCentric();
> }
> bool SgOps_isCentric_1(const SgOps& sgo, const Miller::Index& H) {
> return sgo.isCentric(H);
> }
>
> Bind these to Python:
>
> py_SgOps.def(SgOps_isCentric_0, "isCentric");
> py_SgOps.def(SgOps_isCentric_1, "isCentric");
> py_SgOps.def(&SgOps::isOriginCentric, "isOriginCentric");
Yes of course, it is an obvious alternative. It 's why the problem is not a crucial
one.
Xavier
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk