On Mon, 09 Mar 2009 23:00:50 -0400, Chris Nicholson-Sauls wrote:
Sergey Kovrov wrote:
On 3/9/2009 8:50 PM, Chris Nicholson-Sauls wrote:
While not strictly intuitive, you could do this:
auto var = Rebindable!(const Foo)(new Foo);
assert(var.opDot !is null);
As 'opDot' returns the wrapped objec
Sergey Kovrov wrote:
On 3/9/2009 8:50 PM, Chris Nicholson-Sauls wrote:
While not strictly intuitive, you could do this:
auto var = Rebindable!(const Foo)(new Foo);
assert(var.opDot !is null);
As 'opDot' returns the wrapped object (with const intact). The downside
to that, however, is that it wo
On 3/9/2009 8:50 PM, Chris Nicholson-Sauls wrote:
While not strictly intuitive, you could do this:
auto var = Rebindable!(const Foo)(new Foo);
assert(var.opDot !is null);
As 'opDot' returns the wrapped object (with const intact). The downside
to that, however, is that it won't work in those case
Sergey Kovrov wrote:
On 3/6/2009 11:29 PM, Steven Schveighoffer wrote:
std.typecons.Rebindable
http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#Rebindable
Thanks Steve,
this is what I've been looking for, the only thing missing is comparing
against null (is null).
-- serg.
Whi
On 3/6/2009 11:29 PM, Steven Schveighoffer wrote:
std.typecons.Rebindable
http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#Rebindable
Thanks Steve,
this is what I've been looking for, the only thing missing is comparing
against null (is null).
-- serg.
Sergey Kovrov:
> I guess there is a data member for allocated buffer size as well...
Nope, this isn't vector of C++. It's a long story (caused to allow the
slicing). The result is that the append is very slow.
> Objects may be viewed as a structure too. There are context pointer
> virtual func
On Fri, 06 Mar 2009 09:39:43 -0500, Sergey Kovrov wrote:
> Other reference types (e.g. arrays) have solution to this:
> ``immutable(TYPE)[]`` and ``immutable(TYPE[])`.
>
> I think class instances should have something similar in language as
> well.
>
>
> -- serg.
std.typecons.Rebindable
http:
On 3/6/2009 4:42 PM, bearophile wrote:
Arrays aren't really references, they are a small 2-word long struct,
that contains a pointer to the data and a length.
I guess there is a data member for allocated buffer size as well...
Objects may be viewed as a structure too. There are context pointer
Sergey Kovrov:
> Other reference types (e.g. arrays)<
Arrays aren't really references, they are a small 2-word long struct, that
contains a pointer to the data and a length.
Bye,
bearophile
Other reference types (e.g. arrays) have solution to this:
``immutable(TYPE)[]`` and ``immutable(TYPE[])`.
I think class instances should have something similar in language as well.
-- serg.
10 matches
Mail list logo