Are these C ++ STL algorithms and containers the same for platforms and performance?

After learning a good amount of C ++, I am now in the library of STL templates and algorithms, my main problems:

1) Is this library the same on different platforms such as MS, linux n other os?

2) whether the quality or effectiveness of the C ++ module program will decrease with more use of containers and STL algorithms, I think I can’t configure it for all needs.

3) Is this template library used for use in Linux system programming, kernel modules?

4) Finally, I can use this in programming contests, because he is going through a lot of coding and pressure from the shoulders.

+4
source share
3 answers

1) Is this library the same on different platforms such as MS, linux n other os?

Not. With the exception of the standardized interface, the implementations are all different for each set of compilers, and sometimes they also provide custom extensions, such as hash_map .

2) whether the quality or effectiveness of the C ++ module program will decrease with more use of containers and STL algorithms, I think I can’t configure it for all needs.

I do not think so. Quality and efficiency should be much better than cooking on your own unless you have special needs.

3) Is this template library used for use in Linux system programming, kernel modules?

Better use C for the kernel.

4) Finally, I can use this in programming contests, because he is going through a lot of coding and pressure from the shoulders.

Depends on the rules of the competition.

+5
source

1) The standard (interface) is the same. The implementation is different.

2) The quality or effectiveness of your program depends only on your skills. STL provides you with benefits that you can use and abuse.

3) Not for kernel modules, but for user-mode applications.

4) Usually C ++ competitions allow the use of STL.

+4
source

1) API. The limit behavior specified in the standard (for example, O (n)). Vendor implementation. So you can count on scaling your application.

2) While you need to ask these questions, the quality and effectiveness of your code is best improved with STL.

3) Not in the core.

4) C ++ constants must allow STL.

+3
source

Source: https://habr.com/ru/post/1303677/


All Articles