On Sunday, 1 December 2019 at 20:05:40 UTC, Marcone wrote:
How bundles a Dlang application and all its dependencies into a
single .exe package?
You can embed files in the .exe using the import statement:
https://p0nce.github.io/d-idioms/#Embed-a-dynamic-library-in-an-executable
On Tuesday, 26 November 2019 at 10:24:00 UTC, Robert M. Münch
wrote:
How can I write something like this to check if any of a set of
specific versions is used?
```
version(a) {}
else version(b) {}
else version(c) {}
else {
static assert(0, "only versions a, b and c are supported");
}
```
``
On Saturday, 9 November 2019 at 12:44:20 UTC, W.Boeke wrote:
What should be the right way to accomplish this?
Put an ampersand before the function to get its address:
signal.signal(SIGWINCH,cast(void function(int)) &set_winch);
In C you can omit the & when taking a function address, but wh
On Wednesday, 6 November 2019 at 19:13:46 UTC, Jonathan Levi
wrote:
I would think a function that this would be appropriate to
belong in the module. Am I missing it? Or, how would you
recommend calculating it?
The author of the module has explained before that this is very
intentional:
htt
On Saturday, 2 November 2019 at 20:42:29 UTC, Luh wrote:
Yup that's it !
Many thanks !
One word of warning: ensure the C library does not have the only
reference to your Game class instance, or the garbage collector
might deallocate it since it does not scan threads created by C
libraries.
On Saturday, 2 November 2019 at 19:42:54 UTC, Luh wrote:
So I think I just can't. :(
Is that `void* c` in the callback a context pointer by any chance?
That's a common thing in C callbacks precisely for purposes like
this.
You can cast your class to a void* when you register the callback
and
Template constraints are not allowed before the signature in the
language, so it can be expected the documentation does not swap
that order.
On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath
wrote:
I was confused at first by the trailing
if (!is(T == struct) && !is(T == interfac
On Thursday, 31 October 2019 at 08:40:42 UTC, lili wrote:
Hi:
I want implementation Lua on D, I find that a PEG parser
https://github.com/PhilippeSigaud/Pegged
why do not use BNF parser. Is PEG better than BNF?
The readme has a link to the reference article:
https://bford.info/pub/lang
On Friday, 25 October 2019 at 19:49:05 UTC, Ali Çehreli wrote:
I'm still not completely sold on the whole idea though because
it's not a clear win.
Do others see other advantages in other places like templates?
For example, could templates really be written generically for
arrays and associat
On Friday, 25 October 2019 at 05:17:35 UTC, Ali Çehreli wrote:
- Big O is different
No it isn't. Worst case lookup of an associative array lookup is
O(n) too. It can easily be 'achieved' by having a key type with:
```
size_t toHash() const scope pure {
return 0;
}
```
The fact that std.c
On Wednesday, 23 October 2019 at 11:48:29 UTC, Dennis wrote:
You can change `method(1)` into `x.method(1)` and it should
work.
Wait, but that's only because the local alias and member function
have the same name 'method'.
I think you just have to keep the method name as a string instead
of an
On Wednesday, 23 October 2019 at 11:40:09 UTC, Márcio Martins
wrote:
This is a bug, right? If not, why, and how can I get around it
and call `method`?
An alias refers just to a symbol, in this case a member function
of struct X.
The fact that you polled it on instance 'x' is not something an
On Thursday, 17 October 2019 at 21:32:34 UTC, WhatMeWorry wrote:
DUB version 1.11.0, built on Oct 6 2018
`dub add` got added at the end of 2018 IIRC, so you need to
upgrade Dub.
On Thursday, 17 October 2019 at 20:17:53 UTC, Greatsam4sure wrote:
the same error
That was meant for Adam to put in the dub package file of arsd,
in your project it won't affect the compilation of the
dependency. (Though you can still try adding it in your local
download of arsd to quickly
On Thursday, 17 October 2019 at 12:06:49 UTC, Dennis wrote:
You can put "buildRequirements": "allowWarnings" in your
dub.json.
Should be
"buildRequirements": ["allowWarnings"]
On Thursday, 17 October 2019 at 11:35:26 UTC, Adam D. Ruppe wrote:
ugh dub insists on this stupid warning as error nonsense and
the warnings suck so they slip through me sometimes.
You can put "buildRequirements": "allowWarnings" in your dub.json.
(buildRequirements "allowWarnings" in dub.sdl)
On Thursday, 17 October 2019 at 04:05:40 UTC, Greatsam4sure wrote:
what is the way out.
I made a pull request fixing it:
https://github.com/adamdruppe/arsd/pull/222
In the mean time, you can add the subpackage
"arsd-official:simpledisplay" as a depdendency instead so cgi.d
won't be included
On Wednesday, 16 October 2019 at 20:07:10 UTC, Adam D. Ruppe
wrote:
Notice that the docs say "a negative value" rather than -1
specifically. That's because the implementation for integers an
be as simple as
return a - b; // if b > a, you get a negative value
Except that e.g. -2 - int.max und
On Wednesday, 16 October 2019 at 10:09:51 UTC, Sebastiaan Koppe
wrote:
Do we want to be able to catch things in their 'before' state?
Or is it a bug?
The 'before' and 'after' are implementation details showing up as
a result of underspecification.
Module level declarations are supposed to be
On Saturday, 12 October 2019 at 09:52:59 UTC, Jonathan M Davis
wrote:
You could set up your build so that you had targets which only
compiled specific directories so that the only unit tests that
were run were the ones in those directories, but I don't think
that it's possible to do anything li
On Friday, 11 October 2019 at 12:45:59 UTC, Boyan Lazov wrote:
Any ideas what I'm doing wrong?
Nothing, it's a bug.
https://issues.dlang.org/show_bug.cgi?id=19476
I want to split my package into sub packages for faster
compilation, but I have some custom settings that I don't want to
copy-paste 10 times since that makes editing them really
annoying. Is there a way to inherit the settings from the
main-package, or avoid repetition in another way?
I foun
On Friday, 4 October 2019 at 18:53:30 UTC, H. S. Teoh wrote:
Here's an actual working example that illustrates the pitfall
of this implicit conversion:
Luckily it's caught by -dip1000
On Friday, 4 October 2019 at 19:08:04 UTC, Adam D. Ruppe wrote:
(personally though I like to explicitly slice it all the time
though, it is more clear and the habit is nice)
Turns out I have this habit as well. I'm looking through some of
my code and see redundant slicing everywhere.
On Friday, 4 October 2019 at 18:43:34 UTC, H. S. Teoh wrote:
Actually, it *does* automatically convert the static array to a
slice.
You're right, I'm confused. I recall there was a situation where
you had to explicitly slice a static array, but I can't think of
it now.
On Friday, 4 October 2019 at 18:30:17 UTC, IGotD- wrote:
What if you pass a static array to a function that expects a
dynamic array. Will D automatically create a dynamic array from
the static array?
No, you have to append [] to create a slice from the static array.
On Saturday, 21 September 2019 at 08:34:09 UTC, Ron Tarrant wrote:
Thanks, Dennis. Not performant... It doesn't work? I was hoping
for a complete, working example, but maybe this'll help.
Bad word choice (it appears it's debatable whether 'performant'
even is a word), I meant it was a simple i
On Friday, 20 September 2019 at 20:26:03 UTC, Ron Tarrant wrote:
If someone could please post a minimal example (if there's
extra stuff in there, I'll get confused; I'm getting that old,
dammit) I'd be ever so grateful.
Below is a simple doubly linked list with Garbage Collected
memory.
It's
On Sunday, 15 September 2019 at 08:17:20 UTC, sytnax wrote:
So, the question is: should I share this somehow (despite the
limitations listed below)?
Considering the circumstances you mentioned, I'd say either don't
publish it or simply make it a public GitHub repository with
these limitations
On Monday, 9 September 2019 at 13:22:22 UTC, Johannes Loher wrote:
This is incorrect. It was rejected because the proposal was not
solid enough.
I put that a bit bluntly, but as far as I see it, the DIP focused
too much on only adding a way to mark functions as 'no return'
that people were li
On Monday, 9 September 2019 at 09:37:25 UTC, a11e99z wrote:
cuz throwing exception ever is not compatible with any return
type so I dont see reasons do not allow such expressions
A throw statement can actually be seen as an expression returning
a 'never' / 'bottom' type which is implicitly con
On Sunday, 1 September 2019 at 18:26:20 UTC, WhatMeWorry wrote:
Maybe my question is when would be want to use 3) without also
adjusting the .ptr ?
It matters when casting to a boolean, since an empty array with a
non-null pointer is still `true` while an array with null pointer
casts to `fal
On Tuesday, 20 August 2019 at 17:17:01 UTC, Vladimirs Nordholm
wrote:
In code I have `import core.sys.windows.winuser;`, but still
get this error.
Importing only specifies that you expect the symbols to be there,
it doesn't mean the functions are linked in.
On Windows there are three targets
On Saturday, 3 August 2019 at 16:35:34 UTC, Giovanni Di Maria
wrote:
Do you know other faster functions or methods to generate
random numbers?
For me the "goodness of random" is NOT important.
I found some nice random functions in this public-domain C
single-header library collection, one of
The out-of-the box unittest runner is pretty bare by design. It
just runs unittest blocks in serial as functions where assert()
failures are not undefined behavior. Assert messages are not very
helpful, though the recently added flag `-checkaction=context`
helps a lot.
Luckily there is a trai
On Monday, 22 July 2019 at 12:49:24 UTC, drug wrote:
Before I start investigating I would like to ask if this issue
(different results of floating points calculation for D and
C++) is well known?
This likely has little to do with the language, and more with the
implementation. Basic floating
On Thursday, 18 July 2019 at 11:38:55 UTC, Paul wrote:
What is the solution in D for wysiwyg strings (or similar)
spanning multiple lines containing quotes and apostrophes?
Take a look at:
https://dlang.org/spec/lex.html#string_literals
All string literals may span multiple lines.
If you only
On Thursday, 20 June 2019 at 19:09:11 UTC, Emmanuelle wrote:
Is there any trait or Phobos function for transforming a
function/delegate/lambda/whatever's body into a string suitable
for `mixin(...)`? For example:
See:
https://forum.dlang.org/post/kozwskltzidfnatbp...@forum.dlang.org
If not,
On Tuesday, 18 June 2019 at 12:26:14 UTC, lili wrote:
Hi guys:
Is the Dlang fix-length array alloc on stack? when a test
writeln([1]).sizeof //16
writeln([2]).sizeof //16
Why, What is the fix-length array memory layout.
I'm assuming you mean writeln([1].sizeof).
An array literal
On Tuesday, 4 June 2019 at 16:30:41 UTC, BoQsc wrote:
Is there any way to prompt for administrator's rights, to save
the additional effort of lots of clicks?
Looking at:
https://stackoverflow.com/questions/31844584/is-there-an-api-call-to-prompt-user-for-uac-elevation
You can try something lik
On Sunday, 2 June 2019 at 16:39:57 UTC, Rnd wrote:
Is it not possible in the language to have template map
function also to called as map(x=>... ?
That would be slower, and std.algorithm generally disallows easy
but slow functions.
In Java, you can sort a linked list. In D, sort requires an
On Sunday, 26 May 2019 at 18:14:23 UTC, Jacob Carlborg wrote:
No, that's not possible.
Some hacky solutions are possible by importing a source file as a
string and parsing it manually. dglsl actually extracts D
function code to put into glsl shaders. Here's the snippet. See:
https://github.c
I was replacing a memcpy with a slice assignment and accidentally
used == instead of =.
Usually the compiler protects me from mistakes like that:
```
int[4] a;
a == a;
```
Error: a == a has no effect
However, because I was using slices it didn't:
```
int[4] a;
a[] == a[];
```
No errors
Does sl
On Monday, 20 May 2019 at 12:09:02 UTC, Alex wrote:
void* data;
auto x = cast(byte[A,B,C])data;
X is then an AxBxC matrix.
It sounds like you're looking for ndslide from mir
http://code.dlang.org/packages/mir-algorithm
```
ubyte data[];
auto x = x.sliced(A, B, C);
```
It should be pretty ef
On Monday, 20 May 2019 at 11:10:32 UTC, Boqsc wrote:
I'm frozen in learning basics of D lang since I want to create
a simple game and I really would like a clean and simple code,
For a simple game, I think it's the easiest to just store an
integer of cents (or the lowest amount of currency pos
On Thursday, 9 May 2019 at 09:52:21 UTC, XavierAP wrote:
alias parameters are used for functions (in the general sense).
Why this instead of specifying and typing the parameter
functions or delegates?
With function pointers, there is extra indirection and the
function can not be inlined.
With
On Sunday, 5 May 2019 at 18:07:10 UTC, Adam D. Ruppe wrote:
The std.stdio one is supposed to be an error; the old buggy
behavior was to bypass the private import in these cases and
that is why it is deprecated pending changes.
Thanks, that answers my question. The old private-bypassing
behavi
I was trying to rename an imported `sqrt` (wrongly), but I
stumbled upon this weird behavior:
```
void main() {
import core.stdc.math: sqrtf, sqrt;
alias sqrtd = core.stdc.math.sqrt;
auto a = sqrtd(1);
}
```
onlineapp.d(3): Error: undefined identifier core.stdc.math.sqrt
However, whe
On Friday, 3 May 2019 at 06:20:37 UTC, Mike Parker wrote:
If you compile with -m32mscoff for 32-bit or -m64, DMD will use
the Microsoft linker and import libraries if you have Visual
Studio or the MS Build tools installed, and the LDC linker with
some import libraries from MinGW if you don’t.
On Monday, 22 April 2019 at 16:24:53 UTC, Taylor Hillegeist wrote:
Or would this not be easy at all with D?
I don't think so. While there are lots of traits for
introspection of declarations, there is no way to introspect
lines of code. The whole function
would need to be wrapped into a mixin
On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
Add `const` or `immutable` to A and it will work.
I don't know wh
On Monday, 8 April 2019 at 19:54:28 UTC, WhatMeWorry wrote:
Now, I've studied the on-line documentation and even walked
through the code somewhat but I'm not making an headway.
Very relatable. My tips so far are:
- Look for projects in github with a similar structure to yours
and look at thei
On Monday, 8 April 2019 at 18:04:28 UTC, kdevel wrote:
What's the purpose of .release? The documentation in
https://dlang.org/phobos/std_range.html#.SortedRange.release is
rather monosyllabic.
The sort function returns a SortedRange, which is usually an
array wrapper with the extra type infor
On Monday, 8 April 2019 at 07:53:23 UTC, Robert M. Münch wrote:
Why does DMD not give a hint, that an import from the standard
lib might be missing? I find these explicit import statements
very annyoing.
There currently are a few hard-coded import hints for common
functions:
https://github.c
On Sunday, 7 April 2019 at 18:22:00 UTC, Robert M. Münch wrote:
Error: no property sort for type Tuple!(uint, "key", int,
"value")[]
Did you import it?
import std.algorithm;
On Tuesday, 2 April 2019 at 09:37:26 UTC, Per Nordlöw wrote:
Are there any plans on deprecating implicit conversions of
enums to integers?
Not that I know of. Given the precedence of this:
https://github.com/dlang/DIPs/blob/master/DIPs/rejected/DIP1015.md
I doubt enum/integer-types are going to
On Tuesday, 2 April 2019 at 08:38:28 UTC, Per Nordlöw wrote:
Is there a way (compiler flag) to forbid implicit conversions
from an enum type to integer types?
You can make the enum type not an integer type.
```
struct Int{int i;}
enum E: Int {
first = Int(0),
second = Int(1),
}
```
On Saturday, 16 March 2019 at 03:47:43 UTC, Murilo wrote:
Does anyone know if when I create a variable inside a scope as
in
{int a = 10;}
it disappears complete from the memory when the scope finishes?
Or does it remain in some part of the memory? I am thinking of
using scopes to make optimize
On Thursday, 14 March 2019 at 19:46:30 UTC, spir wrote:
But the doc (the language ref for the matter) should definitely
say what you just explained above, shouldn't they?
Well arguably, the spec should detail the language semantics
formally and not just be a description of the reference
imple
On Sunday, 10 March 2019 at 08:59:59 UTC, kerdemdemir wrote:
Can I avoid for loops and solve my problem with std algorithms
or ranges ?
Try slide: https://dlang.org/phobos/std_range.html#slide
And then use map.
On Friday, 8 March 2019 at 11:42:11 UTC, Simon wrote:
Thanks, this works flawlessly. Out of interest: what is the
"enum" doing there? I had the exact same behaviour in a
function before, that I only called at compile-time, so why did
it complain then? Can I somehow tell the compiler that a
fun
On Sunday, 24 February 2019 at 10:53:09 UTC, aliak wrote:
But the following code is very recoverable and I don't see how
it's unsafe to continue executing:
There is no guarantee that a final switch throws an Error. From
what I've heard of Walter [1] (though I can't find it in the
spec), the d
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));
```
is there better way
On Friday, 15 February 2019 at 17:18:28 UTC, H. S. Teoh wrote:
Why? because that's the only case where you can reinterpret the
.sizeof*.length bytes as an array of a different type. There
is no conversion, the cast works as a reinterpretation. It's
by design.
But my problem is that it *isn'
I assumed that casting an int[] to a ubyte[] would keep all bytes
and quadruple the length of the original array. But when the
array is a literal, it keeps the same length but truncates every
int element to a ubyte:
```
import std.stdio;
void main()
{
// enum:
enum litA = [0x10203040,
On Sunday, 10 February 2019 at 20:25:02 UTC, Murilo wrote:
It seems this is a feature of D I will have to get used to and
accept the fact I can't always get the same number as in C
What compilers and settings do you use? What you're actually
comparing here are different implementations of the
On Friday, 11 January 2019 at 19:45:05 UTC, Head Scratcher wrote:
How can I read the file and convert the string into proper
UTF-8 in memory without an exception?
You have multiple options:
```
import std.file: read;
import std.encoding: transcode, Windows1252String;
auto ansiStr = cast(Window
The most fundamental problem that these features tackle is that
code is costly, so making code-bases smaller and more reusable
saves effort spent on maintaining large code-bases and rewriting
code to suit a different situation.
On Friday, 21 December 2018 at 12:39:48 UTC, Ron Tarrant wrote:
1
On Monday, 10 December 2018 at 21:16:23 UTC, aliak wrote:
Does this fix your issue?
struct S {
mixin operators ops;
S opBinary(string op, T)(T a) {
alias opBinary = ops.opBinary; // explicitly alias
opBinary in this scope
return opBinary!op(a);
}
}
It does, thanks
On Sunday, 9 December 2018 at 18:36:50 UTC, Dennis wrote:
Does anyone know how to get this working?
I added this to the mixin template:
```
alias mixinOpBinary = opBinary;
```
And called mixinOpBinary instead in the forwarded function. I
think that solved it. I think I'll just file an issue f
I'm using Adam's workaround from
https://issues.dlang.org/show_bug.cgi?id=19365, but now I have
endless recursion. Reduced code:
```
mixin template operators() {
S opBinary(string op: "+")(S rhs) {
return rhs;
}
// (A)
auto opBinary(string op, T)(T rhs) if (false) {
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran
wrote:
Why is there a difference in the behavior?
Your first assert expression is looking for a string in a larger
string, your second expression looks for hay which is not a
string but a string[]. To flatten the array, use:
as
On Thursday, 6 December 2018 at 07:37:12 UTC, John Chapman wrote:
Is the compiler giving the non-mixed-in function special
treatment?
I think you're running into this bug:
https://issues.dlang.org/show_bug.cgi?id=19365
I see that it is not limited to operator overloading, in general
the overl
On Monday, 3 December 2018 at 10:00:31 UTC, Simen Kjærås wrote:
However, it's easy to implement in a library:
It even is in phobos:
https://dlang.org/phobos/std_array.html#.staticArray
```
import std.array: staticArray;
auto a = [0, 1, 2].staticArray;
```
On Monday, 19 November 2018 at 13:34:50 UTC, Stanislav Blinov
wrote:
Because it's not mutation, it's initialization.
Oh. That's an epiphany for me.
When a ctor is `pure`, the compiler knows it doesn't mutate any
state other than the object's, so it allows conversion to all
three qualifie
On Monday, 19 November 2018 at 02:39:32 UTC, Stanislav Blinov
wrote:
You're skimming the examples ;)
I'm not saying your examples don't work, I'm trying to understand
the minimum requirements. You said:
"That's [constructors needing to be pure is] only for types with
indirections (pointers)
On Monday, 19 November 2018 at 01:24:02 UTC, Stanislav Blinov
wrote:
Yup, that's because, like Rubn said, copying value types is
trivial. Where it all comes to bite you is when you start
having pointers, because you can't copy a const(T)* into a T*.
I'm not using reference types, but still:
`
On Monday, 19 November 2018 at 01:13:29 UTC, Stanislav Blinov
wrote:
You just dismissed that second to last sentence, did you? :)
I don't know what you mean with it. It's not that I'm trying to
be sneaky or lazy really trying to modify the const parameter
when I should treat it properly. And
On Sunday, 18 November 2018 at 22:30:52 UTC, Rubn wrote:
Yah most people tend to avoid const for this reason. It only
really works for basic types, if you have a "const int" you can
convert it to an "int" by copy. But if you have a type like
Vector!(const int) that won't work, you can't even co
On Sunday, 18 November 2018 at 18:17:54 UTC, Stanislav Blinov
wrote:
// implement separate methods for
mutable/const/immutable
Thanks. I should have tried that, but I assumed it wouldn't work
since you can't overload on return-type only. However, the const
/ non-const makes it allowed
I'm making a fixed point numeric type and want it to work
correctly with const. First problem:
```
const q16 a = 6;
a /= 2; // compiles! despite `a` being const.
writeln(a); // still 6
a.toQ32 /= 2;// what's actually happening
```
My q16 type has an implicit conversion to q32
On Friday, 16 November 2018 at 20:13:42 UTC, Vinay Sajip wrote:
More complicated for the compiler writers, or users of
mixins/generics?
For users of generics. It's hard to come up with an actual
example because I don't know why one would ever use this, but in
this concocted scenario:
```
mi
On Friday, 16 November 2018 at 18:37:00 UTC, Vinay Sajip wrote:
Design flaws in what?
Design flaws in the language.
Quoting Jonathan M Davis:
"Honestly, in general, warnings are a terrible idea. Anything
that's a warning in your code has to be fixed, because it's bad
practice to leave warnin
On Wednesday, 14 November 2018 at 12:28:38 UTC, Per Nordlöw wrote:
Is it because of `group` has a default for the predicate
whereas `chunkBy` hasn't.
chunkBy splits the range into smaller ranges, group actually
returns tuples of the item and the amount of occurences. Because
in group the cond
On Friday, 9 November 2018 at 19:40:15 UTC, Mike Parker wrote:
When you link statically with a library, you have to link with
all of its dependencies, too. For GLFW, you'll need User32.lib,
gdi32.lib, and OpenGL32.lib, off the top of my head.
Aha. Now I wonder why LDC includes those dependenci
On Friday, 9 November 2018 at 19:21:30 UTC, kinke wrote:
May be worth another try with the proper command line.
Thank you! LDC + LD now works without warnings.
On Friday, 9 November 2018 at 19:21:30 UTC, kinke wrote:
Run LDC or DMD with `-v`, that gives you the linker command
line at the end
On Friday, 9 November 2018 at 18:19:22 UTC, Dennis wrote:
[...]
I just noticed in the section about the static version:
"This requires the GLFW development package be installed on your
system at compile time."
http://code.dlang.org/packages/bindbc-glfw
I don't see where I can install the 'de
I'm trying the static bindings for glfw of bindbc on Windows,
using the pre-compiled .lib files from the lib-vc2015 folder in
the official download.
(http://code.dlang.org/packages/bindbc-glfw)
With LDC using the Microsoft MSCV linker, everything works. I can
either add this:
app.d:
```
versi
On Friday, 9 November 2018 at 10:45:49 UTC, Vinay Sajip wrote:
As I see it, a ubyte 0x20 could be decoded to an ASCII char '
', and likewise to wchar or dchar. It doesn't (to me) make
sense to decode a char to a wchar or dchar. Anyway, you've
shown me how decodeFront can be used, so great!
Th
On Friday, 9 November 2018 at 09:47:32 UTC, Vinay Sajip wrote:
std.utf.decodeFront(Flag useReplacementDchar =
No.useReplacementDchar, S)(ref S str) if (isInputRange!S &&
isSomeChar!(ElementType!S))
This is the overload you want, let's check if it matches:
ref S str - your InputRange can be pas
On Thursday, 8 November 2018 at 23:43:38 UTC, Murilo wrote:
It finally worked, but I can't just compile it normally, I have
to use dub run, I wish it were something simple that I just
download into the folder and then use an import statement and
then compile it like any other program. I wish it
On Monday, 5 November 2018 at 03:13:26 UTC, Vladimir Panteleev
wrote:
cmd.exe will interpret \` verbatim (i.e. as \`), so, try not
quoting the ` characters (or just replace them with . if you
want the command to work in both shells).
Of course, the one thing I didn't try. Thanks!
I am debugging a case where operator overloading seems to break
when I define the opBinary templates in a mixin template. On my
own simple test-case it worked fine, so I'm trying to reduce my
current code with dustmite.
The file tree is simply:
myproject/
q16.d
And the command I run is:
``
On Wednesday, 17 October 2018 at 00:12:13 UTC, H. S. Teoh wrote:
I'm not sure what's the reasoning behind the saying that
throwing exceptions in ctors is bad, but exceptions are exactly
the kind of thing designed for handling this sort of situation.
If the parser detects a problem early (i.e.,
On Wednesday, 17 October 2018 at 15:51:21 UTC, Codifies wrote:
okay I should have carried on reading the blog, its so
uninitialized values stick out when debugging...
Indeed, the initial value is not supposed to be useful, it's
there because dealing with garbage memory when forgetting to
init
I've always been curious around the design choice of ranges to
make front and popFront separate functions, instead of having
popFront return the front. I suppose it is useful sometimes to be
able to access front multiple times without having to save it
temporarily (can't think of a specific exa
On Friday, 5 October 2018 at 10:03:35 UTC, Kagamin wrote:
GC allocations are 16 bytes aligned.
Is that an implementation detail or well-defined behavior?
On Friday, 21 September 2018 at 07:25:17 UTC, Chris Katko wrote:
I get "Error: template instance `reduce!((a, b) => a + b)`
cannot use local __lambda1 as parameter to non-global template
reduce(functions...)" when trying to compile that using the
online D editor with DMD and LDC.
Any ideas?
On Sunday, 9 September 2018 at 08:41:37 UTC, Christian Mayer
wrote:
As of my current understanding "char" will create a new
variable and copy the content of the original to the new
variable. "char*" will just use the pointer. And "const char*"
is good for when not modifying. But I also can achi
On Saturday, 1 September 2018 at 21:53:03 UTC, aliak wrote:
Anyway around this?
I don't know if your situation allows it, but you can mark f
explicitly as always @nogc. If your design assumes that it's
@nogc, it's a good idea to add the attribute anyway.
You can also use the C printf functi
201 - 300 of 339 matches
Mail list logo