add a way to print bool vars

This commit is contained in:
Tiago Gomes 2012-04-13 15:21:11 +01:00
parent 15c8f3abc6
commit f3be68a552
2 changed files with 14 additions and 0 deletions

View File

@ -37,6 +37,17 @@ unsigned Statistics::primaryNetCount_;
namespace Util {
template <> std::string
toString (const bool& b)
{
std::stringstream ss;
ss << std::boolalpha << b;
return ss.str();
}
void
toLog (Params& v)
{

View File

@ -36,6 +36,8 @@ template <typename K, typename V> bool contains (
template <typename T> std::string toString (const T&);
template <> std::string toString (const bool&);
void toLog (Params&);
void fromLog (Params&);
@ -312,6 +314,7 @@ void pow (Params&, double);
};
struct NetInfo
{
NetInfo (unsigned size, bool loopy, unsigned nIters, double time)