Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

After 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.

like image 676
Abhilash Muthuraj Avatar asked Dec 17 '22 02:12

Abhilash Muthuraj


2 Answers

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.

like image 98
kennytm Avatar answered Dec 30 '22 23:12

kennytm


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.

like image 31
alexkr Avatar answered Dec 31 '22 00:12

alexkr