TQPair is a TQt implementation of an STL-like pair. It can be used in your application if the standard pair<> is not available on your target platforms.
TQPair<T1, T2> defines a template instance to create a pair of values that contains two values of type T1 and T2. Please note that TQPair does not store pointers to the two elements; it holds a copy of every member. This is why these kinds of classes are called \fIvalue based\fR. If you're interested in \fIpointer based\fR classes see, for example, TQPtrList and TQDict.
TQPair holds one copy of type T1 and one copy of type T2, but does not provide iterators to access these elements. Instead, the two elements (\fCfirst\fR and \fCsecond\fR) are public member variables of the pair. TQPair owns the contained elements. For more relaxed ownership semantics, see TQPtrCollection and friends which are pointer-based containers.
Some classes cannot be used within a TQPair: for example, all classes derived from TQObject and thus all classes that implement widgets. Only "values" can be used in a TQPair. To qualify as a value the class must provide:
Note that C++ defaults to field-by-field assignment operators and copy constructors if no explicit version is supplied. In many cases this is sufficient.