On Tue, 12 Oct 2010 05:45:09 +0400, Philippe Sigaud <philippe.sig...@gmail.com> wrote:

2010/10/12 Denis Koroskin <2kor...@gmail.com>:

That could be as simple as:

struct Bounded(A min, A max, T = A) { ... }

Bounded!(0, 1) zeroOrOne; // 4 bytes because of default int
Bounded!(0, 1, ubyte) zeroOrOne;  // 1 byte, specified explicitly

Neat, this is exactly what I had in mind.
What's the default type for FP values? double?

auto f = 0.0f; // float
auto d = 0.0;  // double

Reply via email to