[#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. The constraint is that the sum of the position and length attributes must be representable by the `bsl::size_t` type. == Synopsis Declared in `<bdlb_indexspan.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class IndexSpan; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlb/IndexSpan/size_type.adoc[`size_type`] | The type of the position and length attributes. |=== == 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; and return `false` otherwise. | xref:BloombergLP/bdlb/IndexSpan/length.adoc[`length`] | Return the length attribute. | xref:BloombergLP/bdlb/IndexSpan/position.adoc[`position`] | Return the position attribute. | 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`. If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. | xref:BloombergLP/bdlb/IndexSpan/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<IndexSpan, HasPrintMethod>`] | Declare that this type is trivially copyable. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlb/operator_not_eq-07f.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` index span objects do not have the same value, and `false` otherwise. Two index span objects do not have the same value if either their position or length attributes do not compare equal. | xref:BloombergLP/bdlb/operator_eq-0b.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` index span objects have the same value, and `false` otherwise. Two index span objects have the same value if their position and length attributes compare equal. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#