On Tue, 08 Mar 2011 15:25:27 -0500, Steven Schveighoffer wrote:
Hey, wouldn't it be cool if I could add a custom allocator to all
classes!?...
class Collection(T, alloc = DefaultAllocator!T) {
Collection!(T) add(T t) { ...; return this; } // 20 other now subtly
incorrect functions
import std.stdio;
import std.traits;
import std.exception;
struct CheckedInt(N) if (isIntegral!N)
{
private N value;
ref CheckedInt opUnary(string op)() if (op == ++)
{
enforce(value != value.max);
++value;
return this;
}
this(N _value)
{
On Tue, 08 Mar 2011 12:06:08 -0500, Andrej Mitrovic n...@none.none wrote:
import std.stdio;
import std.traits;
import std.exception;
struct CheckedInt(N) if (isIntegral!N)
{
private N value;
ref CheckedInt opUnary(string op)() if (op == ++)
{
enforce(value != value.max);
On 03/08/2011 06:20 PM, Steven Schveighoffer wrote:
On Tue, 08 Mar 2011 12:06:08 -0500, Andrej Mitrovic n...@none.none wrote:
import std.stdio;
import std.traits;
import std.exception;
struct CheckedInt(N) if (isIntegral!N)
{
private N value;
ref CheckedInt opUnary(string op)() if (op == ++)
On 3/8/11 8:20 PM, spir wrote:
[…] Yet another
syntactic special-case for special cases in the language. In this case,
there are even 3 ways to write the same thing: […]
I don't quite get how you think this would be a syntactic special case.
As Steve pointed out, »class Foo(T) {}« is merely
On Tue, 08 Mar 2011 14:20:40 -0500, spir denis.s...@gmail.com wrote:
On 03/08/2011 06:20 PM, Steven Schveighoffer wrote:
On Tue, 08 Mar 2011 12:06:08 -0500, Andrej Mitrovic n...@none.none
wrote:
import std.stdio;
import std.traits;
import std.exception;
struct CheckedInt(N) if
On 3/8/11, Steven Schveighoffer schvei...@yahoo.com wrote:
See the problem?
Yup. Btw, does auto ref still suffer from any bugs that I should know
about? I've heard it had issues.
On Tuesday, March 08, 2011 15:31:37 Andrej Mitrovic wrote:
On 3/8/11, Steven Schveighoffer schvei...@yahoo.com wrote:
See the problem?
Yup. Btw, does auto ref still suffer from any bugs that I should know
about? I've heard it had issues.
I'm not sure that it works correctly with properties