On Sunday, 11 July 2021 at 13:30:27 UTC, zjh wrote:
Could you explain more detail?
It is just normal code with a normal name. The fact there's
another variable with the same name doesn't change anything.
On Sunday, 11 July 2021 at 13:21:35 UTC, DLearner wrote:
Is there a 'D' way of avoiding the issue?
Pass the size as a parameter to the thing instead of trying to
combine things. like
mixin template Thing(size_t size) {
ubyte[size] pool;
}
and where you want it like
mixin
On Sunday, 11 July 2021 at 05:20:49 UTC, someone wrote:
```d
mixin template templateUGC (
typeStringUTF,
alias lstrStructureID
) {
public struct lstrStructureID {
typeStringUTF whatever;
}
This creates a struct with teh literal name `lstrStructureID`.
Just like any
On Sunday, 11 July 2021 at 12:37:20 UTC, DLearner wrote:
C:\Users\SoftDev\Documents\BDM\D\Examples\CTFE\T2>type k_mod.d
// k_mod.d
ubyte[MemSiz] MemPool;
You didn't import the other module here.
D's imports aren't like C's includes. Each module is independent
and can only see what it
On Friday, 9 July 2021 at 03:09:52 UTC, Tony wrote:
The editor I am using (Code::Blocks) displays the characters
just fine. So it seems that the error message should be "Error:
Outside the ASCII code space".
D supports stuff outside the ASCII code space just fine.
Are you sure the file is
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
It may be based on any library: SDL, GLFW, Derelict, etc.
my library
http://arsd-official.dpldocs.info/arsd.simpledisplay.html#topic-modern-opengl
arsd-official:simpledisplay dependency on dub, or just download
color.d and
On Tuesday, 6 July 2021 at 10:06:11 UTC, Jack Applegame wrote:
How to disable `register.clock = 10;`
You don't. The language always allows `a = b;` to be rewritten as
`a(b);`.
Best you can do is use different types for the two arguments.
Maybe clock could take a struct Clock { int x; } or
On Thursday, 24 June 2021 at 07:28:56 UTC, kinke wrote:
*scope* classes are deprecated (I don't think I've ever seen
one);
I used it for my database thing where it is supposed to be
destroyed reliably but also uses runtime polymorphism.
I now suggest people just stick `scope(exit)
On Thursday, 17 June 2021 at 15:57:46 UTC, Justin Choi wrote:
I want to write something like `DList!int[]()`
DList!(int[])() ?
On Wednesday, 9 June 2021 at 17:56:24 UTC, Gregor Mückl wrote:
class Bar { Foo foo = new Foo(); }
This is a static initialization
The assert fails. This is completely surprising to me. Is this
actually expected?
Yes, it is expected if you are familiar with the spec.
All member = x
On Saturday, 5 June 2021 at 02:38:50 UTC, someone wrote:
Furthermore, if, **at least**, there was a way to clearly state
what is short (eg 1S a la 1L) things will improve a lot
That actually doesn't matter. The compiler actually will
automatically type it to the most narrow thing it fits. The
On Saturday, 5 June 2021 at 01:46:45 UTC, someone wrote:
What's the point of declaring, for instance ushort's if then
nothing will treat them as ushort's and I have to manually
cast() everything to ushort() all the time ?
Yeah, it totally sucks.
D inherited a silly rule from C - the promote
On Friday, 4 June 2021 at 11:33:32 UTC, wjoe wrote:
This is a contrived example. In reality I would use this with
custom array, hash map and other container implementations so I
could use them in @nogc territory by just switching out the
allocator.
If they are templates, just don't specify
On Friday, 4 June 2021 at 11:27:05 UTC, seany wrote:
In my untrained eye, this seems haphazard. One requires the use
of the new keyword
It doesn't.
T[] a;
just works. it is an array of length 0.
On Tuesday, 1 June 2021 at 22:39:08 UTC, Ola Fosheim Grøstad
wrote:
My understanding is that dropping OS icons onto the web view is
problematic
You have to subscribe to the particular content type so it
doesn't always work but it is totally doable.
You can play with it using
On Tuesday, 1 June 2021 at 21:47:38 UTC, Ola Fosheim Grøstad
wrote:
Right now, drag-and-drop is not as easily supported in browser
UIs though. That is an argument for using native UI.
eh web drag and drop isn't half bad at all. Have you ever used it?
Note: Many simple GUI toolkits are
On Tuesday, 1 June 2021 at 03:36:00 UTC, someone wrote:
On Sunday, 30 May 2021 at 07:03:38 UTC, Chris Piker wrote:
Of the 107 forks of dlangui last seen on github ...
I can't believe it. What a waste of time/resources. It is like
if I forked MATE, changed the title, made 10/20/or-so changes
On Tuesday, 1 June 2021 at 05:26:47 UTC, Mike Parker wrote:
But have you actually investigated it? It's being actively
maintained.
https://github.com/d-widget-toolkit/dwt
Yeah, DWT is solidly OK. I'd pick it over gtkd if you wanted to
target Windows since it doesn't use gtk there.
On Monday, 31 May 2021 at 21:46:09 UTC, data pulverizer wrote:
Something interesting is using arrays. I can see that if you
instantiate an array within the D function using `new`, for
instance
Passing one of those to a C function is iffy anyway because the C
function can hide it from the
On Sunday, 30 May 2021 at 18:42:34 UTC, data pulverizer wrote:
I wonder if it is a purposeful design
It is by design: https://dlang.org/articles/hijack.html
Basically the idea behind it is to make sure that a change in a
lib you import doesn't change your existing code without you
realizing
On Sunday, 30 May 2021 at 09:39:28 UTC, cc wrote:
Is there any way to enforce at compile time that we're not
accidentally allocating when creating a delegate, other than
being carefully aware of what variables are referenced inside
the body?
Use `function` instead of `delegate`. Then it
On Saturday, 29 May 2021 at 10:51:47 UTC, btiffin wrote:
Will politely disagree about 1 or 2 can't do by themselves...
Yeah, yeah they can.
Well, I've actually done it.
My minigui has its quirks I'm slowly working through, but it
clearly isn't impossible.
On Thursday, 27 May 2021 at 20:42:11 UTC, M.M. wrote:
I assume that you, Adam and Steven, hold the new (YAI)DIP in
high regards. Is that right?
Yeah, there's a few small tweaks I'd make (I opened an issue on
the repo with them), but I'm pretty happy with it and simplifying
the goals like it
On Thursday, 27 May 2021 at 20:44:21 UTC, frame wrote:
Did you mean to add the delegate as GC root or the data?
The delegate.ptr property.
On Thursday, 27 May 2021 at 12:59:02 UTC, frame wrote:
But what about the data used in the context of the delegate?
If the delegate is created by the GC and stored it will still be
managed by the GC, along with its captured vars.
As long as the GC can see the delegate in your example you
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:
- like a simple classical UI: favored over any modern one:
My minigui is a thing of beauty. Behold:
http://arsdnet.net/minigui-linux.png
http://arsdnet.net/minigui-sprite.png
its docs:
On Tuesday, 25 May 2021 at 17:52:14 UTC, Gavin Ray wrote:
void takesADerived(Derived derived);
extern class Derived : Base1, Base2
Like I said in chat, these are NOT the same thing. The C++
Derived is a *sibling* class, not a parent, child, nor binding to
the D Derived.
All your
On Friday, 21 May 2021 at 22:37:34 UTC, Alain De Vos wrote:
Next code format a string and prints it.
But I want the formatted string stored in a string
```
//Decimal place separator %,
writefln!"%,s"(123456789);
//123,456,789
```
std.format.format
On Monday, 17 May 2021 at 20:38:12 UTC, Chris Piker wrote:
What is the general state of support for GC dependent D-code
running as webassembly? If the runtime is not ready that's
okay, just wanted to inquire about the state of things.
There is a partial port of full runtime but it is still
On Monday, 17 May 2021 at 16:54:18 UTC, noid wrote:
Hi! I am pretty new on Dlang and I wanted to make a small
password manager that used some sort of encryption on a file
(for example AES256) and save a password to decrypt it later,
so you can copy the password.
I haven't done this
On Monday, 17 May 2021 at 14:56:21 UTC, Steven Schveighoffer
wrote:
It used to be required, but we removed that requirement a long
time ago.
yeah i remember ElementType required it last time i checked but
that was a while ago
indeed it is all fixed now
On Monday, 17 May 2021 at 00:27:01 UTC, SealabJaster wrote:
I've opened a PR (https://github.com/dlang/dmd/pull/12526) with
a super hacked together proof-of-concept.
oh very good! I was going to add something similar to my own todo
list but who knows when I'd get around to it.
This kind of
On Sunday, 16 May 2021 at 22:17:16 UTC, Chris Piker wrote:
It seems there's a broken symmetry in compiler error reporting
for the following, ostensibly identical, cases:
Oh yes, I completely agree with you.
Sometimes error messages even use the name but it is from a
different module so it is
On Sunday, 16 May 2021 at 15:12:25 UTC, Nick wrote:
Is this warning still valid?
The @property thing doesn't do much. All it does is change
typeof(a.prop) from function over to the return value of the
function. (Which actually makes it required for the range empty
and front things!)
But
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Error: undefined identifier 'SetDCBrushColor'
Did you include gdi32.lib on the command line?
On Sunday, 16 May 2021 at 12:54:19 UTC, Chris Piker wrote:
a = b; // Lambdas as arguments instead of types works
Wait a sec, when you do the
```d
auto a = S!(a => a*2)();
```
That's not actually passing a type. That's passing the (hidden)
name of a on-the-spot-created function template
On Sunday, 16 May 2021 at 08:04:06 UTC, cc wrote:
If the goal is to absolutely squeeze the GC back down after
using new or dynamic arrays, I find destroy + GC.free often
fails to do the trick (e.g. GC.stats.usedSize remains high).
destroy + GC.free has a quirk - GC.free only works on what
On Saturday, 15 May 2021 at 17:55:17 UTC, Alain De Vos wrote:
Feature request, a function old which does the opposite of new,
allowing deterministic,real-time behavior and memory
conservation.
You're best off doing malloc+free if you want complete control
though.
On Saturday, 15 May 2021 at 18:15:24 UTC, Dennis wrote:
On Saturday, 15 May 2021 at 17:55:17 UTC, Alain De Vos wrote:
Feature request, a function old which does the opposite of
new, allowing deterministic,real-time behavior and memory
conservation.
You can use
On Saturday, 15 May 2021 at 13:46:57 UTC, Chris Piker wrote:
I'm trying to do that, but range3 and range2 are written by me
not a Phobos wizard, and there's a whole library of template
functions a person needs to learn to make their own pipelines.
For example:
Phobos has plenty of design
On Saturday, 15 May 2021 at 16:52:10 UTC, Alain De Vos wrote:
When I do a "new" in a struct constructor to assign to a member
variable of this struct, what do i write in the same struct
destructor to free the memory ?
If you used `new` the garbage collector is responsible for it.
On Saturday, 15 May 2021 at 11:46:49 UTC, Dennis wrote:
You can do `dmd -i -run main.d`
Yeah but that's weird with how it handles arguments and without
the compilation cache it gets really annoying to use.
On Saturday, 15 May 2021 at 11:25:10 UTC, Chris Piker wrote:
Then the type definition of mega_range is something in the
order of:
The idea is you aren't supposed to care what the type is, just
what attributes it has, e.g., can be indexed, or can be assigned,
etc.
You'd want to do it all in
On Saturday, 15 May 2021 at 07:15:51 UTC, DLearner wrote:
rdmd main.d
rdmd sucks, it runs the compiler twice and get the list of
imports and even then it might not see them all.
Just use
dmd -i main.d
instead. It will be about 2x faster and more reliable.
The downside differences though:
On Friday, 14 May 2021 at 22:39:29 UTC, frame wrote:
- how can I tell the compiler that I do not want to handle some
calls?
Put a template constraint on it. `void opDispatch(string s)()
if(s == "whatever")` or minimally like `if(s != "popFront")`
This kind of thing is why I always put
On Friday, 14 May 2021 at 17:38:54 UTC, Danny Arends wrote:
Hmm, things gotta have a license, why not GPL would CC0 be
better? is attribution and sharing code so weird ?
GPL is a perfectly fine license. If people don't want to use it
because of that, their loss, not your problem.
On Thursday, 13 May 2021 at 21:30:43 UTC, Marcone wrote:
template foo(alias pred = "a*b"){
void foo(int x, int y){
writeln(x.unaryFun!pred);
First, you really shouldn't use these at all. instead of a
string, just pass an actual function to the thing as the
predicate.
On Thursday, 13 May 2021 at 17:48:34 UTC, kdevel wrote:
Then D's pure does not match up with WP's definition [1] of
pure, at least not
Yeah, D's pure is actually useful without being a huge hassle.
Makes it into a useful building block that can be used inside
other scenarios than the purely
On Thursday, 13 May 2021 at 17:07:51 UTC, Jeff wrote:
I have a class where I'd like to supply it with an
InputRange!string. Yet, for the life of me I can't seem to pass
to it a File.byLine, even though the documentation states it's
an InputRange.
byLine is not a range of string. It is a
On Thursday, 13 May 2021 at 13:30:29 UTC, Alain De Vos wrote:
Or have I a wrong understanding of pure or the compiler.
pure means it doesn't depend on any mutable info outside its
arguments.
You are only working on the arguments there so it is ok.
On Monday, 10 May 2021 at 23:35:06 UTC, Tim wrote:
I can't find that in the docs, nor in dpldocs. Can you help out
with this?
dpldocs.info/signal it comes up as the second result.
The C function you call from there (on linux anyway) is
sigaction. A little copy/paste out of my terminal.d:
On Monday, 10 May 2021 at 23:20:47 UTC, Tim wrote:
Hi all,
How can I get a D program to detect something a keyboard
interrupt so I shut things down in a specific way?
import core.sys.posix.signal; then you can use the same functions
as C to set signal handlers.
On Sunday, 9 May 2021 at 10:53:49 UTC, tcak wrote:
The "dim" template parameter has a default value of 1 already.
Why does it still force me to give a value?
It doesn't, but it does require you to instantiate the template.
You can do `OpenClKernel!()` to use the default value.
But without
On Saturday, 8 May 2021 at 18:33:35 UTC, Jack wrote:
```d
abstract class DRY : Base
{
this(int n)
{
this.n = n;
}
override int f()
{
super.doSomething();
return n;
}
private int n;
}
```
You can change that from abstract class to `mixin
On Saturday, 8 May 2021 at 02:29:18 UTC, Stephen Miller wrote:
Is there an easy way to know what the system functions are?
they are imported.
Windows uses winsock:
http://phobos.dpldocs.info/source/std.socket.d.html#L50
posix uses their socket thing:
On Saturday, 8 May 2021 at 01:45:49 UTC, Stephen Miller wrote:
I am writing a tcp proxy server and I noticed that when a
socket is in non-blocking mode, it returns -1 if it doesn't
receive data, as opposed to 0.
It sets the `wouldHaveBlocked` flag in that case returning -1. 0
always means
On Friday, 7 May 2021 at 18:07:45 UTC, Nick wrote:
The class grammar, as defined in the D language specification
([Classes](https://dlang.org/spec/grammar.html#classes)), seems
to imply that a class can inherit from a fundamental type.
Explicitly, the specification says that a 'SuperClass' is
On Thursday, 6 May 2021 at 20:21:32 UTC, Marcone wrote:
Is it compatible with C++ 17 or 20?
No, it is based on the 1998 standard.
On Thursday, 6 May 2021 at 19:59:01 UTC, Marcone wrote:
Well, I am writing a C++ program and compiling with DMC Digital
Mars, and the program is running normally. Can the DMC
completely replace the C or C ++ compiler?
It IS a C and C++ compiler.
On Sunday, 2 May 2021 at 02:34:41 UTC, cc wrote:
which seems to fix it, but I'm not entirely sure what's going
on, if this is expected behavior, if that's the correct way to
handle it, and so on.
Oh I've been working on this the last couple weeks and having a
hard time reproducing outside
On Wednesday, 28 April 2021 at 19:46:00 UTC, Alain De Vos wrote:
Following code produces a linker error.
d: error: undefined symbol: wxApp::OnInit()
```
extern(C++)
{class wxApp {
public:
bool OnInit();
//virtual
On Wednesday, 28 April 2021 at 15:09:36 UTC, eXodiquas wrote:
```d
class Particle : Drawable
{
CircleShape shape = new CircleShape(5);
This `new` is actually run at compile time, so every instance of
Particle refers to the same instance of CircleShape (unless you
rebind it).
On Tuesday, 27 April 2021 at 14:28:12 UTC, jmh530 wrote:
However, should it ever matter if you escape an immutable?
Your example is a pretty clear case of use-after-free if gloin
actually did escape the reference and kept it after main returned.
I tried basically the same thing in Rust and
On Monday, 26 April 2021 at 08:00:08 UTC, Raimondo Mancino wrote:
C:\D\dmd2\src\druntime\import\core\sys\windows\dll.d:
\object.d(18): can only `*` a pointer, not a `typeof(null)`
Do you have a separate object.d in your current directory? That
can cause all kinds of weird errors.
Otherwise
On Monday, 26 April 2021 at 14:44:53 UTC, cc wrote:
I run a D program through the basic cmd.exe, it runs with no
stdout buffering.
You'll find the same thing with C programs, since it is actually
the C standard library that does this buffering rather than D.
If it is writing to a character
On Sun, Apr 25, 2021 at 08:10:17PM +, graw via Digitalmars-d-learn wrote:
> A few years ago I know there was some efforts to get D building for android
> with LDC and dlangui building for android.
I don't know about dlangui, but I had success getting hello world
working on android, including
On Sunday, 25 April 2021 at 12:54:43 UTC, Jack wrote:
I find out this later. I give up trying to get this in
automatic way at compile time
That's because the type might not be known at compile time at
all, it might come from like a plugin loaded at run time and only
ever accessed through the
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 as Base in the this template. The knowledge
that it is
On Friday, 23 April 2021 at 00:44:58 UTC, tcak wrote:
As far as I see, it is not related to that array or indices at
all.
The question of where is to see if it was CTFE allocated or
runtime allocated. I don't think it should make a difference here
but idk.
If there is no known situation
On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote:
"positions" array is defined as auto positions = new float[ 100
]; So, I am 100% sure, it is not out of range. "ri*dim + 1" is
not a big number at all.
Oh and *where* is that positions variable defined?
Are there any other threads in your program?
On Monday, 19 April 2021 at 18:05:46 UTC, cc wrote:
This seems to work if I flush after every printf or write in
both main and the dll. I was under the impression they were
supposed to share the same IO buffers though, is this not the
case?
Very little in D dlls right now are shared, so
On Monday, 19 April 2021 at 14:55:03 UTC, cc wrote:
https://wiki.dlang.org/Win32_DLLs_in_D
I'm starting to think half that page should just be deleted...
the version up top with the druntime dll_process_attach etc
versions should really be used in all cases.
And that gets even simpler too,
On Friday, 16 April 2021 at 17:50:13 UTC, Alain De Vos wrote:
The following very simple low level C-function simply sets the
mixer volume. How to convert this simple function to dlang ?
```
import core.stdc.config;
import core.sys.posix.sys.ioctl;
void mixer_setlevel_stereo(int mixfd,int
On Wednesday, 14 April 2021 at 20:38:16 UTC, Mario wrote:
Maybe I am just too short in D, but I wanted to find out if it
is possible to create classes dynamically. My problem is, I
just don't know where to start reading. Maybe at mixin
templates?
What exactly do you mean?
Your goal is
On Wednesday, 7 April 2021 at 12:57:12 UTC, tcak wrote:
Well, I have a struct, that is defined as a variable already. I
want to read X bytes from the file (not Struct.sizeof bytes
though), and read into the struct variable without any extra
buffer.
file.rawRead((cast(ubyte*) _struct)[0 ..
On Wednesday, 7 April 2021 at 11:42:56 UTC, tcak wrote:
There is rawRead, but it takes an array as parameter, which
causes a dirty looking code with cast etc!
What did you wrote?
file.rawRead(address[0 .. desiredLength])
should do what you want.
On Wednesday, 7 April 2021 at 12:28:25 UTC, tcak wrote:
@property auto b(){ return a.ptr; } // this is a
possibility, but results with overhead of calling. Also, b is
not an array anymore, just int*.
Why are you returning a.ptr instead of just a?
If you return just a, it works fine for
On Tuesday, 30 March 2021 at 08:31:02 UTC, Luhrel wrote:
I have been used this trick in C++, so it might also work in D:
If you follow through the link that's what I mention as being a
bad idea and provide the code given as a more correct alternative.
It changes a global (well to the
On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote:
Why can't I just use: import vibe.vibe; for import packages
like Nim or Python? Why I still use DUB?
I don't use dub. Just dmd -i after you set up the files in the
right place.
Not all libraries support that but I only use my own
On Monday, 29 March 2021 at 02:12:57 UTC, Brad wrote:
a custom implementation for writeln rather than use the one in
stdout module (package?) that would mean any other functions
from that package I would want to leverage I would need to
include by name.
You can still import std.stdio and use
On Monday, 29 March 2021 at 01:24:13 UTC, Preetpal wrote:
writeln(isRandomAccessRange(arr));
Template arguments are passed by !(), not just ().
I believe you must also pass `typeof(arr)` since
isRandomAccessRange is only interested in types.
On Sunday, 28 March 2021 at 17:59:49 UTC, Mark Lagodych wrote:
But auto-generated online documentation and online code viewer
show an outdated version (0.0.1). How to solve that?
Click on the documentation page, then notice at the very bottom
of the page, in small text, there's "Clear Cache".
On Sunday, 28 March 2021 at 17:13:02 UTC, Mark Lagodych wrote:
Although some (all?) of that commands do not work in the
Windows terminal. For instance, you can change background color
ONLY using Windows API.
Windows can support them all if you enable the setting.
but yeah anything outside
On Wednesday, 17 March 2021 at 19:32:02 UTC, uranuz wrote:
Seems that a problem with concatenation is because
Throwable.message has const(char)[] type, but not string. This
makes some inconvenience ;-)
Yes, that's what I thought.
The concat operation tends to give the most flexible type of
On Wednesday, 17 March 2021 at 17:46:27 UTC, uranuz wrote:
Also because it is not a property in some contexts when I try
to concatenate it with string without parentheses using "~"
operator it fails
Can you post some sample code that demonstrates this?
On Sunday, 14 March 2021 at 18:25:51 UTC, starcanopy wrote:
int foo() { return 1; }
int foo() => 1;
I'm concerned that this feature will be in purgatory if its
author becomes busy or forgets about it. (Barring another
individual assuming proprietorship.)
I wrote the implementation for that
On Monday, 15 March 2021 at 02:43:01 UTC, Tim wrote:
Seems pretty good. Does it work on c++ stuff too?
I don't think so
On Monday, 15 March 2021 at 01:53:31 UTC, Tim wrote:
I'm needing to use a c/c++ library in a D program and I'm
struggling with creating a binding as it seems like an enormous
amount of regex modifications. Is there an existing program
that can create most if not all of a binding for me?
On Sunday, 14 March 2021 at 12:27:17 UTC, evilrat wrote:
The problem is that TypeInfo is not shared on Windows, which is
actually roots deeper in the other problems with "sharing".
Unfortunately I cannot provide you with details, but this
situation is well known long standing issue.
It isn't
On Saturday, 13 March 2021 at 23:41:28 UTC, David wrote:
So Excel complains that it can't load my library - presumably
because libphobos2 and libdruntime are not in the sandbox.ly
You *might* be able to compile with
--link-defaultlib-shared=false to use the static
phobos+druntime... but with
On Thursday, 11 March 2021 at 12:26:07 UTC, Виталий Фадеев wrote:
_processMouseKey = // <-- not works
_processMouseMove = // <-- not works
This *should* actually work. What type are those variables?
struct MouseKeyEvent {}
struct MouseMoveEvent{}
void process( ref MouseKeyEvent
On Tuesday, 9 March 2021 at 11:58:45 UTC, Andrey Zherikov wrote:
Should it work for in this case as well?
alias f = (){};
I actually don't know. The docs do say that function pointers
work differently - they match `is(typeof(f) == return)` but it
isn't clear if it would match == function.
On Tuesday, 9 March 2021 at 03:08:14 UTC, Paul Backus wrote:
Yes, it's possible. For example:
template fun(T) {
It'd be nice if we could at least get the arity of a template,
then perhaps speculatively instantiate it and reflect on the
eponymous function then.
(that's a lot of jargon lol
On Tuesday, 9 March 2021 at 02:50:11 UTC, Andrey Zherikov wrote:
writeln(is(f == function));// prints "false"
try
is(typeof(f) == function)
it is kinda weird but that's the trick
On Friday, 5 March 2021 at 15:54:37 UTC, Paul Backus wrote:
The website is *supposed* to keep documentation for old
versions around, and allow you to select them using the
drop-down menu at the top-right:
note that in some cases my website lets you pull old versions too:
On Monday, 1 March 2021 at 20:05:57 UTC, Jack wrote:
int a;
enum s = "";
// both return false but g(s) is expected to return true
So the value must be known at compile time without any extra
context. So that `a` variable might be changed somewhere else so
compile time can't read or write it.
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[x .. y]?
Slicing never allocates memory. reserve extends
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 function. How
is the casting from LPARAM to my type array done in
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
f!(a) omitting the g?
rename g to f. If the function inside
401 - 500 of 6596 matches
Mail list logo