Add ArgInserter::str().
This commit is contained in:
@@ -789,6 +789,17 @@ TEST(TempFormatterTest, Example) {
|
||||
ReportError("File not found: {0}") << path;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string str(const T &value) {
|
||||
return (fmt::Format("{0}") << value).str();
|
||||
}
|
||||
|
||||
TEST(StrTest, Convert) {
|
||||
EXPECT_EQ("42", str(42));
|
||||
std::string s = str(Date(2012, 12, 9));
|
||||
EXPECT_EQ("2012-12-9", s);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef _WIN32
|
||||
// Disable message boxes on assertion failures.
|
||||
|
||||
Reference in New Issue
Block a user