On Wednesday, 23 December 2020 at 13:06:37 UTC, drug wrote:
On 12/23/20 3:23 PM, Godnyx wrote:
Any ideas?
Just fix your typos:
```D
import std : printf, toStringz;
void put(A...)(string prompt, A args) {
static foreach (ulong i; 0..args.length) {
static if (is(typeof(args[i]) ==
On Wednesday, 23 December 2020 at 13:55:20 UTC, Adam D. Ruppe
wrote:
On Wednesday, 23 December 2020 at 13:06:37 UTC, drug wrote:
static foreach (ulong i; 0..args.length) {
static if (is(typeof(args[i]) == string))
printf("%s\n", args[i].toStringz);
static if (is(t
On Wednesday, 23 December 2020 at 09:42:42 UTC, Ferhat Kurtulmuş
wrote:
On Wednesday, 23 December 2020 at 09:40:27 UTC, Ferhat
Kurtulmuş wrote:
On Wednesday, 23 December 2020 at 09:06:02 UTC, Godnyx wrote:
[...]
I didn't dive into your use case, but you should use static
foreach in this case
On Wednesday, 23 December 2020 at 09:50:03 UTC, Ali Çehreli wrote:
On 12/23/20 1:06 AM, Godnyx wrote:
> for (ulong i = 0; i < args.length; i++) {
> if (typeof(args[i]).stringof == "string")
> printf("%s\n", args[i].toStringz);
> }
I replaced for with foreach and
On Wednesday, 23 December 2020 at 08:50:50 UTC, Mike Parker wrote:
On Wednesday, 23 December 2020 at 08:45:15 UTC, Godnyx wrote:
Yep and I find it out! It won't work with templates and/or
variadic function parameters. It says that the variable can't
be read at compile time (so I can't cast it)
On Wednesday, 23 December 2020 at 04:02:54 UTC, Paul Backus wrote:
On Tuesday, 22 December 2020 at 21:26:37 UTC, Godnyx wrote:
On Tuesday, 22 December 2020 at 21:10:59 UTC, Godnyx wrote:
Is there a way? If not then how std.stdio does it?
I should mention that I want to use it in a variable th
On Tuesday, 22 December 2020 at 21:40:15 UTC, Dave P. wrote:
On Tuesday, 22 December 2020 at 21:37:23 UTC, Godnyx wrote:
On Tuesday, 22 December 2020 at 21:28:10 UTC, Dave P. wrote:
On Tuesday, 22 December 2020 at 21:10:59 UTC, Godnyx wrote:
[...]
Lol. Actually I just don't want to use Phobos
On Tuesday, 22 December 2020 at 21:28:10 UTC, Dave P. wrote:
On Tuesday, 22 December 2020 at 21:10:59 UTC, Godnyx wrote:
Is there a way? If not then how std.stdio does it?
I assume you’re asking this because you don’t have access to
std.stdio (such as using betterC).
The way to do it is to
On Tuesday, 22 December 2020 at 21:10:59 UTC, Godnyx wrote:
Is there a way? If not then how std.stdio does it?
I should mention that I want to use it in a variable that can't
be read at compile time so .toStringz is not working for me.
Is there a way? If not then how std.stdio does it?
On Thursday, 12 November 2020 at 09:35:10 UTC, hgriffin wrote:
C++ is a really overloaded with features language. The burden
of backward compatibility and source compatibility with C
doesn't make it any better. But right now it's the only right
choice for development. There are plenty of librar
On Saturday, 12 December 2020 at 11:03:06 UTC, Tobias Pankrath
wrote:
On Saturday, 12 December 2020 at 09:05:19 UTC, Godnyx wrote:
I'm trying to create a cool function that will let us do
formatting sorter and faster. The function will work like that:
outln("My name is {name} and my age is {ag
I'm trying to create a cool function that will let us do
formatting sorter and faster. The function will work like that:
outln("My name is {name} and my age is {age}");
this will be equivalent to:
writeln("My name is ", name, " and my age is ", age);
or:
writefln("My name is %s and my age is
13 matches
Mail list logo