|
778 | 778 | // pseudo-mutators |
779 | 779 | template<@\exposconcept{constexpr-param}@ T> |
780 | 780 | constexpr auto operator++(this T) noexcept |
781 | | - requires requires(T::value_type x) { ++x; } |
782 | | - { return constant_wrapper<[] { auto c = T::value; return ++c; }()>{}; } |
| 781 | + -> constant_wrapper<++Y> { return {}; } |
783 | 782 | template<@\exposconcept{constexpr-param}@ T> |
784 | 783 | constexpr auto operator++(this T, int) noexcept |
785 | | - requires requires(T::value_type x) { x++; } |
786 | | - { return constant_wrapper<[] { auto c = T::value; return c++; }()>{}; } |
787 | | - |
| 784 | + -> constant_wrapper<Y++> { return {}; } |
788 | 785 | template<@\exposconcept{constexpr-param}@ T> |
789 | 786 | constexpr auto operator--(this T) noexcept |
790 | | - requires requires(T::value_type x) { --x; } |
791 | | - { return constant_wrapper<[] { auto c = T::value; return --c; }()>{}; } |
| 787 | + -> constant_wrapper<--Y> { return {}; } |
792 | 788 | template<@\exposconcept{constexpr-param}@ T> |
793 | 789 | constexpr auto operator--(this T, int) noexcept |
794 | | - requires requires(T::value_type x) { x--; } |
795 | | - { return constant_wrapper<[] { auto c = T::value; return c--; }()>{}; } |
| 790 | + -> constant_wrapper<Y--> { return {}; } |
796 | 791 |
|
797 | 792 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
798 | | - constexpr auto operator+=(this T, R) noexcept |
799 | | - requires requires(T::value_type x) { x += R::value; } |
800 | | - { return constant_wrapper<[] { auto v = T::value; return v += R::value; }()>{}; } |
| 793 | + constexpr auto operator+=(T, R) noexcept |
| 794 | + -> constant_wrapper<(T::value += R::value)> { return {}; } |
801 | 795 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
802 | | - constexpr auto operator-=(this T, R) noexcept |
803 | | - requires requires(T::value_type x) { x -= R::value; } |
804 | | - { return constant_wrapper<[] { auto v = T::value; return v -= R::value; }()>{}; } |
| 796 | + constexpr auto operator-=(T, R) noexcept |
| 797 | + -> constant_wrapper<(T::value -= R::value)> { return {}; } |
805 | 798 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
806 | | - constexpr auto operator*=(this T, R) noexcept |
807 | | - requires requires(T::value_type x) { x *= R::value; } |
808 | | - { return constant_wrapper<[] { auto v = T::value; return v *= R::value; }()>{}; } |
| 799 | + constexpr auto operator*=(T, R) noexcept |
| 800 | + -> constant_wrapper<(T::value *= R::value)> { return {}; } |
809 | 801 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
810 | | - constexpr auto operator/=(this T, R) noexcept |
811 | | - requires requires(T::value_type x) { x /= R::value; } |
812 | | - { return constant_wrapper<[] { auto v = T::value; return v /= R::value; }()>{}; } |
| 802 | + constexpr auto operator/=(T, R) noexcept |
| 803 | + -> constant_wrapper<(T::value /= R::value)> { return {}; } |
813 | 804 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
814 | | - constexpr auto operator%=(this T, R) noexcept |
815 | | - requires requires(T::value_type x) { x %= R::value; } |
816 | | - { return constant_wrapper<[] { auto v = T::value; return v %= R::value; }()>{}; } |
| 805 | + constexpr auto operator%=(T, R) noexcept |
| 806 | + -> constant_wrapper<(T::value %= R::value)> { return {}; } |
817 | 807 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
818 | | - constexpr auto operator&=(this T, R) noexcept |
819 | | - requires requires(T::value_type x) { x &= R::value; } |
820 | | - { return constant_wrapper<[] { auto v = T::value; return v &= R::value; }()>{}; } |
| 808 | + constexpr auto operator&=(T, R) noexcept |
| 809 | + -> constant_wrapper<(T::value &= R::value)> { return {}; } |
821 | 810 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
822 | | - constexpr auto operator|=(this T, R) noexcept |
823 | | - requires requires(T::value_type x) { x |= R::value; } |
824 | | - { return constant_wrapper<[] { auto v = T::value; return v |= R::value; }()>{}; } |
| 811 | + constexpr auto operator|=(T, R) noexcept |
| 812 | + -> constant_wrapper<(T::value |= R::value)> { return {}; } |
825 | 813 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
826 | | - constexpr auto operator^=(this T, R) noexcept |
827 | | - requires requires(T::value_type x) { x ^= R::value; } |
828 | | - { return constant_wrapper<[] { auto v = T::value; return v ^= R::value; }()>{}; } |
| 814 | + constexpr auto operator^=(T, R) noexcept |
| 815 | + -> constant_wrapper<(T::value ^= R::value)> { return {}; } |
829 | 816 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
830 | | - constexpr auto operator<<=(this T, R) noexcept |
831 | | - requires requires(T::value_type x) { x <<= R::value; } |
832 | | - { return constant_wrapper<[] { auto v = T::value; return v <<= R::value; }()>{}; } |
| 817 | + constexpr auto operator<<=(T, R) noexcept |
| 818 | + -> constant_wrapper<(T::value <<= R::value)> { return {}; } |
833 | 819 | template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> |
834 | | - constexpr auto operator>>=(this T, R) noexcept |
835 | | - requires requires(T::value_type x) { x >>= R::value; } |
836 | | - { return constant_wrapper<[] { auto v = T::value; return v >>= R::value; }()>{}; } |
| 820 | + constexpr auto operator>>=(T, R) noexcept |
| 821 | + -> constant_wrapper<(T::value >>= R::value)> { return {}; } |
837 | 822 | }; |
838 | 823 |
|
839 | 824 | template<@\exposid{cw-fixed-value}@ X, class> |
|
844 | 829 |
|
845 | 830 | template<@\exposconcept{constexpr-param}@ R> |
846 | 831 | constexpr auto operator=(R) const noexcept |
847 | | - requires requires(value_type x) { x = R::value; } |
848 | | - { return constant_wrapper<[] { auto v = value; return v = R::value; }()>{}; } |
| 832 | + -> constant_wrapper<X = R::value> { return {}; } |
849 | 833 |
|
850 | 834 | constexpr operator decltype(auto)() const noexcept { return value; } |
851 | 835 | }; |
|
0 commit comments