Serving the Quantitative Finance Community

 
User avatar
lballabio
Posts: 0
Joined: January 19th, 2004, 12:34 pm

How do I implement a pointer to Function with variable arguments?

July 2nd, 2008, 8:08 am

Put it in the hpp instead
 
User avatar
wynand494
Topic Author
Posts: 0
Joined: February 20th, 2004, 5:22 am

How do I implement a pointer to Function with variable arguments?

July 2nd, 2008, 8:51 am

That did the trick! But why do I need to provide th definition also in the hpp file? Never had to till now. Not getting it.
 
User avatar
lballabio
Posts: 0
Joined: January 19th, 2004, 12:34 pm

How do I implement a pointer to Function with variable arguments?

July 2nd, 2008, 9:22 am

QuoteOriginally posted by: wynand494That did the trick! But why do I need to provide th definition also in the hpp file? Never had to till now. Not getting it.Not "also"--"only" in the hpp file. It's a quirk of templates. They can't generate code until they're instantiated. For details, grab the C++ book nearest to your desk.
 
User avatar
wynand494
Topic Author
Posts: 0
Joined: February 20th, 2004, 5:22 am

How do I implement a pointer to Function with variable arguments?

July 2nd, 2008, 9:37 am

Thanks a million. Luigi. You rock!
 
User avatar
wynand494
Topic Author
Posts: 0
Joined: February 20th, 2004, 5:22 am

How do I implement a pointer to Function with variable arguments?

July 5th, 2008, 1:23 am

Hi,quick q boost::bind(f,_1,arg2,arg3...argn) seems to work only for n <10. Is there a way in boost to use bind functions with arguments more than 9?
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

How do I implement a pointer to Function with variable arguments?

July 5th, 2008, 2:46 pm

If I can butt in, but do you really want a function with 10 parameters, even if you could do it? As I said in a previous post, a hybrid OO approach + function objects is more robust and easier to maintain. It also closer to the numerical analysis thinking.Your code will become unmaintainable IMO. You can stretch any paradigm to its lmits. It happened before, horror story.
Last edited by Cuchulainn on July 4th, 2008, 10:00 pm, edited 1 time in total.
 
User avatar
wynand494
Topic Author
Posts: 0
Joined: February 20th, 2004, 5:22 am

How do I implement a pointer to Function with variable arguments?

July 5th, 2008, 11:53 pm

QuoteOriginally posted by: CuchulainnIf I can butt in, but do you really want a function with 10 parameters, even if you could do it? I realise I actually don't. :-). Good reality check. Thanks Cuch!
 
User avatar
Blazes
Posts: 0
Joined: September 6th, 2004, 7:36 am

How do I implement a pointer to Function with variable arguments?

July 7th, 2008, 11:54 am

Hi, I recently purchased a copy of your book Financial Instrument Pricing Using C++ and am awaiting delivery. In the interim I have been using the "peek" facility in Amazon to check it out. I see you mention a number of ways of interacting with Excel. In the past I have used DLLs written in C++ and referenced these in VBA and then used in Excel. Is this something you consider (did I not peek in the right places) or is there a reason why you would not do this? Thank you, Regards, Blazes.
 
User avatar
Blazes
Posts: 0
Joined: September 6th, 2004, 7:36 am

How do I implement a pointer to Function with variable arguments?

July 7th, 2008, 11:54 am

Sorry meant t0 PM this!!!
 
User avatar
Blazes
Posts: 0
Joined: September 6th, 2004, 7:36 am

How do I implement a pointer to Function with variable arguments?

July 7th, 2008, 11:54 am

Sorry meant to PM this!!!
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

How do I implement a pointer to Function with variable arguments?

July 7th, 2008, 4:22 pm

QuoteOriginally posted by: BlazesHi, I recently purchased a copy of your book Financial Instrument Pricing Using C++ and am awaiting delivery. In the interim I have been using the "peek" facility in Amazon to check it out. I see you mention a number of ways of interacting with Excel. In the past I have used DLLs written in C++ and referenced these in VBA and then used in Excel. Is this something you consider (did I not peek in the right places) or is there a reason why you would not do this? Thank you, Regards, Blazes.The support site for this book is here (see also Egor's web site as well).siteHere's an COM add in updateYou can follows the steps in chapter 29 of book to do COM Add + automation add in. I have posted a new chapter above. All code is in C++ and the registration process is automagic. So I do not need or use other languageshthDuffy
Last edited by Cuchulainn on July 6th, 2008, 10:00 pm, edited 1 time in total.