Exception programming difficult

Dmitry Olshansky dmitry.olsh at gmail.com
Mon Aug 13 08:54:47 PDT 2012


On 13-Aug-12 19:50, Timon Gehr wrote:
> On 08/13/2012 05:32 PM, Dmitry Olshansky wrote:
>>
>> I think the true cryptonite that melts "checked exceptions" to a pile of
>> green goo is templated code:
>>
>> So (*yawn*) tell what kind of exception specification the following
>> function should have:
>>
>> auto joiner(RoR, Separator)(RoR r, Separator sep);
>>
>> How would you guarantee upfront what kind of exceptions it can throw is
>> beyond me. It all depends on code that you can't reach or know by the
>> very definition of template.
>>
>
> Well, presumably the exception specification would be inferred
> automatically for templates.

What's the propose then? And how end user will get any idea what to put 
in his function where he uses it? I see one, but it's not pretty - run 
compiler once - see complaints, add requested types to throws, re-run 
the compiler?

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list