www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - opApply with Type Inference and Templates?

reply Jerry <hurricane hereiam.com> writes:
I am trying to do opApply to work when the delegate passed when 
it is and isn't nogc/nothrow. As soon as you involve a template 
though, type inference goes out the door. I want to be able to 
use opApply with templates (to get the auto  nogc/nothrow 
deducation passed on the delegate passed) but still be able to 
use type inference. Is there any way to do this?
Feb 15 2017
next sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Thursday, 16 February 2017 at 03:20:12 UTC, Jerry wrote:
 I am trying to do opApply to work when the delegate passed when 
 it is and isn't nogc/nothrow. As soon as you involve a template 
 though, type inference goes out the door. I want to be able to 
 use opApply with templates (to get the auto  nogc/nothrow 
 deducation passed on the delegate passed) but still be able to 
 use type inference. Is there any way to do this?
No, by any chance do you ask this for the tuple unpacking PR ? If so I've also tried and failed.
Feb 15 2017
parent Jerry <hurricane hereiam.com> writes:
On Thursday, 16 February 2017 at 04:09:18 UTC, Basile B. wrote:
 No, by any chance do you ask this for the tuple unpacking PR ?
 If so I've also tried and failed.
Was just trying to use a container I created in functions with and without nogc/nothrow.
Feb 16 2017
prev sibling parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 02/15/2017 07:20 PM, Jerry wrote:
 I am trying to do opApply to work when the delegate passed when it is
 and isn't nogc/nothrow. As soon as you involve a template though, type
 inference goes out the door. I want to be able to use opApply with
 templates (to get the auto  nogc/nothrow deducation passed on the
 delegate passed) but still be able to use type inference. Is there any
 way to do this?
Related: http://forum.dlang.org/post/ovitindvwuxkmbxufzvi forum.dlang.org Ali
Feb 16 2017