Tags » Ripper

Move semantics when sending object as function's parameter

I’m playing with move constructors and move assignments and i’ve stumbled on this problem. First code:

#include <iostream>
#include <utility>

class Foo {
        Foo() {}

        Foo(Foo&& other) {
            value = std::move(other.value);
            other.value = 1; //since it's int! 144 more words
Recent Questions - Stack Overflow

Jack The Ripper: Our Obsession With Serial Killers

I’m currently having a bit of a Jack the Ripper phase. Despite previously knowing very little about the grisly east end murders of 1888, now – I confess – I’m hooked. 771 more words