Commit graph

202 commits

Author SHA1 Message Date
Cauterite
90e7fd0ab4 fix Issue 16383 - 'Algebraic visit does not match const' 2016-08-14 04:21:31 +10:00
Jack Stouffer
503e9f8cb3 Removed global core.stdc.string import from std.variant 2016-07-03 19:39:35 -04:00
Jack Stouffer
909c46251a Removed global std.exception import from std.variant 2016-07-03 19:37:41 -04:00
Jack Stouffer
6a79d1ea06 Removed global std.conv import from std.variant 2016-07-03 19:33:02 -04:00
Walter Bright
853496f7d2 std.variant: add attributes of test cases 2016-06-27 18:16:50 -07:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Vladimir Panteleev
38a6370788 Merge pull request #4303 from wilzbach/mref_phobos
use mref macro instead of link2
2016-05-24 03:12:08 +03:00
Hackerpilot
e702b0ec99 Fix the behavior of a unit test 2016-05-23 14:04:45 -07:00
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Jack Stouffer
f6bfee2a9c Fixed long lines in std/variant.d 2016-05-10 20:51:39 -04:00
Sebastian Wilzbach
69a3d9e59f fix static if mistakes 2016-05-07 14:38:03 +02:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
H. S. Teoh
2f5a8bb99c Merge pull request #4118 from MaksimZh/fix-15827
Fix Issue 15827 -  std.variant.Variant can not be initialized with some struct
2016-03-30 10:15:19 -07:00
Maksim Zholudev
f9aa6f6efc Fix Issue 15827. Avoid explicit use of parameter in delegate. 2016-03-28 11:32:34 +03:00
Dmitry Olshansky
00c5518e7e Merge pull request #4112 from MaksimZh/fix-15823
Fix Issue 15823 - allow opIndex for const std.variant.Variant
2016-03-24 22:57:41 +04:00
Maksim Zholudev
918b58ec37 Fix Issue 15823 - Allow opIndex for const Variant 2016-03-24 18:06:42 +03:00
k-hara
a86eeb1059 Merge two equivalent branches 2016-03-18 13:43:34 +09:00
k-hara
22c8065ffd fix Issue 15791 - Cannot get a stored nested struct object from Variant 2016-03-18 13:43:31 +09:00
Martin Nowak
0e95f6723a Merge remote-tracking branch 'upstream/stable' into merge_stable 2015-10-27 15:55:59 +01:00
k-hara
1df5afebe4 fix Issue 15039 - Algebraic cannot store a Typedef along with Typedef'ed type 2015-10-22 11:39:10 +09:00
Vladimir Panteleev
ca01aeeb83 Merge pull request #3708 from kinke/variant
std.variant: don't assert that target address != null if type size is 0
2015-10-18 02:09:50 +00:00
Dragos Carp
d698887729 Remove obsolete TypeTuple references
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.
2015-10-13 20:37:44 +02:00
Martin
4e1b8dcc21 std.variant: don't assert that target address != null if type size is 0
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? ;)
2015-10-09 18:14:16 +02:00
Ryan Roden-Corrent
0057756b28 Allow Variant.visit to support const types.
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.
2015-08-11 22:21:38 -04:00
Robert burner Schadek
971a76d941 std.variant housekeeping
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
2015-07-24 14:46:56 +02:00
Andrei Alexandrescu
120cbc2959 Replace D_PARAM with D through variant.d 2015-06-08 10:55:04 -07:00
Andrei Alexandrescu
5f0a1a6751 Add ReplaceType, use it in Algebraic. Also add get!k to Variant. 2015-06-08 10:52:11 -07:00
Rainer Schuetze
adab223837 remove trailing whitespace, detab, tolf 2015-05-31 11:24:01 +02:00
Robert burner Schadek
ee6c1a2ca8 variant: alias syntax update 2015-05-28 19:15:35 +02:00
anonymous
ca9e097abd do a reinterpret cast
opCast implementations may be incompatible, especially with inout. And
really, reinterpreting is the goal here.
2015-05-20 17:19:32 +02:00
anonymous
bb23cdd2eb inout 2015-05-15 19:55:07 +02:00
anonymous
095770983f fix issue 14586 - can't get an immutable value from a const std.variant.Variant 2015-05-15 15:35:57 +02:00
anonymous
15712f6e6c fix issue 14585 - destructor called on garbage in std.variant 2015-05-15 15:35:51 +02:00
Walter Bright
d9a9826e55 Revert "Introducing std.meta package" 2015-05-06 14:36:45 -07:00
Dicebot
7970fcc748 Don't use fqn for any/all
In most cases it resolves unambiguosly
2015-05-05 22:22:11 +03:00
Dicebot
a76d90c927 Phobos should only mention tuple as std.typecons.Tuple 2015-05-05 22:22:11 +03:00
Dicebot
1c9ae027ef Rename old std.typetuple symbols inside Phobos
staticIndexOf -> indexOf
allSatisfy -> all
anySatisfy -> any
staticMap -> Map
2015-05-05 22:22:11 +03:00
Dicebot
82f54a38d3 TypeTuple -> MetaList inside Phobos 2015-05-05 22:22:11 +03:00
Dicebot
73f773838d import std.typetuple -> import std.meta 2015-05-05 22:22:10 +03:00
Steven Schveighoffer
9ec468ee32 Merge pull request #3227 from aG0aep6G/13534
remove "@trusted:" from std.variant
2015-04-27 07:49:36 -04:00
anonymous
38a29b2d56 remove "@trusted:" from std.variant
It's too broad.

This fixes issue 13534 - std.variant can violate memory safety.
2015-04-25 21:20:35 +02:00
Justin Whear
e813450c22 Tabs to spaces 2015-04-21 12:00:45 -07:00
Justin Whear
e07a72151b minor style: change Tsize to tsize 2015-04-21 09:30:38 -07:00
Justin Whear
cb32577275 Add algebraic subset constructor
Allows construction from an algrebraic subset of types, leveraging
similar opAssign.
2015-04-21 09:30:08 -07:00
Justin Whear
5a9c0bcd6b Fixes 14457 (VariantN opAssign subset variant)
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
2015-04-17 15:09:23 -07:00
MetaLang
f97aa28724 Document that types larger than maxSize will be automatically boxed 2015-04-12 02:19:17 -03:00
k-hara
af1db6dba1 Supplemental fix for issue 14290 2015-03-16 22:12:31 +09:00
Walter Bright
646dc1969c fix Issue 14198 - [REG2.067a] Link failure with Variant 2015-03-05 02:32:37 -08:00
k-hara
fcc1aab788 fix Issue 14233 - Can't build Algebraic!(This[]) anymore
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.
2015-03-03 00:04:54 +09:00