Access violation on using the smart pointer
===

What's the problem with line **obj->ip = "127.0.0.1";** ? I'm getting access violation here.

As I remember inside class - you are able to use **private** members, aren't you?


    typedef struct Header
    {
    	SOCKET sock;
    	SOCKADDR_IN addr;
    	WORD WSAVersion;
    	WSAData data;
    	char *ip;
    	u_short port;
    	int result;
    } Header;
    
    class A
    {
    private:
    	std::unique_ptr<Header> obj;
    
    public:
    	A(void)
    	{
    		obj(new Header);
    		obj->ip = "127.0.0.1"; // here comes the error!
    	}
    
    	~A(void)
    	{
    		obj.release();
    	}
    };
    
    int main(void)
    {
    	std::unique_ptr<A> handler(new A);