On Tuesday, 9 February 2021 at 23:12:57 UTC, Jack wrote:
arr is empty
You need to check for __traits(getOverloads,...), isCallable!,
ReturnType!.
I have a class like this:
struct S { }
class A
{
@(S)
{
int a;
string b() { return ib; }
string b(string s) { return ib = s;}
}
int x;
int y;
string ib = "lol";
}
where I want to list the members
On Tuesday, 9 February 2021 at 20:50:12 UTC, Max Haughton wrote:
On Tuesday, 9 February 2021 at 19:53:27 UTC, Temtaime wrote:
On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote:
Why using 'new' is allowed in pure functions but calling
GC.addRange or GC.removeRange isn't allowed?
pure
On Tuesday, 9 February 2021 at 19:53:27 UTC, Temtaime wrote:
On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote:
Why using 'new' is allowed in pure functions but calling
GC.addRange or GC.removeRange isn't allowed?
pure is broken. Just don't [use it]
[Citation needed]
On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote:
Why using 'new' is allowed in pure functions but calling
GC.addRange or GC.removeRange isn't allowed?
pure is broken. Just don't [use it]
I'm trying to create a super simple dynamic library consisting of
two files:
file2.d --
extern(D):
double addEight(double d) { return (d + 8.0); }
fileB.d --
extern(D)
{
string concatSuffix(string s) {
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:
On Tuesday, 9 February 2021 at 16:39:25 UTC, Dukc wrote:
You may have or may not have done it wrong, but in any case
this is a bug. If you do something wrong, the program should
tell you what you did wrong, instead of telling you that
character '-' does not belong to middle of a long int.
Oh
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
Is d-profile-viewer no longer working? Or did I do something
wrong?
You may have or may not have done it wrong, but in any case this
is a bug. If you do something wrong, the program should tell you
what you did wrong, instead of telling
On Tuesday, 9 February 2021 at 16:25:46 UTC, Paul Backus wrote:
On Tuesday, 9 February 2021 at 16:22:16 UTC, Jeff wrote:
But, those don't work because T is a Tuple of the types. Is
there some trait combination I can use to do this? Something
like (obviously made up)...
all(TemplateArgsOf!T,
On Tuesday, 9 February 2021 at 16:22:16 UTC, Jeff wrote:
But, those don't work because T is a Tuple of the types. Is
there some trait combination I can use to do this? Something
like (obviously made up)...
all(TemplateArgsOf!T, t => isIntegral!t || isSomeString!t)
Thanks!
import std.meta:
Let's say I have...
void foo(T...)(T xs)
{
foreach(x; xs)
{
if (typeid(x) == typeid(int))
writeln("int: ", x);
else
writeln("str: ", x);
}
}
From the body, it's obvious I really only want int or string to
be passed in to foo. Ideally, this
On Tuesday, 9 February 2021 at 12:23:52 UTC, rikki cattermole
wrote:
https://github.com/dlang-community/containers
It uses the older design for allocators (dependency).
Looks good, thank you
https://github.com/dlang-community/containers
It uses the older design for allocators (dependency).
Normally I'm happy with the GC containers in D, they work well
and suit my use.
I have a few uses that would benefit from allocation in memory
arenas or local stack based allocation. Looks like
std.experimental has allocators for those use cases.
But I can't find any containers to make use
15 matches
Mail list logo