handful and interval

deadalnix deadalnix at gmail.com
Sun Sep 2 08:10:22 PDT 2012


Le 02/09/2012 16:51, Jacob Carlborg a écrit :
> On 2012-09-02 16:22, Andrei Alexandrescu wrote:
>> I'd like to add a simple function to std called "handful". It would
>> return a small, read-only set of which main facility is membership test:
>>
>> string a = "class";
>> if (a in handful("struct", "class", "union"))
>> {
>> ...
>> }
>>
>> Would it be generally useful, and if so what module does it belong to?
>
> I really don't like the name "handful". What would be the difference
> compared to a regular set container? To me it sounds like we should have
> a standard set container in Phobos, std.container.set.
>

+1, and we are back to the allocator design.


More information about the Digitalmars-d mailing list