Summary
Investigate all C++17-specific features used in opensomeip's core library (src/ and include/) to determine which would prevent compilation under a C++14 toolchain. The goal is to produce a clear inventory and, where feasible, identify drop-in C++14 alternatives. The output of this investigation is one or more follow-up tickets with concrete changes — this ticket itself involves no code changes.
Motivation
Embedded BSW frameworks such as Eclipse OpenBSW standardize on C++14. Integrating opensomeip into such a codebase currently requires the entire project to raise its language standard to C++17, which may conflict with existing code, toolchain constraints, or coding guidelines. Understanding and potentially reducing our C++17 surface would make opensomeip accessible to a broader embedded audience.
Scope
Audit src/ and include/ only (not tests/, examples/, or zephyr/). Platform backends under include/platform/ are in scope since they ship with the library.
Known C++17 Features in Use (starting point)
Based on an initial scan, the following C++17 features are used in the core library:
std::optional
| File |
Usage |
include/someip/message.h |
Lines 149, 169 |
include/serialization/serializer.h |
Lines 92, 227–234 |
include/e2e/e2e_protection.h |
Line 73 |
src/serialization/serializer.cpp |
Lines 436, 447, 458, 478, 486, 494, 502, 512 |
src/e2e/e2e_protection.cpp |
Line 86 |
src/e2e/e2e_profiles/standard_profile.cpp |
Line 135 |
if constexpr
| File |
Usage |
include/serialization/serializer.h |
Lines 246–268, 285–307 |
Structured bindings (auto [a, b] = ...)
| File |
Usage |
src/transport/tcp_transport.cpp |
Line 90 |
[[nodiscard]]
| File |
Usage |
include/transport/transport.h |
Lines 78, 91, 97, 121, 127 |
include/transport/tcp_transport.h |
Lines 101, 109 |
include/transport/udp_transport.h |
Line 72 |
[[maybe_unused]]
| File |
Usage |
src/sd/sd_server.cpp |
Line 482 |
src/someip/message.cpp |
Lines 300, 356, 369 |
std::apply
| File |
Usage |
include/platform/zephyr/thread_impl.h |
Line 92 |
include/platform/threadx/thread_impl.h |
Line 141 |
include/platform/freertos/thread_impl.h |
Line 155 |
Features not used (confirmed absent)
std::string_view, std::variant, std::any, std::shared_mutex, std::filesystem, std::clamp, std::invoke, fold expressions, CTAD, nested namespace declarations (namespace a::b).
Investigation Tasks
Acceptance Criteria
Related
- OpenBSW integration planning (see related tickets)
Summary
Investigate all C++17-specific features used in opensomeip's core library (
src/andinclude/) to determine which would prevent compilation under a C++14 toolchain. The goal is to produce a clear inventory and, where feasible, identify drop-in C++14 alternatives. The output of this investigation is one or more follow-up tickets with concrete changes — this ticket itself involves no code changes.Motivation
Embedded BSW frameworks such as Eclipse OpenBSW standardize on C++14. Integrating opensomeip into such a codebase currently requires the entire project to raise its language standard to C++17, which may conflict with existing code, toolchain constraints, or coding guidelines. Understanding and potentially reducing our C++17 surface would make opensomeip accessible to a broader embedded audience.
Scope
Audit
src/andinclude/only (nottests/,examples/, orzephyr/). Platform backends underinclude/platform/are in scope since they ship with the library.Known C++17 Features in Use (starting point)
Based on an initial scan, the following C++17 features are used in the core library:
std::optionalinclude/someip/message.hinclude/serialization/serializer.hinclude/e2e/e2e_protection.hsrc/serialization/serializer.cppsrc/e2e/e2e_protection.cppsrc/e2e/e2e_profiles/standard_profile.cppif constexprinclude/serialization/serializer.hStructured bindings (
auto [a, b] = ...)src/transport/tcp_transport.cpp[[nodiscard]]include/transport/transport.hinclude/transport/tcp_transport.hinclude/transport/udp_transport.h[[maybe_unused]]src/sd/sd_server.cppsrc/someip/message.cppstd::applyinclude/platform/zephyr/thread_impl.hinclude/platform/threadx/thread_impl.hinclude/platform/freertos/thread_impl.hFeatures not used (confirmed absent)
std::string_view,std::variant,std::any,std::shared_mutex,std::filesystem,std::clamp,std::invoke, fold expressions, CTAD, nested namespace declarations (namespace a::b).Investigation Tasks
std::optional→ customOptional<T>wrapper, pointer + bool, or ETLetl::optional?if constexpr→ SFINAE /std::enable_if/ tag dispatch?[[nodiscard]]/[[maybe_unused]]→ compiler-specific__attribute__or remove?std::apply→ manual tuple unpacking with index sequence?#if __cplusplus >= 201703L) is viable vs. a full migration to C++14-only constructsstd::shared_ptrfor arrays) that may not show up in a text searchAcceptance Criteria
Related