Looking at the documentation for std::forward
,
template< class T >
constexpr T&& forward( typename std::remove_reference<T>::type& t ) noexcept;
template< class T >
constexpr T&& forward( typename std::remove_reference<T>::type&& t ) noexcept;
Both functions return T&&
, which (correct me if I'm wrong) collapses to
T&
if T
is an lvalue referenceT&&
if T
is an rvalue reference, or if T
is not a referenceFor an arbitrary type T
which may be a reference, does reference collapsing always cause forward<T>
to do the same as forward<T&&>
?
If so, is there any reason to use forward<T&&>
?
Forward points are often quoted in numbers, such as +13.2 or minus -270.68. These represent 1/10,000, so +13.2 means 0.00132 when added to a currency spot price.
Forward rate. A projection of future interest rates calculated from either spot rates or the yield curve. For example, suppose the one-year government bond was yielding 2% and the two-year bond was yielding 4%. The one year forward rate represents the one-year interest rate one year from now.
forward price = spot price − cost of carry. The future value of that asset's dividends (this could also be coupons from bonds, monthly rent from a house, fruit from a crop, etc.) is calculated using the risk-free force of interest.
A forward exchange contract (FEC) is a special type of over-the-counter (OTC) foreign currency (forex) transaction entered into in order to exchange currencies that are not often traded in forex markets. These may include minor currencies as well as blocked or otherwise inconvertible currencies.
Does reference collapsing always cause
forward<T>
to do the same asforward<T&&>
?
Yes.
[I]s there any reason to use
forward<T&&>
?
No.
Note that this is assuming that the only forward
s in view are the two overloads you showed in std::
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With