Skip to content

Commit

Permalink
[PARAMETER] Print bool value as 0/1 to make parsing easier (apache#314)
Browse files Browse the repository at this point in the history
* [PARAMETER] Print bool value as 0/1 to make parsing easier

* add defult value to type name
  • Loading branch information
tqchen authored Sep 25, 2017
1 parent b09d2b7 commit 04f9195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions include/dmlc/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -963,11 +963,7 @@ class FieldEntry<bool>
protected:
// print default string
virtual void PrintValue(std::ostream &os, bool value) const { // NOLINT(*)
if (value) {
os << "True";
} else {
os << "False";
}
os << static_cast<int>(value);
}
};

Expand Down
6 changes: 4 additions & 2 deletions include/dmlc/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct is_arithmetic {

/*!
* \brief helper class to construct a string that represents type name
*
*
* Specialized this class to defined type name of custom types
*
* \tparam T the type to query
Expand All @@ -87,7 +87,9 @@ struct type_name_helper {
/*!
* \return a string of typename.
*/
static inline std::string value();
static inline std::string value() {
return "";
}
};

/*!
Expand Down

0 comments on commit 04f9195

Please sign in to comment.