appstream
appstream copied to clipboard
Build error in C++20 project
qt/component.h has a function named 'requires'. When including this header in a project that is building with C++20 this will result in a compile error since requires is a reserved keyword in C++20
In file included from /usr/include/AppStreamQt/pool.h:28,
from /home/nico/kde/src/plasma-workspace/applets/kicker/plugin/actionlist.cpp:45:
/usr/include/AppStreamQt/component.h:195:36: error: expected unqualified-id before 'requires'
195 | QList<AppStream::Relation> requires() const;
Hmm... I am not sure how to resolve this without an API break. Is there any best practice on how to deal with these kinds of issues?
good question. I'd say we introduce a new alternative name, mark the old one as deprecated and ifdef the old one out when building against C++20. People upgrading to C++20 are going to have a breakage, but that way we'd avoid/postpone the breakage for people with older C++
This is actually resolved now, with an API break in the 1.0 development branch.