Skip to content

Commit 0c6611a

Browse files
chore: use iwyu on hashing/**.cpp
1 parent dabd6d2 commit 0c6611a

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed

hashing/chaining.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
* @brief Implementation of [hash
66
* chains](https://en.wikipedia.org/wiki/Hash_chain).
77
*/
8-
#include <cmath>
9-
#include <iostream>
10-
#include <memory>
11-
#include <vector>
8+
#include <bits/std_abs.h> // for abs
9+
#include <stdlib.h> // for abs
10+
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
11+
#include <memory> // for shared_ptr, __shared_ptr_access
12+
#include <vector> // for vector
1213

1314
/**
1415
* @brief Chain class with a given modulus

hashing/double_hash_hash_table.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
* keys](https://en.wikipedia.org/wiki/Double_hashing).
77
* @note The implementation can be optimized by using OOP style.
88
*/
9-
#include <iostream>
10-
#include <memory>
11-
#include <vector>
9+
#include <cstddef> // for size_t
10+
#include <functional> // for hash
11+
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
12+
#include <vector> // for vector
1213

1314
/**
1415
* @addtogroup open_addressing Open Addressing

hashing/linear_probing_hash_table.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
* hash](https://en.wikipedia.org/wiki/Linear_probing) keys.
77
* @note The implementation can be optimized by using OOP style.
88
*/
9-
#include <iostream>
10-
#include <vector>
9+
#include <cstddef> // for size_t
10+
#include <functional> // for hash
11+
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
12+
#include <vector> // for vector
1113

1214
/**
1315
* @addtogroup open_addressing Open Addressing

hashing/quadratic_probing_hash_table.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
* hash](https://en.wikipedia.org/wiki/Quadratic_probing) keys.
77
* @note The implementation can be optimized by using OOP style.
88
*/
9-
#include <cmath>
10-
#include <iostream>
11-
#include <vector>
9+
#include <cmath> // for round, pow
10+
#include <cstddef> // for size_t
11+
#include <functional> // for hash
12+
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
13+
#include <vector> // for vector
1214

1315
/**
1416
* @addtogroup open_addressing Open Addressing

hashing/sha256.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
* used for authenticating software packages and secure password hashing.
1313
*/
1414

15-
#include <array> /// For std::array
16-
#include <cassert> /// For assert
17-
#include <cstdint> /// For uint8_t, uint32_t and uint64_t data types
18-
#include <iomanip> /// For std::setfill and std::setw
19-
#include <iostream> /// For IO operations
20-
#include <sstream> /// For std::stringstream
21-
#include <utility> /// For std::move
22-
#include <vector> /// For std::vector
15+
#include <array> // for array
16+
#include <cassert> // for assert
17+
#include <cstdint> // for uint32_t, uint8_t
18+
#include <iomanip> // for operator<<, setfill, setw, _Setfill, _Setw
19+
#include <iostream> // for char_traits, basic_ostream, operator<<, cout, hex
20+
#include <sstream> // for basic_stringstream
21+
#include <utility> // for move
22+
#include <vector> // for allocator, vector
23+
#include <cstddef> // for size_t
24+
#include <stdexcept> // for out_of_range
25+
#include <string> // for basic_string, string, operator==
2326

2427
/**
2528
* @namespace hashing

0 commit comments

Comments
 (0)