<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Curl] WebSocket platform part is not implemented."
   href="https://bugs.webkit.org/show_bug.cgi?id=144628#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Curl] WebSocket platform part is not implemented."
   href="https://bugs.webkit.org/show_bug.cgi?id=144628">bug 144628</a>
              from <span class="vcard"><a class="email" href="mailto:peavo&#64;outlook.com" title="peavo&#64;outlook.com">peavo&#64;outlook.com</a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=144628#c14">comment #14</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=252878&amp;action=diff" name="attach_252878" title="Patch">attachment 252878</a> <a href="attachment.cgi?id=252878&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch</span >
&gt;

Thanks again :)

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/platform/network/curl/SocketStreamHandle.h:99
&gt; &gt; +        SocketData(std::unique_ptr&lt;const char[]&gt;&amp;&amp; source, int length)
&gt; &gt; +        {
&gt; &gt; +            data = WTF::move(source);
&gt; &gt; +            size = length;
&gt; &gt; +        }
&gt; &gt; +
&gt; &gt; +        SocketData(SocketData&amp;&amp; other)
&gt; &gt; +        {
&gt; &gt; +            data = WTF::move(other.data);
&gt; &gt; +            size = other.size;
&gt; &gt; +            other.size = 0;
&gt; &gt; +        }
&gt; 
&gt; I don’t understand why you had to define these.
&gt; 
&gt; &gt; Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp:71
&gt; &gt; +    m_sendData.append(SocketData(WTF::move(copy), length));
&gt; 
&gt; Should just be SocketData { WTF::move(copy), length } and then it should
&gt; work without a constructor.
&gt; </span >

I'm sorry, but I don't seem to be able to get rid of these constructors.
When I remove them, I get the following error:

1&gt;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0(611): error C2280: 'std::unique_ptr&lt;char [],std::default_delete&lt;_Ty&gt;&gt;::unique_ptr(const std::unique_ptr&lt;_Ty,std::default_delete&lt;_Ty&gt;&gt; &amp;)' : attempting to reference a deleted function
1&gt;          with
1&gt;          [
1&gt;              _Ty=char []
1&gt;          ]
1&gt;          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1618) : see declaration of 'std::unique_ptr&lt;char [],std::default_delete&lt;_Ty&gt;&gt;::unique_ptr'
1&gt;          with
1&gt;          [
1&gt;              _Ty=char []
1&gt;          ]
1&gt;          This diagnostic occurred in the compiler generated function 'WebCore::SocketStreamHandle::SocketData::SocketData(const WebCore::SocketStreamHandle::SocketData &amp;)'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I believe this happens because Deque::append and Deque::prepend makes MSVC generate a SocketData copy constructor, which is not possible since the copy constructor in unique_ptr is deleted.

There seems to be reports of similar problems:

<a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/ace575e6-3969-4672-9db1-85c9d6588e4a/cant-put-class-with-uniqueptr-member-in-stl-container?forum=vclanguage">https://social.msdn.microsoft.com/Forums/vstudio/en-US/ace575e6-3969-4672-9db1-85c9d6588e4a/cant-put-class-with-uniqueptr-member-in-stl-container?forum=vclanguage</a>

<a href="http://stackoverflow.com/questions/10133591/using-smart-pointers-in-a-struct-or-class">http://stackoverflow.com/questions/10133591/using-smart-pointers-in-a-struct-or-class</a>

Is this a MSVC problem? I assume gcc doesn't have these problems.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>