Skip to content

Commit

Permalink
fix Issue 10916 - toHash on VariantN not being recognised
Browse files Browse the repository at this point in the history
Make VariantN.toHash() const nothrow @safe. Assume that `VariantN.type` property is @safe nothrow.
  • Loading branch information
9rnsr committed Jul 4, 2014
1 parent f518343 commit 6ba09e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions std/variant.d
Expand Up @@ -674,8 +674,10 @@ public:
* Returns the $(D_PARAM typeid) of the currently held value.
*/

@property TypeInfo type() const
@property TypeInfo type() const nothrow @trusted
{
scope(failure) assert(0);

TypeInfo result;
fptr(OpID.getTypeInfo, null, &result);
return result;
Expand Down Expand Up @@ -872,7 +874,7 @@ public:
* Computes the hash of the held value.
*/

size_t toHash()
size_t toHash() const nothrow @safe
{
return type.getHash(&store);
}
Expand Down

0 comments on commit 6ba09e0

Please sign in to comment.