linksplatform / linksplatform/RegularExpressions.Transformer.CSharpToCpp

Fast forwarding as function arguments

Open
#62 0 comments 1 reaction 0 assignees View on GitHub
enhancement performance
Dominant language
Python
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

- use `const &` for [big type] argument
- use `universal reference` to forward template argument
- use `std::forward` to forward template argument
```c++
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
}
```
```c++
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 identified. Use the C++ examples in the issue as the behavioral reference, first locating the transformer entry point that emits function arguments and any existing tests for generated signatures. Done means the intended forwarding behavior is specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.