问题
Consider the code below:
#include <tuple>
int main() {
std::tuple<char[2], int> t1;
std::tuple<int> t2;
decltype(std::tuple_cat(t1, t2)) t3;
}
It compiles fine with g++
(in version >= 5.2) and icc
(13.0.1), but not in clang++
and older versions of g++
where it gives nasty error:
array initializer must be an initializer list or string literal
My hunch tells me that the code shouldn't compile and clang++
and older versions of g++
are actually right here, but want to take a second opinion.
来源:https://stackoverflow.com/questions/37421194/array-in-stdtuple-passed-to-stdtuple-cat-in-decltype-error-g-vs-clang