AW: AW: [C++-sig] functions whose return type is a pointer

Gottfried.Ganssauge at HAUFE.DE Gottfried.Ganssauge at HAUFE.DE
Mon Jan 27 12:16:37 CET 2003



> -----Ursprüngliche Nachricht-----
> Von: David Abrahams [mailto:dave at boost-consulting.com]
> Gesendet: Freitag, 24. Januar 2003 21:05
> An: c++-sig at python.org
> Betreff: Re: AW: [C++-sig] functions whose return type is a pointer
> 
> 
> Gottfried Ganßauge <ganssauge at gmx.de> writes:
> 
> >> > I appreciate your efforts, but please don't dump reams 
> of unreadable
> >> > error messages on the other list participants!
> > You are right of course, please accept my excuse, everyone.
> >
> >> > This means serious trouble for your approach, and 
> probably also that
> >> > an architectural change in Boost.Python is called for.  
> Basically,
> >> > typeid(X) is illegal when X is a pointer type.
> >> Uhm, sorry, I meant to say "when X is an INCOMPLETE type".
> >> > 
> >> > We'll have to re-think this :(
> >> > 
> > Obviously you already solved this for msvc...
> 
> By exploiting its bug which allows typeid(T) where T is incomplete?  I
> wouldn't call that "solved" in any useful sense.
true, just couldn't resist ...

I tried a workaround for the problem by specializing the type_id function
template:
namespace boost { namespace python {
	template<>
	inline type_info type_id(boost::type<opaque_>*) {
	    return type_info (typeid (opaque_ *));
	}
	template<>
	inline type_info type_id(boost::type<const volatile opaque_ &>*) {
	    return type_info (typeid (opaque_ *));
	}
}}

This works quite well for gcc-3.2 but unfortunately I have no solution for
gcc-2.95.
That compiler chokes on a missing argument to type_id<opaque_>().
Do you have an idea how to make it work on the older gcc as well.

Cheers,

Gottfried
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030127/3bf0f7cc/attachment.htm>


More information about the Cplusplus-sig mailing list