Skip to content

КМБО 03 21 Поляков А.А. новая ветвь#40

Open
LexichWhyNot wants to merge 6 commits intograyed:masterfrom
LexichWhyNot:КМБО-03-21_ПоляковАА_новая_ветвь

Hidden character warning

The head ref may contain hidden characters: "\u041a\u041c\u0411\u041e-03-21_\u041f\u043e\u043b\u044f\u043a\u043e\u0432\u0410\u0410_\u043d\u043e\u0432\u0430\u044f_\u0432\u0435\u0442\u0432\u044c"
Open

КМБО 03 21 Поляков А.А. новая ветвь#40
LexichWhyNot wants to merge 6 commits intograyed:masterfrom
LexichWhyNot:КМБО-03-21_ПоляковАА_новая_ветвь

Conversation

@LexichWhyNot
Copy link
Copy Markdown

No description provided.

@LexichWhyNot LexichWhyNot changed the title кмбо 03 21 поляковаа новая ветвь КМБО 03 21 Поляков А.А. новая ветвь Jun 6, 2022
Comment thread electricity/electricity.cpp Outdated
return false;
else {
pole->connectedObjectPole = "";
pole->connectedObject = nullptr;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Не отключаете другой объект от этого.

Comment thread electricity/electricity.cpp Outdated
Lamp lamp_test;
Switch switch_test;
generator_test.connect("A1", lamp_test, "A1");
lamp_test.connect("A2", switch_test, "A1");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Общее замечание, не касаемо программирования: выключатель ставится до нагрузки (говоря умными словами, коммутирует фазу/плюс, для переменного/постоянного тока, соответственно), чтобы отключать её от потенциала на линии.

Comment thread animals/animal.h
private:
bool CanMoveFreely;
public:
Animal() { CanMoveFreely = 0; }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Не выполнен пункт задания с использованием protected.

Comment thread animals/animal.h
virtual string about() const { return (stringstream() << "CanMoveFreely =" << CanMoveFreely).str(); }

};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Нет перегрузки операции вывода в поток для Animal.

Comment thread memhacks/memhacks.cpp Outdated
/// </summary>
/// <param name="b">Изучаемый объект</param>
void printInternals(const B& b) {
void printInternals(B& b) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Если потребовалось отказаться от const для метода, не подразумевающей изменение состояния объекта, то что-то явно сделано не так.

Comment thread memhacks/memhacks.cpp Outdated
}

float A::getData(int idx) const {
return ((float*)(this + 2))[idx];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Почему (this + 2)?

Comment thread memhacks/memhacks.h Outdated
#include <ostream>
#include <string>

using namespace std;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Использовать using namespace в заголовочных файлах нежелательно.

Comment thread memhacks/memhacks.h Outdated
public:
std::string getBString() const;
A();
virtual string getBString() const;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Идея как раз в том, чтобы продемонстрировать обход штатных (ограничений) средств языка для доступа к полям дочерних классов. В том числе и механизма виртуальных функций.

Comment thread vectors/vector.h Outdated
std::ostream& operator <<(std::ostream& os, const vector3d& v);
#include <iostream>
using namespace std;
int main() {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Почему main() в заголовочном файле?

Comment thread vectors/vector.cpp Outdated
{
if ((data[0] == 0) && (data[1] == 0) && (data[2] == 0))
{
return vector3d(data[0] = 1, data[1] = 1, data[2] = 1);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

В корне неверно здесь и парой строчек ниже.

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