BDE 4.14.0 Production release
|
Provide a function that creates a pair of references.
bdlb::PairUtil::tie
functionThis component provides the class bdlb::PairUtil
, which has a single static member function, tie
, which is intended to be used in place of bsl::tie
when the right-hand side of the assignment is a bsl::pair
.
This section illustrates intended use of this component.
Suppose we need to implement a function that takes a bsl::map
and stores into out-parameters the key and value corresponding to the first entry in the map. Using bsl::map
s container interface, we can obtain a reference to a bsl::pair
of the key and value. We can then use bdlb::PairUtil::tie
to assign from both the key and value in a single expression: