tables::column::eq,ne
1)
template<is_primitive_type P>
inline
column<bool_t>
column<P>::eq(const column<P>& rhs) const
2)
template<is_primitive_type P>
inline
column<bool_t>
column<P>::eq(const P cte) const
3)
template<is_primitive_type P>
inline
column<bool_t>
column<P>::ne(const column<P>& rhs) const
4)
template<is_primitive_type P>
inline
column<bool_t>
column<P>::ne(const P cte) const
1 and 2) Returns column-of-bools containing column-wise equality comparison between this and rhs
columns or between this and cte
value.
3 and 4) Returns column-of-bools containing column-wise inequality comparison between this and rhs
columns or between this and cte
value.
Example
Code
#include <cpptables/table.hh>
using namespace tables;
using namespace std;
void column_eq_ne()
{
const column<unsigned> c0({ 1, 2, 3, 4 ,5});
const column<unsigned> c1({ 1, 2, 3, 0, 0});
{
const column<bool> r0 = c0.eq(c1); // same as c0 == c1
cout << r0 << "\n";
const column<bool> r1 = c0.ne(c1); // same as c0 != c1
cout << r1 << "\n";
}
{
const column<bool> r0 = c0.eq(3); // same as c0 == 3
cout << r0 << "\n";
const column<bool> r1 = c0.ne(3); // same as c0 != 3
cout << r1 << "\n";
}
}