What are the most F.A.Q. on this forum?

Pages: 1... 345
The boost::iequals() function fails for multi-character conversions.

Updated http://cplusplus.com/faq/sequences/sequencing/sort-stuff/ with a fairly-modified version of Albatross's submission.
Last edited on
sorting:
The elements need to be comparable. The functor option is there, but 'overload operator<' is missing.

I think that stable_sort deserves a reference.
The same examples can be used:
__ first we sort lexicographically, then by the length *
__ first by order, then if they are odd or even

The same about make_heap, sort_heap

¿What about the yo-yo treesort(set) and heapsort(priority_queue) ? Maybe it should be a mention of 'choose the right structure'


* Too bad that in the example, sort looks stable
@ne555
You're right. stable_sort definitely deserves a reference. We'll see what can be done about that.

As for overload operator<, I chose not to mention that option because of how easily it can be abused. That's mainly why.

As for the different sorting algorithms (I take it that was your complaint? That we didn't mention them?), that's for the /faq/sort-algorithms "Sort stuff myself?" section. ;)

-Albatross
Oh, yeah, Albatross, I forgot to send you back the source text of the section if you wanted to tweak it more... Shall I?
Mmm... no thanks. Aside from the reference to stable sort, I can't see anything I'd really like to change. One of these days, though, I'll need to write a script to extract the cplusplusML (I can't think of anything better to call it) text from the page's HTML code. >_>

-Albatross
Last edited on
Alright. I am revisiting the sort page now...

I disagree about the < operator abuse problem. Sure, it can be abused -- any operator that can be overloaded can be abused -- but that cannot trump the whole point of lexical comparitors.

The purpose of the < operator is to provide a default comparitor, while the purpose of the std::sort() functor is to sort using a comparitor other than the default.

I haven't had a chance to look through the "sort stuff myself" stuff yet... I hope to get there sometime this weekend. Right now I'm playing with passing N-dimensional arrays to functions.


Also, I've updated the SizeOfArray FAQ: http://cplusplus.com/faq/sequences/arrays/sizeof-array/

[edit]
Finished updating the sort page. I think this is the final version. Any thoughts?
http://cplusplus.com/faq/sequences/sequencing/sort-stuff/
Last edited on
Alright, I had some surgery this week so I haven't gotten too much done... In addition to the last post (sizeof array and sort stuff), I have updated the Introduction page significantly.

http://cplusplus.com/faq/intro/
http://cplusplus.com/faq/intro/#boost-libraries
http://cplusplus.com/faq/intro/#gui

I would like some help writing the examples/compiler tests for
http://cplusplus.com/faq/intro/#supports-cpp11
http://cplusplus.com/faq/intro/#supports-ctor-inheritance
http://cplusplus.com/faq/intro/#supports-variadic-templates
I don't care if you yoink them from somewhere else, just let me know where so I can properly attribute its original source.

@Albatross
I haven't forgotten your sorting page -- I just haven't gotten there yet. Gotta go and feed my kids now. :O)
Can we have "Just how wrong is void main()?" :)
That's number 61 under Language and Style.
http://cplusplus.com/forum/lounge/60389/#msg326397

I'm planning just to post a couple of links to answer that one, since it has been thoroughly answered elsewhere, since at least 1990.


[edit] I'm still having trouble coming up with a non-trivial, but short-and-sweet example for auto, lambda, rvalue references, and static_assert().
Last edited on
Bwa-ha-ha-ha-ha-ha!
I think I got a good example using rvalue references!
http://cplusplus.com/faq/intro/#supports-cpp11
Topic archived. No new replies allowed.
Pages: 1... 345