On Tuesday, 5 April 2022 at 14:10:44 UTC, Steven Schveighoffer
wrote:
[...]
I'd implement it probably like this (for D2):
```d
auto drop(T)(ref T[] arr, T which)
{
import std.algorithm, std.range;
auto f = arr.find(which);
debug if(f.empty) throw ...;
auto result = arr.front;
arr
On 4/5/22 11:43 AM, Paul Backus wrote:
On Tuesday, 5 April 2022 at 14:10:44 UTC, Steven Schveighoffer wrote:
I'd implement it probably like this (for D2):
```d
auto drop(T)(ref T[] arr, T which)
{
import std.algorithm, std.range;
auto f = arr.find(which);
debug if(f.empty) throw ...;
On Tuesday, 5 April 2022 at 14:10:44 UTC, Steven Schveighoffer
wrote:
I'd implement it probably like this (for D2):
```d
auto drop(T)(ref T[] arr, T which)
{
import std.algorithm, std.range;
auto f = arr.find(which);
debug if(f.empty) throw ...;
auto result = arr.front;
arr = arr.
On 4/4/22 7:15 PM, Enjoys Math wrote:
https://forum.dlang.org/post/eih04u$1463$1...@digitaldaemon.com
A version of the code that takes `T which` as a parameter instead of
`int index`.
```
// remove an item from an array
template drop(T)
{
T drop( inout T[] arr, T which )
Note to reader:
On Tuesday, 5 April 2022 at 11:53:19 UTC, Dennis wrote:
On Tuesday, 5 April 2022 at 11:26:27 UTC, BoQsc wrote:
I'd like to know if there is similar function: that can check
if a **key** inside a [Associative Array][2] can be found.
You can use the `in` operator for that:
https://dlang.org/spec
On Tuesday, 5 April 2022 at 11:26:27 UTC, BoQsc wrote:
I'd like to know if there is similar function: that can check
if a **key** inside a [Associative Array][2] can be found.
You can use the `in` operator for that:
https://dlang.org/spec/hash-map.html#testing_membership
I've found [std.algorithm: canFind][1] to be useful on a
**regular arrays**.
I'd like to know if there is similar function: that can check if
a **key** inside a [Associative Array][2] can be found.
[1]:https://dlang.org/phobos/std_algorithm_searching.html#.canFind
[2]:https://dlang.org/spec/h
On Tuesday, 5 April 2022 at 09:57:29 UTC, Mike Parker wrote:
On Tuesday, 5 April 2022 at 09:26:54 UTC, realhet wrote:
You should compile the existing package as a library, then add
the library file to the linker settings in VisualD.
Thank You for the fast help!
Currently I have my own build s
On Tuesday, 5 April 2022 at 09:26:54 UTC, realhet wrote:
Hello,
I have all my D packages in the c:\D\libs\ directory.
I added this path to the PropertyPages/Compiler/Additional
Import Paths field.
In the project source file I imported a module from my package
using "import het.utils;"
Also
Hello,
I have all my D packages in the c:\D\libs\ directory.
I added this path to the PropertyPages/Compiler/Additional Import
Paths field.
In the project source file I imported a module from my package
using "import het.utils;"
Also used a function from it.
The syntax highlighter worked go
10 matches
Mail list logo