why can't a std::vector take a local type?

Posted by anon on Stack Overflow See other posts from Stack Overflow or by anon
Published on 2010-03-18T07:26:13Z Indexed on 2010/03/18 7:31 UTC
Read the original article Hit count: 226

Filed under:
void foo() {
  struct Foo { .. };
  std::vector<foo> vec; // why is this illegal?
}

I'm not returning foo to the outside world. It's just a temporary type that I use within the function.

© Stack Overflow or respective owner

Related posts about c++