STL header files vs non-STL header files 
Author Message
 STL header files vs non-STL header files

hi,

what is the difference between STL header files like <math> and non-STL
header files like <math.h> ?
I read somewhere that STL header files MUST be included rather than non-STL
header files.

thanks



Wed, 02 Jan 2002 03:00:00 GMT  
 STL header files vs non-STL header files
1. I suppose you mean <cmath>, not <math>.
2. It is recommended (in theory) to include <csomething> headers instead of
<something.h> because <csomething> headers are supposed to use namespace
std, so one can use std::sqrt() instead of sqrt().
3. In practice, assuming you're using the VC implementation of the Standard
C++ library, I wouldn't recommend you using <csomething> headers because
currently they don't enclose anything into namespace std. So it's better to
stick with <math.h> etc for a while.

BTW, <cmath> is not a part of STL, it's a part of Standard C++ library (I
recall many flames in comp.std.c++).



Quote:
> hi,

> what is the difference between STL header files like <math> and non-STL
> header files like <math.h> ?
> I read somewhere that STL header files MUST be included rather than
non-STL
> header files.

> thanks



Fri, 04 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Warnings from Microsoft's STL header files in VC++ 6.0 SP2

2. Location of STL Header Files

3. C Header files including header files, mutually referencing typedefs

4. header in header files

5. Header files shall not #include any other headers

6. #ifndef/#ifdef problems in my header file (conditional header inclusion)

7. WMF Header Scale ratio vs Aldus Header

8. VC7.1: Internal compiler error in STL headers

9. Public vs Private header files

10. Cpp vs header files

11. STL headers & numerous compiler-warnings

12. C vs C++ header files

 

 
Powered by phpBB® Forum Software