Unification and extension of compile-time reflection

Bill Baxter wbaxter at gmail.com
Tue Nov 25 13:56:41 PST 2008


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.

--bb



More information about the Digitalmars-d mailing list