Skip to content

Update C++ standard to C++17 #1763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion release_build_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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
Expand Down
Loading