These are chat archives for boostorg/hana

Jan 2016
Maik Klein
Jan 17 2016 21:14
template <typename Iterable, typename T>
constexpr auto index_of(Iterable const& iterable, T const& element) {
  auto size = hana::size(iterable);
  auto dropped = decltype(
  return size - dropped;
template <typename Iterable, typename ...Ts>
constexpr auto indices_of(Iterable const& iterable, const Ts&...  elements) {
  return std::index_sequence<(index_of(iterable, elements)::value)...>{};

The problem is this line

  return std::index_sequence<(index_of(iterable, elements)::value)...>{};

Does :: not work with fold expressions?

Maik Klein
Jan 17 2016 21:25
oh nvm it actually returns std::size_t, thought it would return hana::size_t
Jason Rice
Jan 17 2016 23:42
hana::size returns an hana::integral_constant. To get the value from a size_c you can use hana::value(foo) or decltype(foo)::value.