Skip to content
Extraits de code Groupes Projets
Valider 24747981 rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Delete copy assignment constructors

Add explicit keyword to constructors
Add Line access to Syl and Char
parent 48d59e9b
Branches
Aucune étiquette associée trouvée
1 requête de fusion!4Add basic lyrics/timing classes
......@@ -3,6 +3,7 @@
Char::Char(const Char& old) :
char_(old.char_),
dur(old.dur),
style(old.style)
style(old.style),
line(old.line)
{
}
......@@ -3,17 +3,22 @@
#include "Style.hpp"
class Line;
class Char {
private:
QChar char_;
unsigned int dur;
Style *style;
Line *line;
public:
// Copy constructor
Char(const Char&);
Char(const QChar);
explicit Char(const Char&);
explicit Char(const QChar);
Char& operator=(const Char&) = delete;
~Char() noexcept = default;
};
......
......@@ -19,9 +19,11 @@ private:
QVector<Syl> syls;
public:
Line();
Line(const Line&);
Line(QString);
explicit Line();
explicit Line(const Line&);
explicit Line(QString);
Line& operator=(const Line&) = delete;
~Line() noexcept = default;
};
......
......@@ -30,9 +30,11 @@ private:
public:
// Should grab and copy a user-changeable default style
Style();
Style(const Style&);
Style(const QString&);
explicit Style();
explicit Style(const Style&);
explicit Style(const QString&);
Style& operator=(const Style&) = delete;
~Style() noexcept = default;
};
......
......@@ -3,6 +3,7 @@
Syl::Syl(const Syl& old) :
chars(old.chars),
dur(old.dur),
style(old.style)
style(old.style),
line(old.line)
{
}
......@@ -4,16 +4,21 @@
#include "Char.hpp"
#include "Style.hpp"
class Line;
class Syl {
private:
QVector<Char> chars;
unsigned int dur;
Style *style;
Line *line;
public:
Syl(const Syl&);
Syl(const QString);
explicit Syl(const Syl&);
explicit Syl(const QString);
Syl& operator=(const Syl&) = delete;
~Syl() noexcept = default;
};
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter