2 ms·
No. If D had unlimited access to C code at CTFE then maybe you could implement refinement types at compile time as a library but for now you are stuck with wha
by mhh__ 5y ago
No.
If D had unlimited access to C code at CTFE then maybe you could implement refinement types at compile time as a library but for now you are stuck with what Walter has posted. I implemented a sketch of the API for this ages ago but the actual type checking had to be done at module load time because was of aforementioned (justified) restrictions to CTFE
Dependant types are a whole other monster.