I’m trying to declare the following two functions to put back together a tokenized string (broken up into a vector or other iterator-compatible data structure):
std::string ComposeTokens(std::vector<std::string> Tokens);
std::string ComposeTokens(std::iterator first, std::iterator last);
In the implementation file (not provided here — it’s fairly obvious), Visual Studio’s IntelliSense isn’t recognizing either implementation as valid, saying that both conflict with both declarations. Compiling produces a message that iterators must have a template.
Is there any way to do what I’m trying to, here? Would it work to declare iterator< string >, do I need pointers, etc.? And has the STL or Boost or some other library already done this?
You can use std::accumulate: