#include <eve/module/core.hpp>
#include <eve/module/algo.hpp>
#include <string>
#include <span>
#ifdef __SSSE3__
void remove_spaces(std::string& s)
{
std::span s_bytes{reinterpret_cast<std::uint8_t*>(s.data()), s.size()};
s_bytes,[](u8x16 v) -> eve::logical<u8x16> {
__m128i lut = _mm_setr_epi8(' ', 0, 0, 0,
0, 0, 0, 0,
0, '\t', '\n', 0,
0, '\r', 0, 0);
return v == u8x16{_mm_shuffle_epi8(lut, v)};
});
auto offset = end - s_bytes.begin();
s.erase(s.begin() + offset, s.end());
}
#endif