linksplatform / linksplatform/RegularExpressions.Transformer.CSharpToCpp
Some comments
- Dominant language
- Python
- Stars
- 10
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
- use **C++** type style:
- `Type& val`
- `Type* val`
- use `std::move` for forward `std::string` (and other big [not fundamental] types)
```cpp
constructor(std::string string)
: field(std::move(string))
```
- use `const &` for [big type] argument
- use `universal reference` to forward template argument
- use `std::forward` to forward template argument
```cpp
auto function(std::vector& list, big_type case1, const big_type& case2, auto&& case3)
{
list.push_back(std::move(case1)) // one copy/only move, but call function(list, std::move(val), ..., ...)
list.push_back(case2) // always one copy
list.push_back(std::forward(case3)) // same case1 but have other features
}
```
```cpp
auto function(big_type case1, const big_type& case2, auto&& case3)
{
case1.readonly_func() // (( always one copy
case2.readonly_func() // )) no copy
case3.readonly_func() // )) no copy
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
No files, tests, or entry points are named. First locate the part of the CSharpToCpp transformer that produces C++ function parameters and constructors, then confirm the project’s expected ownership and forwarding conventions before defining the scope and tests for the requested style changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100