diff --git a/doc/reference/flyweight.html b/doc/reference/flyweight.html
index e9b7644..6dad28d 100644
--- a/doc/reference/flyweight.html
+++ b/doc/reference/flyweight.html
@@ -298,7 +298,9 @@ objects constructed from equivalent keys.
const key_type& get_key()const;
const value_type& get()const;
+ const value_type& operator*()const;
operator const value_type&()const;
+ const value_type* operator->()const;
// modifiers:
@@ -499,6 +501,7 @@ if KeyFromValue was not provided, nothrow.
const value_type& get()const;
+ const value_type& operator*()const;
operator const value_type&()const;
@@ -507,6 +510,14 @@ object.+
Exception safety:nothrow.
const value_type* operator->()const
+
++Returns: The address of the value associated to the+flyweight+object.
+Exception safety:nothrow. +
void swap(flyweight& x);
@@ -784,9 +795,9 @@ Key-value flyweights
Revised March 15th 2020
+Revised March 17th 2023
-© Copyright 2006-2020 Joaquín M López Muñoz. +
© Copyright 2006-2023 Joaquín M López Muñoz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at
diff --git a/doc/release_notes.html b/doc/release_notes.html
index 35a04cc..3ebacf6 100644
--- a/doc/release_notes.html
+++ b/doc/release_notes.html
@@ -31,6 +31,7 @@ Acknowledgements
+Contents
+
+Boost 1.83 release
+
+
+
+boost::flyweight (operator*
+ and operator-> dereferencing to the underlying value).
@@ -228,7 +238,7 @@ Acknowledgements
-
Revised February 26th 2023
+Revised March 17th 2023
© Copyright 2006-2023 Joaquín M López Muñoz.
Distributed under the Boost Software
diff --git a/doc/tutorial/basics.html b/doc/tutorial/basics.html
index 0e473be..6504c60 100644
--- a/doc/tutorial/basics.html
+++ b/doc/tutorial/basics.html
@@ -128,24 +128,24 @@ unchanged after the redefinition of user_entry:
Besides, flyweight<T> is convertible to
-const T&, either implicitly or through the get
-member function:
+const T& implicitly, or explicitly using the get
+member function. Smart-pointer syntax can also be used:
@@ -257,9 +257,9 @@ Key-value flyweightsstd::string full_name(const user_entry& user) { - std::string full; +std::string full; - full.reserve( - user.first_name.get().size()+ // get() returns the underlying - user.last_name.get().size()+1); // const std::string& +full.reserve( +user.first_name.get().size()+ // get() returns the underlying const std::string& +user.last_name->size()+1); // flyweights also work as pointers to their + // underlying value +full+=user.first_name; // implicit conversion is used here +full+=" "; +full+=user.last_name; - full+=user.first_name; // implicit conversion is used here - full+=" "; - full+=user.last_name; - - return full; +return full; }
Revised April 24th 2019
+Revised March 17th 2023
-© Copyright 2006-2019 Joaquín M López Muñoz. +
© Copyright 2006-2023 Joaquín M López Muñoz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at
diff --git a/example/basic.cpp b/example/basic.cpp
index 286f735..0d88fa3 100644
--- a/example/basic.cpp
+++ b/example/basic.cpp
@@ -1,6 +1,6 @@
/* Boost.Flyweight basic example.
*
- * Copyright 2006-2020 Joaquin M Lopez Munoz.
+ * Copyright 2006-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -92,10 +92,13 @@ std::string full_name(const user_entry& user)
{
std::string full;
- /* get() returns the underlying const std::string& */
+ /* get() returns the underlying const std::string&.
+ * Smart-pointer syntax can also be used.
+ */
full.reserve(
- user.first_name.get().size()+user.last_name.get().size()+1);
+ user.first_name.get().size()+ /* using get() */
+ user.last_name->size()+1); /* using operator-> */
/* here, on the other hand, implicit conversion is used */
diff --git a/example/html.cpp b/example/html.cpp
index 1fa6d34..e036b57 100644
--- a/example/html.cpp
+++ b/example/html.cpp
@@ -1,6 +1,6 @@
/* Boost.Flyweight example of flyweight-based formatted text processing.
*
- * Copyright 2006-2014 Joaquin M Lopez Munoz.
+ * Copyright 2006-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -192,7 +192,7 @@ void scan_html(ForwardIterator first,ForwardIterator last,OutputIterator out)
for(html_context_data::reverse_iterator rit=context.rbegin();
rit!=context.rend();++rit){
- if(rit->get().name==res.tag.get().name){
+ if(rit->get().name==res.tag->name){
context.erase(rit.base()-1,context.end());
break;
}
diff --git a/include/boost/flyweight/flyweight.hpp b/include/boost/flyweight/flyweight.hpp
index c00c168..ca0b483 100644
--- a/include/boost/flyweight/flyweight.hpp
+++ b/include/boost/flyweight/flyweight.hpp
@@ -1,6 +1,6 @@
/* Flyweight class.
*
- * Copyright 2006-2022 Joaquin M Lopez Munoz.
+ * Copyright 2006-2023 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
#include