ACE  6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | List of all members
ACE_Utils::Comparator< LEFT, RIGHT > Struct Template Reference

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

#include <Truncate.h>

Public Types

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 
comp_type
 

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.
Note
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.

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: