Barry::NamedFieldCmp< RecordT > Class Template Reference
[GenericFieldHandles]

A comparison functor, intended to be used in std::sort(), which allows sorting by a particular record's member variable, selected by string name. More...

#include <recordtmpl.h>

Collaboration diagram for Barry::NamedFieldCmp< RecordT >:
Collaboration graph
[legend]

List of all members.


Detailed Description

template<class RecordT>
class Barry::NamedFieldCmp< RecordT >

A comparison functor, intended to be used in std::sort(), which allows sorting by a particular record's member variable, selected by string name.

eg. It allows you to sort a vector of Contact records by Name, HomeAddress, WorkPhone, or Company name, etc.

This template takes the record type as template argument, and works with only that record type.

If the given name is not found the FieldHandles for RecordT, this class will throw a std::logic_error exception.

Definition at line 105 of file recordtmpl.h.


The documentation for this class was generated from the following file: