Boost C++ Libraries: Ticket #10196: thread_specific_ptr does not support void* https://svn.boost.org/trac10/ticket/10196 <p> Forming reference to void in <code>T&amp; operator*</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10196 Trac 1.4.3 Zhihao Yuan <lichray@…> Tue, 15 Jul 2014 00:55:03 GMT attachment set https://svn.boost.org/trac10/ticket/10196 https://svn.boost.org/trac10/ticket/10196 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">tss_ptr_void.diff</span> </li> </ul> <p> patch using shared_ptr's "private" helpers </p> Ticket viboes Tue, 15 Jul 2014 17:53:09 GMT <link>https://svn.boost.org/trac10/ticket/10196#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:1</guid> <description> <p> What is the value of boost::detail::sp_dereference&lt; void &gt;::type ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 15 Jul 2014 17:53:24 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/10196#comment:2 https://svn.boost.org/trac10/ticket/10196#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Zhihao Yuan <lichray@…> Tue, 15 Jul 2014 18:01:20 GMT <link>https://svn.boost.org/trac10/ticket/10196#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10196#comment:1" title="Comment 1">viboes</a>: </p> <blockquote class="citation"> <p> What is the value of boost::detail::sp_dereference&lt; void &gt;::type ? </p> </blockquote> <p> <code>void</code>. </p> <p> <code>boost::detail::sp_dereference</code> is used by <code>shared_ptr</code> internally to implement <code>shared_ptr&lt;void&gt;.get</code>. <code>shared_ptr</code> is the underlying implementation of <code>thread_specific_ptr</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 23 Jul 2014 21:25:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10196#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:4</guid> <description> <p> Would the following line (*) compile? </p> <pre class="wiki"> void operator*() const { return *get(); // (*) } </pre><p> Please, could you add a test case? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 23 Jul 2014 21:35:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10196#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:5</guid> <description> <p> Well it seems that this compiles, but I'm getting these warnings </p> <pre class="wiki">clang-darwin.compile.c++ ../../../bin.v2/libs/thread/test/test_tss_lib.test/clang-darwin-3.2_11/debug/threading-multi/test_tss.o In file included from test_tss.cpp:13: ../../../boost/thread/tss.hpp:42:17: warning: cannot delete expression with pointer-to-'void' type 'void *' delete static_cast&lt;T*&gt;(data); ^ ~~~~~~~~~~~~~~~~~~~~~ ../../../boost/thread/pthread/thread_heap_alloc.hpp:17:24: note: in instantiation of member function 'boost::thread_specific_ptr&lt;void&gt;::delete_data::operator()' requested here return new T(); ^ ../../../boost/thread/tss.hpp:68:21: note: in instantiation of function template specialization 'boost::detail::heap_new&lt;boost::thread_specific_ptr&lt;void&gt;::delete_data&gt;' requested here cleanup(detail::heap_new&lt;delete_data&gt;(),detail::do_heap_delete&lt;delete_data&gt;()) ^ test_tss.cpp:51:34: note: in instantiation of member function 'boost::thread_specific_ptr&lt;void&gt;::thread_specific_ptr' requested here boost::thread_specific_ptr&lt;void&gt; tss_void; ^ 1 warning generated. </pre><p> How do you want to use it? </p> </description> <category>Ticket</category> </item> <item> <author>Zhihao Yuan <lichray@…></author> <pubDate>Wed, 23 Jul 2014 21:53:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10196#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10196#comment:5" title="Comment 5">viboes</a>: </p> <blockquote class="citation"> <p> Well it seems that this compiles, but I'm getting these warnings </p> <pre class="wiki">clang-darwin.compile.c++ ../../../bin.v2/libs/thread/test/test_tss_lib.test/clang-darwin-3.2_11/debug/threading-multi/test_tss.o In file included from test_tss.cpp:13: ../../../boost/thread/tss.hpp:42:17: warning: cannot delete expression with pointer-to-'void' type 'void *' delete static_cast&lt;T*&gt;(data); ^ ~~~~~~~~~~~~~~~~~~~~~ ../../../boost/thread/pthread/thread_heap_alloc.hpp:17:24: note: in instantiation of member function 'boost::thread_specific_ptr&lt;void&gt;::delete_data::operator()' requested here return new T(); ^ ../../../boost/thread/tss.hpp:68:21: note: in instantiation of function template specialization 'boost::detail::heap_new&lt;boost::thread_specific_ptr&lt;void&gt;::delete_data&gt;' requested here cleanup(detail::heap_new&lt;delete_data&gt;(),detail::do_heap_delete&lt;delete_data&gt;()) ^ test_tss.cpp:51:34: note: in instantiation of member function 'boost::thread_specific_ptr&lt;void&gt;::thread_specific_ptr' requested here boost::thread_specific_ptr&lt;void&gt; tss_void; ^ 1 warning generated. </pre></blockquote> <p> C++11's default_delete is ill-formed for incomplete types including void. </p> <p> It's boost::shared_ptr's job to decide whether deleting void* is OK or not. </p> <blockquote class="citation"> <p> How do you want to use it? </p> </blockquote> <p> Many C APIs expose their interface types with an opaque pointer; void* is a choice. You'll need to use a customized deleter calling the C API's cleanup function. </p> </description> <category>Ticket</category> </item> <item> <author>Zhihao Yuan <lichray@…></author> <pubDate>Wed, 23 Jul 2014 21:58:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10196#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10196#comment:4" title="Comment 4">viboes</a>: </p> <blockquote class="citation"> <p> Please, could you add a test case? </p> </blockquote> <p> Sorry I'm so lazy... But you can copy &amp; paste libc++'s test on void* support: </p> <p> <a class="ext-link" href="https://searchcode.com/codesearch/view/15464587/"><span class="icon">​</span>https://searchcode.com/codesearch/view/15464587/</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 26 Jul 2014 03:24:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10196#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:8</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10196#comment:7" title="Comment 7">Zhihao Yuan &lt;lichray@…&gt;</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10196#comment:4" title="Comment 4">viboes</a>: </p> <blockquote class="citation"> <p> Please, could you add a test case? </p> </blockquote> <p> Sorry I'm so lazy... But you can copy &amp; paste libc++'s test on void* support: </p> <p> <a class="ext-link" href="https://searchcode.com/codesearch/view/15464587/"><span class="icon">​</span>https://searchcode.com/codesearch/view/15464587/</a> </p> </blockquote> <p> This is a unique_ptr test. Do you have one for thread_specific_ptr? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 14 Sep 2014 17:36:50 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/10196#comment:9 https://svn.boost.org/trac10/ticket/10196#comment:9 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> Oh, I got it. It is up to the user to provide the cleanup function. </p> Ticket viboes Tue, 16 Sep 2014 05:59:19 GMT <link>https://svn.boost.org/trac10/ticket/10196#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:10</guid> <description> <p> <a class="ext-link" href="https://github.com/boostorg/thread/commit/27befdf26fbfdc977010f40b6590415a84196916"><span class="icon">​</span>https://github.com/boostorg/thread/commit/27befdf26fbfdc977010f40b6590415a84196916</a> </p> </description> <category>Ticket</category> </item> <item> <author>Zhihao Yuan <lichray@…></author> <pubDate>Tue, 16 Sep 2014 14:17:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10196#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10196#comment:11</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10196#comment:10" title="Comment 10">viboes</a>: </p> <blockquote class="citation"> <p> <a class="ext-link" href="https://github.com/boostorg/thread/commit/27befdf26fbfdc977010f40b6590415a84196916"><span class="icon">​</span>https://github.com/boostorg/thread/commit/27befdf26fbfdc977010f40b6590415a84196916</a> </p> </blockquote> <p> Looks good to me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 23 Sep 2014 00:07:03 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10196#comment:12 https://svn.boost.org/trac10/ticket/10196#comment:12 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket