Commit bb86057
committed
Fix #5874: Use of designated initializers requires C++20 fails the build
Designated initializers are a feature of C++20:
https://en.cppreference.com/w/cpp/language/aggregate_initialization.
However, they appeared in
https://github.com/google-ai-edge/mediapipe/blob/ffe429d5278b914c44fdb5df3ce38962b55580bb/mediapipe/framework/output_stream_handler.cc#L145-L149
The project uses C++17 and adapting it for C++20 would be non-trivial.
The easiest fix is to avoid using aggregated initialization.
It is fine while the order of members is preserved:
```cpp
struct OutputStreamMonitoringInfo {
std::string stream_name;
// The total number of packets added to the output stream.
int num_packets_added;
// The next timestamp bound of the output stream.
Timestamp next_timestamp_bound;
};
```
https://github.com/google-ai-edge/mediapipe/blob/eecf8a5696d5e47edbd3b6e99a6064c99f9ab1a4/mediapipe/framework/output_stream_handler.h#L53-L591 parent eecf8a5 commit bb86057
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
| |||
0 commit comments