Last active
May 6, 2019 10:52
-
-
Save codeporting-com-gists/4e51b0d4f03e1acaf3b4156ae7ba05f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codeporting-Cs2Cpp-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C# source code | |
public class IntEnumerator : IEnumerator<int> | |
{ | |
public int Current | |
{ | |
get | |
{ | |
return 0; | |
} | |
} | |
object System.Collections.IEnumerator.Current | |
{ | |
get | |
{ | |
return Current; | |
} | |
} | |
public void Dispose() | |
{ | |
} | |
public bool MoveNext() | |
{ | |
return false; | |
} | |
public void Reset() | |
{ | |
} | |
} | |
public class IntComparer : IComparer<int> | |
{ | |
public int Compare(int a, int b) | |
{ | |
return (a < b) ? -1 : (a == b) ? 0 : 1; | |
} | |
} | |
public class StringEnumerator : IEnumerator<string> | |
{ | |
public string Current | |
{ | |
get | |
{ | |
return "StringEnumerator"; | |
} | |
} | |
object System.Collections.IEnumerator.Current | |
{ | |
get | |
{ | |
return Current; | |
} | |
} | |
public void Dispose() | |
{ | |
} | |
public bool MoveNext() | |
{ | |
return false; | |
} | |
public void Reset() | |
{ | |
} | |
} | |
public class StringOrdinalComparer : IComparer<string> | |
{ | |
public int Compare(string a, string b) | |
{ | |
return string.Compare(a, b); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C# source code | |
using System; | |
using NUnit.Framework; | |
namespace SampleCsProject.Attributes | |
{ | |
[TestFixture] | |
class PortConstStringAsWCharTest | |
{ | |
const string WCharValueByConfig = "def"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C# source code | |
using System; | |
using NUnit.Framework; | |
namespace SampleCsProject.Attributes | |
{ | |
namespace UsingViaConfig | |
{ | |
public delegate TResult Func<out TResult>(); | |
public delegate TResult Func<in T, out TResult>(T arg); | |
public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C++ source code | |
class StringEnumerable : public System::Collections::Generic::IEnumerable<System::String> | |
{ | |
public: | |
System::SharedPtr<System::Collections::Generic::IEnumerator<System::String>> GetEnumerator() | |
{ | |
//... | |
} | |
}; | |
class GetSetClass : public System::Object | |
{ | |
private: | |
int32_t i; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C# source code | |
public class StringEnumerable : IEnumerable<string> | |
{ | |
public IEnumerator<string> GetEnumerator() | |
{ | |
//... | |
} | |
IEnumerator IEnumerable.GetEnumerator() | |
{ | |
return GetEnumerator(); | |
} | |
} | |
class GetSetClass | |
{ | |
private int i; | |
public int someProperty | |
{ | |
get | |
{ | |
return i; | |
} | |
set | |
{ | |
i = value; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C++ source code | |
#include <system/string.h> | |
#include <cstdint> | |
int32_t IntEnumerator::get_Current() const | |
{ | |
return 0; | |
} | |
bool IntEnumerator::MoveNext() | |
{ | |
return false; | |
} | |
void IntEnumerator::Reset() { } | |
int32_t IntComparer::Compare(int32_t a, int32_t b) const | |
{ | |
return (a < b) ? -1 : (a == b) ? 0 : 1; | |
} | |
System::String StringEnumerator::get_Current() const | |
{ | |
return L"StringEnumerator"; | |
} | |
bool StringEnumerator::MoveNext() | |
{ | |
return false; | |
} | |
void StringEnumerator::Reset() { } | |
int32_t StringOrdinalComparer::Compare(System::String a, System::String b) const | |
{ | |
return System::String::Compare(a, b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment