Skip to content

Instantly share code, notes, and snippets.

@stuartcampbell
Created February 25, 2015 02:41
Show Gist options
  • Select an option

  • Save stuartcampbell/22c809462bdf380d9303 to your computer and use it in GitHub Desktop.

Select an option

Save stuartcampbell/22c809462bdf380d9303 to your computer and use it in GitHub Desktop.
Demo of boost issue for support case 1178175
#include <algorithm>
#include <string>
#include <vector>
#include <boost/lexical_cast.hpp>
int main() {
// Define (and initialise) a string vector
std::vector<std::size_t> intVector;
intVector.push_back(1);
intVector.push_back(2);
intVector.push_back(3);
// Define another string vector
std::vector<std::string> strVector(intVector.size());
std::transform(intVector.begin(), intVector.end(), strVector.begin(),
boost::lexical_cast<std::string, size_t>);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment