From 2be3c1efea2f7ca1272a151d5c4ff0da3e470b07 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 10 Jun 2020 15:19:48 +0200 Subject: [PATCH 1/4] Fix compiler warning about uninitialised member. --- suffix_array.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suffix_array.hpp b/suffix_array.hpp index 8d190b4..ad99ec5 100644 --- a/suffix_array.hpp +++ b/suffix_array.hpp @@ -42,7 +42,7 @@ class suffix_array { explicit suffix_array(std::vector&& str) : str_(std::move(str)), idx_(size()) { - auto generator = [i = Size{}]() mutable { return suffix{i++}; }; + auto generator = [i = Size{}]() mutable { return suffix{i++,{}}; }; auto pos = [](auto& suf) { return suf.pos; }; auto val = [&](auto& suf) { return str_[suf.pos]; }; auto by_rank = [](auto& l, auto& r) { return l.rank < r.rank; }; From 25cc832cffbf849ce97ba9d037d56f68056d9a2b Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 28 May 2020 15:41:14 +0200 Subject: [PATCH 2/4] Relax constraints on include directory naming. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this change, the .hpp files can find the includes in the detail/ directory without necessarily being in a directory called “step”. --- detail/hirschberg.hpp | 2 +- edit_distance.hpp | 2 +- longest_common_subsequence.hpp | 2 +- longest_common_substring.hpp | 4 ++-- longest_repeated_substring.hpp | 4 ++-- suffix_array.hpp | 2 +- suffix_tree.hpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/detail/hirschberg.hpp b/detail/hirschberg.hpp index f03d05e..6f90871 100644 --- a/detail/hirschberg.hpp +++ b/detail/hirschberg.hpp @@ -3,7 +3,7 @@ #ifndef STEP_HIRSCHBERG_HPP #define STEP_HIRSCHBERG_HPP -#include +#include "utility.hpp" namespace step::hirschberg { diff --git a/edit_distance.hpp b/edit_distance.hpp index f58c4ad..c483008 100644 --- a/edit_distance.hpp +++ b/edit_distance.hpp @@ -4,7 +4,7 @@ #define STEP_EDIT_DISTANCE_HPP #include -#include +#include "detail/hirschberg.hpp" namespace step::edit_distance { namespace detail { diff --git a/longest_common_subsequence.hpp b/longest_common_subsequence.hpp index ec7cc75..6f50081 100644 --- a/longest_common_subsequence.hpp +++ b/longest_common_subsequence.hpp @@ -3,7 +3,7 @@ #ifndef STEP_LONGEST_COMMON_SUBSEQUENCE_HPP #define STEP_LONGEST_COMMON_SUBSEQUENCE_HPP -#include +#include "detail/hirschberg.hpp" namespace step::longest_common_subsequence { namespace detail { diff --git a/longest_common_substring.hpp b/longest_common_substring.hpp index 2e92733..66ec445 100644 --- a/longest_common_substring.hpp +++ b/longest_common_substring.hpp @@ -3,8 +3,8 @@ #ifndef STEP_LONGEST_COMMON_SUBSTRING_HPP #define STEP_LONGEST_COMMON_SUBSTRING_HPP -#include -#include +#include "suffix_array.hpp" +#include "suffix_tree.hpp" namespace step::longest_common_substring { namespace detail { diff --git a/longest_repeated_substring.hpp b/longest_repeated_substring.hpp index 7c65f87..276fe8c 100644 --- a/longest_repeated_substring.hpp +++ b/longest_repeated_substring.hpp @@ -3,8 +3,8 @@ #ifndef STEP_LONGEST_REPEATED_SUBSTRING_HPP #define STEP_LONGEST_REPEATED_SUBSTRING_HPP -#include -#include +#include "suffix_array.hpp" +#include "suffix_tree.hpp" namespace step::longest_repeated_substring { namespace detail { diff --git a/suffix_array.hpp b/suffix_array.hpp index ad99ec5..e65928e 100644 --- a/suffix_array.hpp +++ b/suffix_array.hpp @@ -3,7 +3,7 @@ #ifndef STEP_SUFFIX_ARRAY_HPP #define STEP_SUFFIX_ARRAY_HPP -#include +#include "detail/utility.hpp" namespace step { diff --git a/suffix_tree.hpp b/suffix_tree.hpp index 3bfc0c4..3253cfd 100644 --- a/suffix_tree.hpp +++ b/suffix_tree.hpp @@ -5,7 +5,7 @@ #include #include -#include +#include "detail/utility.hpp" #include namespace step { From b9a8836d230c5c96704c60803e2b41d9ad403de4 Mon Sep 17 00:00:00 2001 From: Andrey Naplavkov Date: Sat, 14 Nov 2020 15:56:50 +0300 Subject: [PATCH 3/4] clean up --- .appveyor.yml | 4 ++-- .travis.yml | 14 +++++++------- detail/utility.hpp | 2 +- edit_distance.hpp | 2 +- suffix_array.hpp | 6 +++--- suffix_tree.hpp | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 432ab5a..69c0c5d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,6 @@ image: - Visual Studio 2019 - - Ubuntu1804 + - Ubuntu2004 platform: x64 @@ -9,7 +9,7 @@ configuration: Release clone_depth: 1 install: - - ps: Invoke-WebRequest -Uri https://github.com/catchorg/Catch2/releases/download/v2.9.2/catch.hpp -OutFile $env:APPVEYOR_BUILD_FOLDER\..\catch.hpp + - ps: Invoke-WebRequest -Uri https://github.com/catchorg/Catch2/releases/download/v2.13.3/catch.hpp -OutFile $env:APPVEYOR_BUILD_FOLDER\..\catch.hpp - cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" build_script: diff --git a/.travis.yml b/.travis.yml index eec90cb..75b86cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,27 @@ language: cpp sudo: true os: linux -dist: bionic +dist: focal git: depth: 1 matrix: include: - - env: COMPILER=g++-8 + - env: COMPILER=g++10 addons: apt: packages: - - g++-8 + - g++10 - doxygen - - env: COMPILER=clang++-7 + - env: COMPILER=clang++-11 addons: apt: sources: - - llvm-toolchain-bionic-7 + - llvm-toolchain-focal-11 packages: - - clang-7 + - clang-11 - doxygen script: -- wget -P $TRAVIS_BUILD_DIR/.. https://github.com/catchorg/Catch2/releases/download/v2.9.2/catch.hpp +- wget -P $TRAVIS_BUILD_DIR/.. https://github.com/catchorg/Catch2/releases/download/v2.13.3/catch.hpp - cd $TRAVIS_BUILD_DIR/test - make -f ./makefile.ubuntu test CXX=$COMPILER - make -f ./makefile.ubuntu clean diff --git a/detail/utility.hpp b/detail/utility.hpp index dbe7d1c..299bf39 100644 --- a/detail/utility.hpp +++ b/detail/utility.hpp @@ -21,7 +21,7 @@ struct overloaded : Ts... { }; template -overloaded(Ts...)->overloaded; +overloaded(Ts...) -> overloaded; /// @see https://en.cppreference.com/w/cpp/iterator/iter_t template diff --git a/edit_distance.hpp b/edit_distance.hpp index c483008..e691513 100644 --- a/edit_distance.hpp +++ b/edit_distance.hpp @@ -3,8 +3,8 @@ #ifndef STEP_EDIT_DISTANCE_HPP #define STEP_EDIT_DISTANCE_HPP -#include #include "detail/hirschberg.hpp" +#include namespace step::edit_distance { namespace detail { diff --git a/suffix_array.hpp b/suffix_array.hpp index e65928e..10cddc9 100644 --- a/suffix_array.hpp +++ b/suffix_array.hpp @@ -42,7 +42,7 @@ class suffix_array { explicit suffix_array(std::vector&& str) : str_(std::move(str)), idx_(size()) { - auto generator = [i = Size{}]() mutable { return suffix{i++,{}}; }; + auto generator = [i = Size{}]() mutable { return suffix{i++, {}}; }; auto pos = [](auto& suf) { return suf.pos; }; auto val = [&](auto& suf) { return str_[suf.pos]; }; auto by_rank = [](auto& l, auto& r) { return l.rank < r.rank; }; @@ -171,10 +171,10 @@ class suffix_array { }; template -suffix_array(InputIt, InputIt)->suffix_array>; +suffix_array(InputIt, InputIt) -> suffix_array>; template -suffix_array(InputRng)->suffix_array>; +suffix_array(InputRng) -> suffix_array>; } // namespace step diff --git a/suffix_tree.hpp b/suffix_tree.hpp index 3253cfd..3145769 100644 --- a/suffix_tree.hpp +++ b/suffix_tree.hpp @@ -3,9 +3,9 @@ #ifndef STEP_SUFFIX_TREE_HPP #define STEP_SUFFIX_TREE_HPP +#include "detail/utility.hpp" #include #include -#include "detail/utility.hpp" #include namespace step { From cd95c7ce1c44c7c08d53e31e742737ba5b93145b Mon Sep 17 00:00:00 2001 From: Andrey Naplavkov Date: Sat, 14 Nov 2020 16:24:22 +0300 Subject: [PATCH 4/4] clean up --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75b86cd..917608d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,17 +6,18 @@ git: depth: 1 matrix: include: - - env: COMPILER=g++10 + - env: COMPILER=g++ addons: apt: packages: - - g++10 + - g++ - doxygen - env: COMPILER=clang++-11 addons: apt: sources: - - llvm-toolchain-focal-11 + - sourceline: "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" + key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" packages: - clang-11 - doxygen