Skip to content

Commit

Permalink
Remove as_tuple_view()
Browse files Browse the repository at this point in the history
Mapping a struct to a tuple can be very slow for high enough sizes,
which the practical reason it was limited to <=400 fields.

The functionality can be serviced by the previously introduced
struct_decomposition
  • Loading branch information
alexkaratarakis committed Jan 3, 2025
1 parent 45eb860 commit 25af060
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 1,761 deletions.
5 changes: 1 addition & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,7 @@ cc_library(

cc_library(
name = "tuples",
hdrs = [
"include/fixed_containers/tuples.hpp",
"include/fixed_containers/tuples_as_tuple_view.hpp"
],
hdrs = ["include/fixed_containers/tuples.hpp"],
includes = includes_config(),
strip_include_prefix = strip_include_prefix_config(),
deps = [
Expand Down
8 changes: 0 additions & 8 deletions include/fixed_containers/tuples.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
#pragma once

#include "fixed_containers/tuples_as_tuple_view.hpp"

#include <concepts>
#include <cstddef>
#include <tuple>
#include <utility>

namespace fixed_containers::tuples
{
template <std::size_t FIELD_COUNT, typename T>
constexpr auto as_tuple_view(T& data)
{
return as_tuple_view_detail::as_tuple_view<FIELD_COUNT, T>(data);
}

template <typename Tuple, typename Func>
requires(std::tuple_size_v<std::decay_t<Tuple>> == 0)
constexpr void for_each_entry(Tuple&& /*tuple*/, Func&& /*func*/)
Expand Down
Loading

0 comments on commit 25af060

Please sign in to comment.