Skip to content

Homework #4#4

Open
mashfeii wants to merge 14 commits intomasterfrom
hm-4
Open

Homework #4#4
mashfeii wants to merge 14 commits intomasterfrom
hm-4

Conversation

@mashfeii
Copy link
Owner

@mashfeii mashfeii commented Jul 3, 2024

No description provided.

Copy link
Collaborator

@tarasovxx tarasovxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом работа выполнена неплохо, есть маленькие замечания по исправлению, ознакомься!

#include <string>

// Custom exceptions
class StreamOutputException : public std::exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Классы исключений StreamOutputException, WrongStringFormat и InvalidArguments можно сделать наследниками от std::runtime_error, чтобы иметь возможность передавать сообщение об ошибке в конструктор базового класса. Тогда не потребуется отдельное поле msg_ и метод what().


// Recursion step
template <typename Cur, typename... Args>
std::string formatHelper(const std::string& string_format,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::string_view вместо const std::string& для параметра string_format

// Go through string char by char
for (size_t i = 0; i != string_format.length(); ++i) {
// WARN: Meet closing bracket before opening one
if (string_format[i] == '}') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::string::find вместо ручного поиска символов { и }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants