tables::column::all

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

If P is bool, returns true if all elements are true.

If P is std::string_view, return true if all elements are not empty.

If P is any other primitive type, returns true if all elements are non-zero.

Complexity

Linear

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_all()
{
  cout << column<bool>({true,false,true}).all() << "\n";
  cout << column<string_view>({"foo","bar",""}).all() << "\n";
  cout << column<unsigned>({10,20,30}).all() << "\n";
}

Output

0
0
1