Find longest lines from a file
This is a bug:

else if( record.size() &gt; hash_table.rbegin()-&gt;second.size() )


As implemented, insertion stops once your program encounters the longest line in the file.

For example, suppose the input contains:




2
abcdefghijklmop
a
ab
abc
abcd



Your program will output:


abcdefghijklmop
a



The fix is simple: Change rbegin to begin.



Another potential issue is your use of a std::map as opposed to some other container. Your concept is fine, but not necessarily for "I'm the best hacker!" type sites that place strong emphasis on execution time. A vector-based solution could be faster. With the red-black tree-based hash, search, insertion, and delete are \$O(log n)\$ (but with large constants). With a vector-based solution, search would be \$O(log n)\$ (but potentially much faster than a red-black search), deleting the tail is \$O(1)\$ (which is a big win), but insertion is \$O(n)\$ (which is of course a big loss). However, for small enough values of n, a fast \$O(n)\$ algorithm can and will beat a slow \$O(log n)\$ algorithm.

One last remark: Rather than your void print() member, a stream insertion operator would be more C++-like:



class fixed_hash
{
    ...
    friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const fixed_hash&amp; hash);
    ...
};

std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const fixed_hash&amp; hash)
{
    auto end = std::rend(hash.hash_table);
    for( auto it = std::rbegin(hash.hash_table); it != end ; ++it )
    {
        os &lt;&lt; it-&gt;second &lt;&lt; "\n";
    }
    return os;
}