简体   繁体   English

哪个 STL 容器适合存储数百万用户定义(类)数据?

[英]Which STL Container will be good to store millions of user define(class) data?

Suppose we've millions of custom data that need to be stored and search later these which STL will be good?假设我们有数以百万计的自定义数据需要存储,稍后搜索这些 STL 哪个好? let's say比方说

class A{ 
    public:
      int i;
      float f;
      string s;
};

We need to to store the objects of class A.我们需要存储 class A 的对象。

Which STL Container will be good to store millions of user define(class) data?哪个 STL 容器适合存储数百万用户定义(类)数据?

All of them, except for std::array .所有这些,除了std::array

and search later稍后搜索

Depends on the kind of searching.取决于搜索的类型。 The associative containers have efficient lookup operations.关联容器具有高效的查找操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM