Quote:Original post by NotAYakk
Note that your "fix" is incomplete. Try making a function that returns a double and another that returns on int -- only one version of "parse" will be created (either the int or double one) and will be called in both cases.
Wait, what? I don't see how that's possible.
Two separate class definitions should be created, _ArgParser<int> and _ArgParser<double>, because those represent the return type of the functions (which isn't a true return type - they all return a PyObject*).
I'm really sleepy right now. Anyway, each templated function (even though they have the same signature) resides in a separate class namespace, so I would assume it to be different.
If you're saying that
&_ArgParser<int>::parseNoArgs == &_ArgParser<double>::parseNoArgs
then, like PM me or something and I'll stop using VC7 altogether and burn the CDs in a giant pyre of shame. Because that's a stupidity that I honestly can't live with.
Anyway. I probably misread some part of your post because I'm really sleepy, so I'm going to quickly test to see if different overloads of _returnObject<R> are called, because I'm kind of new to templates and don't really know how to check their parameters at runtime with the debugger.
Want to sleeeeeppp....EDIT:
It appears that two separate instances of _returnObject are created in your example, _returnObject<int> and _returnObject<double>, suggesting that the int and double versions of parse (didn't use the NoArgs one) are indeed not the same function. lolz, I probably am completely not understanding what you're trying to say then :(