mirror of https://github.com/adamdruppe/arsd.git
Make the pure round()ing function private
This commit is contained in:
parent
011abf026e
commit
d83ae00982
|
@ -20,13 +20,16 @@ module arsd.pixmappaint;
|
||||||
import arsd.color;
|
import arsd.color;
|
||||||
import arsd.core;
|
import arsd.core;
|
||||||
|
|
||||||
private float hackyRound(float f) {
|
private float roundImpl(float f) {
|
||||||
import std.math : round;
|
import std.math : round;
|
||||||
|
|
||||||
return round(f);
|
return round(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float round(float f) pure @nogc nothrow @trusted {
|
// `pure` rounding function.
|
||||||
return (cast(float function(float) pure @nogc nothrow) &hackyRound)(f);
|
// std.math.round() isn’t pure on all targets.
|
||||||
|
private float round(float f) pure @nogc nothrow @trusted {
|
||||||
|
return (castTo!(float function(float) pure @nogc nothrow)(&roundImpl))(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue