Skip to content

Commit

Permalink
Added agg::count()
Browse files Browse the repository at this point in the history
Also, reformatted
  • Loading branch information
tedmiddleton committed Jul 21, 2022
1 parent 2cdce8e commit d967269
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 257 deletions.
1 change: 0 additions & 1 deletion mainframe/base.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright Ted Middleton 2022.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Expand Down
1 change: 0 additions & 1 deletion mainframe/base.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright Ted Middleton 2022.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Expand Down
1 change: 0 additions & 1 deletion mainframe/expression.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright Ted Middleton 2022.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Expand Down
1 change: 0 additions & 1 deletion mainframe/frame.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright Ted Middleton 2022.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Expand Down
69 changes: 34 additions & 35 deletions mainframe/frame_iterator.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright Ted Middleton 2022.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Expand Down Expand Up @@ -829,41 +828,41 @@ using const_reverse_frame_iterator = base_frame_iterator<true, true, Ts...>;

namespace std
{
template<bool IsConst, typename... Ts>
struct hash<mf::_base_frame_row<IsConst, Ts...>>
{
template<size_t Ind=0>
size_t
operator()(const mf::_base_frame_row<IsConst, Ts...>& fr) const
{
using T = typename mf::detail::pack_element<Ind, Ts...>::type;
std::hash<T> hasher;
mf::columnindex<Ind> ci;
size_t out = hasher(fr.at( ci ));
if constexpr (Ind + 1 < sizeof...(Ts)) {
out ^= operator()<Ind + 1>(fr);
}
return out;
}
};

template<bool IsConst, typename... Ts>
struct hash<mf::_row_proxy<IsConst, Ts...>>
{
template<size_t Ind=0>
size_t
operator()(const mf::_row_proxy<IsConst, Ts...>& fr) const
{
using T = typename mf::detail::pack_element<Ind, Ts...>::type;
std::hash<T> hasher;
mf::columnindex<Ind> ci;
size_t out = hasher(fr.at( ci ));
if constexpr (Ind + 1 < sizeof...(Ts)) {
out ^= operator()<Ind + 1>(fr);
}
return out;
template<bool IsConst, typename... Ts>
struct hash<mf::_base_frame_row<IsConst, Ts...>>
{
template<size_t Ind = 0>
size_t
operator()(const mf::_base_frame_row<IsConst, Ts...>& fr) const
{
using T = typename mf::detail::pack_element<Ind, Ts...>::type;
std::hash<T> hasher;
mf::columnindex<Ind> ci;
size_t out = hasher(fr.at(ci));
if constexpr (Ind + 1 < sizeof...(Ts)) {
out ^= operator()<Ind + 1>(fr);
}
};
return out;
}
};

template<bool IsConst, typename... Ts>
struct hash<mf::_row_proxy<IsConst, Ts...>>
{
template<size_t Ind = 0>
size_t
operator()(const mf::_row_proxy<IsConst, Ts...>& fr) const
{
using T = typename mf::detail::pack_element<Ind, Ts...>::type;
std::hash<T> hasher;
mf::columnindex<Ind> ci;
size_t out = hasher(fr.at(ci));
if constexpr (Ind + 1 < sizeof...(Ts)) {
out ^= operator()<Ind + 1>(fr);
}
return out;
}
};
} // namespace std

#endif // INCLUDED_mainframe_frame_iterator_h
Loading

0 comments on commit d967269

Please sign in to comment.