Preventing .init for Archive struct, Programming in D, page 295
Monkyyy
crazymonkyyy at gmail.com
Fri Sep 12 15:38:15 UTC 2025
On Friday, 12 September 2025 at 15:31:37 UTC, Brother Bill wrote:
> On Friday, 12 September 2025 at 15:24:46 UTC, Monkyyy wrote:
>> On Friday, 12 September 2025 at 15:20:38 UTC, Brother Bill
>> wrote:
>>> Is is possible to 'disable' .init for a struct?
>>
>> No (and honestly it's bad style to break the constructors)
>
> Please expound on why its 'bad style' to disable constructors.
> Would you accept that disabling postblit may be the exception?
Minor exceptions in type api creates hell inside nested
metaprogramming and your clever scheme isnt going to be worth the
trade off of making users learn your system for modifying the
data.
Plain old data forever
More information about the Digitalmars-d-learn
mailing list