// Copyright 2022 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_ALLOCATOR_DISPATCHER_TESTING_TOOLS_H_ #define BASE_ALLOCATOR_DISPATCHER_TESTING_TOOLS_H_ #include #include #include namespace base::allocator::dispatcher::testing { namespace internal { template struct DefineTupleFromSingleType { using type = typename DefineTupleFromSingleType::type; }; template struct DefineTupleFromSingleType<0, Type, AppendedTypes...> { using type = std::tuple; }; } // namespace internal template struct DefineTupleFromSingleType { using type = typename internal::DefineTupleFromSingleType::type; }; template typename internal::DefineTupleFromSingleType::type CreateTupleOfPointers(std::array& items, std::index_sequence) { return std::make_tuple((&items[Indices])...); } template typename internal::DefineTupleFromSingleType::type CreateTupleOfPointers(std::array& items) { return CreateTupleOfPointers(items, std::make_index_sequence{}); } } // namespace base::allocator::dispatcher::testing #endif // BASE_ALLOCATOR_DISPATCHER_TESTING_TOOLS_H_