Proposal: raise minimum C++ standard from C++11 to C++14 #3411
darion-yaphet
started this conversation in
Ideas
Replies: 1 comment
|
I agree that we can move to C++14. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
I'd like to propose raising bRPC's minimum / default C++ language standard from C++11 to C++14.
This is intentionally a conservative step: update the build defaults and docs first, without a broad modernization refactor.
Motivation
C++14 was standardized in 2014. Current CI (e.g. Ubuntu 22.04 / modern macOS) and the compilers we already recommend (GCC 8.2+) support it without issue.
Docs still mention very old toolchains, but they also note that GCC 4.8 can only build up to older bRPC releases (e.g. 1.5.0). Keeping C++11 as the official
floor no longer matches what we actually test and recommend.
Newer Protobuf versions require at least C++14, and bRPC already switches to C++17 when Protobuf >= 22 (for Abseil). A C++14 floor better matches the
ecosystem without jumping all the way to C++17 yet.
C++14 mainly "completes C++11" (
std::make_unique, generic lambdas, relaxedconstexpr,_ttrait aliases,[[deprecated]], etc.). This makes futuremaintenance easier; it is not being proposed for runtime performance gains.
Non-goals (for this proposal)
-std=c++11→-std=c++14aloneDISALLOW_COPY_AND_ASSIGN, homemade traits, etc.) in the same change-std=Proposed scope (phase 1)
If there is consensus, follow up with a small PR that only:
BRPC_CXX_STANDARD11 → 14config_brpc.sh: default-std=c++0x→-std=c++14cxx_std_11/-std=c++11mentionsExisting behavior should remain:
Optional later phases (separate PRs, only if desired):
make_unique, etc.)Compatibility impact
defaults first
Alternatives considered
Lowest churn, but the documented floor keeps drifting away from CI/dependencies.
Better long-term alignment with the Protobuf>=22 / Abseil path. Slightly larger jump; can be a follow-up once C++14 lands.
Raising the compile floor is closer to a toolchain requirement bump (similar in spirit to dropping Protobuf 2.x in 1.8.0) than a major API break. Waiting for
2.x may delay a low-risk cleanup indefinitely.
Questions for the community
Thanks for the feedback!
All reactions