1. 24 Aug, 2018 2 commits
  2. 18 Jul, 2018 1 commit
    • Victor Poughon's avatar
      COMP: add missing string includes · fc923078
      Victor Poughon authored
      Before this commit, many files are using std::string without including
      <string>. It can work accidentally but causes issues when refactoring,
      especially if using operator <<() which is included implicitly by some
      compilers.
      
      To find guilty header files, I used:
      
          grep -l "^ *std::string" $(grep -L "#include <string>" $(find . -type f -name "*.h"))
      
      which finds all files containing "std::string" at the beginning of a line
      (usually a member or variable declaration), but not "#include <string>".
      And then this script to add the includes (plus some manual ediing):
      
          #!/usr/bin/env python3
      
          import re
          import argparse
      
          def fix_file(filename, header):
      
              with open(filename, "r") as f:
                  content = f.read()
      
              matches = list(re.finditer(r"(#include .*\n)\n", content))
              if len(matches) == 0:
                  print("no include!")
                  sys.exit(-1)
      
              pos = matches[-1].end(1)
              open(filename, "w").write(content[:pos] + "#include <{}>\n".format(header) + content[pos:])
      
          if __name__ == "__main__":
              parser = argparse.ArgumentParser()
              parser.add_argument('--header', type=str, required=True)
              parser.add_argument('files', type=str, nargs='+')
              args = parser.parse_args()
      
              for filename in args.files:
                  fix_file(filename, args.header)
      fc923078
  3. 13 Jul, 2018 1 commit
  4. 05 Jul, 2018 1 commit
  5. 25 Jun, 2018 1 commit
  6. 08 Jun, 2018 1 commit
  7. 07 Jun, 2018 1 commit
  8. 28 May, 2018 1 commit
  9. 12 Mar, 2018 1 commit
  10. 07 Mar, 2018 2 commits
  11. 13 Dec, 2017 1 commit
  12. 08 Dec, 2017 1 commit
  13. 05 Dec, 2017 2 commits
  14. 04 Dec, 2017 2 commits
  15. 28 Nov, 2017 1 commit
  16. 03 Oct, 2017 3 commits
  17. 08 Sep, 2017 1 commit
  18. 04 Aug, 2017 1 commit
  19. 27 Jul, 2017 1 commit
  20. 24 Jul, 2017 1 commit
  21. 20 Jul, 2017 1 commit
  22. 06 Jul, 2017 1 commit
  23. 05 Jul, 2017 1 commit
  24. 29 Jun, 2017 2 commits
  25. 27 Jun, 2017 2 commits
  26. 21 Jun, 2017 2 commits
  27. 19 Jun, 2017 1 commit
  28. 13 Jun, 2017 1 commit
  29. 06 Jun, 2017 1 commit
  30. 30 May, 2017 1 commit
  31. 29 May, 2017 1 commit