What I'd like to know is if it's possible to specify by value, via typedef or some other such hack. The reason I'd like to do this is so that I could overload via the template, which would allow me greater flexibility when determining the behavior of this function. Thanks in advance!
@seymore: something like the following would be nice:
1 2 3
/*@type C: a class that both functions return*/
template<VALUE_ONE> C* foo (arg1,arg2,arg3);
template<VALUE_TWO> C* foo (arg4,arg5,arg6);
The nice thing about this approach is that ideally, I could specialize for two different values with the same arguments, and get different results; this would also allow the difference to be resolved at compile time, rather than by way of a predicate at run time, i.e.
1 2
/*same args as VALUE_ONE, but internally different*/
template<VALUE_THREE> C*foo(arg1,arg2,arg3);
@Bazzy: thanks for the input. What I'm looking for, though, is not a way to specify by TYPE, but by a VALUE.
Also, I just had an idea. I'll get back to you all soon : )
EDIT: So much for that, heh. Suggestions still open!
Are you just trying to do some template metaprogramming, or do you actually want some functionality to perform your task? It sounds like you just need a function that takes 4 parameters!
@seymore: the problem with 4 parameters is that a) it's not guaranteed that the args will be the same, and b) even if they are, I'd rather not have the different resolved at runtime.
Either way, jsmith posted what I was getting at, so now I'll give a shot. Thanks to all contributers!