aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/cpp/hello-lib.cc
blob: 8e40921ceedfbdd6ef966572b24e277cd0ef0304 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "examples/cpp/hello-lib.h"

#include <iostream>

using std::cout;
using std::endl;
using std::string;

namespace hello {

HelloLib::HelloLib() : HelloLib("Hello") {
}

HelloLib::HelloLib(const string& greeting) : greeting_(new string(greeting)) {
}

void HelloLib::greet(const string& thing) {
  cout << *greeting_ << " " << thing << endl;
}

}  // namespace hello