[C++-sig] Problem with identifying polymorphic types on Mac OS

J. Michael Owen mikeowen at llnl.gov
Thu Dec 15 02:05:14 CET 2005


Hi Ralf,

Sadly the type I'm exposing is the std::pair, so I can't just modify  
its source in this way.  I'm going to have to work around this problem  
by altering my code to not use std::pair<double, string>.  It turns out  
that std::pair<string, double> works without a problem.  ??

I notice your compiler guards only screen out Apple's gcc 3.3 version  
-- does that mean that the newer gcc you can get with OS X 10.4 does  
not have this issue?

Thanks Ralf!

Mike.

> Hi Mike,
>
> It is a bogus error message I have been struggling with for some time.  
> Here is
> one of my typical workarounds:
>
> class something
> {
>   // lots of code...
>     private:
> #if defined(__APPLE__) && defined(__MACH__) \
>  && defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3
>       bool dummy_;
> #endif
>       uctbx::unit_cell unit_cell_;
>       fractional<> original_site_;
>       const wyckoff::position* position_;
>       rt_mx sym_op_;
> };
>
> I.e. simply adding a dummy bool as a member is typically enough to  
> make the
> compiler happy. I've not been able to figure out what exactly causes  
> the bogus
> error message. If anyone knows I'd be glad to learn about it.
>
> Cheers,
>         Ralf


  "Hey...where are the sunflower seeds?" |       J. Michael Owen
         o_o /                           |
         (")                             |
        \/'\/                            |
____(__(,_,)____________________________________________________________ 
___
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1617 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20051214/352ffdd8/attachment.bin>


More information about the Cplusplus-sig mailing list