@@ -426,9 +426,7 @@ scope_exit(EF) -> scope_exit<EF>;
} /* namespace utils */
#ifndef __DOXYGEN__
-template<class CharT, class Traits>
-std::basic_ostream<CharT, Traits> &operator<<(std::basic_ostream<CharT, Traits> &os,
- const utils::Duration &d);
+std::ostream &operator<<(std::ostream &os, const utils::Duration &d);
#endif
} /* namespace libcamera */
@@ -658,11 +658,9 @@ void ScopeExitActions::release()
} /* namespace utils */
#ifndef __DOXYGEN__
-template<class CharT, class Traits>
-std::basic_ostream<CharT, Traits> &operator<<(std::basic_ostream<CharT, Traits> &os,
- const utils::Duration &d)
+std::ostream &operator<<(std::ostream &os, const utils::Duration &d)
{
- std::basic_ostringstream<CharT, Traits> s;
+ std::ostringstream s;
s.flags(os.flags());
s.imbue(os.getloc());
@@ -671,11 +669,6 @@ std::basic_ostream<CharT, Traits> &operator<<(std::basic_ostream<CharT, Traits>
s << d.get<std::micro>() << "us";
return os << s.str();
}
-
-template
-std::basic_ostream<char, std::char_traits<char>> &
-operator<< <char, std::char_traits<char>>(std::basic_ostream<char, std::char_traits<char>> &os,
- const utils::Duration &d);
#endif
} /* namespace libcamera */
There is no real need for a function template. It is not defined in a header file, so it has limited availability, and there exists only a single instantion. So convert it to use `std::ostream` directly, like most `operator<<` in the code base. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- include/libcamera/base/utils.h | 4 +--- src/libcamera/base/utils.cpp | 11 ++--------- 2 files changed, 3 insertions(+), 12 deletions(-)