Hi, Im using GDC 4.9.0 compiler. I have template classes like
public class LinkedList(T) {...} and when I try compile it
together, everything works fine. But when I compile every source
file to separate object file and link it together with ld Ill get
errors like:
Could anyone help me please?
On Monday, 17 November 2014 at 21:12:54 UTC, Steven Schveighoffer
wrote:
On 11/14/14 6:29 PM, Satoshi wrote:
Hi, Im using GDC 4.9.0 compiler. I have template classes like
public
class LinkedList(T) {...} and when I try compile it together,
everything works fine. But when I compile every source
I have defined LinkedList as di file, Im not compiling it. Im
compiling every .d file separately, eg. main.d - main.d.o
without including anything else.
I tried to use -femit-templates but nothing happnes.
I dont have object file of LinkedList.di, Im only importing it in
source file and with
Hello,
why operator overloading is not working as a static methods
through the UFCS?
I need overload a << operator in this way:
enum PlatformID {
None,
Trinix,
Unix,
MacOS,
Windows
}
PlatformID toPlatformID(string platform) {
switch
Hello,
I have 2 files:
source/test.d:
module foo.test;
and
source/bar.d
module foo.bar;
import foo.test;
When I am compiling this 2 files together there is no problem.
But when I compile it with -c flag (LDC) compiler thrown an error
(cannot find foo/test.d)
Why isn't import path
On Sunday, 26 June 2016 at 15:37:03 UTC, "Smoke" Adams wrote:
system("cls") works but executeShell doesn't. system is
depreciated.
What's going on? The docs say that it creates a new process. I
simply want to clear the console!
I have problem with executeShell on windows 10 (LDC 1.0.0)
Hello, I have a little problem with Variadic functions.
I have function like:
void perform(string method, ...) {
// here I want to call method findMethod with _argptr and
_arguments
}
MethodDesc findMethod(string method, ...) {
// some lookup through the tables...
}
I know there are
On Friday, 22 April 2016 at 21:13:31 UTC, anonymousuer wrote:
What code is needed to tell D to open a window? Thank you in
advance.
You can choose between existing libraries or wrappers for GUI
implementation like:
DlangUI, Qt, ..., (or my new GUI framework called Rikarin what
will be
On Thursday, 14 April 2016 at 20:21:38 UTC, Lucien wrote:
How can I override a property ?
Test code:
class A
{
@property bool foo { return false; }
void myFunc() { ... }
}
class B : A
{
override bool foo { return true; } // error
override void
On Sunday, 26 June 2016 at 19:01:07 UTC, cym13 wrote:
On Sunday, 26 June 2016 at 17:56:08 UTC, Satoshi wrote:
On Sunday, 26 June 2016 at 15:37:03 UTC, "Smoke" Adams wrote:
system("cls") works but executeShell doesn't. system is
depreciated.
What's going on? The docs say that it creates a new
On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote:
Property functions are used wrong by a compiler when it needs
to get and set a value at the same time:
[...]
Try
@property ref int value() {
return value_;
}
Hi,
I'm using package.d file for the project, where is each file
imported. In each file is imported only that one package file
(like `import Foo;`).
Problem is with .dep files. dep file for each source file
contains all source files of the project just because it imports
that package.
On Sunday, 19 February 2017 at 19:19:25 UTC, berni wrote:
Is it possible to force a function to be inlined?
Comparing a C++ and a D program, the main difference in speed
(about 20-30%) is, because I manage to force g++ to inline a
function while I do not find any means to do the same on D.
Why is not possible to create documentation, compile code and
generate header files simultaneously?
When I pass -D and -Dd flags to ldc2 command it won't create doc
until I don't pass -o- flag too.
Hello,
why
pure @safe nothrow @nogc struct Point {
}
isn't same as
struct Point {
pure: @safe: nothrow: @nogc:
}
??
On Sunday, 2 October 2016 at 17:22:57 UTC, Basile B. wrote:
On Sunday, 2 October 2016 at 15:54:38 UTC, Satoshi wrote:
Hello,
why
pure @safe nothrow @nogc struct Point {
}
isn't same as
struct Point {
pure: @safe: nothrow: @nogc:
}
??
This is not specified but attributes aren't applied to
On Monday, 26 September 2016 at 23:40:10 UTC, Vincent wrote:
Hello, guys!
I was very surprised that module 'socketstream' was deprecated.
Usually if something become obsolete, there is some perfect
replacement! But my digging in Inet and forums gave nothing,
but "outdated" examples with
Hello,
How can I take an ptrdiff_t of any tupleoff entry from class
during compilation?
I need something like this:
template Test(T, int i) {
enum Test = [i] - [0];
}
and then use it like:
class AnyClass {
int a;
int b;
int c;
string d;
}
enum Addr = Test!(AnyClass, 3);
void
Hello,
how can I copy class when I have pointer to the parent of it?
eg.
class Foo {
int m_a;
this(const(Foo) other) {
m_a = other.m_a;
}
}
class Bar : Foo {
int m_b;
this(const(Bar) other) {
super(other);
m_b = other.m_b;
}
R dup(this
On Thursday, 20 October 2016 at 16:04:00 UTC, Nordlöw wrote:
On Thursday, 20 October 2016 at 12:48:34 UTC, Satoshi wrote:
Hello,
why ... cannot be used with structs?
struct Foo {
this(int a) { }
}
void bar(Foo foo...) {
}
bar(42);
Being explicit about these things makes complex code
Hello,
why ... cannot be used with structs?
struct Foo {
this(int a) { }
}
void bar(Foo foo...) {
}
bar(42);
On Tuesday, 22 November 2016 at 19:16:56 UTC, Ali Çehreli wrote:
On 11/22/2016 08:05 AM, Satoshi wrote:
I don't have extensive experience with other languages. In
fact, the only other languages that I can claim proficiency are
C and C++. (I also know Python just enough to find it
incredible
On Monday, 21 November 2016 at 20:04:51 UTC, Ali Çehreli wrote:
First, a reminder that we have this great resource of D idioms:
https://p0nce.github.io/d-idioms/#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it
The link above has an idiom of mixing in a byRef() member
function
or I have simple class
class View {
this(Rectangle frame) {...}
this(float, float, float, float) { ... }
this(Point, Size) { ... }
}
then struct Point, Size and Rectangle (Point, Size)
now I need to write 2 overloads for View class taking 4 floats or
(Point, Size) and this must do in every
Hello,
how can calling method on local struct throw "null this"?
struct is initialized by .init and have default values.
struct Foo {
Bar bar;
static struct Bar {
float x, y, z;
}
Bar getBar() {
return bar;
}
}
then
Foo foo = Foo.init;
auto b = foo.getBar(); // throw "null
cast(ulong) but is not null.
It won't work just in special cases what I cannot reproduce
easily.
On Monday, 21 November 2016 at 10:25:17 UTC, Satoshi wrote:
Hello,
how can calling method on local struct throw "null this"?
struct is initialized by .init and have default values.
struct Foo {
Bar bar;
static struct Bar {
float x, y, z;
}
Bar getBar() {
return bar;
}
}
On Thursday, 20 October 2016 at 12:52:42 UTC, rikki cattermole
wrote:
On 21/10/2016 1:48 AM, Satoshi wrote:
Hello,
why ... cannot be used with structs?
struct Foo {
this(int a) { }
}
void bar(Foo foo...) {
}
bar(42);
Because an int is not a Foo.
Oh, really? I didn't notice that...
On Sunday, 9 October 2016 at 21:32:23 UTC, ag0aep6g wrote:
On 10/09/2016 10:57 PM, jython234 wrote:
1. Where do I use the "shared" keyword?
What doesn't work is creating an unshared object of a class
that only has a shared constructor. To create both shared and
unshared objects, you need
On Monday, 10 October 2016 at 18:21:10 UTC, Jonathan M Davis
wrote:
On Monday, October 10, 2016 17:57:15 Satoshi via
Digitalmars-d-learn wrote:
[...]
You can use the offsetof property of a member variable to find
out the offset between its address and the address of the
beginning
Hello,
is there any advantage of marking function as @property??
class Foo {
void objectValue(Object value) { }
Object objectValue() { }
}
auto foo = new Foo;
// This works fine without @property attribute
foo.objectValue = null;
auto bar = foo.objectValue;
On Thursday, 8 December 2016 at 22:09:14 UTC, Jonathan M Davis
wrote:
On Thursday, December 08, 2016 16:54:57 Adam D. Ruppe via
Digitalmars-d- learn wrote:
[...]
Yeah, it's pretty common for folks to slap @property on
functions to make it clear that it's intended to be used as a
property
Hello,
is rtInfo() already used by GC?
I need to store some data for each class so I'm using this
template and m_rtInfo in TypeInfo_Class but now it seems that GC
is not working properly in some cases.
Thanks.
On Tuesday, 28 March 2017 at 07:27:31 UTC, I Lindström wrote:
After getting the basics down, how did you continue when
learning programming in general?
I do have a need for which I've been trying out a few languages
and D seems by far the best for me. Should I just start doing
that project
On Wednesday, 5 April 2017 at 12:42:23 UTC, evilrat wrote:
On Wednesday, 5 April 2017 at 12:13:38 UTC, Satoshi wrote:
Hi,
How can I build single exe application with vibe.d (windows)?
now it require zlib.dll, libeay32.dll and ssleay32.dll
But I need it as single app.
btw, if all you need is
On Saturday, 11 March 2017 at 12:35:42 UTC, XavierAP wrote:
I do not really think it's a bad solution, to check several
scalar arguments that must obey the same condition; just
wondering if you have better ideas. Try to avoid modifying the
function's signature and defining custom types, unless
Hi,
How can I build single exe application with vibe.d (windows)?
now it require zlib.dll, libeay32.dll and ssleay32.dll
But I need it as single app.
On Saturday, 16 December 2017 at 09:04:05 UTC, Satoshi wrote:
I commented out the TypeInfo declarations and got the same
error but on different symbol.
object.d(1569): Error: Function type does not match previously
declared function with the same mangled name: _d_dynamic_cast
I commented out the TypeInfo declarations and got the same error
but on different symbol.
object.d(1569): Error: Function type does not match previously
declared function with the same mangled name: _d_dynamic_cast
https://github.com/Rikarin/Trinix/blob/master/Kernel/object.d#L1569
On Thursday, 14 December 2017 at 12:18:22 UTC, Nicholas Wilson
wrote:
On Wednesday, 13 December 2017 at 21:39:40 UTC, Satoshi wrote:
On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote:
[...]
Compiling with
ldc2 -debuglib= -defaultlib= -code-model=kernel
-disable-red-zone -w -wi
On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote:
What means this error and how to solve it?
object.d-mixin-1072(1112): Error: Global variable type does not
match previous declaration with same mangled name:
_D10TypeInfo_m6__initZ
Actually, I'm working on OS with minimal D
What means this error and how to solve it?
object.d-mixin-1072(1112): Error: Global variable type does not
match previous declaration with same mangled name:
_D10TypeInfo_m6__initZ
Actually, I'm working on OS with minimal D runtime and I'm unable
to compile object.d
source code:
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
// do
44 matches
Mail list logo