constexpr auto source = " \t \t \t hello there"; auto is_invisible = [](const auto x) { return x == ' ' || x == '\t'; }; auto skip_ws = drop_while_view{source, is_invisible}; for (auto c : skip_ws) { cout << c; // prints hello there with no leading space }