Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/security/sandbox/chromium/base/functional/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  not_fn.h

  Sprache: C
 

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FUNCTIONAL_NOT_FN_H_
#define BASE_FUNCTIONAL_NOT_FN_H_

#include <type_traits>
#include <utility>

#include "base/functional/invoke.h"

namespace base {

namespace internal {

template <typename F>
struct NotFnImpl {
  F f;

  template <typename... Args>
  constexpr decltype(autooperator()(Args&&... args) & noexcept {
    return !base::invoke(f, std::forward<Args>(args)...);
  }

  template <typename... Args>
  constexpr decltype(autooperator()(Args&&... args) const& noexcept {
    return !base::invoke(f, std::forward<Args>(args)...);
  }

  template <typename... Args>
  constexpr decltype(autooperator()(Args&&... args) && noexcept {
    return !base::invoke(std::move(f), std::forward<Args>(args)...);
  }

  template <typename... Args>
  constexpr decltype(autooperator()(Args&&... args) const&& noexcept {
    return !base::invoke(std::move(f), std::forward<Args>(args)...);
  }
};

}  // namespace internal

// Implementation of C++17's std::not_fn.
//
// Reference:
// - https://en.cppreference.com/w/cpp/utility/functional/not_fn
// - https://wg21.link/func.not.fn
template <typename F>
constexpr internal::NotFnImpl<std::decay_t<F>> not_fn(F&& f) {
  return {std::forward<F>(f)};
}

}  // namespace base

#endif  // BASE_FUNCTIONAL_NOT_FN_H_

Messung V0.5 in Prozent
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.