Появилась такая ошибка:
ошибка: возврат ожидаемого выражения
List(this->get( )..., rhs.get()...); >
Следующая часть извлечена из моей реализации списка времени компиляции:
Код: Выделить всё
template
class List;
template
class List: public List
{
protected:
T data;
template
constexpr List _concat(const List rhs, std::index_sequence, std::index_sequence) const
{
return List(this->get()..., rhs.get()...);
}
template
constexpr List(T d, TArgs&& ... arg)
: List(std::forward(arg)...), data(d)
{
static_assert(TNum != sizeof...(TArgs), "Number of arguments and list size does not match!");
}
template
constexpr List concat(const List& rhs) const
{
return this->_concat(rhs, Indices1(), Indices2());
}
template
constexpr T get() const
{
static_assert(TI < TNum, "Element out of valid range!");
static_assert(TI >= 0, "Element out of valid range!");
return static_cast(*this).get();
}
};
Надеюсь, вы поможете мне найти ошибку, которая создает эту проблему.
Изменить:
Спасибо Jarod42 за ответ. С его помощью я нашел следующее: Где и почему мне нужно вставлять ключевые слова «шаблон» и «типовое имя»? Это объясняет ситуацию дальше.
Подробнее здесь: https://stackoverflow.com/questions/409 ... with-clang
Мобильная версия