yo/coroutines/demo/readbinary/floats/floats1.cc
raw| 1 | //#define XERR |
| 2 | #include "floats.ih" |
| 3 | |
| 4 | Floats::Floats(int argc, char **argv) |
| 5 | : |
| 6 | d_action((*argv[1] == 'r') ? READ : |
| 7 | (*argv[1] == 'w') ? WRITE : |
| 8 | ERROR) |
| 9 | { |
| 10 | if (argc < 3 or d_action == ERROR) |
| 11 | throw runtime_error{ |
| 12 | "incorrect arguments, restart without arguments" }; |
| 13 | |
| 14 | d_filename = argv[2]; // store the filename |
| 15 | } |