Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 1 | #include "examples/cpp/hello-lib.h" |
| 2 | |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 3 | #include <iostream> |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 4 | |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 5 | using std::cout; |
| 6 | using std::endl; |
| 7 | using std::string; |
| 8 | |
| 9 | namespace hello { |
| 10 | |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 11 | HelloLib::HelloLib(const string& greeting) : greeting_(new string(greeting)) { |
| 12 | } |
| 13 | |
| 14 | void HelloLib::greet(const string& thing) { |
| 15 | cout << *greeting_ << " " << thing << endl; |
| 16 | } |
| 17 | |
| 18 | } // namespace hello |