Switch to C++20

Prepare for using std::array<> and std::span<> in headers included from
this library. Remove the AFont constructors to prevent that the build
fails as follows:

frameworks/base/native/android/system_fonts.cpp:265:35: error: no matching member function for call to 'insert'
                            fonts.insert(
                            ~~~~~~^~~~~~

Removing these constructors is necessary because of the following rule:
"An aggregate is one of the following types [...] class type (struct or
union) that has [...] no user-declared or inherited constructors (since
C++20)". Source:
https://en.cppreference.com/w/cpp/language/aggregate_initialization.

Bug:  260725458
Change-Id: I384d05f5d3e471f8f58294119d04eb8ab16697ba
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche
2022-11-21 15:49:17 -08:00
parent 282a29b8ba
commit b66923ab2d
3 changed files with 3 additions and 3 deletions

View File

@@ -40,6 +40,8 @@ cc_library_shared {
cppflags: ["-Wno-conversion-null"],
cpp_std: "gnu++20",
srcs: [
"android_animation_PropertyValuesHolder.cpp",
"android_os_SystemClock.cpp",

View File

@@ -34,6 +34,7 @@ ndk_library {
cc_defaults {
name: "libandroid_defaults",
cpp_std: "gnu++20",
cflags: [
"-Wall",
"-Werror",

View File

@@ -66,9 +66,6 @@ struct AFont {
return mFilePath == o.mFilePath && mLocale == o.mLocale && mWeight == o.mWeight &&
mItalic == o.mItalic && mCollectionIndex == o.mCollectionIndex && mAxes == o.mAxes;
}
AFont() = default;
AFont(const AFont&) = default;
};
struct FontHasher {