[#BloombergLP-bslalg-BidirectionalLinkListUtil-insertLinkBeforeTarget]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/BidirectionalLinkListUtil.adoc[BidirectionalLinkListUtil]::insertLinkBeforeTarget
:relfileprefix: ../../../
:mrdocs:

Insert the specified `newNode` before the specified `target` node in the linked list that contains `target`&period; If `target` is 0, then the value of the attributes `nextLink` and `previousLink` of `newNode` is set to 0&period; After successful execution of this function the values of the `previousLink` and `nextLink` attributes of all the links in the list appropriately reflect the operation&period; The behavior is undefined unless `0 &equals;&equals; target&hyphen;&gt;previousLink()` is true or `isWellFormed(target&hyphen;&gt;previousLink(), target)` is true&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;bidirectionallinklistutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
insertLinkBeforeTarget(
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[BidirectionalLink]* newNode,
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[BidirectionalLink]* target);
----


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