I want to add constexpr to the following functions:
20.14.3 Function template invoke [func.invoke]
template <class F, class... Args>
constexpr result_of_t<F&&(Args&&...)> invoke(F&& f, Args&&... args);
20.14.4 Class template reference_wrapper [refwrap]
namespace std {
template <class T> class reference_wrapper {
public :
// types
using type = T;
// construct/copy/destroy
constexpr reference_wrapper(T&) noexcept;
reference_wrapper(T&&) = delete; // do not bind to temporary objects
constexpr reference_wrapper(const reference_wrapper& x) noexcept;
// assignment
constexpr reference_wrapper& operator=(const reference_wrapper& x) noexcept;
// access
constexpr operator T& () const noexcept;
constexpr T& get() const noexcept;
// invocation
template <class... ArgTypes>
constexpr result_of_t<T&(ArgTypes&&...)>
operator() (ArgTypes&&...) const;
};
}
20.14.4.5 reference_wrapper helper functions [refwrap.helpers]
template <class T> constexpr reference_wrapper<T> ref(T& t) noexcept;
template <class T> constexpr reference_wrapper<T> ref(reference_wrapper<T> t) noexcept;
template <class T> constexpr reference_wrapper<const T> cref(const T& t) noexcept;
template <class T> constexpr reference_wrapper<const T> cref(reference_wrapper<T> t) noexcept;
invoke and reference_wrapper are very basic and powerful tools that might be used in constexpr functions. I'm working with C++17 for a while and need to implement constexpr versions by my self to use them in constexpr expressions.