Skip to content

Loading…

Made bitfields() nothrow #586

Closed
wants to merge 1 commit into from

3 participants

@wfunction

No description provided.

@klickverbot
D Programming Language member

Sorry, seems like Alex was faster on this one (see #583).

@gchatelet

We should probably close this one so.

@klickverbot
D Programming Language member

Yes, indeed, but I don't have the permissions to do so.

@wfunction

Oh lol, am I the one who's supposed to close it? (Haven't really done this before...)

@wfunction wfunction closed this
@wfunction wfunction reopened this
@wfunction wfunction closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 16, 2012
  1. Mde bitfields() methods be 'nothrow'

    Lambert committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 std/bitmanip.d
View
8 std/bitmanip.d
@@ -80,17 +80,17 @@ private template createAccessors(
static assert(len == 1);
enum result =
// getter
- "@property bool " ~ name ~ "() const { return "
+ "@property bool " ~ name ~ "() const nothrow { return "
~"("~store~" & "~myToString(maskAllElse)~") != 0;}\n"
// setter
- ~"@property void " ~ name ~ "(bool v){"
+ ~"@property void " ~ name ~ "(bool v) nothrow {"
~"if (v) "~store~" |= "~myToString(maskAllElse)~";"
~"else "~store~" &= ~"~myToString(maskAllElse)~";}\n";
}
else
{
// getter
- enum result = "@property "~T.stringof~" "~name~"() const { auto result = "
+ enum result = "@property "~T.stringof~" "~name~"() const nothrow { auto result = "
"("~store~" & "
~ myToString(maskAllElse) ~ ") >>"
~ myToString(offset) ~ ";"
@@ -100,7 +100,7 @@ private template createAccessors(
: "")
~ " return cast("~T.stringof~") result;}\n"
// setter
- ~"@property void "~name~"("~T.stringof~" v){ "
+ ~"@property void "~name~"("~T.stringof~" v) nothrow { "
~"assert(v >= "~name~"_min); "
~"assert(v <= "~name~"_max); "
~store~" = cast(typeof("~store~"))"
Something went wrong with that request. Please try again.