[#BloombergLP-bdlb-IndexSpan]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::IndexSpan
:relfileprefix: ../../
:mrdocs:

A constrained attribute type that represents a position and a length&period; The constraint is that the sum of the position and length attributes must be representable by the `bsl&colon;&colon;size&lowbar;t` type&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;indexspan&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class IndexSpan;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/IndexSpan/size_type.adoc[`size&lowbar;type`] 
| The type of the position and length attributes&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/IndexSpan/2constructor-05.adoc[`IndexSpan`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlb/IndexSpan/isEmpty.adoc[`isEmpty`] 
| Return `true` if the length attribute is 0&semi; and return `false` otherwise&period;
| xref:BloombergLP/bdlb/IndexSpan/length.adoc[`length`] 
| Return the length attribute&period;
| xref:BloombergLP/bdlb/IndexSpan/position.adoc[`position`] 
| Return the position attribute&period;
| xref:BloombergLP/bdlb/IndexSpan/print.adoc[`print`] 
| Format this object to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`&period; If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period;
| xref:BloombergLP/bdlb/IndexSpan/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;IndexSpan, HasPrintMethod&gt;`] 
| Declare that this type is trivially copyable&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/operator_not_eq-07f.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` index span objects do not have the same value, and `false` otherwise&period; Two index span objects do not have the same value if either their position or length attributes do not compare equal&period;
| xref:BloombergLP/bdlb/operator_eq-0b.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` index span objects have the same value, and `false` otherwise&period; Two index span objects have the same value if their position and length attributes compare equal&period;
|===


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