C ++ Статический шаблон ContexPR в структуре [дубликат]C++

Программы на C++. Форум разработчиков
Anonymous
C ++ Статический шаблон ContexPR в структуре [дубликат]

Сообщение Anonymous »

Я уменьшил свой код до следующего минимального примера: < /p>
#include
#include
#include

enum Indices : std::uint16_t
{
kIndex1 = 0,
kIndex2 = 1,
kNumIndices = 2
};

struct TestStruct
{
static constexpr std::array myvals{4,7};

template
static constexpr std::uint32_t GetValue()
{
return myvals[myIndex]*5;
}

static constexpr std::array newVals{GetValue(), GetValue()};
};

int main()
{
auto myArr = TestStruct::newVals;
std::cout

Подробнее здесь: https://stackoverflow.com/questions/793 ... -in-struct

Вернуться в «C++»