digitalmars.D.bugs - [Issue 15670] New: std.variant.Variant does not allow classes
- via Digitalmars-d-bugs (27/27) Feb 10 2016 https://issues.dlang.org/show_bug.cgi?id=15670
https://issues.dlang.org/show_bug.cgi?id=15670 Issue ID: 15670 Summary: std.variant.Variant does not allow classes derived from templated classes Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: petar.p.kirov gmail.com The following code does not compile: void main() { import std.variant; class BaseTemplate(T) { this() {} } class Concrete : BaseTemplate!int { this() {} } Algebraic!(Concrete) holder; Concrete a = new Concrete(); holder = Algebraic!Concrete(a); } Error: static assert "Cannot store a Concrete in a VariantN!(8LU, Concrete)" test.d(10): instantiated from here: __ctor!(Concrete) --
Feb 10 2016