chore: use C++20 standard (#410)

As of now sdbus-c++ supports C++20 but does not require it, and the used C++20 features are conditionally compiled depending on whether they are available or not.
This commit is contained in:
Stanislav Angelovič
2024-04-24 20:20:29 +02:00
parent 29e94c3b68
commit 0dc0c87cc9
4 changed files with 27 additions and 19 deletions
+5 -1
View File
@@ -884,7 +884,11 @@ namespace {
// Please note that the solution is NOT thread-safe.
// Another common solution is global sdbus-c++ startup/shutdown functions, but that would be an intrusive change.
/*constinit (C++20 keyword) */ static bool pseudoConnectionDestroyed{};
#ifdef __cpp_constinit
constinit static bool pseudoConnectionDestroyed{};
#else
static bool pseudoConnectionDestroyed{};
#endif
std::unique_ptr<sdbus::internal::IConnection, void(*)(sdbus::internal::IConnection*)> createPseudoConnection()
{