I settled this just using an enum value passed as template argument:

---
enum DatePart
{
    Year,
    Month,
    Day,
}

struct DatePartImpl(T : DatePart )
{
    // Insert implementation here...
}

alias DatePartImpl!(DatePart.Year)  Year;
alias DatePartImpl!(DatePart.Month) Month;
alias DatePartImpl!(DatePart.Day)   Day;

void foo( Year y, Month m, Day d ) {}

// Works correctly
foo( Year(2010), Month(8), Day(14) );

// But this isn't allowed
foo( Day(14), Year(2010), Month(8) );
---


--
Yao G.

Reply via email to