On Saturday, 16 May 2020 at 05:22:49 UTC, n0den1te wrote:
[...]
For example, like this:
´´´
import std;
alias types = AliasSeq!(
bool, byte, ubyte, short, ushort, int, uint, long, ulong,
float, double, real, char, wchar, dchar
);
void main()
{
static foreach(type; types)
{
Hi,
I am working through the book 'Programming in D' and wanted
to take the sample program on
http://ddili.org/ders/d.en/types.html, one step further:
import std.stdio;
void main() {
writeln("Type : ", int.stringof);
writeln("Length in bytes: ", int.siz
On Thursday, 14 May 2020 at 16:09:16 UTC, solidstate1991 wrote:
When I try to compile my own project under Ubuntu with dub, I
get the following linker error:
/usr/bin/ld: .dub/obj/pixelperfectengine_pixelperfecteditor.o:
undefined reference to symbol 'inflateEnd'
//lib/x86_64-linux-gnu/libz.so
On Saturday, 16 May 2020 at 01:11:54 UTC, NaN wrote:
Howdy, any idea what Im doing wrong? Given a type T i want to
test the presence of certain methods. I looked in phobos to see
how isInputRange was defined but it didnt really help as all
the methods have no parameters and it used some weird l
try changing delegate to function, on the type itself it is often
function
Howdy, any idea what Im doing wrong? Given a type T i want to
test the presence of certain methods. I looked in phobos to see
how isInputRange was defined but it didnt really help as all the
methods have no parameters and it used some weird lamda stuff i
think.
template isPathType(T)
{
a
On Friday, 15 May 2020 at 23:49:37 UTC, solidstate1991 wrote:
Dub should do the linking by itself.
How does it know what to link?
On Friday, 15 May 2020 at 03:46:57 UTC, evilrat wrote:
Um, pardon the stupid question, but did you just forgot to link
it? I can't see a mention of it anywhere in both the old json
and dub.sdl, and I don't see subpackages either. (does it links
implicitly by the compiler?)
Also if it's digg
On Friday, 15 May 2020 at 19:19:59 UTC, H. S. Teoh wrote:
It's possible to do it, but the called function has to support
it. If that's not an option, then you're out of luck and
probably have to use metaprogramming instead. Here's how to do
it:
int add(int[] args...) {
On Friday, 15 May 2020 at 19:19:59 UTC, H. S. Teoh wrote:
Here's how to do it:
int add(int[] args...) {
... // access `args` here as an array
}
Beware that that language feature, typesafe variadic functions,
might become deprecated:
https://github.com/dlang/dm
On Fri, May 15, 2020 at 06:44:52PM +, surlymoor via Digitalmars-d-learn
wrote:
[...]
> I don't often miss JS, but one particular feature that I enjoyed is
> the ability to expand arrays into argument lists using a unary
> operator.
>
> Example: add(...[1, 1]) === add(1, 1) // IIRC
>
> I've b
On Friday, 15 May 2020 at 14:29:38 UTC, Adam D. Ruppe wrote:
use the -run switch to dmd. Make sure it and te d file name are
the LAST arguments.
dmd -i other_dmd_args_you_need -run yourfile.d
Thank you for the reply. Let me try. :)
On Friday, 15 May 2020 at 18:22:47 UTC, Seb wrote:
On Friday, 15 May 2020 at 14:09:00 UTC, Vinod K Chandran wrote:
Hi,
For some unknown reasons, dub is not working for me. But i can
build my program with "dmd -i". But i would like to know if
there is any code to run my program with "dmd -i".
N
Hello,
I don't often miss JS, but one particular feature that I enjoyed
is the ability to expand arrays into argument lists using a unary
operator.
Example: add(...[1, 1]) === add(1, 1) // IIRC
I've been looking in Phobos and the spec, but nothing's popped
out to me. Is there a fairly obvio
On Friday, 15 May 2020 at 14:09:00 UTC, Vinod K Chandran wrote:
Hi,
For some unknown reasons, dub is not working for me. But i can
build my program with "dmd -i". But i would like to know if
there is any code to run my program with "dmd -i".
Note : "rdmd" is also working but it creates the exe
On Friday, 15 May 2020 at 15:24:32 UTC, Ali Çehreli wrote:
On 5/15/20 8:04 AM, Paul Backus wrote:
[...]
Yes, that is a consistent way of explaining it. :)
As an off-topic trivia, the same feature is in C++ as well:
[...]
Ali
Awesome. Thank you Ali and Paul :)
On 5/15/20 8:04 AM, Paul Backus wrote:
On Friday, 15 May 2020 at 14:55:07 UTC, Ali Çehreli wrote:
Additionally, the name of a template when used inside that template
means that instance of it. So just say Foo. :)
struct Foo(A, B, C, size_t a, size_t b)
{
Foo * p;
}
Ali
To expand a little,
On Friday, 15 May 2020 at 14:55:07 UTC, Ali Çehreli wrote:
Additionally, the name of a template when used inside that
template means that instance of it. So just say Foo. :)
struct Foo(A, B, C, size_t a, size_t b)
{
Foo * p;
}
Ali
To expand a little, this works because a struct template su
There is a way to make to ignore some branchs and tags?
Actually it's pretty annoying when someone publish a fork, and
spams with "does not match the original package name" on older
tags.
On 5/15/20 7:37 AM, wjoe wrote:
On Friday, 15 May 2020 at 13:52:38 UTC, Paul Backus wrote:
On Friday, 15 May 2020 at 13:47:43 UTC, wjoe wrote:
struct Foo(A, B, C, size_t a, size_t b)
{
alias foo_t = Foo!(A, B, C, a, b); // is there a better way to get
foo_t ?
}
typeof(this)
Thanks :)
On Friday, 15 May 2020 at 13:52:38 UTC, Paul Backus wrote:
On Friday, 15 May 2020 at 13:47:43 UTC, wjoe wrote:
struct Foo(A, B, C, size_t a, size_t b)
{
alias foo_t = Foo!(A, B, C, a, b); // is there a better way
to get foo_t ?
}
typeof(this)
Thanks :)
use the -run switch to dmd. Make sure it and te d file name are
the LAST arguments.
dmd -i other_dmd_args_you_need -run yourfile.d
On Thursday, 14 May 2020 at 12:57:19 UTC, JN wrote:
On Thursday, 14 May 2020 at 12:53:43 UTC, Vinod K Chandran
wrote:
Hi all,
I just build a skeleton of a Gui library(win32 based) for my
own purpose. How do i use this in my d programs with dub ?
Now, all files are located in a folder called "G
Hi,
For some unknown reasons, dub is not working for me. But i can
build my program with "dmd -i". But i would like to know if there
is any code to run my program with "dmd -i".
Note : "rdmd" is also working but it creates the exe file in temp
directory, so my AV is catching it every time. Its
On Friday, 15 May 2020 at 13:47:43 UTC, wjoe wrote:
struct Foo(A, B, C, size_t a, size_t b)
{
alias foo_t = Foo!(A, B, C, a, b); // is there a better way
to get foo_t ?
}
typeof(this)
struct Foo(A, B, C, size_t a, size_t b)
{
alias foo_t = Foo!(A, B, C, a, b); // is there a better way to
get foo_t ?
}
26 matches
Mail list logo