Provide common non-primitive operations on bdlc::PackedIntArray
.
More...
Namespaces |
namespace | bdlc |
Detailed Description
- Outline
-
-
- Purpose:
- Provide common non-primitive operations on
bdlc::PackedIntArray
.
-
- Classes:
-
- See also:
- Component bdlc_packedintarray
-
- Description:
- This component provides a
struct
, bdlc::PackedIntArrayUtil
, that serves as a namespace for utility functions that operate on bdlc::PackedIntArray
objects.
- The following list of methods are provided by
bdlc::PackedIntArrayUtil
: 'isSorted' Returns 'true' if the range from a
'bdlc::PackedIntArray' is sorted, and 'false' otherwise.
'lowerBound' Returns an iterator to the first element in a sorted
range from a 'bdlc::PackedIntArray' that compares
greater than or equal to a specified value.
'upperBound' Returns an iterator to the first element in a sorted
range from a 'bdlc::PackedIntArray' that compares
greater than a specified value.
-
- Usage:
- This section illustrates intended use of this component.
-
- Example 1: lowerBound:
- Suppose that given a sorted
bdlc::PackedIntArray
, we want to find the first value greater than or equal to the value 17. First, create and populate with sorted data the bdlc::PackedIntArray
to be searched: Then, verify the array's data has sorted values: Finally, use bdlc::PackedIntArrayUtil::lowerBound
to find the desired value: