Use iota rather than partial sum

This commit is contained in:
Thomas Goyne 2012-12-02 13:34:32 -08:00
parent de4ef14598
commit 17ffacb6a0

View file

@ -22,10 +22,6 @@
#include <numeric> #include <numeric>
#ifdef __VISUALC__
#pragma warning(disable:4996)
#endif
SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& message, wxString const& caption, wxArrayString const& choices) { SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& message, wxString const& caption, wxArrayString const& choices) {
Create(parent, message, caption, choices); Create(parent, message, caption, choices);
@ -44,9 +40,8 @@ SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& m
} }
void SelectedChoicesDialog::SelectAll(wxCommandEvent&) { void SelectedChoicesDialog::SelectAll(wxCommandEvent&) {
wxArrayInt sel(m_listbox->GetCount(), 1); wxArrayInt sel(m_listbox->GetCount());
sel[0] = 0; std::iota(sel.begin(), sel.end(), 0);
std::partial_sum(sel.begin(), sel.end(), sel.begin());
SetSelections(sel); SetSelections(sel);
} }