#include <functional>
#include <memory>
#include <utility>
#include <iostream>

template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) {
    return std::unique_ptr<T>{new T{std::forward<Args>(args)...}};
}

template <typename T>
class Movable {
    T value;
public:
    explicit Movable(T value) :
        value{std::move(value)} {}
    ~Movable() { std::cout << "~Movable()" << std::endl; }
    Movable(const Movable&) = delete;
    Movable& operator = (const Movable&) = delete;
    friend std::ostream& operator << (std::ostream& os, const Movable& m) {
        return os << m.value;
    }
};

int main() {
    using namespace std::placeholders;
    auto f = std::bind([](std::unique_ptr<Movable<int>>& p, int i, const char* s){
        std::cout << *p << ' ' << i << ' ' << s << std::endl;
    }, make_unique<Movable<int>>(42), _1, _2);
    f(13, "Hello, ");
    f(69, "World!");
}
