Commit graph

273 commits

Author SHA1 Message Date
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
Robert burner Schadek
b63b286b2b variant documentation update
* moved examples from comments to unittests
 * some tests failed because of old copy paste bugs (fixed)
2015-02-02 23:59:16 +01:00
sinkuu
797f13f04d Add unittest 2015-02-01 08:42:12 +09:00
sinkuu
4a6d321545 Do not call destructor in VariantN.opAssign if no allowed type requires 2015-01-31 23:53:24 +09:00
k-hara
2e69efed7e fix Issue 13871 - Segmentation fault from std/variant.d:609
A variant to variant assignment is specially handled by OpID.copyOut. Therefore, destroying original value before the copyOut call is problematic.
2014-12-31 22:53:00 +09:00
Ilya Yaroshenko
c8d9afedea clean scope imports
imports of `std.range, std.algorithm, std.array, std.string,
std.format, std.uni` are affected.
2014-11-21 00:08:35 +03:00
Walter Bright
196ef0c7a5 std.variant unions cannot have postblit or destructors 2014-11-15 16:03:12 -08:00
Geod24
0fb95b8c27 Usage of WEB macro for License everywhere 2014-10-15 11:30:42 +02:00
Sönke Ludwig
c9d8ee5b2f Code clean up. 2014-09-11 08:28:04 +02:00
Sönke Ludwig
6c04790e41 Don't throw static exceptions. 2014-09-10 12:53:56 +02:00
Sönke Ludwig
fd5ff8a704 Use positional arguments for format(). 2014-09-10 12:53:12 +02:00
Sönke Ludwig
7b805bde94 Use VariantException instead of a bare Exception. 2014-09-10 12:52:17 +02:00
Sönke Ludwig
cb5d83dad9 Fix issue #13352 - Only perform Algebraic arithmetic with allowed types.
Adds a static check allowed!T before trying any particular numeric type. Also checks for an exact type match in case of a raw (non-Variant) operand and prefers that to one of the fixed numeric types. Finally, it loosens the restriction for opArithmetic to only work for equal Variant types.

Conflicts:
	std/variant.d
2014-09-10 12:52:17 +02:00
Михаил Страшун
9c8a1a5dfe Merge pull request #2453 from s-ludwig/issue_13354
Fix issue #13354 - Use a generic Variant for passing opIndex/opIndexAssign arguments.
2014-09-06 18:44:37 +02:00
H. S. Teoh
76db0de19c Eliminate C-style array declarations. 2014-08-30 06:51:27 -07:00
Dmitry Olshansky
ef1b0bcf97 Merge pull request #2439 from 9rnsr/fix13300
[REG2.067a] Issue 13300 - pure function 'std.array.Appender!(T[]).Appender.ensureAddable' cannot call impure function 'test.T.__fieldPostBlit'
2014-08-22 23:26:26 +04:00
Sönke Ludwig
352dee3a89 Fix issue #13354 - Use a generic Variant for passing opIndex/opIndexAssign arguments.
Also improves the error message when an incompatible index or value type is used by printing the actual type ID instead of "void[]" in the thrown exception.
2014-08-22 12:30:13 +02:00
Nick Treleaven
74cfb8fb38 Fix variant.d typo 2014-08-21 12:07:03 +01:00
k-hara
1baf12b102 fix Issue 13300 - pure function 'std.array.Appender!(T[]).Appender.ensureAddable' cannot call impure function 'test.T.__fieldPostBlit' 2014-08-19 22:35:56 +09:00
Yuriy Glukhov
625f98e13a hasElaborateAssign -> hasElaborateCopyConstructor.
Corrected check for elaborate copying.
2014-08-19 15:52:04 +03:00
k-hara
a846ecb18b fix Issue 13284 - Cannot match shared classes at receive 2014-08-12 16:37:20 +09:00
k-hara
57f9c81933 [Refactoring] Make unittest exhaustive 2014-08-12 16:34:32 +09:00
Daniel Murphy
cacd5f645f Merge pull request #2386 from MetaLang/variant-remove-float-min
Fix Issue 13230: std.variant.Variant Uses Deprecated .min Property in opArithmetic When T is a Floating Point Type
2014-08-04 18:54:02 +10:00
MetaLang
85bccdb9ab Replace use of T.min to determine signedness with std.traits.isUnsigned. 2014-08-04 00:50:17 -03:00
Andrej Mitrovic
76b03836e8 Merge pull request #2390 from 9rnsr/enforceProp
fix property enforcement
2014-08-02 12:52:13 +02:00
Ognjen Ivkovic
f802ee6ce1 Remove workaround for issue 12164. 2014-08-01 14:32:21 -06:00
k-hara
35bf8e1719 fix property enforcement 2014-07-30 19:15:39 +09:00
yglukhov
7da102aee6 Fixed handling of a struct with no "length" field defined but with opDispatch of inappropriate type. 2014-07-15 23:57:01 +03:00
Steven Schveighoffer
3cd7afcb1b Merge pull request #2330 from joakim-noah/strerror_move
Deprecate std.c.string and move its contents to druntime
2014-07-15 16:10:14 -04:00
Михаил Страшун
45fda72192 Merge pull request #2147 from yglukhov/issue10194
Issue 10194. Variant does not call struct destructors.
2014-07-14 13:40:22 +03:00