Приложение застревает с E / com.facebook.internal.AttributionIdentifiers [duplicate]

Я знаю, что тема довольно старая, но она показана в верхних ссылках в google при поиске «boost tokenizer по строке»

, поэтому я добавлю свой вариант TokenizerFunction, на всякий случай:

class FindStrTFunc
{
public:
    FindStrTFunc() : m_str(g_dataSeparator)
    {
    }

    bool operator()(std::string::const_iterator& next,
        const std::string::const_iterator& end, std::string& tok) const
    {
        if (next == end)
        {
            return false;
        }
        const std::string::const_iterator foundToken =
            std::search(next, end, m_str.begin(), m_str.end());
        tok.assign(next, foundToken);
        next = (foundToken == end) ? end : foundToken + m_str.size();
        return true;
    }

    void reset()
    {
    }

private:
    std::string m_str;
};

после того, как мы сможем создать

boost::tokenizer<FindStrTFunc> tok("some input...some other input");

и использовать, как обычный повышающий токенизатор

22
задан InsaneCat 31 August 2018 в 11:09
поделиться