Online Generic Data Ordering Wizard (for C++)
 
">
Type of ordering
> Ascending > Descending Created by Jim Xochellis
Functor name
Parameter type > Const reference
Member variables
or methods
  


Overview Usage Instructions STL compatibility Interesting Q&A

Have you ever tried to use any of the notable std::sort, std::merge or std::lower_bound STL algorithms for processing custom structures or classes? Have you ever tried to use STL associative containers, like the std::set or the std::map, for storing your own data types? Or maybe, do you feel that the implementation of the function objects, (functors) the lambda expressions, or the custom C++ operators should be less tedious, cumbersome and error-prone? If your answer to any of these questions is positive, chances are that this tool will interest you.

The C++ compilers do not automatically handle the ordering of custom classes or structures, while at the same time, data ordering is being widely used by a plethora of generic C++ components (i.e. template classes, structures and functions). Therefore, many generic C++ components, including some of the most notable STL algorithms and containers, often fail to work with user-made classes or structures out-of-the-box, because they cannot order this kind of data without additional programming effort. The typical solution for these issues is to create an adequate function object (functor), lambda function or custom operator, and use it to assist the generic code in ordering the particular custom data type. However, the manual creation of these functors, lambdas and custom operators is a rather cumbersome, tedious and relatively error-prone programming task.

Fortunately, this Online Generic Data Ordering Wizard can simplify the previously cumbersome and error-prone generic data ordering so much, that most data ordering tasks in generic C++ programming can now become as easy as filling a three-field form. At the same time, this tool allows us to enjoy the benefits of some very useful functors, lambdas and custom operators, without having to worry about their (rather cumbersome) implementation and without investing time in learning and mastering them.