Skip to content
Snippets Groups Projects
Commit f0ddf275 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Partially revert 5daf1d39:

   "[signal-cast-helper] Removed unused template specialization".
   DefaultCastRegisterer<std::string>::cast template specialization is
   required to set empty string to a signal.
parent e70e3c8a
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,15 @@ inline boost::any DefaultCastRegisterer<double>::cast(std::istringstream &iss) { ...@@ -52,6 +52,15 @@ inline boost::any DefaultCastRegisterer<double>::cast(std::istringstream &iss) {
} }
} }
// for std::string, do not check failure. If input stream contains an
// empty string, iss.fail() returns true and an exception is thrown
template <>
inline boost::any
DefaultCastRegisterer<std::string>::cast(std::istringstream &iss) {
std::string inst(iss.str());
return inst;
}
// for std::string, do not add std::endl at the end of the stream. // for std::string, do not add std::endl at the end of the stream.
template <> template <>
inline void DefaultCastRegisterer<std::string>::disp(const boost::any &object, inline void DefaultCastRegisterer<std::string>::disp(const boost::any &object,
......
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