?
Solved

stl sort function

Posted on 2011-09-14
3
Medium Priority
?
376 Views
Last Modified: 2012-08-14
Hi,

I am trying to find the stl's sort function code. Is there any available. The only one I can find is the .h files.

Thanks,
0
Comment
Question by:zizi21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 1200 total points
ID: 36540979
Hi zizi21,

the 'sort' function is implemented in header <algorithm>. There aren't further source files since as it's implemented as function template it has to be implemented in the header.

ZOPPO
0
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 800 total points
ID: 36541012
There is no standard implementation. All the C++ standard does is define what sort must do but how it's implemented is up to the vendor. More often than not sort is implemented as a quick sort (but it doesn't have to be).
0
 

Author Closing Comment

by:zizi21
ID: 36546975
Thanks a million.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question