# Visual Studio: select /std:c++23preview or /std:c++latest ?

**URL:** https://discourse.cmake.org/t/visual-studio-select-std-c-23preview-or-std-c-latest/15456
**Category:** Usage
**Created:** [January 13, 2026, 1:36pm UTC](https://discourse.cmake.org/t/visual-studio-select-std-c-23preview-or-std-c-latest/15456 "2026-01-13T13:36:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![johan556](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johan556/32/788_2.png) [@johan556](https://discourse.cmake.org/u/johan556)
#### Post date: [January 13, 2026, 1:36pm UTC](https://discourse.cmake.org/t/visual-studio-select-std-c-23preview-or-std-c-latest/15456/1 "2026-01-13T13:36:58Z")

</div>

How do I select among the options /std:c++23preview and /std:c++latest in Visual Studio. I currently have:

```auto
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

```

and this results in “/std:c++latest” in my generated project (both in Visual Studio 2022, and in 2026). I have not been able to get " /std:c++23preview" via setting variables like above in CMake. I guess it should be possible, but I haven’t succeeded yet.

I have tried with CMake 4.2.1 and setting cmake\_minimum\_required(VERSION 4.2) too, suspecting that it should have an effect too.

Have I missed some obvious detail?

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [January 21, 2026, 2:44pm UTC](https://discourse.cmake.org/t/visual-studio-select-std-c-23preview-or-std-c-latest/15456/2 "2026-01-21T14:44:52Z")

</div>

This was previously implemented and then reverted for reasons discussed in [CMake Issue 26692](https://gitlab.kitware.com/cmake/cmake/-/issues/26692#note_1635924).
