From b2fcd4dcdeb0f4962f8c8a1ce1a6fd64c2014062 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Aug 2011 13:32:25 +0200 Subject: Add support for boost::optional and boost::shared_ptr as value wrappers New test: boost/common/optional. --- boost/employee.hxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'boost/employee.hxx') diff --git a/boost/employee.hxx b/boost/employee.hxx index ffa017e..952f065 100644 --- a/boost/employee.hxx +++ b/boost/employee.hxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -86,7 +87,20 @@ public: const std::string& last, const date& born, shared_ptr employer) - : first_ (first), last_ (last), born_ (born), employer_ (employer) + : first_ (first), last_ (last), + born_ (born), + employer_ (employer) + { + } + + employee (const std::string& first, + const std::string& middle, + const std::string& last, + const date& born, + shared_ptr employer) + : first_ (first), middle_ (middle), last_ (last), + born_ (born), + employer_ (employer) { } @@ -98,6 +112,12 @@ public: return first_; } + const boost::optional& + middle () const + { + return middle_; + } + const std::string& last () const { @@ -151,6 +171,7 @@ private: unsigned long id_; std::string first_; + boost::optional middle_; std::string last_; date born_; -- cgit v1.1