Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <iostream>
#include <assert.h>
#include <algorithm>
#include <functional>
#include "cpp_timer/Timer.h"
#include "cpp_timer/Ticker.h"
#include "cpp_timer/TimerTotal.h"
Expand Down Expand Up @@ -370,7 +371,7 @@ void Timer::buildTree_(){
// ================================================================================

const char* Timer::normalizeDuration_(time_t& duration) const{
static constexpr std::array units = {" ns", " us", " ms"};
static constexpr std::array<const char*, 3> units = {" ns", " us", " ms"};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a little digging and apparently this one is better fixed by adding an explicit #include <array> and then the template arguments can still be omitted

size_t div_count = 0;
while (duration > 1000 && div_count < (units.size() - 1)){
duration /= 1000;
Expand Down