File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class LERep : public std::array<std::byte, sizeof(A)> {
2727 uint16_t ,
2828 uint8_t >::type>::type>::type;
2929public:
30- constexpr operator A () {
30+ constexpr operator A () const {
3131 uint_according ret = 0 ;
3232 for (size_t offs = 0 ; auto &b : *this ) {
3333 ret |= (static_cast <uint_according>(b) << offs) & (uint_according (0xFFu ) << offs);
@@ -44,11 +44,13 @@ class LERep : public std::array<std::byte, sizeof(A)> {
4444 return *this ;
4545 }
4646 template <Arithmetic B> requires (std::convertible_to<B, A> || std::is_same_v<A, half>)
47- constexpr LERep(const B &u) { *this = static_cast <A>(u); }
47+ constexpr LERep(const B &u) { this ->operator =(static_cast <A>(u)); }
48+
4849 template <Arithmetic B> requires std::convertible_to<B, A>
49- constexpr LERep (const LERep<B> &u) { *this = static_cast <A>(u); }
50+ constexpr LERep (const LERep<B> &u) { this ->operator =(u.operator A ()); }
51+
5052 template <Arithmetic B> requires std::convertible_to<A, B>
51- constexpr operator B () const { return static_cast <B>(static_cast <A>(* this )); }
53+ constexpr operator B () const { return static_cast <B>(this -> operator A ( )); }
5254};
5355
5456namespace ImagePixel {
You can’t perform that action at this time.
0 commit comments