Recommand · June 11, 2021 0

Latest Visual Studio 2019 v 16.10.0 and _DEPRECATE_TR1_NAMESPACE

I am programming with /std:c++latest in VS2019 v16.10.0. Everything compiled fine with previous version of VS2019. Now I get many errors in header related to _DEPRECATE_TR1_NAMESPACE.
How can I compile around this deprecation?

An example of an error follows:

    error C2146: syntax error: missing ';' before identifier 'subtract_with_carry_01'

where the code referenced is:

template <class _Ty, size_t _Wx, size_t _Sx, size_t _Rx>
class _DEPRECATE_TR1_NAMESPACE subtract_with_carry_01
    : public _Swc_base<_Ty, _Sx, _Rx, _Swc_01_traits<_Ty, _Wx, _Rx>> { // subtract_with_carry_01 generator

The workaround I found was to

#define _HAS_TR1_NAMESPACE 0

before all header files.

Or to add _HAS_TR1_NAMESPACE=0; in the preprocessor definitions…

This allows me to use latest C++ language!!