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

Niall Douglas s_sourceforge at nedprod.com
Wed Feb 18 19:32:22 CET 2004


-----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.

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-----




More information about the Cplusplus-sig mailing list