Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/gfx/skia/skia/src/utils/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  SkCallableTraits.h

  Sprache: C
 

/*
 * Copyright 2018 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkCallableTraits_DEFINED
#define SkCallableTraits_DEFINED

#include <type_traits>
#include <tuple>

template <typename R, typename... Args> struct sk_base_callable_traits {
    using return_type = R;
    static constexpr std::size_t arity = sizeof...(Args);
    template <std::size_t N> struct argument {
        static_assert(N < arity, "");
        using type = typename std::tuple_element<N, std::tuple<Args...>>::type;
    };
};

#define SK_CALLABLE_TRAITS__COMMA ,

#define SK_CALLABLE_TRAITS__VARARGS(quals, _) \
SK_CALLABLE_TRAITS__INSTANCE(quals,) \
SK_CALLABLE_TRAITS__INSTANCE(quals, SK_CALLABLE_TRAITS__COMMA ...)

#ifdef __cpp_noexcept_function_type
#define SK_CALLABLE_TRAITS__NE_VARARGS(quals, _) \
SK_CALLABLE_TRAITS__VARARGS(quals,) \
SK_CALLABLE_TRAITS__VARARGS(quals noexcept,)
#else
#define SK_CALLABLE_TRAITS__NE_VARARGS(quals, _) \
SK_CALLABLE_TRAITS__VARARGS(quals,)
#endif

#define SK_CALLABLE_TRAITS__REF_NE_VARARGS(quals, _) \
SK_CALLABLE_TRAITS__NE_VARARGS(quals,) \
SK_CALLABLE_TRAITS__NE_VARARGS(quals &,) \
SK_CALLABLE_TRAITS__NE_VARARGS(quals &&,)

#define SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS() \
SK_CALLABLE_TRAITS__REF_NE_VARARGS(,) \
SK_CALLABLE_TRAITS__REF_NE_VARARGS(const,) \
SK_CALLABLE_TRAITS__REF_NE_VARARGS(volatile,) \
SK_CALLABLE_TRAITS__REF_NE_VARARGS(const volatile,)

/** Infer the return_type and argument<N> of a callable type T. */
template <typename T> struct SkCallableTraits : SkCallableTraits<decltype(&T::operator())> {};

// function (..., (const, volatile), (&, &&), noexcept)
#define SK_CALLABLE_TRAITS__INSTANCE(quals, varargs) \
template <typename R, typename... Args> \
struct SkCallableTraits<R(Args... varargs) quals> : sk_base_callable_traits<R, Args...> {};

SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS()
#undef SK_CALLABLE_TRAITS__INSTANCE

// pointer to function (..., noexcept)
#define SK_CALLABLE_TRAITS__INSTANCE(quals, varargs) \
template <typename R, typename... Args> \
struct SkCallableTraits<R(*)(Args... varargs) quals> : sk_base_callable_traits<R, Args...> {};

SK_CALLABLE_TRAITS__NE_VARARGS(,)
#undef SK_CALLABLE_TRAITS__INSTANCE

// pointer to method (..., (const, volatile), (&, &&), noexcept)
#define SK_CALLABLE_TRAITS__INSTANCE(quals, varargs) \
template <typename T, typename R, typename... Args> \
struct SkCallableTraits<R(T::*)(Args... varargs) quals> : sk_base_callable_traits<R, Args...> {};

SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS()
#undef SK_CALLABLE_TRAITS__INSTANCE

// pointer to field
template <typename T, typename R>
struct SkCallableTraits<R T::*> : sk_base_callable_traits<typename std::add_lvalue_reference<R>::type> {};

#undef SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS
#undef SK_CALLABLE_TRAITS__REF_NE_VARARGS
#undef SK_CALLABLE_TRAITS__NE_VARARGS
#undef SK_CALLABLE_TRAITS__VARARGS
#undef SK_CALLABLE_TRAITS__COMMA

#endif

Messung V0.5 in Prozent
C=90 H=96 G=93

¤ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© 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.