templates and parameters
Posted: Fri Mar 11, 2016 1:47 am
I'm working on implementing an optional argument for the files() and folders() functions.
I've got things to the point where the parser will accept a parameter or not, and I'm returning the same result in each case.
So far so good.
But I'm stuck trying to implement the exec part of this. Both functions are currently implemented with a template that doesn't take arguments. I see a template for a variable number of math arguments, and I see one that requires a *lot* of rework of the affected functions and all I've been able to do when it finally compiles is throw a segment fault. I'm assuming I have to invoke get0or1parameters at some point, but it's looking like I'll have to create a new type of template for this situation, and that doesn't seem right.
So I'm going on the assumption that I'm missing something obvious, and maybe there's another function already doing this that I can use as a model.
I'm up for any ideas. I've had to modify seven files to get this far.
I've got things to the point where the parser will accept a parameter or not, and I'm returning the same result in each case.
So far so good.
But I'm stuck trying to implement the exec part of this. Both functions are currently implemented with a template that doesn't take arguments. I see a template for a variable number of math arguments, and I see one that requires a *lot* of rework of the affected functions and all I've been able to do when it finally compiles is throw a segment fault. I'm assuming I have to invoke get0or1parameters at some point, but it's looking like I'll have to create a new type of template for this situation, and that doesn't seem right.
So I'm going on the assumption that I'm missing something obvious, and maybe there's another function already doing this that I can use as a model.
I'm up for any ideas. I've had to modify seven files to get this far.