简体   繁体   中英

How to expose C# Tuples to C++

I'm a C++ developer who is currently writing a library in C# which has to be exposed to C++. As of now I'm using Tuples in C# to get a list of Pair of strings, which is described in the following structure.

public struct ProductInfo
{
    string ProductID;
    List<Tuple<String,String>> attributes;
}; 

I would like to expose this structure to C++. I'm expecting C++ developers to use std::pair to fill in. But I'm not sure how to Marshal the same from C++ to C#. My googling didn't give me much help. Can somebody throw some light on this?

根据您希望互操作的准确程度,您需要如何使用PInvokeSWIG 构造结构

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM