Skip to content
Snippets Groups Projects
Unverified Commit e66cedf4 authored by kongr45gpen's avatar kongr45gpen
Browse files

Remove noexcept, as the string.append functions may throw exceptions

parent e6d520ca
No related branches found
No related tags found
No related merge requests found
...@@ -111,16 +111,17 @@ public: ...@@ -111,16 +111,17 @@ public:
* *
* @tparam T The type of value to append * @tparam T The type of value to append
* @param value The new value to add * @param value The new value to add
* @todo See if noexcept can be added here without triggering warnings
* @return The current Logger::LogEntry where the value has been appended * @return The current Logger::LogEntry where the value has been appended
*/ */
template <class T> template <class T>
Logger::LogEntry& operator<<(const T value) noexcept { Logger::LogEntry& operator<<(const T value) {
etl::to_string(value, message, format, true); etl::to_string(value, message, format, true);
return *this; return *this;
} }
Logger::LogEntry& operator<<(const std::string& value) noexcept; Logger::LogEntry& operator<<(const std::string& value);
}; };
/** /**
......
...@@ -4,14 +4,14 @@ etl::format_spec Logger::format; ...@@ -4,14 +4,14 @@ etl::format_spec Logger::format;
// Reimplementation of the function for variable C strings // Reimplementation of the function for variable C strings
template <> template <>
Logger::LogEntry& Logger::LogEntry::operator<<(char* value) noexcept { Logger::LogEntry& Logger::LogEntry::operator<<(char* value) {
message.append(value); message.append(value);
return *this; return *this;
} }
// Reimplementation of the function for C strings // Reimplementation of the function for C strings
template <> template <>
Logger::LogEntry& Logger::LogEntry::operator<<(const char* value) noexcept { Logger::LogEntry& Logger::LogEntry::operator<<(const char* value) {
message.append(value); message.append(value);
return *this; return *this;
} }
......
...@@ -61,7 +61,7 @@ void Logger::log(Logger::LogLevel level, etl::istring & message) { ...@@ -61,7 +61,7 @@ void Logger::log(Logger::LogLevel level, etl::istring & message) {
// Reimplementation of the log function for C++ strings // Reimplementation of the log function for C++ strings
// This is kept in the Platform files, since we don't want to mess with std::strings in the microcontroller // This is kept in the Platform files, since we don't want to mess with std::strings in the microcontroller
Logger::LogEntry& Logger::LogEntry::operator<<(const std::string & value) noexcept { Logger::LogEntry& Logger::LogEntry::operator<<(const std::string & value) {
message.append(value.c_str()); message.append(value.c_str());
return *this; return *this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment