So I have a perfect forwarder, and I want to appropriately capture it in a lambda, such that R-values are copied in, and L-values are captured by reference. However simply
You may use the following:
[test = std::conditional_t< std::is_lvalue_reference::value, std::reference_wrapper>, T>{std::forward(t)}]
Live Demo
but providing helper function seems more readable