mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 07:00:37 +03:00
Changed only.Result to static struct
This commit is contained in:
parent
fb3a15a33f
commit
8977fd6ae3
1 changed files with 3 additions and 2 deletions
|
@ -6525,7 +6525,8 @@ must be passed to an algorithm expecting a range.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
----
|
----
|
||||||
assert(equal(only('♡'), "♡"));
|
assert(equal(
|
||||||
|
('♡'), "♡"));
|
||||||
assert([1, 2, 3, 4].findSplitBefore(only(3))[0] == [1, 2]);
|
assert([1, 2, 3, 4].findSplitBefore(only(3))[0] == [1, 2]);
|
||||||
|
|
||||||
string title = "The D Programming Language";
|
string title = "The D Programming Language";
|
||||||
|
@ -6534,7 +6535,7 @@ assert(filter!isUpper(title).map!only().join(".") == "T.D.P.L");
|
||||||
*/
|
*/
|
||||||
auto only(T)(T value)
|
auto only(T)(T value)
|
||||||
{
|
{
|
||||||
struct Result
|
static struct Result
|
||||||
{
|
{
|
||||||
this(T value) { _value = value; }
|
this(T value) { _value = value; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue