Add log::stream_type typedef

This addition is useful when an explicit template instantiation of
operator<< is needed, for example, when logging from an ARM mode
function. Example usage:

template mtl::log::stream_type& mtl::log::stream_type::operator<<
<uint16_t>(uint16_t);

ARM_MODE void foo(int16_t x) {
	mtl::log::debug << x; // Without the explicit template
	instantiation, an ODR violation would occur.
}
This commit is contained in:
Madeline Busig 2024-07-28 18:08:21 -06:00
parent 45a1690032
commit f2862f7c96

View File

@ -21,6 +21,8 @@ constexpr char endl_char = 0;
constexpr char endl_char = '\n';
#endif
using stream_type = basic_string_stream<false, endl_char>;
/**
* \brief Log stream
*
@ -42,7 +44,7 @@ constexpr char endl_char = '\n';
* On MGBA this also starts the line with "GBA Debug: ",so the line is not
* completely blank either.
*/
class stream : public basic_string_stream<false, endl_char> {
class stream : public stream_type {
private:
level m_log_level;