for those that don't know: https://circularstudios.com/
I just found out a game using D to develop games but later I see
the last updates on the github, web site, twitter etc is from
2015. Does anyone knows what happend to the company?
On Tuesday, 31 May 2022 at 15:29:16 UTC, frame wrote:
On Monday, 30 May 2022 at 11:18:42 UTC, Alexander Zhirov wrote:
if (here is my condition termination of the program)
OT: Wouldn't it be great to have ArnoldC support? ;-)
i'm pretty sure the terminattor is more efficient than kill -9
On Friday, 20 May 2022 at 12:32:37 UTC, ryuukk_ wrote:
Avoid GTK, it's bloated, GTK4 looks like a toolkit to design
mobile apps, and you need runtime dependencies on windows
adam's gui library is very nice, 0 dependencies
I personally prefer IMGUI, 0 dependencies, you bring the
could you se
On Tuesday, 8 June 2021 at 17:40:19 UTC, Basile B. wrote:
On Tuesday, 8 June 2021 at 17:10:47 UTC, seany wrote:
Hello
How can I increase the speed of executable files created via :
`dub build -b release`
try `dub build -b release --compiler=ldc2`
Then you can set some specific DFlags for l
On Tuesday, 8 June 2021 at 03:04:39 UTC, Mike Parker wrote:
On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote:
the dll which I was just build with dub command? how I have a
version mismatch if they're the very same file?
Electron embeds node and does not use whatever you have on your
syste
On Tuesday, 8 June 2021 at 04:56:27 UTC, NotSpooky wrote:
On Tuesday, 8 June 2021 at 03:04:39 UTC, Mike Parker wrote:
On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote:
[...]
Electron embeds node and does not use whatever you have on
your system. So if there’s a mismatch between the embed
On Tuesday, 8 June 2021 at 03:32:31 UTC, someone wrote:
On Tuesday, 8 June 2021 at 02:59:28 UTC, rikki cattermole wrote:
SafeD is an old name given to the attributes @safe @trusted
@system.
I have the Alexandrescu's book on hand so that explains it.
There is no switch nor any special behavio
On Tuesday, 8 June 2021 at 00:00:50 UTC, Mike Parker wrote:
On Monday, 7 June 2021 at 22:24:03 UTC, Jack wrote:
I think the entry point function is ```void atStart(napi_env
env) {}``` so there's no DllMain...
DLLMain is not strictly required. It's called by the system
loader when the DLL is
On Monday, 7 June 2021 at 20:37:19 UTC, MoonlightSentinel wrote:
On Monday, 7 June 2021 at 19:03:44 UTC, Jack wrote:
actually i didnt so I just added:
```d
shared static this()
{
Runtime.initialize();
}
shared static ~this()
{
Runtime.terminate();
}
```
but it didn't change an
On Monday, 7 June 2021 at 20:13:03 UTC, frame wrote:
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
If this runs under Windows, there is no dlopen(), maybe a
wrapper to LoadLibrary() but this will need to call a DllMain()
in the DLL if I am not wrong. Is there a DllM
On Monday, 7 June 2021 at 20:13:03 UTC, frame wrote:
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
If this runs under Windows, there is no dlopen(), maybe a
wrapper to LoadLibrary() but this will need to call a DllMain()
in the DLL if I am not wrong. Is there a DllM
On Monday, 7 June 2021 at 17:22:48 UTC, MoonlightSentinel wrote:
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:
What am I missing?
Does your code / `node_dlang` initialize Druntime before
calling `writeln`?
actually i didnt so I just added:
```d
shared static this()
{
Runtime.
On Monday, 7 June 2021 at 15:26:27 UTC, someone wrote:
Consider the following code:
```d
class classComputer {
private string pstrName;
final @property string name() { return this.pstrName; }
final @property void name(in string lstrName) {
this.pstrName = lstrName; }
this(
On Sunday, 6 June 2021 at 21:44:44 UTC, NotSpooky wrote:
On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote:
I'm trying to use the node_dlang pakckage but the code example
from [this
repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working
the command ```dub build```
On Sunday, 6 June 2021 at 17:32:57 UTC, Mike Parker wrote:
On Sunday, 6 June 2021 at 15:42:55 UTC, Jack wrote:
0.4.11\node_dlang\source\node_dlang.d(137,11): Error: none of
the overloads of `this` are callable using argument types
`(string, string, ulong, Throwable)`, candidates are:
[...]
T
On Sunday, 6 June 2021 at 06:10:18 UTC, Mike Parker wrote:
On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote:
I'm trying to use the node_dlang pakckage but the code example
from [this
repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working
the command ```dub build`
On Sunday, 6 June 2021 at 06:10:18 UTC, Mike Parker wrote:
On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote:
I'm trying to use the node_dlang pakckage but the code example
from [this
repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working
the command ```dub build`
I'm trying to use the node_dlang pakckage but the code example
from [this
repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working
the command ```dub build``` is fine but ```node example.js```
retuns an error saying the module.node is not a valid win32
application. H
On Wednesday, 26 May 2021 at 13:58:56 UTC, Elmar wrote:
On Saturday, 8 December 2018 at 03:51:02 UTC, Adam D. Ruppe
wrote:
[...]
That's amazing, this should be one thing that should appear in
every tutorial just right at the start! I was looking hours for
a way to generate an "iterator" (a r
On Wednesday, 26 May 2021 at 11:31:31 UTC, Ola Fosheim Grostad
wrote:
On Wednesday, 26 May 2021 at 08:38:29 UTC, Imperatorn wrote:
On Wednesday, 26 May 2021 at 07:34:06 UTC, Ola Fosheim Grøstad
wrote:
On Tuesday, 25 May 2021 at 17:55:17 UTC, Ola Fosheim Grostad
wrote:
Is it possible to use a te
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Well, I program in D as a hobby for just over a year, and I
like to learn and explore this wonderful programming language.
Now I found the DMC compiler that compiles C ++ code. So I
decided to test it. Creating a program with a win32api
gr
On Friday, 14 May 2021 at 14:14:03 UTC, Steven Schveighoffer
wrote:
On 5/13/21 11:49 PM, Jack wrote:
[...]
Just slice the `a`, appropriately. You have to translate the
indexes back into the original array.
```d
auto opSlice(size_t start, size_t end)
{
return typeof(this)(a[$ - end .. $ -
On Friday, 14 May 2021 at 10:00:44 UTC, Christian Köstlin wrote:
On 2021-05-14 05:49, Jack wrote:
[...]
arr.retro()[0..2] already works.
see https://run.dlang.io/is/U8u3br
oh, how i silly of i didn't notice that before
sorry, in this code i mean b must be [5, 4]
```d
auto arr = [1, 2, 3, 4, 5];
auto a = new A!int(arr);
auto b = a.retro[0 .. 2]; //5,4
```
How can I implement ranges in the retro range? I'd like to do
this without allocate a new array with .array from std.array, can
I do that?
use like this:
```d
auto arr = [1, 2, 3, 4, 5];
auto a = new A!int(arr);
auto b = a.retro[0 .. 2]; // 4, 5
```
the class:
```d
class A(T)
{
I'd to change the visibility of a method overrided from public to
private but it doesn't work tho to protected it does. Why is that?
give:
```d
class A
{
void f() { }
}
```
this is ok:
```d
class B : A
{
protected override void f() { }
}
```
this is not:
```d
class B : A
{
priva
On Monday, 10 May 2021 at 21:10:13 UTC, Paul Backus wrote:
On Monday, 10 May 2021 at 21:01:53 UTC, Jack wrote:
[...]
You can do it with a string mixin:
```d
// Note: q{ ... } creates a "token string", a special kind of
string literal
// that's used for code strings.
// See https://dlang.org
mixin template seems to allow only declarations so if I put a if
or case-statement in the body it doesn't work. I'd like to make
something like this work:
```d
switch(code) {
case X, Y: // that specific case repeats alot in
the code in different procedures
let's say I have:
```d
class Base
{
int f()
{
doSomething();
return n * 5;
}
void doSomething() { }
}
class Foo : Base
{
void myMethod() { /* ... */ }
}
class Baa : Base
{
void myMethod2() { /* ... */ }
}
```
then I'd like to make a extended version(mak
On Thursday, 6 May 2021 at 22:16:04 UTC, Per Nordlöw wrote:
On Thursday, 6 May 2021 at 01:04:02 UTC, Jack wrote:
Does it allocate the object rather on stack, like auto scope a
= new A or what?
Further note that
auto scope a = new A;
can be written shorter as
scope a = new A;
I'll
On Thursday, 6 May 2021 at 02:11:27 UTC, Mike Parker wrote:
On Thursday, 6 May 2021 at 01:04:02 UTC, Jack wrote:
Does it allocate the object rather on stack, like auto scope a
= new A or what?
It doesn't do anything to classes. `@nogc` prevents you from
any action triggers a GC allocation, su
Does it allocate the object rather on stack, like auto scope a =
new A or what?
I have a block of code that the only thing that change is the
type passed in one of the template functions called so I'd like
to make a DRY for this. But I'm not just replacing by a function
due to control-flow, for example, there are if-statements where
one just break and the other return 0. I
On Tuesday, 20 April 2021 at 19:56:33 UTC, Steven Schveighoffer
wrote:
I have had the need in some cases to *maybe* set a const value
inside a loop. One can sometimes abstract this into a lambda
function, but sometimes this is not possible (e.g. if the loop
is static). Not only that, but I may
On Sunday, 25 April 2021 at 08:36:51 UTC, Adam D. Ruppe wrote:
On Sunday, 25 April 2021 at 03:45:13 UTC, Jack wrote:
that's better, thanks
Imporant to remember that any compile time thing will be the
static type. If someone does:
Base a = new Derived();
a.something();
it will still show up
On Sunday, 25 April 2021 at 02:45:38 UTC, Paul Backus wrote:
On Sunday, 25 April 2021 at 02:26:00 UTC, Jack wrote:
doesn't this work when called from member in a derived class?
```d
class A
{
void doSomething(this T)()
{
writefln("name = [%s]", __traits(identif
On Sunday, 25 April 2021 at 02:26:00 UTC, Jack wrote:
On Sunday, 25 April 2021 at 02:02:47 UTC, Ali Çehreli wrote:
On 4/24/21 6:50 PM, Jack wrote:
I'd like to output `K` and get this identifier at compile
time.
This is solved by the "this template parameter":
import std.stdio;
class A {
v
On Sunday, 25 April 2021 at 02:02:47 UTC, Ali Çehreli wrote:
On 4/24/21 6:50 PM, Jack wrote:
I'd like to output `K` and get this identifier at compile time.
This is solved by the "this template parameter":
import std.stdio;
class A {
void showMyName(this T)() {
writefln("name = [%s]",
On Sunday, 25 April 2021 at 02:02:47 UTC, Ali Çehreli wrote:
On 4/24/21 6:50 PM, Jack wrote:
I'd like to output `K` and get this identifier at compile time.
This is solved by the "this template parameter":
import std.stdio;
class A {
void showMyName(this T)() {
writefln("name = [%s]",
On Saturday, 24 April 2021 at 04:09:15 UTC, Mike Parker wrote:
On Saturday, 24 April 2021 at 03:40:20 UTC, Jack wrote:
Can I rely on this format from fullyQualifiedName? for
example, let's say I do:
```d
enum s = fullyQualifiedName!f.split;
```
where f is a function member of a class. Can I r
```d
class A
{
void showMyName()
{
writefln("name = [%s]", __traits(identifier, typeof(this)));
}
}
class K : A { }
```
then
```d
new K().showMyName();
```
output:
name = [A]
I'd like to output `K` and get this identifier at compile time.
But I'd to d
Can I rely on this format from fullyQualifiedName? for example,
let's say I do:
```d
enum s = fullyQualifiedName!f.split;
```
where f is a function member of a class. Can I realy that s[0] is
the module name, s[1] is the class name and s[2] the functio
name? is this standard or can the compil
In order to my array class work with filter, I went to implement
an ``InputRange``. But I don't quite get how do that and didn't
find much help on the docs. From below code, is ``moveFront()``
implemented correctly? I'm using a simple int i as index of
current item and in popFront() just increm
On Thursday, 15 April 2021 at 17:48:02 UTC, Imperatorn wrote:
On Thursday, 15 April 2021 at 16:39:30 UTC, Kagamin wrote:
On Wednesday, 14 April 2021 at 20:38:16 UTC, Mario wrote:
[...]
String mixins is D replacement of macros for code generation.
Works like this:
```d
mixin("class MyDynamicCl
On Sunday, 11 April 2021 at 20:38:10 UTC, Pierre wrote:
Hi,
I have a class with a reference to the parent object and a
constructor that has the parent as parameter
class foo {
this ( foo p /* , other params */ ) {
parent = p;
}
foo parent;
}
Of cause,
Give this class:
```d
class A
{
int X() { return x; }
int X(int v) { return x = v;}
private int x;
}
```
I'd like to allow use ```+=```, ```-=``` operators on ```X()```
and keep encapsulation. What's a somehow elegant way to do that?
On Thursday, 8 April 2021 at 16:45:14 UTC, Jack wrote:
On Thursday, 8 April 2021 at 04:02:26 UTC, Ali Çehreli wrote:
On 4/7/21 8:57 PM, Brad wrote:
auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0];
I want to come out of this with a string that looks like
this: 101110100
Me, me, me, me! :)
i
On Thursday, 8 April 2021 at 04:02:26 UTC, Ali Çehreli wrote:
On 4/7/21 8:57 PM, Brad wrote:
auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0];
I want to come out of this with a string that looks like this:
101110100
Me, me, me, me! :)
import std;
void main()
{
auto a = [1,0,1,1,1,0,1,0,1,1
On Sunday, 28 March 2021 at 16:45:29 UTC, dog2002 wrote:
I mean, I want to write a string without a new line. For
example, some command line applications have progress bars.
For a single line string I use \r. But it doesn't work for a
multiple line string - the application is just adding new l
On Friday, 26 March 2021 at 06:45:39 UTC, Daniel Kozak wrote:
On Fri, Mar 26, 2021 at 7:36 AM Daniel Kozak
wrote:
On Fri, Mar 26, 2021 at 7:31 AM Daniel Kozak
wrote:
On Fri, Mar 26, 2021 at 6:50 AM Jack via Digitalmars-d-learn
< digitalmars-d-learn@puremagic.com> wrote:
What
What's the equivalent of C's VLA in D? scoped from std.typecons
doesn't seem to work with arrays. Should I use alloca() for my
array or is there something else?
On Wednesday, 24 March 2021 at 08:31:19 UTC, Basile B. wrote:
On Wednesday, 24 March 2021 at 07:58:22 UTC, Per Nordlöw wrote:
When wrapping C code that tries to allocate memory resources
via functions such as
X* X_create();
should one call `onOutOfMemoryError();` upon null return?
Making
On Saturday, 20 March 2021 at 00:16:06 UTC, Steven Schveighoffer
wrote:
On 3/19/21 12:41 PM, Jack wrote:
On Friday, 19 March 2021 at 08:54:50 UTC, Paul Backus wrote:
On Friday, 19 March 2021 at 07:14:46 UTC, Jack wrote:
give below template struct, how can I list the members x, y
and z? I've tr
On Friday, 19 March 2021 at 17:40:39 UTC, frame wrote:
On Friday, 19 March 2021 at 16:41:11 UTC, Jack wrote:
thanks this works fine outside a method but not in a static
method. what am I missing?
Reading the manual ;)
To use isInstanceOf to check the identity of a template while
inside of s
there's a value passed as template parameter which is know at
compile time (can be used with static if) but I don't know how
can I pass it around and use in a property. Obviously enum
deosn't work because it would be a local to the function.
immutable would result in compiler can't read it at c
On Friday, 19 March 2021 at 08:54:50 UTC, Paul Backus wrote:
On Friday, 19 March 2021 at 07:14:46 UTC, Jack wrote:
give below template struct, how can I list the members x, y
and z? I've tried something with OriginalType and TemplateOf
but no luck... it seems if I do foo!"str1" the "str1" becam
On Friday, 19 March 2021 at 07:56:26 UTC, Panke wrote:
On Friday, 19 March 2021 at 07:14:46 UTC, Jack wrote:
give below template struct, how can I list the members x, y
and z? I've tried something with OriginalType and TemplateOf
but no luck... it seems if I do foo!"str1" the "str1" became
"pa
give below template struct, how can I list the members x, y and
z? I've tried something with OriginalType and TemplateOf but no
luck... it seems if I do foo!"str1" the "str1" became "part of
type"? give .stringof from typeof(__traits(getMember, foo,
field)) I thought the type would be foo!strin
let's assume this class:
class C
{
private S m_s;
this()
{
m_s = S(30);
}
ref S value() { return m_s; }
ref S value(ref S s)
{
return m_s = s;
}
}
and I do something like this:
auto s1 = S(
On Tuesday, 16 March 2021 at 17:26:01 UTC, Vinod K Chandran wrote:
Hi all,
I am creating a Button class with Win32 API functions. So far
so good. I am using NM_CUSTOMDRAW message to change the back
color of my buttons. It's really easy to change the back color
in this way. But I can't change t
On Tuesday, 16 March 2021 at 15:02:54 UTC, Steven Schveighoffer
wrote:
On 3/16/21 8:49 AM, Per Nordlöw wrote:
I find myself writing
foreach (_; 0 .. n)
doSomething(); // no using the variable `_`
.
What about relaxing the syntax to allow
foreach (; 0 .. n)
and/or
foreach (0
On Tuesday, 16 March 2021 at 16:02:14 UTC, Vinod K Chandran wrote:
On Sunday, 28 February 2021 at 13:15:47 UTC, Adam D. Ruppe
wrote:
And it is the simplest thing, no missing length, no weird
property casting. The GC handled with two simple add/remove
calls.
Perfect example of teaching somet
On Sunday, 28 February 2021 at 13:15:47 UTC, Adam D. Ruppe wrote:
On Sunday, 28 February 2021 at 07:05:27 UTC, Jack wrote:
I'm using a windows callback function where the user-defined
value is passed thought a LPARAM argument type. I'd like to
pass my D array then access it from that callback f
On Friday, 5 March 2021 at 21:24:08 UTC, tsbockman wrote:
On Friday, 5 March 2021 at 21:17:24 UTC, tsbockman wrote:
On Friday, 5 March 2021 at 21:02:08 UTC, H. S. Teoh wrote:
class C {...}
import core.memory : GC;
C c = cast(C) GC.malloc(C.sizeof);
...
...
On Friday, 5 March 2021 at 21:25:52 UTC, Ali Çehreli wrote:
On 3/5/21 12:57 PM, Jack wrote:
>> destroy() executes the destructor.
>
> but I would need to call it manually and only after I
somewhat I've
> determined I no longer need the resources, right? so
destroy(c) would be
> no different from
On Friday, 5 March 2021 at 21:02:08 UTC, H. S. Teoh wrote:
On Fri, Mar 05, 2021 at 08:24:26PM +, Jack via
Digitalmars-d-learn wrote:
On Friday, 5 March 2021 at 20:18:44 UTC, Max Haughton wrote:
> On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote:
[...]
> > But the ones heap
On Friday, 5 March 2021 at 20:28:58 UTC, Ali Çehreli wrote:
On 3/5/21 12:24 PM, Jack wrote:
Are there some kind of replacement or I have to make my own
finalize-like method, once I determine somewhat the
application no longer need those resources?
destroy() executes the destructor.
but I w
On Friday, 5 March 2021 at 20:18:44 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote:
On Friday, 5 March 2021 at 20:10:39 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:03:58 UTC, Jack wrote:
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Fr
On Friday, 5 March 2021 at 20:10:39 UTC, Max Haughton wrote:
On Friday, 5 March 2021 at 20:03:58 UTC, Jack wrote:
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it
did happ
On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not
possible in the descontrutor? if so, why?
https://dlang.org/b
On Friday, 5 March 2021 at 05:42:03 UTC, evilrat wrote:
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not
possible in the descontrutor? if so, why?
GC prohibits allocati
On Friday, 5 March 2021 at 04:22:23 UTC, Steven Schveighoffer
wrote:
On Friday, 5 March 2021 at 02:13:39 UTC, Jack wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I have to write
one? just making sure to not reinvent the wheel
[1
On Friday, 5 March 2021 at 02:43:36 UTC, H. S. Teoh wrote:
On Fri, Mar 05, 2021 at 02:13:39AM +, Jack via
Digitalmars-d-learn wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I have to write
one? just making sure to not reinvent
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not possible
in the descontrutor? if so, why?
core.exception.InvalidMemoryOperationError@src\core\exception.d(647): Invalid
memory operation
import std.stdio;
int main()
{
something like filter[1] but that stops at first match? are there
any native functions for this in D or I have to write one? just
making sure to not reinvent the wheel
[1]: https://devdocs.io/d/std_algorithm_iteration#filter
the one that the compiler defaults to when you don't provide one?
bool g(T)(T)
{
return __traits(compiles, mixin("{ enum a = t; }"));
}
int a;
enum s = "";
// both return false but g(s) is expected to return true
pragma(msg, g(s));
pragma(msg, g(a));
On Monday, 1 March 2021 at 03:12:42 UTC, Adam D. Ruppe wrote:
On Monday, 1 March 2021 at 03:07:19 UTC, Jack wrote:
isn't clear for me if reserve() does preallocate memory so
that that operator like arr ~= x can use previously allocate
memory by reserve() or it's just used in slices like b = arr
isn't clear for me if reserve() does preallocate memory so that
that operator like arr ~= x can use previously allocate memory by
reserve() or it's just used in slices like b = arr[x .. y]?
On Saturday, 27 February 2021 at 01:23:06 UTC, H. S. Teoh wrote:
On Sat, Feb 27, 2021 at 01:03:56AM +, Jack via
Digitalmars-d-learn wrote:
On Friday, 26 February 2021 at 23:37:18 UTC, Murilo wrote:
> On Friday, 26 February 2021 at 05:25:14 UTC, Jack wrote:
> > I started with:
>
I'm using a windows callback function where the user-defined
value is passed thought a LPARAM argument type. I'd like to pass
my D array then access it from that callback function. How is the
casting from LPARAM to my type array done in that case?
for example, I need something like this to wor
On Friday, 26 February 2021 at 23:37:18 UTC, Murilo wrote:
On Friday, 26 February 2021 at 05:25:14 UTC, Jack wrote:
I started with:
enum isAssignableNull(T) = is(T : Object) || isPointer(T);
but how do I cover all cases?
You can check if it's null with this `variable is null` and you
can tes
On Friday, 26 February 2021 at 19:37:34 UTC, Adam D. Ruppe wrote:
On Friday, 26 February 2021 at 19:32:52 UTC, Jack wrote:
I managed to do this with alias parameter in a template:
this is the only way, it needs to be an alias template
Also, can I short this template function somehow to syntax
int a = 10;
f(a); // print "a"
int b = 10;
f(b); // print "b"
I managed to do this with alias parameter in a template:
template f(alias s, string file = __FILE__, size_t line =
__LINE__)
{
import std.exception : enforce;
import std.string : format;
void g()
{
writeln(__t
On Friday, 26 February 2021 at 05:45:39 UTC, Nathan S. wrote:
On Friday, 26 February 2021 at 05:34:26 UTC, Paul Backus wrote:
On Friday, 26 February 2021 at 05:25:14 UTC, Jack wrote:
I started with:
enum isAssignableNull(T) = is(T : Object) || isPointer(T);
but how do I cover all cases?
Som
I started with:
enum isAssignableNull(T) = is(T : Object) || isPointer(T);
but how do I cover all cases?
I have a base class that loads a value and if it isn't net, load
a default value. Since the value can be set, I'd like to do lazy
evaluation of this default value until it's really needed. So
rather have a C defValue = xxx, that makes xxx to be loaded even
if defValue doesn't get used. So I tho
On Saturday, 13 February 2021 at 07:08:58 UTC, mw wrote:
On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote:
I have a base class A, where I make specific operator
depending on the derived class type. Currently I'm using
something like this:
c is a class derived from A
bool shouldDoX =
On Saturday, 13 February 2021 at 19:40:43 UTC, frame wrote:
On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote:
I have a base class A, where I make specific operator
depending on the derived class type. Currently I'm using
something like this:
c is a class derived from A
bool shouldDoX
On Saturday, 13 February 2021 at 09:54:28 UTC, Rumbu wrote:
On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote:
I have a base class A, where I make specific operator
depending on the derived class type. Currently I'm using
something like this:
c is a class derived from A
bool shouldDoX
On Tuesday, 16 February 2021 at 00:39:33 UTC, Steven
Schveighoffer wrote:
On 2/15/21 4:04 PM, Jack wrote:
I have to make my function nothrow because the function that
calls it (not written by me) is nothrow. So I need to wrap my
code in a try-catch() but how will I report the error message,
if
Why doesn't this compiles?
class Baa
{
Foo Foo = new Foo();
}
On Sunday, 21 February 2021 at 09:30:14 UTC, Jacob Carlborg wrote:
On 2021-02-21 07:12, Jack wrote:
I've had a struct like this:
struct Attr
{
string value;
}
struct Foo
{
@(Attr("a attr"))
enum a = Foo(10);
@(Attr("b attr"))
enum b = Foo(11);
int x;
int y
I've had a struct like this:
struct Attr
{
string value;
}
struct Foo
{
@(Attr("a attr"))
enum a = Foo(10);
@(Attr("b attr"))
enum b = Foo(11);
int x;
int y;
bool doY = true;
int value()
{
if someone happens to be looking to do that in the future: I
didn't find a way to do this with a linker but managed to find a
way to do this with code only. The code goes like this:
// source: https://stackoverflow.com/a/10444161/800123
#include
// NOTE: It is recommended that you delay-load
I have to make my function nothrow because the function that
calls it (not written by me) is nothrow. So I need to wrap my
code in a try-catch() but how will I report the error message, if
the toString() from Throwable isn't nothrow? how do I get out
this circular dependence?
void f() nothro
I need to check if an instance is of a specific type derived from
my base class but this class has template parameter and this type
isn't available at time I'm checking it. Something like:
class B { }
class A(T) : B { }
class X : B { }
class Z : B { }
auto c = can be any derived class from B
b
I have a base class A, where I make specific operator depending
on the derived class type. Currently I'm using something like
this:
c is a class derived from A
bool shouldDoX = (cast(X)c) !is null || (cast(Y)c) !is null ||
(cast(K)c) !is null ... ;
as the number of cast(C) !is null is growin
helpful always,thank you guys
1 - 100 of 252 matches
Mail list logo