why is string not declared in scope

前端 未结 3 1680
时光取名叫无心
时光取名叫无心 2020-12-09 03:15

I have the following code:

#include 
#include 

static boost::thread_specific_ptr _tssThreadNameSptr;
         


        
3条回答
  •  萌比男神i
    2020-12-09 03:50

    string is in the std namespace. You have the following options:

    • Write using namespace std; after the include and enable all the std names: then you can write only string on your program.
    • Write using std::string after the include to enable std::string: then you can write only string on your program.
    • Use std::string instead of string

提交回复
热议问题