ACE_Utils::Comparator< LEFT, RIGHT > Struct Template Reference

Structure that provides optimal comparison operation for given types. More...

#include <Truncate.h>

List of all members.

Public Types

typedef ACE::If_Then_Else
< Fast_Comparator< LEFT, RIGHT >
::USABLE, Fast_Comparator
, Safe_Comparator< LEFT, RIGHT,
Sign_Check< LEFT >::is_signed,
Sign_Check< RIGHT >::is_signed >

Detailed Description

template<typename LEFT, typename RIGHT>
struct ACE_Utils::Comparator< LEFT, RIGHT >

Structure that provides optimal comparison operation for given types.

The comparison operations provided by this structure are chosen at compile time based on the signs and sizes of types being compared.

Comparisons of values with the same sign or those with types that can be promoted safely are done quickly, without any range checking.
Comparisons of values of different types that cannot be safely promoted incur an additional check for a negative value to allow the compiler to perform the appropriate implicit unsigned type promotion.
In general, the operations found in this structure should not be used to work around compiler diagnostics regarding comparison of signed and unsigned types. Verify that your types are correct before relying on those operations.

For internal use only.

This structure is not meant for general use.

Member Typedef Documentation

template<typename LEFT, typename RIGHT>
typedef ACE::If_Then_Else< Fast_Comparator<LEFT, RIGHT>::USABLE, Fast_Comparator<LEFT, RIGHT>, Safe_Comparator<LEFT, RIGHT, Sign_Check<LEFT>::is_signed, Sign_Check<RIGHT>::is_signed> >::result_type ACE_Utils::Comparator< LEFT, RIGHT >::comp_type

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

Generated on Wed Apr 23 02:44:12 2008 for ACE by  doxygen 1.5.5