I have the following code:
#include
#include
static boost::thread_specific_ptr _tssThreadNameSptr;
I find that including:
using namespace std;
To your C++ code saves a lot of time in debugging especially in situations like yours where std:: string is required and also it will help in keeping your code clean.
With this in mind, your code should be:
#include <string>
using namespace std;
#include <boost/thread/tss.hpp>
static boost::thread_specific_ptr<string> _tssThreadNameSptr;
You have to use std::string
since it's in the std
namespace.
string
is in the std
namespace. You have the following options:
using namespace std;
after the include and enable all the std
names: then you can write only string
on your program.using std::string
after the include to enable std::string
: then you can write only string
on your program.std::string
instead of string