[C++-sig] Pyste bug: UniqueInt<> doesn't appear in all modules when using --multiple

Niall Douglas s_sourceforge at nedprod.com
Fri Oct 3 20:14:45 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Can I suggest you simply always insert the following code instead:

            write('// Unique type for unnamed enums\n')
            write('#ifndef UNIQUEINTDEFINED')
            write('#define UNIQUEINTDEFINED')
            write('template<int num>\n')
            write('struct UniqueInt {\n')
            write('   int v;\n')
            write('   enum { value=num };\n')
            write('   UniqueInt(int v_):\n') 
            write('       v(v_)\n')
            write('   {}\n')
            write('   operator int() const\n')
            write('   { return v; }\n')
            write('};\n')
            write('#endif')

Problem solved.

Cheers,
Niall





-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2

iQA/AwUBP328lsEcvDLFGKbPEQIm6wCeNpfr3DhPUDxtoBjZz+AGTaLl6XwAoLk1
oW0GlgHo1g0EzElW4qkThlYI
=42Q6
-----END PGP SIGNATURE-----




More information about the Cplusplus-sig mailing list