Could we reserve void[T] for builtin set of T ?
matovitch via Digitalmars-d
digitalmars-d at puremagic.com
Fri Apr 1 05:36:13 PDT 2016
On Friday, 1 April 2016 at 11:59:29 UTC, Dejan Lekic wrote:
> On Thursday, 31 March 2016 at 19:24:14 UTC, deadalnix wrote:
>> Pretty much as per title. I has that in the back of my mind
>> for a while. Would that work ?
>
> I am not sure about that... I would rather have a completely
> new type (`set`) for this purpose.
Agreed, although it looked like a good idea at first, void[T] is
kind of obscture when you compare it to std::unordered_set<T> in
C++. Although unordered_map are really practical to the point lua
made it its only data structure (behind the scene of a dynamic
language), when I first encountered D I thought this was sad to
have add it as a build-in construct (phobos would have done
fine). This thread point out one don't have a satifactory way to
insert or erase keys and code a specific behavior for void[T]
just remove all the interest of the similarty with AAs that we
are looking for in the first place.
More information about the Digitalmars-d
mailing list