Skip to content

Commit

Permalink
Merge pull request #3708 from kinke/variant
Browse files Browse the repository at this point in the history
std.variant: don't assert that target address != null if type size is 0
  • Loading branch information
CyberShadow committed Oct 18, 2015
2 parents 6ee65f4 + 4e1b8dc commit ca01aee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions std/variant.d
Expand Up @@ -303,7 +303,8 @@ private:
auto zat = cast(T*) target;
if (src)
{
assert(target, "target must be non-null");
static if (T.sizeof > 0)
assert(target, "target must be non-null");
*zat = *src;
}
}
Expand All @@ -315,7 +316,8 @@ private:
auto zat = cast(U*) target;
if (src)
{
assert(target, "target must be non-null");
static if (U.sizeof > 0)
assert(target, "target must be non-null");
*zat = *(cast(UA*) (src));
}
}
Expand Down

0 comments on commit ca01aee

Please sign in to comment.