diff --git a/doc/common_type.qbk b/doc/common_type.qbk
new file mode 100644
index 0000000..71cfbf6
--- /dev/null
+++ b/doc/common_type.qbk
@@ -0,0 +1,219 @@
+
+[/===================================================================]
+[section:common_type common_type]
+[/===================================================================]
+
+[def __declval [@../../../utility/doc/html/declval.html declval]]
+
+
+`#include
@@ -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! +
++ | + |