M
Matthias =?ISO-8859-1?Q?K=E4ppler?=
Hi,
I'm using a glibc system header <sys/stat.h> which defines a C struct
'stat'. Furthermore, I'm using the struct 'dirent', defined in <dirent.h>.
Now, at one point in my code I'm holding an std::list of dirents:
std::list< dirent > mylist;
This works.
Now, I wanted to extend the list to hold pairs of dirent/stat:
std::list< std:air< dirent, stat > > mynewlist;
Now, the compiler (g++ 3.3.4) says he doesn't know a type called 'stat'. So
I tried the C-style notation for instantiating structs:
std::list< std:air< dirent, struct stat > > mynewlist;
This works. I find it rather odd that I can pass 'dirent' without a
preceding 'struct', but for 'stat' I have to do it the C way to calm the
compiler.
So, is there a rule of thumb in which cases I need the C-notation? Frankly I
was quite sure that you don't need it at all in C++.
Thanks in advance,
Matthias
I'm using a glibc system header <sys/stat.h> which defines a C struct
'stat'. Furthermore, I'm using the struct 'dirent', defined in <dirent.h>.
Now, at one point in my code I'm holding an std::list of dirents:
std::list< dirent > mylist;
This works.
Now, I wanted to extend the list to hold pairs of dirent/stat:
std::list< std:air< dirent, stat > > mynewlist;
Now, the compiler (g++ 3.3.4) says he doesn't know a type called 'stat'. So
I tried the C-style notation for instantiating structs:
std::list< std:air< dirent, struct stat > > mynewlist;
This works. I find it rather odd that I can pass 'dirent' without a
preceding 'struct', but for 'stat' I have to do it the C way to calm the
compiler.
So, is there a rule of thumb in which cases I need the C-notation? Frankly I
was quite sure that you don't need it at all in C++.
Thanks in advance,
Matthias