Skip to content

Commit 61e8156

Browse files
authored
Clean up <include>s (#19)
* fixup includes There are some unnecessary headers in `finders_interface.h` that emit warnings. This commit aims to: - remove unnecessary headers, - move necessary headers to where they're needed, and include them transitively, and - "decorate" technically unused, yet necessary-for-usage headers with `// IWYU pragma: export`. * remove newline * compile fix
1 parent 4fe33b2 commit 61e8156

6 files changed

Lines changed: 6 additions & 15 deletions

File tree

example/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <iostream>
2-
#include <list>
2+
#include <utility>
33
#include <rectpack2D/finders_interface.h>
44

55
/* For description of the algorithm, please see the README.md */

src/rectpack2D/best_bin_finder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include <variant>
33
#include <cassert>
4-
#include <algorithm>
4+
#include <optional>
55
#include "rect_structs.h"
66

77
namespace rectpack2D {

src/rectpack2D/empty_space_allocators.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#pragma once
22
#include <array>
33
#include <vector>
4-
#include <type_traits>
5-
64
#include "rect_structs.h"
75

86
namespace rectpack2D {

src/rectpack2D/empty_spaces.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
#include <optional>
23
#include "insert_and_split.h"
34

45
namespace rectpack2D {

src/rectpack2D/finders_interface.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
#pragma once
2-
#include <optional>
3-
#include <vector>
4-
#include <array>
5-
#include <variant>
62
#include <memory>
7-
#include <algorithm>
8-
9-
#include "insert_and_split.h"
103
#include "empty_spaces.h"
11-
#include "empty_space_allocators.h"
12-
134
#include "best_bin_finder.h"
5+
#include "empty_space_allocators.h" // IWYU pragma: export
146

157
namespace rectpack2D {
168
template <class empty_spaces_type>

src/rectpack2D/rect_structs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <utility>
2+
#include <algorithm>
33

44
namespace rectpack2D {
55
using total_area_type = int;
@@ -87,4 +87,4 @@ namespace rectpack2D {
8787
};
8888

8989
using space_rect = rect_xywh;
90-
}
90+
}

0 commit comments

Comments
 (0)