Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
563 views
in Technique[技术] by (71.8m points)

c++17 - Eclipse CDT在使用std :: index_sequence时报告错误错误(Eclipse CDT is reporting false erros while using std::index_sequence)

I have Eclipse 2019-03 (4.11.0) with CDT 9.7.0.20190309 and the build-in compiler reports false positive errors while using std::index_sequence in C++17:

(我有带有CDT 9.7.0.20190309的Eclipse 2019-03(4.11.0),并且内置编译器在C ++ 17中使用std :: index_sequence时报告了误报错误:)

template<std::size_t... Is>
inline std::array<std::size_t, sizeof...(Is)> calculate_percentages( std::index_sequence<Is...> ) noexcept {
    return { this->get_percentage<Is>()... };
}

template<std::size_t N>
inline std::array<std::size_t, N> get_percentages( void ) noexcept {
    return this->calculate_percentages( std::make_index_sequence<N>() );
    /*           ^^^^^^^^^^^^^^^^^^^^^ : Invalid arguments ' Candidates are: std::array calculate_percentages(std::integer_sequence) ' */
}

But the normal compilation succeeds without any problem.

(但是普通编译成功了,没有任何问题。)

My CDT GCC Built-in Compiler Settings in Project Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers is as follows:

(项目属性-> C / C ++常规->预处理器包含路径,宏等中的CDT GCC内置编译器设置 。->提供程序如下:)

${COMMAND} ${FLAGS} -E -P -v -dD -std=c++17 "${INPUTS}"

The same applies for CDT Cross GCC Built-in Compiler Settings .

(CDT Cross GCC内置编译器设置也是如此 。)

Rebuilding the index does not helped in there.

(重建索引没有帮助。)

Many thanks in advance to anyone willing to help...

(在此先感谢任何愿意提供帮助的人...)

  ask by Martin Kopecky translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...