The home of the ICU project source code.
Find a file
Fredrik Roubert 3534d337c6 ICU-20973 Rewrite polymorphic CacheKeyBase equality operators for C++20.
The existing polymorphic equality operators that use different types for
the `this` and `other` objects are ambiguous with C++20 resolution rules
that require equality for reversed arguments.

In order to resolve that, while also possibly making the implementation
somewhat simpler overall, the implementation classes (LocaleCacheKey
and DateFmtBestPatternKey) now get normal (non-polymorphic) equality
operators that are trivially non-ambiguous (and as a bonus also don't
need any type casts), while the dynamic type checking logic is moved
into protected helper functions, which in the end are invoked
(without any ambiguity) by friend operators in the base class.

This way, all equality testing of cache key objects ends up taking one
of these two possible paths:

1. Both sides of the equality operator are of the same implementation
   type (ie. LocaleCacheKey or DateFmtBestPatternKey):

   The type specific equality operator is called directly, comparing the
   relevant attributes of the two objects directly.

2. The two sides of the equality operator are either of different types
   or of some base class type:

   The friend equality operators of CacheKeyBase call the virtual helper
   function to figure out whether the two objects are actually of the
   same type and if they are and this type is an implementation type
   then does the necessary type cast to get to 1.
2021-08-26 00:12:04 +02:00
.ci-builds ICU-20973 Add C++20 build bots to Azure CI: Clang-13, GCC-11, MSVC with std:c++latest 2021-08-17 15:42:27 -07:00
.github ICU-21569 Fix Java7 breakage in LSTM & add Java7 CI 2021-05-27 16:11:51 -07:00
docs ICU-21590 Add skeleton syntax for integer-width-trunc 2021-08-25 12:51:51 -05:00
icu4c ICU-20973 Rewrite polymorphic CacheKeyBase equality operators for C++20. 2021-08-26 00:12:04 +02:00
icu4j ICU-21590 Add skeleton syntax for integer-width-trunc 2021-08-25 12:51:51 -05:00
tools ICU-21708 Update ant version in cldr-to-icu tool 2021-08-24 13:46:57 -04:00
vendor/double-conversion ICU-21508 Rename 'master' to 'main' in docs, maven files, scripts, etc 2021-03-24 18:56:50 +01:00
.bazeliskrc ICU-21635 Unicode 14 beta 2021-06-21 22:26:15 +00:00
.cpyskip.txt ICU-21535 Port Cygwin CI build from AppVeyor to Azure Pipelines 2021-04-08 17:04:07 -07:00
.gitattributes ICU-20717 move small files out of lfs: .dat, .gz, .gif 2020-09-17 11:09:48 -07:00
.gitignore ICU-21404 Migrate various documents from Google Sites pages to Markdown. 2021-06-11 09:48:19 +02:00
KEYS ICU-21361 Add public PGP key 2020-11-10 13:50:58 -08:00
README.md ICU-21244 Fix the Valgrind status badge in the top-level Readme. 2021-08-18 16:23:17 -07:00
WORKSPACE ICU-21117 Use Bazel to automate generation of Unicode data files 2021-03-24 10:39:38 -07:00

International Components for Unicode

This is the repository for the International Components for Unicode. The ICU project is under the stewardship of The Unicode Consortium.

ICU Logo

🔴🔴🔴 Special Notice About Branch Renaming 🔴🔴🔴

Around March 24-25, 2021 we renamed the master branch to main. You may need to rename your branch in your local git repo and change your normal git command to reflect this change. See also https://github.com/github/renaming

Build Status (main branch)

Build Status
GitHub Actions GHA CI
Azure Pipelines Build Status
Azure Pipelines (Exhaustive Tests) Build Status
Azure Pipelines (Valgrind ICU4C) Build Status
Fuzzing Fuzzing Status

Subdirectories and Information

License

Please see ./icu4c/LICENSE (C and J are under an identical license file.)

Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. Terms of Use and License