Re: [pygccxml-development] type_traits problem
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-12 10:25:09
|
On 5/12/06, Allen Bierbaum <al...@vr...> wrote: > I just ran into an annoyance that I had seen before bug forgot to post. > > I am checking a return_type from a method to see if it is a const > reference and the type traits are not working well. > > The problem is that is_const and is_reference only check the most > external portion of a composed type. So if you want to check if > something is really a const ref you have do write code something like > this (please correct me if I am wrong). > > ret_type =3D method.return_type > is_ref =3D True in map(declarations.is_reference, > declarations.decompose_type(ret_type)) > is_const =3D True in map(declarations.is_const, > declarations.decompose_type(ret_type)) > is_const_ref =3D (is_ref and not is_const) > > Boost type traits and other libraries like it automatically do the > decomposition so you could check a const reference type and it will > return true to both is_reference and is_const. > > Is there any reason that we shouldn't make pygccxml work similarly? Yes. I did not have test case for this. If you can send me test case I will= make sure it works as expected. > -Allen > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job ea= sier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > pygccxml-development mailing list > pyg...@li... > https://lists.sourceforge.net/lists/listinfo/pygccxml-development > --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |