Boost C++ Libraries: Ticket #3401: has_new_operator fail if several new operators is overrided https://svn.boost.org/trac10/ticket/3401 <p> This code will not compile: </p> <pre class="wiki">#include &lt;stdio.h&gt; #include &lt;tchar.h&gt; #include &lt;boost/type_traits.hpp&gt; #include &lt;boost/type_traits/has_new_operator.hpp&gt; class A { public: void* operator new(std::size_t); void* operator new(std::size_t, void*); }; int _tmain(int argc, _TCHAR* argv[]) { boost::has_new_operator&lt;A&gt;(); return 0; } </pre><p> }; </p> <p> int _tmain(int argc, _TCHAR* argv[]) { </p> <blockquote> <p> boost::has_new_operator&lt;A&gt;(); return 0; </p> </blockquote> <p> } </p> <p> The has_new_operator could be updated with a new check_sig3 test. Where the new(std::size_t, void*) is moved to the new check_sig3. But because of ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3400" title="#3400: Bugs: Problem with boost::serialization when only operator new[] is overrided (closed: fixed)">#3400</a>, the function should also be split into tree different functions (ex. has_new_operator, has_new_operator_array and has_new_operator_placement). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3401 Trac 1.4.3 Robert Ramey Sun, 11 Oct 2009 21:20:56 GMT <link>https://svn.boost.org/trac10/ticket/3401#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3401#comment:1</guid> <description> <p> Hmmm - I notice your name is the first on the list of authors in the source code for has_new_operator.hpp. </p> <p> I suspect that I and john maddock made just minor tweaks. How about updating has_new_operator.hpp and sending it to me so I can check it in. This is much easier for me than diving back into this. </p> <p> Now that I look at it, there is a "rutger" on the user list for this site. Could I just assign this to you and let you take care of this? Same would go for <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3400" title="#3400: Bugs: Problem with boost::serialization when only operator new[] is overrided (closed: fixed)">#3400</a>. This would be very helpful to me. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 12 Oct 2009 10:42:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3401#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3401#comment:2</guid> <description> <p> I've been meaning to look at this as well, but haven't had the time yet :-( </p> <p> Before we get too carried away with any changes: </p> <ul><li>I'd prefer it if has_new_operator retained the existing semantics - which is to say returns true if the class has <em>any</em> of the new operator signatures overloaded. </li><li>With regard to splitting in 3: just remember that there are actually 6 (I think!) variations if we include the nothrow versions as well. Wait, make that 8 if we include the 2 placement versions! Not sure whether has_operator_new should return true for placement operator overload though? </li></ul><p> Just thinking out loud yours, John. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 12 Oct 2009 10:59:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3401#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3401#comment:3</guid> <description> <p> Will be fixed in Trunk shortly (but not the splitting up). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 12 Oct 2009 11:00:04 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3401#comment:4 https://svn.boost.org/trac10/ticket/3401#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/56730" title="Fixes #3401.">[56730]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3401" title="#3401: Bugs: has_new_operator fail if several new operators is overrided (closed: fixed)">#3401</a>. </p> Ticket