diff --git a/ArduCopter/AP_Rally.h b/ArduCopter/AP_Rally.h index dace66f48a..bfc9e77d6d 100644 --- a/ArduCopter/AP_Rally.h +++ b/ArduCopter/AP_Rally.h @@ -12,7 +12,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #pragma once #include @@ -20,12 +19,19 @@ class AP_Rally_Copter : public AP_Rally { - public: - // constructor - AP_Rally_Copter(AP_AHRS &ahrs) : AP_Rally(ahrs) {}; + static AP_Rally_Copter create(AP_AHRS &ahrs) { + return AP_Rally_Copter{ahrs}; + } + + constexpr AP_Rally_Copter(AP_Rally_Copter &&other) = default; + + /* Do not allow copies */ + AP_Rally_Copter(const AP_Rally_Copter &other) = delete; + AP_Rally_Copter &operator=(const AP_Rally_Copter&) = delete; private: - bool is_valid(const Location &rally_point) const override; + AP_Rally_Copter(AP_AHRS &ahrs) : AP_Rally(ahrs) { } + bool is_valid(const Location &rally_point) const override; };