Skip to content

Commit

Permalink
type_pack: Remove unused sequence transform.
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Jan 11, 2018
1 parent 264c3b6 commit 2e3478a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
7 changes: 0 additions & 7 deletions bindings/pydrake/util/test/type_pack_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ GTEST_TEST(TypeUtilTest, Visit) {
EXPECT_EQ(names, names_expected_sub);
};

GTEST_TEST(TypeUtilTest, Transform) {
auto seq = sequence_transform(
constant_add<int, 5>{}, std::make_integer_sequence<int, 5>{});
EXPECT_TRUE((std::is_same<
decltype(seq), std::integer_sequence<int, 5, 6, 7, 8, 9>>::value));
}

GTEST_TEST(TypeUtilTest, Hash) {
using T = int;
using U = int;
Expand Down
18 changes: 0 additions & 18 deletions bindings/pydrake/util/type_pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,6 @@ void type_visit(
true)...};
}

/// Transforms an integer sequence.
/// @tparam TForm
/// Type with the interface `TForm::template type<T>::value`,
/// which operates on a constexpr value.
/// @tparam T Integral type.
/// @tparam Values... Integral values.
template <typename TForm, typename T, T... Values>
auto sequence_transform(TForm = {}, std::integer_sequence<T, Values...> = {}) {
return std::integer_sequence<T, TForm::template type<Values>::value...>{};
}

/// Adds a constant value to a constexpr value.
template <typename T, T x>
struct constant_add {
template <T y>
using type = std::integral_constant<T, x + y>;
};

/// Provides short-hand for hashing a type.
template <typename T>
constexpr size_t type_hash() {
Expand Down

0 comments on commit 2e3478a

Please sign in to comment.