Skip to content

Commit 3bb88a9

Browse files
refactor: Simplify conditions in numeric cast functions for clarity
1 parent b27c7e4 commit 3bb88a9

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/conversion/underlying.cppm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ constexpr auto numeric_risk(SrcRep value)
297297
template <details::numeric_cast_operand DestRep,
298298
details::numeric_cast_operand SrcRep>
299299
requires details::statically_castable<DestRep, SrcRep> &&
300-
!(underlying_type<std::remove_cvref_t<DestRep>> &&
301-
underlying_type<std::remove_cvref_t<SrcRep>>)
300+
(!(underlying_type<std::remove_cvref_t<DestRep>> &&
301+
underlying_type<std::remove_cvref_t<SrcRep>>))
302302
constexpr auto unchecked_cast(SrcRep value) noexcept
303303
-> std::remove_cvref_t<DestRep> {
304304
return details::unchecked_rep_cast<DestRep>(value);
@@ -307,8 +307,8 @@ constexpr auto unchecked_cast(SrcRep value) noexcept
307307
template <details::numeric_cast_operand DestRep,
308308
details::numeric_cast_operand SrcRep>
309309
requires details::statically_castable<DestRep, SrcRep> &&
310-
!(underlying_type<std::remove_cvref_t<DestRep>> &&
311-
underlying_type<std::remove_cvref_t<SrcRep>>)
310+
(!(underlying_type<std::remove_cvref_t<DestRep>> &&
311+
underlying_type<std::remove_cvref_t<SrcRep>>))
312312
constexpr auto checked_cast(SrcRep value)
313313
-> cast_result<std::remove_cvref_t<DestRep>> {
314314
return details::checked_rep_cast<DestRep>(value);
@@ -317,8 +317,8 @@ constexpr auto checked_cast(SrcRep value)
317317
template <details::numeric_cast_operand DestRep,
318318
details::numeric_cast_operand SrcRep>
319319
requires details::statically_castable<DestRep, SrcRep> &&
320-
!(underlying_type<std::remove_cvref_t<DestRep>> &&
321-
underlying_type<std::remove_cvref_t<SrcRep>>)
320+
(!(underlying_type<std::remove_cvref_t<DestRep>> &&
321+
underlying_type<std::remove_cvref_t<SrcRep>>))
322322
constexpr auto saturating_cast(SrcRep value) noexcept
323323
-> std::remove_cvref_t<DestRep> {
324324
return details::saturating_rep_cast<DestRep>(value);
@@ -327,8 +327,8 @@ constexpr auto saturating_cast(SrcRep value) noexcept
327327
template <details::numeric_cast_operand DestRep,
328328
details::numeric_cast_operand SrcRep>
329329
requires details::statically_castable<DestRep, SrcRep> &&
330-
!(underlying_type<std::remove_cvref_t<DestRep>> &&
331-
underlying_type<std::remove_cvref_t<SrcRep>>)
330+
(!(underlying_type<std::remove_cvref_t<DestRep>> &&
331+
underlying_type<std::remove_cvref_t<SrcRep>>))
332332
constexpr auto truncating_cast(SrcRep value) noexcept
333333
-> std::remove_cvref_t<DestRep> {
334334
return details::truncating_rep_cast<DestRep>(value);
@@ -337,8 +337,8 @@ constexpr auto truncating_cast(SrcRep value) noexcept
337337
template <details::numeric_cast_operand DestRep,
338338
details::numeric_cast_operand SrcRep>
339339
requires details::statically_castable<DestRep, SrcRep> &&
340-
!(underlying_type<std::remove_cvref_t<DestRep>> &&
341-
underlying_type<std::remove_cvref_t<SrcRep>>)
340+
(!(underlying_type<std::remove_cvref_t<DestRep>> &&
341+
underlying_type<std::remove_cvref_t<SrcRep>>))
342342
constexpr auto exact_cast(SrcRep value)
343343
-> cast_result<std::remove_cvref_t<DestRep>> {
344344
return details::exact_rep_cast<DestRep>(value);

0 commit comments

Comments
 (0)