> std::fstream::in is not a type the error is indeed error: ‘in’ in ‘std::fstream {aka class std::basic_fstream<char>}’ does not name a type btw you have a spurious “;” before "|" I think you are confusing the usage of “using” and “auto” keywords this compiles #include <fstream> int main () { auto && my_read = std::fstream::in; std::fstream fs; fs.open ("test.txt", my_read | std::fstream::out | std::fstream::app); fs << " more lorem ipsum"; fs.close(); return 0; } On 25 Jun, 2014, at 3:13 PM, Arbol One <arbolone@xxxxxxxxxx> wrote: > #include <fstream> > int main () { > using my_read = std::fstream::in; //<== Error: expected type-specifier > std::fstream fs; > fs.open ("test.txt", my_read | std::fstream::out; | std::fstream::app); > fs << " more lorem ipsum"; > fs.close(); > return 0; > }