Commit 6d23d77
Use safe specialization for C++ functors
Replace unsafe std namespace specializations with safe template
specialization syntax:
- Changed from 'namespace std { template<...> struct hash<Type> {...} }'
- To 'template<...> struct std::hash<Type> {...}'
This addresses issue #63 by using the safer approach that avoids
namespace pollution and ADL issues.
Changes made in both C# and Python implementations:
- CSharpToCppTransformer.cs: Updated regex to generate safe syntax
- cs2cpp.py: Updated SubRule to generate safe syntax
- Added test case to verify the transformation works correctly
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 70a8bff commit 6d23d77
File tree
3 files changed
+33
-4
lines changed- csharp
- Platform.RegularExpressions.Transformer.CSharpToCpp.Tests
- Platform.RegularExpressions.Transformer.CSharpToCpp
- python/cs2cpp
3 files changed
+33
-4
lines changedLines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
38 | 67 | | |
39 | 68 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
582 | | - | |
| 581 | + | |
| 582 | + | |
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
581 | | - | |
| 580 | + | |
| 581 | + | |
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| |||
0 commit comments