lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Using ublas in expression template test


From: Vadim Zeitlin
Subject: [lmi] Using ublas in expression template test
Date: Wed, 12 May 2021 12:41:07 +0200

 Sorry, but _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS story is not
over yet... I haven't noticed this problem because of another, unrelated,
one, but expression_template_test_0.cpp doesn't compile with clang out of
the box currently because it includes ublas headers that use
std::allocator::construct() which _is_ deprecated in C++17 and removed in
C++20 (https://en.cppreference.com/w/cpp/memory/allocator/construct), so
compiling it results in -Wdeprecated-declarations with clang 11, for which
we define the symbol above to work around its bug, and errors for clang 12
for which we don't define it.

 There are, of course, several ways to fix it, but I wonder if the real
solution couldn't be even simpler: your commit e89831e23 (C++20-ize two
unit tests, 2021-03-01) added the following condition to this test:

        #if 202002L <= __cplusplus
        #   define USE_UBLAS
        #endif // 202002L < __cplusplus

with the explanation:

    * expression_template_0_test.cpp: lmi will never use ublas anyway.

I don't quite understand this, but I would understand it if the direction
of the test were reversed, i.e.

        #if __cplusplus < 202002L

And the commit message said that ublas from Boost 1.33 doesn't compile in
C++20. Could it be as simple as this?

 Or do I need to fix this in a different way?

 Thanks in advance,
VZ

Attachment: pgpW2UjFg6cvx.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]