c++ - 类型转换 PTLib PString -> std::string

标签 c++

如何? 在 PTLib 的文档中:

PString::operator std::string () const [inline]

Cast the PString to a std::string.

我尝试:

m_string= string(m_pstring);
m_string = (string) m_pstring;

但是得到 错误:重载“basic_string(PString&)”的调用不明确

海湾合作委员会版本 4.6.3

最佳答案

m_string = m_pstring.operator std::string();

关于c++ - 类型转换 PTLib PString -> std::string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19208689/

相关文章:

c++ - 跳过规则中的强制性 boost::spirit::qi::attr(0)

c++ - 我卡在自定义链表上

c++ - 在 C++ 中每次生成相同的随机字符

c++ - pthreads : What are the different models of pthread implemenation

c++ - 在 CentOS 7 上部署动态链接的 Qt 5.7 Widgets 应用程序 - 无法打开共享库

c++ - 将字符串操作成变量的名称?

c++ - 我应该使用 UTF-8 通过网络发送数据吗?

c++ - 模板 模板参数

java - Java 库是否具有 C++ 中的 std::lower_bound() 、 std::upper_bound() 之类的函数?

c++ - 每次运行时文件中的连续输出