Use iota rather than partial sum
This commit is contained in:
parent
de4ef14598
commit
17ffacb6a0
1 changed files with 2 additions and 7 deletions
|
@ -22,10 +22,6 @@
|
|||
|
||||
#include <numeric>
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& message, wxString const& caption, wxArrayString const& choices) {
|
||||
Create(parent, message, caption, choices);
|
||||
|
||||
|
@ -44,9 +40,8 @@ SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& m
|
|||
}
|
||||
|
||||
void SelectedChoicesDialog::SelectAll(wxCommandEvent&) {
|
||||
wxArrayInt sel(m_listbox->GetCount(), 1);
|
||||
sel[0] = 0;
|
||||
std::partial_sum(sel.begin(), sel.end(), sel.begin());
|
||||
wxArrayInt sel(m_listbox->GetCount());
|
||||
std::iota(sel.begin(), sel.end(), 0);
|
||||
SetSelections(sel);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue