Skip to content

Commit 1e011c2

Browse files
authored
Merge pull request #949 from cppalliance/const
Improve const correctness in library functions
2 parents 4a5b7c7 + 3c56044 commit 1e011c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+263
-237
lines changed

include/boost/decimal/bid_conversion.hpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,162 +22,162 @@ namespace decimal {
2222
# pragma GCC diagnostic ignored "-Wconversion"
2323
#endif
2424

25-
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d32(decimal32_t val) noexcept -> std::uint32_t
25+
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d32(const decimal32_t val) noexcept -> std::uint32_t
2626
{
2727
return val.bits_;
2828
}
2929

30-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d32(std::uint32_t bits) noexcept -> decimal32_t
30+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d32(const std::uint32_t bits) noexcept -> decimal32_t
3131
{
3232
return from_bits(bits);
3333
}
3434

35-
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d32f(decimal_fast32_t val) noexcept -> std::uint32_t
35+
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d32f(const decimal_fast32_t val) noexcept -> std::uint32_t
3636
{
3737
const decimal32_t compliant_val {val};
3838
return to_bid_d32(compliant_val);
3939
}
4040

41-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d32f(std::uint32_t bits) noexcept -> decimal_fast32_t
41+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d32f(const std::uint32_t bits) noexcept -> decimal_fast32_t
4242
{
4343
const auto compliant_val {from_bid_d32(bits)};
4444
const decimal_fast32_t val {compliant_val};
4545
return val;
4646
}
4747

48-
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d64(decimal64_t val) noexcept -> std::uint64_t
48+
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d64(const decimal64_t val) noexcept -> std::uint64_t
4949
{
5050
return val.bits_;
5151
}
5252

53-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d64(std::uint64_t bits) noexcept -> decimal64_t
53+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d64(const std::uint64_t bits) noexcept -> decimal64_t
5454
{
5555
return from_bits(bits);
5656
}
5757

58-
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d64f(decimal_fast64_t val) noexcept -> std::uint64_t
58+
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d64f(const decimal_fast64_t val) noexcept -> std::uint64_t
5959
{
6060
const decimal64_t compliant_val {val};
6161
return to_bid_d64(compliant_val);
6262
}
6363

64-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d64f(std::uint64_t bits) noexcept -> decimal_fast64_t
64+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d64f(const std::uint64_t bits) noexcept -> decimal_fast64_t
6565
{
6666
const auto compliant_val {from_bid_d64(bits)};
6767
const decimal_fast64_t val {compliant_val};
6868
return val;
6969
}
7070

71-
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d128(decimal128_t val) noexcept -> int128::uint128_t
71+
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d128(const decimal128_t val) noexcept -> int128::uint128_t
7272
{
7373
return val.bits_;
7474
}
7575

76-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128(int128::uint128_t bits) noexcept -> decimal128_t
76+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128(const int128::uint128_t bits) noexcept -> decimal128_t
7777
{
7878
return from_bits(bits);
7979
}
8080

8181
#ifdef BOOST_DECIMAL_HAS_INT128
82-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128(detail::builtin_uint128_t bits) noexcept -> decimal128_t
82+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128(const detail::builtin_uint128_t bits) noexcept -> decimal128_t
8383
{
8484
return from_bits(bits);
8585
}
8686
#endif
8787

88-
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d128f(decimal_fast128_t val) noexcept -> int128::uint128_t
88+
BOOST_DECIMAL_EXPORT constexpr auto to_bid_d128f(const decimal_fast128_t& val) noexcept -> int128::uint128_t
8989
{
9090
const decimal128_t compliant_val {val};
9191
return to_bid_d128(compliant_val);
9292
}
9393

94-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128f(int128::uint128_t bits) noexcept -> decimal_fast128_t
94+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128f(const int128::uint128_t bits) noexcept -> decimal_fast128_t
9595
{
9696
const auto compliant_val {from_bid_d128(bits)};
9797
const decimal_fast128_t val {compliant_val};
9898
return val;
9999
}
100100

101101
#ifdef BOOST_DECIMAL_HAS_INT128
102-
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128f(detail::builtin_uint128_t bits) noexcept -> decimal_fast128_t
102+
BOOST_DECIMAL_EXPORT constexpr auto from_bid_d128f(const detail::builtin_uint128_t bits) noexcept -> decimal_fast128_t
103103
{
104104
const auto compliant_val {from_bid_d128(bits)};
105105
const decimal_fast128_t val {compliant_val};
106106
return val;
107107
}
108108
#endif
109109

110-
BOOST_DECIMAL_EXPORT constexpr auto to_bid(decimal32_t val) noexcept -> std::uint32_t
110+
BOOST_DECIMAL_EXPORT constexpr auto to_bid(const decimal32_t val) noexcept -> std::uint32_t
111111
{
112112
return to_bid_d32(val);
113113
}
114114

115-
BOOST_DECIMAL_EXPORT constexpr auto to_bid(decimal_fast32_t val) noexcept -> std::uint32_t
115+
BOOST_DECIMAL_EXPORT constexpr auto to_bid(const decimal_fast32_t val) noexcept -> std::uint32_t
116116
{
117117
return to_bid_d32f(val);
118118
}
119119

120-
BOOST_DECIMAL_EXPORT constexpr auto to_bid(decimal64_t val) noexcept -> std::uint64_t
120+
BOOST_DECIMAL_EXPORT constexpr auto to_bid(const decimal64_t val) noexcept -> std::uint64_t
121121
{
122122
return to_bid_d64(val);
123123
}
124124

125-
BOOST_DECIMAL_EXPORT constexpr auto to_bid(decimal_fast64_t val) noexcept -> std::uint64_t
125+
BOOST_DECIMAL_EXPORT constexpr auto to_bid(const decimal_fast64_t val) noexcept -> std::uint64_t
126126
{
127127
return to_bid_d64f(val);
128128
}
129129

130-
BOOST_DECIMAL_EXPORT constexpr auto to_bid(decimal128_t val) noexcept -> int128::uint128_t
130+
BOOST_DECIMAL_EXPORT constexpr auto to_bid(const decimal128_t val) noexcept -> int128::uint128_t
131131
{
132132
return to_bid_d128(val);
133133
}
134134

135-
BOOST_DECIMAL_EXPORT constexpr auto to_bid(decimal_fast128_t val) noexcept -> int128::uint128_t
135+
BOOST_DECIMAL_EXPORT constexpr auto to_bid(const decimal_fast128_t& val) noexcept -> int128::uint128_t
136136
{
137137
return to_bid_d128f(val);
138138
}
139139

140140
BOOST_DECIMAL_EXPORT template <typename T>
141-
constexpr auto to_bid(T val) noexcept
141+
constexpr auto to_bid(const T val) noexcept
142142
{
143143
return to_bid(val);
144144
}
145145

146146
BOOST_DECIMAL_EXPORT template <typename T = decimal32_t>
147-
constexpr auto from_bid(std::uint32_t bits) noexcept
147+
constexpr auto from_bid(const std::uint32_t bits) noexcept
148148
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
149149
{
150150
return from_bid_d32(bits);
151151
}
152152

153153
BOOST_DECIMAL_EXPORT template <>
154-
constexpr auto from_bid<decimal_fast32_t>(std::uint32_t bits) noexcept -> decimal_fast32_t
154+
constexpr auto from_bid<decimal_fast32_t>(const std::uint32_t bits) noexcept -> decimal_fast32_t
155155
{
156156
return from_bid_d32f(bits);
157157
}
158158

159159
BOOST_DECIMAL_EXPORT template <typename T = decimal64_t>
160-
constexpr auto from_bid(std::uint64_t bits) noexcept
160+
constexpr auto from_bid(const std::uint64_t bits) noexcept
161161
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
162162
{
163163
return from_bid_d64(bits);
164164
}
165165

166166
BOOST_DECIMAL_EXPORT template <>
167-
constexpr auto from_bid<decimal_fast64_t>(std::uint64_t bits) noexcept -> decimal_fast64_t
167+
constexpr auto from_bid<decimal_fast64_t>(const std::uint64_t bits) noexcept -> decimal_fast64_t
168168
{
169169
return from_bid_d64f(bits);
170170
}
171171

172172
BOOST_DECIMAL_EXPORT template <typename T = decimal128_t>
173-
constexpr auto from_bid(int128::uint128_t bits) noexcept
173+
constexpr auto from_bid(const int128::uint128_t bits) noexcept
174174
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
175175
{
176176
return from_bid_d128(bits);
177177
}
178178

179179
BOOST_DECIMAL_EXPORT template <>
180-
constexpr auto from_bid<decimal_fast128_t>(int128::uint128_t bits) noexcept -> decimal_fast128_t
180+
constexpr auto from_bid<decimal_fast128_t>(const int128::uint128_t bits) noexcept -> decimal_fast128_t
181181
{
182182
return from_bid_d128f(bits);
183183
}

include/boost/decimal/charconv.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace decimal {
4747
namespace detail {
4848

4949
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
50-
constexpr auto from_chars_general_impl(const char* first, const char* last, TargetDecimalType& value, chars_format fmt) noexcept -> from_chars_result
50+
constexpr auto from_chars_general_impl(const char* first, const char* last, TargetDecimalType& value, const chars_format fmt) noexcept -> from_chars_result
5151
{
5252
using significand_type = std::conditional_t<(std::numeric_limits<typename TargetDecimalType::significand_type>::digits >
5353
std::numeric_limits<std::uint64_t>::digits),
@@ -101,15 +101,15 @@ constexpr auto from_chars_general_impl(const char* first, const char* last, Targ
101101
} //namespace detail
102102

103103
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
104-
BOOST_DECIMAL_EXPORT constexpr auto from_chars(const char* first, const char* last, TargetDecimalType& value, chars_format fmt = chars_format::general) noexcept -> from_chars_result
104+
BOOST_DECIMAL_EXPORT constexpr auto from_chars(const char* first, const char* last, TargetDecimalType& value, const chars_format fmt = chars_format::general) noexcept -> from_chars_result
105105
{
106106
return detail::from_chars_general_impl(first, last, value, fmt);
107107
}
108108

109109
#ifndef BOOST_DECIMAL_HAS_STD_STRING_VIEW
110110

111111
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
112-
BOOST_DECIMAL_EXPORT constexpr auto from_chars(const std::string& str, TargetDecimalType& value, chars_format fmt = chars_format::general) noexcept -> from_chars_result
112+
BOOST_DECIMAL_EXPORT constexpr auto from_chars(const std::string& str, TargetDecimalType& value, const chars_format fmt = chars_format::general) noexcept -> from_chars_result
113113
{
114114
return detail::from_chars_general_impl(str.data(), str.data() + str.size(), value, fmt);
115115
}
@@ -168,7 +168,7 @@ constexpr auto from_chars(std::string_view str, DecimalType& value, std::chars_f
168168
namespace detail {
169169

170170
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
171-
BOOST_DECIMAL_CONSTEXPR auto to_chars_nonfinite(char* first, char* last, const TargetDecimalType& value, int fp, chars_format fmt, int precision) noexcept -> to_chars_result
171+
BOOST_DECIMAL_CONSTEXPR auto to_chars_nonfinite(char* first, char* last, const TargetDecimalType& value, const int fp, const chars_format fmt, const int precision) noexcept -> to_chars_result
172172
{
173173
const auto buffer_len = last - first;
174174

@@ -273,7 +273,7 @@ BOOST_DECIMAL_CONSTEXPR auto to_chars_nonfinite(char* first, char* last, const T
273273
}
274274

275275
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
276-
BOOST_DECIMAL_CONSTEXPR auto to_chars_scientific_impl(char* first, char* last, const TargetDecimalType& value, chars_format fmt = chars_format::general, int precision = -1) noexcept -> to_chars_result
276+
BOOST_DECIMAL_CONSTEXPR auto to_chars_scientific_impl(char* first, char* last, const TargetDecimalType& value, const chars_format fmt = chars_format::general, const int precision = -1) noexcept -> to_chars_result
277277
{
278278
if (signbit(value))
279279
{
@@ -293,7 +293,7 @@ BOOST_DECIMAL_CONSTEXPR auto to_chars_scientific_impl(char* first, char* last, c
293293
std::numeric_limits<std::uint64_t>::digits),
294294
int128::uint128_t, std::uint64_t>;
295295

296-
// Since frexp10 normalizes the value we by default know the number of digits in the significand
296+
// Since frexp10 normalizes the value, we by default know the number of digits in the significand
297297
auto significand_digits = std::numeric_limits<TargetDecimalType>::digits;
298298
exp += significand_digits - 1;
299299
bool append_zeros = false;
@@ -408,7 +408,7 @@ BOOST_DECIMAL_CONSTEXPR auto to_chars_scientific_impl(char* first, char* last, c
408408
}
409409

410410
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
411-
BOOST_DECIMAL_CONSTEXPR auto to_chars_fixed_impl(char* first, char* last, const TargetDecimalType& value, chars_format fmt = chars_format::general, int precision = -1) noexcept -> to_chars_result
411+
BOOST_DECIMAL_CONSTEXPR auto to_chars_fixed_impl(char* first, char* last, const TargetDecimalType& value, const chars_format fmt = chars_format::general, const int precision = -1) noexcept -> to_chars_result
412412
{
413413
using target_decimal_significand_type = typename TargetDecimalType::significand_type;
414414

@@ -652,7 +652,7 @@ BOOST_DECIMAL_CONSTEXPR auto to_chars_fixed_impl(char* first, char* last, const
652652
}
653653

654654
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
655-
BOOST_DECIMAL_CONSTEXPR auto to_chars_hex_impl(char* first, char* last, const TargetDecimalType& value, int precision = -1) noexcept -> to_chars_result
655+
BOOST_DECIMAL_CONSTEXPR auto to_chars_hex_impl(char* first, char* last, const TargetDecimalType& value, const int precision = -1) noexcept -> to_chars_result
656656
{
657657
using Unsigned_Integer = std::conditional_t<(std::numeric_limits<typename TargetDecimalType::significand_type>::digits >
658658
std::numeric_limits<std::uint64_t>::digits),
@@ -784,7 +784,7 @@ BOOST_DECIMAL_CONSTEXPR auto to_chars_hex_impl(char* first, char* last, const Ta
784784
#endif
785785

786786
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
787-
BOOST_DECIMAL_CONSTEXPR auto to_chars_impl(char* first, char* last, TargetDecimalType value, chars_format fmt = chars_format::general, int precision = -1) noexcept -> to_chars_result
787+
BOOST_DECIMAL_CONSTEXPR auto to_chars_impl(char* first, char* last, const TargetDecimalType& value, const chars_format fmt = chars_format::general, const int precision = -1) noexcept -> to_chars_result
788788
{
789789
// Sanity check our bounds
790790
if (first >= last)
@@ -855,19 +855,19 @@ BOOST_DECIMAL_CONSTEXPR auto to_chars_impl(char* first, char* last, TargetDecima
855855
} //namespace detail
856856

857857
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
858-
BOOST_DECIMAL_EXPORT BOOST_DECIMAL_CONSTEXPR auto to_chars(char* first, char* last, TargetDecimalType value) noexcept -> to_chars_result
858+
BOOST_DECIMAL_EXPORT BOOST_DECIMAL_CONSTEXPR auto to_chars(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result
859859
{
860860
return detail::to_chars_impl(first, last, value);
861861
}
862862

863863
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
864-
BOOST_DECIMAL_EXPORT BOOST_DECIMAL_CONSTEXPR auto to_chars(char* first, char* last, TargetDecimalType value, chars_format fmt) noexcept -> to_chars_result
864+
BOOST_DECIMAL_EXPORT BOOST_DECIMAL_CONSTEXPR auto to_chars(char* first, char* last, const TargetDecimalType& value, chars_format fmt) noexcept -> to_chars_result
865865
{
866866
return detail::to_chars_impl(first, last, value, fmt);
867867
}
868868

869869
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
870-
BOOST_DECIMAL_EXPORT BOOST_DECIMAL_CONSTEXPR auto to_chars(char* first, char* last, TargetDecimalType value, chars_format fmt, int precision) noexcept -> to_chars_result
870+
BOOST_DECIMAL_EXPORT BOOST_DECIMAL_CONSTEXPR auto to_chars(char* first, char* last, const TargetDecimalType& value, chars_format fmt, int precision) noexcept -> to_chars_result
871871
{
872872
if (precision < 0)
873873
{

include/boost/decimal/cstdio.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct parameters
5353

5454
inline auto parse_format(const char* format) -> parameters
5555
{
56-
// If the format is unspecified or incorrect we will use this as the default values
56+
// If the format is unspecified or incorrect, we will use this as the default values
5757
parameters params {6, chars_format::general, decimal_type::decimal64_t, false};
5858

5959
auto iter {format + 1};
@@ -155,7 +155,7 @@ inline void make_uppercase(char* first, const char* last) noexcept
155155
}
156156

157157
template <typename... T>
158-
inline auto snprintf_impl(char* buffer, std::size_t buf_size, const char* format, T... values) noexcept
158+
inline auto snprintf_impl(char* buffer, const std::size_t buf_size, const char* format, const T... values) noexcept
159159
#ifndef BOOST_DECIMAL_HAS_CONCEPTS
160160
-> std::enable_if_t<detail::conjunction_v<detail::is_decimal_floating_point<T>...>, int>
161161
#else
@@ -244,7 +244,7 @@ inline auto snprintf_impl(char* buffer, std::size_t buf_size, const char* format
244244
} // namespace detail
245245

246246
template <typename... T>
247-
inline auto snprintf(char* buffer, std::size_t buf_size, const char* format, T... values) noexcept
247+
inline auto snprintf(char* buffer, const std::size_t buf_size, const char* format, const T... values) noexcept
248248
#ifndef BOOST_DECIMAL_HAS_CONCEPTS
249249
-> std::enable_if_t<detail::conjunction_v<detail::is_decimal_floating_point<T>...>, int>
250250
#else
@@ -255,7 +255,7 @@ inline auto snprintf(char* buffer, std::size_t buf_size, const char* format, T..
255255
}
256256

257257
template <typename... T>
258-
inline auto fprintf(std::FILE* buffer, const char* format, T... values) noexcept
258+
inline auto fprintf(std::FILE* buffer, const char* format, const T... values) noexcept
259259
#ifndef BOOST_DECIMAL_HAS_CONCEPTS
260260
-> std::enable_if_t<detail::conjunction_v<detail::is_decimal_floating_point<T>...>, int>
261261
#else
@@ -306,7 +306,7 @@ inline auto fprintf(std::FILE* buffer, const char* format, T... values) noexcept
306306
}
307307

308308
template <typename... T>
309-
inline auto printf(const char* format, T... values) noexcept
309+
inline auto printf(const char* format, const T... values) noexcept
310310
#ifndef BOOST_DECIMAL_HAS_CONCEPTS
311311
-> std::enable_if_t<detail::conjunction_v<detail::is_decimal_floating_point<T>...>, int>
312312
#else

include/boost/decimal/cstdlib.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace detail {
3535

3636
// 3.8.2
3737
template <typename TargetDecimalType>
38-
inline auto strtod_calculation(const char* str, char** endptr, char* buffer, std::size_t str_length) noexcept -> TargetDecimalType
38+
inline auto strtod_calculation(const char* str, char** endptr, char* buffer, const std::size_t str_length) noexcept -> TargetDecimalType
3939
{
4040
using significand_type = std::conditional_t<(std::numeric_limits<typename TargetDecimalType::significand_type>::digits >
4141
std::numeric_limits<std::uint64_t>::digits),
@@ -123,7 +123,7 @@ inline auto strtod_impl(const char* str, char** endptr) noexcept -> TargetDecima
123123

124124
// 3.9.2
125125
template <typename TargetDecimalType>
126-
inline auto wcstod_calculation(const wchar_t* str, wchar_t** endptr, char* buffer, std::size_t str_length) noexcept -> TargetDecimalType
126+
inline auto wcstod_calculation(const wchar_t* str, wchar_t** endptr, char* buffer, const std::size_t str_length) noexcept -> TargetDecimalType
127127
{
128128
// Convert all the characters from wchar_t to char and use regular strtod32
129129
for (std::size_t i {}; i < str_length; ++i)

include/boost/decimal/detail/cmath/abs.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace boost {
1919
namespace decimal {
2020

2121
BOOST_DECIMAL_EXPORT template <typename T>
22-
constexpr auto abs BOOST_DECIMAL_PREVENT_MACRO_SUBSTITUTION (T rhs) noexcept
22+
constexpr auto abs BOOST_DECIMAL_PREVENT_MACRO_SUBSTITUTION (const T rhs) noexcept
2323
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
2424
{
2525
return signbit(rhs) ? -rhs : rhs;

include/boost/decimal/detail/cmath/acos.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace decimal {
2727
namespace detail {
2828

2929
template <typename T>
30-
constexpr auto acos_impl(T x) noexcept
30+
constexpr auto acos_impl(const T x) noexcept
3131
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
3232
{
3333
#ifndef BOOST_DECIMAL_FAST_MATH
@@ -69,7 +69,7 @@ constexpr auto acos_impl(T x) noexcept
6969
} // namespace detail
7070

7171
BOOST_DECIMAL_EXPORT template <typename T>
72-
constexpr auto acos(T x) noexcept
72+
constexpr auto acos(const T x) noexcept
7373
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
7474
{
7575
#if BOOST_DECIMAL_DEC_EVAL_METHOD == 0

0 commit comments

Comments
 (0)