Sort the elements of NODE_TYPE in topological order determined by the specified relations and load the resulting linear ordered set to the specified result. If the sort is unsuccessful, load the elements that have not been ordered to the specified unsorted list. The input relations are provided as pairs of the form (U, V) where U precedes V in the output. Return false if sort fails due to a cycle in the input else return true if sort successful. Note that even if the method returns false, result may contain a subset of elements in the right topological order, essentially elements that the routine was able to sort before the cycle was discovered and unsorted will contain the elements that the routine was unable to sort.
Synopsis
Declared in <bdlb_topologicalsortutil.h>
template<class NODE_TYPE>
static
bool
sort(
bsl::vector<NODE_TYPE>* result,
bsl::vector<NODE_TYPE>* unsorted,
bsl::vector<bsl::pair<NODE_TYPE, NODE_TYPE>> const& relations);
Created with MrDocs