On Saturday, 6 April 2019 at 03:24:04 UTC, FrankLike wrote:
Hi,everyone,...
Do you have some better code than this?
import std.stdio;
import std.socket;
void main()
{
testIPPort();
}
bool testIPPort()
{
try
On Saturday, 16 March 2019 at 15:53:26 UTC, Johan Engelen wrote:
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 p
Hi,everyone,
How to test that the IP port is reachable?
In C,you can do this like that, what should I do in D?
/* C Code*/
https://blog.csdn.net/zhangyingchuang/article/details/51957552
#include
#include
#include
#include
#include /* inet(3) functions */
#define bool int
#define false
On Friday, 5 April 2019 at 22:08:50 UTC, Adam D. Ruppe wrote:
Weird combination of cases that maybe should be illegal.
It errors with the highly descriptive errormessage:
app.obj(app)
Error 42: Symbol Undefined __D8mymodule3BarFZ3fooMFZCQx3Foo
Error: linker exited with status 1
On Friday, 5 April 2019 at 21:59:35 UTC, Sjoerd Nijboer wrote:
Foo Bar()
{
Foo foo();
It looks like the compiler is treating that as a function
prototype without a body (that just happens to be nested in
another function).
return foo;
And then, this foo is given the optio
module mymodule;
class Foo{}
Foo Bar()
{
Foo foo();
return foo;
}
int main()
{
auto foo = Bar();
return 0;
}
This code doesn't compile with a linker error that there's a
missing symbol for `Foo Bar()` on windows.
After all, `Foo foo();` isn't legitimate
On Friday, 5 April 2019 at 13:59:27 UTC, Alex wrote:
class X(T)
void opOpAssign(string op)(T d)
If T has more than length of one then
x +=
We can work around this but it seems to me that we should be
able to get it to work in some way
x += Alias!(a,b,c)
fails to package it up
On 05.04.19 16:00, Alex wrote:
I was thinking using tuple would work(of course is longer than Add but
would allow for a more general approach, it would require automatic
unpacking though and so doesn't work.
`tuple` works for me:
import std.typecons: tuple;
class X(T ...)
{
void opO
Hello,
Since literal strings are interned (and immutable), can I count on the fact that
they are compared (==) by pointer?
Context: The use case is a custom lexer for a custom language. I initially
wanted to represent lexeme classes by a big enum 'LexClass'. However, this makes
me write 3 ti
BTW `T.stringof` is usually a bug waiting to happen. You are
using mixin in a lot of places where you shouldn't be and this is
going to lead to name conflicts, import problems, and more. Just
use `T`.
If you need a member, use __traits(getMember, T, "name").
On Friday, 5 April 2019 at 14:38:21 UTC, Alex wrote:
No one has a clue about this?
Your code has a lot of layers to unfold, but instead let me just
show you a working example and then maybe you can fix your own
code:
---
class A {
void foo(int a) {}
void foo(int b, int c) {}
On Friday, 5 April 2019 at 14:05:55 UTC, Russel Winder wrote:
I get the feeling this blog is going to become an important
tutorial resource for people wanting to do GtkD stuff with D.
Given D and GtkD is currently the best way of writing Gtk+
applications, this blog is a great resource.
Thank
On Friday, 5 April 2019 at 14:52:05 UTC, lithium iodate wrote:
You are just having a little issue with operator precedence
there. Your code attempts to get the member `A` from
`MyClass!MyEnum`, if you add braces around it, it'll work just
fine `MyClass!(MyEnum.A)`.
That's really funny acutal
On Friday, 5 April 2019 at 14:47:42 UTC, Sjoerd Nijboer wrote:
So the following code doesn't compile for some reason, and I
can't figure out why.
enum MyEnum { A, B, C }
class MyClass(MyEnum myEnum)
{
/*...*/
}
int main()
{
MyClass!MyEnum.A a;
}
The error: Error: template instan
On Friday, 5 April 2019 at 14:47:42 UTC, Sjoerd Nijboer wrote:
So the following code doesn't compile for some reason, and I
can't figure out why.
The error: Error: template instance `MyClass!(MyEnum)` does
not match template declaration `MyClass(MyEnum myEnum)`
pops up, no matter what I do.
So the following code doesn't compile for some reason, and I
can't figure out why.
enum MyEnum { A, B, C }
class MyClass(MyEnum myEnum)
{
/*...*/
}
int main()
{
MyClass!MyEnum.A a;
}
The error: Error: template instance `MyClass!(MyEnum)` does not
match template declaration `MyCl
No one has a clue about this?
I get the feeling this blog is going to become an important tutorial resource
for people wanting to do GtkD stuff with D. Given D and GtkD is currently the
best way of writing Gtk+ applications, this blog is a great resource.
On Fri, 2019-04-05 at 13:44 +, Ron Tarrant via Digitalmars-d-learn w
On Friday, 5 April 2019 at 13:59:27 UTC, Alex wrote:
class X(T)
void opOpAssign(string op)(T d)
If T has more than length of one then
x +=
We can work around this but it seems to me that we should be
able to get it to work in some way
x += Alias!(a,b,c)
fails to package it up
class X(T)
void opOpAssign(string op)(T d)
If T has more than length of one then
x +=
We can work around this but it seems to me that we should be able
to get it to work in some way
x += Alias!(a,b,c)
fails to package it up as do all other things I have tried.
void Add(Ts d) {
On Friday, 5 April 2019 at 13:44:35 UTC, Ron Tarrant wrote:
Since the forum seems to have trouble with replies to existing
posts, for now I'll be doing a separate post for each. Hope
that doesn't get anyone's nose out of joint.
Anyway...
Today we explore the GTK Switch widget with two example
Since the forum seems to have trouble with replies to existing
posts, for now I'll be doing a separate post for each. Hope that
doesn't get anyone's nose out of joint.
Anyway...
Today we explore the GTK Switch widget with two examples, a
simple one and a complex one. Enjoy.
22 matches
Mail list logo