On 23 January 2011 14:55, Stephan Beal <[email protected]> wrote:
> On Sun, Jan 23, 2011 at 3:48 PM, James Pike <[email protected]> wrote: > >> I sent you an e-mail about how to get rid of the (*). >> > > Hi! i just saw it, but the code was already out the door at that point. In > my initial experimentation i couldn't get the proper templates to be > selected if i omitted the (*). Adding it solved my problem and didn't seem > to cause others, so i stuck with it. i will try to go back and get rid of > it, but if i can't do that without a rewrite then i don't mind living with > the 3 extra characters. > You don't need a big rewrite.. You just need to turn the member pointer *template argument type* (not the template argument itself) to a meta-function. This will be necessary for doing the step mentioned below anyway. Here is a simplification showing the technique: template <class T, T V> integral_type {}; typedef integral_type<int, 4> int_4; typedef integral_type<bool, false> bool_false; But in your case the second T in integral_type would be the result of a meta-function. > Also I think using a function pointer template and then converting this >> (based on the already known class) would be much cleaner (and shorter) than >> the way you directly pass member function template arguments: >> >> e.g. <MyType, int MyType::*(int, int), &MyType::memfunc> >> v.s. <MyType, int (int, int), &MyType::memfunc> >> > > Doh! i didn't realize i could get away with that. Time to go back to > experimenting... > Yes, as mentioned above you just need a meta-function that will turn MyType and the pointer function template type into a member-function template type.. James -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
