Is there a reason declval returns add_rvalue_reference instead of add_lvalue_reference
With add_rvalue_reference: declval<Foo>() is of type Foo&&. declval<Foo&>() is of type Foo& (reference collapsing: “Foo& &&” collapses to Foo&). declval<Foo&&>() is of type Foo&& (reference collapsing: “Foo&& &&” collapses to Foo&&). With add_lvalue_reference: declval<Foo>() would be of type Foo&. declval<Foo&>() would be of type Foo& (reference collapsing: “Foo& &” collapses to Foo&). declval<Foo&&>() would be … Read more