[C++-sig] Pyste bug: UniqueInt<> doesn't appear in all modules when using --multiple
Nicodemus
nicodemus at globalite.com.br
Mon Oct 6 20:57:31 CEST 2003
Niall Douglas wrote:
>-----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.
>
>
Fixed, thanks for the suggestion. 8)
Regards,
Nicodemus.
More information about the Cplusplus-sig
mailing list