Re: Accessing mutable data that isn't

2013-11-25 Thread Jonathan M Davis
On Monday, November 25, 2013 18:34:30 Spott wrote: > Why is rhs a purely runtime argument? I would think it would be > known at compile time. Function arguments are runtime entities, not compile-time entities and therefore cannot be used in places where a compile-time entity is required. e.g. th

Re: Accessing mutable data that isn't

2013-11-25 Thread Spott
On Thursday, 21 November 2013 at 07:23:09 UTC, Jonathan M Davis wrote: On Wednesday, November 20, 2013 23:49:42 Spott wrote: I've been screwing around with templates lately, and I'm attempting to figure out why the following won't compile: struct value { int a; const auto

Re: Accessing mutable data that isn't

2013-11-25 Thread Spott
On Thursday, 21 November 2013 at 06:48:40 UTC, qznc wrote: On Wednesday, 20 November 2013 at 22:49:42 UTC, Spott wrote: I've been screwing around with templates lately, and I'm attempting to figure out why the following won't compile: struct value { int a; const auto opBinary(s

Re: Accessing mutable data that isn't

2013-11-21 Thread bearophile
Jonathan M Davis: I find it annoying when people do that unless the code is quite long. It's much easier to have it just be in the message IMHO. Also, it has the benefit of not having to worry about the link not being valid in the future, I agree with Jonathan. External sites should be avoid

Re: Accessing mutable data that isn't

2013-11-20 Thread Jonathan M Davis
On Thursday, November 21, 2013 07:48:34 qznc wrote: > First, use dpaste for such code snippets: > http://dpaste.dzfl.pl/f2f39b32 Really? I find it annoying when people do that unless the code is quite long. It's much easier to have it just be in the message IMHO. Also, it has the benefit of not

Re: Accessing mutable data that isn't

2013-11-20 Thread Jonathan M Davis
On Wednesday, November 20, 2013 23:49:42 Spott wrote: > I've been screwing around with templates lately, and I'm > attempting to figure out why the following won't compile: > > struct value > { > int a; > > const auto > opBinary(string op, T)(in T rhs) const pure { >

Re: Accessing mutable data that isn't

2013-11-20 Thread qznc
On Wednesday, 20 November 2013 at 22:49:42 UTC, Spott wrote: I've been screwing around with templates lately, and I'm attempting to figure out why the following won't compile: struct value { int a; const auto opBinary(string op, T)(in T rhs) const pure { static i

Re: Accessing mutable data that isn't

2013-11-20 Thread Jesse Phillips
On Wednesday, 20 November 2013 at 22:49:42 UTC, Spott wrote: I've been screwing around with templates lately, and I'm attempting to figure out why the following won't compile: struct value { int a; const auto opBinary(string op, T)(in T rhs) const pure { static i

Accessing mutable data that isn't

2013-11-20 Thread Spott
I've been screwing around with templates lately, and I'm attempting to figure out why the following won't compile: struct value { int a; const auto opBinary(string op, T)(in T rhs) const pure { static if (op == "+") return intermediateValue!(value