[C++-sig] Re: Pyste bug with unnamed enums

Roman Yakovenko roman.yakovenko at actimize.com
Thu Feb 19 08:17:56 CET 2004



> -----Original Message-----
> From: Niall Douglas [mailto:s_sourceforge at nedprod.com]
> Sent: Wednesday, February 18, 2004 8:32 PM
> To: David Abrahams
> Cc: c++-sig at python.org
> Subject: Re: [C++-sig] Re: Pyste bug with unnamed enums
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 17 Feb 2004 at 11:38, David Abrahams wrote:
> 
> > Name them.  If you can't name them, you can't export them.  
> You can't
> > even pass them through a function template:
> 
> Actually you can.
> 
> > I don't really know what UniqueInt is supposed to do, but I 
> don't love
> > it because it's not unique ;-)
> > 
> >  enum { x = 1 }
> >  enum { y = 1 }
> > 
> >  BOOST_STATIC_ASSERT((boost::is_same<UniqueInt<x>,UniqueInt<y>
> >  >::value));
> 
> No, pyste here produces:
> 
> enum_< UniqueInt<incrementing number> >("unnamed")
>         .value("x", x)
>         .value("y", y)
>         ;
> 
> At least, it would if AllFromHeader() were fixed. The UniqueInt 
> merely converts a number to a unique strawman type to keep BPL happy. 
> If you know of a way to always generate a random type with guaranteed 
> no collisions, we'd be very interested.

The one possible solution is generating UniqueInt + GUID
I think



> Cheers,
> Niall
> 
> 
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2
> 
> iQA/AwUBQDOvtsEcvDLFGKbPEQJKQQCfSy0DSdqWhXbXCycY1LW4JpG/WlYAn2pQ
> S5sxmWv3CmJXAtGrl15J3u63
> =ojUI
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 




More information about the Cplusplus-sig mailing list