The C++ String Toolkit Library (Strtk) has the following solution to your problem:
#include
#include
#include
#include "strtk.hpp"
int main()
{
std::string int_string = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15";
std::vector int_list;
strtk::parse(int_string,",",int_list);
std::string double_string = "123.456|789.012|345.678|901.234|567.890";
std::deque double_list;
strtk::parse(double_string,"|",double_list);
return 0;
}
More examples can be found Here