Commit graph

49 commits

Author SHA1 Message Date
Jonathan M Davis
1a8cfa7029 Require that popFront and popBack be callable without parens.
Technically, prior to this change, it was possible to define popFront
and popBack to be callables that required parens - such as member
variable with an overloaded opCall or a delegate. It's unlikely that
anyone has actually declared popFront or popBack in this manner, but
it's possible. Because of that, calling popFront or popBack without
parens would technically not work with some valid ranges (even if such
ranges are unlikely to exist) and thus without this change, it's
arguably not valid to call popFront or popBack without parens in generic
code - especially in the standard library.

Andrei wants to be able to call popFront without parens in generic code,
and when I pointed out the existing problem with that, he wanted me to
change it so that it's no longer legal to have a range where popFront or
popBack is a callable that requires parens. So, this PR fixes that.

Now, technically, this is a breaking change, but it's highly unlikely
that it actually breaks any code, and I don't know of any way to do this
change in a way which would allow for any kind of deprecation message
for anyone trying to declare a range with a popFront or popBack that
would not work without parens. So, as far as I can tell, if we want to
make this change, we're stuck making a breaking change, but the odds of
it actually mattering seem low.
2016-11-25 10:42:29 -08:00
UplinkCoder
8bed6b2843 15% more performance for popFront(char[]) 2016-10-12 20:14:47 +02:00
Andrei Alexandrescu
71dc211e69 Merge pull request #4848 from andralex/popFront
Tighten popFront
2016-10-10 18:22:31 -04:00
Andrei Alexandrescu
28b6b462b8 Tighten popFront 2016-10-09 18:04:14 -04:00
Per Nordlöw
0e448d2780 Update primitives.d
Fix typo in explanation.
2016-10-09 22:55:48 +02:00
Jack Stouffer
67d44e4cdc Remove package wide std.algorithm imports from Phobos 2016-09-22 08:36:14 +01:00
Rainer Schuetze
0d213a9288 Fix issue 16385: do not pass 0 to bsr, it has undefined return value 2016-08-14 11:31:53 +02:00
Jack Stouffer
1dd85d4089 Make the Phobos rules/assumptions of input ranges clearer 2016-07-18 14:15:59 -04:00
Andrei Alexandrescu
b3cf5d5e6e Merge pull request #4313 from wilzbach/public_document_range
std.range: document public methods
2016-06-18 04:30:55 -04: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
493c989770 std.range: document public methods 2016-06-03 22:39:29 +02:00
Dmitry Olshansky
2bc17e8a10 Merge pull request #4375 from wilzbach/remove_weird_authors
remove placeholder copyright
2016-06-01 12:55:32 +04:00
anonymous
e1af1b0b51 fix issue 16090 - popFront generates out-of-bounds array index on corrupted utf-8 strings 2016-05-31 17:50:44 +02:00
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00
Sebastian Wilzbach
59431712ce remove placeholder copyright 2016-05-28 19:30:26 +02:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Jack Stouffer
82b1c0e097 Fixed long lines in std/range/primitives.d 2016-05-10 20:51:39 -04:00
Nick Treleaven
58b1f7a03e Document narrow string front, back
Also make back not compile when T is void, as front does.
2016-05-04 12:23:12 +01:00
Sebastian Wilzbach
d1714c9afb minor style fixes 2016-04-27 04:18:22 +03:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Nick Treleaven
0fff9203f8 [trivial] Tweak moveFront example 2016-04-18 13:44:15 +01:00
Yazan Dabain
9887af3fe6 Fix some imports 2016-04-12 22:15:09 +03:00
Ilya Yaroshenko
3884b9d13a clean API for moveAt 2016-04-10 12:46:55 +02:00
Ilya Yaroshenko
ff296c514b fix imports 2016-04-07 13:25:18 +02:00
Steven Schveighoffer
b0acb7a394 Fix remaining import deprecation messages 2016-02-22 16:03:12 -05:00
Dragos Carp
75cbbef0ab Add asserts for the "compiles" tests 2015-11-16 03:04:07 +01:00
Dragos Carp
eb293b5063 Fix issue 15320 2015-11-13 03:45:29 +01: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 Nowak
b861b0fe71 fix spelling in doPut error message 2015-10-03 21:46:57 +02:00
k-hara
6813eca0d2 fix Issue 15046 - isForwardRange documentation is documenting issue 14544 2015-09-12 20:14:29 +09:00
Steven Schveighoffer
c353c4ae7f Fix more typeof expressions that were missed 2015-06-05 16:50:33 -04:00
Steven Schveighoffer
ad1eefffae Fix inconsistency issues where some range properties are required to have @property because of quirk in typeof for member functions. 2015-06-05 16:50:33 -04:00
Walter Bright
d9a9826e55 Revert "Introducing std.meta package" 2015-05-06 14:36:45 -07: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
Dragos Carp
b170d93693 Fix some PHOBOSSRC broken links 2015-04-29 11:02:58 +02:00
anonymous
0842fc7841 @nogc for std.range.primitives.{empty,save,popFront,popBack,front,back}
Excluding the UTF-decoding variants, because those throw GC allocated
exceptions.

Makes sure that issue 12666 - "@nogc std.array.front, popFront, and more"
stays fixed.
2015-04-23 22:15:41 +02:00
Walter Bright
a0f0a3930d improve doc for std.range.primitives.isInputRange 2015-03-29 00:46:47 -07:00
Andrei Alexandrescu
11b32b56e5 Fix links 2015-02-16 13:39:18 -08:00
Robert burner Schadek
087c505b86 range documentation update
* moved examples from comments to unittests
* marked verify unittests as doc unittests and deleted duplication
2015-02-03 16:13:24 +01:00
Martin Nowak
b5b1625ef7 fix safety of put primitive 2015-02-02 22:39:13 +01:00
Walter Bright
dc302d26a4 DIP25: make phobos work with it 2015-01-30 12:02:48 -08:00
Andrej Mitrovic
67605b53dc Merge pull request #2771 from quickfur/issue13766
Issue 13766: Fix broken ddoc build for std/regex/package.d.
2014-12-06 21:37:03 +01:00
Nick Treleaven
4ba128b828 List walkLength under convenience functions rather than capabilities 2014-12-02 18:25:04 +00:00
H. S. Teoh
ad44c0bc7a Update std.range.* docs.
The previous docs were simply dissected from the original std.range docs, and
the text in each module is truncated and awkward to read. The main package.d
docs were also missing links to the submodules. So, update the docs to reflect
the current state of things.
2014-12-01 20:47:30 -08:00
Rainer Schuetze
7c2f962b10 make nested foreach over TypeTuple bodies into lambdas to avoid huge functions 2014-11-28 17:15:37 +01:00
Ilya Yaroshenko
2c744b54e1 std.range: constraints => primitives
See discussion and voting in #2661
2014-11-23 20:05:20 +03:00
Renamed from std/range/constraints.d (Browse further)