powertab / powertabeditor

View and edit guitar tablature.
https://powertab.github.io
GNU General Public License v3.0
519 stars 68 forks source link

Add functional header to include std::greater #387

Closed psyomn closed 2 years ago

psyomn commented 2 years ago

Description of Change(s)

This would make the compiler unhappy when trying to build with the following message:

  [412/525] Building CXX object source/app/CMakeFiles/pteapp.dir/viewoptions.cpp.o
  FAILED: source/app/CMakeFiles/pteapp.dir/viewoptions.cpp.o
  powertabeditor/source/app/viewoptions.cpp: In member function ‘bool ViewOptions::decreaseZoom()’:
  powertabeditor/source/app/viewoptions.cpp:40:100: error: ‘greater’ is not a member of ‘std’
     40 |     int prevZoom = *std::upper_bound(ZOOM_LEVELS.rbegin(), ZOOM_LEVELS.rend() - 1, getZoom(), std::greater<int>());
        |                                                                                                    ^~~~~~~
  powertabeditor/source/app/viewoptions.cpp:40:108: error: expected primary-expression before ‘int’
     40 |     int prevZoom = *std::upper_bound(ZOOM_LEVELS.rbegin(), ZOOM_LEVELS.rend() - 1, getZoom(), std::greater<int>());
        |

Fixes Issue(s)

psyomn commented 2 years ago

Discovered this when I was preparing the AUR pkgbuild; if we can do without it I can just apply this as a patch in said pkgbuild.

cameronwhite commented 2 years ago

Thanks! Probably just a change in the headers for the latest gcc version