I just realized my code base was a bit incoherent with some objects being constructed from strings using a constructor A(const std::string&)
and some others being constructed from strings using boost::lexical_cast<A>(const std::string&)
.
In my understanding, these fulfill the same need but do not behave the same in many ways, exceptions on a badly formatted string and conversions being the first ones that spring to my mind but I'm sure there are also other implications. So my questions is: What should I be using and why?
Edit: as per @hetepeperfan's comment, I'm transforming the std::string arguments in const std::string&, which is what I meant in the first place