std::tie (3) - Linux Manuals
std::tie: std::tie
NAME
Synopsis
Defined in header <tuple>
template< class... Types > (since C++11)
tuple<Types&...> tie( Types&... args ) noexcept; (constexpr since C++14)
Creates a tuple of lvalue references to its arguments or instances of std::ignore.
Parameters
args - zero or more lvalue arguments to construct the tuple from
Return value
A std::tuple object containing lvalue references.
Possible implementation
Notes
std::tie may be used to unpack a std::pair because std::tuple has a converting_assignment from pairs:
Example
std::tie can be used to introduce lexicographical comparison to a struct or to unpack a tuple:
// Run this code
Output:
See also
make_tuple (function template)
forward_as_tuple (function template)
tuple_cat (function template)
ignore (constant)