News for hackers. Stuff that matters.
Re:Writing comments about pointer ownership by frankzinger on Sunday August 23, 2015 @04:07AM (#10104998)
Tip: insert manual newlines into verbatim/code blocks to make them more readable:

  Some people might ask why I chose to make
  the parameter of BlackBox::store an rvalue
  reference rather than an lvalue reference
  and force the client code to use std::move.
  While it is true that an lvalue reference
  would also have worked, if I did that, it
  would be impossible to write code like
  crate.store(std::make_unique<Gadget>(beeper, flasher));.
  I also happen to think that forcing the client to use
  std::move at the call sites is good rather than bad,
  because it communicates the intended effect to the reader.

There are no comments on this comment yet.