Is std::regex thread safe?

后端 未结 2 1794
时光取名叫无心
时光取名叫无心 2021-01-05 00:21

Related to Is a static boost::wregex instance thread-safe? but for the standarized version. Can I call regex_search from several threads with the same regex object?

2条回答
  •  一个人的身影
    2021-01-05 00:31

    While Sean's answer is true of the standard, individual implementation may fall short. VC++ 2013, at least, looks like it has race conditions in its copy constructor and in a lazily evaluated variable.

提交回复
热议问题