std.compress

Walter Bright newshound2 at digitalmars.com
Tue Jun 4 10:50:46 PDT 2013


On 6/4/2013 9:33 AM, John Colvin wrote:
> On Tuesday, 4 June 2013 at 16:09:09 UTC, Walter Bright wrote:
>> On 6/4/2013 6:34 AM, Jacob Carlborg wrote:
>>> I'm wondering if (un)compress can take the compressing algorithm as a template
>>> parameter. Does that make sense?
>>>
>>> Something like:
>>>
>>> auto result = data.compress!(LZW);
>>>
>>> Then we could pass different compressing algorithms to the compress function.
>>
>> I don't see the point. Furthermore, it requires that the compress template
>> know about all the compression algorithms available, which limits future
>> expansion.
>
> Not necessarily. If the compression algorithms were free functions in the module
> you could just be passing an alias to one, which compress would then call.
> (which would also allow people to specify their own algorithms)

What value does a function which just passes an alias to another one add?


More information about the Digitalmars-d mailing list