6 Commits 6085dce832 ... 0cfc0bb587

Author SHA1 Message Date
  __vic 0cfc0bb587 Merge branch 'generic' into windows 6 months ago
  __vic 8889b1f206 Merge branch 'iso' into generic 6 months ago
  __vic 7f36372d79 C++17 is used by default 6 months ago
  __vic af017bed6e C++23 6 months ago
  __vic 5d72632400 /EHsc for MSVC++ 11 months ago
  __vic 903d69e71e __VIC_IF_CONSTEVAL added 1 year ago
8 changed files with 30 additions and 15 deletions
  1. 7 0
      ChangeLog
  2. 2 2
      doc/en/build.xml
  3. 3 3
      doc/en/general.xml
  4. 2 2
      doc/ru/build.xml
  5. 3 3
      doc/ru/general.xml
  6. 8 0
      include/__vic/_cfg.h
  7. 3 3
      src/GNUmakefile
  8. 2 2
      src/Makefile.nmake

+ 7 - 0
ChangeLog

@@ -4,6 +4,13 @@ Legend:
     * Changes
     ! Important
 
+2023-10-06  __vic
+    + C++23 mode support
+    * C++17 is used by default
+
+2023-04-07  __vic
+    + __VIC_IF_CONSTEVAL
+
 2022-03-02  __vic
     - readonly_cstring: compare(const char *,readonly_cstring)
 

+ 2 - 2
doc/en/build.xml

@@ -19,14 +19,14 @@ C:\> gmake
 </tty>
 <p>The library file will be built for you.</p>
 
-<p>C++14 is used by default but you can choose another language standard
+<p>C++17 is used by default but you can choose another language standard
 version using <tt>std</tt> option. E.g. to build the library in C++98 mode
 write:</p>
 <tty>
 C:\> gmake std=98
 </tty>
 
-<p>Available values include: 98, 11, 14, 17 and 20.</p>
+<p>Available values include: 98, 11, 14, 17, 20 and 23.</p>
 
 <p>Also you can choose the used compiler manually:</p>
 <tty>

+ 3 - 3
doc/en/general.xml

@@ -24,8 +24,8 @@ $ g++ -std=c++14 prog.cpp -l__vic14
 </tty>
 
 <p>The library can be built using one of the ISO C++ standards: C++98, C++11,
-C++14, C++17 or C++20. The standard suffix is used as a suffix for the library
-file (archive).</p>
+C++14, C++17, C++20 or C++23. The standard suffix is used as a suffix for the
+library file (archive).</p>
 
 <p>Some features require a specific minimal standard version to be available,
 e.g. many of them require at least C++11. These features are marked with
@@ -36,7 +36,7 @@ available otherwise. Such features are marked with <sign>C++98 only</sign>
 sign.</p>
 
 <p>Detailed description of the library components is provided in the subsequent
-chapters. Descriptions are grouped by headers. C++20 language syntax is mainly
+chapters. Descriptions are grouped by headers. C++23 language syntax is mainly
 used as a more complete and expressive one.</p>
 
 </chapter>

+ 2 - 2
doc/ru/build.xml

@@ -19,13 +19,13 @@ C:\> gmake
 </tty>
 <p>Файл библиотеки будет собран.</p>
 
-<p>По умолчанию используется C++14, но используя параметр <tt>std</tt> можно
+<p>По умолчанию используется C++17, но используя параметр <tt>std</tt> можно
 задать версию явно. Например для сборки в режиме C++98 наберите:</p>
 <tty>
 C:\> gmake std=98
 </tty>
 
-<p>Доступные значения включают: 98, 11, 14, 17 и 20.</p>
+<p>Доступные значения включают: 98, 11, 14, 17, 20 и 23.</p>
 
 <p>Также можно вручную выбрать используемый компилятор:</p>
 <tty>

+ 3 - 3
doc/ru/general.xml

@@ -24,8 +24,8 @@ $ g++ -std=c++14 prog.cpp -l__vic14
 </tty>
 
 <p>Библиотека может быть собрана с использованием одного из стандартов ISO C++:
-C++98, C++11, C++14, C++17 или C++20. Суффикс стандарта используется в качестве
-суффикса файла библиотеки (архива).</p>
+C++98, C++11, C++14, C++17, C++20 или C++23. Суффикс стандарта используется в
+качестве суффикса файла библиотеки (архива).</p>
 
 <p>Некоторые компоненты библиотеки требуют какую-то минимальную версию
 стандарта, например многие требуют использования как минимум C++11. Такие
@@ -38,6 +38,6 @@ C++98, C++11, C++14, C++17 или C++20. Суффикс стандарта ис
 
 <p>Детальное описание компонентов библиотеки приведено в последующих главах.
 Описание сгруппировано по заголовочным файлам. В основном используется синтаксис
-C++20, как более богатый и выразительный.</p>
+C++23, как более богатый и выразительный.</p>
 
 </chapter>

+ 8 - 0
include/__vic/_cfg.h

@@ -278,6 +278,14 @@
 #   define __VIC_CONSTEXPR14 inline
 #endif
 
+#if __cpp_if_consteval
+#   define __VIC_IF_CONSTEVAL if consteval
+#   define __VIC_IF_NOT_CONSTEVAL if !consteval
+#else
+#   define __VIC_IF_CONSTEVAL if(std::is_constant_evaluated())
+#   define __VIC_IF_NOT_CONSTEVAL if(!std::is_constant_evaluated())
+#endif
+
 #ifndef __has_include
 #   define __has_include(f) 0
 #endif

+ 3 - 3
src/GNUmakefile

@@ -2,10 +2,10 @@
 # GNU Make 3.82+ Makefile
 #
 # Usage:
-#   $ gmake [compiler={gcc|clang[-cl]|msvc}] [std={98|11|14|17|20}]
+#   $ gmake [compiler={gcc|clang[-cl]|msvc}] [std={98|11|14|17|20|23}]
 
 include ../src/defs.mk
-std = 14
+std = 17
 compiler = gcc
 
 ##############################################################################
@@ -29,7 +29,7 @@ CFLAGS := -DNDEBUG -D_CRT_SECURE_NO_DEPRECATE -O2 -Ob1 -GF
 WARNS  :=
 ##############################################################################
 else ifeq ($(compiler),msvc)
-CC     := cl /nologo /std:c++$(std) /Zc:__cplusplus /permissive-
+CC     := cl /nologo /std:c++$(std) /Zc:__cplusplus /permissive- /EHsc
 CFLAGS := -DNDEBUG -D_CRT_SECURE_NO_DEPRECATE -O2 -Ob1 -GF
 WARNS  :=
 endif

+ 2 - 2
src/Makefile.nmake

@@ -5,11 +5,11 @@
 #   $ nmake -f Makefile.nmake [compiler={msvc|clang-cl}] [std={14|17|20|latest}]
 
 !include ../src/defs.mk
-std = 14
+std = 17
 compiler = msvc
 
 !if "$(compiler)" == "msvc"
-CC = cl /nologo /std:c++$(std) /Zc:__cplusplus /permissive-
+CC = cl /nologo /std:c++$(std) /Zc:__cplusplus /permissive- /EHsc
 !elseif "$(compiler)" == "clang-cl"
 CC = clang-cl /std:c++$(std)
 !else