Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forward headers for STL containers

The header <iostream> has a companion <iosfwd> which is sufficient if I only need pointers or references to streams. The latter is a common scenario when overloading operator<<.

Is there such a header for the STL containers? I want to define a couple of functions that take references to STL containers, and I do not want to include <vector>, <list>, <set> et. al. in their entirety just so I can have references to those types. Are there standard, boost or other solutions to this problem?

like image 882
fredoverflow Avatar asked Nov 17 '10 18:11

fredoverflow


1 Answers

Is there such a header for the STL containers?

No, there isn't.

Are there standard, boost or other solutions to this problem?

Not that I know of.

You will have to include those headers.

like image 168
sbi Avatar answered Oct 01 '22 20:10

sbi