Open
Conversation
artem-lukanin
suggested changes
Apr 9, 2023
artem-lukanin
left a comment
There was a problem hiding this comment.
Сергей, добрый день!
В целом очень хорошо. Оставил комментарии.
| #include <iostream> | ||
| #include <cmath> | ||
|
|
||
| // |
There was a problem hiding this comment.
Использование конструкций switch/case для данного случая (проверок true/false) загромождает код и затрудняет его понимание. Лучше использовать обычный if/else.
| #include <string> | ||
| #include <stdlib.h> | ||
|
|
||
| // |
There was a problem hiding this comment.
- Можно вынести в приватную секцию поля
numberиemailклассовSmsNotifierиEmailNotifierсоответственно. - Метод
Notify()классов является константным, поэтому можно передавать параметрnotifierв функциюNotify()по константной ссылке.
| #include <vector> | ||
| #include <map> | ||
|
|
||
| // |
There was a problem hiding this comment.
int array[3];
cin >> array[1] >> array[2] >> array[3];
Итерация в массиве с нуля.
Может возникнуть:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
| #include <vector> | ||
| #include <algorithm> | ||
|
|
||
| // |
There was a problem hiding this comment.
- Инициализация пустой строки производится конструктором по умолчанию класса
string, поэтому можно так не писать:string input = ""; - Для вывода вектора могли использовать свою перегрузку оператора
<<) - В функцию
split_string()можно передавать строку по константной ссылке, но тогда нужно использовать константный тип итераторов (string::const_iterator) или просто использовать ключевое словоauto. - Лучше вместо метода
string::copy()воспользоваться алгоритмомcopy()или сразу конструктором строки, принимающим два итератора. Тогда не нужно будет заводить массив char'ов.
| #include <iostream> | ||
| #include <mylib.h> | ||
|
|
||
| // |
There was a problem hiding this comment.
- Папку
buildне добавляем в репозиторий, лучше сразу ее имя добавить в файл.gitignore, тогда она не будет отображаться в спискеuntrackedфайлов. - Проблема, про которую Вы мне писали, что не получается собрать проект после
git cloneрепозитория, заключается в том, что у Вас используется сабмодуль. Чтобы его подтянуть, нужно: или использовать специальный флаг приclon'е (git clone --recursive), или после клона выполнить командуgit submodule update --init.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.