diff --git a/include/SAX/helpers/AttributesImpl.hpp b/include/SAX/helpers/AttributesImpl.hpp index 064c2841..12ae708d 100644 --- a/include/SAX/helpers/AttributesImpl.hpp +++ b/include/SAX/helpers/AttributesImpl.hpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace Arabica { @@ -546,9 +547,9 @@ private: void badIndex(unsigned int index) { // sort out - std::string msg = - "Attempt to modify attribute at illegal index: " + index; - throw std::out_of_range(msg); + std::stringstream msg; + msg << "Attempt to modify attribute at illegal index: " << index; + throw std::out_of_range(msg.str()); } class AttributeNamed diff --git a/include/Taggle/impl/html/HTMLScanner.hpp b/include/Taggle/impl/html/HTMLScanner.hpp index 6be7aaf8..1001b2d7 100644 --- a/include/Taggle/impl/html/HTMLScanner.hpp +++ b/include/Taggle/impl/html/HTMLScanner.hpp @@ -1,6 +1,7 @@ #ifndef ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP #define ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP +#include #include #include #include @@ -473,7 +474,9 @@ public: outputBuffer_.clear(); break; default: - throw std::runtime_error("Can't process state " + action); + throw std::runtime_error( + "Can't process state " + static_cast( + std::stringstream() << action).str()); } // switch ... state_ = nextState_; } // while (state_ != S_DONE)