On Friday, 11 October 2019 at 13:13:46 UTC, Dennis wrote:
On Friday, 11 October 2019 at 12:45:59 UTC, Boyan Lazov wrote:
Any ideas what I'm doing wrong?
Nothing, it's a bug.
https://issues.dlang.org/show_bug.cgi?id=19476
Alright, I see
Well, the alias workaround works, so that seems just as
On Friday, 11 October 2019 at 12:45:59 UTC, Boyan Lazov wrote:
Any ideas what I'm doing wrong?
Nothing, it's a bug.
https://issues.dlang.org/show_bug.cgi?id=19476
Hello,
I seem to have a problem when I use a template mixin and then try
to overload operators both in the mixin and in a struct from
where it's instantiated.
So the idea is that I have a few operators defined in the mixin,
then a few more in the struct, and I want to forward all
operations n
On Monday, 16 September 2013 at 21:01:48 UTC, Aleksey wrote:
On Monday, 16 September 2013 at 20:53:18 UTC, Namespace wrote:
On Monday, 16 September 2013 at 20:43:01 UTC, Aleksey wrote:
I get strange type errors in the following code, and I don't
understand why =( Could anybody help?
struct I {
On Monday, 16 September 2013 at 20:43:01 UTC, Aleksey wrote:
I get strange type errors in the following code, and I don't
understand why =( Could anybody help?
struct I {
int i;
I opBinary(string op)(ref I that)
if (op == "+") {
return I(i + that.i);
}
}
void m
I get strange type errors in the following code, and I don't
understand why =( Could anybody help?
struct I {
int i;
I opBinary(string op)(ref I that)
if (op == "+") {
return I(i + that.i);
}
}
void main() {
auto a = I(1);
auto d = a + (a + a);
}
Er
On Monday, 16 September 2013 at 20:53:18 UTC, Namespace wrote:
On Monday, 16 September 2013 at 20:43:01 UTC, Aleksey wrote:
I get strange type errors in the following code, and I don't
understand why =( Could anybody help?
struct I {
int i;
I opBinary(string op)(ref I that)
if (o
On 01/21/2013 07:53 PM, Ali Çehreli wrote:
...
void foo(string s == "hello")() // ERROR; I don't think possible
{
// ...
}
void foo(string s : "hello")(){
// ...
}
On Monday, 21 January 2013 at 18:53:08 UTC, Ali Çehreli wrote:
...
Can you elaborate. I don't see the duplication.
Ali
First we check that parameter is one of allowed ones in
constraint. Then we do the very same check using the very same
operator list to actually make a right dispatch. Looks
On 01/21/2013 10:02 AM, mist wrote:
> Hm, but why can't static assert provide an instantiation trace? I can
> live without error message
I forgot to mention that template constraints take part in choosing the
implementation as well:
void foo(string s)()
if ((s == "hello") || (s == "goodbye
Hm, but why can't static assert provide an instantiation trace? I
can live without error message but duplicating same condition
twice (one time being part of implementation) hurts my eyes :(
On Monday, 21 January 2013 at 17:16:22 UTC, Ali Çehreli wrote:
On 01/21/2013 08:32 AM, mist wrote:
> p
On 01/21/2013 08:32 AM, mist wrote:
> phobos style
> guidelines favor constraints heavily over static asserts but this
> exactly the example when I am uneasy about such choice: static assert
> can both provide more user-friendly error message here and remove some
> code duplication.
Agreed but t
Do you want to discuss it? :) I have noticed that phobos style
guidelines favor constraints heavily over static asserts but this
exactly the example when I am uneasy about such choice: static
assert can both provide more user-friendly error message here and
remove some code duplication.
On Mo
Nathan M. Swan:
The correct keyword is "opBinary", not "opbinary".
The compiler must give an error message easy to understand in
similar wrong cases.
http://dpaste.1azy.net/b73ef2cd
This is your code:
Arithmetic opbinary(string op)(Arithmetic rhs)
{
stat
On Monday, 21 January 2013 at 06:51:23 UTC, Nathan M. Swan wrote:
On Monday, 21 January 2013 at 06:19:47 UTC, Joseph Cassman
wrote:
Please refer to http://dpaste.dzfl.pl/edit/b73ef2cd
The code is contrived but is trying to focus on overloading
the "+" and "*" operators for a struct.
Here is
On Monday, 21 January 2013 at 06:19:47 UTC, Joseph Cassman wrote:
Please refer to http://dpaste.dzfl.pl/edit/b73ef2cd
The code is contrived but is trying to focus on overloading the
"+" and "*" operators for a struct.
Here is the output.
/home/c215/c527.d(36): Error: incompatible types for (
Please refer to http://dpaste.dzfl.pl/edit/b73ef2cd
The code is contrived but is trying to focus on overloading the
"+" and "*" operators for a struct.
Here is the output.
/home/c215/c527.d(36): Error: incompatible types for ((x) + (y)):
'Arithmetic!(int)' and 'Arithmetic!(int)'
/home/c215/c
17 matches
Mail list logo