Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ostringstream gives me Implicit instantiation error

Tags:

c++

string

I'm trying the elegant solution provided in this answer but no matter what I try, I cannot get passed the error Implicit instantiation of undefined template for this line:

std::ostringstream strs;

What I need to do? I've included the following, which I'm sure is overkill. As a second question it seems hard to track down what exactly needs to be included for ostringstream:

#include <iostream>
#include <fstream>
#include <iosfwd>
#include <ios>
like image 621
johnbakers Avatar asked Apr 23 '13 10:04

johnbakers


1 Answers

stringstream classes are defined in sstream header, so write

#include <sstream>

and all will be fine.

like image 148
ForEveR Avatar answered Oct 22 '22 18:10

ForEveR