Skip to content

Simple processor and Simple Log processor use a non-standard feature deprecated in C++20 #468

@maxgolov

Description

@maxgolov

These two pieces of code:

std::atomic_flag shutdown_latch_{ATOMIC_FLAG_INIT};

std::atomic_flag shutdown_latch_{ATOMIC_FLAG_INIT};

Should be rewritten as follows:

std::atomic_flag static_flag = ATOMIC_FLAG_INIT; // static initialization,
  • and empty constructor for C++20, since This macro is no longer needed and deprecated, since default constructor of std::atomic_flag initializes it to clear state.

I hit this while rebasing my PR for Standard Library support and testing it with C++20. The code won't compile as written in Visual Studio 2019 with C++20 enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpr:please-mergeThis PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions