Check to see if a file has content inside

What would be an easy implementation of reading a file to see if there are contents inside for a beginner?
1
2
inline bool has_content( const std::string& path )
{ return std::ifstream(path).peek() != std::ifstream::traits_type::eof() ; }

http://coliru.stacked-crooked.com/a/6906d9b22cc86f5f
Topic archived. No new replies allowed.