Thread: [pygccxml-development] Boolean operator == with std::vector
Brought to you by:
mbaas,
roman_yakovenko
From: Romain C. <rom...@gm...> - 2009-12-06 14:23:24
|
Hi, I am using Py++ to generate the bindings for a C++ class using a vector of objects (i.e std::vector<MyObject>) I got this error: "the next line of code will not compile, because "::MyObject" does not have operator== !" Could anyone tell me why I need to define this boolean operator? Cheers, Romain |
From: Roman Y. <rom...@gm...> - 2009-12-06 14:34:57
|
On Sun, Dec 6, 2009 at 4:23 PM, Romain CHANU <rom...@gm...> wrote: > Hi, > I am using Py++ to generate the bindings for a C++ class using a vector of > objects (i.e std::vector<MyObject>) > I got this error: > "the next line of code will not compile, because "::MyObject" does not have > operator== !" > Could anyone tell me why I need to define this boolean operator? Do you use indexing suite, that comes with boost? If so, you need this operator for "contains", "index" and other functionality. You can switch to indexing suite v2 and than you will not have to define the operator. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Romain C. <rom...@gm...> - 2009-12-06 15:31:34
|
Oh ok. Thank you for this hint. However, I changed to indexing suite version 2 and I got the following lines at the beginning of the generated files: // This file has been generated by Py++. #include "boost/python.hpp" #include "boost/python/suite/indexing/value_traits.hpp" #include "boost/python/suite/indexing/container_suite.hpp" #include "boost/python/suite/indexing/vector.hpp" "value_traits.hpp" is not part of the Boost Python library and should be provided by Py++ (cf. http://www.language-binding.net/pyplusplus/documentation/containers.html#indexing-suite-version-2-installation ). Did I miss something?? 2009/12/6 Roman Yakovenko <rom...@gm...> > On Sun, Dec 6, 2009 at 4:23 PM, Romain CHANU <rom...@gm...> > wrote: > > Hi, > > I am using Py++ to generate the bindings for a C++ class using a vector > of > > objects (i.e std::vector<MyObject>) > > I got this error: > > "the next line of code will not compile, because "::MyObject" does not > have > > operator== !" > > Could anyone tell me why I need to define this boolean operator? > > Do you use indexing suite, that comes with boost? If so, you need this > operator for "contains", "index" and other functionality. > You can switch to indexing suite v2 and than you will not have to > define the operator. > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > |
From: Roman Y. <rom...@gm...> - 2009-12-06 15:46:32
|
On Sun, Dec 6, 2009 at 5:31 PM, Romain CHANU <rom...@gm...> wrote: > Oh ok. Thank you for this hint. > However, I changed to indexing suite version 2 and I got the following lines > at the beginning of the generated files: > // This file has been generated by Py++. > #include "boost/python.hpp" > #include "boost/python/suite/indexing/value_traits.hpp" > #include "boost/python/suite/indexing/container_suite.hpp" > #include "boost/python/suite/indexing/vector.hpp" > > "value_traits.hpp" is not part of the Boost Python library and should be > provided by Py++ > (cf. http://www.language-binding.net/pyplusplus/documentation/containers.html#indexing-suite-version-2-installation). > Did I miss something?? I don't understand you. Anyway I suggest you to try to use SVN version, as it doesn't require boost directory modification. HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Romain C. <rom...@gm...> - 2009-12-07 01:30:07
|
I was using the version 1.0.0 from SourceForge. Why the version 1.1 is not on SourceForge? (cf. http://sourceforge.net/projects/pygccxml/files/) I will get the SVN version and try again. Thank you! Romain 2009/12/6 Roman Yakovenko <rom...@gm...> > On Sun, Dec 6, 2009 at 5:31 PM, Romain CHANU <rom...@gm...> > wrote: > > Oh ok. Thank you for this hint. > > However, I changed to indexing suite version 2 and I got the following > lines > > at the beginning of the generated files: > > // This file has been generated by Py++. > > #include "boost/python.hpp" > > #include "boost/python/suite/indexing/value_traits.hpp" > > #include "boost/python/suite/indexing/container_suite.hpp" > > #include "boost/python/suite/indexing/vector.hpp" > > > > "value_traits.hpp" is not part of the Boost Python library and should be > > provided by Py++ > > (cf. > http://www.language-binding.net/pyplusplus/documentation/containers.html#indexing-suite-version-2-installation > ). > > Did I miss something?? > > I don't understand you. Anyway I suggest you to try to use SVN > version, as it doesn't require boost directory modification. > > HTH > > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > |