Replace following names:
std.typetuple -> std.meta
TypeTuple -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple -> Fields
std.traits requires more work than search/replace and is left unchanged.
A unittest triggers in line 1918 when testing Variant!(void[0]) with LDC
(current merge-2.068 branch).
When taking the address of a truly empty type, such as T[0], LDC always
returns a null constant; nothing is allocated on the stack.
Disabling this assert in case the target type's size is 0 should be safe,
there's no private state which could be modified by the following
assignment (it may still have side effects though) - right? ;)
Assuming that Foo.depth and Bar.depth are both const (e.g. both are just int
members), the following should compile:
-----
int depth(in FooBar fb) {
return fb.visit!((Foo foo) => foo.depth,
(Bar bar) => bar.depth);
}
-----
However, it was failing with:
std/variant.d(2246): Error: cannot implicitly convert expression (variant.peek())
of type const(Foo)* to Foo*
std/variant.d(2246): Error: cannot implicitly convert expression (variant.peek())
of type const(Bar)* to Bar*
This patch changes an explicit `T*` declaration to an `auto` declaration so
const types can be visited.
variant hat some code disabled due to compiler bugs.
Some of these bugs have been fixed.
This re-enables this dead code.
removed some old code
bug remove reverse
Allows a VariantN to be assigned from another VariantN that is a strict
subset. Implements an opAssign overload that specializes on VariantN
instantations that are not the current VariantN but whose AllowedTypes
are a subset of the current variant's.
Added accompanying unittest.
Fix Issue 14457
In pull#2453, VariantN.opIndex has been changed to return `Variant`.
It affects to OpID.catAssign case in handler(A), because it's using `alias E = typeof((*zis)[0]);` to determine concatenated element type.