Matthias Andreas Benkard | effabc9 | 2018-04-10 22:22:45 +0200 | [diff] [blame] | 1 | #include <greeting/greeting.hpp> |
Matthias Andreas Benkard | 38610ae | 2018-04-10 20:39:24 +0200 | [diff] [blame] | 2 | |
| 3 | #include <sstream> |
| 4 | |
| 5 | namespace greeting { |
| 6 | |
| 7 | std::string make_greeting(std::string const& greetee) { |
Matthias Andreas Benkard | e0f35b1 | 2018-04-10 21:15:20 +0200 | [diff] [blame] | 8 | if (greetee == "") { |
| 9 | return "Hello!"; |
| 10 | } else { |
| 11 | std::ostringstream out; |
| 12 | out << "Hello " << greetee << "!"; |
| 13 | return out.str(); |
| 14 | } |
Matthias Andreas Benkard | 38610ae | 2018-04-10 20:39:24 +0200 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | } |