C-Plus-Plus icon indicating copy to clipboard operation
C-Plus-Plus copied to clipboard

feat: update to CXX standard 17 and add CMakeLists file to directories without them

Open realstealthninja opened this issue 1 year ago • 1 comments

Description of Change

CMakeLists.txt changes

Some directories lack CMakeLists Thus giving any algorithms under those directories

  • dynamic_programming
  • greedy_algorithms
  • range_queries
  • operations_on_datastructures

cmake specific changes

  • Incremented CXX standard (see reasoning below)
  • Removed old commented cmake statements
  • Added warnings
  • Made msvc be permissive

So this pr focuses on the the inclusion of the CMakeLists file and fixing compilation problems associated with the inclusion of the directories

File renames

some files had to be renamed due to file name conflicts with pre-existing files. I would love feedback on the names. These algorithms are duplicates with alot of history associated with them removing them seemed like not my decision to make.

Code changes

Some older code was updated very slightly just enough to make them compile as the scope of this pr is not part of #2456

The updated code include;

  • Variable length arrays are fixed by using either vectors or dynamic arrays
  • linting done on files edited

Standard updated

This is the part of the pr where I explain my thought process behind this update in such a minor pr.

here are some of my arguments:

  • Some algorithms in the repository use newer features from newer standards
  • The Readme mentions compatibility with esp32 & arm cortex however they already use newer standards
  • C++11 is 13 years old
  • People learn using C++17 it only makes sense for us to provide algorithms showcasing newer features

Checklist

  • [x] Added description of change
  • [x] Added file name matches File name guidelines
  • [x] Added tests and example, test must pass
  • [x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • [x] Relevant documentation/comments is changed or added
  • [x] PR title follows semantic commit guidelines
  • [x] Search previous suggestions before making a new one, as yours may be a duplicate.
  • [x] I acknowledge that all my contributions will be made under the project's license.

Notes:

realstealthninja avatar Oct 01 '24 16:10 realstealthninja