Subject: [Boost-bugs] [Boost C++ Libraries] #6296: wrong has_trivial_constructor value for custom class follows to programm fail
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-19 12:23:19
#6296: wrong has_trivial_constructor value for custom class follows to programm
fail
-------------------------------------+--------------------------------------
Reporter: azubanov@⦠| Owner:
Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
Version: Boost 1.48.0 | Severity: Problem
Keywords: has_trivial_constructor |
-------------------------------------+--------------------------------------
System:
-- Windows Server 2008 R2 x64
-- Visual Studio 2010
I use wrapper for MPFR (http://www.holoborodko.com/pavel/mpfr/) and custom
std::complex type implementation for mpreal class (see attachment)
typedef mpfr::mpreal number;
typedef std::complex<number> complex;
typedef boost::numeric::ublas::matrix<complex> cmatrix;
cmatrix m1 = E - J;
// E, J -- cmatrix
storege.hpp:
explicit BOOST_UBLAS_INLINE
unbounded_array (size_type size, const ALLOC &a = ALLOC()):
alloc_(a), size_ (size) {
if (size_) {
data_ = alloc_.allocate (size_);
// has_trivial_constructor returns true for
complex<number>,
// but this is my custom class with implemented default
construtor
if (! detail::has_trivial_constructor<T>::value) {
for (pointer d = data_; d != data_ + size_; ++d)
alloc_.construct(d, value_type());
}
}
else
data_ = 0;
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6296> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC