Boost C++ Libraries: Ticket #6296: wrong has_trivial_constructor value for custom class follows to programm fail https://svn.boost.org/trac10/ticket/6296 <p> System: </p> <blockquote> <p> -- Windows Server 2008 R2 x64 -- Visual Studio 2010 </p> </blockquote> <p> I use wrapper for MPFR (<a class="ext-link" href="http://www.holoborodko.com/pavel/mpfr/"><span class="icon">​</span>http://www.holoborodko.com/pavel/mpfr/</a>) and custom std::complex type implementation for mpreal class (see attachment) </p> <p> typedef mpfr::mpreal number; typedef std::complex&lt;number&gt; complex; typedef boost::numeric::ublas::matrix&lt;complex&gt; cmatrix; </p> <p> cmatrix m1 = E - J; <em> E, J -- cmatrix </em></p> <p> storege.hpp: explicit BOOST_UBLAS_INLINE </p> <blockquote> <p> unbounded_array (size_type size, const ALLOC &amp;a = ALLOC()): </p> <blockquote> <p> alloc_(a), size_ (size) { </p> </blockquote> <p> if (size_) { </p> <blockquote> <blockquote> <p> data_ = alloc_.allocate (size_); </p> <blockquote> <p> <em> has_trivial_constructor returns true for complex&lt;number&gt;, </em> but this is my custom class with implemented default construtor </p> </blockquote> <p> if (! detail::has_trivial_constructor&lt;T&gt;::value) { </p> <blockquote> <blockquote> <p> for (pointer d = data_; d != data_ + size_; ++d) </p> <blockquote> <p> alloc_.construct(d, value_type()); </p> </blockquote> </blockquote> </blockquote> <p> } </p> </blockquote> </blockquote> <p> } else </p> <blockquote> <blockquote> <p> data_ = 0; </p> </blockquote> </blockquote> </blockquote> <blockquote> <p> } </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6296 Trac 1.4.3 anonymous Mon, 19 Dec 2011 12:23:52 GMT attachment set https://svn.boost.org/trac10/ticket/6296 https://svn.boost.org/trac10/ticket/6296 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">complex_mpft.hpp</span> </li> </ul> Ticket anonymous Mon, 19 Dec 2011 12:24:24 GMT attachment set https://svn.boost.org/trac10/ticket/6296 https://svn.boost.org/trac10/ticket/6296 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">mpreal.cpp</span> </li> </ul> Ticket anonymous Mon, 19 Dec 2011 12:24:40 GMT attachment set https://svn.boost.org/trac10/ticket/6296 https://svn.boost.org/trac10/ticket/6296 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">mpreal.h</span> </li> </ul> Ticket anonymous Mon, 19 Dec 2011 12:37:00 GMT <link>https://svn.boost.org/trac10/ticket/6296#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6296#comment:1</guid> <description> <p> This bug seems to appears again <a class="ext-link" href="http://connect.microsoft.com/VisualStudio/feedback/details/339442/vs2008-tr1-problems-with-is-pod-and-has-trivial-constructor"><span class="icon">​</span>http://connect.microsoft.com/VisualStudio/feedback/details/339442/vs2008-tr1-problems-with-is-pod-and-has-trivial-constructor</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daryle Walker</dc:creator> <pubDate>Mon, 23 Jan 2012 07:20:03 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/6296#comment:2 https://svn.boost.org/trac10/ticket/6296#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Gunter</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">uBLAS</span> </li> </ul> Ticket