I seem to remember phobos has an interval type so you can specify: Interval!("(]", 0, 10) myvalue; Interval!("(0,10]") myvalue; // or perhaps like this.. and get enforce(value > 0 && value <= 10); added automatically. I'm unable to find it though.. Is my memory playing tricks on me?