Add workaround for Visual C++ issue with std::array in debug

If Visual C++ _ITERATOR_DEBUG_LEVEL > 0, then
accessing std::array<char[N], M> elements via reference to const
causes compilation error:

...\msvc\14.10.25017\include\array(181): error C2440: 'return': cannot convert from 'const char *' to 'const char (&)[256]'

Alternative workaround is to remove const qualifier from the GetClassName method.
This commit is contained in:
Mateusz Loskot 2017-08-08 16:58:43 +02:00 committed by Daniel J. H
parent 7069af3e20
commit 80b705e997

View File

@ -83,7 +83,8 @@ struct ProfileProperties
std::string GetClassName(std::size_t index) const
{
BOOST_ASSERT(index <= MAX_CLASS_INDEX);
return std::string(class_names[index]);
const auto &name_it = std::begin(class_names) + index;
return std::string(*name_it);
}
double GetWeightMultiplier() const { return std::pow(10., weight_precision); }