Commit graph

152 commits

Author SHA1 Message Date
Don Clugston
84477a5d3e Move Boost copyright declaration from ddoc to normal comment. Fixes ugly ddoc output. 2010-11-24 19:34:47 +00:00
Shin Fujishiro
af1fb0b618 Constrain swap() with isMutable!T so that const objects should not be swapped. std.traits.isMutable is undocumented for now. 2010-11-18 21:45:18 +00:00
Shin Fujishiro
85b5c42510 Made std.array empty(), save() and overlap() "@safe pure nothrow".
overlap: nested functions min() and max() are ad-hoc workaround to make the function pure nothrow.

front(), back(), popFront() and popBack() depend on std.utf, and they are unchanged for now.
2010-11-18 21:25:55 +00:00
Lars T. Kyllingstad
5264901ff4 Bug 5163: meaningless error message with front() applied to void[]
It's not possible to index into void[] arrays, which means that they
cannot be ranges.  Therefore, I've added template constraints to
front(), back(), popFront(), and popBack() in std.array that prevents
them from being instantiated with void[].
2010-11-05 12:12:55 +00:00
David Simcha
b597d23f83 Bug 4888: Heavy reliance on Bug 3534 in Phobos range usage. I used a different approach here than the first one I tried. I only did what was necessary to make Phobos work instead of trying to fix the deeper issue of making std.algorithm to work w/ const/immutable arrays. 2010-09-18 21:00:52 +00:00
David Simcha
1ec0042c6c Fix bug where opApply iterables with length can't be converted to arrays. 2010-09-14 23:09:40 +00:00
Andrei Alexandrescu
eb6b17f27b Fix Appender to accept input ranges 2010-09-13 13:36:52 +00:00
David Simcha
8a50942419 Fix memory corruption bug in std.array caused by having GC block attributes backwards. 2010-09-08 21:18:12 +00:00
Steven Schveighoffer
7641283d44 Removed cases for RefAppender where passed in array pointer is null. No point to do that, since you could just use the Appender directly instead. 2010-09-07 13:13:39 +00:00
Steven Schveighoffer
f5565aec67 Added RefAppender wrapper to appender that simulates original functionality (updates a reference when array is appended to) 2010-09-07 12:02:36 +00:00
Steven Schveighoffer
6636569318 changed appender to prevent calling .clear on appenders of immutable or const data.
Removed buffer arg from std.xml.encode since most of the time the data is string data, and the buffer was defined as the same type.

Fixed std.format unittests to not use string-based appenders, since they now cannot be rewritten.
2010-08-26 19:05:09 +00:00
Steven Schveighoffer
399d8c0eaa Upon discussion in the appender access bug, it was determined we could make the Appender able to use the entire memory block, not just the data passed in.
With this fix, Appender and builtin appending should both be callable on the same data without corruption, of course using the builtin append on data held
by an Appender will reallocate.
2010-08-26 17:04: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
Andrei Alexandrescu
3f2b8c12ea 64-bit compatibility work 2010-08-22 20:55:22 +00:00
David Simcha
d51ceb4c29 Bug 4346: More flexible std.array.array. Also improve std.array.array to work better with immutable narrow strings and use emplace() instead of placement new. 2010-08-19 00:53:05 +00:00
Andrei Alexandrescu
3c4c5bc25a Different implementation of capacity in Appender 2010-08-08 01:11:05 +00:00
Andrei Alexandrescu
6dc8c7ad3f Saved capacity properly after each append 2010-07-28 07:50:50 +00:00
Andrei Alexandrescu
2da8c7920e Removed put for arrays 2010-07-12 00:46:16 +00:00
David Simcha
7d9a0eb0c9 array() should work with input ranges. 2010-07-11 23:55:22 +00:00
Andrei Alexandrescu
125345ba2f Removed specialization of put(a, e) for array and object because the definition in std.range fulfills it 2010-07-09 03:50:31 +00:00
Andrei Alexandrescu
536cb93d9c Fixed issue in Appender 2010-07-06 05:34:59 +00:00
Andrei Alexandrescu
432e3fdfc8 Replaced std.contracts with std.exception throughout 2010-07-04 22:09:03 +00:00
Andrei Alexandrescu
93a828c06b Temporary workaround for bug 4426 2010-07-04 21:13:07 +00:00
Andrei Alexandrescu
875d77e732 Made Appender a reference type by encoding capacity at the end of the store 2010-07-04 19:57:04 +00:00
David Simcha
19b57eecf4 std.array.back(): enforce -> assert. 2010-07-03 13:50:21 +00:00
Andrei Alexandrescu
63efc7ab50 Added implementation of save() for T[]s. 2010-06-08 17:16:57 +00:00
SHOO
0591659255 Fixed bugzilla 4228: std.array.replace contains 2 bugs
4th parameter allows null.
Approach of remove method was wrong.
2010-05-23 18:09:19 +00:00
Walter Bright
9b4dcc1c0e invariant => immutable 2010-05-05 22:21:46 +00:00
Masahiro Nakagawa
a288172908 Add @property to length method. 2010-05-04 21:54:00 +00:00
Andrei Alexandrescu
2a9a6e336c string, wstring are now bidirectional (not random) ranges
std.algorithm: defined move with one argument; levenshtein distance generalized to with all forward ranges; take now has swapped arguments
std.array: empty for arrays is now a @property; front and back for a string and wstring automatically decodes the first/last character; popFront, popBack for string and wstring obey the UTF stride
std.conv: changed the default array formatting from "[a, b, c]" to "a b c"
std.range: swapped order of arguments in take
std.stdio: added readln template
std.variant: now works with statically-sized arrays and const data
std.traits: added isNarrowString
2010-02-22 15:52:31 +00:00
David Simcha
868dc726a2 Unlisted bug in array(): Arrays scanned by GC even if they don't need to be. 2009-12-01 13:52:15 +00:00
Don Clugston
0ecae3a354 Change [length] to [$] throughout Phobos. 2009-11-03 07:55:49 +00:00
Andrei Alexandrescu
579d23419c Line length adjusted to under 80 characters 2009-10-26 22:38:50 +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
37e9bab89e added array function. 2009-07-04 06:51:36 +00:00
Andrei Alexandrescu
e112df9d98 Made Appender instantiable with string and other arrays with immutable elements. Also now Appender appends ranges to arrays wherever applicable. 2009-04-29 21:31:33 +00:00
Andrei Alexandrescu
dfef2a7214 Replaced next, retreat, head, and toe with (respectively) popFront, popBack, front, and back 2009-04-13 19:10:58 +00:00
Andrei Alexandrescu
9d341e7cae Range primitives for arrays 2009-04-06 05:46:42 +00:00
Walter Bright
7afd13a6c6 fix broken unittests 2008-11-23 06:38:57 +00:00
Sean Kelly
61e7e85856 Replaced std.array, which I'd been a bit overzealous in deleting. 2008-11-17 23:24:23 +00:00
Sean Kelly
edb5c5003e This commit includes all the changes necessary for Phobos to run against druntime. Here is a sucinct list of the changes made:
* Removed gcstats.  Garbage collector statistics will be avaialable in durintime's 'memory' module.
    * Removed object.d.  This module is replaced by the object.d provided by druntime.
    * Removed std.array.  To trap an array bounds error, import 'exception' from druntime and catch ArrayBoundsException.
    * Removed std.asserterror.  To trap an asertion failure, import 'exception' from druntime and catch AssertException.
    * Removed std.gc.  To interact with the garbage collector, import 'memory' from druntime.
    * Removed std.hiddenfunc.  No equivalent exception is currently exposed by druntime, but if one is exposed it will be called HiddenFuncException and be declared in 'exception'.
    * Removed std.moduleinit.  druntime declares ModuleInfo in object.d, so it is implicitly availble without importing.
    * Removed std.outofmemory.  To trap an out of memory error, import 'exception' from druntime and catch OutOfMemoryException.
    * Removed std.switcherr.  To trap a switch error, import 'exception' from druntime and catch SwitchException.
    * Removed std.synchro.  This functionality will exist within druintime.
    * Removed std.thread.  A Thread class is available within druntime's 'thread' module.  An interface comparison will be provided separately.
    * Removed std.typeinfo.  The classes defined in this package are for runtime use and should not be visible to the user.

The prior version of Phobos has been archived in tags/phobos-2.019 if needed.
2008-10-11 00:56:40 +00:00
Andrei Alexandrescu
b3edae74e9 $(LI Added module $(B std.array) containing array operations: $(B insert), $(B erase), and $(B replace).) 2008-07-08 03:03:22 +00:00
Brad Roberts
a9bc53273c merge r387:397 from candidate to trunk
-- new module std.contracts
  -- migrate callers to it where appropriate
2007-10-14 23:04:19 +00:00
Brad Roberts
eec6be69ed Merge r297:387 from candidate to trunk.
-- add std.getopt
  -- add std.variant
  -- switch strings over to be invariant rather than const
  -- hopefully the last big linux makefile overhaul
  -- fix for bug 1579: write[ln] fails for obj.toString()
  -- fix negative precision handling in std.format
  -- add some file and directory iterator helpers
  -- among other little changes here and there...
2007-10-14 09:22:50 +00:00
Brad Roberts
8f79f3ec35 phobos 2.003 2007-09-10 07:28:23 +00:00
Brad Roberts
de971890b0 phobos 2.000 2007-09-10 06:45:08 +00:00
Brad Roberts
7371485bf8 phobos 0.177 2007-09-10 05:36:45 +00:00
Brad Roberts
383b51702e phobos 0.106 2007-09-10 04:22:07 +00:00
Brad Roberts
17fe123175 phobos 0.105 2007-09-10 04:17:05 +00:00
Brad Roberts
97c64f349e phobos 0.93 2007-09-10 04:01:57 +00:00