diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-04 14:29:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-04 14:29:05 +0200 |
commit | 49261d3c921a16bffd491555d3a41ea1e5410d13 (patch) | |
tree | f0081f7a03da5226f60782d9731156cceb7ac9fb /libhello/libhello/hello.cxx | |
parent | cb647d3e1affe6b1ebd8a31b1ad5f7a76cde63ab (diff) |
Regenerate libhello using bdep-new
Diffstat (limited to 'libhello/libhello/hello.cxx')
-rw-r--r-- | libhello/libhello/hello.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libhello/libhello/hello.cxx b/libhello/libhello/hello.cxx index 677815d..4fbd917 100644 --- a/libhello/libhello/hello.cxx +++ b/libhello/libhello/hello.cxx @@ -1,16 +1,17 @@ -// file: libhello/hello.cxx -*- C++ -*- - #include <libhello/hello.hxx> -#include <iostream> +#include <ostream> +#include <stdexcept> using namespace std; namespace hello { - void - say (const string& n) + void say_hello (ostream& o, const string& n) { - cout << "Hello, " << n << '!' << endl; + if (n.empty ()) + throw invalid_argument ("empty name"); + + o << "Hello, " << n << '!' << endl; } } |