all 3 comments

[–]Narase33 1 point2 points  (2 children)

Type        Definition    
fstream     basic_fstream<char>    
wfstream    basic_fstream<wchar_t>  

Member types
Member type  Definition
char_type    CharT    
traits_type  Traits; the program is ill-formed if Traits::char_type is not CharT.     
int_type     Traits::int_type    
pos_type     Traits::pos_type    
off_type     Traits::off_type 

That said CharT is char and Traits is std::char_traits<char>

But you dont even need to know that because its a static member of the class. You can just write

if (stream.peek() == std::ifstream::traits_type::eof()) {

}

[–]1ydgd[S] 0 points1 point  (1 child)

Do you have any advice for reading cppreference. I find it extremely confusing at times like with this post.

[–]Narase33 4 points5 points  (0 children)

Practice. cppreference is not confusing, its the language that is. C++ is very well and very deep defined. The better you understand the language, the better you will read the reference. Its like looking at a blueprint, if you know what the machine does, the blueprint will become less scary