File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -726,7 +726,7 @@ target_link_libraries(ecal_core_private
726726 ecal_core_serialization $<TARGET_OBJECTS:ecal_core_serialization>
727727)
728728
729- target_compile_features (ecal_core_private PUBLIC cxx_std_14 )
729+ target_compile_features (ecal_core_private PUBLIC cxx_std_17 )
730730
731731set_property (TARGET ecal_core_private PROPERTY FOLDER core)
732732set_property (TARGET ecal_core_private PROPERTY POSITION_INDEPENDENT_CODE ON )
@@ -792,6 +792,9 @@ set_target_properties(core
792792 VISIBILITY_INLINES_HIDDEN ON
793793)
794794
795+ target_compile_features (core INTERFACE cxx_std_14)
796+ target_compile_features (core PRIVATE cxx_std_17)
797+
795798set_property (TARGET core PROPERTY FOLDER core)
796799endmacro ()
797800
Original file line number Diff line number Diff line change 2727#include < atomic>
2828#include < chrono>
2929#include < memory>
30+ #include < optional>
3031#include < numeric>
3132
3233namespace eCAL
@@ -99,11 +100,11 @@ namespace eCAL
99100 {
100101 if (!calculator)
101102 {
102- calculator = std::make_unique< FrequencyCalculator<T> >(now);
103+ calculator = FrequencyCalculator<T>(now);
103104 }
104105 else
105106 {
106- calculator-> addTick (now);
107+ calculator. value (). addTick (now);
107108 }
108109 last_tick_time = now;
109110 received_tick_since_get_frequency_called = true ;
@@ -137,7 +138,7 @@ namespace eCAL
137138 time_point timeout_time = last_tick_time + std::chrono::duration_cast<std::chrono::nanoseconds>(expected_time_in_seconds_between_last_and_next_tick * reset_factor);
138139 if (now > timeout_time)
139140 {
140- calculator. reset () ;
141+ calculator = std:: nullopt ;
141142 return 0.0 ;
142143 }
143144
@@ -148,7 +149,7 @@ namespace eCAL
148149 float reset_factor;
149150 time_point last_tick_time;
150151 bool received_tick_since_get_frequency_called = false ;
151- std::unique_ptr <FrequencyCalculator<T>> calculator;
152+ std::optional <FrequencyCalculator<T>> calculator;
152153 };
153154}
154155
You can’t perform that action at this time.
0 commit comments