On Saturday, 9 July 2016 at 21:12:24 UTC, WhatMeWorry wrote:
foreach( i, str; myClassMembers)
What are you doing to get myClassMembers?
If it is __traits(allMembers), it just gives you the *names* of
the members. To get the actual thing, you then do
__traits(getMember, object, str) and can
class C
{
this(){ _i = 0; _j = 0; }
void setVar(int i) { _i = i; }
int getVar() { return _i; }
int _i;
int _j;
}
writeln("C");
foreach( i, str; myClassMembers)
{
writeln("member ", i, " = ", str);
TypeInfo ti = typeid(str);
writeln("type id is ", ti);
Thank you!
On 07/09/2016 10:32 PM, phant0m wrote:
As far as I know, AA implemented as a hashtable. So, will there be two
searches performed (one search for each line)?
records[3].value = 10;
records[3].name = "name";
Yup. A good optimizer may be able to eliminate one, but conceptually
there are two
On 07/09/2016 01:35 PM, Suliman wrote:
> On Thursday, 5 January 2012 at 22:53:12 UTC, Ali Çehreli wrote:
>> On 01/05/2012 02:15 PM, asm wrote:
>>> how can i implementing the singleton pattern in D?
>>
>> Is singleton still alive? ;)
I'm glad I was alive in 2012. :o)
>> An idea is to instantiate
On 07/09/2016 01:32 PM, phant0m wrote:
> Suppose I have AA of structures:
>
> struct Foo {
> int value;
> string name;
> }
>
> Foo[int] records;
>
> As far as I know, AA implemented as a hashtable. So, will there be two
> searches performed (one search for each line)?
> records[3].value
On Thursday, 5 January 2012 at 22:53:12 UTC, Ali Çehreli wrote:
On 01/05/2012 02:15 PM, asm wrote:
how can i implementing the singleton pattern in D?
Is singleton still alive? ;)
An idea is to instantiate the object in the module's static
this().
Ali
Yeah, same question, what difference
Suppose I have AA of structures:
struct Foo {
int value;
string name;
}
Foo[int] records;
As far as I know, AA implemented as a hashtable. So, will there
be two searches performed (one search for each line)?
records[3].value = 10;
records[3].name = "name";
How can I access elements
On Saturday, 9 July 2016 at 05:40:10 UTC, ag0aep6g wrote:
template bar(T, U...)
if (U.length > 1)
{
import std.meta : staticMap;
import std.typecons : Tuple;
alias baz(A) = Tuple!(T, A);
alias V = staticMap!(baz, U);
alias TupleToFoo(T : Tuple!(Types), Types ...) =
On Sat, Jul 09, 2016 at 11:57:36PM +1200, rikki cattermole via
Digitalmars-d-learn wrote:
> On 09/07/2016 11:46 PM, Tofu Ninja wrote:
> > On Saturday, 9 July 2016 at 11:35:24 UTC, Tofu Ninja wrote:
> > > On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote:
> > > > On Saturday, 9 July 2016 at
On Saturday, 9 July 2016 at 11:57:36 UTC, rikki cattermole wrote:
That implementation is weird in that it returns a dchar instead
of the raw type. Which is decoding, but it is not auto
decoding. Auto decoding involves the foreach statement.
You have that backwards. foreach only decodes if you
On Saturday, 9 July 2016 at 11:57:36 UTC, rikki cattermole wrote:
In this case, its not aut odecoding.
ElementType is using std.range : front for array's since they
do not provide a front method.
That implementation is weird in that it returns a dchar
hello, autodecoding.
On Saturday, 9 July 2016 at 11:46:14 UTC, Tofu Ninja wrote:
On Saturday, 9 July 2016 at 11:35:24 UTC, Tofu Ninja wrote:
On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote:
On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote:
Seems pretty silly to me...
due to universally beloved
On 09/07/2016 11:46 PM, Tofu Ninja wrote:
On Saturday, 9 July 2016 at 11:35:24 UTC, Tofu Ninja wrote:
On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote:
On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote:
Seems pretty silly to me...
due to universally beloved autodecoding.
On Saturday, 9 July 2016 at 11:35:24 UTC, Tofu Ninja wrote:
On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote:
On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote:
Seems pretty silly to me...
due to universally beloved autodecoding.
Hmmm... I dont really know the history of
On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote:
On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote:
Seems pretty silly to me...
due to universally beloved autodecoding.
Hmmm... I dont really know the history of autodecoding, why was
that supposed to be a good idea?
On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote:
Seems pretty silly to me...
due to universally beloved autodecoding.
On 09/07/2016 11:24 PM, Tofu Ninja wrote:
Seems pretty silly to me...
http://dlang.org/phobos/std_range_primitives.html#.front
Seems pretty silly to me...
On Saturday, 9 July 2016 at 00:03:22 UTC, Meta wrote:
I have two questions.
1. Is it possible to build subpackages when dub build is
invoked for the main package? It's a pain to first do dub build
:mysubpackage and then dub build.
2. It seems that when dub detects that no dependencies need
20 matches
Mail list logo