セッターがたくさんいます。それぞれの異なるセッター引数の名前を綴らずに、各セッターの最初の引数を取得する一般的な方法はありますか?例えば:
void
Class::setSelectedEntryIndex(int newSelectedEntryIndex) {
m_log(ExEr) << "first arg: " << newSelectedEntryIndex << std::endl;
m_selectedEntryIndex = newSelectedEntryIndex;
emit selectedEntryIndexChanged();
}
replaced with:
void
Class::setSelectedEntryIndex(int newSelectedEntryIndex) {
m_log(ExEr) << "first arg: " << this->firstArg << std::endl; // Change here
m_selectedEntryIndex = newSelectedEntryIndex;
emit selectedEntryIndexChanged();
}
?