Useful in case we need >= or <= (instead of > or < or = as provided by
lowerBound/upperBound/equalRange).
Same convention as SortedRange.trisect, except just return a static
array instead of a tuple (as the type is the same).
Partial Fix: #10559
Improve the error message to:
static assert(0, "Cannot convert infinite range to string. Use `std.range.take` or `std.range.takeExactly` to make it finite.");
Also add a unittest to verify that compilation fails when an infinite range is passed for string conversion.
Co-authored-by: Paul Backus <snarwin@gmail.com>
For a single needle, it only requires an input range.
Split docs for unary `pred`.
Document `needle` parameter.
Explain pseudo-tuple returned, extend example.
This makes it easier to follow the docs.
Move 2 documented unittests under isTerminator overload.
Tweak isWhite example to use `\t`, not just a single space.
For HTTP, the response body encoding is specified in the
"Content-Type" header, e.g.: "Content-Type: application/json;
charset=utf-8".
MDN says:
> - `charset`: Indicates the character encoding standard used.
> The value is **case insensitive but lowercase is preferred**.
However, `_decodeContent` was comparing the encoding with the exact
string "UTF-8", which causes most HTTP requests to go through the slow
path.
Fix this by using `icmp`, like elsewhere in the module for
case-insensitive string comparisons.
* std.conv: factor out writeTextImpl from textImpl
* std.conv: add writeText, writeWText, writeDText
These are variants of text, wtext, and dtext that write their output to
an output range instead of returning a string.
Fixes#10550
* Add changelog entry for writeText
* reduce: Document Acc, Elem order in most visible place
* Reduce doesn't enforce predicates
* Reduce: Document behaviour on range with 1 elem
* Doc: Remove references to implemententation detail
Accumulator is the commonly used term for this concept.
* Fix#9585 Add check `variant` alignment
There has been code that handles alignment for a long time
now, and while this module is unlikely to be touched anymore, create a
regression test so the issue can be closed.
* Apparently double is 32bit aligned on x86
The current contraints have been implemented in #3837 to make `each`
behave more like `foreach` and automatically destructure tuples.
I haven't publically documented this behavior because it is probably
better these days to use `bind` for that.
just return the value and assign it to the receiver. Renamed the
conversion function and also cleaned up all the `typeof` calls, which
were very verbose.
This ports the fixes from abs(T)(ComplexT) regarding NaN and skipping
potentially inaccuracy inducing mathematical no-ops when one arg is 0 to
hypot. Both functions do the same thing and should be deduplicated.
hypot also has some logic regarding under and overflows, and while I
don't fully understand it, it should probably not be removed for complex
numbers.