[#BloombergLP-bdlb-TopologicalSortUtil-sort-07] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/TopologicalSortUtil.adoc[TopologicalSortUtil]::sort :relfileprefix: ../../../ :mrdocs: `sort` overloads == Synopses Declared in `<bdlb_topologicalsortutil.h>` Sort nodes into topological order given edge relations. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class NODE_TYPE> static bool xref:BloombergLP/bdlb/TopologicalSortUtil/sort-04.adoc[sort]( xref:bsl/vector-00d.adoc[bsl::vector<NODE_TYPE>]* result, xref:bsl/vector-00d.adoc[bsl::vector<NODE_TYPE>]* unsorted, xref:bsl/vector-00d.adoc[bsl::vector<bsl::pair<NODE_TYPE, NODE_TYPE>>] const& relations); ---- [.small]#xref:BloombergLP/bdlb/TopologicalSortUtil/sort-04.adoc[_» more..._]# Sort input edges into topological order via output iterators. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class INPUT_ITER, class OUTPUT_ITER, class UNSORTED_OUTPUT_ITER> static bool xref:BloombergLP/bdlb/TopologicalSortUtil/sort-03.adoc[sort]( INPUT_ITER relationsBegin, INPUT_ITER relationsEnd, OUTPUT_ITER resultOutIter, UNSORTED_OUTPUT_ITER unsortedOutIter); ---- [.small]#xref:BloombergLP/bdlb/TopologicalSortUtil/sort-03.adoc[_» more..._]# == Return Value `true` if the sort succeeds, and `false` if a cycle is found == Parameters [cols="1,4"] |=== | Name| Description | *result* | destination for the ordered nodes | *unsorted* | destination for nodes left unsorted on failure | *relations* | directed edges (U, V) where U precedes V | *relationsBegin* | beginning of the input edge range | *relationsEnd* | end of the input edge range | *resultOutIter* | output iterator for the ordered nodes | *unsortedOutIter* | output iterator for unsorted nodes on failure |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#