Commit graph

62 commits

Author SHA1 Message Date
dsimcha
64be18eea8 Fix std.typecons unittest on 64-bit. 2011-04-27 21:16:09 -04:00
andralex
e5f2d8eaf4 Merge branch 'master' of https://github.com/kennytm/phobos into testing-pull-request 2011-04-25 01:02:45 -05:00
KennyTM~
8786bd8cb1 Issue 4674: Change std.typecons.alignForSize's signature to (string[] names...)
This patch also removes many other workarounds in the function (2562, 2564, 2569).

Note that the return type has been changed from char[] to string, but since this
function is intended for mixin(), it should not cause many trouble.
2011-03-07 04:22:34 +08:00
Andrei Alexandrescu
1083bd4e7b One pass through std.range and friends
* Made emplace faster and replaced calls to it to also make them faster.

* Replaced phobos.d in posix.mak with index.d.

* Added version=StdDdoc to documentation build in posix.mak, and replaced uses of D_Ddoc with it.

* Improved documentation target in posix.mak (target dir automatically created).

* Added nice documentation table and cheat sheet at the top of std.algorithm.

* Replaced a few helper structs in std.range and std.algorithm with local structs, which simplify matters a fair amount.

* Added more constraints to functions in std.algorithm (still work in progress).

* Improved error message in std.algorithm.sort in case of failure to sort.

* std.random.dice(1, 10) now works (no need for array notation std.random.dice([1, 10])).

* Fixed documentation bugs and insufficiencies in std.range (still more to do).

* Improved speed of walkLength.

* Simplified retro.

* Simplified and optimized stride. Also folded stride(stride(r, a), b) into stride(r, a * b).

* Added roundRobin to std.range, which as a perk simplified radial.

* Added takeOne and takeNone to std.range.

* Added unsigned to std.traits.
2011-02-27 12:38:49 -06:00
Walter Bright
046e1b36db add source links 2011-02-06 15:46:50 -08:00
Brad Roberts
f368104f37 A bunch of 64 bit fixes, including disabling tests that don't pass 2010-12-23 20:39:22 +00:00
Sean Kelly
d04c21a806 Minimal support for toString use on shared objects. format now generates a meaningful compile error when attempting to format a shared object, and Tuple can now contain shared objects (the toString operation returns typeinfo for the object instead of calling toString). 2010-10-07 20:44:06 +00:00
Andrei Alexandrescu
362bece515 Fix for bugzilla 3318 2010-10-03 02:21:15 +00:00
Andrei Alexandrescu
934da4922b Deprecated defineEnum 2010-09-26 15:28:50 +00:00
Shin Fujishiro
d201e25c38 Tuple: Reduced instantiations and duplicate tests to deal with failing tests on win32.
See http://lists.puremagic.com/pipermail/phobos/2010-September/002609.html
2010-09-19 03:40:05 +00:00
Shin Fujishiro
430021772b std.typecons: Remove swap() in Tuple's constructor for now (it's incorrect if U != typeof(this)). 2010-09-18 06:07:19 +00:00
Shin Fujishiro
c6920e33cb Fixed access violation due to std.typecons.Tuple.
Suppressed the codegen for a dummy opAssign that is there just for a workaround of the bug 4424.
2010-09-18 06:07:09 +00:00
Shin Fujishiro
75592dc0f3 Workaround: std.typecons fails depending on the order of compilation. 2010-09-18 01:27:48 +00:00
Shin Fujishiro
10f0c7c702 std.typecons: Several improvements to Tuple.
- Tuple members are now accessible with the syntax a[0], a[1] etc.
- Eliminated an internal union (see bug 4421 and 4846). Re-implemented named members with alias.
- Worked around bug 4424. Got opAssign back.
- Made Tuple.slice!(from, to) to preserve field names if any.
- Added isTuple!(T) template.
- Removed the 'default constructor' that is never called.
- Changed Tuple.toString() to use formattedWrite() instead of the `static if (is(to!string...))` thingy.
2010-09-17 21:40:15 +00:00
David Simcha
620c0b0191 Add at!() for std.typecons.Tuple to mitigate breakage of old code that depended on the Proxy struct from std.range.Zip. Intentionally lacking ddoc since this is purely a backwards compatibility hack that IMHO should be deprecated or removed entirely eventually. 2010-09-09 20:21:44 +00:00
Steven Schveighoffer
7e89201cda Rewrote Appender to be safer and to not corrupt memory.
Fixed all places that use appender to use the safer interface.
bugzilla 4681: Appender access violation
2010-08-26 11:49:50 +00:00
David Simcha
e3331fbd90 Bug 4381: Length attribute for std.typecons.Tuple 2010-08-15 02:01:48 +00:00
David Simcha
38c8089063 Add convenience functions for Rebindable. 2010-08-14 00:40:50 +00:00
Brad Roberts
9eff03d36a Fix typo in documentation (reported in ng by Andrej) 2010-07-30 19:06:49 +00:00
Andrei Alexandrescu
0c07d592d4 Fixed bug reported by Max Samukha in scoped() 2010-07-23 16:12:11 +00:00
Andrei Alexandrescu
c2f7d08c1d Simplified scoped() 2010-07-22 19:33:04 +00:00
Andrei Alexandrescu
576cdf6d08 Fixed bug in scoped() 2010-07-21 22:38:14 +00:00
Andrei Alexandrescu
3121ed957a Added scoped() function 2010-07-21 22:24:17 +00:00
Andrei Alexandrescu
203e291864 Improvements to RefCounted. Better names (no clashes) and also defined a debug mode. Compiling with debug=RefCounted gives access to a bool property debugging that allows tracking the lifetime of the refcounted object. 2010-07-09 04:21:10 +00:00
Andrei Alexandrescu
432e3fdfc8 Replaced std.contracts with std.exception throughout 2010-07-04 22:09:03 +00:00
Andrei Alexandrescu
70a14177ce Changed broken opAssign to assign, plus minor changes to RefCounted 2010-07-04 21:54:33 +00:00
Shin Fujishiro
5160b4e052 Fixed typecons.Tuple static assert failure 2010-06-22 05:33:16 +00:00
Sean Kelly
3229f1aa37 Cleaned up ctor def. I can still get bizarre compile errors in some cases, but I don't think the remaining ones are ctor-related. 2010-06-19 18:53:51 +00:00
Sean Kelly
3f20e149fc Added a default ctor for Tuple (needed to put a Tuple in a Variant).
Fixed an issue with the Tuple copy ctor.  It now compiles.
Added prioritySend per TDPL.  Needs more testing, but it looks good so far.
2010-06-19 06:46:39 +00:00
Walter Bright
245e29f630 notify gc of malloc'd data 2010-06-12 20:56:25 +00:00
Andrei Alexandrescu
6cd25a5054 Added RefCounted type, yum 2010-06-10 15:58:31 +00:00
Masahiro Nakagawa
adf941f657 Replace static opCall with Constructor. static opCall for struct construction is old style. 2010-06-01 19:44:00 +00:00
Masahiro Nakagawa
e8700d4484 Remove tie. This implementation is unsafe! 2010-05-29 17:24:14 +00:00
Shin Fujishiro
188b8169be typecons doc: made reference to the Class::BlackHole and Class::WhiteHole perl modules.
Plus made WhiteHole to throw NotImplementedError if possible.
2010-05-27 20:43:04 +00:00
Shin Fujishiro
1b18d516cc Added code for bugzilla 3909: toDelegate handles only a tiny subset of function pointer types.
The bug is not completely fixed.  toDelegate() still does not work well with @safe function pointers... because toDelegate() is unsafe.  And variadic arguments are ignored.
2010-05-26 14:22:06 +00:00
Shin Fujishiro
b0d41bd3e3 Fixed bugzilla 3653: Problem sorting array of Rebindable.
Thanks to pc for the patch!

std.algorithm.sort does assignments over input array, but Rebindable did not have opAssign overload for Rebindable itself. This change implements Rebindable.opAssign(Rebindable).
2010-05-26 05:59:01 +00:00
Shin Fujishiro
35beaec1d9 Fixed bugzilla 2738: Rebindable should work for interfaces. 2010-05-24 04:27:06 +00:00
Shin Fujishiro
19166286a7 Added BlackHole and WhiteHole. 2010-05-23 00:35:48 +00:00
Shin Fujishiro
163bd6fe4d Added AutoImplement to std.typecons. 2010-05-22 00:10:16 +00:00
Shin Fujishiro
5c9725d6cd Moved allSatisfy and staticMap to std.typetuple 2010-05-18 11:15:44 +00:00
Masahiro Nakagawa
093183db7a Add tie to std.typecons 2010-05-17 16:19:35 +00:00
Walter Bright
e790058bf4 invariant => immutable 2010-05-05 18:25:44 +00:00
Andrei Alexandrescu
144c9108de added alias expand for Tuple.field 2009-10-27 00:12:43 +00:00
Sean Kelly
747f3cf1e4 Changed Phobos to use the Boost license. Currently, all public domain modules and all licensed modules by Walter, Andrei, Bartosz, and Don have been changed to use this license (excepting std.c, for the moment). Ideally, all Phobos modules will eventually be distributed under this license, which means obtaining permission from a few more authors, deleting, or rewriting some modules.
Removed std.openrj.
2009-09-16 18:19:51 +00:00
Andrei Alexandrescu
d218c12ede commented out Nullable and NullableRef for the time being 2009-09-03 03:27:45 +00:00
Andrei Alexandrescu
0c142994d9 See changelog - bunch of bug fixes and a couple additions for release 2.032 2009-08-31 19:46:33 +00:00
Andrei Alexandrescu
d05e7e21ea replaced indexOf with indexOfType, kept the old name as an alias that will be deprecated. 2009-07-04 07:08:39 +00:00
Andrei Alexandrescu
f3113665bd Restricted Tuple.opCmp and Tuple.opEquals a bit. 2009-04-30 20:55:44 +00:00
Andrei Alexandrescu
fbec43b21f Added Tuple.opComp. 2009-04-30 19:20:13 +00:00
Andrei Alexandrescu
c5ad7272fa minor 2009-04-19 17:18:03 +00:00