template <class Tgt, class Src>
typename std::enable_if<std::is_same<Tgt, Src>::value, Tgt>::type
to(Src && value) {
- return std::move(value);
+ return std::forward<Src>(value);
}
/*******************************************************************************
uint64_t maxLineLength = 0, // No line length limit by default
char delimiter = '\n',
uint64_t bufSize = 1024
- ) : fdLineCb_(std::move(fdLineCb)),
+ ) : fdLineCb_(std::forward<Callback>(fdLineCb)),
maxLineLength_(maxLineLength),
delimiter_(delimiter),
bufSize_(bufSize) {}
template <class E>
void raise(E&& exception) {
raise(make_exception_wrapper<typename std::remove_reference<E>::type>(
- std::move(exception)));
+ std::forward<E>(exception)));
}
/// Raise an interrupt. If the promise holder has an interrupt
template<class F, class Tuple>
struct GuardObj : GuardObjBase {
explicit GuardObj(F&& f, Tuple&& args)
- : f_(std::move(f))
- , args_(std::move(args))
+ : f_(std::forward<F>(f))
+ , args_(std::forward<Tuple>(args))
{}
GuardObj(GuardObj&& g) noexcept
: GuardObjBase(std::move(g))
template <typename T>
void runElementTypeTest(T&& src) {
MPMCQueue<T> cq(10);
- cq.blockingWrite(std::move(src));
+ cq.blockingWrite(std::forward<T>(src));
T dest;
cq.blockingRead(dest);
EXPECT_TRUE(cq.write(std::move(dest)));