-- d857e6e1f9b09a3eb5abd890677a98b23346f07a by Abseil Team <absl-team@google.com>: Simplify internal TryAcquireWithSpinning. No point declaring the `result` variable: we can just return the results directly. PiperOrigin-RevId: 307045800 -- 421952252bc23be51f47f7d23f3422bad1ed382c by Derek Mauro <dmauro@google.com>: Add custom sink support for `absl::Format()` through an ADL extension mechanism. Users can now define `void AbslFormatFlush(MySink* dest, absl::string_view part)` to allow `absl::Format()` to append to a custom sink. PiperOrigin-RevId: 306929052 -- c73d5cdb62cd58ea421ed1aeeab78a0ffcfeeefb by Matt Calabrese <calabrese@google.com>: Internal-only conformance-testing macro ABSL_INTERNAL_ASSERT_CONFORMANCE_OF for compile-time and runtime checks of a specified type, expected properties of that type, and a logically-ordered series of equivalence classes of that type. PiperOrigin-RevId: 306885512 -- a8c2495a07f37d68907855e3f0535bd5c27a3b52 by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 306766753 GitOrigin-RevId: d857e6e1f9b09a3eb5abd890677a98b23346f07a Change-Id: Ic23c92ac74f9ffcbb2471ff8c6691f4b7b20354bpull/671/head
parent
db5773a721
commit
b35973e3e3
16 changed files with 3095 additions and 43 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,391 @@ |
||||
// Copyright 2019 The Abseil Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef ABSL_TYPES_INTERNAL_CONFORMANCE_TESTING_HELPERS_H_ |
||||
#define ABSL_TYPES_INTERNAL_CONFORMANCE_TESTING_HELPERS_H_ |
||||
|
||||
// Checks to determine whether or not we can use abi::__cxa_demangle
|
||||
#if (defined(__ANDROID__) || defined(ANDROID)) && !defined(OS_ANDROID) |
||||
#define ABSL_INTERNAL_OS_ANDROID |
||||
#endif |
||||
|
||||
// We support certain compilers only. See demangle.h for details.
|
||||
#if defined(OS_ANDROID) && (defined(__i386__) || defined(__x86_64__)) |
||||
#define ABSL_TYPES_INTERNAL_HAS_CXA_DEMANGLE 0 |
||||
#elif (__GNUC__ >= 4 || (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)) && \ |
||||
!defined(__mips__) |
||||
#define ABSL_TYPES_INTERNAL_HAS_CXA_DEMANGLE 1 |
||||
#elif defined(__clang__) && !defined(_MSC_VER) |
||||
#define ABSL_TYPES_INTERNAL_HAS_CXA_DEMANGLE 1 |
||||
#else |
||||
#define ABSL_TYPES_INTERNAL_HAS_CXA_DEMANGLE 0 |
||||
#endif |
||||
|
||||
#include <tuple> |
||||
#include <type_traits> |
||||
#include <utility> |
||||
|
||||
#include "absl/meta/type_traits.h" |
||||
#include "absl/strings/string_view.h" |
||||
#include "absl/utility/utility.h" |
||||
|
||||
#if ABSL_TYPES_INTERNAL_HAS_CXA_DEMANGLE |
||||
#include <cxxabi.h> |
||||
|
||||
#include <cstdlib> |
||||
#endif |
||||
|
||||
namespace absl { |
||||
ABSL_NAMESPACE_BEGIN |
||||
namespace types_internal { |
||||
|
||||
// Return a readable name for type T.
|
||||
template <class T> |
||||
absl::string_view NameOfImpl() { |
||||
// TODO(calabrese) Investigate using debugging:internal_demangle as a fallback.
|
||||
#if ABSL_TYPES_INTERNAL_HAS_CXA_DEMANGLE |
||||
int status = 0; |
||||
char* demangled_name = nullptr; |
||||
|
||||
demangled_name = |
||||
abi::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status); |
||||
|
||||
if (status == 0 && demangled_name != nullptr) { |
||||
return demangled_name; |
||||
} else { |
||||
return typeid(T).name(); |
||||
} |
||||
#else |
||||
return typeid(T).name(); |
||||
#endif |
||||
// NOTE: We intentionally leak demangled_name so that it remains valid
|
||||
// throughout the remainder of the program.
|
||||
} |
||||
|
||||
// Given a type, returns as nice of a type name as we can produce (demangled).
|
||||
//
|
||||
// Note: This currently strips cv-qualifiers and references, but that is okay
|
||||
// because we only use this internally with unqualified object types.
|
||||
template <class T> |
||||
std::string NameOf() { |
||||
static const absl::string_view result = NameOfImpl<T>(); |
||||
return std::string(result); |
||||
} |
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Metafunction to check if a type is callable with no explicit arguments
|
||||
template <class Fun, class /*Enabler*/ = void> |
||||
struct IsNullaryCallableImpl : std::false_type {}; |
||||
|
||||
template <class Fun> |
||||
struct IsNullaryCallableImpl< |
||||
Fun, absl::void_t<decltype(std::declval<const Fun&>()())>> |
||||
: std::true_type { |
||||
using result_type = decltype(std::declval<const Fun&>()()); |
||||
|
||||
template <class ValueType> |
||||
using for_type = std::is_same<ValueType, result_type>; |
||||
|
||||
using void_if_true = void; |
||||
}; |
||||
|
||||
template <class Fun> |
||||
struct IsNullaryCallable : IsNullaryCallableImpl<Fun> {}; |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// A type that contains a function object that returns an instance of a type
|
||||
// that is undergoing conformance testing. This function is required to always
|
||||
// return the same value upon invocation.
|
||||
template <class Fun> |
||||
struct GeneratorType; |
||||
|
||||
// A type that contains a tuple of GeneratorType<Fun> where each Fun has the
|
||||
// same return type. The result of each of the different generators should all
|
||||
// be equal values, though the underlying object representation may differ (such
|
||||
// as if one returns 0.0 and another return -0.0, or if one returns an empty
|
||||
// vector and another returns an empty vector with a different capacity.
|
||||
template <class... Funs> |
||||
struct EquivalenceClassType; |
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// A metafunction to check if a type is a specialization of EquivalenceClassType
|
||||
template <class T> |
||||
struct IsEquivalenceClass : std::false_type {}; |
||||
|
||||
template <> |
||||
struct IsEquivalenceClass<EquivalenceClassType<>> : std::true_type { |
||||
using self = IsEquivalenceClass; |
||||
|
||||
// A metafunction to check if this EquivalenceClassType is a valid
|
||||
// EquivalenceClassType for a type `ValueType` that is undergoing testing
|
||||
template <class ValueType> |
||||
using for_type = std::true_type; |
||||
}; |
||||
|
||||
template <class Head, class... Tail> |
||||
struct IsEquivalenceClass<EquivalenceClassType<Head, Tail...>> |
||||
: std::true_type { |
||||
using self = IsEquivalenceClass; |
||||
|
||||
// The type undergoing conformance testing that this EquivalenceClass
|
||||
// corresponds to
|
||||
using result_type = typename IsNullaryCallable<Head>::result_type; |
||||
|
||||
// A metafunction to check if this EquivalenceClassType is a valid
|
||||
// EquivalenceClassType for a type `ValueType` that is undergoing testing
|
||||
template <class ValueType> |
||||
using for_type = std::is_same<ValueType, result_type>; |
||||
}; |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// A type that contains an ordered series of EquivalenceClassTypes, where the
|
||||
// the function object of each underlying GeneratorType has the same return type
|
||||
//
|
||||
// These equivalence classes are required to be in a logical ascending order
|
||||
// that is consistent with comparison operators that are defined for the return
|
||||
// type of each GeneratorType, if any.
|
||||
template <class... EqClasses> |
||||
struct OrderedEquivalenceClasses; |
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// A metafunction to determine the return type of the function object contained
|
||||
// in a GeneratorType specialization.
|
||||
template <class T> |
||||
struct ResultOfGenerator {}; |
||||
|
||||
template <class Fun> |
||||
struct ResultOfGenerator<GeneratorType<Fun>> { |
||||
using type = decltype(std::declval<const Fun&>()()); |
||||
}; |
||||
|
||||
template <class Fun> |
||||
using ResultOfGeneratorT = typename ResultOfGenerator<GeneratorType<Fun>>::type; |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// A metafunction that yields true iff each of Funs is a GeneratorType
|
||||
// specialization and they all contain functions with the same return type
|
||||
template <class /*Enabler*/, class... Funs> |
||||
struct AreGeneratorsWithTheSameReturnTypeImpl : std::false_type {}; |
||||
|
||||
template <> |
||||
struct AreGeneratorsWithTheSameReturnTypeImpl<void> : std::true_type {}; |
||||
|
||||
template <class Head, class... Tail> |
||||
struct AreGeneratorsWithTheSameReturnTypeImpl< |
||||
typename std::enable_if<absl::conjunction<std::is_same< |
||||
ResultOfGeneratorT<Head>, ResultOfGeneratorT<Tail>>...>::value>::type, |
||||
Head, Tail...> : std::true_type {}; |
||||
|
||||
template <class... Funs> |
||||
struct AreGeneratorsWithTheSameReturnType |
||||
: AreGeneratorsWithTheSameReturnTypeImpl<void, Funs...>::type {}; |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// A metafunction that yields true iff each of Funs is an EquivalenceClassType
|
||||
// specialization and they all contain GeneratorType specializations that have
|
||||
// the same return type
|
||||
template <class... EqClasses> |
||||
struct AreEquivalenceClassesOfTheSameType { |
||||
static_assert(sizeof...(EqClasses) != sizeof...(EqClasses), ""); |
||||
}; |
||||
|
||||
template <> |
||||
struct AreEquivalenceClassesOfTheSameType<> : std::true_type { |
||||
using self = AreEquivalenceClassesOfTheSameType; |
||||
|
||||
// Metafunction to check that a type is the same as all of the equivalence
|
||||
// classes, if any.
|
||||
// Note: In this specialization there are no equivalence classes, so the
|
||||
// value type is always compatible.
|
||||
template <class /*ValueType*/> |
||||
using for_type = std::true_type; |
||||
}; |
||||
|
||||
template <class... Funs> |
||||
struct AreEquivalenceClassesOfTheSameType<EquivalenceClassType<Funs...>> |
||||
: std::true_type { |
||||
using self = AreEquivalenceClassesOfTheSameType; |
||||
|
||||
// Metafunction to check that a type is the same as all of the equivalence
|
||||
// classes, if any.
|
||||
template <class ValueType> |
||||
using for_type = typename IsEquivalenceClass< |
||||
EquivalenceClassType<Funs...>>::template for_type<ValueType>; |
||||
}; |
||||
|
||||
template <class... TailEqClasses> |
||||
struct AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<>, EquivalenceClassType<>, TailEqClasses...> |
||||
: AreEquivalenceClassesOfTheSameType<TailEqClasses...>::self {}; |
||||
|
||||
template <class HeadNextFun, class... TailNextFuns, class... TailEqClasses> |
||||
struct AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<>, EquivalenceClassType<HeadNextFun, TailNextFuns...>, |
||||
TailEqClasses...> |
||||
: AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<HeadNextFun, TailNextFuns...>, |
||||
TailEqClasses...>::self {}; |
||||
|
||||
template <class HeadHeadFun, class... TailHeadFuns, class... TailEqClasses> |
||||
struct AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<HeadHeadFun, TailHeadFuns...>, EquivalenceClassType<>, |
||||
TailEqClasses...> |
||||
: AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<HeadHeadFun, TailHeadFuns...>, |
||||
TailEqClasses...>::self {}; |
||||
|
||||
template <class HeadHeadFun, class... TailHeadFuns, class HeadNextFun, |
||||
class... TailNextFuns, class... TailEqClasses> |
||||
struct AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<HeadHeadFun, TailHeadFuns...>, |
||||
EquivalenceClassType<HeadNextFun, TailNextFuns...>, TailEqClasses...> |
||||
: absl::conditional_t< |
||||
IsNullaryCallable<HeadNextFun>::template for_type< |
||||
typename IsNullaryCallable<HeadHeadFun>::result_type>::value, |
||||
AreEquivalenceClassesOfTheSameType< |
||||
EquivalenceClassType<HeadHeadFun, TailHeadFuns...>, |
||||
TailEqClasses...>, |
||||
std::false_type> {}; |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Execute a function for each passed-in parameter.
|
||||
template <class Fun, class... Cases> |
||||
void ForEachParameter(const Fun& fun, const Cases&... cases) { |
||||
const std::initializer_list<bool> results = { |
||||
(static_cast<void>(fun(cases)), true)...}; |
||||
|
||||
(void)results; |
||||
} |
||||
|
||||
// Execute a function on each passed-in parameter (using a bound function).
|
||||
template <class Fun> |
||||
struct ForEachParameterFun { |
||||
template <class... T> |
||||
void operator()(const T&... cases) const { |
||||
(ForEachParameter)(fun, cases...); |
||||
} |
||||
|
||||
Fun fun; |
||||
}; |
||||
|
||||
// Execute a function on each element of a tuple.
|
||||
template <class Fun, class Tup> |
||||
void ForEachTupleElement(const Fun& fun, const Tup& tup) { |
||||
absl::apply(ForEachParameterFun<Fun>{fun}, tup); |
||||
} |
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Execute a function for each combination of two elements of a tuple, including
|
||||
// combinations of an element with itself.
|
||||
template <class Fun, class... T> |
||||
struct ForEveryTwoImpl { |
||||
template <class Lhs> |
||||
struct WithBoundLhs { |
||||
template <class Rhs> |
||||
void operator()(const Rhs& rhs) const { |
||||
fun(lhs, rhs); |
||||
} |
||||
|
||||
Fun fun; |
||||
Lhs lhs; |
||||
}; |
||||
|
||||
template <class Lhs> |
||||
void operator()(const Lhs& lhs) const { |
||||
(ForEachTupleElement)(WithBoundLhs<Lhs>{fun, lhs}, args); |
||||
} |
||||
|
||||
Fun fun; |
||||
std::tuple<T...> args; |
||||
}; |
||||
|
||||
template <class Fun, class... T> |
||||
void ForEveryTwo(const Fun& fun, std::tuple<T...> args) { |
||||
(ForEachTupleElement)(ForEveryTwoImpl<Fun, T...>{fun, args}, args); |
||||
} |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Insert all values into an associative container
|
||||
template<class Container> |
||||
void InsertEach(Container* cont) { |
||||
} |
||||
|
||||
template<class Container, class H, class... T> |
||||
void InsertEach(Container* cont, H&& head, T&&... tail) { |
||||
cont->insert(head); |
||||
(InsertEach)(cont, tail...); |
||||
} |
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// A template with a nested "Invoke" static-member-function that executes a
|
||||
// passed-in Callable when `Condition` is true, otherwise it ignores the
|
||||
// Callable. This is useful for executing a function object with a condition
|
||||
// that corresponds to whether or not the Callable can be safely instantiated.
|
||||
// It has some overlapping uses with C++17 `if constexpr`.
|
||||
template <bool Condition> |
||||
struct If; |
||||
|
||||
template <> |
||||
struct If</*Condition =*/false> { |
||||
template <class Fun, class... P> |
||||
static void Invoke(const Fun& /*fun*/, P&&... /*args*/) {} |
||||
}; |
||||
|
||||
template <> |
||||
struct If</*Condition =*/true> { |
||||
template <class Fun, class... P> |
||||
static void Invoke(const Fun& fun, P&&... args) { |
||||
// TODO(calabrese) Use std::invoke equivalent instead of function-call.
|
||||
fun(absl::forward<P>(args)...); |
||||
} |
||||
}; |
||||
|
||||
//
|
||||
// ABSL_INTERNAL_STRINGIZE(...)
|
||||
//
|
||||
// This variadic macro transforms its arguments into a c-string literal after
|
||||
// expansion.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// ABSL_INTERNAL_STRINGIZE(std::array<int, 10>)
|
||||
//
|
||||
// Results in:
|
||||
//
|
||||
// "std::array<int, 10>"
|
||||
#define ABSL_INTERNAL_STRINGIZE(...) ABSL_INTERNAL_STRINGIZE_IMPL((__VA_ARGS__)) |
||||
#define ABSL_INTERNAL_STRINGIZE_IMPL(arg) ABSL_INTERNAL_STRINGIZE_IMPL2 arg |
||||
#define ABSL_INTERNAL_STRINGIZE_IMPL2(...) #__VA_ARGS__ |
||||
|
||||
} // namespace types_internal
|
||||
ABSL_NAMESPACE_END |
||||
} // namespace absl
|
||||
|
||||
#endif // ABSL_TYPES_INTERNAL_CONFORMANCE_TESTING_HELPERS_H_
|
@ -0,0 +1,34 @@ |
||||
// Copyright 2019 The Abseil Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// parentheses.h
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// This file contains macros that expand to a left parenthesis and a right
|
||||
// parenthesis. These are in their own file and are generated from macros
|
||||
// because otherwise clang-format gets confused and clang-format off directives
|
||||
// do not help.
|
||||
//
|
||||
// The parentheses macros are used when wanting to require a rescan before
|
||||
// expansion of parenthesized text appearing after a function-style macro name.
|
||||
|
||||
#ifndef ABSL_TYPES_INTERNAL_PARENTHESES_H_ |
||||
#define ABSL_TYPES_INTERNAL_PARENTHESES_H_ |
||||
|
||||
#define ABSL_INTERNAL_LPAREN ( |
||||
|
||||
#define ABSL_INTERNAL_RPAREN ) |
||||
|
||||
#endif // ABSL_TYPES_INTERNAL_PARENTHESES_H_
|
@ -0,0 +1,246 @@ |
||||
// Copyright 2019 The Abseil Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// transform_args.h
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// This file contains a higher-order macro that "transforms" each element of a
|
||||
// a variadic argument by a provided secondary macro.
|
||||
|
||||
#ifndef ABSL_TYPES_INTERNAL_TRANSFORM_ARGS_H_ |
||||
#define ABSL_TYPES_INTERNAL_TRANSFORM_ARGS_H_ |
||||
|
||||
//
|
||||
// ABSL_INTERNAL_CAT(a, b)
|
||||
//
|
||||
// This macro takes two arguments and concatenates them together via ## after
|
||||
// expansion.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// ABSL_INTERNAL_CAT(foo_, bar)
|
||||
//
|
||||
// Results in:
|
||||
//
|
||||
// foo_bar
|
||||
#define ABSL_INTERNAL_CAT(a, b) ABSL_INTERNAL_CAT_IMPL(a, b) |
||||
#define ABSL_INTERNAL_CAT_IMPL(a, b) a##b |
||||
|
||||
//
|
||||
// ABSL_INTERNAL_TRANSFORM_ARGS(m, ...)
|
||||
//
|
||||
// This macro takes another macro as an argument followed by a trailing series
|
||||
// of additional parameters (up to 32 additional arguments). It invokes the
|
||||
// passed-in macro once for each of the additional arguments, with the
|
||||
// expansions separated by commas.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// ABSL_INTERNAL_TRANSFORM_ARGS(MY_MACRO, a, b, c)
|
||||
//
|
||||
// Results in:
|
||||
//
|
||||
// MY_MACRO(a), MY_MACRO(b), MY_MACRO(c)
|
||||
//
|
||||
// TODO(calabrese) Handle no arguments as a special case.
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS(m, ...) \ |
||||
ABSL_INTERNAL_CAT(ABSL_INTERNAL_TRANSFORM_ARGS, \
|
||||
ABSL_INTERNAL_NUM_ARGS(__VA_ARGS__)) \
|
||||
(m, __VA_ARGS__) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS1(m, a0) m(a0) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS2(m, a0, a1) m(a0), m(a1) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS3(m, a0, a1, a2) m(a0), m(a1), m(a2) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS4(m, a0, a1, a2, a3) \ |
||||
m(a0), m(a1), m(a2), m(a3) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS5(m, a0, a1, a2, a3, a4) \ |
||||
m(a0), m(a1), m(a2), m(a3), m(a4) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS6(m, a0, a1, a2, a3, a4, a5) \ |
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS7(m, a0, a1, a2, a3, a4, a5, a6) \ |
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS8(m, a0, a1, a2, a3, a4, a5, a6, a7) \ |
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS9(m, a0, a1, a2, a3, a4, a5, a6, a7, a8) \ |
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS10(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS11(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), m(a10) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS12(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS13(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS14(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS15(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS16(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS17(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS18(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS19(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS20(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS21(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19, a20) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS22(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19, a20, a21) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS23(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19, a20, a21, a22) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS24(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19, a20, a21, a22, a23) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS25(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19, a20, a21, a22, a23, a24) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS26( \ |
||||
m, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, \
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS27( \ |
||||
m, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, \
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25), m(a26) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS28( \ |
||||
m, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, \
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25), m(a26), m(a27) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS29( \ |
||||
m, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, \
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25), m(a26), m(a27), \
|
||||
m(a28) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS30( \ |
||||
m, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, \
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25), m(a26), m(a27), \
|
||||
m(a28), m(a29) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS31( \ |
||||
m, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, \
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25), m(a26), m(a27), \
|
||||
m(a28), m(a29), m(a30) |
||||
|
||||
#define ABSL_INTERNAL_TRANSFORM_ARGS32(m, a0, a1, a2, a3, a4, a5, a6, a7, a8, \ |
||||
a9, a10, a11, a12, a13, a14, a15, a16, \
|
||||
a17, a18, a19, a20, a21, a22, a23, a24, \
|
||||
a25, a26, a27, a28, a29, a30, a31) \
|
||||
m(a0), m(a1), m(a2), m(a3), m(a4), m(a5), m(a6), m(a7), m(a8), m(a9), \
|
||||
m(a10), m(a11), m(a12), m(a13), m(a14), m(a15), m(a16), m(a17), m(a18), \
|
||||
m(a19), m(a20), m(a21), m(a22), m(a23), m(a24), m(a25), m(a26), m(a27), \
|
||||
m(a28), m(a29), m(a30), m(a31) |
||||
|
||||
#define ABSL_INTERNAL_NUM_ARGS_IMPL(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, \ |
||||
a10, a11, a12, a13, a14, a15, a16, a17, \
|
||||
a18, a19, a20, a21, a22, a23, a24, a25, \
|
||||
a26, a27, a28, a29, a30, a31, result, ...) \
|
||||
result |
||||
|
||||
#define ABSL_INTERNAL_FORCE_EXPANSION(...) __VA_ARGS__ |
||||
|
||||
#define ABSL_INTERNAL_NUM_ARGS(...) \ |
||||
ABSL_INTERNAL_FORCE_EXPANSION(ABSL_INTERNAL_NUM_ARGS_IMPL( \
|
||||
__VA_ARGS__, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, \
|
||||
17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, )) |
||||
|
||||
#endif // ABSL_TYPES_INTERNAL_TRANSFORM_ARGS_H_
|
Loading…
Reference in new issue