mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
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. |
||
---|---|---|
.. | ||
as_is | ||
packaging | ||
source | ||
APIChangeReport.html | ||
APIChangeReport.md | ||
icu4c.css | ||
LICENSE | ||
license.html | ||
readme.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> <head> <title>ReadMe for ICU4C</title> <meta name="COPYRIGHT" content= "Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html"/> <!-- meta name="COPYRIGHT" content= "Copyright (c) 1997-2016 IBM Corporation and others. All Rights Reserved." / --> <meta name="KEYWORDS" content= "ICU; International Components for Unicode; ICU4C; what's new; readme; read me; introduction; downloads; downloading; building; installation;" /> <meta name="DESCRIPTION" content= "The introduction to the International Components for Unicode with instructions on building, installation, usage and other information about ICU." /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link type="text/css" href="./icu4c.css" rel="stylesheet"/> </head> <body> <p>This readme has moved to the <a href="https://unicode-org.github.io/icu/userguide/icu4c/">ICU4C Readme</a> section in the <a href="https://unicode-org.github.io/icu/">ICU User Guide</a>.</p> <hr /> <p> Copyright © 2016 and later: Unicode, Inc. and others. License & terms of use: <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/> Copyright © 1997-2016 International Business Machines Corporation and others. All Rights Reserved.</p> </body> </html>