#include <iostream>
#include <vector>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/range/adaptor/transformed.hpp>
int main() {
const std::string input_string = "Hello world! String with spaces.";
std::vector<std::string> words;
boost::split(words, input_string, boost::algorithm::is_any_of(" "), boost::algorithm::token_compress_on);
std::cout << "{"
<< boost::algorithm::join(words | boost::adaptors::transformed([](auto &s){return "\"" + s + "\"";}), ", ")
<< "}"
<< std::endl;
return 0;
}
if ((!words.empty() && words.find(word) != words.end() && word_str != words.end()->first) || std::string(word) == words.end()->first)