Coalesce constructors using a default value.

This commit is contained in:
Bård Skaflestad 2012-02-01 16:40:15 +01:00
parent a785d9488e
commit 08671a1d6d

View File

@ -43,11 +43,15 @@ namespace Opm {
namespace Polymer {
class Hello {
public:
Hello() : designee_("world") {}
Hello(const std::string& dsgn) : designee_(dsgn) {}
Hello(const ::std::string& dsgn = ::std::string("world"))
: designee_(dsgn)
{}
template <class Ostream>
friend Ostream& operator<< (Ostream& os, const Hello& h);
friend
Ostream&
operator<< (Ostream& os, const Hello& h);
private:
::std::string designee_;
};