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: azubanov@… 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)

complex_mpft.hpp (6.2 KB ) - added by anonymous 11 years ago.
mpreal.cpp (12.9 KB ) - added by anonymous 11 years ago.
mpreal.h (98.9 KB ) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (5)

by anonymous, 11 years ago

Attachment: complex_mpft.hpp added

by anonymous, 11 years ago

Attachment: mpreal.cpp added

by anonymous, 11 years ago

Attachment: mpreal.h added

comment:2 by Daryle Walker, 11 years ago

Component: NoneuBLAS
Owner: set to Gunter
Note: See TracTickets for help on using tickets.