Skip to content

Upgrade to C++20 #1

Description

@OptimumCpp

std::thread is mostly a backward compatiblity class for C++11. The need for manual join is a missed case for RAII. The fix is std::jthread with automatic join on destruction. It also uses std::stop_token; a feature in high demand that many developers try to implement for controlling termination of event loops in looping threads. From C++20 onward, it's better to never mention std::thread in introductory material , and simply start with std::jthread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions