#include <iostream>
using namespace std;

class foo {
    int data;
public:
    template <typename T, typename = enable_if_t<is_constructible<T, int>::value>>
    foo(const T& i) : data{ i } { cout << "Value copy ctor" << endl; }

    template <typename T, typename = enable_if_t<is_constructible<T, int>::value>>
    foo(T&& i) : data{ i } { cout << "Value move ctor" << endl; }

    foo(const foo& other) : data{ other.data } { cout << "Copy ctor" << endl; }

    foo(foo&& other) : data{ other.data } { cout << "Move ctor" << endl; }

    operator int() { cout << "Operator int()" << endl; return data; }
};

int main() {
    foo obj1(42);
    foo obj2(obj1);
}