Skip to content

Commit 9caf861

Browse files
committed
Ensure R6 compliance
Chapter 8. Geometry Chapter 9. Text rendering and display
1 parent 599d587 commit 9caf861

File tree

2 files changed

+25
-45
lines changed

2 files changed

+25
-45
lines changed

N3888_RefImpl/src/xgeometry.h

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,44 @@ namespace std::experimental::io2d {
99
float _Width = 0.0F;
1010
float _Height = 0.0F;
1111
public:
12-
constexpr bounding_box() noexcept;
13-
constexpr bounding_box(float x, float y, float width, float height) noexcept;
14-
constexpr bounding_box(const point_2d& tl, const point_2d& br) noexcept;
12+
constexpr bounding_box() noexcept;
13+
constexpr bounding_box(float x, float y, float width, float height) noexcept;
14+
constexpr bounding_box(point_2d tl, point_2d br) noexcept;
1515

16-
constexpr void x(float value) noexcept;
17-
constexpr void y(float value) noexcept;
18-
constexpr void width(float value) noexcept;
19-
constexpr void height(float value) noexcept;
20-
constexpr void top_left(const point_2d& value) noexcept;
21-
constexpr void bottom_right(const point_2d& value) noexcept;
16+
constexpr void x(float val) noexcept;
17+
constexpr void y(float val) noexcept;
18+
constexpr void width(float val) noexcept;
19+
constexpr void height(float val) noexcept;
20+
constexpr void top_left(point_2d val) noexcept;
21+
constexpr void bottom_right(point_2d val) noexcept;
2222

2323
constexpr float x() const noexcept;
2424
constexpr float y() const noexcept;
2525
constexpr float width() const noexcept;
2626
constexpr float height() const noexcept;
27-
constexpr float left() const noexcept;
28-
constexpr float right() const noexcept;
29-
constexpr float top() const noexcept;
30-
constexpr float bottom() const noexcept;
3127
constexpr point_2d top_left() const noexcept;
3228
constexpr point_2d bottom_right() const noexcept;
3329

3430
friend constexpr bool operator==(const bounding_box& lhs, const bounding_box& rhs) noexcept;
3531
};
3632

37-
constexpr bool operator==(const bounding_box& lhs, const bounding_box& rhs) noexcept;
38-
constexpr bool operator!=(const bounding_box& lhs, const bounding_box& rhs) noexcept;
39-
40-
class circle {
33+
constexpr bool operator==(const bounding_box& lhs, const bounding_box& rhs) noexcept;
34+
constexpr bool operator!=(const bounding_box& lhs, const bounding_box& rhs) noexcept;
35+
36+
class circle {
4137
point_2d _Center;
4238
float _Radius;
4339
public:
44-
constexpr circle() noexcept;
45-
constexpr circle(const point_2d& ctr, float r) noexcept;
40+
constexpr circle() noexcept;
41+
constexpr circle(point_2d ctr, float rad) noexcept;
4642

47-
constexpr void center(const point_2d& ctr) noexcept;
48-
constexpr void radius(float r) noexcept;
43+
constexpr void center(point_2d ctr) noexcept;
44+
constexpr void radius(float r) noexcept;
4945

50-
constexpr point_2d center() const noexcept;
51-
constexpr float radius() const noexcept;
46+
constexpr point_2d center() const noexcept;
47+
constexpr float radius() const noexcept;
5248

53-
constexpr bool operator==(const circle& rhs) noexcept;
49+
constexpr bool operator==(const circle& rhs) noexcept;
5450
constexpr bool operator!=(const circle& rhs) noexcept;
5551
};
5652

N3888_RefImpl/src/xio2d_impl.h

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ namespace std::experimental::io2d {
534534
, _Width(width)
535535
, _Height(height) {
536536
}
537-
inline constexpr bounding_box::bounding_box(const point_2d& tl, const point_2d& br) noexcept
537+
inline constexpr bounding_box::bounding_box(point_2d tl, point_2d br) noexcept
538538
: _X(tl.x)
539539
, _Y(tl.y)
540540
, _Width(::std::max(0.0F, br.x - tl.x))
@@ -553,11 +553,11 @@ namespace std::experimental::io2d {
553553
inline constexpr void bounding_box::height(float value) noexcept {
554554
_Height = value;
555555
}
556-
inline constexpr void bounding_box::top_left(const point_2d& value) noexcept {
556+
inline constexpr void bounding_box::top_left(point_2d value) noexcept {
557557
_X = value.x;
558558
_Y = value.y;
559559
}
560-
inline constexpr void bounding_box::bottom_right(const point_2d& value) noexcept {
560+
inline constexpr void bounding_box::bottom_right(point_2d value) noexcept {
561561
_Width = max(0.0F, value.x - _X);
562562
_Height = max(0.0F, value.y - _Y);
563563
}
@@ -578,22 +578,6 @@ namespace std::experimental::io2d {
578578
return _Height;
579579
}
580580

581-
inline constexpr float bounding_box::left() const noexcept {
582-
return _X;
583-
}
584-
585-
inline constexpr float bounding_box::right() const noexcept {
586-
return _X + _Width;
587-
}
588-
589-
inline constexpr float bounding_box::top() const noexcept {
590-
return _Y;
591-
}
592-
593-
inline constexpr float bounding_box::bottom() const noexcept {
594-
return _Y + _Height;
595-
}
596-
597581
inline constexpr point_2d bounding_box::top_left() const noexcept {
598582
return{ _X, _Y };
599583
}
@@ -614,11 +598,11 @@ namespace std::experimental::io2d {
614598
inline constexpr circle::circle() noexcept
615599
: _Center()
616600
, _Radius() {}
617-
inline constexpr circle::circle(const point_2d& ctr, float r) noexcept
601+
inline constexpr circle::circle(point_2d ctr, float r) noexcept
618602
: _Center(ctr)
619603
, _Radius(r) {}
620604

621-
inline constexpr void circle::center(const point_2d& ctr) noexcept {
605+
inline constexpr void circle::center(point_2d ctr) noexcept {
622606
_Center = ctr;
623607
}
624608
inline constexpr void circle::radius(float r) noexcept {

0 commit comments

Comments
 (0)