Skip to content

Commit

Permalink
Better use of std::format
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Sep 27, 2023
1 parent 8d281d7 commit 470bd13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ budget::data_writer& budget::data_writer::operator<<(const bool& value){
parts.emplace_back(buffer.begin(), p);
return *this;
}
throw budget::budget_exception("\"" + std::to_string(temp) + "\" cant' be converted to string");
throw budget::budget_exception(std::format("\"{}\" can't be converted to string", temp));
}

budget::data_writer& budget::data_writer::operator<<(const size_t& value){
Expand All @@ -179,7 +179,7 @@ budget::data_writer& budget::data_writer::operator<<(const size_t& value){
parts.emplace_back(buffer.begin(), p);
return *this;
}
throw budget::budget_exception("\"" + std::to_string(value) + "\" cant' be converted to string");
throw budget::budget_exception(std::format("\"{}\" can't be converted to string", value));
}

budget::data_writer& budget::data_writer::operator<<(const int64_t& value){
Expand All @@ -189,7 +189,7 @@ budget::data_writer& budget::data_writer::operator<<(const int64_t& value){
parts.emplace_back(buffer.begin(), p);
return *this;
}
throw budget::budget_exception("\"" + std::to_string(value) + "\" cant' be converted to string");
throw budget::budget_exception(std::format("\"{}\" can't be converted to string", value));
}

budget::data_writer& budget::data_writer::operator<<(const int32_t& value){
Expand All @@ -199,7 +199,7 @@ budget::data_writer& budget::data_writer::operator<<(const int32_t& value){
parts.emplace_back(buffer.begin(), p);
return *this;
}
throw budget::budget_exception("\"" + std::to_string(value) + "\" cant' be converted to string");
throw budget::budget_exception(std::format("\"{}\" can't be converted to string", value));
}

budget::data_writer& budget::data_writer::operator<<(const std::string& value){
Expand Down

0 comments on commit 470bd13

Please sign in to comment.