Lars, what the fuck have you done to getVectorFromString?

        vector<string> const authors = getVectorFromString(author, " and ");

        vector<string>::const_iterator cit = authors.begin();
        vector<string>::const_iterator end = authors.end();
        for (; cit != end; ++cit) {
                std::cerr << "*it = \"" << *cit << '\"' << std::endl;
        }

author = "J.P. Butler and A. Tsuda"
*it = "J.P."
*it = "Butler"
*it = "A."
*it = "Tsu"

author = "A. Wonhas and J.C. Vassilicos"
*it = "A."
*it = "Wo"
*it = "h"
*it = "s"
*it = "J.C."
*it = "V"
*it = "ssilicos"

I think that this test confirms that this:

vector<string> const getVectorFromString(string const & str,
                                         string const & delim)
{
        boost::char_separator<char> sep(delim.c_str());
        boost::tokenizer<boost::char_separator<char> > tokens(str, sep);
        return vector<string>(tokens.begin(), tokens.end());
}

is absolutely, totally, buggered.

Angus

Reply via email to