Unification and extension of compile-time reflection
Nick Sabalausky
a at a.a
Tue Nov 25 14:21:38 PST 2008
"Bill Baxter" <wbaxter at gmail.com> wrote in message
news:mailman.57.1227650204.22690.digitalmars-d at puremagic.com...
> On Tue, Nov 25, 2008 at 10:42 PM, Steven Schveighoffer
> <schveiguy at yahoo.com> wrote:
>> There is also one other benefit to min and max (and others) being first
>> class properties. You can mimic their behavior in user-defined types.
>> For
>> example, if int.min is changed to traits(min, int) or even
>> int.traits.min,
>> then how do I define a similar 'minimum' for say, a time type, which
>> would
>> be totally arbitrary.
>
> Agreed. Clearly we need a way to define custom traits info, too. It
> could be done using some kind of traits{...} block in a class, that
> contains only functions and members safe for compile use.
>
[min=4, serializable]
class Foo {...}
More information about the Digitalmars-d
mailing list