Skip to content

Commit 6ff2a45

Browse files
committed
'Auto-commit changes made by Claude
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>'
1 parent 6d23d77 commit 6ff2a45

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Platform.Ranges
2+
{
3+
public struct Range<T>
4+
{
5+
public T Minimum;
6+
public T Maximum;
7+
8+
public override int GetHashCode()
9+
{
10+
return {Minimum, Maximum}.GetHashCode();
11+
}
12+
}
13+
}

examples/test_program.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System;
2+
using Platform.RegularExpressions.Transformer.CSharpToCpp;
3+
4+
class Program
5+
{
6+
static void Main()
7+
{
8+
var transformer = new CSharpToCppTransformer();
9+
10+
string input = @"
11+
namespace Platform.Ranges
12+
{
13+
public struct Range<T>
14+
{
15+
public T Minimum;
16+
public T Maximum;
17+
18+
public override int GetHashCode()
19+
{
20+
return {Minimum, Maximum}.GetHashCode();
21+
}
22+
}
23+
}";
24+
25+
string result = transformer.Transform(input);
26+
Console.WriteLine("===== TRANSFORMED OUTPUT =====");
27+
Console.WriteLine(result);
28+
29+
// Check if we have the new safe specialization syntax
30+
if (result.Contains("template <typename T>") && result.Contains("struct std::hash<"))
31+
{
32+
Console.WriteLine("\n✅ SUCCESS: Safe specialization pattern detected!");
33+
if (!result.Contains("namespace std\n{"))
34+
{
35+
Console.WriteLine("✅ SUCCESS: No unsafe namespace std usage detected!");
36+
}
37+
}
38+
else
39+
{
40+
Console.WriteLine("\n❌ FAILURE: Safe specialization pattern not found!");
41+
}
42+
}
43+
}

examples/test_transformation.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Platform.Ranges
2+
{
3+
public struct Range<T>
4+
{
5+
public T Minimum { get; set; }
6+
public T Maximum { get; set; }
7+
8+
public override int GetHashCode()
9+
{
10+
return {Minimum, Maximum}.GetHashCode();
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)