On 2017-02-24 19:10, houdoux09 wrote:
The problem is that I can not retrieve the variables from the parent class.
Cast the value to the type of the base class and run it through the same
function. You can have a look at the Orange serialization library [1].
[1] https://github.com/jacob-carl
I'm pretty sure you need to use "value.tupleof[i][0]" instead
of "mm[0]" as well.
it does not work but I found a solution, that's what I do :
abstract class BaseClass
{
uint[] a = [9, 10, 5];
}
override class Test : BaseClass
{
int t = 0;
string s = "holla";
}
public static JSONVal
On 2017-02-22 20:13, thedeemon wrote:
On Wednesday, 22 February 2017 at 18:34:26 UTC, houdoux09 wrote:
void Read(T)(T value)
{
foreach(i, mm; value.tupleof)
{
writeln(__traits(identifier, value.tupleof[i]), " = ", mm);
if(isArray!(typeof(mm)))
{
Read(mm[0]); //
Yes thank you it works.
On Wednesday, 22 February 2017 at 18:34:26 UTC, houdoux09 wrote:
void Read(T)(T value)
{
foreach(i, mm; value.tupleof)
{
writeln(__traits(identifier, value.tupleof[i]), " = ",
mm);
if(isArray!(typeof(mm)))
{
Read(mm[0]); //Error
}
}
}
You need to us
Hello, i am new in D and i have a problem.
I would like to retrieve the names of the variables and their
value.
But i can not retrieve the value of the array.
class Test
{
public int a;
public Test[] b;
this()
{
a = 1;
b = [new Test(), new Test()];
}
}
//==