From a5c7239fa9b475ef4a3c4df30936f18ca991784d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Mon, 3 Nov 2003 20:43:50 +0000 Subject: [PATCH] fixes on the lazy stuff [SVN r1729] --- doc/enable_if.html | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/doc/enable_if.html b/doc/enable_if.html index 24cf69e..349189e 100644 --- a/doc/enable_if.html +++ b/doc/enable_if.html @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@ enable_if

-Copyright 2003 Jaakko Järvi, Jeremiah Willcock, Andrew Lumsdaine.
+Copyright 2003 Jaakko Järvi, Jeremiah Willcock, Andrew Lumsdaine.

@@ -261,8 +261,8 @@ partial specializations as well.

3.3  Lazy enable_if

-The standard is not entirely clear on how deep into nested template instantiations SFINAE applies, -and there is variation among compilers. For example: +In some cases it is necessary to avoid instantiating part of a +function signature unless an enabling condition is true. For example:
 
 template <class T, class U> class mult_traits;
@@ -294,6 +294,18 @@ operator*(const T& t, const U& u) { ... }
 that defines a nested type named type whenever the first
 parameter (the condition) is true.

+ + +
Note
+ +Referring to one member type or static constant in a traits class +causes all of the members (type and static constant) of that +specialization to be instantiated. Therefore, if your traits classes +can sometimes contain invalid types, you should use two distinct +templates for describing the conditions and the type mappings. In the +above example, is_multipliable<T, U>::value defines when +mult_traits<T, U>::type is valid.
+

3.4  Compiler workarounds

@@ -367,16 +379,16 @@ Smith whose findings have influenced the library.

References

[1]
-Jaakko Järvi, Jeremiah Willcock, Howard Hinnant, and Andrew Lumsdaine. +Jaakko Järvi, Jeremiah Willcock, Howard Hinnant, and Andrew Lumsdaine. Function overloading based on arbitrary properties of types. C/C++ Users Journal, 21(6):25--32, June 2003.

[2]
-Jaakko Järvi, Jeremiah Willcock, and Andrew Lumsdaine. +Jaakko Järvi, Jeremiah Willcock, and Andrew Lumsdaine. Concept-controlled polymorphism. -In Proceedings of Generative Programming and Component - Engineering (GPCE'03), September 2003. -To appear.
+In Frank Pfennig and Yannis Smaragdakis, editors, Generative + Programming and Component Engineering, volume 2830 of LNCS, pages + 228--244. Springer Verlag, September 2003.

[3]
David Vandevoorde and Nicolai M. Josuttis. @@ -390,7 +402,7 @@ Addison-Wesley, 2002.

Contributed by:
-Jaakko Järvi, Jeremiah Willcock and Andrew Lumsdaine
+Jaakko Järvi, Jeremiah Willcock and Andrew Lumsdaine
{jajarvi|jewillco|lums}@osl.iu.edu
Indiana University
Open Systems Lab