Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Made bitfields() nothrow #586

Closed
wants to merge 1 commit into from

3 participants

@niknami

No description provided.

@klickverbot
Collaborator

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

@gchatelet

We should probably close this one so.

@klickverbot
Collaborator

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

@niknami

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

@niknami niknami closed this
@niknami niknami reopened this
@niknami niknami 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 authored
This page is out of date. Refresh to see the latest.
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.