Skip to content

C++17 deprecation warning on std::multiplies result_type #2192

Open
@adriendelsalle

Description

@adriendelsalle

Hi @JohanMabille , thanks for this project!

I encounter a C4996 MSVC compiler warning using xtensor with cmake CMAKE_CXX_STANDARD 17 flag set.

This minimal code

#include "xtensor/xtensor.hpp"

void Test()
{
    xt::xtensor<double, 1> tensor {1., 2.};
    xt::cumprod(tensor);
}

throws me the following warning:

xtensor\xaccumulator.hpp(259): warning C4996: 'std::multiplies<result_type>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

Could you please have a look at this ?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions