Skip to content

unique_ptr<io_scheduler>& interface seems too restrictive #415

@borro0

Description

@borro0

For multiple functions (i.e. tcp/server tcp/client) a std::unique_ptr<coro::io_scheduler>& is asked as scheduler type. This enforces the caller to use unique_pointers. On the other hand, if you pass this to a coroutine, it conflicts with the CPP core guideline that you should not use reference types in coroutines: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cp53-parameters-to-coroutines-should-not-be-passed-by-reference

Would a coro::io_scheduler* raw pointer not be more flexible to the user?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions