diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-01-29 13:25:08 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:16:25 +0300 |
commit | 0bec0e6da0f336f4ac0ee93dbc1b2563b4411c40 (patch) | |
tree | cb0cbe0cc2d900dd7b7dc9f60a0c4d3164bcfd1f /3party | |
parent | 6dc309a95450622c669be59543e540481809da72 (diff) |
Fix warnings in opening_hours.cpp
Diffstat (limited to '3party')
-rw-r--r-- | 3party/opening_hours/opening_hours.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/3party/opening_hours/opening_hours.cpp b/3party/opening_hours/opening_hours.cpp index b3ccf02f60..81f7fd0997 100644 --- a/3party/opening_hours/opening_hours.cpp +++ b/3party/opening_hours/opening_hours.cpp @@ -32,6 +32,7 @@ #include <iomanip> #include <ios> #include <ostream> +#include <type_traits> #include <vector> namespace @@ -94,8 +95,10 @@ class StreamFlagsKeeper std::ios_base::fmtflags m_flags; }; -void PrintPaddedNumber(std::ostream & ost, uint32_t const number, uint32_t const padding = 1) +template <typename TNumber> +void PrintPaddedNumber(std::ostream & ost, TNumber const number, uint32_t const padding = 1) { + static_assert(std::is_integral<TNumber>::value, "number should be of integral type."); StreamFlagsKeeper keeper(ost); ost << std::setw(padding) << std::setfill('0') << number; } |