Since Boost.Any library does not work well with Move-Only types, I had to write my own alternative:#include <typeindex>#include <type_traits>#include <utility>#include <exception>class TAny {public:    TAny() = default;    TAny(const TAny &a) {        *this = a;    }    TAny &operator=(const TAny &a) {        if (this != &a) {            ptr = a.ptr->clone();        }        return *this;    }    TAny(TAny &&a) {        *this = std::move(a);    }    TAny &operator=(TAny &&a) {        if (this != &a) {            ptr = a.ptr;            a.ptr = nullptr;    // swap        }        return *this;    }    template <typename T>    TAny(const T &t) {        *this = t;    }    template <typename T>    TAny &operator=(const T &t) {        if (ptr) delete ptr;        typename std::conditional<            std::is_copy_constructible<T>::value,            return_placeholder_by_copying<T>,   // sadece true is alacak (umarm)            return_placeholder_nullptr>::type do_something;        ptr = do_something(t);        return *this;    }    template <typename T>    TAny(T &&t) {        *this = std::move(t);    }    template <typename T>    TAny &operator=(T &&t) {        if (ptr) delete ptr;        ptr = new impl<T>(std::move(t));        return *this;    }    ~TAny() {        delete ptr;    }    struct placeholder {        std::type_index type_information { typeid(void) };        virtual placeholder *clone() = 0;        virtual void *object() = 0;        virtual ~placeholder() {  }    };    template <typename T>    struct impl : placeholder {        impl(T const &t) : val(t) { type_information = typeid(T); }        // ^^^ why doesn't this code cause problems for move-only types???        // answer is http://stackoverflow.com/questions/21166762/forcing-the-compiler-to-generate-code-for-all-member-functions-of-a-template-cla        // unless explicitly instantiated, compiler doesn't generate        // whole code for the class. (meaning not includes every member        // function, even doesn't do deletedness checking! --> is it standard?)        impl(T &&t) : val(std::move(t)) { type_information = typeid(T); }        virtual placeholder *clone() {            typename std::conditional<                std::is_copy_constructible<T>::value,                return_placeholder_by_copying<T>,   // sadece true is alacak (umarm)                return_placeholder_nullptr>::type do_something;            return do_something(val);        }        virtual void *object() { return (void *) &val; }        T val;    };    template <typename Tx>    struct return_placeholder_by_copying {  // iyi template magic kastm yalnz :O        placeholder *operator()(const Tx &t) {            return new impl<Tx>(t);        }    };    struct return_placeholder_nullptr {        template <typename... Args>        placeholder *operator()(Args&&... args) {            return nullptr;        }    };    placeholder *ptr { nullptr };};class BadAnyCast : public std::exception {public:    const char *what() const noexcept {        return Bad Any Cast!!!;    }};template <typename T>T AnyCast(TAny &a) {    if (std::type_index(typeid(typename std::remove_reference<T>::type)) == a.ptr->type_information) {        return (T)            (*static_cast<                typename std::remove_reference<T>::type*            >(a.ptr->object()));    }    throw BadAnyCast();}What do you suggest me to improve this?
Alternative Boost.Any Library
c++;c++14;boost