C#中带有两个类的C#模板 [英] C++ template with two class in C#
本文介绍了C#中带有两个类的C#模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以转换吗?
is possible to convert?
struct sKeyState {
bool bPressed;
bool bReleased;
bool bHeld;
};
int m_numKeys;
Uint8* m_keyOldState;
const Uint8* m_keyNewState;
bool m_mouseOldState[5];
bool m_mouseNewState[5];
owncopy(
m_keyNewState,
m_keyNewState + m_numKeys,
m_keyOldState
);
owncopy(
m_mouseNewState,
m_mouseNewState + 5,
m_mouseOldState
);
template<class InputIterator, class OutputIterator>
OutputIterator owncopy(InputIterator first, InputIterator last, OutputIterator result)
{
while (first != last) {
*result = *first;
++result; ++first;
}
return result;
}
我的尝试:
public struct sKeyState
{
public bool bPressed;
public bool bReleased;
public bool bHeld;
};
int m_numKeys;
uint [] m_keyOldState;
uint [] m_keyNewState;
bool [] m_mouseOldState = new bool [5];
bool [] m_mouseNewState = new bool [5];
What I have tried:
public struct sKeyState
{
public bool bPressed;
public bool bReleased;
public bool bHeld;
};
int m_numKeys;
uint[] m_keyOldState;
uint[] m_keyNewState;
bool[] m_mouseOldState = new bool[5];
bool[] m_mouseNewState = new bool[5];
推荐答案
你可以尝试这个转换器的免费版本: C ++到C#转换器 [ ^ ]
但请注意,这些转换器不适合复杂的应用程序!
You can try the free version of this Converter: C++ to C# Converter[^]
But be warned, these converters are not suited for complex applications !
这篇关于C#中带有两个类的C#模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文