Next: , Previous: change Derivation, Up: The change Class



3.6.2 Constructors

— Constructor: change::change (void);

This constructs an empty change.

— Constructor: explicit change::change (int n);

This constructs an empty change for n bells, which will initially contain no swaps, that is, all bells will remain in the same place.

— Constructor: change::change (const change& c);

This is the copy constructor; it makes a new copy of c.

— Constructor: change::change (int n, char* pn);
— Constructor: change::change (int n, const string& pn);

This constructs a change on n bells, with place notation as given in pn. This should consist of a sequence of characters which signify the places to be made, arranged in ascending order. If no places are to be made, the string "X" should be used. Note that you can miss out external places, unless no internal places are made at all. If the place notation is not valid, this constructor will throw an exception of class change::invalid.