Quantcast

[C++-sig] boost, const and problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[C++-sig] boost, const and problems

anewtroll

    Hi !

       As a newbie to boost.python, I would like to know why the "const"
argument (i.e. void function(const float t){ ... }) causes an error when
using the bjam (VC++6)

------------------------------------------------------------
C:\test_09_net>bjam -sTOOLS=msvc
...found 1598 targets...
...updating 4 targets...
vc-C++ bin\test_09_net\nlib.pyd\msvc\debug\threading-multi\nlib.obj
nlib.cpp
C:\boost_1_33_0\boost/python/class.hpp(543) : error C2665:
'get_signature' : none of the 4 overloads can convert parameter 1 from
type 'bool (__thiscall ncell::*)(const float,const class ntype &)'
C:\boost_1_33_0\boost/python/class.hpp(237) : see reference to function
template instantiation 'void __cdecl boost::python::class_<class
ncell,struct boost::python::detail::not_specified,struct
boost::python::detail::not_specified,struct
boost::python::detail::not_specified>::def_impl(class ncell *,const char
*,bool (__thiscall ncell::*)(const float,const class ntype &),const
struct boost::python::detail::def_helper<char const *,struct
boost::python::detail::not_specified,struct
boost::python::detail::not_specified,struct
boost::python::detail::not_specified> &,...)' being compiled
C:\boost_1_33_0\boost/python/class.hpp(544) : error C2780: 'class
boost::python::api::object __cdecl boost::python::make_function(F,const
CallPolicies &,const KeywordsOrSignature &)' : expects 3 arguments - 4
provided

[...]

...skipped <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.CMD
for lack of <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.obj...
...skipped <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.pyd
for lack of <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.CMD...
...skipped <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.lib
for lack of <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.CMD...
...failed updating 1 target...
...skipped 3 targets...
------------------------------------------------------------

       Whereas when const is omitted no problem occurs.

       I also would like to know how to modify the C++ compilation
parameters when calling the bjam command (where is the bjam config file
?). Thanks a lot !

          ANT.
_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++-sig] boost, const and problems

Eric Jardim
2005/9/9, anewtroll <[hidden email]>:
    Hi !
       As a newbie to boost.python, I would like to know why the "const"
argument (i.e. void function(const float t){ ... }) causes an error when
using the bjam (VC++6)

Could you show some of the code you exposed and the class?

Or even better, can you reduce your problem to a single class with a single method and reproduce the error?
 
It would help.

[Eric Jardim]

_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++-sig] boost, const and problems

Ralf W. Grosse-Kunstleve
> 2005/9/9, anewtroll <[hidden email]>:
> >
> > Hi !
> > As a newbie to boost.python, I would like to know why the "const"
> > argument (i.e. void function(const float t){ ... }) causes an error when
> > using the bjam (VC++6)

IIRC, this is a general VC6 bug; "const float" or similar doesn't work with
that compiler.
Ralf


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++-sig] boost, const and problems

David Abrahams
"Ralf W. Grosse-Kunstleve" <[hidden email]> writes:

>> 2005/9/9, anewtroll <[hidden email]>:
>> >
>> > Hi !
>> > As a newbie to boost.python, I would like to know why the "const"
>> > argument (i.e. void function(const float t){ ... }) causes an error when
>> > using the bjam (VC++6)
>
> IIRC, this is a general VC6 bug; "const float" or similar doesn't work with
> that compiler.
> Ralf

Just remove it from the function declaration; it has no effect there
anyway other than to mess up Boost.Python.  You can leave the const on
the function definition.

--
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Loading...