diff --git a/doc/add_lvalue_reference.qbk b/doc/add_lvalue_reference.qbk
new file mode 100644
index 0000000..4416816
--- /dev/null
+++ b/doc/add_lvalue_reference.qbk
@@ -0,0 +1,47 @@
+[/
+ Copyright 2010 John Maddock.
+ 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).
+]
+
+[section:add_lvalue_reference add_lvalue_reference]
+
+ template
@@ -84,7 +84,7 @@ given.
@@ -174,7 +174,7 @@ in the default template.
@@ -247,7 +247,7 @@ otherwise it will call the "slow but safe version".
@@ -280,7 +280,7 @@
Table 1.1. Time taken to copy 1000 elements using `copy<const T*, T*>` (times +
Table 1.1. Time taken to copy 1000 elements using `copy<const T*, T*>` (times in micro-seconds)
@@ -416,7 +416,7 @@ to hold non-reference types, references, and constant references:
Table 1.2. Required Constructor Argument Types
+Table 1.2. Required Constructor Argument Types
![]() |
+Home | +Libraries | +People | +FAQ | +More | +
+ An improved std::min
function could be written like this:
+
template <class T, class U> +typename common_type<T, U>::type min(T t, T u) +{ + return t < u ? t : u; +} ++
+ And now expressions such as: +
+min(1, 2.0) ++
+ will actually compile and return the correct type! +
++ | + |