mirror of
https://github.com/dlang/phobos.git
synced 2025-05-03 08:30:33 +03:00
Merge pull request #598 from alexrp/variant-attributes
@trusted pure nothrow const in some parts of std.variant.
This commit is contained in:
commit
ae7c91bfab
1 changed files with 4 additions and 2 deletions
|
@ -71,6 +71,8 @@ import std.traits, std.c.string, std.typetuple, std.conv, std.exception;
|
|||
import std.exception, std.stdio;
|
||||
//}
|
||||
|
||||
@trusted:
|
||||
|
||||
private template maxSize(T...)
|
||||
{
|
||||
static if (T.length == 1)
|
||||
|
@ -560,7 +562,7 @@ public:
|
|||
* ----
|
||||
*/
|
||||
|
||||
@property bool hasValue() const
|
||||
@property bool hasValue() const pure nothrow
|
||||
{
|
||||
// @@@BUG@@@ in compiler, the cast shouldn't be needed
|
||||
return cast(typeof(&handler!(void))) fptr != &handler!(void);
|
||||
|
@ -608,7 +610,7 @@ public:
|
|||
* $(LINK2 std_traits.html#ImplicitConversionTargets,ImplicitConversionTargets).
|
||||
*/
|
||||
|
||||
@property bool convertsTo(T)()
|
||||
@property bool convertsTo(T)() const
|
||||
{
|
||||
TypeInfo info = typeid(T);
|
||||
return fptr(OpID.testConversion, null, &info) == 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue