mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 22:19:14 +08:00
Merge pull request #13745 from smirnov-alexey:gapi_add_gout_overloading
* Add GOut overloading for tuple of parameter pack * Move getGOut_impl into namespace and add const to input references
This commit is contained in:
parent
315e7fbbee
commit
766fd20faa
@ -76,6 +76,30 @@ template<typename... Ts> inline GProtoOutputArgs GOut(Ts&&... ts)
|
||||
return GProtoOutputArgs(detail::packArgs(std::forward<Ts>(ts)...));
|
||||
}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
// Extract elements form tuple
|
||||
// FIXME: Someday utilize a generic tuple_to_vec<> routine
|
||||
template<typename... Ts, int... Indexes>
|
||||
static GProtoOutputArgs getGOut_impl(const std::tuple<Ts...>& ts, detail::Seq<Indexes...>)
|
||||
{
|
||||
return GProtoOutputArgs{ detail::packArgs(std::get<Indexes>(ts)...)};
|
||||
}
|
||||
}
|
||||
|
||||
template<typename... Ts> inline GProtoOutputArgs GOut(const std::tuple<Ts...>& ts)
|
||||
{
|
||||
// TODO: think of std::forward(ts)
|
||||
return detail::getGOut_impl(ts, typename detail::MkSeq<sizeof...(Ts)>::type());
|
||||
}
|
||||
|
||||
// Takes rvalue as input arg
|
||||
template<typename... Ts> inline GProtoOutputArgs GOut(std::tuple<Ts...>&& ts)
|
||||
{
|
||||
// TODO: think of std::forward(ts)
|
||||
return detail::getGOut_impl(ts, typename detail::MkSeq<sizeof...(Ts)>::type());
|
||||
}
|
||||
|
||||
// Extract run-time arguments from node origin
|
||||
// Can be used to extract constant values associated with G-objects
|
||||
// (like GScalar) at graph construction time
|
||||
|
Loading…
Reference in New Issue
Block a user