Boost::Any ported to D

Fredrik Olsson peylow at gmail.com
Tue Sep 26 23:58:59 PDT 2006


Bruno Medeiros skrev:
>> 2. Arrays with static size are not fully supported e.g. function can not
>> return static array. Also static arrays are not implicitly converted to
>> dynamic arrays, so when assigning string to Any class there is a need to
>> cast to dynamic array:
>>         (new Any).assign(cast(char[])("char[] test"));
> 
> Static arrays are teh suck. :(
> "Certain aspects of D are a pathway to many issues some consider to 
> be... unnatural." :P
> 
Perhaps a prefix is in order, in your example:
(new Any).assign(d"char[] test"); // Dynamic
(new Any).assign(s"char[] test"); // Static

And same for the new array literals (That I love).
(new Any).assign(d[1,2,3]); // Dynamic
(new Any).assign(s[1,2,3]); // Static

I guess no prefix would default to static as is?


(And before you even think about going about to complain about choosing 
'd', and 's' as prefixes have in mind: I do not care if any other 
character is used, if it is postfix instead, or whatere. It is the 
functionality I want!)


// Fredrik Olsson



More information about the Digitalmars-d-announce mailing list