mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Use explicit streaming ops instead of Boost.LexicalCast
This commit is contained in:
parent
898a5a4524
commit
04dff97fde
5 changed files with 24 additions and 17 deletions
|
|
@ -35,13 +35,15 @@ namespace
|
|||
//]
|
||||
|
||||
//[ quick_constraint_solution
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <sstream>
|
||||
|
||||
namespace // in the same namespace as 'my_class'
|
||||
{
|
||||
bool operator==( const my_class& actual, const std::string& expected ) // the first part of the trick is to compare to a string
|
||||
{
|
||||
return boost::lexical_cast< std::string >( actual ) == expected;
|
||||
std::ostringstream s;
|
||||
s << actual;
|
||||
return s.str() == expected;
|
||||
}
|
||||
} // mock
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue