#include <fstream> // std::ifstream
#include <iostream>
#include <stdexcept>
#include <string>
#include <stdlib.h> // EXIT_SUCCESS, EXIT_FAILURE
using namespace std;
inline bool throwX( std::string const& s ) { throw runtime_error( s ); }
inline bool hopefully( bool v ) { return v; }
int main( int argc, char* argv[] )
{
try
{
hopefully( argc == 2 )
|| throwX( string() + "Usage: " + argv[0] + " FILENAME" );
ifstream stream( argv[1] );
hopefully( !stream.fail() )