开发者

is c++ STL algorithms and containers same across platforms and performance?

开发者 https://www.devze.com 2022-12-22 07:02 出处:网络
A开发者_高级运维fter learning good amount of c++, i\'m now into STL containers and algorithms template library, my major concerns are,

A开发者_高级运维fter learning good amount of c++, i'm now into STL containers and algorithms template library, my major concerns are,

1) Is this library same across different platforms like MS, linux n other os?

2) will quality or efficiency of program c++ module decrease with more use of STL containers and algorithms, i think i can't customize it to all needs.

3) Is this template library good to use in linux system programming, kernel modules?

4) lastly can i use this in programming contests, because it relives a lot of coding and pressure off shoulders.


1) Is this library same across different platforms like MS, linux n other os?

No. Except the standardized interface, the implementations are all different for each compiler suite, and sometimes they also provide custom extensions such as hash_map.

2) will quality or efficiency of program c++ module decrease with more use of STL containers and algorithms, i think i can't customize it to all needs.

I don't think so. The quality and efficiency should be much better than cooking one up by your own, unless you have very special needs.

3) Is this template library good to use in linux system programming, kernel modules?

Better use C for the kernel.

4) lastly can i use this in programming contests, because it relives a lot of coding and pressure off shoulders.

Depends on the rules of the contests.


1) Standard (interface) is the same. Implementation is different.

2) Quality or efficiency of your program depends only on your skills. STL provides you benefits you can use and misuse.

3) Not for kernel modules, yes for user mode applications.

4) Normally C++ contests allow STL.


1) API same. Limiting behavior specified in the standard (e.g. O(n) ). Implementation vendor specific. Means you can rely on the scaling of your app.

2) As long as you have to ask this questions, the quality and efficiency of your code is likey to improve by using the STL.

3) Not in the kernel.

4) C++ constests should allow STL.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号