![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist
Join Date: Sep 2005
Posts: 259
Rep Power: 3
![]() |
'max_element()' without <algorithm> (Dev-C++)
Hi,
I'm using Dev-C++ and have noticed that I can use some functions such as: ''max_element()' and 'tolower()' -- without including their header file 'algorithm', 'cctype' ect. Can anyone explain the reason for this? |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
It's assuming you are using the standard library, which you are.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#3 |
|
Hobbyist
Join Date: Sep 2005
Posts: 259
Rep Power: 3
![]() |
Then should I still #include these header files?
|
|
|
|
|
|
#4 |
|
Newbie
|
Yes, you should. This is compiler-dependent, if I'm not mistaken.
__________________
«Don't touch what you can't grab!» |
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Some declarations are present in more than one header file. Some header files are included in other header files. The documentation for the function will normally give you all the information you need. Zirener is correct -- you should not rely on non-standard defaults.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#6 |
|
Hobbyist
Join Date: Sep 2005
Posts: 259
Rep Power: 3
![]() |
OK, thanks a lot guys.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|