chore: use iwyu on others/**.cpp

This commit is contained in:
realstealthninja
2024-09-13 15:39:10 +05:30
parent eff2f44a50
commit 8a8fd42383
11 changed files with 42 additions and 36 deletions

View File

@@ -4,10 +4,8 @@
* to both Lower case and Upper case Roman Numeral
*/
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iostream> // for char_traits, basic_ostream, operator<<, basic_os...
#include <string> // for basic_string, operator+, allocator, string, oper...
/** This functions fills a string with character c, n times and returns it
* @note This can probably be replace by `memcpy` function.

View File

@@ -17,9 +17,8 @@
* @author [AlternateWalls](https://github.com/AlternateWalls)
*/
#include <cassert> /// for assert
#include <cstdint> /// for integral typedefs
#include <iostream> /// for IO operations
#include <cassert> // for assert
#include <cstdint> // for uint64_t
/*
* @brief Contains information for Easter date

View File

@@ -3,7 +3,8 @@
* @brief Read integers from stdin continuously as they are entered without
* waiting for the `\n` character
*/
#include <iostream>
#include <iostream> // for char_traits, basic_ostream, basic_ostream::opera...
#include <cstdio> // for getchar
/** Function to read the number from stdin. The function reads input until a non
* numeric character is entered.

View File

@@ -35,11 +35,12 @@
* set of steps until the Stack becomes empty or the current becomes NULL. And
* return the result array as the inorder traversal of a tree.
*/
#include <algorithm> /// for `reverse`
#include <cassert> /// for `assert`
#include <iostream> /// for I/O operations
#include <stack> /// for `stack`
#include <vector> /// for `vector`
#include <stdint.h> // for int64_t
#include <algorithm> // for reverse
#include <cassert> // for assert
#include <iostream> // for basic_ostream, operator<<, char_traits, cout, endl
#include <stack> // for stack
#include <vector> // for vector
/**
* @namespace others

View File

@@ -14,11 +14,13 @@
* @author [Abhijeet Tiwari](https://github.com/thisabhijeet)
*/
#include <array> /// for std::array
#include <cassert> /// for assert
#include <climits> /// for INT_MIN value
#include <cstdint> /// for integral typedefs
#include <iostream> /// for IO operations
#include <array> // for array
#include <cassert> // for assert
#include <climits> // for INT_MIN
#include <cstdint> // for int64_t, uint64_t
#include <iostream> // for operator<<, basic_ostream, cout
#include <cstddef> // for size_t
/**
* @brief Utility function to check the current maximum number
* \param arr input array

View File

@@ -17,9 +17,10 @@
* @author [David Leal](https://github.com/Panquesito7)
*/
#include <cassert> /// for assert
#include <cmath> /// for std::abs
#include <iostream> /// for IO operations
#include <bits/std_abs.h> // for abs
#include <cassert> // for assert
#include <iostream> // for operator<<, basic_ostream, cout
#include <stdexcept> // for invalid_argument
/**
* @namespace

View File

@@ -22,8 +22,9 @@ Steps for Matrix Expo
The first element of this matrix is the required result.
*/
#include <iostream>
#include <vector>
#include <stdint.h> // for int64_t
#include <iostream> // for basic_istream, char_traits, cin, basic_ostream
#include <vector> // for vector
using std::cin;
using std::cout;

View File

@@ -5,14 +5,14 @@
*
* This program cheats by using the STL library's std::reverse function.
*/
#include <algorithm>
#include <iostream>
#include <algorithm> // for reverse
#include <iostream> // for operator<<, basic_ostream, cout, basic_istream:...
#include <string> // for basic_string, allocator, operator==, string
#ifdef _MSC_VER
// Required to compile std::toString function using MSVC
#include <string>
#include <string> // for basic_string, allocator, operator==, string
#else
#include <cstring>
#endif
/** Main function */

View File

@@ -5,11 +5,11 @@
* @note Implementation is C-type and does not utilize the C++ constructs
* @todo implement as a C++ class
*/
#include <iostream>
#include <iostream> // for operator<<, basic_ostream, cout, basic_istream, cin
#include <string> // for basic_string, operator>>, string
#ifdef _MSC_VER
#include <string> // Visual Studio C requires this include
#include <string> // for basic_string, operator>>, string
#else
#include <cstring>
#endif
/** check number */

View File

@@ -10,11 +10,13 @@
* Evaluate the operator and push the result back to the stack
* When the expression is ended, the number in the stack is the final answer
*/
#include <ctype.h> // for isdigit
#include <algorithm> // for all_of
#include <array> // for std::array
#include <array> // for array
#include <cassert> // for assert
#include <iostream> // for io operations
#include <string> // for stof
#include <iostream> // for operator<<, basic_ostream, cout
#include <string> // for basic_string, char_traits, string, stof
#include <cstddef> // for size_t
/**
* @namespace others

View File

@@ -7,9 +7,10 @@
* @see [other
* implementation](https://www.nayuki.io/page/smallest-enclosing-circle)
*/
#include <cmath>
#include <iostream>
#include <vector>
#include <cmath> // for sqrt, INFINITY
#include <cstddef> // for size_t
#include <iostream> // for basic_ostream, char_traits, cout, endl, operator<<
#include <vector> // for vector
/** Define a point */
struct Point {