new std.variant (was Re: The Right Approach to Exceptions)

Robert Jacques sandford at jhu.edu
Wed Feb 22 06:19:38 PST 2012


On Tue, 21 Feb 2012 21:51:34 -0600, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> On 2/21/12 6:11 PM, Robert Jacques wrote:
>> On Tue, 21 Feb 2012 09:12:57 -0600, Adam D. Ruppe
>> <destructionator at gmail.com> wrote:
>>
>>> On Tuesday, 21 February 2012 at 02:33:15 UTC, Robert Jacques
>>> wrote:
>>>> Nope. See
>>>> (https://jshare.johnshopkins.edu/rjacque2/public_html/ )
>>>
>>>
>>> Any luck in getting the required patches into phobos?
>>>
>>> I'd love to see this full thing in there for the next release.
>>>
>>> It rox.
>>
>> I'm in the process of cleaning up the required patches and submitting
>> them. The first one's already in
>> (https://github.com/sandford/phobos/commit/8b845d2a50bc20993afed7306f3d84921e4ac54b).
>> I've almost got appender ready.
>
> Are the changes substantial enough to put them through the review process?
>
> Andrei

To Variant? Yes, definitely. To Appender? I don't think so. There is an slight change in API behavior necessitated by performance considerations, but I don't think it warrants a review by the community at large. Specifically, appender's internal data structure is now sealed, which means that .data must always make a copy. My preference would be to deprecate .data in favor of a .dup/.idup pair. It'll break a bunch of code (which I don't like), but it will make sure no one is calling .data twice in a row, resulting in a silent performance problem.


More information about the Digitalmars-d mailing list