Strange observation when using rdmd

2012-11-19 Thread Danny Arends
When I do: rdmd --build-only -w dir/main.d It compiles fine under Debian 32b and Debian 64b however: in 32b the executable is created as: ./main in 64b the executable is created as: ./dir/main Is this expected, and if so why the difference based on architecture ? Danny Arends

Re: Can I call the default opAssign after overloading opAssign?

2012-11-19 Thread Rob T
On Monday, 19 November 2012 at 06:32:56 UTC, Jonathan M Davis wrote: I'm not sure. Close certainly. But if any member variables define an opAssign, then the compiler probably calls them rather than doing a simple memcpy. I'm not sure though. If it does, then a memcpy would not exhibit the same

Re: Can I call the default opAssign after overloading opAssign?

2012-11-19 Thread Jonathan M Davis
On Monday, November 19, 2012 10:29:21 Rob T wrote: the D language specification (which is currently MIA). The online documentation _is_ the official spec, though it definitely doesn't have enough detail to be unambiguous, and in some cases, it's not properly up- to-date. - Jonathan M Davis

Re: Can I call the default opAssign after overloading opAssign?

2012-11-19 Thread Dan
On Monday, 19 November 2012 at 05:22:38 UTC, Jonathan M Davis wrote: On Monday, November 19, 2012 06:01:55 Rob T wrote: postblit constructors and opAssign aren't really related. The postblit constructor is used when a _new_ instance is being constructed (it plays the same role as a copy

Re: Can I call the default opAssign after overloading opAssign?

2012-11-19 Thread Andrej Mitrovic
On 11/19/12, Rob T r...@ucora.com wrote: perhaps best done using the C libs memcopy function. I think the safest thing you can do is: void oldAssign(Type rhs) { this.tupleof = rhs.tupleof; }

Default template arguments

2012-11-19 Thread Joseph Rushton Wakeling
Suppose I have a template, for which I provide a default parameter type. Is there any way of ensuring that this default will be respected unless the user explicitly requests an alternative type? As an example, consider the following: // import

Re: Default template arguments

2012-11-19 Thread bearophile
Joseph Rushton Wakeling: Suppose I have a template, for which I provide a default parameter type. Is there any way of ensuring that this default will be respected unless the user explicitly requests an alternative type? Take a look at how Complex does it:

Re: Default template arguments

2012-11-19 Thread Joseph Rushton Wakeling
On 11/19/2012 04:47 PM, bearophile wrote: Take a look at how Complex does it: https://github.com/D-Programming-Language/phobos/blob/master/std/complex.d Looking, but I don't think that's really what I'm looking for. AFAICS Complex basically operates along these rules: -- if your input

Re: Default template arguments

2012-11-19 Thread bearophile
Joseph Rushton Wakeling: ... or have I missed something? Second try: import std.stdio; void printSize2(T)(T x) { writeln(T.stringof); } void printSize(T1 = void, T2 = real)(T2 x) { static if (is(T1 == void)) printSize2!real(x); else printSize2!T1(x); } void

Re: Default template arguments

2012-11-19 Thread Ali Çehreli
On 11/19/2012 09:44 AM, bearophile wrote: Better: import std.stdio; private void printSizeHelper(T)(T x) { writeln(T.stringof); } void printSize(T1 = void, T2)(T2 x) { static if (is(T1 == void)) printSizeHelper!real(x); else printSizeHelper!T1(x); } void main() { float x; x.printSize();

Re: Default template arguments

2012-11-19 Thread Tobias Pankrath
On Monday, 19 November 2012 at 17:50:59 UTC, Ali Çehreli wrote: On 11/19/2012 09:44 AM, bearophile wrote: Better: import std.stdio; private void printSizeHelper(T)(T x) { writeln(T.stringof); } void printSize(T1 = void, T2)(T2 x) { static if (is(T1 == void)) printSizeHelper!real(x); else

Re: Default template arguments

2012-11-19 Thread Joseph Rushton Wakeling
On 11/19/2012 06:44 PM, bearophile wrote: private void printSizeHelper(T)(T x) { writeln(T.stringof); } void printSize(T1 = void, T2)(T2 x) { static if (is(T1 == void)) printSizeHelper!real(x); else printSizeHelper!T1(x); } Thanks for the suggestion! :-) Now

Re: using std.regex with (A|B) patterns.

2012-11-19 Thread Dmitry Olshansky
11/19/2012 11:55 AM, Aquiles пишет: Hello, While instantiating a floating point regex using ctRegex!\\b[-+]?([0-9]*\\.[0-9]+|[0-9]+)\\B, I got a compiler error (see below.) The offending character seems to be '|' and when escaped it compiles. I can reproduce it with a simpler regex: assert (

Re: Can I call the default opAssign after overloading opAssign?

2012-11-19 Thread Rob T
On Monday, 19 November 2012 at 09:37:35 UTC, Jonathan M Davis wrote: On Monday, November 19, 2012 10:29:21 Rob T wrote: the D language specification (which is currently MIA). The online documentation _is_ the official spec, though it definitely doesn't have enough detail to be unambiguous,

Broken Hyperlinks on the Web server.

2012-11-19 Thread 0b1100110
http://dlang.org/cppcomplex.html And it makes me sad, because it's one of the ones that I wanted to read. All of the other ones look fine. If anyone has it or wants to share it, that'd be cool with me. And whoever designed this webforum, I thank you for not dropping my session immediately