Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/tr1/doc/tr1.qbk @ 44

Last change on this file since 44 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 59.4 KB
Line 
1[library Boost.TR1
2    [copyright 2005 John Maddock]
3    [purpose An implementation of the C++ Technical Report on Standard Library Extensions]
4    [license
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</ulink>)]
9    [authors [Maddock, John]]
10    [category misc]
11    [last-revision $Date: 2007/05/09 17:20:56 $]
12]
13
14[section:intro Introduction]
15
16This documentation is
17[@http://boost-consulting.com/vault/index.php?action=downloadfile&filename=boost_tr1-1.34.pdf&directory=PDF%20Documentation&
18also available in printer-friendly PDF format].
19
20The TR1 library provides an implementation of the C++ Technical Report on Standard Library Extensions.
21This library does not itself implement the TR1 components, rather it's a thin wrapper that will
22include your standard library's TR1 implementation (if it has one), otherwise it will include the Boost
23Library equivalents, and import them into namespace `std::tr1`.
24
25[endsect]
26
27[section:usage Usage]
28There are two things you need to decide before using the Boost.TR1 library:
29whether to use your standard library's native TR1 implementation (if it has one),
30and which include style to use.
31
32[section:native Whether to use Your Native TR1 Library]
33If your standard library implements the TR1, and you want to make
34use of it, rather than use the Boost equivalents, then you will need to
35take some explicit action to enable it: this may be a pre-processor
36define, a special compiler switch, or a different include path.
37You will need to consult your compilers documentation to find out
38which of these
39actions you need to take.
40
41Provided Boost is [link boost_tr1.config correctly configured],
42everything should
43now "just work", and code written to use Boost.TR1 will include
44your standard library's native headers rather than the Boost ones.
45
46[endsect]
47
48[section:include_style Header Include Style]
49
50There are two ways you can include the Boost.TR1 headers,
51for example if you are interested in shared_ptr then you can either use:
52
53   #include <boost/tr1/memory.hpp>
54   
55or:
56
57   #include <memory>
58   
59The first option is the preferred method for other Boost libraries
60to use.  The second option is standard-conforming, but requires that you
61add `boost-install-path/boost/tr1/tr1` to your compiler's include search path. 
62Note that you must not copy the headers in boost/tr1/tr1 into a directory
63called "include", doing so will cause them to cease working.
64
65[blurb [*Important Note #1]\n\n
66The include path order is very important if you want this library to work
67correctly.  If you get compiler errors then suspect the include paths.  The
68correct order is:\n\n
691) boost-root/boost/tr1/tr1\n
702) boost-root\n
713) Any other standard library replacements (STLport for example).\n
724) Your regular standard library.]
73
74[blurb [*Important Note #2: Borland C++ Users]\n\n
75Borland's compiler has a particularly broken form of `#include`, that
76will actually look for a file named `array.h` if you `#include <array>`.
77In order to make this library work with Borland's compiler you will need to
78set up the include paths as follows:\n\n
791) boost-root/boost/tr1/tr1/bcc32\n
802) boost-root/boost/tr1/tr1\n
813) boost-root\n
824) Any other standard library replacements (STLport for example).\n
835) Your regular standard library.]
84
85[blurb [*Important Note #3: Sun C++ Users]\n\n
86Sun's compiler has a particularly interesting form of `#include`, that
87will actually look for a file named `array.SUNWCCh` if you `#include <array>`.
88In order to make this library work with Sun's compiler you will need to
89set up the include paths as follows:\n\n
901) boost-root/boost/tr1/tr1/sun\n
912) boost-root/boost/tr1/tr1\n
923) boost-root\n
934) Any other standard library replacements (STLport for example).\n
945) Your regular standard library.]
95
96[endsect]
97
98[endsect]
99
100[section:config Configuration]
101
102Configuring Boost.TR1 is no different to configuring any other part of
103Boost; in the majority of cases you shouldn't actually need to do anything at all.
104However, because Boost.TR1 will inject Boost components into namespace std::tr1
105it is more than usually sensitive to an incorrect configuration.
106
107The intention is that
108[@../../libs/config/index.html Boost.Config]
109will automaticaly define the configuration
110macros used by this library, so that if your standard library is set up to
111support TR1 (note that few are at present) then this will be detected and Boost.TR1
112will use your standard library versions of these components rather than the
113Boost ones.
114
115If you would prefer to use the Boost versions of the TR1 conponents rather than
116your standard library, then either: include the Boost headers directly
117
118   #include <boost/regex.hpp>
119   
120   boost::regex e("myregex"); //etc
121   
122Or else don't enable TR1 in your standard library: since TR1 is not part of
123the current standard, there should be some option to disable it in your
124compiler or standard library.
125
126The configuration macros used by each TR1 component are documented in each
127library section (and all together in the
128[@../../libs/config/index.html Boost.Config]
129documentation), but defining BOOST_HAS_TR1 will turn on native TR1 support
130for everything (if your standard library has it), which can act as a
131convenient shortcut.
132
133[blurb [*Note for gcc users]\n\n
134Boost.TR1 does not currently enable gcc's native TR1 implementation
135as this is currently in an early stage of development.  However, you may
136choose to do so by defining BOOST_HAS_GCC_TR1.]
137
138[endsect]
139
140[section:subject_list TR1 By Subject]
141
142[section:ref Reference Wrappers.]
143   
144   #include <boost/tr1/functional.hpp>
145
146or
147
148   #include <functional>
149   
150The Ref library is a small library that is useful for passing
151references to function templates (algorithms) that would usually
152take copies of their arguments. It defines the class template
153`reference_wrapper<T>`,
154and the two functions
155`ref` and `cref` that return
156instances of `reference_wrapper<T>`.
157[@../../doc/html/ref.html Refer to Boost.Bind for more information.]
158
159   namespace std {
160   namespace tr1 {
161
162   template <class T> class reference_wrapper;
163
164   template <class T> reference_wrapper<T> ref(T&);
165   template <class T> reference_wrapper<const T> cref(const T&);
166   template <class T> reference_wrapper<T> ref(reference_wrapper<T>);
167   template <class T> reference_wrapper<const T> cref(reference_wrapper<T>);
168
169   } // namespace tr1
170   } // namespace std
171
172[*Configuration:]
173[@../../libs/config/index.html Boost.Config] should (automatically) define
174the macro BOOST_HAS_TR1_REFERENCE_WRAPPER if your
175standard library implements this part of TR1.
176
177[*Standard Conformity:]
178The Boost version of this this component does not currently support
179function call invocation (2.1.2.4), or derivation from std::unary_function
180or std::binary_function (2.1.2 paragraphs 3 and 4).
181
182The Boost version is not implicitly convertible to T& as the TR requires.
183
184[endsect]
185
186[section:ptrs Smart Pointers.]
187
188   #include <boost/tr1/memory.hpp>
189
190or
191
192   #include <memory>
193
194The `shared_ptr` class template stores a pointer to a dynamically allocated
195object, typically with a C++ new-expression. The object pointed to is
196guaranteed to be deleted when the last `shared_ptr` pointing to it is
197destroyed or reset. For more information refer to the
198[@../../libs/smart_ptr/shared_ptr.htm shared_ptr]
199and [@../../libs/smart_ptr/weak_ptr.htm weak_ptr] documentation.
200   
201   namespace std {
202   namespace tr1 {
203
204   class bad_weak_ptr;
205
206   // [2.2.3] Class template shared_ptr
207   template<class T> class shared_ptr;
208
209   // [2.2.3.6] shared_ptr comparisons
210   template<class T, class U> bool operator==(shared_ptr<T> const& a, shared_ptr<U> const& b);
211   template<class T, class U> bool operator!=(shared_ptr<T> const& a, shared_ptr<U> const& b);
212   template<class T, class U> bool operator<(shared_ptr<T> const& a, shared_ptr<U> const& b);
213
214   // [2.2.3.8] shared_ptr specialized algorithms
215   template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b);
216
217   // [2.2.3.9] shared_ptr casts
218   template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const& r);
219   template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const& r);
220   template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const& r);
221
222   // [2.2.3.7] shared_ptr I/O
223   template<class E, class T, class Y>
224   basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, shared_ptr<Y> const& p);
225
226   // [2.2.3.10] shared_ptr get_deleter
227   template<class D, class T> D * get_deleter(shared_ptr<T> const& p);
228
229   // [2.2.4] Class template weak_ptr
230   template<class T> class weak_ptr;
231
232   // [2.2.4.6] weak_ptr comparison
233   template<class T, class U> bool operator<(weak_ptr<T> const& a, weak_ptr<U> const& b);
234
235   // [2.2.4.7] weak_ptr specialized algorithms
236   template<class T> void swap(weak_ptr<T>& a, weak_ptr<T>& b);
237
238   // [2.2.5] Class enable_shared_from_this
239   template<class T> class enable_shared_from_this;
240
241   } // namespace tr1
242   } // namespace std
243
244[*Configuration:]
245[@../../libs/config/index.html Boost.Config] should (automatically) define
246the macro BOOST_HAS_TR1_SHARED_PTR if your
247standard library implements this part of TR1.
248
249[*Standard Conformity:] There are no known deviations from the standard when
250using the Boost version of this component.
251
252[endsect]
253
254[section:result_of Class template result_of.]
255
256   #include <boost/tr1/functional.hpp>
257   
258or
259
260   #include <functional>
261
262The class template
263`result_of` helps determine the type of a
264call expression. Given an lvalue `f` of
265type `F` and lvalues `t1`,
266`t2, ..., tN` of
267types `T1, T2, ..., TN`, respectively, the type
268`result_of<F(T1, T2, ..., TN)>::type` defines the result type
269of the expression `f(t1, t2, ...,tN)`. The implementation permits
270the type `F` to be a function pointer,
271function reference, member function pointer, or class
272type.  For more information
273[@../../libs/utility/utility.htm#result_of refer to the Boost.Utility documentation.]
274
275   namespace std {
276   namespace tr1 {
277
278   template <class T>
279   struct result_of
280   {
281      typedef unspecified type;
282   };
283
284   } // namespace tr1
285   } // namespace std
286
287[*Configuration:]
288[@../../libs/config/index.html Boost.Config] should (automatically) define
289the macro BOOST_HAS_TR1_RESULT_OF if your
290standard library implements this part of TR1.
291   
292[*Standard Conformity:] No known problems.
293
294[endsect]
295
296[section:mem_fn Function template mem_fn.]
297
298   #include <boost/tr1/functional.hpp>
299   
300or
301
302   #include <functional>
303
304`std::tr1::mem_fn` is a generalization of the standard functions `std::mem_fun`
305and `std::mem_fun_ref`. It supports member function pointers with more
306than one argument, and the returned function object can take a pointer, a
307reference, or a smart pointer to an object instance as its first argument. `mem_fn`
308also supports pointers to data members by treating them as functions taking no
309arguments and returning a (const) reference to the member.
310For more information refer to the [@../../libs/bind/mem_fn.html
311Boost.Mem_fn documentation].
312
313   namespace std {
314   namespace tr1 {
315
316   template <class R, class T> unspecified mem_fn(R T::* pm);
317
318   } // namespace tr1
319   } // namespace std
320
321[*Configuration:]
322[@../../libs/config/index.html Boost.Config] should (automatically) define
323the macro BOOST_HAS_TR1_MEM_FN if your
324standard library implements this part of TR1.
325
326[*Standard Conformity:]
327The Boost implementation does not produce functors that inherit from
328`std::unary_function` or `std::binary_function`, nor does it function
329correctly with pointers to volatile member functions (these should
330be extremely rare in practice however).
331
332[endsect]
333
334[section:bind Function Object Binders.]
335
336   #include <boost/tr1/functional.hpp>
337
338or
339
340   #include <functional>
341
342`std::tr1::bind` is a generalization of the standard functions `std::bind1st`
343and `std::bind2nd`. It supports arbitrary function objects, functions,
344function pointers, and member function pointers, and is able to bind any
345argument to a specific value or route input arguments into arbitrary positions. `bind`
346does not place any requirements on the function object; in particular, it does
347not need the `result_type`, `first_argument_type` and `second_argument_type`
348standard typedefs.
349For more information refer to the [@../../libs/bind/bind.html
350Boost.Bind documentation].
351
352   namespace std {
353   namespace tr1 {
354
355   // [3.6] Function object binders
356   template<class T> struct is_bind_expression;
357   template<class T> struct is_placeholder;
358   template<class F, class T1, ..., class Tn > unspecified bind(F f, T1 t1, ..., Tn tn );
359   template<class R, class F, class T1, ..., class Tn > unspecified bind(F f, T1 t1, ..., Tn tn );
360
361   namespace placeholders {
362      // M is the implementation-defined number of placeholders
363      extern unspecified _1;
364      extern unspecified _2;
365      .
366      .
367      .
368      extern unspecified _M;
369   }
370
371   } // namespace tr1
372   } // namespace std
373
374[*Configuration:]
375[@../../libs/config/index.html Boost.Config] should (automatically) define
376the macro BOOST_HAS_TR1_BIND if your
377standard library implements this part of TR1.
378
379[*Standard Conformity:]
380The traits classes `is_placeholder` and `is_bind_expression` are not supported
381by the Boost implementation.
382
383The named return value syntax isn't supported if the object being bound is a
384function pointer, for example:
385
386   std::tr1::bind(&my_proc, arg1, arg2 /* etc */); // works OK.
387   std::tr1::bind<double>(&my_proc, arg1, arg2 /* etc */); // causes compiler error.
388   std::tr1::bind<double>(my_function_object, arg1, arg2 /* etc */); // works OK.
389
390On the other hand, the Boost implementation does work with pointers to overloaded
391functions, and optionally with function pointers with non-standard
392calling conventions.
393
394[endsect]
395
396[section:function Polymorphic function wrappers.]
397
398   #include <boost/tr1/functional.hpp>
399
400or
401
402   #include <functional>
403
404The polymorphic function wrappers are a family of class templates
405that may be used as a generalized callback mechanism.
406A polymorphic function wrapper shares features with function pointers, in
407that both define a call interface (for example a function taking two integer
408arguments and returning a floating-point value) through which some
409arbitrary code may be called. However a polymorphic function wrapper can call
410any callable object with a compatible call signature, this could be a function
411pointer, or it could be a function object produced by std::tr1::bind, or some
412other mechanism.  For more information see the [@../../doc/html/function.html
413Boost.Function documentation].
414
415   
416   namespace std {
417   namespace tr1 {
418
419   // [3.7] polymorphic function wrappers
420   class bad_function_call;
421
422   template<class Function>
423   class function;
424
425   template<class Function>
426   void swap(function<Function>&, function<Function>&);
427
428   template<class Function1, class Function2>
429   void operator==(const function<Function1>&, const function<Function2>&);
430   template<class Function1, class Function2>
431   void operator!=(const function<Function1>&, const function<Function2>&);
432   template <class Function>
433   bool operator==(const function<Function>&, unspecified-null-pointer-type );
434   template <class Function>
435   bool operator==(unspecified-null-pointer-type , const function<Function>&);
436   template <class Function>
437   bool operator!=(const function<Function>&, unspecified-null-pointer-type );
438   template <class Function>
439   bool operator!=(unspecified-null-pointer-type , const function<Function>&);
440
441   } // namespace tr1
442   } // namespace std
443
444[*Configuration:]
445[@../../libs/config/index.html Boost.Config] should (automatically) define
446the macro BOOST_HAS_TR1_FUNCTION if your
447standard library implements this part of TR1.
448
449[*Standard Conformity:]
450The Boost version of `std::tr1::function` lacks the member function
451`target_type()` and does not inherit from `std::unary_function`
452or `std::binary_function` when applicable. The member function
453target() can only access pointer-to-member targets when they
454have been wrapped in mem_fn.
455
456[endsect]
457
458[section:type_traits Type Traits.]
459
460   #include <boost/tr1/type_traits.hpp>
461
462or
463
464   #include <type_traits>
465
466Type traits enable generic code to access the fundamental properties
467of a type, to determine the relationship between two types, or to
468transform one type into another related type.  For more information
469refer to the [@../../libs/type_traits/index.html Boost.Type_traits documentation].
470   
471   namespace std {
472   namespace tr1 {
473
474   template <class T, T v> struct integral_constant;
475
476   typedef integral_constant<bool, true> true_type;
477   typedef integral_constant<bool, false> false_type;
478
479   // [4.5.1] primary type categories:
480   template <class T> struct is_void;
481   template <class T> struct is_integral;
482   template <class T> struct is_floating_point;
483   template <class T> struct is_array;
484   template <class T> struct is_pointer;
485   template <class T> struct is_reference;
486   template <class T> struct is_member_object_pointer;
487   template <class T> struct is_member_function_pointer;
488   template <class T> struct is_enum;
489   template <class T> struct is_union;
490   template <class T> struct is_class;
491   template <class T> struct is_function;
492
493   // [4.5.2] composite type categories:
494   template <class T> struct is_arithmetic;
495   template <class T> struct is_fundamental;
496   template <class T> struct is_object;
497   template <class T> struct is_scalar;
498   template <class T> struct is_compound;
499   template <class T> struct is_member_pointer;
500
501   // [4.5.3] type properties:
502   template <class T> struct is_const;
503   template <class T> struct is_volatile;
504   template <class T> struct is_pod;
505   template <class T> struct is_empty;
506   template <class T> struct is_polymorphic;
507   template <class T> struct is_abstract;
508   template <class T> struct has_trivial_constructor;
509   template <class T> struct has_trivial_copy;
510   template <class T> struct has_trivial_assign;
511   template <class T> struct has_trivial_destructor;
512   template <class T> struct has_nothrow_constructor;
513   template <class T> struct has_nothrow_copy;
514   template <class T> struct has_nothrow_assign;
515   template <class T> struct has_virtual_destructor;
516   template <class T> struct is_signed;
517   template <class T> struct is_unsigned;
518   template <class T> struct alignment_of;
519   template <class T> struct rank;
520   template <class T, unsigned I = 0> struct extent;
521
522   // [4.6] type relations:
523   template <class T, class U> struct is_same;
524   template <class Base, class Derived> struct is_base_of;
525   template <class From, class To> struct is_convertible;
526
527   // [4.7.1] const-volatile modifications:
528   template <class T> struct remove_const;
529   template <class T> struct remove_volatile;
530   template <class T> struct remove_cv;
531   template <class T> struct add_const;
532   template <class T> struct add_volatile;
533   template <class T> struct add_cv;
534
535   // [4.7.2] reference modifications:
536   template <class T> struct remove_reference;
537   template <class T> struct add_reference;
538
539   // [4.7.3] array modifications:
540   template <class T> struct remove_extent;
541   template <class T> struct remove_all_extents;
542
543   // [4.7.4] pointer modifications:
544   template <class T> struct remove_pointer;
545   template <class T> struct add_pointer;
546
547   // [4.8] other transformations:
548   template <std::size_t Len, std::size_t Align> struct aligned_storage;
549
550   } // namespace tr1
551   } // namespace std
552
553[*Configuration:]
554[@../../libs/config/index.html Boost.Config] should (automatically) define
555the macro BOOST_HAS_TR1_TYPE_TRAITS if your
556standard library implements this part of TR1.
557
558[*Standard Conformity:]
559No known problems.
560
561[endsect]
562
563[section:random Random Number Generators and Distributions.]
564
565   #include <boost/tr1/random.hpp>
566   
567or
568
569   #include <random>
570
571The random number library is devided into three parts:
572[@../../libs/random/random-generators.html generators], which
573are nullary functors producing uniform random number distributions. 
574[@../../libs/random/random-distributions.html Distributions], which are unary
575functors that adapt a generator to some
576specific kind of distribution.  And the class template
577[@../../libs/random/random-variate.html variate_generator]
578which combines a generator with a distribution, to create a new generator.
579For more information see the [@../../libs/random/index.html Boost.Random documentation].
580
581   
582   namespace std {
583   namespace tr1 {
584
585   // [5.1.3] Class template variate_generator
586   template<class UniformRandomNumberGenerator, class Distribution>
587   class variate_generator;
588
589   // [5.1.4.1] Class template linear_congruential
590   template<class IntType, IntType a, IntType c, IntType m>
591   class linear_congruential;
592
593   // [5.1.4.2] Class template mersenne_twister
594   template<class UIntType, int w, int n, int m, int r,
595   UIntType a, int u, int s, UIntType b, int t, UIntType c, int l>
596   class mersenne_twister;
597
598   // [5.1.4.3] Class template substract_with_carry
599   template<class IntType, IntType m, int s, int r>
600   class subtract_with_carry;
601
602   // [5.1.4.4] Class template substract_with_carry_01
603   template<class RealType, int w, int s, int r>
604   class subtract_with_carry_01;
605
606   // [5.1.4.5] Class template discard_block
607   template<class UniformRandomNumberGenerator, int p, int r>
608   class discard_block;
609
610   // [5.1.4.6] Class template xor_combine
611   template<class UniformRandomNumberGenerator1, int s1,
612   class UniformRandomNumberGenerator2, int s2>
613   class xor_combine;
614   
615   // [5.1.5] Predefined generators
616   typedef linear_congruential<
617               implementation-defined ,
618               16807,
619               0,
620               2147483647> minstd_rand0;
621               
622   typedef linear_congruential<
623               implementation-defined ,
624               48271,
625               0,
626               2147483647> minstd_rand;
627               
628   typedef mersenne_twister<
629               implementation-defined ,
630               32, 624, 397, 31,
631               0x9908b0df, 11, 7,
632               0x9d2c5680, 15,
633               0xefc60000, 18> mt19937;
634               
635   typedef subtract_with_carry_01<
636               float,
637               24,
638               10,
639               24> ranlux_base_01;
640               
641   typedef subtract_with_carry_01<
642               double,
643               48,
644               10,
645               24> ranlux64_base_01;
646               
647   typedef discard_block<
648               subtract_with_carry<
649                     implementation-defined ,
650                     (1<<24),
651                     10,
652                     24>,
653               223,
654               24> ranlux3;
655               
656   typedef discard_block<
657               subtract_with_carry<
658                     implementation-defined,
659                     (1<<24),
660                     10,
661                     24>,
662               389,
663               24> ranlux4;
664               
665   typedef discard_block<
666               subtract_with_carry_01<
667                     float,
668                     24,
669                     10,
670                     24>,
671               223,
672               24> ranlux3_01;
673               
674   typedef discard_block<
675               subtract_with_carry_01<
676                     float,
677                     24,
678                     10,
679                     24>,
680               389,
681               24> ranlux4_01;
682   
683   // [5.1.6] Class random_device
684   class random_device;
685
686   // [5.1.7.1] Class template uniform_int
687   template<class IntType = int>
688   class uniform_int;
689
690   // [5.1.7.2] Class bernoulli_distribution
691   class bernoulli_distribution;
692
693   // [5.1.7.3] Class template geometric_distribution
694   template<class IntType = int, class RealType = double>
695   class geometric_distribution;
696
697   // [5.1.7.4] Class template poisson_distribution
698   template<class IntType = int, class RealType = double>
699   class poisson_distribution;
700
701   // [5.1.7.5] Class template binomial_distribution
702   template<class IntType = int, class RealType = double>
703   class binomial_distribution;
704
705   // [5.1.7.6] Class template uniform_real
706   template<class RealType = double>
707   class uniform_real;
708
709   // [5.1.7.7] Class template exponential_distribution
710   template<class RealType = double>
711   class exponential_distribution;
712
713   // [5.1.7.8] Class template normal_distribution
714   template<class RealType = double>
715   class normal_distribution;
716
717   // [5.1.7.9] Class template gamma_distribution
718   template<class RealType = double>
719   class gamma_distribution;
720
721   } // namespace tr1
722   } // namespace std
723
724[*Configuration:]
725[@../../libs/config/index.html Boost.Config] should (automatically) define
726the macro BOOST_HAS_TR1_RANDOM if your
727standard library implements this part of TR1.
728
729[*Standard Conformity:]
730The Boost implementation has the following limitations:
731
732*The linear_congruential generator is fully supported for
733signed integer types only (unsigned types probably only work when
734the modulus is zero).
735*The subtract_with_carry template does not support a modulus of zero.
736*Not all of the standard generator types have Boost documentation yet, they are
737none the less supported however.
738*Class template variate_generator does not have a template unary function call operator(),
739only the non-template nullary version.
740
741Note also that most of the Random number generators have been re-implemented
742as thin wrappers around the Boost versions in order to
743provide a standard conforming interface (the Boost versions all take an additional,
744redundant, template parameter, and are initialized by iterators rather than functors).
745
746[endsect]
747
748[section:tuple Tuples.]
749
750   #include <boost/tr1/tuple.hpp>
751
752or
753   
754   #include <tuple>
755
756A tuple is a fixed size collection of elements.
757Pairs, triples, quadruples etc. are tuples.
758In a programming language, a tuple is a data object containing other objects as elements.
759These element objects may be of different types.
760Tuples are convenient in many circumstances.
761For instance, tuples make it easy to define functions that return more than one value.
762Some programming languages, such as ML, Python and Haskell, have built-in tuple constructs.
763Unfortunately C++ does not.
764To compensate for this "deficiency", the TR1 Tuple Library implements a tuple construct using templates.
765For more information see the [@../../libs/tuple/index.html Boost Tuple Library Documentation].
766
767   namespace std {
768   namespace tr1 {
769
770   // [6.1.3] Class template tuple
771   template <class T1 = unspecified ,
772   class T2 = unspecified ,
773   ...,
774   class TM = unspecified > class tuple;
775
776   // [6.1.3.2] Tuple creation functions
777   const unspecified ignore;
778
779   template<class T1, class T2, ..., class TN>
780   tuple<V1, V2, ..., VN> make_tuple(const T1&, const T2& , ..., const TN&);
781
782   // [6.1] Tuple types Containers
783   template<class T1, class T2, ..., class TN>
784   tuple<T1&, T2&, ..., TN&> tie(T1&, T2& , ..., TN&);
785
786   // [6.1.3.3] Tuple helper classes
787   template <class T> class tuple_size;
788   template <int I, class T> class tuple_element;
789
790   // [6.1.3.4] Element access
791   template <int I, class T1, class T2, ..., class TN>
792   RI get(tuple<T1, T2, ..., TN>&);
793   template <int I, class T1, class T2, ..., class TN>
794   PI get(const tuple<T1, T2, ..., TN>&);
795
796   // [6.1.3.5] relational operators
797   template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM>
798   bool operator==(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&);
799   template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM>
800   bool operator<(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&);
801   template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM>
802   bool operator!=(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&);
803   template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM>
804   bool operator>(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&);
805   template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM>
806   bool operator<=(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&);
807   template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM>
808   bool operator>=(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&);
809
810   } // namespace tr1
811   } // namespace std
812
813[*Configuration:]
814[@../../libs/config/index.html Boost.Config] should (automatically) define
815the macro BOOST_HAS_TR1_TUPLE if your
816standard library implements this part of TR1.
817
818[*Standard Conformity:]
819No known issues for conforming compilers.
820
821[endsect]
822
823[section:utility Tuple Interface to std::pair.]
824
825   #include <boost/tr1/utility.hpp>
826
827or
828
829   #include <utility>
830
831The existing class template std::pair, can also be accessed using the
832[link boost_tr1.tuple tuple interface].
833   
834   namespace std {
835   namespace tr1 {
836
837   template <class T> class tuple_size; // forward declaration
838   template <int I, class T> class tuple_element; // forward declaration
839   template <class T1, class T2> struct tuple_size<std::pair<T1, T2> >;
840   template <class T1, class T2> struct tuple_element<0, std::pair<T2, T2> >;
841   template <class T1, class T2> struct tuple_element<1, std::pair<T2, T2> >;
842   // see below for definition of "P".
843   template<int I, class T1, class T2> P& get(std::pair<T1, T2>&);
844   template<int I, class T1, class T2> const P& get(const std::pair<T1, T2>&);
845
846   } // namespace tr1
847   } // namespace std
848
849[*Configuration:]
850[@../../libs/config/index.html Boost.Config] should (automatically) define
851the macro BOOST_HAS_TR1_UTILITY if your
852standard library implements this part of TR1.
853
854[*Standard Conformity:]
855No known problems.
856
857[endsect]
858
859[section:array Fixed Size Array.]
860
861   #include <boost/tr1/array.hpp>
862   
863or
864
865   #include <array>
866   
867Class template array is a fixed size array that is safer than and no
868less efficient than a C style array.  Class array fulfils almost all of the
869requirements of a reversible-container (see Section 23.1,
870[lib.container.requirements] of the C++ Standard).  For more information refer
871to the [@../../libs/array/index.html Boost.Array documentation].
872
873   namespace std {
874   namespace tr1 {
875
876   // [6.2.2] Class template array
877   template <class T, size_t N > struct array;
878
879   // Array comparisons
880   template <class T, size_t N> bool operator== (const array<T,N>& x, const array<T,N>& y);
881   template <class T, size_t N> bool operator< (const array<T,N>& x, const array<T,N>& y);
882   template <class T, size_t N> bool operator!= (const array<T,N>& x, const array<T,N>& y);
883   template <class T, size_t N> bool operator> (const array<T,N>& x, const array<T,N>& y);
884   template <class T, size_t N> bool operator>= (const array<T,N>& x, const array<T,N>& y);
885   template <class T, size_t N> bool operator<= (const array<T,N>& x, const array<T,N>& y);
886
887   // [6.2.2.2] Specialized algorithms
888   template <class T, size_t N > void swap(array<T,N>& x, array<T,N>& y);
889
890   // [6.2.2.5] Tuple interface to class template array
891   template <class T> class tuple_size; // forward declaration
892   template <int I, class T> class tuple_element; // forward declaration
893   template <class T, size_t N> struct tuple_size<array<T, N> >;
894   template <int I, class T, size_t N> struct tuple_element<I, array<T, N> >;
895   template <int I, class T, size_t N> T& get( array<T, N>&);
896   template <int I, class T, size_t N> const T& get(const array<T, N>&);
897
898   } // namespace tr1
899   } // namespace std
900
901[*Configuration:]
902[@../../libs/config/index.html Boost.Config] should (automatically) define
903the macro BOOST_HAS_TR1_ARRAY if your
904standard library implements this part of TR1.
905
906[*Standard Conformity:]
907No known issues as of Boost-1.34 onwards.
908
909[endsect]
910
911[section:hash Hash Function Objects.]
912
913   #include <boost/tr1/functional.hpp>
914   
915or
916
917   #include <functional>
918
919Class template std::hash is a unary-functor that converts some type T
920into a hash-value,
921specializations of std::hash are provided for integer, character, floating point,
922and pointer types, plus the two string types std::string and std::wstring.
923See the [@../../libs/functional/hash/index.html Boost.Hash]
924documentation for more information.
925   
926   namespace std {
927   namespace tr1 {
928
929   template <class T>
930   struct hash : public unary_function<T, size_t>
931   {
932      size_t operator()(T val)const;
933   };
934
935   // Hash function specializations
936   template <> struct hash<bool>;
937   template <> struct hash<char>;
938   template <> struct hash<signed char>;
939   template <> struct hash<unsigned char>;
940   template <> struct hash<wchar_t>;
941   template <> struct hash<short>;
942   template <> struct hash<int>;
943   template <> struct hash<long>;
944   template <> struct hash<unsigned short>;
945   template <> struct hash<unsigned int>;
946   template <> struct hash<unsigned long>;
947   template <> struct hash<float>;
948   template <> struct hash<double>;
949   template <> struct hash<long double>;
950   template<class T> struct hash<T*>;
951   template <> struct hash<std::string>;
952   template <> struct hash<std::wstring>;
953
954   } // namespace tr1
955   } // namespace std
956
957[*Configuration:]
958[@../../libs/config/index.html Boost.Config] should (automatically) define
959the macro BOOST_HAS_TR1_HASH if your
960standard library implements this part of TR1.
961
962[*Standard Conformity:]
963Boost.Hash adds specialisations of std::hash for a wider range of types
964than those required by TR1: Boost.Hash acts as a testbed for issue 6.18
965in the [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
966Library Extension Technical Report Issues List].
967
968[endsect]
969
970[section:regex Regular Expressions.]
971
972   #include <boost/tr1/regex.hpp>
973   
974or
975
976   #include <regex>
977   
978This library provides comprehensive support for regular expressions,
979including either iterator or string based matching, searching, search-and-replace,
980iteration, and tokenization.  Both POSIX and ECMAScript (JavaScript) regular
981expressions are supported.  For more information see the [@../../libs/regex/index.html
982Boost.Regex documentation].
983   
984   namespace std {
985   namespace tr1 {
986
987   // [7.5] Regex constants
988   namespace regex_constants {
989
990   typedef bitmask_type syntax_option_type;
991   typedef bitmask_type match_flag_type;
992   typedef implementation-defined error_type;
993
994   } // namespace regex_constants
995
996   // [7.6] Class regex_error
997   class regex_error;
998
999   // [7.7] Class template regex_traits
1000   template <class charT> struct regex_traits;
1001
1002   // [7.8] Class template basic_regex
1003   template <class charT, class traits = regex_traits<charT> >
1004   class basic_regex;
1005
1006   typedef basic_regex<char> regex;
1007   typedef basic_regex<wchar_t> wregex;
1008
1009   // [7.8.6] basic_regex swap
1010   template <class charT, class traits>
1011   void swap(basic_regex<charT, traits>& e1,
1012            basic_regex<charT, traits>& e2);
1013             
1014   // [7.9] Class template sub_match
1015   template <class BidirectionalIterator>
1016   class sub_match;
1017
1018   typedef sub_match<const char*> csub_match;
1019   typedef sub_match<const wchar_t*> wcsub_match;
1020   typedef sub_match<string::const_iterator> ssub_match;
1021   typedef sub_match<wstring::const_iterator> wssub_match;
1022
1023   // [7.9.2] sub_match non-member operators
1024
1025   /* Comparison operators omitted for clarity.... */
1026
1027   template <class charT, class ST, class BiIter>
1028   basic_ostream<charT, ST>&
1029      operator<<(basic_ostream<charT, ST>& os,
1030               const sub_match<BiIter>& m);
1031
1032   // [7.10] Class template match_results
1033   template <class BidirectionalIterator,
1034            class Allocator = allocator<sub_match<BidirectionalIterator> > >
1035   class match_results;
1036
1037   typedef match_results<const char*> cmatch;
1038   typedef match_results<const wchar_t*> wcmatch;
1039   typedef match_results<string::const_iterator> smatch;
1040   typedef match_results<wstring::const_iterator> wsmatch;
1041
1042   // match_results comparisons
1043   template <class BidirectionalIterator, class Allocator>
1044   bool operator== (const match_results<BidirectionalIterator, Allocator>& m1,
1045                  const match_results<BidirectionalIterator, Allocator>& m2);
1046   template <class BidirectionalIterator, class Allocator>
1047   bool operator!= (const match_results<BidirectionalIterator, Allocator>& m1,
1048                  const match_results<BidirectionalIterator, Allocator>& m2);
1049
1050   // [7.10.6] match_results swap
1051   template <class BidirectionalIterator, class Allocator>
1052   void swap(match_results<BidirectionalIterator, Allocator>& m1,
1053            match_results<BidirectionalIterator, Allocator>& m2);
1054             
1055   // [7.11.2] Function template regex_match
1056   template <class BidirectionalIterator, class Allocator, class charT, class traits>
1057   bool regex_match(BidirectionalIterator first,
1058                  BidirectionalIterator last,
1059                  match_results<BidirectionalIterator, Allocator>& m,
1060                  const basic_regex<charT, traits>& e,
1061                  regex_constants::match_flag_type flags = regex_constants::match_default);
1062
1063   template <class BidirectionalIterator, class charT, class traits>
1064   bool regex_match(BidirectionalIterator first,
1065                  BidirectionalIterator last,
1066                  const basic_regex<charT, traits>& e,
1067                  regex_constants::match_flag_type flags = regex_constants::match_default);
1068                   
1069   template <class charT, class Allocator, class traits>
1070   bool regex_match(const charT* str,
1071                  match_results<const charT*, Allocator>& m,
1072                  const basic_regex<charT, traits>& e,
1073                  regex_constants::match_flag_type flags = regex_constants::match_default);
1074                   
1075   template <class ST, class SA, class Allocator, class charT, class traits>
1076   bool regex_match(const basic_string<charT, ST, SA>& s,
1077                  match_results<typename basic_string<charT, ST, SA>::const_iterator,Allocator>& m,
1078                  const basic_regex<charT, traits>& e,
1079                  regex_constants::match_flag_type flags = regex_constants::match_default);
1080                   
1081   template <class charT, class traits>
1082   bool regex_match(const charT* str,
1083                  const basic_regex<charT, traits>& e,
1084                  regex_constants::match_flag_type flags = regex_constants::match_default);
1085                   
1086   template <class ST, class SA, class charT, class traits>
1087   bool regex_match(const basic_string<charT, ST, SA>& s,
1088                  const basic_regex<charT, traits>& e,
1089                  regex_constants::match_flag_type flags = regex_constants::match_default);
1090                   
1091   // [7.11.3] Function template regex_search
1092   template <class BidirectionalIterator, class Allocator, class charT, class traits>
1093   bool regex_search(BidirectionalIterator first,
1094                     BidirectionalIterator last,
1095                     match_results<BidirectionalIterator, Allocator>& m,
1096                     const basic_regex<charT, traits>& e,
1097                     regex_constants::match_flag_type flags = regex_constants::match_default);
1098                     
1099   template <class BidirectionalIterator, class charT, class traits>
1100   bool regex_search(BidirectionalIterator first,
1101                     BidirectionalIterator last,
1102                     const basic_regex<charT, traits>& e,
1103                     regex_constants::match_flag_type flags = regex_constants::match_default);
1104                     
1105   template <class charT, class Allocator, class traits>
1106   bool regex_search(const charT* str,
1107                     match_results<const charT*, Allocator>& m,
1108                     const basic_regex<charT, traits>& e,
1109                     regex_constants::match_flag_type flags = regex_constants::match_default);
1110                     
1111   template <class charT, class traits>
1112   bool regex_search(const charT* str,
1113                     const basic_regex<charT, traits>& e,
1114                     regex_constants::match_flag_type flags = regex_constants::match_default);
1115                     
1116   template <class ST, class SA, class charT, class traits>
1117   bool regex_search(const basic_string<charT, ST, SA>& s,
1118                     const basic_regex<charT, traits>& e,
1119                     regex_constants::match_flag_type flags = regex_constants::match_default);
1120                     
1121   template <class ST, class SA, class Allocator, class charT, class traits>
1122   bool regex_search(const basic_string<charT, ST, SA>& s,
1123                     match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
1124                     const basic_regex<charT, traits>& e,
1125                     regex_constants::match_flag_type flags = regex_constants::match_default);
1126                     
1127   // [7.11.4] Function template regex_replace
1128   template <class OutputIterator, class BidirectionalIterator, class traits, class charT>
1129   OutputIterator regex_replace(OutputIterator out,
1130                              BidirectionalIterator first,
1131                              BidirectionalIterator last,
1132                              const basic_regex<charT, traits>& e,
1133                              const basic_string<charT>& fmt,
1134                              regex_constants::match_flag_type flags = regex_constants::match_default);
1135                               
1136   template <class traits, class charT>
1137   basic_string<charT> regex_replace(const basic_string<charT>& s,
1138                                          const basic_regex<charT, traits>& e,
1139                                          const basic_string<charT>& fmt,
1140                                          regex_constants::match_flag_type flags = regex_constants::match_default);
1141                                           
1142   // [7.12.1] Class template regex_iterator
1143   template <class BidirectionalIterator,
1144            class charT = typename iterator_traits<BidirectionalIterator>::value_type,
1145            class traits = regex_traits<charT> >
1146   class regex_iterator;
1147
1148   typedef regex_iterator<const char*> cregex_iterator;
1149   typedef regex_iterator<const wchar_t*> wcregex_iterator;
1150   typedef regex_iterator<string::const_iterator> sregex_iterator;
1151   typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
1152
1153   // [7.12.2] Class template regex_token_iterator
1154   template <class BidirectionalIterator,
1155            class charT = typename iterator_traits<BidirectionalIterator>::value_type,
1156            class traits = regex_traits<charT> >
1157   class regex_token_iterator;
1158
1159   typedef regex_token_iterator<const char*> cregex_token_iterator;
1160   typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
1161   typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
1162   typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
1163
1164   } // namespace tr1
1165   } // namespace std
1166
1167   
1168[*Configuration:]
1169[@../../libs/config/index.html Boost.Config] should (automatically) define
1170the macro BOOST_HAS_TR1_REGEX if your
1171standard library implements this part of TR1.
1172
1173[*Standard Conformity:]
1174No known problems.
1175
1176[endsect]
1177
1178[section:complex Complex Number Algorithm Overloads.]
1179
1180   #include <boost/tr1/complex.hpp>
1181   
1182or
1183
1184   #include <complex>
1185   
1186The following function templates have additional overloads:
1187`arg`, `norm`, `conj`, `polar`, `imag`, and `real`.
1188
1189The additional
1190overloads are sufficient to ensure:
1191
1192*If the argument has type `long double`, then the overload behaves as if
1193the argument had been cast to `std::complex<long double>`.
1194*Otherwise, if the argument has type `double` or is an integer type,
1195then the overload behaves as if
1196the argument had been cast to `std::complex<double>`.
1197*Otherwise, if the argument has type `float`, then the overload
1198behaves as if
1199the argument had been cast to `std::complex<float>`.
1200
1201The function template `pow` has additional overloads sufficient to ensure,
1202for a call with at least one argument of type `std::complex<T>`:
1203
1204*If either argument has type `complex<long double>` or type
1205`long double`, then the overload behaves as if both arguments were cast
1206to `std::complex<long double>`
1207*Otherwise, if either argument has type `complex<double>`, `double`,
1208or an integer type, then the overload behaves as if both arguments were cast
1209to `std::complex<double>`
1210*Otherwise, if either argument has type `complex<float>` or `float`,
1211then the overload behaves as if both arguments were cast
1212to `std::complex<float>`
1213
1214In the following synopsis, `Real` is a floating point type,
1215`Arithmetic` is an integer or floating point type, and `
1216PROMOTE(X1 ... XN)` is the largest floating point type in the list
1217X1 to XN, after any non-floating point types in the list have been replaced by
1218the type `double`.
1219
1220   template <class Arithmetic>
1221   PROMOTE(Arithmetic) arg(const Arithmetic& t);
1222
1223   template <class Arithmetic>
1224   PROMOTE(Arithmetic) norm(const Arithmetic& t);
1225
1226   template <class Arithmetic>
1227   complex<PROMOTE(Arithmetic)> conj(const Arithmetic& t);
1228
1229   template <class Arithmetic1, class Arithmetic2>
1230   complex<PROMOTE(Arithmetic1,Arithmetic2)> polar(const Arithmetic1& rho, const Arithmetic2& theta = 0);
1231
1232   template <class Arithmetic>
1233   PROMOTE(Arithmetic) imag(const Arithmetic& );
1234
1235   template <class Arithmetic>
1236   PROMOTE(Arithmetic) real(const Arithmetic& t);
1237
1238   template<class Real1, class Real2>
1239   complex<PROMOTE(Real1, Real2)>
1240      pow(const complex<Real1>& x, const complex<Real2>& y);
1241     
1242   template<class Real, class Arithmetic>
1243   complex<PROMOTE(Real, Arithmetic)>
1244      pow (const complex<Real>& x, const Arithmetic& y);
1245
1246   template<class Arithmetic, class Real>
1247   complex<PROMOTE(Real, Arithmetic)>
1248      pow (const Arithmetic& x, const complex<Real>& y);
1249   
1250[*Configuration:]
1251[@../../libs/config/index.html Boost.Config] should (automatically) define
1252the macro BOOST_HAS_TR1_COMPLEX_OVERLOADS if your
1253standard library implements the additional overloads for the existing
1254complex arithmetic functions.
1255
1256[*Standard Conformity:]
1257No known problems.
1258
1259[endsect]
1260
1261[section:complex_trig Complex Number Additional Algorithms.]
1262
1263   #include <boost/tr1/complex.hpp>
1264   
1265or
1266
1267   #include <complex>
1268
1269The algorithms `acos`, `asin`, `atan`,
1270`acosh`, `asinh`, `atanh` and `fabs`
1271are overloaded
1272for arguments of type `std::complex<T>`. 
1273These algorithms are entirely
1274classical, and behave as specified in the C99 standard section 7.3.5.
1275See the [@boost_math/inverse_complex.html Boost.Math documentation
1276for more information].
1277   
1278   namespace std {
1279   namespace tr1 {
1280
1281   template<class T> complex<T> acos(complex<T>& x);
1282   template<class T> complex<T> asin(complex<T>& x);
1283   template<class T> complex<T> atan(complex<T>& x);
1284   template<class T> complex<T> acosh(complex<T>& x);
1285   template<class T> complex<T> asinh(complex<T>& x);
1286   template<class T> complex<T> atanh(complex<T>& x);
1287   template<class T> complex<T> fabs(complex<T>& x);
1288
1289   } // namespace tr1
1290   } // namespace std
1291
1292[*Configuration:]
1293[@../../libs/config/index.html Boost.Config] should (automatically) define
1294the macro BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
1295if your standard library implements the additional inverse trig functions.
1296
1297[*Standard Conformity:]
1298No known problems.
1299
1300[endsect]
1301
1302[endsect]
1303
1304[section:unsupported TR By Subject: Unsupported Features]
1305
1306[section:special Mathematical Special Functions.]
1307
1308The TR adds 23 special functions (plus float and long double overloads)
1309to header <cmath>.  However, at present there is no Boost License
1310compatible implementation of these functions, so these are [*unsupported
1311by this implementation] unless your standard library supports them itself.
1312   
1313   namespace std {
1314   namespace tr1 {
1315
1316   // [5.2.1.1] associated Laguerre polynomials:
1317   double assoc_laguerre(unsigned n, unsigned m, double x);
1318   float assoc_laguerref(unsigned n, unsigned m, float x);
1319   long double assoc_laguerrel(unsigned n, unsigned m, long double x);
1320
1321   // [5.2.1.2] associated Legendre functions:
1322   double assoc_legendre(unsigned l, unsigned m, double x);
1323   float assoc_legendref(unsigned l, unsigned m, float x);
1324   long double assoc_legendrel(unsigned l, unsigned m, long double x);
1325
1326   // [5.2.1.3] beta function:
1327   double beta(double x, double y);
1328   float betaf(float x, float y);
1329   long double betal(long double x, long double y);
1330
1331   // [5.2.1.4] (complete) elliptic integral of the first kind:
1332   double comp_ellint_1(double k);
1333   float comp_ellint_1f(float k);
1334   long double comp_ellint_1l(long double k);
1335
1336   // [5.2.1.5] (complete) elliptic integral of the second kind:
1337   double comp_ellint_2(double k);
1338   float comp_ellint_2f(float k);
1339   long double comp_ellint_2l(long double k);
1340
1341   // [5.2.1.6] (complete) elliptic integral of the third kind:
1342   double comp_ellint_3(double k, double nu);
1343   float comp_ellint_3f(float k, float nu);
1344   long double comp_ellint_3l(long double k, long double nu);
1345
1346   // [5.2.1.7] confluent hypergeometric functions:
1347   double conf_hyperg(double a, double c, double x);
1348   float conf_hypergf(float a, float c, float x);
1349   long double conf_hypergl(long double a, long double c, long double x);
1350
1351   // [5.2.1.8] regular modified cylindrical Bessel functions:
1352   double cyl_bessel_i(double nu, double x);
1353   float cyl_bessel_if(float nu, float x);
1354   long double cyl_bessel_il(long double nu, long double x);
1355
1356   // [5.2.1.9] cylindrical Bessel functions (of the first kind):
1357   double cyl_bessel_j(double nu, double x);
1358   float cyl_bessel_jf(float nu, float x);
1359   long double cyl_bessel_jl(long double nu, long double x);
1360
1361   // [5.2.1.10] irregular modified cylindrical Bessel functions:
1362   double cyl_bessel_k(double nu, double x);
1363   float cyl_bessel_kf(float nu, float x);
1364   long double cyl_bessel_kl(long double nu, long double x);
1365
1366   // [5.2.1.11] cylindrical Neumann functions;
1367   // cylindrical Bessel functions (of the second kind):
1368   double cyl_neumann(double nu, double x);
1369   float cyl_neumannf(float nu, float x);
1370   long double cyl_neumannl(long double nu, long double x);
1371
1372   // [5.2.1.12] (incomplete) elliptic integral of the first kind:
1373   double ellint_1(double k, double phi);
1374   float ellint_1f(float k, float phi);
1375   long double ellint_1l(long double k, long double phi);
1376
1377   // [5.2.1.13] (incomplete) elliptic integral of the second kind:
1378   double ellint_2(double k, double phi);
1379   float ellint_2f(float k, float phi);
1380   long double ellint_2l(long double k, long double phi);
1381
1382   // [5.2.1.14] (incomplete) elliptic integral of the third kind:
1383   double ellint_3(double k, double nu, double phi);
1384   float ellint_3f(float k, float nu, float phi);
1385   long double ellint_3l(long double k, long double nu, long double phi);
1386
1387   // [5.2.1.15] exponential integral:
1388   double expint(double x);
1389   float expintf(float x);
1390   long double expintl(long double x);
1391
1392   // [5.2.1.16] Hermite polynomials:
1393   double hermite(unsigned n, double x);
1394   float hermitef(unsigned n, float x);
1395   long double hermitel(unsigned n, long double x);
1396
1397   // [5.2.1.17] hypergeometric functions:
1398   double hyperg(double a, double b, double c, double x);
1399   float hypergf(float a, float b, float c, float x);
1400   long double hypergl(long double a, long double b, long double c, long double x);
1401
1402   // [5.2.1.18] Laguerre polynomials:
1403   double laguerre(unsigned n, double x);
1404   float laguerref(unsigned n, float x);
1405   long double laguerrel(unsigned n, long double x);
1406
1407   // [5.2.1.19] Legendre polynomials:
1408   double legendre(unsigned l, double x);
1409   float legendref(unsigned l, float x);
1410   long double legendrel(unsigned l, long double x);
1411
1412   // [5.2.1.20] Riemann zeta function:
1413   double riemann_zeta(double);
1414   float riemann_zetaf(float);
1415   long double riemann_zetal(long double);
1416
1417   // [5.2.1.21] spherical Bessel functions (of the first kind):
1418   double sph_bessel(unsigned n, double x);
1419   float sph_besself(unsigned n, float x);
1420   long double sph_bessell(unsigned n, long double x);
1421
1422   // [5.2.1.22] spherical associated Legendre functions:
1423   double sph_legendre(unsigned l, unsigned m, double theta);
1424   float sph_legendref(unsigned l, unsigned m, float theta);
1425   long double sph_legendrel(unsigned l, unsigned m, long double theta);
1426
1427   // [5.2.1.23] spherical Neumann functions;
1428   // spherical Bessel functions (of the second kind):
1429   double sph_neumann(unsigned n, double x);
1430   float sph_neumannf(unsigned n, float x);
1431   long double sph_neumannl(unsigned n, long double x);
1432
1433   } // namespace tr1
1434   } // namespace std
1435
1436
1437[*Standard Conformity:]
1438['[*Not Supported.]]
1439
1440[endsect]
1441
1442[section:unordered_set Unordered Associative Set (Hash Table).]
1443
1444   #include <boost/tr1/unordered_set.hpp>
1445   
1446or
1447
1448   #include <unordered_set>
1449
1450This is not currently supported by Boost, although that situation is
1451hoped to change soon.
1452   
1453   namespace std {
1454   namespace tr1 {
1455
1456   template <class Value,
1457            class Hash = hash<Value>,
1458            class Pred = std::equal_to<Value>,
1459            class Alloc = std::allocator<Value> >
1460   class unordered_set;
1461
1462   // [6.3.4.5] Class template unordered_multiset
1463   template <class Value,
1464            class Hash = hash<Value>,
1465            class Pred = std::equal_to<Value>,
1466            class Alloc = std::allocator<Value> >
1467   class unordered_multiset;
1468
1469   template <class Value, class Hash, class Pred, class Alloc>
1470   void swap(unordered_set<Value, Hash, Pred, Alloc>& x,
1471            unordered_set<Value, Hash, Pred, Alloc>& y);
1472             
1473   template <class Value, class Hash, class Pred, class Alloc>
1474   void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x,
1475            unordered_multiset<Value, Hash, Pred, Alloc>& y);
1476
1477   } // namespace tr1
1478   } // namespace std
1479
1480[*Configuration:]
1481[@../../libs/config/index.html Boost.Config] should (automatically) define
1482the macro BOOST_HAS_TR1_UNORDERED_SET if your
1483standard library implements this part of TR1.
1484
1485[*Standard Conformity:]
1486Not supported.
1487
1488[endsect]
1489
1490[section:unordered_map Unordered Associative Map (Hash Table).]
1491
1492   #include <boost/tr1/unordered_map.hpp>
1493   
1494or
1495
1496   #include <unordered_map>
1497   
1498This is not currently supported by Boost, although that situation is
1499hoped to change soon.
1500   
1501   namespace std {
1502   namespace tr1 {
1503
1504   // [6.3.4.4] Class template unordered_map
1505   template <class Key,
1506            class T,
1507            class Hash = hash<Key>,
1508            class Pred = std::equal_to<Key>,
1509            class Alloc = std::allocator<std::pair<const Key, T> > >
1510   class unordered_map;
1511
1512   // [6.3.4.6] Class template unordered_multimap
1513   template <class Key,
1514            class T,
1515            class Hash = hash<Key>,
1516            class Pred = std::equal_to<Key>,
1517            class Alloc = std::allocator<std::pair<const Key, T> > >
1518   class unordered_multimap;
1519
1520   template <class Key, class T, class Hash, class Pred, class Alloc>
1521   void swap(unordered_map<Key, T, Hash, Pred, Alloc>& x,
1522            unordered_map<Key, T, Hash, Pred, Alloc>& y);
1523             
1524   template <class Key, class T, class Hash, class Pred, class Alloc>
1525   void swap(unordered_multimap<Key, T, Hash, Pred, Alloc>& x,
1526            unordered_multimap<Key, T, Hash, Pred, Alloc>& y);
1527
1528   } // namespace tr1
1529   } // namespace std
1530
1531[*Configuration:]
1532[@../../libs/config/index.html Boost.Config] should (automatically) define
1533the macro BOOST_HAS_TR1_UNORDERED_MAP if your
1534standard library implements this part of TR1.
1535
1536[*Standard Conformity:]
1537Not supported.
1538
1539[endsect]
1540
1541[endsect]
1542
1543[section:header_list TR1 By Header]
1544
1545[section:array_header <array>]
1546
1547See: [link boost_tr1.array Fixed Size Array]
1548
1549[endsect]
1550
1551[section:cmath_header <cmath>]
1552
1553See: [link boost_tr1.special Special Functions]
1554
1555[endsect]
1556
1557[section:complex_header <complex>]
1558
1559See: [link boost_tr1.complex Additional Overloads for Complex Number Algorithms]
1560
1561See: [link boost_tr1.complex_trig Additional Complex Number Algorithms]
1562
1563[endsect]
1564
1565[section:functional <functional>]
1566
1567See: [link boost_tr1.ref Reference Wrapper].
1568
1569See: [link boost_tr1.result_of Result_of].
1570
1571See: [link boost_tr1.mem_fn Member Function Wrappers].
1572
1573See: [link boost_tr1.bind Function Binders].
1574
1575See: [link boost_tr1.function Polymorphic Function Wrappers].
1576
1577See: [link boost_tr1.hash Hash Functions].
1578
1579[endsect]
1580
1581[section:memory <memory>]
1582
1583See: [link boost_tr1.ptrs Smart Pointers].
1584
1585[endsect]
1586
1587[section:random_header <random>]
1588
1589See: [link boost_tr1.random Random Numbers].
1590
1591[endsect]
1592
1593[section:regex_header <regex>]
1594
1595See: [link boost_tr1.regex Regular Expressions].
1596
1597[endsect]
1598
1599[section:tuple_header <tuple>]
1600
1601See: [link boost_tr1.tuple Tuple Types].
1602
1603[endsect]
1604
1605[section:type_traits_header <type_traits>]
1606
1607See: [link boost_tr1.type_traits Type Traits].
1608
1609[endsect]
1610
1611[section:unordered_map_header <unordered_map>]
1612
1613See: [link boost_tr1.unordered_map Unordered Associative Map]
1614
1615[endsect]
1616
1617[section:unordered_set_header <unordered_set>]
1618
1619See: [link boost_tr1.unordered_set Unordered Associative Set].
1620
1621[endsect]
1622
1623[section:utility_header <utility>]
1624
1625See: [link boost_tr1.utility  Tuple Interface to std::pair].
1626
1627[endsect]
1628
1629[endsect]
1630
1631[section:implementation Implementation]
1632
1633When Boost.TR1 is [link boost_tr1.config configured] to make use of your standard library's
1634native TR1 implementation, then it doesn't do very much: it just includes
1635the appropriate header.
1636
1637When Boost.TR1 is using the Boost implementation of a particular
1638component, then it includes the appropriate Boost header(s) and imports
1639the necessary declarations in `namespace std::tr1` with using declarations.
1640Note that only those declarations that are part of the standard are imported:
1641the implementation is deliberately quite strict about not including any
1642Boost-specific extensions in `namespace std::tr1`, in order to catch any
1643portability errors in user code.  If you really need to use Boost-specific
1644extensions then you should include the Boost headers directly and use the
1645declarations in `namespace boost::` instead.  Note that this style of implementation
1646is not completely standards-conforming, in particular it is not possible
1647to add user-defined template specializations of TR1 components
1648into `namespace std::tr1`.  There are also one or two Boost libraries that are not
1649yet fully standards conforming, any such non-conformities are documented in
1650[link boost_tr1.subject_list the TR1 by subject section].  Hopefully, occurrences of non-standard
1651behavior should be extremely rare in practice however.
1652
1653If you use the standard conforming header includes (in `boost/tr1/tr1`)
1654then these header names can sometimes conflict with existing standard library
1655headers (for example `shared_ptr` is added to the existing
1656standard library header
1657`<memory>` rather than it's own header).  These headers
1658forward on to your existing standard library header in one of two ways: for
1659gcc it uses `#include_next`, and for other compilers it uses the
1660macro `BOOST_TR1_STD_HEADER(header)` (defined in
1661[@../../boost/tr1/detail/config.hpp" boost/tr1/detail/config.hpp])
1662which evaluates to `#include <../include/header>`.  This
1663should work "straight out the box" for most compilers, but does mean that
1664these headers should [*never] be placed inside a
1665directory called "include"
1666that is already in your compiler's search path.
1667
1668[endsect]
1669
1670
1671[section:testing Testing]
1672
1673The test suite for Boost.TR1 is relatively lightweight; tests have been
1674added to the Boost.Config test suite for each new configuration macro, and
1675each TR1 component has a very short concept check test added.  The concept test
1676programs are designed only to verify that all the TR1 components
1677that are
1678supposed to be in `namespace std::tr1` are indeed present and have standards
1679conforming interfaces.  There are a few test programs (those which end in the suffix
1680"_tricky") which do not currently compile with the Boost.TR1 implementation, because the
1681relevant Boost libraries have not yet implemented the features tested; hopefully
1682these incompatibilities will be removed in future releases.
1683
1684The concept tests do not take account of compiler defects (quite deliberately
1685so); the intent is that the tests can be used to verify conformance with the
1686standard, both for Boost code, and for third party implementations.  Consequently
1687very many of these tests are known to fail with older compilers.  This should
1688not be taken as evidence that these compilers can not be used at all with Boost.TR1,
1689simply that there are features missing that make those compilers non-conforming.
1690
1691Full runtime tests for TR1 components are not in general part of this
1692test suite, however, it is hoped that the Boost.TR1 component authors will make
1693their regular test suites compile with the standards conforming headers as well
1694as the Boost-specific ones. This will allow these tests to be used against the standard
1695library's own TR1 implementation as well as the Boost one.
1696
1697[endsect]
1698
1699
1700
1701
1702
Note: See TracBrowser for help on using the repository browser.