beautypg.com

Parameter requirements – HP Integrity NonStop J-Series User Manual

Page 120

background image

Click on the banner to return to the user guide home page.

©Copyright 1996 Rogue Wave Software

Parameter Requirements

In order to use a Tools.h++ template collection class to collect objects of some type T, that type
must satisfy certain minimal requirements. Unfortunately, some compilers may require the
instantiating type or types to be more powerful than should be necessary.

According to the draft C++ standard, a compiler should only instantiate and compile those
template functions that are actually used. Thus, if you avoid calling any member functions, such
as sort(), that require valid less-than semantics, you should still be able to create a collection
class of some type U for which, given instances u1 and u2, the expression (u1 < u2) is
ill-formed. If your compiler does not provide this selective instantiation, you may not be able to
collect objects of type U without implementing operator<(const U&, const U&) for that type.

This manual is related to the following products: