Skip to content

Add explicit to single-parameter constructors #28

@NewbieOrange

Description

@NewbieOrange

Describe the new feature

Can we add explicit to single-parameter constructors to avoid unintended implicit construct?

Code example

    explicit thread_pool(const ui32 &_thread_count = std::thread::hardware_concurrency())
        : thread_count(_thread_count ? _thread_count : std::thread::hardware_concurrency()), threads(new std::thread[thread_count]);
// ...
    explicit synced_stream(std::ostream &_out_stream = std::cout);

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions