This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/65790] New: compilation error std::index_sequnece


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65790

            Bug ID: 65790
           Summary: compilation error std::index_sequnece
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: faithandbrave at gmail dot com

Compilation error follow code:

#include <iostream>
#include <utility>

void g(std::size_t a, std::size_t b, std::size_t c)
{
  std::cout << a << ", " << b << ", " << c << std::endl;
}

//template <class T, T... Seq>
//void f(std::integer_sequence<T, Seq...>) // OK
template <std::size_t... Seq>
void f(std::index_sequence<Seq...>) // NG
{
  g(Seq...);
}

int main()
{
  f(std::index_sequence<0, 1, 2>());
}


error message:
prog.cc: In function 'void f(std::index_sequence<Seq ...>)':
prog.cc:14:11: error: too few arguments to function 'void g(std::size_t,
std::size_t, std::size_t)'
   g(Seq...);
           ^
prog.cc:4:6: note: declared here
 void g(std::size_t a, std::size_t b, std::size_t c)
      ^

I think this is compiler's issue, not libstdc++.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]