Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doubt regarding the member function declaration

Status
Not open for further replies.

glathaa

Programmer
Aug 21, 2002
21
0
0
IN
Hi,

I have seen the following type of declaration stl_map.h file.

...
iterator find(const key_type& __x) { return _M_t.find(__x); }
const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
...

Two member functions are having the same name, but returning two different data types? Is it function overloading? please tell me what it means?

Regards,
Latha.G
 
The second is for const classes. A const class will not be routed to the first definition.
 
What is meant by const class? Can you give a small example for it?

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top