tables::column::any

template <is_valid_primitive P>
bool column<P>::any() const

If P is bool, returns true if at least one element is true.

If P is std::string_view, return true if at least one element is true.

If P is any other primitive type, returns true if at least one element is non-zero.

Complexity

Linear

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_any()
{
  cout << column<bool>({true,false,true}).any() << "\n";
  cout << column<string_view>({"foo","bar",""}).any() << "\n";
  cout << column<unsigned>({0,0,0}).any() << "\n";
}

Output

1
1
0