0

I want to do the following:

QThreadStorage<QSharedPointer<sqlite3>> database;

but the editor is reporting a syntax error. Is this not possible?

chacham15
  • 13,719
  • 26
  • 104
  • 207

2 Answers2

4

The problem is that >> at the and of your expression is parsed as a bit-shift operator instead of end of template. It was fixed in c++11 but in previous versions of c++ you need to add a space between angle brackets : QThreadStorage<QSharedPointer<sqlite3> > database;

Alex Telishev
  • 2,264
  • 13
  • 15
0

>> is interpreted as an operator rather than nested generics in pre-C++11.

You'll need to upgrade your compiler, or just leave a space between them, like > >.

segfault
  • 5,759
  • 9
  • 45
  • 66