Opened 7 years ago

Closed 7 years ago

#11840 closed Bugs (fixed)

New is_complex<T> failing with const types

Reported by: dolfim@… Owned by: John Maddock
Milestone: To Be Determined Component: type_traits
Version: Boost 1.60.0 Severity: Regression
Keywords: Cc: hehn@…

Description

I would like to report a change in behavior for the new version of the type_traits in Boost 1.60.0 (b1).

When the type is const std::complex<T>, the traits return false. This is different between 1.58.0 and the current 1.60.0b1

Example:

template <typename T>
void mycheck() {
    if (boost::is_complex<T>())
        std::cout << "COMPLEX" << std::endl;
    else
        std::cout << "REAL" << std::endl;
}

int main () {
    mycheck<float>(); // REAL
    mycheck<double>(); // REAL
    mycheck<int>(); // REAL
    mycheck<std::complex<float> >();  // COMPLEX
    mycheck<std::complex<double> >();  // COMPLEX
    mycheck<std::complex<const double> >();  // COMPLEX
    mycheck<const std::complex<double> >();  // COMPLEX in 1.58.0, REAL in 1.60.0_b1
}

Change History (2)

comment:1 by hehn@…, 7 years ago

Cc: hehn@… added

comment:2 by John Maddock, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.