From fd4589fe52aa7650740014935874384abd11f0ae Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Thu, 16 Feb 2017 20:38:03 +0300 Subject: [PATCH] Fixed compiler error (missing assignment operator for class). --- include/telebotxx/RequestOptions.hpp | 3 +++ src/RequestOptions.cpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/telebotxx/RequestOptions.hpp b/include/telebotxx/RequestOptions.hpp index fd2e3d4..412a83e 100644 --- a/include/telebotxx/RequestOptions.hpp +++ b/include/telebotxx/RequestOptions.hpp @@ -135,6 +135,9 @@ public: const SwitchInlineQuery& getSwitchInlineQuery() const; const SwitchInlineQueryCurrentChat& getSwitchInlineQueryCurrentChat() const; + void swap(InlineKeyboardButton&); + const InlineKeyboardButton& operator=(InlineKeyboardButton); + private: ActionType actionType_; std::string text_; diff --git a/src/RequestOptions.cpp b/src/RequestOptions.cpp index adc78f2..d4c2c8a 100644 --- a/src/RequestOptions.cpp +++ b/src/RequestOptions.cpp @@ -228,6 +228,20 @@ const SwitchInlineQueryCurrentChat& InlineKeyboardButton::getSwitchInlineQueryCu return boost::get(value_); } +void InlineKeyboardButton::swap(InlineKeyboardButton& other) +{ + using std::swap; + swap(text_, other.text_); + swap(actionType_, other.actionType_); + swap(value_, other.value_); +} + +const InlineKeyboardButton& InlineKeyboardButton::operator=(InlineKeyboardButton other) +{ + swap(other); + return *this; +} + //////////////////////////////////////////////////////////////// void InlineKeyboardMarkup::addRow(const InlineKeyboardButtonRow& row)