DIP 45 - approval discussion

Timon Gehr timon.gehr at gmx.ch
Tue Nov 12 14:36:21 PST 2013


On 11/12/2013 06:46 AM, Andrei Alexandrescu wrote:
> On 11/11/13 2:36 PM, Timon Gehr wrote:
>> On 11/11/2013 11:02 PM, deadalnix wrote:
>>> On Sunday, 10 November 2013 at 12:39:35 UTC, Timon Gehr wrote:
>>>> What about Object.factory?
>>>
>>> I always though of it as a misfeature.
>>
>> Me too.
>
> ... well time to substantiate.
>
> Andrei

- Every class in any imported module will need to show up in the 
generated code even if it is never used unless global static analysis is 
carried out on arguments to Object.factory.

- If I know the fully qualified name of a class, there are better ways 
to instantiate this class than passing a string containing that name to 
Object.factory in order to call the default constructor.

- The functionality provided by Object.factory is trivially replaced by 
a solution more specifically tailored to the problem at hand using 
compile-time reflection.


More information about the Digitalmars-d mailing list