@@ -43,11 +43,11 @@ class sum {
4343
4444 // / Allow implicit conversion from sum<T>
4545 template <class T >
46- sum (const sum<T>& s) noexcept : sum(s.large (), s.small ()) {}
46+ sum (const sum<T>& s) noexcept : sum(s.large_part (), s.small_part ()) {}
4747
4848 // / Initialize sum explicitly with large and small parts
49- sum (const_reference large , const_reference small ) noexcept
50- : large_(large ), small_(small ) {}
49+ sum (const_reference large_part , const_reference small_part ) noexcept
50+ : large_(large_part ), small_(small_part ) {}
5151
5252 // / Increment sum by one
5353 sum& operator ++() noexcept { return operator +=(1 ); }
@@ -96,10 +96,10 @@ class sum {
9696 value_type value () const noexcept { return large_ + small_; }
9797
9898 // / Return large part of the sum.
99- const_reference large () const noexcept { return large_; }
99+ const_reference large_part () const noexcept { return large_; }
100100
101101 // / Return small part of the sum.
102- const_reference small () const noexcept { return small_; }
102+ const_reference small_part () const noexcept { return small_; }
103103
104104 // lossy conversion to value type must be explicit
105105 explicit operator value_type () const noexcept { return value (); }
@@ -156,6 +156,25 @@ class sum {
156156
157157 // end: extra operators
158158
159+ // windows.h illegially uses `#define small char` which breaks this now deprecated API
160+ #if !defined(small)
161+
162+ // / Return large part of the sum.
163+ [[deprecated(" use large_part() instead; "
164+ " large() will be removed in boost-1.80" )]] const_reference
165+ large () const noexcept {
166+ return large_;
167+ }
168+
169+ // / Return small part of the sum.
170+ [[deprecated(" use small_part() instead; "
171+ " small() will be removed in boost-1.80" )]] const_reference
172+ small () const noexcept {
173+ return small_;
174+ }
175+
176+ #endif
177+
159178private:
160179 value_type large_{};
161180 value_type small_{};
0 commit comments