diff --git a/CMakeLists.txt b/CMakeLists.txt index aea6d80a34..fe69a2f4cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,13 @@ cmake_minimum_required (VERSION 3.1) -set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version. +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") +endif() + # Turn on virtual folders for visual studio set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index a141ee0b66..4bfdb0983d 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -100,10 +100,10 @@ Examples of typical Do's and Don'ts: they result in hard to understand errors, and can make correct use of your API harder to understand. -* Utilize C++11 features where appropriate. This project has adopted C++11, +* Utilize C++17 features where appropriate. This project has adopted C++17, and features such as `std::unique_ptr`, `std::shared_ptr`, - `std::make_unique`, and `std::move` are encouraged to improve code safety - and readability. However, avoid features from C++14 or newer standards. + `std::make_unique`, `std::move`, and `std::optional` are encouraged to + improve code safety and readability. * Go easy on objectifying everything, and prefer value types. In languages like Java it is common to give each "concept" your API deals with its own diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 0ecbafb0d9..6366fd8336 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -72,7 +72,7 @@ libs/windows | Windows static libraries (desktop or stub ## C++ Language Standards -The Firebase C++ SDK supports the C++14 language standard. For more information, +The Firebase C++ SDK supports the C++17 language standard. For more information, please see our [C++ Language Standard Support Criteria](https://opensource.google/documentation/policies/cplusplus-support#c_language_standard). @@ -677,6 +677,7 @@ code. ## Release Notes ### Upcoming Release - Changes + - General: Updated the minimum C++ standard from C++14 to C++17. - iOS: Added an option to explicitly specify your app's `AppDelegate` class name via the `FirebaseAppDelegateClassName` key in `Info.plist`. This provides a more direct way for Firebase to interact with your specified