79814853

Date: 2025-11-09 14:56:45
Score: 1
Natty:
Report link

It should be

template <typename T>
void push_front(T&& value) {
  // ...
  new_head->value = std::forward<T>(value);
  // ...
}

If value is U&& then it will give new_head->value = std::move(value);

If value is const U& then it will give new_head->value = value;

See When is a reference a forwarding reference, and when is it an rvalue reference?, Is there a difference between universal references and forwarding references?

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: 3CEZVQ