On Sunday, 24 June 2012 at 13:16:53 UTC, simendsjo wrote:
import std.exception;
import std.traits;
struct Ranged(T, T min, T max) {
T _value = min;
typeof(this) opAssign(V : T)(V value) {
enforce(value >= min);
enforce(value <= max);
_value = value;
return
On Sunday, 24 June 2012 at 13:16:53 UTC, simendsjo wrote:
import std.exception;
import std.traits;
struct Ranged(T, T min, T max) {
T _value = min;
typeof(this) opAssign(V : T)(V value) {
enforce(value >= min);
enforce(value <= max);
_value = value;
return
import std.exception;
import std.traits;
struct Ranged(T, T min, T max) {
T _value = min;
typeof(this) opAssign(V : T)(V value) {
enforce(value >= min);
enforce(value <= max);
_value = value;
return this;
}
alias _value this;
}
void f(int i) {