Using a C++ function template from CLI wrapper
up vote
0
down vote
favorite
I'm building a C++/CLI DLL to be able to communicate a plain C++ DLL with a C# application. The plain C++ DLL is third party provided and I have no way to modify it. That plain C++ DLL contains some member function templates, in the way: plain C++ DLL header file: class pureCPP { template<typename T> void usefulFunctionA(T &b, T const &a) { /* Implementation of the function */ } } So my idea would be to reflect that in the CLI DLL header file: CLI DLL header file: public ref class CLI_DLL { template<typename T> void usefulFunctionB(T &b, T const &a) { pureCppPtr->usefulFunctionA(b, a); } PureCPP *pureCppPtr; } And then in the C# executable for example simply call: CLI_DLL cliDLL ...