Private visible?
Walter Bright
newshound at digitalmars.com
Fri Jul 14 03:25:44 PDT 2006
Ivan Senji wrote:
> Walter Bright wrote:
>> Ivan Senji wrote:
>>> Various 'poisoning' techniques sound a lot like C++ to me. There one
>>> can make classes that can not be constructed, can not be inherited
>>> from, can not be passed by value, cannot be allocated on stack and
>>> many different things by making something that is private. But are
>>> these techniques realistic or even possible in D?
>>
>> Sometimes it is valuable to be able to say "you can't do this
>> operation with this type". I don't see why this ability should be
>> restricted to C++.
>
> OK, for a type, but would it be inconsistent if private was handled
> different in class and module level?
>
> I didn't mean it should be restricted to C++ but was rather wondering if
> there are other/better ways in D?
I don't know of a better way.
More information about the Digitalmars-d
mailing list