2 [authors [Vertleyb, Arkadiy], [Holt, Peder]]
3 [copyright 2004 2005 Arkadiy Vertleyb, Peder Holt]
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 <ulink url="http://www.boost.org/LICENSE_1_0.txt">
8 http://www.boost.org/LICENSE_1_0.txt
12 [last-revision $Date$]
15 [section:moti Motivation]
19 Today many template libraries supply object generators to simplify object creation
20 by utilizing the C++ template argument deduction facility. Consider `std::pair`.
21 In order to instantiate this class template and create a temporary object of this instantiation,
22 one has to supply template parameters, as well as parameters to the constructor:
24 std::pair<int, double>(5, 3.14159);
26 To avoid this duplication, STL supplies the `std::make_pair` object generator.
27 When it is used, the types of template parameters are deduced from supplied function arguments:
29 std::make_pair(5, 3.14159);
31 For the temporary objects it is enough. However, when a named object needs to be allocated,
32 the problem appears again:
34 std::pair<int, double> p(5, 3.14159);
36 The object generator no longer helps:
38 std::pair<int, double> p = std::make_pair(5, 3.14159);
40 It would be nice to deduce the type of the object (on the left) from the expression
41 it is initialized with (on the right), but the current C++ syntax does not allow for this.
43 The above example demonstrates the essence of the problem but does not demonstrate its scale.
44 Many libraries, especially expression template libraries, create objects of really complex types,
45 and go a long way to hide this complexity behind object generators. Consider a nit Boost.Lambda functor:
49 If one wanted to allocate a named copy of such an innocently looking functor,
50 she would have to specify something like this:
54 logical_action<and_action>,
58 relational_action<greater_action>,
60 lambda_functor<placeholder<1> >,
67 relational_action<less_action>,
69 lambda_functor<placeholder<2> >,
77 f = _1 > 15 && _2 < 20;
80 Not exactly elegant. To solve this problem (as well as some other problems),
81 the C++ standard committee is considering
82 a few additions to the standard language, such as `typeof/decltype` and `auto` (see
83 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf
84 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf]).
86 The `typeof` operator (or `decltype`, which is a slightly different flavor of `typeof`)
87 allows one to determine the type of an expression at compile time. Using `typeof`,
88 the above example can be simplified drastically:
90 typeof(_1 > 15 && _2 < 20) f = _1 > 15 && _2 < 20;
92 Much better, but some duplication still exists. The `auto` type solves the rest of the problem:
94 auto f = _1 > 15 && _2 < 20;
96 The purpose of the Boost.Typeof library is to provide a library-based solution,
97 which could be used until the language-based facility is added to the Standard
98 and becomes widely available.
102 [section:tuto Tutorial]
104 To start using typeof include the typeof header:
106 #include <boost/typeof/typeof.hpp>
108 To deduce the type of an expression at compile time
109 use the `BOOST_TYPEOF` macro:
113 typedef BOOST_TYPEOF(1 + 0.5) type;
115 BOOST_STATIC_ASSERT((is_same<type, double>::value));
118 In the dependent context use `BOOST_TYPEOF_TPL` instead of `BOOST_TYPEOF`:
122 template<class T, class U>
123 BOOST_TYPEOF_TPL(T() + U()) add(const T& t, const U& u)
128 typedef BOOST_TYPEOF(add('a', 1.5)) type;
130 BOOST_STATIC_ASSERT((is_same<type, double>::value));
133 The above examples are possible because the Typeof Library knows about
134 primitive types, such as `int`, `double`, `char`, etc. The Typeof Library also
135 knows about most types and templates defined by the
136 Standard C++ Library, but the appropriate headers need to be included
137 to take advantage of this:
139 #include <boost/typeof/std/utility.hpp>
143 BOOST_AUTO(p, make_pair(1, 2));
145 BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(p), pair<int, int> >::value));
148 Here `<boost/typeof/std/utility.hpp>` includes `<utility>` and contains
149 knowledge about templates defined there. This naming convention
150 applies in general, for example to let the Typeof Library handle `std::vector`,
151 include `<boost/typeof/std/vector.hpp>`, etc.
153 To deduce the type of a variable from the expression, this variable
154 is initialized with, use the `BOOST_AUTO` macro (or `BOOST_AUTO_TPL`
155 in a dependent context:
157 #include <boost/typeof/std/string.hpp>
161 BOOST_AUTO(p, new int[20]);
163 BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(p), int*>::value));
166 Both `BOOST_TYPEOF` and `BOOST_AUTO` strip top-level qualifiers.
167 Therefore, to allocate for example a reference, it has to be specified explicitly:
173 static string s = "hello";
177 BOOST_AUTO(&s, hello());
180 To better understand this syntax, note that this gets expanded into:
182 BOOST_TYPEOF(hello()) &s = hello();
184 If your define your own type, the Typeof Library cannot handle it
185 unless you let it know about this type. You tell the Typeof Library
186 about a type (or template) by the means of "registering" this type/template.
188 Any source or header file where types/templates are registered has to
189 contain the following line before any registration is done:
191 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
193 After this a type can be registered:
201 BOOST_TYPEOF_REGISTER_TYPE(ex6::MyType)
203 The registration must be done from the context of global namespace;
204 fully qualified type name has to be used.
206 Any number of types can be registered in one file, each on a separate line.
208 Once your type is registered, the Typeof Library can handle it in any context:
212 typedef BOOST_TYPEOF(make_pair(1, MyType())) type;
214 BOOST_STATIC_ASSERT((is_same<type, pair<int, MyType> >::value));
217 A template is registered by specifying its fully qualified name,
218 and describing its parameters. In the simplest case, when all parameters
219 are type parameters, only their number needs to be specified:
223 template<class T, class U>
228 BOOST_TYPEOF_REGISTER_TEMPLATE(ex7::MyTemplate, 2)
232 typedef BOOST_TYPEOF(make_pair(1, MyTemplate<int, ex6::MyType>())) type;
234 BOOST_STATIC_ASSERT((is_same<type,
235 pair<int, MyTemplate<int, ex6::MyType> >
239 When a template has integral template parameters, all parameters need
240 to be described in the preprocessor sequence:
244 template<class T, int n>
249 BOOST_TYPEOF_REGISTER_TEMPLATE(ex8::MyTemplate, (class)(int))
253 typedef BOOST_TYPEOF(make_pair(1, MyTemplate<ex7::MyTemplate<ex6::MyType, int>, 0>())) type;
255 BOOST_STATIC_ASSERT((is_same<type,
256 pair<int, MyTemplate<ex7::MyTemplate<ex6::MyType, int>, 0> >
260 Please see the reference for more details.
264 [section:refe Reference]
266 [section:auto AUTO, AUTO_TPL]
268 The `BOOST_AUTO` macro emulates the proposed `auto` keyword in C++.
273 BOOST_AUTO_TPL(var,expr)
275 [variablelist Arguments
276 [[var][a variable to be initialized with the expression]]
277 [[expr][a valid c++ expression]]
282 If you want to use `auto` in a template-context, use `BOOST_AUTO_TPL(expr)`,
283 which takes care of the `typename` keyword inside the `auto` expression.
291 BOOST_AUTO(c, a * b);
296 [section:compl COMPLIANT]
298 The `BOOST_TYPEOF_COMPLIANT` macro can be used to force the emulation mode.
299 Define it if your compiler by default uses another mode, such as native `typeof`
300 or Microsoft-specific trick, but you want to use the emulation mode,
301 for example for portability reasons.
305 [section:incr INCREMENT_REGISTRATION_GROUP]
307 The `BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP` macro ensures that type registrations
308 in different header files receive unique identifiers.
312 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
316 specified once in every cpp/hpp file where any registration is performed,
317 before any registration.
321 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
324 BOOST_TYPEOF_REGISTER_TYPE(X)
328 [section:inte INTEGRAL]
330 The `BOOST_TYPEOF_INTEGRAL` macro is used when registering an integral
331 template parameter using `BOOST_TYPEOF_REGISTER_TEMPLATE`.
333 Useful for `enum`s and dependent integral template parameters.
337 BOOST_TYPEOF_INTEGRAL(x)
339 [variablelist Arguments
340 [[x][a fully qualified integral type or enum]]
345 A short syntax has been implemented for the built in types
346 (int, bool, long, unsigned long, etc.)
347 Other non-type template parameters (e.g. pointer to member)
352 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
356 enum color {red, green, blue};
358 template<color C0,typename T1>
359 class class_with_enum {};
361 template<typename T0,T0 I1>
362 class class_with_dependent_non_type {};
365 BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_enum,
366 (BOOST_TYPEOF_INTEGRAL(foo::color))
370 BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_dependent_non_type,
372 (BOOST_TYPEOF_INTEGRAL(P0))
377 [section:limit_func LIMIT_FUNCTION_ARITY]
379 The `BOOST_TYPEOF_LIMIT_FUNCTION_ARITY` macro defines how many parameters
380 are supported for functios, and applies to functions, function pointers,
381 function references, and member function pointers. The default value is 10.
382 Redefine if you want the Typeof Library to handle functions with more parameters.
386 [section:messages MESSAGES]
388 Define `BOOST_TYPEOF_MESSAGE` before including boost/typeof/typeof.hpp to
389 include messages "using typeof emulation" and "using native typeof".
390 By default, these messages will not be displayed.
394 [section:limit_size LIMIT_SIZE]
396 The `BOOST_TYPEOF_LIMIT_SIZE` macro defines the size of the compile-time sequence
397 used to encode a type. The default value is 50. Increase it if you want
398 the Typeof Library to handle very complex types, although this
399 possibility is limited by the maximum number of template parameters supported
400 by your compiler. On the other hand, if you work only with very simple types,
401 decreasing this number may help to boost compile-time performance.
405 [section:regtype REGISTER_TYPE]
407 The `BOOST_TYPEOF_REGISTER_TYPE` macro informs the Typeof Library
408 about the existence of a type
412 BOOST_TYPEOF_REGISTER_TYPE(x)
414 [variablelist Arguments
415 [[x][a fully qualified type]]
420 Must be used in the global namespace
424 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
429 enum color {red, green, blue};
432 BOOST_TYPEOF_REGISTER_TYPE(foo::bar)
433 BOOST_TYPEOF_REGISTER_TYPE(foo::color)
437 [section:regtemp REGISTER_TEMPLATE]
439 The `BOOST_TYPEOF_REGISTER_TEMPLATE` macro informs the Typeof Library
440 about the existence of a template and describes its parameters
444 BOOST_TYPEOF_REGISTER_TEMPLATE(x, n)
445 BOOST_TYPEOF_REGISTER_TEMPLATE(x, seq)
447 [variablelist Arguments
448 [[x][a fully qualified template]]
449 [[n][the number of template arguments. Only valid if all template arguments are typenames]]
450 [[seq][a sequence of template arguments. Must be used when integral or template template parameters are present]]
455 Must be used in the global namespace.
457 The library allows registration of templates with type, integral,
458 and template template parameters:
460 * A type template parameter is described by the `(class)` or `(typename)` sequence element
461 * A template parameter of a well-known integral type can be described by
462 simply supplying its type, like `(unsigned int)`.
463 The following well-known integral types are supported:
464 * `[signed/unsigned] char`
471 * Enums and typedefs of integral types, need to be described explicitly
472 with the `BOOST_TYPEOF_INTEGRAL` macro, like `(BOOST_TYPEOF_INTEGRAL(MyEnum))`
473 * Template template parameters are described with the `BOOST_TYPEOF_TEMPLATE` macro,
474 like: `(BOOST_TYPEOF_TEMPLATE((class)(unsigned int)))`.
475 In case of all type parameters this can be shortened to something like `(BOOST_TYPEOF_TEMPLATE(2))`.
476 The nested template template parameters are not supported.
480 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
484 template<typename T0, typename T1>
485 class simple_template {};
487 template<typename T0, int I1>
488 class class_with_integral_constant {};
491 BOOST_TYPEOF_REGISTER_TEMPLATE(foo::simple_template, 2)
492 BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_integral_constant, (typename)(int))
496 [section:temp TEMPLATE]
498 The `BOOST_TYPEOF_TEMPLATE` macro is used when registering template template parameters
499 using `BOOST_TYPEOF_REGISTER_TEMPLATE`.
503 BOOST_TYPEOF_TEMPLATE(n)
504 BOOST_TYPEOF_TEMPLATE(seq)
506 [variablelist Arguments
507 [[n][the number of template arguments. Only valid if all template arguments are typenames]]
508 [[seq][a sequence of template arguments. Must be used when there are integral constants in the nested template]]
513 Can not be used to register nested template template parameters.
517 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
521 enum color {red, green, blue};
523 template<color C0, template<typename> class T1>
524 class nested_template_class {};
526 template<template<typename, unsigned char> class T1>
527 class nested_with_integral {};
530 BOOST_TYPEOF_REGISTER_TEMPLATE(foo::nested_template_class,
532 (BOOST_TYPEOF_TEMPLATE(1))
535 BOOST_TYPEOF_REGISTER_TEMPLATE(foo::nested_with_integral,
536 (BOOST_TYPEOF_TEMPLATE((typename)(unsigned char)))
541 [section:typo TYPEOF, TYPEOF_TPL]
543 The `BOOST_TYPEOF` macro calculates the type of an expression,
544 but removes the top-level qualifiers, `const&`
549 BOOST_TYPEOF_TPL(expr)
551 [variablelist Arguments
552 [[expr][a valid c++ expression that can be bound to const T&]]
557 If you want to use `typeof` in a template-context, use `BOOST_TYPEOF_TPL(expr)`,
558 which takes care of `typename` inside the `typeof` expression.
562 template<typename A, typename B>
563 struct result_of_conditional
565 typedef BOOST_TYPEOF_TPL(true?A():B()) type;
568 template<typename A, typename B>
569 result_of_conditional<A, B>::type min(const A& a,const B& b)
571 return a < b ? a : b;
576 [section:typn TYPEOF_NESTED_TYPEDEF, TYPEOF_NESTED_TYPEDEF_TPL]
578 The `TYPEOF_NESTED_TYPEDEF` macro works in much the same way as the 'TYPEOF' macro does, but
579 workarounds several compiler deficiencies.
583 BOOST_TYPEOF_NESTED_TYPEDEF(name,expr)
584 BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr)
586 [variablelist Arguments
587 [[name][a valid identifier to nest the typeof operation inside]
588 [expr][a valid c++ expression that can be bound to const T&]]
593 'typeof_nested_typedef' nests the 'typeof' operation inside a struct. By doing this, the 'typeof' operation
594 can be split into two steps, deconfusing several compilers (notably VC7.1 and VC8.0) on the way.
595 This also removes the limitation imposed by `BOOST_TYPEOF_LIMIT_SIZE` and allows you to use 'typeof' on much
598 If you want to use `typeof_nested_typedef` in a template-context, use `BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr)`,
599 which takes care of `typename` inside the `typeof` expression.
601 'typeof_nested_typedef' can not be used at function/block scope.
605 template<typename A, typename B>
606 struct result_of_conditional
608 BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B())
609 typedef typename nested::type type;
612 template<typename A, typename B>
613 result_of_conditional<A, B>::type min(const A& a,const B& b)
615 return a < b ? a : b;
622 [section:other Other considerations and tips]
624 [section:natem Native typeof support and emulation]
626 Many compilers support typeof already, most noticeable GCC and Metrowerks.
628 Igor Chesnokov discovered a method that allows to implement `typeof`
629 on the VC series of compilers. It uses a bug in the Microsoft compiler
630 that allows a nested class of base to be defined in a class derived from base:
632 template<int ID> struct typeof_access
634 struct id2type; //not defined
637 template<class T, int ID> struct typeof_register : typeof_access
639 // define base's nested class here
640 struct typeof_access::id2type
646 //Type registration function
647 typeof_register<T, compile-time-constant> register_type(const T&);
649 //Actually register type by instantiating typeof_register for the correct type
650 sizeof(register_type(some-type));
652 //Use the base class to access the type.
653 typedef typeof_access::id2type::type type;
655 Peder Holt adapted this method to VC7.0, where the nested class
656 is a template class that is specialized in the derived class.
658 In VC8.0, it seemed that all the bug-featire had been fixed, but
659 Steven Watanabe managed to implement a more rigorous version of the VC7.0 fix that
660 enables 'typeof' to be supported 'natively' here as well.
662 For many other compilers neither native `typeof` support
663 nor the trick described above is an option. For such compilers
664 the emulation method is the only way of implementing `typeof`.
666 According to a rough estimate, at the time of this writing
667 the introduction of the `typeof`, `auto`, etc., into the C++ standard
668 may not happen soon. Even after it's done, some time still has to pass
669 before most compilers implement this feature. But even after that,
670 there always are legacy compilers to support (for example now, in 2005,
671 many people are still using VC6, long after VC7.x, and even VC8.0 beta became available).
673 Considering extreme usefulness of the feature right now,
674 it seems to make sense to implement it at the library level.
676 The emulation mode seems to be important even if a better option is present
677 on some particular compiler. If a library author wants to develop portable
678 code using `typeof`, she needs to use emulation mode and register her types and
679 templates. Those users who have a better option can still take
680 advantage of it, since the registration macros are defined as no-op on
681 such compilers, while the users for whom emulation is the only option will use it.
683 The other consideration applies to the users of VC7.1. Even though the more
684 convenient `typeof` trick is available, the possibility of upgrade to VC8,
685 where emulation remains the only option, should be considered.
687 The emulation mode can be forced on the compilers that don't use it
688 by default by defining the `BOOST_TYPEOF_COMPLIANT` symbol:
690 g++ -D BOOST_TYPEOF_COMPLIANT -I \boost\boost_1_32_0 main.cpp
694 [section:parties The three participating parties]
696 The Lambda example from the Motivation section requires the following registration:
698 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
700 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::tuples::tuple, 2);
701 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor, 1);
702 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor_base, 2);
703 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::relational_action, 1);
704 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::logical_action, 1);
705 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::other_action, 1);
706 BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::greater_action);
707 BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::less_action);
708 BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::and_action);
709 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::placeholder, (int));
711 It may seem that the price for the ability to discover the expression's type
712 is too high: rather large amount of registration is required.
713 However note that all of the above registration is done only once,
714 and after that, any combination of the registered types and templates
715 would be handled. Moreover, this registration is typically done
716 not by the end-user, but rather by a layer on top of some library
717 (in this example -- Boost.Lambda).
719 When thinking about this, it's helpful to consider three parties: the typeof facility,
720 the library (probably built on expression templates principle), and the end-user.
721 The typeof facility is responsible for registering fundamental types.
722 The library can register its own types and templates.
724 In the best-case scenario, if the expressions always consist of only
725 fundamental types and library-defined types and templates, a library author
726 can achieve the impression that the `typeof` is natively supported for her library.
727 On the other hand, the more often expressions contain user-defined types,
728 the more responsibility is put on the end-user, and therefore the less attractive
729 this approach becomes.
731 Thus, the ratio of user-defined types in the expressions should be the main
732 factor to consider when deciding whether or not to apply the typeof facility.
736 [section:features Supported features]
738 The Typeof library pre-registers fundamental types. For these types,
739 and for any other types/templates registered by the user library or end-user,
740 any combination of the following is supported:
743 * References (except top-level);
744 * Consts (except top-level);
745 * Volatiles (except top-level);
747 * Functions, function pointers, and references;
748 * Pointers to member functions;
749 * Pointers to data members.
751 For example the following type:
753 int& (*)(const volatile char*, double[5], void(*)(short))
755 is supported right away, and something like:
757 void (MyClass::*)(int MyClass::*, MyClass[10]) const
759 is supported provided `MyClass` is registered.
761 The Typeof Library also provides registration files for most STL classes/templates.
762 These files are located in the std subdirectory, and named after corresponding STL headers.
763 These files are not included by the typeof system and have to be explicitly included
764 by the user, as needed:
766 #include <boost/typeof/std/functional.hpp>
767 BOOST_AUTO(fun, std::bind2nd(std::less<int>(), 21)); //create named function object for future use.
771 [section:what What needs to be registered?]
773 It is possible to take advantage of the compiler when registering types for the Typeof Library.
774 Even though there is currently no direct support for typeof in the language,
775 the compiler is aware of what the type of an expression is, and gives an error
776 if it encounters an expression that has not been handled correctly. In the `typeof` context,
777 this error message will contain clues to what types needs to be registered with the
778 Typeof Library in order for `BOOST_TYPEOF` to work.
782 template<typename A,bool B>
785 std::pair<X,Y<int,true> > a;
789 We get the following error message from VC7.1
792 error C2504: 'boost::type_of::'anonymous-namespace'::encode_type_impl<V,Type_Not_Registered_With_Typeof_System>' : base
796 V=boost::type_of::'anonymous-namespace'::encode_type_impl<boost::mpl::vector0<boost::mpl::na>,std::pair<X,Y<int,true>>>::V0,
797 Type_Not_Registered_With_Typeof_System=X
801 Inspecting this error message, we see that the compiler complains about `X`
803 BOOST_TYPEOF_REGISTER_TYPE(X); //register X with the typeof system
805 Recompiling, we get a new error message from VC7.1
808 error C2504: 'boost::type_of::'anonymous-namespace'::encode_type_impl<V,Type_Not_Registered_With_Typeof_System>' : base
812 V=boost::type_of::'anonymous-namespace'::encode_type_impl<boost::mpl::vector0<boost::mpl::na>,std::pair<X,Y<int,true>>>::V1,
813 Type_Not_Registered_With_Typeof_System=Y<int,true>
817 Inspecting this error message, we see that the compiler complains about `Y<int,true>`.
818 Since `Y` is a template, and contains integral constants, we need to take more care when registering:
820 BOOST_TYPEOF_REGISTER_TEMPLATE(Y,(typename)(bool)); //register template class Y
822 It is a good idea to look up the exact definition of `Y` when it contains integral constants.
823 For simple template classes containing only typenames, you can rely solely on the compiler error.
825 The above code now compiles.
827 This technique can be used to get an overview of which types needs to be registered
828 for a given project in order to support `typeof`.
832 [section:limi Limitations]
834 Nested template template parameters are not supported, like:
836 template<template<template<class> class> class Tpl>
837 class A; // can't register!
839 Classes and templates nested inside other templates also can't be registered
840 because of the issue of nondeduced context. This limitation is most noticeable
841 with regards to standard iterators in Dinkumware STL, which are implemented
842 as nested classes. Instead, instantiations can be registered:
844 BOOST_TYPEOF_REGISTER_TYPE(std::list<int>::const_iterator)
850 [section:cont Contributed By:]
852 * Compliant compilers -- Arkadiy Vertleyb, Peder Holt
853 * MSVC 6.5, 7.0, 7.1 -- Igor Chesnokov, Peder Holt
857 [section:ackn Acknowledgements]
859 The idea of representing a type as multiple compile-time integers,
860 and passing these integers across function boundaries using sizeof(),
861 was taken from Steve Dewhurst's article "A Bitwise typeof Operator", CUJ 2002.
862 This article can also be viewed online, at [@http://www.semantics.org/localarchive.html
863 http://www.semantics.org/localarchive.html].
865 Special thank you to Paul Mensonides, Vesa Karvonen, and Aleksey Gurtovoy
866 for the Boost Preprocessor Library and MPL. Without these two libraries,
867 this typeof implementation would not exist.
869 The following people provided support, gave valuable comments,
870 or in any other way contributed to the library development
871 (in alphabetical order):