chore: use iwyu on strings/**.cpp

This commit is contained in:
realstealthninja
2024-09-13 15:39:46 +05:30
parent a290ae7ee2
commit f2127456a8
7 changed files with 39 additions and 34 deletions

View File

@@ -42,12 +42,13 @@
* @author [Stoycho Kyosev](https://github.com/stoychoX) * @author [Stoycho Kyosev](https://github.com/stoychoX)
*/ */
#include <cassert> /// for assert #include <cassert> // for assert
#include <climits> /// for CHAR_MAX macro #include <climits> // for CHAR_MAX
#include <cstring> /// for strlen #include <cstring> // for size_t, strlen
#include <iostream> /// for IO operations #include <iostream> // for operator<<, basic_ostream, cout
#include <string> /// for std::string #include <string> // for basic_string, string
#include <vector> /// for std::vector #include <vector> // for vector
#include <algorithm> // for max
#define APLHABET_SIZE CHAR_MAX ///< number of symbols in the alphabet we use #define APLHABET_SIZE CHAR_MAX ///< number of symbols in the alphabet we use

View File

@@ -2,13 +2,14 @@
* @file * @file
* @brief String pattern search - brute force * @brief String pattern search - brute force
*/ */
#include <iostream> #include <iostream> // for operator<<, basic_ostream, char_traits, cout
#include <string> // for basic_string, operator==, string, to_string
#ifdef _MSC_VER #ifdef _MSC_VER
#include <string> // use this for MS Visual C++ #include <string> // for basic_string, operator==, string, to_string
#else #else
#include <cstring> #include <cstring> // for size_t
#endif #endif
#include <vector> #include <vector> // for vector, allocator
namespace string_search { namespace string_search {
/** /**

View File

@@ -4,9 +4,10 @@
* @author [Harry Kontakis](https://github.com/ckontakis) * @author [Harry Kontakis](https://github.com/ckontakis)
*/ */
#include <iostream> #include <unordered_map> // for unordered_map, _Node_iterator_base, operator!=
#include <unordered_map> #include <cassert> // for assert
#include <cassert> #include <string> // for basic_string, string
#include <utility> // for pair, make_pair
/** /**
* @namespace strings * @namespace strings

View File

@@ -13,10 +13,11 @@
* @author [Yancey](https://github.com/Yancey2023) * @author [Yancey](https://github.com/Yancey2023)
*/ */
#include <cassert> /// for assert #include <cassert> // for assert
#include <iostream> /// for IO operations #include <cstddef> // for size_t
#include <string> /// for std::string #include <iostream> // for operator<<, basic_ostream, cout
#include <vector> /// for std::vector #include <string> // for basic_string, string
#include <vector> // for vector
/** /**
* @namespace string_search * @namespace string_search

View File

@@ -10,14 +10,15 @@
* @author [Riti Kumari](https://github.com/riti2409) * @author [Riti Kumari](https://github.com/riti2409)
*/ */
#include <cassert> /// for assert #include <cassert> // for assert
#include <cstdint> /// for integral typedefs #include <cstdint> // for uint64_t
#include <iostream> /// for IO operations #include <iostream> // for char_traits, basic_ostream, operator<<, cout, endl
#include <vector> /// for std::vector STL #include <vector> // for allocator, vector
#include <algorithm> // for min
#include <string> // for basic_string, operator==, operator+, string
#ifdef _MSC_VER #ifdef _MSC_VER
#include <string> /// for string (required for MS Visual C++) #include <string> // for basic_string, operator==, operator+, string
#else #else
#include <cstring> /// for string
#endif #endif
/** /**

View File

@@ -4,13 +4,13 @@
* Algorithm](https://en.wikipedia.org/wiki/RabinKarp_algorithm) for finding a * Algorithm](https://en.wikipedia.org/wiki/RabinKarp_algorithm) for finding a
* pattern within a piece of text with complexity O(n + m) * pattern within a piece of text with complexity O(n + m)
*/ */
#include <cassert> #include <stdint.h> // for int64_t
#include <cmath> #include <cassert> // for assert
#include <iostream> #include <cmath> // for pow
#include <string> // for basic_string, string
#ifdef _MSC_VER #ifdef _MSC_VER
#include <string> // use this for MS Visucal C++ #include <string> // for basic_string, string
#else #else
#include <cstring>
#endif #endif
#define PRIME 5 ///< Prime modulus for hash functions #define PRIME 5 ///< Prime modulus for hash functions

View File

@@ -11,15 +11,15 @@
* @author [Ritika Gupta](https://github.com/RitikaGupta8734) * @author [Ritika Gupta](https://github.com/RitikaGupta8734)
*/ */
#include <cstdint> /// for integral typedefs #include <cstdint> // for uint64_t
#include <iostream> /// for IO operations #include <algorithm> // for min
#include <string> // for basic_string, string, operator+, char_traits
#ifdef _MSC_VER #ifdef _MSC_VER
#include <string> /// for string (use this for MS Visual C++) #include <string> // for basic_string, string, operator+, char_traits
#else #else
#include <cstring> /// for string
#endif #endif
#include <cassert> /// for assert #include <cassert> // for assert
#include <vector> /// for std::vector #include <vector> // for vector, allocator, operator==
/** /**
* @brief Generate the Z-function for the inputted string. * @brief Generate the Z-function for the inputted string.