aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/cpp
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2015-04-10 17:29:58 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-04-13 11:45:49 +0000
commit3af12e60e75a8d6acc5c272c29bf562030f6f975 (patch)
tree4f1e73349a339e5aba032f531c1158dda2c2e09f /examples/cpp
parentef455a6171fad427afcdc11787e2e115f99ac5b0 (diff)
Remove constructor delegation from example
This requires gcc 4.7+ to work, Travis runs gcc 4.6. -- MOS_MIGRATED_REVID=90818739
Diffstat (limited to 'examples/cpp')
-rw-r--r--examples/cpp/hello-fail.cc2
-rw-r--r--examples/cpp/hello-lib.cc3
-rw-r--r--examples/cpp/hello-lib.h2
3 files changed, 1 insertions, 6 deletions
diff --git a/examples/cpp/hello-fail.cc b/examples/cpp/hello-fail.cc
index 5b561cb0ce..5fb2292354 100644
--- a/examples/cpp/hello-fail.cc
+++ b/examples/cpp/hello-fail.cc
@@ -11,7 +11,7 @@ using std::string;
* "test" has failed.
*/
int main(int argc, char** argv) {
- HelloLib lib;
+ HelloLib lib("Hello");
string thing = "barf";
if (argc > 1) {
thing = argv[1];
diff --git a/examples/cpp/hello-lib.cc b/examples/cpp/hello-lib.cc
index 8e40921cee..bceb2683d5 100644
--- a/examples/cpp/hello-lib.cc
+++ b/examples/cpp/hello-lib.cc
@@ -8,9 +8,6 @@ using std::string;
namespace hello {
-HelloLib::HelloLib() : HelloLib("Hello") {
-}
-
HelloLib::HelloLib(const string& greeting) : greeting_(new string(greeting)) {
}
diff --git a/examples/cpp/hello-lib.h b/examples/cpp/hello-lib.h
index 555d177936..e1fe88d8c7 100644
--- a/examples/cpp/hello-lib.h
+++ b/examples/cpp/hello-lib.h
@@ -8,8 +8,6 @@ namespace hello {
class HelloLib {
public:
- HelloLib();
-
explicit HelloLib(const std::string &greeting);
void greet(const std::string &thing);