Issue 18183 - std.variant should be usable in @safe
Summary: std.variant should be usable in @safe
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks: 18110
  Show dependency treegraph
 
Reported: 2018-01-03 04:35 UTC by Seb
Modified: 2024-12-01 16:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Seb 2018-01-03 04:35:28 UTC

    
Comment 1 Steven Schveighoffer 2019-10-28 22:23:01 UTC
Fully agree. Would it be reasonable to have a SafeVariant type that excludes any types which cannot run all the variant code with @safe?

I'm running into this, because I'm trying to make everything in mysql-native safe, and it uses Variant a lot.

It's going to be really hard to make Variant safe "when it needs to be", since you can't overload based on @safe, and you can't detect whether the caller is asking for a safe call in a template.
Comment 2 dlangBugzillaToGithub 2024-12-01 16:31:46 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9732

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB