Are Templates Supported (Boost specifically)?

45 views
Skip to first unread message

fmfau...@gmail.com

unread,
Jun 9, 2015, 12:53:45 PM6/9/15
to cppsha...@googlegroups.com
I'm trying to determine if CppSharp will work for my project. Created a simple class and included "boost/intrusive/list.hpp" the generator ended up throwing an unsupported exception:

System.NotImplementedException was unhandled
HResult=-2147467263
Message=The method or operation is not implemented.
Source=CppSharp.Generator
StackTrace:
at CppSharp.Generators.CLI.CLIMarshalNativeToManagedPrinter.VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) in d:...\Generators\CLI\CLIMarshal.cs:line 255

If not fully supported are there any plans? Is there a workaround?


Here is the native .h:

namespace Prototype
{
// This class is exported from the CallMe.Native.dll
class CALLMENATIVE_API CCallMeNative {
public:
CCallMeNative();
// TODO: add your methods here.

int howManyTimes();
std::string callMeMaybe(void);
std::string callMeAgain(void);

boost::intrusive::list_member_hook<> hook_bytype_HeartBreaker;
};
}

fmfau...@gmail.com

unread,
Jun 9, 2015, 12:58:08 PM6/9/15
to cppsha...@googlegroups.com, fmfau...@gmail.com
Didn't paste this preamble:
#pragma once

#ifdef CALLMENATIVE_EXPORTS
#define CALLMENATIVE_API __declspec(dllexport)
#else
#define CALLMENATIVE_API __declspec(dllimport)
#endif

#include <string>
#include "boost/intrusive/list.hpp"

João Matos

unread,
Jun 22, 2015, 5:18:22 PM6/22/15
to cppsha...@googlegroups.com, fmfau...@gmail.com, fmfau...@gmail.com
Seems like I missed this one.

You might want to try the C# backend instead since it's had the most development and testing for the last few months.

But nonetheless, if you could report this issue on Github along with the repro code it would be nice so we can look at it and fix the problem.
Reply all
Reply to author
Forward
0 new messages