Aug 29, 2024

[C++] ExplicitArgumentBarrier trick to force argument type being deduced during the call.

ExplicitArgumentBarrier used to force caller to have C being deduced instead of explicitly specified.
template <int&... ExplicitArgumentBarrier, typename C>
constexpr auto deref_second_view(C&& map ABSL_ATTRIBUTE_LIFETIME_BOUND) {
  return deref_second_view_t<std::remove_reference_t<C>>(map);
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.