为什么每个C ++平台都有不同的字符串类? [英] Why is there a different string class in every C++ platform out there?

查看:168
本文介绍了为什么每个C ++平台都有不同的字符串类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然我喜欢用C ++编程,但我讨厌的想法:

std :: basic_string vs QString vs wxString vs .............

不是标准字符串类满足需要对于这些框架?我的意思是标准字符串类有什么问题?

While I like programming in C++, I hate the idea of:
std::basic_string vs QString vs wxString vs .............
Doesn't the standard string class satisfy the needs for these frameworks? I mean what is wrong with the standard string class?!

下面是一个重要的问题:

你在每个要使用的框架中学习框架的字符串类吗?

Just to emphasize, that below is the important question:
Do you learn "the" string class of the framework in every framework you are going to work with? would you instead stick to the standard string class by trying to adapt it everywhere?

感谢...

推荐答案

多个字符串类的原因是C ++标准在1998年最后定稿;然后花费一些时间,直到所有系统实际提供了一个正确的C ++库。到那时,所有这些已经写入的竞争字符串类。

The reason for multiple string classes is that the C++ standard was finalized fairly late (in 1998); it then took some time until all systems actually provided a correct C++ library. By that time, all these competing string classes where already written.

此外,在某些情况下,人们希望从单个基类继承,std :: string不会。

In addition, in some cases, people want to inherit from a single base class, which std::string wouldn't do.

这篇关于为什么每个C ++平台都有不同的字符串类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆