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

Specialize template DefaultCastRegisterer<std::string>::disp

  Default implementation adds std::endl at the end of the stream.
  In the case of string this extra '\n' is not desired.
parent 85fcf12f
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,14 @@ inline boost::any DefaultCastRegisterer<std::string>::cast ...@@ -84,6 +84,14 @@ inline boost::any DefaultCastRegisterer<std::string>::cast
return inst; return inst;
} }
// for std::string, do not add std::endl at the end of the stream.
template <>
inline void DefaultCastRegisterer<std::string>::disp
(const boost::any &object, std::ostream &os)
{
os << boost::any_cast<std::string>(object);
}
/// Registers useful casts /// Registers useful casts
namespace { namespace {
DefaultCastRegisterer<double> double_reg; DefaultCastRegisterer<double> double_reg;
......
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