c++ initializtion with interface : I am trying to implement a general `value` class in c++ that can contain integer, float, and fractions etc. So I wrote an interface `value_interface`  and had `int` wrapped up in `int_wrapper` to inherit from the interface. However, `value(3)` will not initialize a `value` object, because even if `3` is convertable to `int_wrapper`, which is convertable to `value_interface`, `value_interface` is not directly convertable to `value`. Is there any way to make `value(3)` possible? Or is there a better way to do this?

    #include <string>
    
    class value_interface {
    public:
        virtual std::string to_string() const = 0;
        virtual ~value_interface() {}
    };
    
    class value {
        std::shared_ptr<value_interface> d_ptr_;
    public:
        value(value_interface* x) { d_ptr_ = std::unique_ptr<value_interface>(x); }
        std::string to_string() const { return d_ptr_->to_string(); }
    };

    class int_wrapper : public value_interface {
        int val_;
    public:
        int_wrapper(const int val) : val_(val) {}
        operator int() const { return val_; }
        std::string to_string() const override { return std::to_string(val_); }
        friend value operator+(int_wrapper x, int_wrapper y);
    };
    
    int main() {
        value a = 3; // compile error : cannot convert 3 to value
        return 0;
    }

