Skip to content

Commit

Permalink
DPL: use constraints directly on arguments in place of requires
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Dec 4, 2024
1 parent 2ae1d33 commit f4f29a3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Framework/Foundation/include/Framework/Endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,20 @@
#define O2_BIG_ENDIAN __BIG_ENDIAN
#define O2_LITTLE_ENDIAN __LITTLE_ENDIAN


template <typename T>
requires std::same_as<T, uint16_t>
inline uint16_t doSwap(uint16_t x)
inline uint16_t doSwap(std::same_as<uint16_t> auto x)
{
return swap16_(x);
}

template <typename T>
requires std::same_as<T, uint32_t>
inline uint32_t doSwap(uint32_t x)
inline uint32_t doSwap(std::same_as<uint32_t> auto x)
{
return swap32_(x);
}

template <typename T>
requires std::same_as<T, uint64_t>
inline uint64_t doSwap(uint64_t x)
inline uint64_t doSwap(std::same_as<uint64_t> auto x)
{
return swap64_(x);
}
Expand Down

0 comments on commit f4f29a3

Please sign in to comment.