From d25b0cfd59c9705901f99543e5e92d04c558403d Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Fri, 6 Jun 2014 23:52:29 +0200 Subject: [PATCH] improved example in tutorial --- doc/01_quick_start.qbk | 4 ++-- .../boost_optional/quick_start/optional_data_members.html | 4 ++-- doc/html/index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/01_quick_start.qbk b/doc/01_quick_start.qbk index 2b642df..fee59c5 100644 --- a/doc/01_quick_start.qbk +++ b/doc/01_quick_start.qbk @@ -88,12 +88,12 @@ Suppose we want to implement a ['lazy load] optimization. This is because we do class Widget { - boost::optional resource_; + mutable boost::optional resource_; public: Widget() {} - Resource& getResource() // not thread-safe + const Resource& getResource() const // not thread-safe { if (resource_ == boost::none) resource_.emplace("resource", "arguments"); diff --git a/doc/html/boost_optional/quick_start/optional_data_members.html b/doc/html/boost_optional/quick_start/optional_data_members.html index 505f0ce..abb5589 100644 --- a/doc/html/boost_optional/quick_start/optional_data_members.html +++ b/doc/html/boost_optional/quick_start/optional_data_members.html @@ -35,12 +35,12 @@

class Widget
 {
-  boost::optional<Resource> resource_;
+  mutable boost::optional<const Resource> resource_;
 
 public:
   Widget() {}
 
-  Resource& getResource() // not thread-safe
+  const Resource& getResource() const // not thread-safe
   {
     if (resource_ == boost::none)
         resource_.emplace("resource", "arguments");
diff --git a/doc/html/index.html b/doc/html/index.html
index f981d82..297e7be 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -129,7 +129,7 @@
 
 
 
-
+

Last revised: June 06, 2014 at 21:22:06 GMT

Last revised: June 06, 2014 at 21:50:26 GMT