Bug 18183 – std.variant should be usable in @safe

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2018-01-03T04:35:28Z
Last change time
2024-12-01T16:31:46Z
Assigned to
No Owner
Creator
Seb
Blocks
18110
Moved to GitHub: phobos#9732 →

Comments

Comment #0 by greensunny12 — 2018-01-03T04:35:28Z
Comment #1 by schveiguy — 2019-10-28T22:23:01Z
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 by robert.schadek — 2024-12-01T16:31:46Z
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