|
797 | 797 | friend constexpr auto operator->*(L, R) noexcept -> constant_wrapper<L::value->*(R::value)> |
798 | 798 | { return {}; } |
799 | 799 |
|
800 | | - // call and index |
801 | | - template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@... Args> |
802 | | - constexpr auto operator()(this T, Args...) noexcept |
803 | | - requires requires { constant_wrapper<T::value(Args::value...)>(); } |
804 | | - { return constant_wrapper<T::value(Args::value...)>{}; } |
805 | | - template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@... Args> |
806 | | - constexpr auto operator[](this T, Args...) noexcept |
807 | | - -> constant_wrapper<(T::value[Args::value...])> |
808 | | - { return {}; } |
809 | | - |
810 | 800 | // pseudo-mutators |
811 | 801 | template<@\exposconcept{constexpr-param}@ T> |
812 | 802 | constexpr auto operator++(this T) noexcept |
|
864 | 854 | -> constant_wrapper<X = R::value> { return {}; } |
865 | 855 |
|
866 | 856 | constexpr operator decltype(auto)() const noexcept { return value; } |
| 857 | + |
| 858 | + template<class... Args> |
| 859 | + static constexpr decltype(auto) operator()(Args&&... args) noexcept(@\seebelow@); |
| 860 | + template<class... Args> |
| 861 | + static constexpr decltype(auto) operator[](Args&&... args) noexcept(@\seebelow@); |
867 | 862 | }; |
868 | 863 | } |
869 | 864 | \end{codeblock} |
|
926 | 921 | Initialize elements of \exposid{data} with corresponding elements of \tcode{arr}. |
927 | 922 | \end{itemdescr} |
928 | 923 |
|
| 924 | +\indexlibrarymember{operator()}{constant_wrapper}% |
| 925 | +\begin{itemdecl} |
| 926 | +template<class... Args> |
| 927 | + static constexpr decltype(auto) operator()(Args&&... args) noexcept(@\seebelow@); |
| 928 | +\end{itemdecl} |
| 929 | + |
| 930 | +\begin{itemdescr} |
| 931 | +\pnum |
| 932 | +Let \tcode{\placeholder{call-expr}} be |
| 933 | +\tcode{constant_wrapper<\placeholder{INVOKE}(value, |
| 934 | +remove_cvref_t<Args>::value...)>\{\}} if all types in |
| 935 | +\tcode{remove_cvref_t<Args>...} satisfy \exposconcept{constexpr-param} and |
| 936 | +\tcode{constant_wrapper<\placeholder{INVOKE}(val\-ue, |
| 937 | +remove_cvref_t<Args>::value...)>} is a valid type, otherwise let |
| 938 | +\tcode{\placeholder{call-expr}} be \tcode{\placeholder{INVOKE}(value, |
| 939 | +std::forward<Args>(args)...)}. |
| 940 | + |
| 941 | +\pnum |
| 942 | +\constraints |
| 943 | +\tcode{\placeholder{call-expr}} is a valid expression. |
| 944 | + |
| 945 | +\pnum |
| 946 | +\effects |
| 947 | +Equivalent to: \tcode{return \placeholder{call-expr};} |
| 948 | + |
| 949 | +\pnum |
| 950 | +\remarks |
| 951 | +The exception specification is equivalent to \tcode{noexcept(\placeholder{call-expr})}. |
| 952 | +\end{itemdescr} |
| 953 | + |
| 954 | +\indexlibrarymember{operator[]}{constant_wrapper}% |
| 955 | +\begin{itemdecl} |
| 956 | +template<class... Args> |
| 957 | + static constexpr decltype(auto) operator[](Args&&... args) noexcept(@\seebelow@); |
| 958 | +\end{itemdecl} |
| 959 | + |
| 960 | +\begin{itemdescr} |
| 961 | +\pnum |
| 962 | +Let \tcode{\placeholder{subscr-expr}} be |
| 963 | +\tcode{constant_wrapper<value[remove_cvref_t<Args>::value...]>\{\}} if all |
| 964 | +types in \tcode{remove_cvref_t<Args>...} satisfy \exposconcept{constexpr-param} |
| 965 | +and \tcode{constant_wrapper<value[remove_cv\-ref_t<Args>::value...]>} is a valid |
| 966 | +type, otherwise let \tcode{\placeholder{subscr-expr}} be |
| 967 | +\tcode{value[std::forward<Args\brk{}>(args)...]}. |
| 968 | + |
| 969 | +\pnum |
| 970 | +\constraints |
| 971 | +\tcode{\placeholder{subscr-expr}} is a valid expression. |
| 972 | + |
| 973 | +\pnum |
| 974 | +\effects |
| 975 | +Equivalent to: \tcode{return \placeholder{subscr-expr};} |
| 976 | + |
| 977 | +\pnum |
| 978 | +\remarks |
| 979 | +The exception specification is equivalent to \tcode{noexcept(\placeholder{subscr-expr})}. |
| 980 | +\end{itemdescr} |
| 981 | + |
929 | 982 | \rSec2[meta.unary]{Unary type traits} |
930 | 983 |
|
931 | 984 | \rSec3[meta.unary.general]{General} |
|
0 commit comments