On 1/14/21 7:06 PM, dog2002 wrote:
On Thursday, 14 January 2021 at 16:01:43 UTC, drug wrote:
On 1/14/21 6:55 PM, drug wrote:
But this method consumes a huge amount of memory (up to 4 GB and
more). Is there a more appropriate way to walk directories
recursively that does not consume a lot of
On 1/14/21 7:30 PM, dog2002 wrote:
On Thursday, 14 January 2021 at 16:18:28 UTC, drug wrote:
On 1/14/21 7:06 PM, dog2002 wrote:
On Thursday, 14 January 2021 at 16:01:43 UTC, drug wrote:
[...]
Yes. I forgot to add it in the original post.
Does using `ref` changed anything?
Try following:
``
On 1/14/21 7:06 PM, dog2002 wrote:
On Thursday, 14 January 2021 at 16:01:43 UTC, drug wrote:
On 1/14/21 6:55 PM, drug wrote:
But this method consumes a huge amount of memory (up to 4 GB and
more). Is there a more appropriate way to walk directories
recursively that does not consume a lot of
On 1/19/21 4:48 PM, Per Nordlöw wrote:
On Tuesday, 19 January 2021 at 13:36:58 UTC, Steven Schveighoffer wrote:
Use a cast instead.
const lvalue = cast(long)value;
Ahh, good point.
Followd by a compare of the original value I presume.
don't forget to check by std.math.isFinite before casti
On 1/19/21 5:04 PM, drug wrote:
On 1/19/21 4:48 PM, Per Nordlöw wrote:
On Tuesday, 19 January 2021 at 13:36:58 UTC, Steven Schveighoffer wrote:
Use a cast instead.
const lvalue = cast(long)value;
Ahh, good point.
Followd by a compare of the original value I presume.
don't forget to check
On 1/19/21 6:50 PM, Ali Çehreli wrote:
On 1/19/21 6:04 AM, drug wrote:
> Another (low level) way is to shift mantissa left by exponent value.
Luckily, we already have a helper in Phobos:
https://dlang.org/phobos/std_bitmanip.html#FloatRep
Ali
That makes life simpler, thanks for sharing
On 1/19/21 9:28 PM, Per Nordlöw wrote:
On Tuesday, 19 January 2021 at 16:14:17 UTC, drug wrote:
https://dlang.org/phobos/std_bitmanip.html#FloatRep
Doesn't this pattern already cover all possible cases of `value` needed?
void f(double value)
{
auto lvalue = cast(long)value;
if (l
It is not easy to understand what mir library one should use to work
with matrices. mir-glas turns out unsupported now and I try to use
mir-blas. I need to reimplement my Kalman filter version to use more
high dimension matrix than 4x4 plus Kronecker product. Is mir-blas
recommended to work wit
On 1/29/21 4:50 PM, 9il wrote:
On Tuesday, 26 January 2021 at 14:43:08 UTC, drug wrote:
It is not easy to understand what mir library one should use to work
with matrices. mir-glas turns out unsupported now and I try to use
mir-blas. I need to reimplement my Kalman filter version to use more
h
On 1/29/21 8:20 PM, 9il wrote:
On Friday, 29 January 2021 at 15:35:49 UTC, drug wrote:
Between is there a plan to implement some sort of static slice where
the lengths of the dimensions are known in compile time? Compiler help
is very useful.
No. BLAS/LAPACK API's can't use compile-time infor
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
I was trying to profile a d program. So I ran: dub build
--build=profile. I then ran the program and it produced
trace.log and trace.def. I then ran d-profile-viewer and got
the following error:
std.conv.ConvException@/home/jg/dlang/ldc-1
On 2/10/21 2:52 PM, JG wrote:
On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote:
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
I was trying to profile a d program. So I ran: dub build
--build=profile. I then ran the program and it produced trace.log and
trace.def. I then ran d-p
On 3/16/21 1:58 AM, David Skluzacek wrote:
>
> Error: template std.algorithm.iteration.splitter cannot deduce
function from argument types !()(GZippedFile, string), candidates are:
> /usr/include/dlang/dmd/std/algorithm/iteration.d(4678):
splitter(alias pred = "a == b", Range, Separator)(Range r
I use asdf https://code.dlang.org/packages/asdf
Also vibe-d https://code.dlang.org/packages/vibe-d has
vibe-d:data subpackage
02.04.2021 15:06, Ali Çehreli пишет:
For those who prefer a video description with some accent :) here is how
What about accent - I'm curious what would you say about this old
Russian sketch about English and its dialects (in English, no facebook
account required):
https://www.facebook.co
21.04.2021 16:19, Alain De Vos пишет:
import std.stdio;
void main(){
struct List {
struct Node {
float f;
Node *next;
}
Node * root=null;
bool empty() const {return !root;}
void popFront() {root=root.next;}
f
11.05.2021 12:10, Vinod K Chandran пишет:
Hi all,
I am practising D with a win api GUI hobby project.
I have a Window class and it resides in module window.d
My WndProc function resides in another module named wnd_proc_module.d
Inside my WndProc, I get the Window class like this.
```d
Window win
13.05.2021 16:30, Alain De Vos пишет:
Shouldn't the compiler error it is not pure ?
Or have I a wrong understanding of pure or the compiler.
The function is pure. If you call it several times passing the same
argument it will return the same result.
https://run.dlang.io/is/futqjP
21.05.2021 15:39, Alain De Vos пишет:
I'll have a look at that website.
With this code I capture the mouse press event
```
this()
{
addEvents(GdkEventMask.BUTTON_PRESS_MASK);
addOnDraw(&drawCallback);
addOnButtonPress(&onButtonPress);
}
```
```
public bool onButtonPress(Event event, Widget wid
21.05.2021 16:45, newbie пишет:
I am following
https://wiki.dlang.org/Defining_custom_print_format_specifiers, why sink
and formatValue are not @safe? What are the best practice for toString
in safe code? Thank you
sink is obsolete now, use W(riter)
```D
import std.range : isOutputRange;
vo
02.06.2021 00:47, Ola Fosheim Grøstad пишет:
Note: Many simple GUI toolkits are horribly inefficient as they let each
object render themselves. An efficient GUI engine will have to
replicate some of the browser complexity...
I tried retained and immediate GUI, both fail (imho) for my use case
02.06.2021 12:50, Ola Fosheim Grøstad пишет:
Depends on the data, I guess, if they are all visible at once then you
basically have to very carefully write your own GPU render stage for
that view and carefully cache things that does not move by rendering
them to buffers (in GPU memory).
Usuall
07.06.2021 17:02, Prokop Hapala пишет:
Basically I'm desperate do find anything which encapsulates OpenGL calls
into some nice D-lang classes
Did you try gfm? specifically its 7th version -
[gfm7](https://github.com/drug007/gfm7)?
It has nice
[classes](https://github.com/drug007/gfm7/tree/mas
06.07.2021 13:06, Jack Applegame пишет:
Code:
```d
import std.stdio;
struct Field {
void opAssign(int a) {
writefln("Field.opAssign(%s)", a);
}
}
struct Register {
Field clock(int a) {
writefln("Register.clock(%s)", a);
return Field();
}
}
void m
08.07.2021 16:51, Виталий Фадеев пишет:
Hi!
I searching trivial simple D/OpenGL working in 2021 year example.
It may be triangle.
It may be based on any library: SDL, GLFW, Derelict, etc.
Can you help me ?
https://github.com/drug007/gfm7/tree/master/examples/simpleshader
it's not trivial t
08.07.2021 17:20, Виталий Фадеев пишет:
vital@unknown:~/src/dtest/working-example/gfm7/examples/simpleshader$
dub run
Fetching bindbc-opengl 0.15.0 (getting selected version)...
Fetching colorize 1.0.5 (getting selected version)...
Fetching gfm 8.0.6 (getting selected version)...
Fetching bind
08.07.2021 18:46, Виталий Фадеев пишет:
On Thursday, 8 July 2021 at 15:30:07 UTC, drug wrote:
08.07.2021 17:20, Виталий Фадеев пишет:
[...]
I failed to reproduce that. What platform you use and what is the
compiler version?
drug, Linux, Ubuntu, x64
# uname -a
Linux unknown 5.11.0-22-generi
08.07.2021 19:11, Виталий Фадеев пишет:
I fix source code, as drug say.
I've fixed the issue upstream, shortly gfm7 v1.1.2 will be available.
I wouldn't state it is the best way but you can try something like that:
```D
import std.complex;
import std.range : zip;
import std.algorithm : equal, map;
import std.array : array;
void main(){
auto N=2;
double[] x,y;
x.length = N;
y.length = N;
x[0] = 1.1;
x[1] = 2.2;
28.07.2021 17:39, Mathias LANG пишет:
On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote:
Hi, I'm new to D lang and encounter some performance issues with
fiber, not sure if there's something obviously wrong with my code.
I took a quick look, and the first problem I saw was that you
12.08.2021 12:36, Learner пишет:
> It seems that there is no easy way to transition from a postblit to a
copy constructor, no?
You just need both const and mutable copy ctors to replace inout one:
```D
struct A {
int[] data;
this(ref return scope A rhs) { data = rhs.data.dup; }
12.08.2021 14:07, drug пишет:
12.08.2021 12:36, Learner пишет:
> It seems that there is no easy way to transition from a postblit to a
copy constructor, no?
You just need both const and mutable copy ctors to replace inout one:
```D
struct A {
int[] data;
this(ref return scope A
12.08.2021 14:32, Paul Backus пишет:
This is not true. Qualifying the ctor as `inout` works fine:
https://run.dlang.io/is/Kpzp5M
The problem in this example is that `.dup` always returns a mutable
array, even if the array being copied is `inout`. The solution is to
cast the copy back to the
17.08.2021 15:21, Ferhat Kurtulmuş пишет:
Hello folks,
Hope everyone is doing fine. Considering the following code, in the
first condition, I am extracting the type Point from the slice Point[].
I searched in the std.traits, and could not find a neater solution
something like ElementTypeOf!T.
10.09.2021 12:27, eugene пишет:
//import std.container.dlist; // dmd (v2.097.2)
import std.container: DList; // gdc (4.9.2)
It is off-topic a bit but I think none can compare gdc 4.9.2 to dmd
2.097.2 because gdc has older version than dmd. I would compare gdc to
appropriate dmd version, it
You just need to check if T is a pointer:
```D
import std;
alias DA = int[];
alias SA = int[3];
alias PSA = SA*;
alias PDA = DA*;
version(all)
enum isPointedStaticArray(T) = isPointer!T &&
isStaticArray!(PointerTarget!T);
else
enum isPointedStaticArray(T) = isPointer!T && is(PointerTarget!T
On 10.10.2021 18:01, Elmar wrote:
Well, I just wondered why your code would compile and mine wouldn't. The
`version(all)` variant will not compile on my computer with `rdmd`
because `PointerTarget` only allows pointers.
It depends on compiler version. This variant is compiled on version
2.0
On 26.11.2021 12:16, Ferhat Kurtulmuş wrote:
I am working on the DCV to make it compilable with the recent versions
of LDC, mir libraries, and stuff. I have not yet simply forked it to
work on it. I am including modules one by one for my convenience
instead. Hope, I am close to the end. Here is
On 13.12.2021 13:49, forkit wrote:
On Monday, 13 December 2021 at 09:49:05 UTC, forkit wrote:
char* w = cast(char*)str.toStringz; // this seems to be the solution
class has ended ;-)
That's because `str` is initialized by a literal and you can not change
it by definition. When you cal
On 13.12.2021 14:26, ag0aep6g wrote:
On 13.12.21 12:09, drug wrote:
That's because `str` is initialized by a literal and you can not
change it by definition. When you call `toStringz` it duplicates that
literal (adding terminating zero at the end) and the duplicate is
mutable. I would recommen
Auto ref?
```D
int* getX(T)(auto ref T t)
{
...
```
26.04.2018 21:16, FreeSlave пишет:
Most dub packages are libraries and should provide runnable examples.
What's the current idiomatic way to add examples? I used sub-packages
with dependency on the library and "*" as version and running them as
dub run :examplename
Now I've noticed vibed uses a
27.04.2018 13:58, Laurent Tréguier пишет:
This is the way Rust packages handle their Cargo.lock file, if I'm not
mistaken, and it seems reasonable to me
Exactly
On 03.05.2018 22:45, kerdemdemir wrote:
After a big refactor my code crushes I have no idea where.
I am only getting :
Program exited with code -11
And a core file.
I used to use gdb for c++ coredumps. With what program&option I can
check dmd core file?
Erdemdem
The same programs and opti
I port nanogui, but besides porting I'd like to improve it using great
capabilities of D language provides. One of them is utf support, so I
added support for Asian languages to nanogui.TextBox. But I'm not sure
I've did it well and so I'd like to ask someone to test it using the
following:
``
On 06.05.2018 06:10, Binghoo Dang wrote:
hi,
I'm a Chinese, and I just have done the test. I also copied some
Japanese text from Dlang twitter channel and added some Chinese wide
punctuation Char.
And It's all seems displayed correctly.
The resulting screenshot is here: https://pasteboard.
I get the error like:
```
./foo/bar/baz/builder.d(57,23): Error: template instance
`staticMap!(DebugTypeMapper, BaseDebuggerTypes)` recursive template
expansion
```
That's all. It doesn's print instantiations stack so I can't track back
the reason. Could someone give an advice how to struggle
08.05.2018 11:11, Kagamin пишет:
On Sunday, 6 May 2018 at 11:18:17 UTC, drug wrote:
Could you describe the problem in more details?
SDL probably selects the first font that has the characters, which in
his case is a font of comic sans design, instead of a font configured
for gui.
It's not
07.05.2018 17:22, Timoses пишет:
On Monday, 7 May 2018 at 10:28:14 UTC, drug wrote:
I get the error like:
```
./foo/bar/baz/builder.d(57,23): Error: template instance
`staticMap!(DebugTypeMapper, BaseDebuggerTypes)` recursive template
expansion
```
That's all. It doesn's print instantiations
08.05.2018 16:23, BoQsc пишет:
On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote:
On Tuesday, 8 May 2018 at 12:37:42 UTC, BoQsc wrote:
On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote:
On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote:
[...]
This one needs to be compiled+run wi
16.05.2018 10:06, Dennis пишет:
Here's a version that only outputs the first chunk:
```
import std.stdio;
import std.range;
import std.algorithm;
import std.file;
import std.exception;
void main(string[] args) {
enforce(args.length == 2, "Pass one filename as argument");
auto lineChun
On 09.06.2018 23:39, OlegZ wrote:
On Saturday, 9 June 2018 at 20:03:15 UTC, OlegZ wrote:
auto hz = (string s) => { writeln( s ); return cast( int )s.length; }
How I should to write lambda of type "int delegate( string )?
I found one way:
auto hz = delegate int( string s ) { writeln( s ); ret
On 10.06.2018 12:21, OlegZ wrote:
On Saturday, 9 June 2018 at 22:28:22 UTC, Ali Çehreli wrote:
There is some explanation at the following page, of how the lambda
syntax is related to the full syntax:
http://ddili.org/ders/d.en/lambda.html#ix_lambda.=%3E
copy rect from article as image
http
On 10.06.2018 20:58, SrMordred wrote:
a => { return 2*a; }
/\ \ /
|| \ /
|| \ /
|| \ /
|| \ /
This is \ /
function \ This is definition of delegate
definition \
so you have a function that returns delegate.
```
it's like
a => a
There were several attempts to make Qt binding for dlang, but either
they has failed or has been stalled. It would be nice to collect that
experience. Considering 2.081 supports C++ special member (not all but
majority) isn't it time to make another attempt or the problem is more
complex?
Coul
16.07.2018 17:32, bachmeier пишет:
On Friday, 13 July 2018 at 19:53:45 UTC, Laeeth Isharc wrote:
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso
wrote:
What are your ideas?
If you would like to expose C function and type declarations to D, you
could take a look at DPP,
24.08.2018 16:32, Per Nordlöw пишет:
Is anybody working on a D-based really fast OpenGL-based visualization
engine that supports tessellation of 2d primitives on the GPU?
For instance, if I want to animate a huge amount of circles (in a
2d-graph) and I would like to only have to send an array
24.08.2018 17:38, Per Nordlöw пишет:
On Friday, 24 August 2018 at 14:34:46 UTC, Per Nordlöw wrote:
On Friday, 24 August 2018 at 14:03:08 UTC, drug wrote:
imgui, but now I'm replacing it by nuklear.
Is nuklear a software project that can be found somewhere?
Ahh, I presume you mean
- https:/
30.08.2018 11:19, Andrey пишет:
Hello,
is it possible to declare an internal variable in "static foreach" and
on each iteration assign something to it?
Example:
static foreach(arg; SomeAliasSeq)
{
internal = arg[0].converted; // a shortcut for expression
"arg[0].converted"
static i
On 04.09.2018 22:23, SrMordred wrote:
Most C++ game related projects uses GLM as they default math/vector lib
(even if not using opengl).
In D we have (that I found):
gfm.math - https://github.com/d-gamedev-team/gfm
dlib.math - https://github.com/gecko0307/dlib
Gl3n - https://github.com/
On 08.09.2018 20:59, Marcin wrote:
void main()
{
snipped
}
This? https://run.dlang.io/is/SHyCXA
11.09.2018 13:11, Timoses пишет:
Is this why it is said that passing parameters by value can be more
efficient?
Cause for a ref parameter it would require passing the address which
would require to be allocated?
Aww, I really would love some insights into function parameter passing.
Why is
12.09.2018 15:14, Timoses пишет:
On Tuesday, 11 September 2018 at 12:07:14 UTC, drug wrote:
If data size is less or equal to total size of available registers
(that can be used to pass values) than passing by value is more
efficient. Passing data with size less than register size by reference
According to https://dlang.org/articles/ctarguments.html compile time
sequences "...allow a programmer to operate on types, symbols and values..."
Phobos has `isType`/`isTypeTuple` traits, also `isExpressions` where
expression may contain both values and symbols, but has no traits like
`isSymbol
On 03.10.2018 20:22, Paul Backus wrote:
In my experience doing metaprogramming in D, it's best to make your
static if/template constraint tests as narrow and specific as possible.
For example, if you want to know whether you can call a function with a
particular argument, you don't need to mu
I was incorrect with description of the problem. The problem is that
there is no simple way to distinct types and symbols if symbols are
private. Because private symbol is not accessible you can not get any
info on it, including is it type or symbol or value. And you can not get
protection for
04.10.2018 14:44, drug пишет:
I was incorrect with description of the problem. The problem is that
there is no simple way to distinct types and symbols if symbols are
private. Because private symbol is not accessible you can not get any
info on it, including is it type or symbol or value. And y
16.10.2018 17:47, cosinus пишет:
On Tuesday, 16 October 2018 at 14:42:32 UTC, cosinus wrote:
Is there a way to use std.regex at compile-time?
I would like to `mixin()` the result of this function:
```D
string generateVertexStruct()
{
auto reVertex = ctRegex!(`in\s+(?P\w+)\s+(?P\w+)\s*;`)
25.10.2018 23:34, Michelle Long пишет:
Ignores spaces: <-
Doesn't: <
Concatenates results: <~
Thank you for sharing your results!
On 07.11.2018 22:09, Alex wrote:
Ok... sorry for being penetrant, but there is still something strange.
Having dependencies as you had,
´´´
import mir.random.algorithm;
import mir.algorithm.iteration;
import mir.ndslice;
import mir.random;
void fun(size_t s){}
void main()
{
size_t[] arr;
08.11.2018 14:48, Codifies пишет:
On Thursday, 8 November 2018 at 11:46:44 UTC, Codifies wrote:
when creating a new instance of a class
aclass a = new aclass();
I was under the impression that this created a new chunk of memory on
the heap...
however I'm trying to create this class instance
On 10.11.2018 22:42, Václav Kozák wrote:
I'm making a Rest API with vibe.d and I have a struct User. Sometimes I
need to return only a few of the fields. So for example: return User(1,
null, "John", null, null, ...);
If I do this, an error occurs: cannot implicitly convert expression null
of ty
https://run.dlang.io/is/IygU5D
AllMembers states that struct S contains "this" member, but hasMember
negates it. Is it bug or misusing?
On 18.11.2018 0:09, Adam D. Ruppe wrote:
On Saturday, 17 November 2018 at 20:54:24 UTC, drug wrote:
https://run.dlang.io/is/IygU5D
AllMembers states that struct S contains "this" member, but hasMember
negates it. Is it bug or misusing?
I'm not sure what it is supposed to do, but since this i
On 18.11.2018 1:26, Adam D. Ruppe wrote:
That's because the compiler passes it a hidden pointer to refer to the
context outside. The compiler could perhaps be smarter about it, and see
if those methods actually refer to the context, but it seems to simply
say if the method is there, it might
On 18.11.2018 5:37, Stanislav Blinov wrote:
It's only "hidden" in that there's no symbol to access it. But you can
still access it via .tupleof, and it still of course affects the ABI
(i.e. S.sizeof is always at least pointer size when S is nested).
If you want to iterate fields, .tupleof is a
I have the following grammar https://run.dlang.io/is/gRTGm3
If user types `ubyte1` instead of `ubyte` the whole string parsing fails
and error message says string is wrong from the start. How can I get
more informative message like "unknown type ubyte1" or at least error
position points to `uby
Now I do it this way (https://run.dlang.io/is/8kVibT):
```
auto some_duration = dur!"msecs"(500);
auto seconds = some_duration.total!"hnsecs" / 10_000_000.0;
assert(seconds.approxEqual(0.5));
```
is there better way to do it?
Thanks in advance
On 19.02.2019 18:07, Dennis wrote:
On Tuesday, 19 February 2019 at 14:34:09 UTC, drug wrote:
Now I do it this way (https://run.dlang.io/is/8kVibT):
```
auto some_duration = dur!"msecs"(500);
auto seconds = some_duration.total!"hnsecs" / 10_000_000.0;
assert(seconds.approxEqual(0.5));
On 19.02.2019 19:19, Kagamin wrote:
On Tuesday, 19 February 2019 at 15:30:22 UTC, Atila Neves wrote:
I keep hearing how const is nigh unusable in D, and except for ranges
I litter my code with const everywhere, pretty much just as often as I
used in C++.
I once spent a good amount of effort t
On 19.02.2019 19:35, Alex wrote:
On Tuesday, 19 February 2019 at 16:26:33 UTC, drug wrote:
Well, I understand that using floating point values to represent time
internally is a bad idea and I totally agree. But some convenient API
to convert Duration to floating point and vice versa would be
19.02.2019 19:55, Alex пишет:
On Tuesday, 19 February 2019 at 16:44:23 UTC, drug wrote:
On 19.02.2019 19:35, Alex wrote:
On Tuesday, 19 February 2019 at 16:26:33 UTC, drug wrote:
Well, I understand that using floating point values to represent
time internally is a bad idea and I totally agre
On 20.02.2019 11:05, Kagamin wrote:
On Tuesday, 19 February 2019 at 16:38:17 UTC, drug wrote:
The same I can say about properties - for example I use them in meta
programming to detect what to serialize/process - I skip methods but
serialize properties and for me this is a nice language feature
On 25.02.2019 1:51, 0x wrote:
How to disable dub from checking internet before building, it's slowing
down build whenever it does this.
`--skip-registry=all` let you avoid checking of all dependencies
(https://dub.pm/commandline)
On 04.03.2019 11:14, r-const-dev wrote:
I have a DList of structs, DataPoint, ordered by a struct field, time.
I'm trying to insert a new entry preserving order, so I'm trying to use
`until` to find the insertion point and `insertBefore` with the result.
struct DataPoint {
immutable ulong
On 04.03.2019 13:03, drug wrote:
insertStable needs DList.Range, not Until!... one. You can do something
like this https://run.dlang.io/is/A2vZjW
Oops, it was wrong example, I'd recommend this way -
https://run.dlang.io/is/ugPL8j
```
import std.algorithm, std.container, std.stdio;
struct DataP
On 05.03.2019 2:01, r-const-dev wrote:
Thanks, seems that using dataPoints[] makes dataPoints usable as an
range. How can I learn more about [] operator? I'm not sure I understand
how is this documented in DList.
dataPoints is an aggregate type variable, not a range and slice operator
opSlice
16.03.2019 1:30, eXodiquas пишет:
On Friday, 15 March 2019 at 21:46:50 UTC, Ali Çehreli wrote:
On 03/15/2019 02:43 PM, Sebastiaan Koppe wrote:
On Friday, 15 March 2019 at 21:35:12 UTC, eXodiquas wrote:
Is there any way to achive this behaivour with D2?
Yep. Just make the return type in the f
On 15.05.2019 16:08, Bogdan wrote:
I don't have any experience with using templates. Is it possible to
create a RB tree containing structs, where the nodes are ordered by one
struct member?
```
import std.stdio;
import std.container;
enum KeyID: uint
{
KEY_A,
KEY_S,
KEY_D,
On 17.05.2019 14:39, Ron Tarrant wrote:
On Friday, 17 May 2019 at 11:12:41 UTC, Alex wrote:
ListStore and TreeStore and how they interact with TreeView and ComboBox
via TreeIter, TreeSelection, etc., etc. That's taking most of my time ATM.
That would be really nice!
My use case is a large list
01.06.2019 15:51, David Zhang пишет:
Say I have a struct `S`:
struct S {
/*const*/ char* pointer;
... other members ...
this(/*const*/ char* p, ... others ...) {
pointer = p;
...
}
}
What I want, is to be able to use `S` i
01.06.2019 15:55, drug пишет:
Is there a type-safe way to do this? If this were a class, I'd try
std.typecons.Rebindable.
Ah, sorry))
19.06.2019 17:52, Den_d_y пишет:
void load (const (char *) path)
{
SDL_Surface ab = SDL_LoadBMP (path);
a = SDL_CreateTextureFromSurface (ab);
SDL_FreeSurface (ab);
}
try the following:
```
void load (string path)
{
import std.string : toStringz;
SDL_Surface ab = SDL_Load
26.06.2019 20:39, bauss пишет:
auto stack = SList!int(0);
stack.removeFront();
Then something that just allowed you to do:
auto stack = SList!int;
this compiles:
```
auto stack = SList!int();
```
07.07.2019 17:49, Joseph Rushton Wakeling пишет:
it's possible to do something like `writefln!"%s"(now.toISOExtString)` and have
it automatically use the output range overload rather than allocating a new string
instance.
This is exactly how it is intended to work: https://run.dlang.io/is/ATj
Hello!
Is there a convenient way to get rank of range a.k.a. count of
dimensions in compile time? Like:
static assert( rankOf!(uint[]) == 1);
static assert( rankOf!(uint[][][]) == 3);
01.07.2017 20:33, Ali Çehreli пишет:
On 07/01/2017 10:05 AM, drug wrote:
Hello!
Is there a convenient way to get rank of range a.k.a. count of
dimensions in compile time? Like:
static assert( rankOf!(uint[]) == 1);
static assert( rankOf!(uint[][][]) == 3);
I'm not aware of one but this seems
01.07.2017 22:07, Void-995 пишет:
(Void-995) Hi, everyone. I'm pretty excited with what have D to offer
for game development, especially meta programming, traits,
object.factory, signals and bunch of other neat things that may save a
lot of time. Also, i saw support for vector data types and si
02.07.2017 04:06, Ali Çehreli пишет:
On 07/01/2017 04:56 PM, crimaniak wrote:
> about very long error messages generated in some
> cases.
Please submit a bug report. The compiler may be able to abbreviate
certain types. For example, in this case most of the error message text
is values of a
02.07.2017 09:52, H. S. Teoh via Digitalmars-d-learn пишет:
On Sun, Jul 02, 2017 at 12:49:30AM +, LeqxLeqx via Digitalmars-d-learn
wrote:
Hello!
How does one go about invoking a templated-variatic function such as
std.string.format with an array of objects?
For example:
string stringMyTh
101 - 200 of 389 matches
Mail list logo