Fixed compiler error (missing assignment operator for class).

This commit is contained in:
Kirill Kirilenko 2017-02-16 20:38:03 +03:00
parent 299dced3dc
commit fd4589fe52
2 changed files with 17 additions and 0 deletions

View file

@ -135,6 +135,9 @@ public:
const SwitchInlineQuery& getSwitchInlineQuery() const; const SwitchInlineQuery& getSwitchInlineQuery() const;
const SwitchInlineQueryCurrentChat& getSwitchInlineQueryCurrentChat() const; const SwitchInlineQueryCurrentChat& getSwitchInlineQueryCurrentChat() const;
void swap(InlineKeyboardButton&);
const InlineKeyboardButton& operator=(InlineKeyboardButton);
private: private:
ActionType actionType_; ActionType actionType_;
std::string text_; std::string text_;

View file

@ -228,6 +228,20 @@ const SwitchInlineQueryCurrentChat& InlineKeyboardButton::getSwitchInlineQueryCu
return boost::get<SwitchInlineQueryCurrentChat>(value_); return boost::get<SwitchInlineQueryCurrentChat>(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) void InlineKeyboardMarkup::addRow(const InlineKeyboardButtonRow& row)