A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/func.not_fn below:

23 General utilities library [utilities]

23 General utilities library [utilities] 23.14 Function objects [function.objects] 23.14.10 Function template not_­fn [func.not_fn]

template <class F> unspecified not_fn(F&& f);

Effects: Equivalent to return call_­wrapper(std​::​forward<F>(f)); where call_­wrapper is an exposition only class defined as follows:

class call_wrapper {
  using FD = decay_t<F>;
  FD fd;

  explicit call_wrapper(F&& f);

public:
  call_wrapper(call_wrapper&&) = default;
  call_wrapper(const call_wrapper&) = default;

  template<class... Args>
    auto operator()(Args&&...) &
      -> decltype(!declval<invoke_result_t<FD&, Args...>>());

  template<class... Args>
    auto operator()(Args&&...) const&
      -> decltype(!declval<invoke_result_t<const FD&, Args...>>());

  template<class... Args>
    auto operator()(Args&&...) &&
      -> decltype(!declval<invoke_result_t<FD, Args...>>());

  template<class... Args>
    auto operator()(Args&&...) const&&
      -> decltype(!declval<invoke_result_t<const FD, Args...>>());
};

explicit call_wrapper(F&& f);

Requires: FD shall satisfy the requirements of MoveConstructible. is_­constructible_­v<FD, F> shall be true. fd shall be a callable object.

Effects: Initializes fd from std​::​forward<F>(f).

Throws: Any exception thrown by construction of fd.

template<class... Args> auto operator()(Args&&... args) & -> decltype(!declval<invoke_result_t<FD&, Args...>>()); template<class... Args> auto operator()(Args&&... args) const& -> decltype(!declval<invoke_result_t<const FD&, Args...>>());

Effects: Equivalent to:

return !INVOKE(fd, std::forward<Args>(args)...);              

template<class... Args> auto operator()(Args&&... args) && -> decltype(!declval<invoke_result_t<FD, Args...>>()); template<class... Args> auto operator()(Args&&... args) const&& -> decltype(!declval<invoke_result_t<const FD, Args...>>());

Effects: Equivalent to:

return !INVOKE(std::move(fd), std::forward<Args>(args)...);   

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4