Initialize array of objects not work
    Andre Pany via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Wed Aug  3 10:58:11 PDT 2016
    
    
  
Hi,
I try to initialize an array of objects. The methods 
(linear/equals/....)
returns object of different classes, but all implement a common 
interface "Element".
Element[] elements = 
quadraticCoefficient(1)~linearCoefficient(2)~equals()~constant(1);
I tried different casts and different ways but it seems, 
currently D does not support this syntax?
I always get some strange error like: Incompatible types for .... 
object.Object and object.Object.
Is there any nice way to initialize an array of objects without 
much syntax overhead?
Kind regards
André
    
    
More information about the Digitalmars-d-learn
mailing list