linksplatform / linksplatform/Delegates
Create a new delegate specialization
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
We can create ConstDelegate or UniqueDelegate, or NonMutableDelegate and others
For support the follow style:
auto GlobalDelegate = Delegate(...);
// change follow function
{
GlobalDelegate Delegate(shared ptr to object, ptr to method);
}
// case #1 - create from standart delegate
{
auto delegate = NEW_DELEGATE_NAME(GlobalDelegate);
WorkFunc(delegate);
}
// case #2 - create from ref to object and ptr to method
auto global_ptr = std::shared_ptr(...);
{
auto delegate = NEW_DELEGATE_NAME(*global_ptr, &decltype(*global_ptr)::FOO);
WorkFunc(delegate);
}
// case #3 - create from ref to object and ptr to method
auto global_ptr = std::shared_ptr(...);
{
Object object = ...;
auto delegate = NEW_DELEGATE_NAME(object, &Object::FOO);
WorkFunc(delegate);
}
// case #4 - create from unique_ptr to object and ptr to method
auto global_ptr = std::shared_ptr(...);
{
auto object = std::unique_ptr(...);
auto delegate = NEW_DELEGATE_NAME(object, &decltype(*object)::FOO);
WorkFunc(delegate);
}
The main purpose of such a delegate is to avoid creating a std::shared_ptr.
Since it can use only objects from its own visibility zone or from a higher one, there will be no problems with dangling pointers
P.S. also can use Platform::Delegates::Delegate template specialization
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Platform::Delegates::Delegate template specialization and compare the proposed ConstDelegate, UniqueDelegate, and NonMutableDelegate variants. Clarify the intended specialization name and ownership rules for the four construction cases, especially avoiding std::shared_ptr without dangling pointers. Done means an agreed delegate design supports the required object and method forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100