[#BloombergLP-bdlb-NullableAllocatedValue_PointerBitsPair]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::NullableAllocatedValue&lowbar;PointerBitsPair
:relfileprefix: ../../
:mrdocs:

This is a component&hyphen;private class&period; Do not use&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;nullableallocatedvalue&lowbar;pointerbitspair&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    unsigned int t&lowbar;NUM&lowbar;BITS&gt;
class NullableAllocatedValue&lowbar;PointerBitsPair;
----

== Description

This regular, value&hyphen;semantic class provides a mechanism for storing a number of bit flags in the otherwise unused bits of a pointer to the template parameter class `t&lowbar;TYPE`&period; The number of bits that can be stored is dependent upon the required alignment of the class `t&lowbar;TYPE`&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/2constructor-09.adoc[`NullableAllocatedValue&lowbar;PointerBitsPair`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/clearFlag.adoc[`clearFlag`] 
| Clear the flag specified by `idx`&period; The behavior is undefined unless `idx &lt; t&lowbar;NUM&lowbar;BITS`&period;
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/equal.adoc[`equal`] 
| Return `true` if this object and the specified `other` have the same value, and `false` otherwise&period; Two `NullableAllocatedValue&lowbar;PointerBitsPair` objects have the same value when their pointer and flags are the same&period;
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/getPointer.adoc[`getPointer`] 
| Return the held pointer&period;
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/readFlag.adoc[`readFlag`] 
| Return the value of the flag specified by `idx`&period; The behavior is undefined unless `idx &lt; t&lowbar;NUM&lowbar;BITS`&period;
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/setFlag.adoc[`setFlag`] 
| Set the flag specified by `idx`&period; The behavior is undefined unless `idx &lt; t&lowbar;NUM&lowbar;BITS`&period;
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/setPointer.adoc[`setPointer`] 
| Set the held pointer to the value of the specified `new&lowbar;ptr`&period;
| xref:BloombergLP/bdlb/NullableAllocatedValue_PointerBitsPair/swap.adoc[`swap`] 
| Efficiently exchange the value of this object with the value of the specified `other` object&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/operator_not_eq-0cc.adoc[`operator!&equals;`]
| Return `false` if the specified `lhs` and `rhs` objects have the same value, and `true` otherwise&period; Two `NullableAllocatedValue&lowbar;PointerBitsPair` objects have the same value when their pointer and flags are the same&period;
| xref:BloombergLP/bdlb/operator_eq-05a.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `NullableAllocatedValue&lowbar;PointerBitsPair` objects have the same value when their pointer and flags are the same&period;
| xref:BloombergLP/bdlb/swap-01.adoc[`swap`]
| Exchange the values of the specified `a` and `b` objects&period; This function provides the no&hyphen;throw exception&hyphen;safety guarantee&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
