Add check to ensure serialization code only added when underlying value can be serialized.
This commit is contained in:
parent
416e0b220f
commit
8abb3a2c42
|
|
@ -88,6 +88,9 @@ struct Optional(T) {
|
||||||
version (Have_asdf) {
|
version (Have_asdf) {
|
||||||
import asdf;
|
import asdf;
|
||||||
|
|
||||||
|
static if (
|
||||||
|
__traits(compiles, deserialize!T(Asdf.init))
|
||||||
|
) {
|
||||||
/**
|
/**
|
||||||
* Deserializes an optional value from raw ASDF data. This function
|
* Deserializes an optional value from raw ASDF data. This function
|
||||||
* is defined to allow for automatic deserialization of Optionals when
|
* is defined to allow for automatic deserialization of Optionals when
|
||||||
|
|
@ -122,6 +125,7 @@ struct Optional(T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps the value of a given optional to another type using a given function.
|
* Maps the value of a given optional to another type using a given function.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue