Opened 11 years ago
Last modified 11 years ago
#6296 new Bugs
wrong has_trivial_constructor value for custom class follows to programm fail
Reported by: | Owned by: | Gunter | |
---|---|---|---|
Milestone: | To Be Determined | Component: | uBLAS |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | has_trivial_constructor | Cc: |
Description
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;
}
Attachments (3)
Change History (5)
by , 11 years ago
Attachment: | complex_mpft.hpp added |
---|
by , 11 years ago
Attachment: | mpreal.cpp added |
---|
by , 11 years ago
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Component: | None → uBLAS |
---|---|
Owner: | set to |
This bug seems to appears again http://connect.microsoft.com/VisualStudio/feedback/details/339442/vs2008-tr1-problems-with-is-pod-and-has-trivial-constructor