[C++-sig] [Py++] free operators

Roman Yakovenko roman.yakovenko at gmail.com
Wed Mar 25 13:59:12 CET 2009


2009/3/25 Michał Nowotka <mmmnow at gmail.com>:
> Hello,
> I want to expose to python following code:
>
> typedef std::map<const Haplotype*,double> ProbHaplotype;
>
> typedef std::map<const Fenotype*,double> ProbFenotype;
>
> typedef std::map<const Genotype*,double> ProbGenotype;
>
> (...)
>
> std::ostream& operator<<(std::ostream& os, const ProbHaplotype& hapl);
>
> std::ostream& operator<<(std::ostream& os, const ProbFenotype& fen);
>
> std::ostream& operator<<(std::ostream& os, const ProbGenotype& gen);
>
> but I get some warnings:
>
> WARNING: extern std::ostream & hapl::operator<<(std::ostream & os,
> hapl::ProbGenotype const & gen) [free operator]
>> warning W1052: Py++ will not expose free operator "extern std::ostream & hapl::operator<<(std::ostream & os, hapl::ProbGenotype const & gen) [free
>> operator]" - all classes, this operator works on, are excluded.
>
> WARNING: extern std::ostream & hapl::operator<<(std::ostream & os,
> hapl::ProbFenotype const & fen) [free operator]
>> warning W1052: Py++ will not expose free operator "extern std::ostream & hapl::operator<<(std::ostream & os, hapl::ProbFenotype const & fen) [free
>> operator]" - all classes, this operator works on, are excluded.
>
> WARNING: extern std::ostream & hapl::operator<<(std::ostream & os,
> hapl::ProbHaplotype const & hapl) [free operator]
>> warning W1052: Py++ will not expose free operator "extern std::ostream & hapl::operator<<(std::ostream & os, hapl::ProbHaplotype const & hapl) [free
>> operator]" - all classes, this operator works on, are excluded.
>
> How can I get rid of it?

If you use SVN version, than you can "include" the classes.

HTH

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/


More information about the Cplusplus-sig mailing list