On Thu, Dec 9, 2010 at 9:03 AM, fuzzy spoon <[email protected]> wrote:
> Ah, it is you! > Thanks for the response, > > Firstly, it seems to be a bug in the c++ compiler itself ( :( ) > Something along these lines : > https://connect.microsoft.com/VisualStudio/feedback/details/362170/function-template-cannot-be-overloaded-by-template-parameter-type > > The code is *extremely* primitive, and i am no real stranger to templates. > The confusing thing is the code examples you provided also failed to compile > (after a few hours of blaming my code). > I had a simple class/struct with a single function that i would have like > to expose : > > http://pastebin.com/PEwTpWFM > Something different: struct Factory<RG> : Factory_CtorForwarder<RG, tmp::TypeList< convert:: CtorForwarder0<RG> > > {}; You don't need the typelist-using forwarder there. You can use CtorForwarder0<RG> as the Factory<RG> base class. Or i might be wrong and it might be Factory_CtorForwarder0<RG> (i don't have the API in front of me at the moment). Also: 1. char const * ClassName<RG>::Value() 2. { 3. return "Phoenix::renderGeometry"; 4. } that won't work as you expect: the name MUST be a JS-legal class name without any class/object separators. but that's not causing the compilation error. int addVert(int x, int y); Can you try making that const and see if it compiles? Note that the implementation doesn't return a value, which will compile on MSVC but not on standards-conforming compilers. Implement integer return values are not legal in C++ (but are in the older C standards). g:\dev\v8juice\src\client\sample\boundnative\mynative.cpp(57) : error C2440: > 'specialization' : cannot convert from 'int (__thiscall MyNative::* )(void)' > to 'int (__thiscall MyNative::* const )(void) const' > That still bugs me the most. It seems to be saying that the compiler cannot distinguish vs. const- and non-const in this context. i don't know if that's a shortcoming in MSVC or a laxness in gcc (my compiler) which allowed me to implement it. Unfortunate, error code C2440 has about a hundred different causes: http://msdn.microsoft.com/en-us/library/sy5tsf8z(v=vs.80).aspx i haven't had time to look closely at it yet, but will look at it this evening. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
