Skip to content

Commit 522ed98

Browse files
authored
ICU-23004 make C++ code point iterators/ranges work with C++20 (#3499)
1 parent 88db995 commit 522ed98

File tree

3 files changed

+1093
-412
lines changed

3 files changed

+1093
-412
lines changed

icu4c/source/common/unicode/platform.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@
479479
/* Otherwise use the predefined value. */
480480
#elif !defined(__cplusplus)
481481
# define U_CPLUSPLUS_VERSION 0
482+
// The value of _MSVC_LANG for C++23 preview is undocumented, except that it is larger than 202002.
483+
// As of this writing, it is 202004.
484+
#elif __cplusplus >= 202302L || (defined(_MSVC_LANG) && _MSVC_LANG > 202002L)
485+
# define U_CPLUSPLUS_VERSION 23
482486
#elif __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
483487
# define U_CPLUSPLUS_VERSION 20
484488
#elif __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)

0 commit comments

Comments
 (0)