johnbakers
johnbakers

Reputation: 24760

ostringstream gives me Implicit instantiation error

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>

Upvotes: 25

Views: 16773

Answers (1)

ForEveR
ForEveR

Reputation: 55887

stringstream classes are defined in sstream header, so write

#include <sstream>

and all will be fine.

Upvotes: 61

Related Questions