From e270dda904c3bd5b7028ad609b9b6e360091a184 Mon Sep 17 00:00:00 2001 From: neingeist Date: Sun, 13 Apr 2014 15:03:24 +0200 Subject: [PATCH] initialize members in object-lifetime.cpp --- object-lifetime.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/object-lifetime.cpp b/object-lifetime.cpp index ec0bef5..cd6cb64 100644 --- a/object-lifetime.cpp +++ b/object-lifetime.cpp @@ -14,7 +14,10 @@ struct C { A a; B b; - C() { puts("C()"); } + C() + : a(), b() { + puts("C()"); + } ~C() { puts("~C()"); } };