Use ctor-initializer rather than assignment for non-POD class members
This commit is contained in:
@@ -20,27 +20,26 @@ class LifePattern
|
||||
{
|
||||
public:
|
||||
// This ctor is used by the LifeReader class
|
||||
LifePattern(wxString name,
|
||||
wxString description,
|
||||
wxString rules,
|
||||
wxArrayString shape)
|
||||
LifePattern(const wxString& name,
|
||||
const wxString& description,
|
||||
const wxString& rules,
|
||||
const wxArrayString& shape)
|
||||
: m_name(name)
|
||||
, m_description(description)
|
||||
, m_rules(rules)
|
||||
, m_shape(shape)
|
||||
{
|
||||
m_name = name;
|
||||
m_description = description;
|
||||
m_rules = rules;
|
||||
m_shape = shape;
|
||||
}
|
||||
|
||||
// A more convenient ctor for the built-in samples
|
||||
LifePattern(wxString name,
|
||||
wxString description,
|
||||
LifePattern(const wxString& name,
|
||||
const wxString& description,
|
||||
int width,
|
||||
int height,
|
||||
const char *shape)
|
||||
: m_name(name)
|
||||
, m_description(description)
|
||||
{
|
||||
m_name = name;
|
||||
m_description = description;
|
||||
m_rules = wxEmptyString;
|
||||
// TODO: add the positions later, since the formatting command
|
||||
// causes a crash due to conversion objects not being available
|
||||
// during initialisation.
|
||||
|
Reference in New Issue
Block a user