diff --git a/tools/boost_1_65_1/libs/Jamfile.v2 b/tools/boost_1_65_1/libs/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..b0d40658043c13a6ed637c0b83a48f1649a52ea5 --- /dev/null +++ b/tools/boost_1_65_1/libs/Jamfile.v2 @@ -0,0 +1,15 @@ +# Jamfile.v2 +# +# Copyright (C) 2013 Bjorn Roald +# +# Distributed under the Boost Software License, Version 1.0. +# See www.boost.org/LICENSE_1_0.txt +# +# Boost libraries common project properties: +# +# Under modularized layout, ensure all inheriting projects get +# implicit dependency to headers staged as links in /boost + +project boost/libs + : requirements /boost//headers + ; diff --git a/tools/boost_1_65_1/libs/index.html b/tools/boost_1_65_1/libs/index.html new file mode 100644 index 0000000000000000000000000000000000000000..4720ada4f4dc3a37c68d203903e7f393ed61f669 --- /dev/null +++ b/tools/boost_1_65_1/libs/index.html @@ -0,0 +1,14 @@ + + + + + +Automatic redirection failed, please go to +libraries.htm. +
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +www.boost.org/LICENSE_1_0.txt)

+ + \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/libraries.htm b/tools/boost_1_65_1/libs/libraries.htm new file mode 100644 index 0000000000000000000000000000000000000000..13c117140170fed458345b8ab906dfaef5494487 --- /dev/null +++ b/tools/boost_1_65_1/libs/libraries.htm @@ -0,0 +1,589 @@ + + + + + + + + +Boost Libraries + + + + + + + + + + +
+ + boost.png (6897 bytes) + Libraries +
+ + + + + +
Getting Started    +      Tools    +      Web Site    +      News    +      Community    +      + FAQ    +      More Info
+ +
+
Libraries Listed Alphabetically
+
Libraries Listed by Category
+
+
Algorithms
+
Broken compiler workarounds
+
Concurrent Programming
+
Containers
+
Correctness and testing
+
Data structures
+
Domain Specific
+
Function objects and higher-order programming
+
Generic Programming
+
Image processing
+
Input/Output
+
Inter-language support
+
Iterators
+
Language Features Emulation
+
Math and numerics
+
Memory
+
Parsing
+
Patterns and Idioms
+
Preprocessor Metaprogramming
+
Programming Interfaces
+
State Machines
+
String and text processing
+
System
+
Template Metaprogramming
+
Miscellaneous
+
+
Libraries Retired from Boost
+
+ +

See Getting Started page to find out +how to download, build, and install the libraries.

+ +
+ +

Libraries Listed Alphabetically

+ + + +
+ +

Libraries Listed by Category

+ +

Algorithms

+ + + +

Broken compiler workarounds

+ + + +

Concurrent Programming

+ + + +

Containers

+ + + +

Correctness and testing

+ + + +

Data structures

+ + + +

Domain Specific

+ + + +

Function objects and higher-order programming

+ + + +

Generic Programming

+ + + +

Image processing

+ + + +

Input/Output

+ + + +

Inter-language support

+ + + +

Iterators

+ + + +

Language Features Emulation

+ + + +

Math and numerics

+ + + +

Memory

+ + + +

Parsing

+ + + +

Patterns and Idioms

+ + + +

Preprocessor Metaprogramming

+ + + +

Programming Interfaces

+ + + +

State Machines

+ + + +

String and text processing

+ + + +

System

+ + + +

Template Metaprogramming

+ + + +

Miscellaneous

+ + + + +

[Category suggestions from Aleksey Gurtovoy, Beman Dawes and Vicente J. Botet Escribá]

+ +
+ +

Libraries Retired from Boost

+ + + +
+ +

Revised +19 Feb 2015

+ +

© Copyright Beman Dawes 2000-2004

+

Distributed under the Boost Software License, Version 1.0. +(See file LICENSE_1_0.txt +or www.boost.org/LICENSE_1_0.txt) +

+ + + diff --git a/tools/boost_1_65_1/libs/maintainers.txt b/tools/boost_1_65_1/libs/maintainers.txt new file mode 100644 index 0000000000000000000000000000000000000000..051b431c79153af7220b11baabe9c2541b26df21 --- /dev/null +++ b/tools/boost_1_65_1/libs/maintainers.txt @@ -0,0 +1,152 @@ +# Copyright (C) 2005, 2007 Douglas Gregor +# Distributed under the Boost Software License, Version 1.0. +# See www.boost.org/LICENSE_1_0.txt +# +# This file lists the names and e-mail addresses of the maintainers +# of each Boost library, and is used by the regression-reporting +# scripts to direct e-mail related to those libraries to the +# maintainers. +# +# This file is automatically updated from library metadata. + +accumulators Eric Niebler +algorithm Marshall Clow +algorithm/minmax Marshall Clow +algorithm/string Marshall Clow +align Glen Fernandes +any Antony Polukhin +array Marshall Clow +asio Chris Kohlhoff +assert Peter Dimov +assign Thorsten Ottosen +atomic Helge Bahmann , Tim Blechmann , Andrey Semashev +bimap Matias Capeletto +bind Peter Dimov +chrono Vicente J. Botet Escriba +chrono/stopwatch Vicente J. Botet Escriba +circular_buffer Jan Gaspar +compute Kyle Lutz +concept_check Jeremy Siek +config John Maddock +container Ion Gaztanaga +context Oliver Kowalke +conversion Antony Polukhin +convert Vladimir Batov +core Peter Dimov , Glen Fernandes , Andrey Semashev +coroutine Oliver Kowalke +coroutine2 Oliver Kowalke +crc Daryle Walker +date_time Jeff Garland +detail Beman Dawes , Robert Ramey , Rene Rivera , Andrey Semashev +disjoint_sets Jeremy Siek +dll Antony Polukhin +dynamic_bitset Jeremy Siek +endian Beman Dawes +exception Emil Dotchevski +fiber Oliver Kowalke +filesystem Beman Dawes +flyweight Joaquin M Lopez Munoz +foreach Eric Niebler +format Samuel Krempp +function Douglas Gregor +function_types Tobias Schwinger +functional +functional/factory Tobias Schwinger +functional/forward Tobias Schwinger +functional/hash Daniel James +functional/overloaded_function Lorenzo Caminiti +fusion Joel de Guzman , Dan Marsden , Tobias Schwinger +geometry Barend Gehrels , Bruno Lalande , Mateusz Loskot , Adam Wulkiewicz +gil Stefan Seefeld +graph K. Noel Belcourt +graph_parallel K. Noel Belcourt +hana Louis Dionne +heap Tim Blechmann +icl Joachim Faulhaber +integer Daryle Walker +interprocess Ion Gaztanaga +intrusive Ion Gaztanaga +io Daryle Walker +iostreams Jonathan Turkanis +iterator David Abrahams , Thomas Witt , Jeffrey Lee Hellrung Jr. +lambda Jaakko Jarvi +lexical_cast Antony Polukhin +local_function Lorenzo Caminiti +locale Artyom Beilis +lockfree Tim Blechmann +log Andrey Semashev +logic Douglas Gregor +math Hubert Holin , John Maddock +metaparse Abel Sinkovics +move Ion Gaztanaga +mpi K. Noel Belcourt , Alain Miniussi +mpl Aleksey Gurtovoy +msm Christophe Henry +multi_array Ronald Garcia +multi_index Joaquin M Lopez Munoz +multiprecision John Maddock , christopher Kormanyos +numeric/conversion Fernando Cacciola , Brandon Kohn +numeric/interval Sylvain Pion , Herve Bronnimann , Guillaume Melquiond +numeric/odeint Karsten Ahnert , Mario Mulansky +numeric/ublas David Bellot +operators Daniel Frey +optional Fernando Cacciola , Andrzej Krzemienski +parameter David Abrahams , Daniel Wallin +phoenix Joel de Guzman , Thomas Heller , John Fletcher +poly_collection Joaquin M Lopez Munoz +polygon Lucanus Simonson , Andrii Sydorchuk +pool Stephen Cleary +predef Rene Rivera +preprocessor Paul Mensonides +process Klemens D. Morgenstern +program_options Vladimir Prus +property_map Douglas Gregor +property_tree Sebastian Redl +proto Eric Niebler +ptr_container Thorsten Ottosen +python Stefan Seefeld +qvm Emil Dotchevski +random Steven Watanabe +range Neil Groves , Nathan Ridge +ratio Vicente J. Botet Escriba +rational Jonathan Turkanis +regex John Maddock +scope_exit Alexander Nasonov , Lorenzo Caminiti +serialization Robert Ramey +signals Douglas Gregor +signals2 Frank Mori Hess +smart_ptr Peter Dimov +smart_ptr/make_shared Glen Fernandes +sort Steven Ross +spirit Joel de Guzman , Hartmut Kaiser +stacktrace Antony Polukhin +statechart Andreas Huber +static_assert John Maddock +test Gennadiy Rozental , Raffi Enficiaud +thread Vicente J. Botet Escriba , Niall Douglas +throw_exception Emil Dotchevski +timer Beman Dawes +tokenizer John R. Bandela +tr1 John Maddock +tti Edward Diener +tuple Jaakko Jarvi +type_erasure Steven Watanabe +type_index Antony Polukhin +type_traits John Maddock +typeof Arkadiy Vertleyb , Peder Holt +units Jürgen Hunold , Steven Watanabe +unordered Daniel James +utility +utility/enable_if Jaakko Jarvi , Jeremiah Willcock +utility/identity_type Lorenzo Caminiti +utility/result_of Daniel Walker +utility/swap Joseph Gauterin +uuid Andy Tompkins +variant Antony Polukhin , Eric Friedman +vmd Edward Diener +wave Hartmut Kaiser +winapi Andrey Semashev +xpressive Eric Niebler + + + diff --git a/tools/boost_1_65_1/libs/platform_maintainers.txt b/tools/boost_1_65_1/libs/platform_maintainers.txt new file mode 100644 index 0000000000000000000000000000000000000000..756d77b06918fb7b6390b7a3711756c59fdc4bd1 --- /dev/null +++ b/tools/boost_1_65_1/libs/platform_maintainers.txt @@ -0,0 +1,38 @@ +# Copyright (C) 2005, 2007 Douglas Gregor +# Distributed under the Boost Software License, Version 1.0. +# See www.boost.org/LICENSE_1_0.txt +# +# This file lists the names and e-mail addresses of the maintainers +# of each Boost testing platform , and is used by the regression- +# reporting scripts to direct e-mail related to those platforms to the +# maintainers. When making changes to this file, please be careful +# to closely follow the format of the library. +# +# The format of each line is: +# +# Runner Platform Email addresses + +Sandia-darwin-intel darwin-4.0.1 Noel Belcourt +Sandia-darwin-ppc darwin-4.0.1 Noel Belcourt +Sandia-intel intel-linux-8.1 Noel Belcourt +Sandia-intel intel-linux-9.0 Noel Belcourt +Sandia-intel intel-linux-9.1 Noel Belcourt +Sandia-gcc gcc-4.2.1 Noel Belcourt +Sandia-gcc gcc-3.4.3 Noel Belcourt +Sandia-gcc gcc-4.0.1 Noel Belcourt +Sandia-gcc-64 gcc-4.2.1 Noel Belcourt +Sandia-gcc-64 gcc-4.1.1 Noel Belcourt +Sandia-sun gcc-3.4.6 Noel Belcourt +Sandia-sun sun-5.7 Noel Belcourt +Sandia-sun sun-5.8 Noel Belcourt +Sandia-sun sun-5.9 Noel Belcourt +"Martin Wille x86_64" gcc-4.2.1_linux_x86_64 Martin Wille +"Martin Wille x86_64" gcc-3.4.6_linux_x86_64 Martin Wille +Huang-WinXP-x86_32 intel-vc8-win-10.0 Sean Huang +Huang-WinXP-x86_32 msvc-8.0 Sean Huang +Huang-Vista-x64 msvc-8.0_64 Sean Huang +Huang-Vista-x64 intel-vc8-win-10.0_x86_64 Sean Huang +Huang-Vista-x64 msvc-8.0_x86_64 Sean Huang +IBM_Canada_Ltd vacpp Chris Cambly +RW_WinXP_VC msvc-7.1 Richard Webb +RW_WinXP_VC msvc-9.0 Richard Webb diff --git a/tools/boost_1_65_1/libs/tuple/doc/design_decisions_rationale.html b/tools/boost_1_65_1/libs/tuple/doc/design_decisions_rationale.html new file mode 100644 index 0000000000000000000000000000000000000000..21f7457da65615f36ee84fda5f9233d2d9a517de --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/doc/design_decisions_rationale.html @@ -0,0 +1,155 @@ + + + +Design decisions rationale for Boost Tuple Library + + + +C++ Boost + +

Tuple Library : design decisions rationale

+ +

About namespaces

+ +

+There was a discussion about whether tuples should be in a separate namespace or directly in the boost namespace. +The common principle is that domain libraries (like graph, python) should be on a separate +subnamespace, while utility like libraries directly in the boost namespace. +Tuples are somewhere in between, as the tuple template is clearly a general utility, but the library introduces quite a lot of names in addition to just the tuple template. +Tuples were originally under a subnamespace. +As a result of the discussion, tuple definitions were moved directly under the boost namespace. +As a result of a continued discussion, the subnamespace was reintroduced. +The final (I truly hope so) solution is now to have all definitions in namespace ::boost::tuples, and the most common names in the ::boost namespace as well. +This is accomplished with using declarations (suggested by Dave Abrahams):

+
namespace boost {
+  namespace tuples {
+      ...      
+    // All library code
+      ...
+  }
+  using tuples::tuple; 
+  using tuples::make_tuple;
+  using tuples::tie;
+  using tuples::get;
+}
+
+

With this arrangement, tuple creation with direct constructor calls, make_tuple or tie functions do not need the namespace qualifier. +Further, all functions that manipulate tuples are found with Koenig-lookup. +The only exceptions are the get<N> functions, which are always called with an explicitly qualified template argument, and thus Koenig-lookup does not apply. +Therefore, get is lifted to ::boost namespace with a using declaration. +Hence, the interface for an application programmer is in practice under the namespace ::boost. +

+

+The other names, forming an interface for library writers (cons lists, metafunctions manipulating cons lists, ...) remain in the subnamespace ::boost::tuples. +Note, that the names ignore, set_open, set_close and set_delimiter are considered to be part of the application programmer's interface, but are still not under boost namespace. +The reason being the danger for name clashes for these common names. +Further, the usage of these features is probably not very frequent. +

+ +

For those who are really interested in namespaces

+ +

+The subnamespace name tuples raised some discussion. +The rationale for not using the most natural name 'tuple' is to avoid having an identical name with the tuple template. +Namespace names are, however, not generally in plural form in boost libraries. +First, no real trouble was reported for using the same name for a namespace and a class and we considered changing the name 'tuples' to 'tuple'. +But we found some trouble after all. +Both gcc and edg compilers reject using declarations where the namespace and class names are identical:

+ +
namespace boost {
+  namespace tuple {
+    ... tie(...);
+    class tuple; 
+      ...
+  }
+  using tuple::tie; // ok
+  using tuple::tuple; // error
+    ...
+}
+
+ +

Note, however, that a corresponding using declaration in the global namespace seems to be ok:

+ +

+using boost::tuple::tuple; // ok;
+
+ + +

The end mark of the cons list (nil, null_type, ...)

+ +

+Tuples are internally represented as cons lists: + +

tuple<int, int>
+
+

inherits from

+
cons<int, cons<int, null_type> >
+
+ +

+null_type is the end mark of the list. Original proposition was nil, but the name is used in MacOS, and might have caused problems, so null_type was chosen instead. +Other names considered were null_t and unit (the empty tuple type in SML).

+

+Note that null_type is the internal representation of an empty tuple: tuple<> inherits from null_type. +

+ +

Element indexing

+ +

+Whether to use 0- or 1-based indexing was discussed more than thoroughly, and the following observations were made:

+ +
    +
  • 0-based indexing is 'the C++ way' and used with arrays etc.
  • +
  • 1-based 'name like' indexing exists as well, eg. bind1st, bind2nd, pair::first, etc.
  • +
+

Tuple access with the syntax get<N>(a), or a.get<N>() (where a is a tuple and N an index), was considered to be of the first category, hence, the index of the first element in a tuple is 0.

+ +

+A suggestion to provide 1-based 'name like' indexing with constants like _1st, _2nd, _3rd, ... was made. +By suitably chosen constant types, this would allow alternative syntaxes: + +

a.get<0>() == a.get(_1st) == a[_1st] == a(_1st);
+
+ +

We chose not to provide more than one indexing method for the following reasons:

+
    +
  • 0-based indexing might not please everyone, but once its fixed, it is less confusing than having two different methods (would anyone want such constants for arrays?).
  • +
  • Adding the other indexing scheme doesn't really provide anything new (like a new feature) to the user of the library.
  • +
  • C++ variable and constant naming rules don't give many possibilities for defining short and nice index constants (like _1st, ...). +Let the binding and lambda libraries use these for a better purpose.
  • +
  • The access syntax a[_1st] (or a(_1st)) is appealing, and almost made us add the index constants after all. However, 0-based subscripting is so deep in C++, that we had a fear for confusion.
  • +
  • +Such constants are easy to add. +
  • +
+ + +

Tuple comparison

+ +

The comparison operator implements lexicographical order. +Other orderings were considered, mainly dominance (a < b iff for each i a(i) < b(i)). +Our belief is, that lexicographical ordering, though not mathematically the most natural one, is the most frequently needed ordering in everyday programming.

+ +

Streaming

+ +

+The characters specified with tuple stream manipulators are stored within the space allocated by ios_base::xalloc, which allocates storage for long type objects. +static_cast is used in casting between long and the stream's character type. +Streams that have character types not convertible back and forth to long thus fail to compile.

+ +

This may be revisited at some point. The two possible solutions are:

+
    +
  • Allow only plain char types as the tuple delimiters and use widen and narrow to convert between the real character type of the stream. +This would always compile, but some calls to set manipulators might result in a different + character than expected (some default character).
  • +
  • Allocate enough space to hold the real character type of the stream. +This means memory for holding the delimiter characters must be allocated separately, and that pointers to this memory are stored in the space allocated with ios_base::xalloc. +Any volunteers?
  • +
+ +Back to the user's guide +

© Copyright Jaakko Järvi 2001. + + + diff --git a/tools/boost_1_65_1/libs/tuple/doc/tuple_advanced_interface.html b/tools/boost_1_65_1/libs/tuple/doc/tuple_advanced_interface.html new file mode 100644 index 0000000000000000000000000000000000000000..c783f0285d9c340093ccf7a5a016e0dd05340802 --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/doc/tuple_advanced_interface.html @@ -0,0 +1,134 @@ + + + + Tuple library advanced features + + + + +C++ Boost + +

Tuple library advanced features

+ +The advanced features described in this document are all under namespace ::boost::tuples + +

Metafunctions for tuple types

+

+Suppose T is a tuple type, and N is a constant integral expression.

+ +
element<N, T>::type
+ +

gives the type of the Nth element in the tuple type T. If T is const, the resulting type is const qualified as well. +Note that the constness of T does not affect reference type +elements. +

+ +
length<T>::value
+ +

gives the length of the tuple type T. +

+ +

Cons lists

+ +

+Tuples are internally represented as cons lists. +For example, the tuple

+ +
tuple<A, B, C, D>
+ +

inherits from the type

+
cons<A, cons<B, cons<C, cons<D, null_type> > > >
+
+ +

The tuple template provides the typedef inherited to access the cons list representation. E.g.: +tuple<A>::inherited is the type cons<A, null_type>. +

+ +

Empty tuple

+

+The internal representation of the empty tuple tuple<> is null_type. +

+ +

Head and tail

+

+Both tuple template and the cons templates provide the typedefs head_type and tail_type. +The head_type typedef gives the type of the first element of the tuple (or the cons list). +The +tail_type typedef gives the remaining cons list after removing the first element. +The head element is stored in the member variable head and the tail list in the member variable tail. +Cons lists provide the member function get_head() for getting a reference to the head of a cons list, and get_tail() for getting a reference to the tail. +There are const and non-const versions of both functions. +

+

+Note that in a one element tuple, tail_type equals null_type and the get_tail() function returns an object of type null_type. +

+

+The empty tuple (null_type) has no head or tail, hence the get_head and get_tail functions are not provided. +

+ +

+Treating tuples as cons lists gives a convenient means to define generic functions to manipulate tuples. For example, the following pair of function templates assign 0 to each element of a tuple (obviously, the assignments must be valid operations for the element types): + +

inline void set_to_zero(const null_type&) {};
+
+template <class H, class T>
+inline void set_to_zero(cons<H, T>& x) { x.get_head() = 0; set_to_zero(x.get_tail()); }
+
+

+ +

Constructing cons lists

+ +

+A cons list can be default constructed provided that all its elements can be default constructed. +

+

+A cons list can be constructed from its head and tail. The prototype of the constructor is:

+
cons(typename access_traits<head_type>::parameter_type h,
+     const tail_type& t)
+
+

The traits template for the head parameter selects correct parameter types for different kinds of element types (for reference elements the parameter type equals the element type, for non-reference types the parameter type is a reference to const non-volatile element type). +

+

+For a one-element cons list the tail argument (null_type) can be omitted. +

+ + +

Traits classes for tuple element types

+ +

access_traits

+

+The template access_traits defines three type functions. Let T be a type of an element in a tuple:

+
    +
  1. access_traits<T>::non_const_type maps T to the return type of the non-const access functions (nonmember and member get functions, and the get_head function).
  2. +
  3. access_traits<T>::const_type maps T to the return type of the const access functions.
  4. +
  5. access_traits<T>::parameter_type maps T to the parameter type of the tuple constructor.
  6. +
+

make_tuple_traits

+ +

The element types of the tuples that are created with the make_tuple functions are computed with the type function make_tuple_traits. +The type function call make_tuple_traits<T>::type implements the following type mapping:

+
    +
  • any reference type -> compile time error +
  • +
  • any array type -> constant reference to the array type +
  • +
  • reference_wrapper<T> -> T& +
  • +
  • T -> T +
  • +
+ +

Objects of type reference_wrapper are created with the ref and cref functions (see The make_tuple function.) +

+ +

Reference wrappers were originally part of the tuple library, but they are now a general utility of boost. +The reference_wrapper template and the ref and cref functions are defined in a separate file ref.hpp in the main boost include directory; and directly in the boost namespace. +

+ +Back to the user's guide +
+ +

© Copyright Jaakko Järvi 2001.

+ + diff --git a/tools/boost_1_65_1/libs/tuple/doc/tuple_users_guide.html b/tools/boost_1_65_1/libs/tuple/doc/tuple_users_guide.html new file mode 100644 index 0000000000000000000000000000000000000000..c68edfc7f1dbfe99729849f5abf8b612d3d60712 --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/doc/tuple_users_guide.html @@ -0,0 +1,535 @@ + + + +The Boost Tuple Library + + + +C++ Boost + +

The Boost Tuple Library

+ +

+A tuple (or n-tuple) is a fixed size collection of elements. +Pairs, triples, quadruples etc. are tuples. +In a programming language, a tuple is a data object containing other objects as elements. +These element objects may be of different types. +

+ +

Tuples are convenient in many circumstances. +For instance, tuples make it easy to define functions that return more than one value. +

+ +

+Some programming languages, such as ML, Python and Haskell, have built-in tuple constructs. +Unfortunately C++ does not. +To compensate for this "deficiency", the Boost Tuple Library implements a tuple construct using templates. +

+ +

Table of Contents

+ +
    +
  1. Using the library
  2. +
  3. Tuple types
  4. +
  5. Constructing tuples
  6. +
  7. Accessing tuple elements
  8. +
  9. Copy construction and tuple assignment
  10. +
  11. Relational operators
  12. +
  13. Tiers
  14. +
  15. Streaming
  16. +
  17. Performance
  18. +
  19. Portability
  20. +
  21. Acknowledgements
  22. +
  23. References
  24. +
+ +

More details

+ +

+Advanced features (describes some metafunctions etc.).

+

+Rationale behind some design/implementation decisions.

+ + +

Using the library

+ +

To use the library, just include:

+ +
#include "boost/tuple/tuple.hpp"
+ +

Comparison operators can be included with:

+
#include "boost/tuple/tuple_comparison.hpp"
+ +

To use tuple input and output operators,

+ +
#include "boost/tuple/tuple_io.hpp"
+ +

Both tuple_io.hpp and tuple_comparison.hpp include tuple.hpp.

+ +

All definitions are in namespace ::boost::tuples, but the most common names are lifted to namespace +::boost with using declarations. These names are: tuple, make_tuple, tie and get. +Further, ref and cref are defined directly under the ::boost namespace.

+ +

Tuple types

+ +

A tuple type is an instantiation of the tuple template. +The template parameters specify the types of the tuple elements. +The current version supports tuples with 0-10 elements. +If necessary, the upper limit can be increased up to, say, a few dozen elements. +The data element can be any C++ type. +Note that void and plain function types are valid +C++ types, but objects of such types cannot exist. +Hence, if a tuple type contains such types as elements, the tuple type +can exist, but not an object of that type. +There are natural limitations for element types that cannot +be copied, or that are not default constructible (see 'Constructing tuples' + below).

+ +

+For example, the following definitions are valid tuple instantiations (A, B and C are some user defined classes):

+ +
tuple<int>
+tuple<double&, const double&, const double, double*, const double*>
+tuple<A, int(*)(char, int), B(A::*)(C&), C>
+tuple<std::string, std::pair<A, B> >
+tuple<A*, tuple<const A*, const B&, C>, bool, void*>
+
+ +

Constructing tuples

+ +

+The tuple constructor takes the tuple elements as arguments. +For an n-element tuple, the constructor can be invoked with k arguments, where 0 <= k <= n. +For example:

+
tuple<int, double>() 
+tuple<int, double>(1) 
+tuple<int, double>(1, 3.14)
+
+ +

+If no initial value for an element is provided, it is default initialized (and hence must be default initializable). +For example.

+ +
class X {
+  X(); 
+public:
+  X(std::string);
+};
+
+tuple<X,X,X>()                                              // error: no default constructor for X
+tuple<X,X,X>(string("Jaba"), string("Daba"), string("Duu")) // ok
+
+ +

In particular, reference types do not have a default initialization:

+ +
tuple<double&>()                // error: reference must be 
+                                // initialized explicitly
+
+double d = 5; 
+tuple<double&>(d)               // ok
+
+tuple<double&>(d+3.14)          // error: cannot initialize 
+                                // non-const reference with a temporary
+
+tuple<const double&>(d+3.14)    // ok, but dangerous: 
+                                // the element becomes a dangling reference 
+
+ +

Using an initial value for an element that cannot be copied, is a compile +time error:

+ +
class Y { 
+  Y(const Y&); 
+public:
+  Y();
+};
+
+char a[10];
+
+tuple<char[10], Y>(a, Y()); // error, neither arrays nor Y can be copied
+tuple<char[10], Y>();       // ok
+
+ +

Note particularly that the following is perfectly ok:

+
Y y;
+tuple<char(&)[10], Y&>(a, y); 
+
+ +

It is possible to come up with a tuple type that cannot be constructed. +This occurs if an element that cannot be initialized has a lower +index than an element that requires initialization. +For example: tuple<char[10], int&>.

+ +

In sum, the tuple construction is semantically just a group of individual elementary constructions. +

+ +

The make_tuple function

+ +

+Tuples can also be constructed using the make_tuple (cf. std::make_pair) helper functions. +This makes the construction more convenient, saving the programmer from explicitly specifying the element types:

+
tuple<int, int, double> add_multiply_divide(int a, int b) {
+  return make_tuple(a+b, a*b, double(a)/double(b));
+}
+
+ +

+By default, the element types are deduced to the plain non-reference types. E.g.:

+
void foo(const A& a, B& b) { 
+  ...
+  make_tuple(a, b);
+
+

The make_tuple invocation results in a tuple of type tuple<A, B>.

+ +

+Sometimes the plain non-reference type is not desired, e.g. if the element type cannot be copied. +Therefore, the programmer can control the type deduction and state that a reference to const or reference to +non-const type should be used as the element type instead. +This is accomplished with two helper template functions: ref and cref. +Any argument can be wrapped with these functions to get the desired type. +The mechanism does not compromise const correctness since a const object wrapped with ref results +in a tuple element with const reference type (see the fifth example below). +For example:

+ +
A a; B b; const A ca = a;
+make_tuple(cref(a), b);      // creates tuple<const A&, B>
+make_tuple(ref(a), b);       // creates tuple<A&, B>
+make_tuple(ref(a), cref(b)); // creates tuple<A&, const B&>
+make_tuple(cref(ca));        // creates tuple<const A&>
+make_tuple(ref(ca));         // creates tuple<const A&>
+
+ + +

+Array arguments to make_tuple functions are deduced to reference to const types by default; there is no need to wrap them with cref. For example:

+
make_tuple("Donald", "Daisy");
+
+ +

This creates an object of type tuple<const char (&)[7], const char (&)[6]> +(note that the type of a string literal is an array of const characters, not const char*). +However, to get make_tuple to create a tuple with an element of a +non-const array type one must use the ref wrapper.

+ +

+Function pointers are deduced to the plain non-reference type, that is, to plain function pointer. +A tuple can also hold a reference to a function, +but such a tuple cannot be constructed with make_tuple (a const qualified function type would result, which is illegal):

+
void f(int i);
+  ...
+make_tuple(&f); // tuple<void (*)(int)>
+  ...
+tuple<tuple<void (&)(int)> > a(f) // ok
+make_tuple(f);                    // not ok
+
+ +

Accessing tuple elements

+ +

+Tuple elements are accessed with the expression:

+ +
t.get<N>()
+
+

or

+
get<N>(t)
+
+

where t is a tuple object and N is a constant integral expression specifying the index of the element to be accessed. +Depending on whether t is const or not, get returns the Nth element as a reference to const or +non-const type. +The index of the first element is 0 and thus +N must be between 0 and k-1, where k is the number of elements in the tuple. +Violations of these constraints are detected at compile time. Examples:

+ +
double d = 2.7; A a;
+tuple<int, double&, const A&> t(1, d, a);
+const tuple<int, double&, const A&> ct = t;
+  ...
+int i = get<0>(t); i = t.get<0>();        // ok
+int j = get<0>(ct);                       // ok
+get<0>(t) = 5;                            // ok 
+get<0>(ct) = 5;                           // error, can't assign to const 
+  ...
+double e = get<1>(t); // ok   
+get<1>(t) = 3.14;     // ok 
+get<2>(t) = A();      // error, can't assign to const 
+A aa = get<3>(t);     // error: index out of bounds 
+  ...
+++get<0>(t);  // ok, can be used as any variable
+
+ +

+Note! The member get functions are not supported with MS Visual C++ compiler. +Further, the compiler has trouble with finding the non-member get functions without an explicit namespace qualifier. +Hence, all get calls should be qualified as: tuples::get<N>(a_tuple) when writing code that should compile with MSVC++ 6.0. +

+ +

Copy construction and tuple assignment

+ +

+A tuple can be copy constructed from another tuple, provided that the element types are element-wise copy constructible. +Analogously, a tuple can be assigned to another tuple, provided that the element types are element-wise assignable. +For example:

+ +
class A {};
+class B : public A {};
+struct C { C(); C(const B&); };
+struct D { operator C() const; };
+tuple<char, B*, B, D> t;
+  ...
+tuple<int, A*, C, C> a(t); // ok 
+a = t;                     // ok 
+
+ +

In both cases, the conversions performed are: char -> int, B* -> A* (derived class pointer to base class pointer), B -> C (a user defined conversion) and D -> C (a user defined conversion).

+ +

+Note that assignment is also defined from std::pair types:

+ +
tuple<float, int> a = std::make_pair(1, 'a');
+
+ +

Relational operators

+

+Tuples reduce the operators ==, !=, <, >, <= and >= to the corresponding elementary operators. +This means, that if any of these operators is defined between all elements of two tuples, then the same operator is defined between the tuples as well. + +The equality operators for two tuples a and b are defined as:

+
    +
  • a == b iff for each i: ai == bi
  • +
  • a != b iff exists i: ai != bi
  • +
+ +

The operators <, >, <= and >= implement a lexicographical ordering.

+ +

+Note that an attempt to compare two tuples of different lengths results in a compile time error. +Also, the comparison operators are "short-circuited": elementary comparisons start from the first elements and are performed only until the result is clear.

+ +

Examples:

+ +
tuple<std::string, int, A> t1(std::string("same?"), 2, A());
+tuple<std::string, long, A> t2(std::string("same?"), 2, A());
+tuple<std::string, long, A> t3(std::string("different"), 3, A());
+
+bool operator==(A, A) { std::cout << "All the same to me..."; return true; }
+
+t1 == t2; 		// true
+t1 == t3;               // false, does not print "All the..."
+
+ + +

Tiers

+ +

+Tiers are tuples, where all elements are of non-const reference types. +They are constructed with a call to the tie function template (cf. make_tuple):

+ +
int i; char c; double d; 
+  ...
+tie(i, c, a);
+
+ +

+The above tie function creates a tuple of type tuple<int&, char&, double&>. +The same result could be achieved with the call make_tuple(ref(i), ref(c), ref(a)). +

+ +

+A tuple that contains non-const references as elements can be used to 'unpack' another tuple into variables. E.g.:

+ +
int i; char c; double d; 
+tie(i, c, d) = make_tuple(1,'a', 5.5);
+std::cout << i << " " <<  c << " " << d;
+
+

This code prints 1 a 5.5 to the standard output stream. + +A tuple unpacking operation like this is found for example in ML and Python. +It is convenient when calling functions which return tuples.

+ +

+The tying mechanism works with std::pair templates as well:

+ +
int i; char c;
+tie(i, c) = std::make_pair(1, 'a');
+
+

Ignore

+

There is also an object called ignore which allows you to ignore an element assigned by a tuple. +The idea is that a function may return a tuple, only part of which you are interested in. For example (note, that ignore is under the tuples subnamespace):

+ +
char c;
+tie(tuples::ignore, c) = std::make_pair(1, 'a');
+
+ +

Streaming

+ +

+The global operator<< has been overloaded for std::ostream such that tuples are +output by recursively calling operator<< for each element. +

+ +

+Analogously, the global operator>> has been overloaded to extract tuples from std::istream by recursively calling operator>> for each element. +

+ +

+The default delimiter between the elements is space, and the tuple is enclosed +in parenthesis. +For Example: + +

tuple<float, int, std::string> a(1.0f,  2, std::string("Howdy folks!");
+
+cout << a; 
+
+

outputs the tuple as: (1.0 2 Howdy folks!)

+ +

+The library defines three manipulators for changing the default behavior:

+
    +
  • set_open(char) defines the character that is output before the first +element.
  • +
  • set_close(char) defines the character that is output after the +last element.
  • +
  • set_delimiter(char) defines the delimiter character between +elements.
  • +
+ +

Note, that these manipulators are defined in the tuples subnamespace. +For example:

+
cout << tuples::set_open('[') << tuples::set_close(']') << tuples::set_delimiter(',') << a; 
+
+

outputs the same tuple a as: [1.0,2,Howdy folks!]

+ +

The same manipulators work with operator>> and istream as well. Suppose the cin stream contains the following data: + +

(1 2 3) [4:5]
+ +

The code:

+ +
tuple<int, int, int> i;
+tuple<int, int> j;
+
+cin >> i;
+cin >> tuples::set_open('[') >> tuples::set_close(']') >> tuples::set_delimiter(':');
+cin >> j;
+
+ +

reads the data into the tuples i and j.

+ +

+Note that extracting tuples with std::string or C-style string +elements does not generally work, since the streamed tuple representation may not be unambiguously +parseable. +

+ +

Performance

+ +

All tuple access and construction functions are small inlined one-liners. +Therefore, a decent compiler can eliminate any extra cost of using tuples compared to using hand-written tuple like classes. +Particularly, with a decent compiler there is no performance difference between this code:

+ +
class hand_made_tuple { 
+  A a; B b; C c;
+public:
+  hand_made_tuple(const A& aa, const B& bb, const C& cc) 
+    : a(aa), b(bb), c(cc) {};
+  A& getA() { return a; };
+  B& getB() { return b; };
+  C& getC() { return c; };
+};
+
+hand_made_tuple hmt(A(), B(), C()); 
+hmt.getA(); hmt.getB(); hmt.getC();
+
+ +

and this code:

+ +
tuple<A, B, C> t(A(), B(), C());
+t.get<0>(); t.get<1>(); t.get<2>(); 
+
+ +

Note, that there are widely used compilers (e.g. bcc 5.5.1) which fail to optimize this kind of tuple usage. +

+

+Depending on the optimizing ability of the compiler, the tier mechanism may have a small performance penalty compared to using +non-const reference parameters as a mechanism for returning multiple values from a function. +For example, suppose that the following functions f1 and f2 have equivalent functionalities:

+ +
void f1(int&, double&);
+tuple<int, double> f2();
+
+ +

Then, the call #1 may be slightly faster than #2 in the code below:

+ +
int i; double d;
+  ...
+f1(i,d);         // #1
+tie(i,d) = f2(); // #2
+
+

See +[1, +2] + for more in-depth discussions about efficiency.

+ +

Effect on Compile Time

+ +

+Compiling tuples can be slow due to the excessive amount of template instantiations. +Depending on the compiler and the tuple length, it may be more than 10 times slower to compile a tuple construct, compared to compiling an equivalent explicitly written class, such as the hand_made_tuple class above. +However, as a realistic program is likely to contain a lot of code in addition to tuple definitions, the difference is probably unnoticeable. +Compile time increases between 5 and 10 percent were measured for programs which used tuples very frequently. +With the same test programs, memory consumption of compiling increased between 22% to 27%. See +[1, +2] +for details. +

+ +

Portability

+ +

The library code is(?) standard C++ and thus the library works with a standard conforming compiler. +Below is a list of compilers and known problems with each compiler: +

+ + + + + + + +
CompilerProblems
gcc 2.95-
edg 2.44-
Borland 5.5Can't use function pointers or member pointers as tuple elements
Metrowerks 6.2Can't use ref and cref wrappers
MS Visual C++No reference elements (tie still works). Can't use ref and cref wrappers
+ +

Acknowledgements

+

Gary Powell has been an indispensable helping hand. In particular, stream manipulators for tuples were his idea. Doug Gregor came up with a working version for MSVC, David Abrahams found a way to get rid of most of the restrictions for compilers not supporting partial specialization. Thanks to Jeremy Siek, William Kempf and Jens Maurer for their help and suggestions. +The comments by Vesa Karvonen, John Max Skaller, Ed Brey, Beman Dawes, David Abrahams and Hartmut Kaiser helped to improve the +library. +The idea for the tie mechanism came from an old usenet article by Ian McCulloch, where he proposed something similar for std::pairs.

+

References

+ +

+[1] +Järvi J.: Tuples and multiple return values in C++, TUCS Technical Report No 249, 1999. +

+ +

+[2] +Järvi J.: ML-Style Tuple Assignment in Standard C++ - Extending the Multiple Return Value Formalism, TUCS Technical Report No 267, 1999. +

+ +

+[3] Järvi J.:Tuple Types and Multiple Return Values, C/C++ Users Journal, August 2001. +

+ +
+ +

Last modified 2003-09-07

+ +

© Copyright Jaakko Järvi 2001. + +Permission to copy, use, modify, sell and distribute this software and its documentation is granted provided this copyright notice appears in all copies. +This software and its documentation is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose. +

+ + + + + + diff --git a/tools/boost_1_65_1/libs/tuple/index.html b/tools/boost_1_65_1/libs/tuple/index.html new file mode 100644 index 0000000000000000000000000000000000000000..d8c1cf895339116c583902c80e1b2848b1639feb --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/index.html @@ -0,0 +1,13 @@ + + + + + +Automatic redirection failed, please go to doc/tuple_users_guide.html
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/tuple/test/Jamfile b/tools/boost_1_65_1/libs/tuple/test/Jamfile new file mode 100644 index 0000000000000000000000000000000000000000..66574f691bef12b9b7f1b08e32d0b9b11ef4f846 --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/test/Jamfile @@ -0,0 +1,8 @@ + +project : requirements /boost/test//boost_test_exec_monitor ; + +test-suite tuple : + [ run tuple_test_bench.cpp ] + [ run io_test.cpp ] + [ run another_tuple_test_bench.cpp ] + ; \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/tuple/test/README b/tools/boost_1_65_1/libs/tuple/test/README new file mode 100644 index 0000000000000000000000000000000000000000..6047c49aa2c4b8a6bb100f8d8ba0b251c926b47d --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/test/README @@ -0,0 +1,16 @@ +To compile the + +libs/tuple/test/*.cpp + +files, you need to set include paths +for boost. +For example, in libs/tuple/test directory you would type (using g++): + +g++ -I../../.. tuple_test_bench.cpp + +The following is not true anymore: + + If you want to use tuple_io, you need to compile and link src/tuple.cpp: + g++ -I../../.. ../src/tuple.cpp io_test.cpp + +Thanks to Hartmut Kaiser's suggestion, the tuple.cpp is not needed anymore. diff --git a/tools/boost_1_65_1/libs/tuple/test/another_tuple_test_bench.cpp b/tools/boost_1_65_1/libs/tuple/test/another_tuple_test_bench.cpp new file mode 100644 index 0000000000000000000000000000000000000000..15074daf056d6a1f847c134a6470bace21d6bc6f --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/test/another_tuple_test_bench.cpp @@ -0,0 +1,163 @@ +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// For more information, see http://www.boost.org + + +// another_test_bench.cpp -------------------------------- + +// This file has various tests to see that things that shouldn't +// compile, don't compile. + +// Defining any of E1 to E5 or E7 to E11 opens some illegal code that +// should cause the compliation to fail. + +#define BOOST_INCLUDE_MAIN // for testing, include rather than link +#include // see "Header Implementation Option" + +#include "boost/tuple/tuple.hpp" + +#include +#include + +using namespace boost; +using namespace boost::tuples; + + +template void dummy(const T&) {} + +class A {}; class B {}; class C {}; + +// A non-copyable class +class no_copy { + no_copy(const no_copy&) {} +public: + no_copy() {}; +}; + +no_copy y; + +#ifdef E1 +tuple v1; // should faild +#endif + + +#ifdef E2 +char cs[10]; +tuple v3; // should fail, arrays must be stored as references +#endif + +// a class without a public default constructor +class no_def_constructor { + no_def_constructor() {} +public: + no_def_constructor(std::string) {} // can be constructed with a string +}; + +void foo1() { + +#ifdef E3 + dummy(tuple()); + // should fail + +#endif +} + +void foo2() { +// testing default values +#ifdef E4 + dummy(tuple()); // should fail, not defaults for references + dummy(tuple()); // likewise +#endif + +#ifdef E5 + double dd = 5; + dummy(tuple(dd+3.14)); // should fail, temporary to non-const reference +#endif +} + + + +// make_tuple ------------------------------------------ + + + void foo3() { +#ifdef E7 + std::make_pair("Doesn't","Work"); // fails +#endif + // make_tuple("Does", "Work"); // this should work +} + + + +// - testing element access + +void foo4() +{ + double d = 2.7; + A a; + tuple t(1, d, a); + const tuple ct = t; + (void)ct; +#ifdef E8 + get<0>(ct) = 5; // can't assign to const +#endif + +#ifdef E9 + get<4>(t) = A(); // can't assign to const +#endif +#ifdef E10 + dummy(get<5>(ct)); // illegal index +#endif +} + +// testing copy and assignment with implicit conversions between elements +// testing tie + + class AA {}; + class BB : public AA {}; + struct CC { CC() {} CC(const BB& b) {} }; + struct DD { operator CC() const { return CC(); }; }; + + void foo5() { + tuple t; + (void)t; + tuple aaa; + tuple bbb(aaa); + (void)bbb; + // tuple a = t; + // a = t; + } + + +// testing tie +// testing assignment from std::pair +void foo7() { + + tuple a; +#ifdef E11 + a = std::make_pair(1, 2); // should fail, tuple is of length 3, not 2 +#endif + + dummy(a); +} + + + +// -------------------------------- +// ---------------------------- +int test_main(int, char *[]) { + + foo1(); + foo2(); + foo3(); + foo4(); + foo5(); + + foo7(); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/tuple/test/io_test.cpp b/tools/boost_1_65_1/libs/tuple/test/io_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..382f8cc51db178f7e096c602f0f81c63960835d0 --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/test/io_test.cpp @@ -0,0 +1,143 @@ +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// For more information, see http://www.boost.org + +// -- io_test.cpp ----------------------------------------------- +// +// Testing the I/O facilities of tuples + +#define BOOST_INCLUDE_MAIN // for testing, include rather than link +#include "boost/test/test_tools.hpp" // see "Header Implementation Option" + +#include "boost/tuple/tuple_io.hpp" +#include "boost/tuple/tuple_comparison.hpp" + +#include +#include +#include +#include +#include + +#if defined BOOST_NO_STRINGSTREAM +#include +#else +#include +#endif + +using namespace boost; + +#if defined BOOST_NO_STRINGSTREAM +typedef std::ostrstream useThisOStringStream; +typedef std::istrstream useThisIStringStream; +#else +typedef std::ostringstream useThisOStringStream; +typedef std::istringstream useThisIStringStream; +#endif + +int test_main(int argc, char * argv[] ) { + (void)argc; + (void)argv; + using boost::tuples::set_close; + using boost::tuples::set_open; + using boost::tuples::set_delimiter; + + useThisOStringStream os1; + + // Set format [a, b, c] for os1 + os1 << set_open('['); + os1 << set_close(']'); + os1 << set_delimiter(','); + os1 << make_tuple(1, 2, 3); + BOOST_CHECK (os1.str() == std::string("[1,2,3]") ); + + { + useThisOStringStream os2; + // Set format (a:b:c) for os2; + os2 << set_open('('); + os2 << set_close(')'); + os2 << set_delimiter(':'); +#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + os2 << make_tuple("TUPU", "HUPU", "LUPU", 4.5); + BOOST_CHECK (os2.str() == std::string("(TUPU:HUPU:LUPU:4.5)") ); +#endif + } + + // The format is still [a, b, c] for os1 + os1 << make_tuple(1, 2, 3); + BOOST_CHECK (os1.str() == std::string("[1,2,3][1,2,3]") ); + + // check empty tuple. + useThisOStringStream os3; + os3 << make_tuple(); + BOOST_CHECK (os3.str() == std::string("()") ); + os3 << set_open('['); + os3 << set_close(']'); + os3 << make_tuple(); + BOOST_CHECK (os3.str() == std::string("()[]") ); + + // check width + useThisOStringStream os4; + os4 << std::setw(10) << make_tuple(1, 2, 3); + BOOST_CHECK (os4.str() == std::string(" (1 2 3)") ); + + std::ofstream tmp("temp.tmp"); + +#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + tmp << make_tuple("One", "Two", 3); +#endif + tmp << set_delimiter(':'); + tmp << make_tuple(1000, 2000, 3000) << std::endl; + + tmp.close(); + + // When teading tuples from a stream, manipulators must be set correctly: + std::ifstream tmp3("temp.tmp"); + tuple j; + +#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + tmp3 >> j; + BOOST_CHECK (tmp3.good() ); +#endif + + tmp3 >> set_delimiter(':'); + tuple i; + tmp3 >> i; + BOOST_CHECK (tmp3.good() ); + + tmp3.close(); + + + // reading tuple in format (a b c); + useThisIStringStream is1("(100 200 300)"); + + tuple ti1; + BOOST_CHECK(bool(is1 >> ti1)); + BOOST_CHECK(ti1 == make_tuple(100, 200, 300)); + + useThisIStringStream is2("()"); + tuple<> ti2; + BOOST_CHECK(bool(is2 >> ti2)); + useThisIStringStream is3("[]"); + is3 >> set_open('['); + is3 >> set_close(']'); + BOOST_CHECK(bool(is3 >> ti2)); + + // Make sure that whitespace between elements + // is skipped. + useThisIStringStream is4("(100 200 300)"); + + BOOST_CHECK(bool(is4 >> std::noskipws >> ti1)); + BOOST_CHECK(ti1 == make_tuple(100, 200, 300)); + + // Note that strings are problematic: + // writing a tuple on a stream and reading it back doesn't work in + // general. If this is wanted, some kind of a parseable string class + // should be used. + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/tuple/test/tuple_test_bench.cpp b/tools/boost_1_65_1/libs/tuple/test/tuple_test_bench.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8bf756f9bf3e26a8119a886cc0814077e3c32204 --- /dev/null +++ b/tools/boost_1_65_1/libs/tuple/test/tuple_test_bench.cpp @@ -0,0 +1,497 @@ +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// For more information, see http://www.boost.org + +// tuple_test_bench.cpp -------------------------------- + +#define BOOST_INCLUDE_MAIN // for testing, include rather than link +#include // see "Header Implementation Option" + +#include "boost/tuple/tuple.hpp" + +#include "boost/tuple/tuple_comparison.hpp" + +#include "boost/type_traits/is_const.hpp" + +#include "boost/ref.hpp" +#include +#include + +using namespace boost; + +// ---------------------------------------------------------------------------- +// helpers +// ---------------------------------------------------------------------------- + +class A {}; +class B {}; +class C {}; + +// classes with different kinds of conversions +class AA {}; +class BB : public AA {}; +struct CC { CC() {} CC(const BB&) {} }; +struct DD { operator CC() const { return CC(); }; }; + +// something to prevent warnings for unused variables +template void dummy(const T&) {} + +// no public default constructor +class foo { +public: + explicit foo(int v) : val(v) {} + + bool operator==(const foo& other) const { + return val == other.val; + } + +private: + foo() {} + int val; +}; + +// another class without a public default constructor +class no_def_constructor { + no_def_constructor() {} +public: + no_def_constructor(std::string) {} +}; + +// A non-copyable class +class no_copy { + no_copy(const no_copy&) {} +public: + no_copy() {}; +}; + + +// ---------------------------------------------------------------------------- +// Testing different element types -------------------------------------------- +// ---------------------------------------------------------------------------- + + +typedef tuple t1; + +typedef tuple t2; +typedef tuple t3; +typedef tuple > t4; +typedef tuple, bool, void*> t5; +typedef tuple t6; + +# if !defined(__BORLANDC__) || __BORLAND__ > 0x0551 +typedef tuple t7; +#endif + +// ----------------------------------------------------------------------- +// -tuple construction tests --------------------------------------------- +// ----------------------------------------------------------------------- + + +no_copy y; +tuple x = tuple(y); // ok + +char cs[10]; +tuple v2(cs); // ok + +void +construction_test() +{ + + // Note, the get function can be called without the tuples:: qualifier, + // as it is lifted to namespace boost with a "using tuples::get" but + // MSVC 6.0 just cannot find get without the namespace qualifier + + tuple t1; + BOOST_CHECK(get<0>(t1) == int()); + + tuple t2(5.5f); + BOOST_CHECK(get<0>(t2) > 5.4f && get<0>(t2) < 5.6f); + + tuple t3(foo(12)); + BOOST_CHECK(get<0>(t3) == foo(12)); + + tuple t4(t2); + BOOST_CHECK(get<0>(t4) > 5.4 && get<0>(t4) < 5.6); + + tuple t5; + BOOST_CHECK(get<0>(t5) == int()); + BOOST_CHECK(get<1>(t5) == float()); + + tuple t6(12, 5.5f); + BOOST_CHECK(get<0>(t6) == 12); + BOOST_CHECK(get<1>(t6) > 5.4f && get<1>(t6) < 5.6f); + + tuple t7(t6); + BOOST_CHECK(get<0>(t7) == 12); + BOOST_CHECK(get<1>(t7) > 5.4f && get<1>(t7) < 5.6f); + + tuple t8(t6); + BOOST_CHECK(get<0>(t8) == 12); + BOOST_CHECK(get<1>(t8) > 5.4f && get<1>(t8) < 5.6f); + + dummy( + tuple( + std::string("Jaba"), // ok, since the default + std::string("Daba"), // constructor is not used + std::string("Doo") + ) + ); + +// testing default values + dummy(tuple()); + dummy(tuple(1)); + dummy(tuple(1,3.14)); + + + // dummy(tuple()); // should fail, not defaults for references + // dummy(tuple()); // likewise + + double dd = 5; + dummy(tuple(dd)); // ok + + dummy(tuple(dd+3.14)); // ok, but dangerous + + // dummy(tuple(dd+3.14)); // should fail, + // // temporary to non-const reference +} + + +// ---------------------------------------------------------------------------- +// - testing element access --------------------------------------------------- +// ---------------------------------------------------------------------------- + +void element_access_test() +{ + double d = 2.7; + A a; + tuple t(1, d, a, 2); + const tuple ct = t; + + int i = get<0>(t); + int i2 = get<3>(t); + + BOOST_CHECK(i == 1 && i2 == 2); + + int j = get<0>(ct); + BOOST_CHECK(j == 1); + + get<0>(t) = 5; + BOOST_CHECK(t.head == 5); + + // get<0>(ct) = 5; // can't assign to const + + double e = get<1>(t); + BOOST_CHECK(e > 2.69 && e < 2.71); + + get<1>(t) = 3.14+i; + BOOST_CHECK(get<1>(t) > 4.13 && get<1>(t) < 4.15); + + // get<4>(t) = A(); // can't assign to const + // dummy(get<5>(ct)); // illegal index + + ++get<0>(t); + BOOST_CHECK(get<0>(t) == 6); + + BOOST_STATIC_ASSERT((boost::is_const >::type>::value != true)); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_STATIC_ASSERT((boost::is_const >::type>::value)); +#endif + + BOOST_STATIC_ASSERT((boost::is_const >::type>::value != true)); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_STATIC_ASSERT((boost::is_const >::type>::value)); +#endif + + + dummy(i); dummy(i2); dummy(j); dummy(e); // avoid warns for unused variables +} + + +// ---------------------------------------------------------------------------- +// - copying tuples ----------------------------------------------------------- +// ---------------------------------------------------------------------------- + + + +void +copy_test() +{ + tuple t1(4, 'a'); + tuple t2(5, 'b'); + t2 = t1; + BOOST_CHECK(get<0>(t1) == get<0>(t2)); + BOOST_CHECK(get<1>(t1) == get<1>(t2)); + + tuple t3(2, "a"); + t3 = t1; + BOOST_CHECK((double)get<0>(t1) == get<0>(t3)); + BOOST_CHECK(get<1>(t1) == get<1>(t3)[0]); + +// testing copy and assignment with implicit conversions between elements +// testing tie + + tuple t; + tuple a(t); + a = t; + + int i; char c; double d; + tie(i, c, d) = make_tuple(1, 'a', 5.5); + + BOOST_CHECK(i==1); + BOOST_CHECK(c=='a'); + BOOST_CHECK(d>5.4 && d<5.6); +} + +void +mutate_test() +{ + tuple t1(5, 12.2f, true, foo(4)); + get<0>(t1) = 6; + get<1>(t1) = 2.2f; + get<2>(t1) = false; + get<3>(t1) = foo(5); + + BOOST_CHECK(get<0>(t1) == 6); + BOOST_CHECK(get<1>(t1) > 2.1f && get<1>(t1) < 2.3f); + BOOST_CHECK(get<2>(t1) == false); + BOOST_CHECK(get<3>(t1) == foo(5)); +} + +// ---------------------------------------------------------------------------- +// make_tuple tests ----------------------------------------------------------- +// ---------------------------------------------------------------------------- + +void +make_tuple_test() +{ + tuple t1 = make_tuple(5, 'a'); + BOOST_CHECK(get<0>(t1) == 5); + BOOST_CHECK(get<1>(t1) == 'a'); + + tuple t2; + t2 = boost::make_tuple((short int)2, std::string("Hi")); + BOOST_CHECK(get<0>(t2) == 2); + BOOST_CHECK(get<1>(t2) == "Hi"); + + + A a = A(); B b; + const A ca = a; + make_tuple(boost::cref(a), b); + make_tuple(boost::ref(a), b); + make_tuple(boost::ref(a), boost::cref(b)); + + make_tuple(boost::ref(ca)); + +// the result of make_tuple is assignable: + BOOST_CHECK(make_tuple(2, 4, 6) == + (make_tuple(1, 2, 3) = make_tuple(2, 4, 6))); + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + make_tuple("Donald", "Daisy"); // should work; +#endif + // std::make_pair("Doesn't","Work"); // fails + +// You can store a reference to a function in a tuple + tuple adf(make_tuple_test); + + dummy(adf); // avoid warning for unused variable + +// But make_tuple doesn't work +// with function references, since it creates a const qualified function type + +// make_tuple(make_tuple_test); + +// With function pointers, make_tuple works just fine + +#if !defined(__BORLANDC__) || __BORLAND__ > 0x0551 + make_tuple(&make_tuple_test); +#endif + +// NOTE: +// +// wrapping it the function reference with ref helps on gcc 2.95.2. +// on edg 2.43. it results in a catastrophic error? + +// make_tuple(ref(foo3)); + +// It seems that edg can't use implicitly the ref's conversion operator, e.g.: +// typedef void (&func_t) (void); +// func_t fref = static_cast(ref(make_tuple_test)); // works fine +// func_t fref = ref(make_tuple_test); // error + +// This is probably not a very common situation, so currently +// I don't know how which compiler is right (JJ) +} + +void +tie_test() +{ + int a; + char b; + foo c(5); + + tie(a, b, c) = make_tuple(2, 'a', foo(3)); + BOOST_CHECK(a == 2); + BOOST_CHECK(b == 'a'); + BOOST_CHECK(c == foo(3)); + + tie(a, tuples::ignore, c) = make_tuple((short int)5, false, foo(5)); + BOOST_CHECK(a == 5); + BOOST_CHECK(b == 'a'); + BOOST_CHECK(c == foo(5)); + +// testing assignment from std::pair + int i, j; + tie (i, j) = std::make_pair(1, 2); + BOOST_CHECK(i == 1 && j == 2); + + tuple ta; +#ifdef E11 + ta = std::make_pair(1, 2); // should fail, tuple is of length 3, not 2 +#endif + + dummy(ta); +} + + +// ---------------------------------------------------------------------------- +// - testing tuple equality ------------------------------------------------- +// ---------------------------------------------------------------------------- + +void +equality_test() +{ + tuple t1(5, 'a'); + tuple t2(5, 'a'); + BOOST_CHECK(t1 == t2); + + tuple t3(5, 'b'); + tuple t4(2, 'a'); + BOOST_CHECK(t1 != t3); + BOOST_CHECK(t1 != t4); + BOOST_CHECK(!(t1 != t2)); +} + + +// ---------------------------------------------------------------------------- +// - testing tuple comparisons ----------------------------------------------- +// ---------------------------------------------------------------------------- + +void +ordering_test() +{ + tuple t1(4, 3.3f); + tuple t2(5, 3.3f); + tuple t3(5, 4.4); + BOOST_CHECK(t1 < t2); + BOOST_CHECK(t1 <= t2); + BOOST_CHECK(t2 > t1); + BOOST_CHECK(t2 >= t1); + BOOST_CHECK(t2 < t3); + BOOST_CHECK(t2 <= t3); + BOOST_CHECK(t3 > t2); + BOOST_CHECK(t3 >= t2); + +} + + +// ---------------------------------------------------------------------------- +// - testing cons lists ------------------------------------------------------- +// ---------------------------------------------------------------------------- +void cons_test() +{ + using tuples::cons; + using tuples::null_type; + + cons a(1, null_type()); + cons > b(2,a); + int i = 3; + cons > > c(i, b); + BOOST_CHECK(make_tuple(3,2,1)==c); + + cons > > x; + dummy(x); +} + +// ---------------------------------------------------------------------------- +// - testing const tuples ----------------------------------------------------- +// ---------------------------------------------------------------------------- +void const_tuple_test() +{ + const tuple t1(5, 3.3f); + BOOST_CHECK(get<0>(t1) == 5); + BOOST_CHECK(get<1>(t1) == 3.3f); +} + +// ---------------------------------------------------------------------------- +// - testing length ----------------------------------------------------------- +// ---------------------------------------------------------------------------- +void tuple_length_test() +{ + typedef tuple t1; + using tuples::cons; + typedef cons > > t1_cons; + typedef tuple<> t2; + typedef tuples::null_type t3; + + BOOST_STATIC_ASSERT(tuples::length::value == 3); + BOOST_STATIC_ASSERT(tuples::length::value == 3); + BOOST_STATIC_ASSERT(tuples::length::value == 0); + BOOST_STATIC_ASSERT(tuples::length::value == 0); + +} + +// ---------------------------------------------------------------------------- +// - testing swap ----------------------------------------------------------- +// ---------------------------------------------------------------------------- +void tuple_swap_test() +{ + tuple t1(1, 2.0f, 3.0), t2(4, 5.0f, 6.0); + swap(t1, t2); + BOOST_CHECK(get<0>(t1) == 4); + BOOST_CHECK(get<1>(t1) == 5.0f); + BOOST_CHECK(get<2>(t1) == 6.0); + BOOST_CHECK(get<0>(t2) == 1); + BOOST_CHECK(get<1>(t2) == 2.0f); + BOOST_CHECK(get<2>(t2) == 3.0); + + int i = 1,j = 2; + boost::tuple t3(i), t4(j); + swap(t3, t4); + BOOST_CHECK(i == 2); + BOOST_CHECK(j == 1); +} + + + +// ---------------------------------------------------------------------------- +// - main --------------------------------------------------------------------- +// ---------------------------------------------------------------------------- + +int test_main(int, char *[]) { + + construction_test(); + element_access_test(); + copy_test(); + mutate_test(); + make_tuple_test(); + tie_test(); + equality_test(); + ordering_test(); + cons_test(); + const_tuple_test(); + tuple_length_test(); + tuple_swap_test(); + return 0; +} + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_erasure/build/Jamfile.v2 b/tools/boost_1_65_1/libs/type_erasure/build/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..9f4bb93ef1bfda5d940ce639c918f2dbe30bbd89 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/build/Jamfile.v2 @@ -0,0 +1,15 @@ +# Boost.TypeErasure library +# +# Copyright 2015 Steven Watanabe +# +# Distributed under the Boost Software License version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +project /boost/type_erasure + : source-location ../src + : requirements shared:BOOST_TYPE_ERASURE_DYN_LINK + : usage-requirements shared:BOOST_TYPE_ERASURE_DYN_LINK +; + +lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ; diff --git a/tools/boost_1_65_1/libs/type_erasure/doc/Jamfile.jam b/tools/boost_1_65_1/libs/type_erasure/doc/Jamfile.jam new file mode 100644 index 0000000000000000000000000000000000000000..adc17467f3bdcb7a332511f4ebad334447ca71d8 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/doc/Jamfile.jam @@ -0,0 +1,75 @@ +# Boost.TypeErasure library +# +# Copyright 2011 Steven Watanabe +# +# Distributed under the Boost Software License version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import path ; +using boostbook ; +using quickbook ; +using doxygen ; + +path-constant here : . ; +path-constant boost-root : ../../.. ; + +# Figure out where the root of the boost tree is relative +# to the html directory. +local BOOST_ROOT = [ path.relative-to + [ path.join [ path.pwd ] html ] + [ path.root + [ path.make $(boost-root) ] + [ path.pwd ] ] ] ; + +xml type_erasure : type_erasure.qbk : reference ; + +doxygen reference + : + [ glob ../../../boost/type_erasure/*.hpp ] + : + EXPAND_ONLY_PREDEF=YES + "ALIASES= \\ + CopyConstructible=\"CopyConstructible\" \\ + Concept=\"@xmlonlyConcept@endxmlonly\" \\ + call=\"@xmlonlycall@endxmlonly\" \\ + any_cast=\"@xmlonlyany_cast@endxmlonly\" \\ + typeid_of=\"@xmlonlytypeid_of@endxmlonly\" \\ + binding_of=\"@xmlonlybinding_of@endxmlonly\" \\ + is_empty=\"@xmlonlyis_empty@endxmlonly\" \\ + require_match=\"@xmlonlyrequire_match@endxmlonly\" " + "PREDEFINED= \\ + \"BOOST_TYPE_ERASURE_DOXYGEN=1\" \\ + \"BOOST_TYPE_ERASURE_UNARY_INPLACE_OPERATOR(name, op)=template struct name { static void apply(T&); };\" \\ + \"BOOST_TYPE_ERASURE_UNARY_OPERATOR(name, op)=template struct name { static R apply(const T&); };\" \\ + \"BOOST_TYPE_ERASURE_BINARY_OPERATOR(name, op)=template struct name { static R apply(const T&, const U&); };\" \\ + \"BOOST_TYPE_ERASURE_ASSIGNMENT_OPERATOR(name, op)=template struct name { static void apply(T&, const U&); };\" \\ + \"table_arg=table\" \\ + \"binding_arg=binding\" \\ + \"data_arg=data\"" + HIDE_UNDOC_MEMBERS=NO + QUIET=YES + WARN_IF_UNDOCUMENTED=NO + EXTRACT_PRIVATE=NO + ENABLE_PREPROCESSING=YES + MACRO_EXPANSION=YES + SEARCH_INCLUDES=NO +; + +boostbook standalone + : + type_erasure + : + reference + boost.root=../../../.. +; + +############################################################################### +alias boostdoc + : type_erasure + : + : reference + : ; +explicit boostdoc ; +alias boostrelease ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/type_erasure/doc/reference.xml b/tools/boost_1_65_1/libs/type_erasure/doc/reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..0de2d872c69fb993210cfcca4e91b82dfec0c197 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/doc/reference.xml @@ -0,0 +1,1706 @@ + +
+ + +ConceptT & + +U &The object to bind the reference to.Constructs an any from a reference. + + +U is a model of Concept. Concept must not refer to any non-deduced placeholder besides T.Nothing. +U &The object to bind the reference to. const static_binding< Map > &Specifies the actual types that all the placeholders should bind to.Constructs an any from a reference. + + +U is a model of Concept. Map is an MPL map with an entry for every non-deduced placeholder referred to by Concept.Nothing. +const any &The reference to copy.Constructs an any from another reference. + +Nothing. +any< Concept, T > &The object to bind the reference to.Constructs an any from another any. + +Nothing. +const any< Concept2, Tag2 & > &The reference to copy.Constructs an any from another reference. + + +Concept must not refer to any non-deduced placeholder besides T. After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +any< Concept2, Tag2 > &The object to bind the reference to.Constructs an any from another any. + + +Concept must not refer to any non-deduced placeholder besides T. After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +const any< Concept2, Tag2 & > &The reference to copy. const static_binding< Map > &Specifies the mapping between the two concepts.Constructs an any from another reference. + + +Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2. After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +any< Concept2, Tag2 > &The object to bind the reference to. const static_binding< Map > &Specifies the mapping between the two concepts.Constructs an any from another any. + + +Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2. After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +const any< Concept2, Tag2 & > &The reference to copy. const binding< Concept > &Specifies the bindings of placeholders to actual types.Constructs an any from another reference. + + + +The type stored in other must match the type expected by binding.binding_of(*this) == binding Nothing. +any< Concept2, Tag2 > &The object to bind the reference to. const binding< Concept > &Specifies the bindings of placeholders to actual types.Constructs an any from another any. + + + +The type stored in other must match the type expected by binding.binding_of(*this) == binding Nothing. +any &const any &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. +any &U &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. +any &const U &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. +Conceptconst T & + +const U &The object to bind the reference to.Constructs an any from a reference. + + +U is a model of Concept. Concept must not refer to any non-deduced placeholder besides T.Nothing. +const U &The object to bind the reference to. const static_binding< Map > &Specifies the actual types that all the placeholders should bind to.Constructs an any from a reference. + + +U is a model of Concept. Map is an MPL map with an entry for every non-deduced placeholder referred to by Concept.Nothing. +const any &The reference to copy.Constructs an any from another any. + +Nothing. +const any< Concept, T & > &The reference to copy.Constructs an any from another any. + +Nothing. +const any< Concept, T > &The object to bind the reference to.Constructs an any from another any. + +Nothing. +const any< Concept, T && > &The object to bind the reference to.Constructs an any from another any. + +Nothing. +const any< Concept2, Tag2 > &The object to bind the reference to.Constructs an any from another any. + + +Concept must not refer to any non-deduced placeholder besides T. After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +const any< Concept2, Tag2 > &The object to bind the reference to. const static_binding< Map > &Specifies the mapping between the two concepts.Constructs an any from another any. + + +Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2. After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +const any< Concept2, Tag2 > &The object to bind the reference to. const binding< Concept > &Specifies the bindings of placeholders to actual types.Constructs an any from another any. + + + +The type stored in other must match the type expected by binding.binding_of(*this) == binding Nothing. +any &const any &Assigns to an any. + +relaxed is in Concept.Nothing. +any &const U &Assigns to an any. + +relaxed is in Concept.std::bad_alloc. Provides the strong exception guarantee. +ConceptT && + +U &&The object to bind the reference to.Constructs an any from a reference. + + +U is a model of Concept. Concept must not refer to any non-deduced placeholder besides T.Nothing. +U &&The object to bind the reference to. const static_binding< Map > &Specifies the actual types that all the placeholders should bind to.Constructs an any from a reference. + + +U is a model of Concept. Map is an MPL map with an entry for every non-deduced placeholder referred to by Concept.Nothing. +any< Concept, T > &&The reference to copy.The object to bind the reference to.Constructs an any from another rvalue reference. + + + +Nothing. Constructs an any from another any.Nothing. +any< Concept2, Tag2 && > &&The reference to copy.Constructs an any from another rvalue reference. + + +Concept must not refer to any non-deduced placeholder besides T. After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +any< Concept2, Tag2 > &&The object to bind the reference to.Constructs an any from another any. + + +Concept must not refer to any non-deduced placeholder besides T. After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +const any< Concept2, Tag2 && > &The reference to copy. const static_binding< Map > &Specifies the mapping between the two concepts.Constructs an any from another reference. + + +Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2. After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +any< Concept2, Tag2 > &&The object to bind the reference to. const static_binding< Map > &Specifies the mapping between the two concepts.Constructs an any from another any. + + +Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2. After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc +const any< Concept2, Tag2 && > &The reference to copy. const binding< Concept > &Specifies the bindings of placeholders to actual types.Constructs an any from another rvalue reference. + + + +The type stored in other must match the type expected by binding.binding_of(*this) == binding Nothing. +any< Concept2, Tag2 > &&The object to bind the reference to. const binding< Concept > &Specifies the bindings of placeholders to actual types.Constructs an any from another any. + + + +The type stored in other must match the type expected by binding.binding_of(*this) == binding Nothing. +any &const any &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. +any &U &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. +any &const U &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +Tany< Concept, Tag > &Tconst any< Concept, Tag > &Tany< Concept, Tag > *Tconst any< Concept, Tag > *Attempts to extract the object that arg holds. If casting to a pointer fails, any_cast returns a null pointer. Casting to void* always succeeds and returns the address of stored object.any<mpl::vector<typeid_<>, copy_constructible<> > > x(1); +any_cast<int>(x); // returns 1 +any_cast<int&>(x); // returns a reference to the contents of x +any_cast<double>(x); // throws bad_any_cast +any_cast<int*>(&x); // returns a pointer to the contents of x +any_cast<void*>(&x); // returns a pointer to the contents of x +any_cast<double*>(&x); // returns NULL + + +if arg is a pointer, T must be a pointer type. Concept must contain typeid_<Tag>.bad_any_cast if arg doesn't contain an object of type T and we're casting to a value or reference. + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + +const binding< Concept > &const any< Concept, T > & + +The type bindings of an any.Nothing. + + + + + + +
+
+ + +The destructible concept enables forwarding to the destructor of the contained type. This is required whenever an any is created by value.The destructible concept rarely needs to be specified explicitly, because it is included in the copy_constructible concept.destructible may not be specialized and may not be passed to call as it depends on the implementation details of any. + + +boost::mpl::vector< constructible< T(const T &)>, destructible< T > >The copy_constructible concept allows objects to be copied and destroyed.This concept is defined to match C++ 2003, [lib.copyconstructible]. It is not equivalent to the concept of the same name in C++11. +Enables assignment of any types. +voidT &const U & + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +unspecifiedconst binding< Concept > &const Op &U &&...unspecifiedconst Op &U &&...Dispatches a type erased function.Op must be a primitive concept which is present in Concept. Its signature determines how the arguments of call are handled. If the argument is a placeholder, call expects an any using that placeholder. This any is unwrapped by call. The type that it stores must be the same type specified by binding. Any arguments that are not placeholders in the signature of Op are passed through unchanged.If binding is not specified, it will be deduced from the arguments. Naturally this requires at least one argument to be an any. In this case, all any arguments must have the same binding. + +Example:typedef mpl::vector< + copy_constructible<_b>, + addable<_a, int, _b> > concept; +any<concept, _a> a = ...; +any<concept, _b> b(call(addable<_a, int, _b>(), a, 10)); +The signature of addable is _b(const _a&, const int&) The result of the operation. If the result type of the signature of Op is a placeholder, the result will be converted to the appropriate any type.bad_function_call if relaxed is in Concept and there is a type mismatch. + + + + + + + + +
+
+ + +The callable concept allows an any to hold function objects. Sig is interpreted in the same way as for Boost.Function, except that the arguments and return type are allowed to be placeholders. F must be a placeholder.Multiple instances of callable can be used simultaneously. Overload resolution works normally. Note that unlike Boost.Function, callable does not provide result_type. It does, however, support boost::result_of. +RF &T...R is the result type of Sig and T is the argument types of Sig. + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +Enables runtime type information. This is required if you want to use any_cast or typeid_of.typeid_ cannot be specialized because several library components including any_cast would not work correctly if its behavior changed. There is no need to specialize it anyway, since it works for all types. typeid_ also cannot be passed to call. To access it, use typeid_of. + + + + + + + + + + + + + + +boolconst binding< Concept > &const Op &U &&...boolconst Op &U &&...If relaxed is in Concept, checks whether the arguments to f match the types specified by binding. If relaxed is not in Concept, returns true. If binding is not specified, it will be deduced from the arguments. + + + + + + + + + + +
+
+ + +BaseThe concept_interface class can be specialized to add behavior to an any. An any inherits from all the relevant specializations of concept_interface.concept_interface can be specialized for either primitive or composite concepts. If a concept C1 contains another concept C2, then the library guarantees that the specialization of concept_interface for C2 is a base class of the specialization for C1. This means that C1 can safely override members of C2.concept_interface may only be specialized for user-defined concepts. The library owns the specializations of its own built in concepts. +The metafunctions derived, rebind_any, and as_param (which can be applied to Base) are useful for determining the argument and return types of functions defined in concept_interface.For dispatching the function use call. + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +A metafunction returning the concept corresponding to an any. It will also work for all bases of any, so it can be applied to the Base parameter of concept_interface. unspecified + + + + + + + + + + + + + + + + + + + + + + + +
+
+The maximum number of functions that an any can have. +The maximum number of arguments that functions in the library support. +The maximum number of elements in a tuple. +
+
+ + +The constructible concept enables calling the constructor of a type contained by an any. Sig should be a function signature. The return type is the placeholder specifying the type to be constructed. The arguments are the argument types of the constructor. The arguments of Sig may be placeholders.constructible may not be specialized and may not be passed to call as it depends on the implementation details of any. + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +boost::type_erasure::placeholderA placeholder for an associated type. The type corresponding to this placeholder is deduced by substituting placeholders in the arguments of the metafunction and then evaluating it.When using deduced in a template context, if it is possible for Metafunction to contain no placeholders at all, use the nested type, to automatically evaluate it early as needed. unspecified + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +A metafunction which returns the full any type, when given any of its base classes. This is primarily intended to be used when implementing concept_interface.See Also:rebind_any, as_param +unspecified + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + +RAny &&RAny &&const static_binding< Map > &Downcasts or crosscasts an any. +The single argument form can only be used when R uses a single non-deduced placeholder. +Example: // Assume that typeid_<>, copy_constructible<>, and incrementable<> +// have all been registered for int. +any<mpl::vector<typeid_<>, copy_constructible<> > > x(1); +typedef any< + mpl::vector< + typeid_<>, + copy_constructible<>, + incrementable<> + > +> incrementable_any; +auto y = dynamic_any_cast<incrementable_any>(x); +++y; +assert(any_cast<int>(y) == 2); + R and Any must both be specializations of any. PlaceholderMap must be an MPL map with a key for every non-deduced placeholder used by R. The value associated with each key should be the corresponding placeholder in Any. The concept of Any must include typeid_, for every placeholder which is used by R.bad_any_cast if the concepts used by R were not previously registered via a call to register_binding. + + + + + + + + + + + + +
+
+ + +Maps a set of placeholders to actual types. + +const static_binding< Map > & +const binding< Concept > &const static_binding< Map > & + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +invalid_argumentException thrown when the arguments to a primitive concept are incorrect.See Also: call, require_match + + + +bad_castException thrown when an any_cast to a reference or value fails. + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +should be a preprocessor sequence of the form (namespace1)(namespace2)...(concept_name). is the name of the function. is the number of arguments of the function.Defines a primitive concept for a free function. +The declaration of the concept is template<class Sig> +struct ::namespace1::namespace2::...::concept_name; + where Sig is a function type giving the signature of the function.This macro can only be used in the global namespace.Example:BOOST_TYPE_ERASURE_FREE((boost)(has_to_string), to_string, 1) + +
+
+ + + + + + + + + + + +boolconst T &Returns true for an empty any. + + + + + + + + + + + + + +
+
+ + +boost::is_base_and_derived< placeholder, T >A metafunction that indicates whether a type is a placeholder. + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +is_subconcept is a boolean metafunction that determines whether one concept is a sub-concept of another.is_subconcept<incrementable<>, incrementable<> > -> true +is_subconcept<incrementable<>, addable<> > -> false +is_subconcept<incrementable<_a>, forward_iterator<_iter>, + mpl::map<mpl::pair<_a, _iter> > > -> true + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +The iterator concept can be used for any iterator category. +The value_type of the iterator is deduced. To force it to be a specific type, use the same_type concept.Example:mpl::vector< + iterator<boost::forward_traversal_tag>, + same_type<iterator<boost::forward_traversal_tag>::value_type, int> > int_it; + unspecified +Reference +DifferenceType +boost::type_erasure::iterator< boost::forward_traversal_tag, T, Reference, DifferenceType >boost::type_erasure::iterator< boost::bidirectional_traversal_tag, T, Reference, DifferenceType >boost::type_erasure::iterator< boost::random_access_traversal_tag, T, Reference, DifferenceType > + + + + + + + + + + + + + + + + + + + + + + +
+
+should be a preprocessor sequence of the form (namespace1)(namespace2)...(concept_name). is the name of the member function. is the number of arguments of the function.Defines a primitive concept for a member function. +The declaration of the concept is template<class Sig, class T = _self> +struct ::namespace1::namespace2::...::concept_name; + where Sig is a function type giving the signature of the member function, and T is the object type. T may be const-qualified for const member functions.This macro can only be used in the global namespace.Example:BOOST_TYPE_ERASURE_MEMBER((boost)(has_push_back), push_back, 1) +typedef boost::has_push_back<void(int), _self> push_back_concept; +In C++11 the argument N is ignored and may be omitted. BOOST_TYPE_ERASURE_MEMBER will always define a variadic concept. + +
+
+ + +The incrementable concept allow pre and post increment on an any. The contained type must provide a pre-increment operator. +voidT & + +The decrementable concept allow pre and post decrement on an any. The contained type must provide a pre-decrement operator. +voidT & + +The complementable concept allow use of the bitwise complement operator on an any. +Rconst T & + +The negatable concept allow use of the unary minus operator on an any. +Rconst T & + + +Rconst T & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +Rconst T &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +voidT &const U & + + +boolconst T &const U & + + +boolconst T &const U & + + +RT &const N & + +The ostreamable concept allows an any to be written to a std::ostream. +voidOs &const T & + +The istreamable concept allows an any to be read from a std::istream. +voidIs &T & + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +Metafunction that creates a param. If T is a (cv/reference qualifed) placeholder, returns param<concept_of<Any>::type, T>, otherwise, returns T. This metafunction is intended to be used for function arguments in specializations of concept_interface.See Also:derived, rebind_any +unspecified + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +Placeholders are used heavily throughout the library. Every placeholder must derive from placeholder. The library provides a number of placeholders, out of the box, but you are welcome to define your own, if you want more descriptive names. The placeholder _self is special in that it is used as the default wherever possible.What exactly is a placeholder? Placeholders act as a substitute for template parameters in concepts. The library automatically replaces all the placeholders used in a concept with the actual types involved when it stores an object in an any.For example, in the following,any<copy_constructible<_a>, _a> x(1); +The library sees that we're constructing an any that uses the _a placeholder with an int. Thus it binds _a to int and instantiates copy_constructible<int>.When there are multiple placeholders involved, you will have to use tuple, or pass the bindings explicitly, but the substitution still works the same way. boost::type_erasure::placeholderboost::type_erasure::placeholderboost::type_erasure::placeholderboost::type_erasure::placeholderboost::type_erasure::placeholderboost::type_erasure::placeholderboost::type_erasure::placeholderboost::type_erasure::placeholderThe default placeholder. _self is the default placeholder used by any. It should be used as a default by most concepts, so using concepts with no explicit arguments will "just work" as much as possible. + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +A wrapper to help with overload resolution for functions operating on an any. The template arguments are interpreted in the same way as any.A parameter of type param can be initialized with an any that has the same Concept and base placeholder when there exists a corresponding standard conversion for the placeholder. A conversion sequence from any<C, P> to param<C, P1> is a better conversion sequence than any<C, P> to param<C, P2> iff the corresponding placeholder standard conversion sequence from P to P1 is a better conversion sequence than P to P2.Overloading based on cv-qualifiers and rvalue-ness is only supported in C++11. In C++03, all conversion sequences from any to param have the same rank. +Example:void f(param<C, _a&>); +void f(param<C, const _a&>); +void g(param<C, const _a&>); +void g(param<C, _a&&>); + +any<C, _a> a; +f(any<C, _a>()); // calls void f(param<C, const _a&>); +f(a); // calls void f(param<C, _a&>); (ambiguous in C++03) +g(any<C, _a>()); // calls void g(param<C, _a&&>); (ambiguous in C++03) +g(a); // calls void g(param<C, const _a&>); + +any< Concept, T >Returns the stored any. + +any< Concept, U > & +const any< Concept, U > & +any< Concept, U > && +A metafunction returning the (const/reference qualified) placeholder corresponding to an any. It will also work for all bases of any, so it can be applied to the Base parameter of concept_interface. unspecified + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +The class template any can store any object that models a specific Concept. It dispatches all the functions defined by the Concept to the contained type at runtime. +See Also:concept_of, placeholder_of, any_cast, is_empty, binding_of, typeid_of + + +Constructs an empty any.Except as otherwise noted, all operations on an empty any result in a bad_function_call exception. The copy-constructor of an empty any creates another null any. The destructor of an empty any is a no-op. Comparison operators treat all empty anys as equal. typeid_of applied to an empty any returns typeid(void).An any which does not include relaxed in its Concept can never be null. + +See Also: is_empty +relaxed must be in Concept.Nothing. +U &&The object to store in the any.Constructs an any to hold a copy of data. The Concept will be instantiated with the placeholder T bound to U. + + +This constructor never matches if the argument is an any, binding, or static_binding. +U is a model of Concept. U must be CopyConstructible. Concept must not refer to any non-deduced placeholder besides T.std::bad_alloc or whatever that the copy constructor of U throws. +U &&The object to store in the any. const static_binding< Map > &Specifies the types that all the placeholders should bind to.Constructs an any to hold a copy of data with explicitly specified placeholder bindings. + + +This constructor never matches if the argument is an any. +U is a model of Concept. U must be CopyConstructible. Map is an MPL map with an entry for every non-deduced placeholder referred to by Concept. T must map to U in Map.std::bad_alloc or whatever that the copy constructor of U throws. +const any &The object to make a copy of.Copies an any. + + +Concept must contain constructible<T(const T&)>. (This is included in copy_constructible<T>)std::bad_alloc or whatever that the copy constructor of the contained type throws. +const any< Concept2, Tag2 > &The object to make a copy of.Upcasts from an any with stricter requirements to an any with weaker requirements. + + +Concept must contain constructible<T(const T&)>. Concept must not refer to any non-deduced placeholder besides T. After substituting T for Tag2, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc or whatever that the copy constructor of the contained type throws. +const any< Concept2, Tag2 > &The object to make a copy of. const static_binding< Map > &Specifies the mapping between the placeholders used by the two concepts.Constructs an any from another any. + + +Concept must contain constructible<T(const T&)>. Map must be an MPL map with keys for all the non-deduced placeholders used by Concept and values for the corresponding placeholders in Concept2. After substituting placeholders according to Map, the requirements of Concept2 must be a superset of the requirements of Concept.std::bad_alloc or whatever that the copy constructor of the contained type throws. +const any< Concept2, Tag2 > &The object to make a copy of. const binding< Concept > &Specifies the bindings of placeholders to actual types.Constructs an any from another any. + + + +This constructor is potentially dangerous, as it cannot check at compile time whether the arguments match. +Concept must contain constructible<T(const T&)>. The type stored in other must match the type expected by binding.binding_of(*this) == binding std::bad_alloc or whatever that the copy constructor of the contained type throws. +U &&...The arguments to be passed to the underlying constructor.Calls a constructor of the contained type. The bindings will be deduced from the arguments. + + +This constructor is never chosen if any other constructor can be called instead. +Concept must contain an instance of constructible which can be called with these arguments. At least one of the arguments must by an any with the same Concept as this. The bindings of all the arguments that are any's, must be the same.std::bad_alloc or whatever that the constructor of the contained type throws. +const binding< Concept > &Specifies the bindings of placeholders to actual types. U &&...The arguments to be passed to the underlying constructor.Calls a constructor of the contained type. + + + +Concept must contain a matching instance of constructible. The contained type of every argument that is an any, must be the same as that specified by binding.binding_of(*this) == binding std::bad_alloc or whatever that the constructor of the contained type throws. +any &const any &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc or whatever the copy constructor of the contained type throws. In this case assignment provides the strong exception guarantee. When calling the assignment operator of the contained type, the exception guarantee is whatever the contained type provides. +any &const U &Assigns to an any.If an appropriate overload of assignable is not available and relaxed is in Concept, falls back on constructing from other. +Whatever the assignment operator of the contained type throws. When falling back on construction, throws std::bad_alloc or whatever the copy constructor of the contained type throws. In this case assignment provides the strong exception guarantee. When calling an assignment operator of the contained type, the exception guarantee is whatever the contained type provides. + +Concept includes destructible<T>. +A metafunction that changes the placeholder of an any. If T is not a placeholder, returns T unchanged. This class is intended to be used in concept_interface to deduce the argument types from the arguments of the concept. +rebind_any<any<Concept>, _a>::type -> any<Concept, _a> +rebind_any<any<Concept>, _b&>::type -> any<Concept, _b&> +rebind_any<any<Concept>, int>::type -> int +See Also:derived, as_param +unspecified + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +voidconst static_binding< Map > &voidRegisters a model of a concept to allow downcasting any via dynamic_any_cast. + + + + + + + + + + + + + + + +
+
+ + +A metafunction indicating whether Concept includes relaxed. boost::mpl::vector0<>This special concept enables various useful default behavior that makes any act like an ordinary object. By default any forwards all operations to the underlying type, and provides only the operations that are specified in its Concept.In detail, relaxed enables the following: +A raw value can be assigned to an any. This will replace the value stored by the any. (But note that if assignable is present, it takes priority.)copy assignment of any uses the copy constructor if it can't use assignable (either because assignable is missing, or because the stored types do not match).default construction of any is allowed and creates a null any.equality_comparable: If the types do not match, it will return false.less_than_comparable: If the types do not match, the ordering will be according to std::type_info::before.if the arguments to any other function do not match, it will throw a bad_function_call exception instead of having undefined behavior. + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +Stores the binding of a Concept to a set of actual types. Concept is interpreted in the same way as with any. +friend boolconst binding &const binding & + +true iff the sets of types that the placeholders bind to are the same for both arguments.Nothing. +friend boolconst binding &const binding & + +true iff the arguments do not map to identical sets of types.Nothing. + + + + + +relaxed must be in Concept.Nothing. +const Map & + +Map must be an MPL map with an entry for each placeholder referred to by Concept.Nothing. +const static_binding< Map > & + +Map must be an MPL map with an entry for each placeholder referred to by Concept.Nothing. +const binding< Concept2 > &const Map &Converts from another set of bindings. + +Map must be an MPL map with an entry for each placeholder referred to by Concept. The mapped type should be the corresponding placeholder in Concept2.std::bad_alloc +const binding< Concept2 > &const static_binding< Map > &Converts from another set of bindings. + +Map must be an MPL map with an entry for each placeholder referred to by Concept. The mapped type should be the corresponding placeholder in Concept2.std::bad_alloc +const dynamic_binding< Placeholders > &const static_binding< Map > &Converts from another set of bindings. + +Map must be an MPL map with an entry for each placeholder referred to by Concept. The mapped type should be the corresponding placeholder in Concept2.std::bad_alloc + + + + + +voidconst binding< Concept > &const Op &U &&...voidconst Op &U &&...Checks that the actual types stored in all the any arguments match the types specified by binding. If they do not match then, +If relaxed is in Concept, throws bad_function_call.Otherwise the behavior is undefined. +If binding is not specified, it will be deduced from the arguments. + call(binding, f, args...) is valid. + + + + + + + + + + + + + + + + + +
+
+ + +A built in concept that indicates that two types are the same. Either T or U or both can be placeholders.Any number of instances of deduced can be connected with same_type, but there should be at most one regular placeholder in the group. same_type<_a, _b> is not allowed. The reason for this is that the library needs to normalize all the placeholders, and in this context there is no way to decide whether to use _a or _b. + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +Represents a mapping from placeholders to the actual types that they bind to. + + + + +static_binding< Map >A convenience function to prevent constructor calls from being parsed as function declarations. + + + + + + + + + + + + + + + + + + +
+
+ + +tuple is a Boost.Fusion Random Access Sequence containing anys. Concept specifies the Concept for each of the elements. The remaining arguments must be (possibly const and/or reference qualified) placeholders, which are the placeholders of the elements. + +U &&...Constructs a tuple. Each element of args will be used to initialize the corresponding any member. The binding for the tuple elements is determined by mapping the placeholders in T to the corresponding types in U. + + +any< Concept, TN > &tuple< Concept, T...> &const any< Concept, TN > &const tuple< Concept, T...> &Returns the Nth any in the tuple. + + + + + + + + + + + + + + + + + + + + +
+
+ + +const std::type_info &const any< Concept, T > &const std::type_info &const binding< Concept > &The first form returns the type currently stored in an any.The second form returns the type corresponding to a placeholder in binding. +Concept includes typeid_<T>. T is a non-reference, CV-unqualified placeholder. + + + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/type_erasure/doc/type_erasure.qbk b/tools/boost_1_65_1/libs/type_erasure/doc/type_erasure.qbk new file mode 100644 index 0000000000000000000000000000000000000000..0e7268ab651bbec0f320e0d8ef84b064ff4f61c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/doc/type_erasure.qbk @@ -0,0 +1,552 @@ +[library Boost.TypeErasure + [quickbook 1.5] + [authors [Watanabe, Steven]] + [copyright 2011-2013 Steven Watanabe] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] + [purpose Runtime polymorphism based on concepts] +] + +[def __any [classref boost::type_erasure::any any]] +[def __any_cast [funcref boost::type_erasure::any_cast any_cast]] +[def __tuple [classref boost::type_erasure::tuple tuple]] +[def __rebind_any [classref boost::type_erasure::rebind_any rebind_any]] +[def __derived [classref boost::type_erasure::derived derived]] +[def __concept_interface [classref boost::type_erasure::concept_interface concept_interface]] +[def __constructible [classref boost::type_erasure::constructible constructible]] +[def __destructible [classref boost::type_erasure::destructible destructible]] +[def __copy_constructible [classref boost::type_erasure::copy_constructible copy_constructible]] +[def __assignable [classref boost::type_erasure::assignable assignable]] +[def __typeid_ [classref boost::type_erasure::typeid_ typeid_]] +[def __relaxed [classref boost::type_erasure::relaxed relaxed]] +[def __binding [classref boost::type_erasure::binding binding]] +[def __static_binding [classref boost::type_erasure::static_binding static_binding]] +[def __placeholder [classref boost::type_erasure::placeholder placeholder]] +[def __call [funcref boost::type_erasure::call call]] +[def __deduced [classref boost::type_erasure::deduced deduced]] +[def __as_param [classref boost::type_erasure::as_param as_param]] + +[def __addable [classref boost::type_erasure::addable addable]] +[def __subtractable [classref boost::type_erasure::subtractable subtractable]] +[def __multipliable [classref boost::type_erasure::multipliable multipliable]] +[def __dividable [classref boost::type_erasure::dividable dividable]] +[def __modable [classref boost::type_erasure::modable modable]] +[def __bitandable [classref boost::type_erasure::bitandable bitandable]] +[def __bitorable [classref boost::type_erasure::bitorable bitorable]] +[def __bitxorable [classref boost::type_erasure::bitxorable bitxorable]] +[def __left_shiftable [classref boost::type_erasure::left_shiftable left_shiftable]] +[def __right_shiftable [classref boost::type_erasure::right_shiftable right_shiftable]] +[def __add_assignable [classref boost::type_erasure::add_assignable add_assignable]] +[def __subtract_assignable [classref boost::type_erasure::subtract_assignable subtract_assignable]] +[def __multiply_assignable [classref boost::type_erasure::multiply_assignable multiply_assignable]] +[def __divide_assignable [classref boost::type_erasure::divide_assignable divide_assignable]] +[def __mod_assignable [classref boost::type_erasure::mod_assignable mod_assignable]] +[def __bitand_assignable [classref boost::type_erasure::bitand_assignable bitand_assignable]] +[def __bitor_assignable [classref boost::type_erasure::bitor_assignable bitor_assignable]] +[def __bitxor_assignable [classref boost::type_erasure::bitxor_assignable bitxor_assignable]] +[def __left_shift_assignable [classref boost::type_erasure::left_shift_assignable left_shift_assignable]] +[def __right_shift_assignable [classref boost::type_erasure::right_shift_assignable right_shift_assignable]] +[def __incrementable [classref boost::type_erasure::incrementable incrementable]] +[def __decrementable [classref boost::type_erasure::decrementable decrementable]] +[def __negatable [classref boost::type_erasure::negatable negatable]] +[def __complementable [classref boost::type_erasure::complementable complementable]] +[def __dereferenceable [classref boost::type_erasure::dereferenceable dereferenceable]] +[def __callable [classref boost::type_erasure::callable callable]] +[def __subscriptable [classref boost::type_erasure::subscriptable subscriptable]] +[def __equality_comparable [classref boost::type_erasure::equality_comparable equality_comparable]] +[def __less_than_comparable [classref boost::type_erasure::less_than_comparable less_than_comparable]] +[def __ostreamable [classref boost::type_erasure::ostreamable ostreamable]] +[def __istreamable [classref boost::type_erasure::istreamable istreamable]] +[def __iterator [classref boost::type_erasure::iterator iterator]] +[def __forward_iterator [classref boost::type_erasure::forward_iterator forward_iterator]] +[def __bidirectional_iterator [classref boost::type_erasure::bidirectional_iterator bidirectional_iterator]] +[def __random_access_iterator [classref boost::type_erasure::random_access_iterator random_access_iterator]] +[def __same_type [classref boost::type_erasure::same_type same_type]] + +[def __BOOST_TYPE_ERASURE_MEMBER [macroref BOOST_TYPE_ERASURE_MEMBER]] +[def __BOOST_TYPE_ERASURE_FREE [macroref BOOST_TYPE_ERASURE_FREE]] + +[section:introduction Introduction] + +The Boost.TypeErasure library provides runtime polymorphism +in C++ that is more flexible than that provided by the +core language. + +C++ has two distinct kinds of polymorphism, +virtual functions and templates, each of which has +its own advantages and disadvantages. + +* Virtual functions are not resolved until runtime, + while templates are always resolved at compile + time. If your types can vary at runtime (for + example, if they depend on user input), then + static polymorphism with templates doesn't help much. +* Virtual functions can be used with separate compilation. + The body of a template has to be available + in every translation unit in which it is used, + slowing down compiles and increasing rebuilds. +* Virtual functions automatically make the requirements + on the arguments explicit. Templates are only + checked when they're instantiated, requiring + extra work in testing, assertions, and documentation. +* The compiler creates a new copy of each function + template every time it is instantiated. This + allows better optimization, because the compiler + knows everything statically, but it also causes + a significant increase of binary sizes. +* Templates support Value semantics. Objects that + "behave like an int" and are not shared are easier + to reason about. To use virtual functions, on + the other hand, you have to use (smart) pointers + or references. +* Template libraries can allow third-party types to + be adapted non-intrusively for seamless interoperability. + With virtual functions, you have to create a wrapper + that inherits from the base class. +* Templates can handle constraints involving + multiple types. For example, std::for_each + takes an iterator range and a function that + can be called on the elements of the range. + Virtual functions aren't really able to + express such constraints. + +The Boost.TypeErasure library combines the superior +abstraction capabilities of templates, with the +runtime flexibility of virtual functions. + +Boost includes several special cases of this kind +of polymorphism: + +* `boost::any` for CopyConstructible types. +* `boost::function` for objects that can be called like functions. +* Boost.Range provides `any_iterator`. + +Boost.TypeErasure generalizes this to support arbitrary +requirements and provides a +[link boost_typeerasure.predef predefined set of common concepts] + +[endsect] + +[section:reading How to read this documentation] + +To avoid excessive verbosity, all the examples +assume that a few using directives are in place. + + namespace mpl = boost::mpl; + using namespace boost::type_erasure; + +[endsect] + +[section:basic Basic Usage] +[import ../example/basic.cpp] +[basic] +[endsect] + +[section Composing Concepts] +[import ../example/compose.cpp] +[compose] +[endsect] + +[section:multi Functions with Multiple Arguments] +[import ../example/multi.cpp] +[multi] +[endsect] + +[section:concept Concepts in Depth] + +[section:custom Defining Custom Concepts] +[import ../example/custom.cpp] +[custom] +[endsect] + +[section:overload Overloading] +[import ../example/overload.cpp] +[overload] +[endsect] + +[section:concept_map Concept Maps] +[import ../example/concept_map.cpp] +[concept_map] +[endsect] + +[section:overload Associated Types] +[import ../example/associated.cpp] +[associated] +[endsect] + +[endsect] + +[section:any Using Any] + +[section:construction Construction] +[import ../example/construction.cpp] +[construction] +[endsect] + +[section Conversions] +[import ../example/convert.cpp] +[convert] +[endsect] + +[section:references References] +[import ../example/references.cpp] +[references] +[endsect] + +[section:limit Syntax Limitations] + +In most cases using an any has the same +syntax as using the underlying object. +However, there are a few cases where +this is not possible to implement. +An __any reference is proxy and cannot +be used in contexts where a real +reference is required. In particular, +__forward_iterator does not create +a conforming ForwardIterator (unless +the value_type is fixed.) Another +difference is that all operations +which do not take at least one __any +argument have to be passed the type +information explicitly. Static member +functions and constructors can fall in +this category. All this means that generic +algorithms might not work when applied to +__any arguments. + +[endsect] + +[endsect] + +[section:examples Examples] + +[section:print_sequence A polymorphic range formatter] +[import ../example/print_sequence.cpp] +[print_sequence] +[endsect] + +[section:printf A type-safe printf] +[import ../example/printf.cpp] +[printf] +[endsect] + +[section:multifunction Boost.Function with multiple signatures] +[import ../example/multifunction.cpp] +[multifunction] +[endsect] + +[endsect] + +[section:conceptdef Concept Definitions] + +A Concept defines a set of constraints on the types that +are stored in an __any. + +There are three kinds of concepts. + +# The library defines a number of [link boost_typeerasure.predef predefined concepts]. + Most of these are equivalent to user-defined concepts, but a few + require special handling. +# Users can define their own primitive concepts as described below. + The macros __BOOST_TYPE_ERASURE_MEMBER and __BOOST_TYPE_ERASURE_FREE + define concepts of this form. +# Any MPL Forward Sequence whose elements are + concepts is also a concept. This allows concepts + to be composed easily. + +Each primitive concept defines a single function. +A primitive concept must be a specialization of a +class template, with a static member function +called `apply`, which will be executed when the +function is dispatched by __call. The template +can only take template type parameters. non-type +template parameters and template template parameters +are not allowed. + +The template parameters of the concept +may involve placeholders. The following are +considered. + +* Each template argument may be a cv and/or reference + qualified placeholder type. +* If a template argument is a function type, its + arguments and return type may be cv/reference + qualified placeholders. + +Any other placeholders are ignored. + +A concept is instantiated by constructing an +__any from a raw value or by constructing a __binding. +When a concept is instantiated with a specific +set of type bindings, each placeholder is bound +to a cv-unqualified non-reference type. After +replacing each placeholder in the template argument +list with the type that it binds to, the following +must hold. + +* The number of arguments of apply in the + bound concept must be the same as the number + of arguments in the unbound concept. +* The arguments and return type of apply in the + bound concept can be derived from the corresponding + arguments and the return type in the unbound concept + as follows: If the argument in the unbound concept is a + placeholder with optional cv and reference + qualifiers, then the argument in the bound + concept can be found by replacing the placeholder. + Otherwise, the argument in the unbound concept + must be the same as the argument in the bound concept. + + // Correct. + template + struct foo1 { + static void apply(const T& t) { t.foo(); } + }; + + // Wrong. The signature of apply is different from the + // primary template + template<> + struct foo1 { + static void apply(int i); + }; + + // Wrong. A concept must be a template + struct foo2 { + static void apply(const _self&); + }; + + // Wrong. apply must be static + template + struct foo3 { + void apply(const T&); + }; + + // Wrong. apply cannot be overloaded + template + struct foo3 { + static void apply(T&); + static void apply(const T&); + }; + + // Wrong. Only top level placeholders are detected + template + struct foo4; + template + struct foo4 > { + static void apply(const T&); + }; + + // Wrong. Template template parameters are not allowed. + template class T> + struct foo5 + { + static void apply(T&); + }; + +[endsect] + +[section:predef Predefined Concepts] + +In the following tables, `T` and `U` are the types that the operation +applies to, `R` is the result type. `T` always defaults +to `_self` to match the default behavior of any. These +concepts assume normal semantics. Thus, comparison +operators always return bool, and references will be +added to the arguments and results as appropriate. + +Except as otherwise noted, primitive concepts defined by +the library can be specialized to provide concept maps. +__copy_constructible, and the iterator concepts cannot +be specialized because they are composites. __constructible, +__destructible, __typeid_, and __same_type cannot be +specialized because they require special handling in +the library. + +[table:special Special Members + [[concept][notes]] + [[__constructible``][-]] + [[__copy_constructible``][-]] + [[__destructible``][-]] + [[__assignable``][-]] + [[__typeid_``][-]] +] +[table:unary Unary Operators + [[operator][concept][notes]] + [[`operator++`][__incrementable``][There is no separate post-increment]] + [[`operator--`][__decrementable``][There is no separate post-decrement]] + [[`operator*`][__dereferenceable``][`R` should usually be a reference]] + [[`operator~`][__complementable``][-]] + [[`operator-`][__negatable``][-]] +] + +[table:binary Binary Operators + [[operator][concept][notes]] + [[`operator+`][__addable``][-]] + [[`operator-`][__subtractable``][-]] + [[`operator*`][__multipliable``][-]] + [[`operator/`][__dividable``][-]] + [[`operator%`][__modable``][-]] + [[`operator&`][__bitandable``][-]] + [[`operator|`][__bitorable``][-]] + [[`operator^`][__bitxorable``][-]] + [[`operator<<`][__left_shiftable``][-]] + [[`operator>>`][__right_shiftable``][-]] + [[`operator==` and `!=`][__equality_comparable``][`!=` is implemented in terms of `==`]] + [[`operator<`, `>`, `<=`, and `>=`][__less_than_comparable``][All are implemented in terms of `<`]] + [[`operator+=`][__add_assignable``][-]] + [[`operator-=`][__subtract_assignable``][-]] + [[`operator*=`][__multiply_assignable``][-]] + [[`operator/=`][__divide_assignable``][-]] + [[`operator%=`][__mod_assignable``][-]] + [[`operator&=`][__bitand_assignable``][-]] + [[`operator|=`][__bitor_assignable``][-]] + [[`operator^=`][__bitxor_assignable``][-]] + [[`operator<<=`][__left_shift_assignable``][-]] + [[`operator>>=`][__right_shift_assignable``][-]] + [[`operator<<`][__ostreamable``][-]] + [[`operator>>`][__istreamable``][-]] +] + +[table:misc Miscellaneous Operators + [[operator][concept][notes]] + [[`operator()`][__callable``][`Sig` should be a function type. T may be const qualified.]] + [[`operator[]`][__subscriptable``][`R` should usually be a reference. `T` can be optionally const qualified.]] +] + +[table:iterator Iterator Concepts + [[concept][notes]] + [[__iterator``][Use __same_type to control the iterator's value type.]] + [[__forward_iterator``][-]] + [[__bidirectional_iterator``][-]] + [[__random_access_iterator``][-]] +] + +[table:special Special Concepts + [[concept][notes]] + [[__same_type``][Indicates that two types are the same.]] +] + +[endsect] + +[xinclude reference.xml] + +[section:rationale Rationale] + +[section Why do I have to specify the presence of a destructor explicitly?] +When using references the destructor isn't needed. +By not assuming it implicitly, we allow capturing +types with private or protected destructors by reference. +For the sake of consistency, it must be specified +when capturing by value as well. +[endsect] + +[section Why non-member functions?] +The members of __any can be customized. By using +free functions, we guarantee that we don't interfere +with anything that a user might want. +[endsect] + +[section:placeholder Why are the placeholders called `_a`, `_b` and not `_1` `_2`] + +An earlier version of the library used the names `_1`, `_2`, etc. +instead of `_a`, `_b`, etc. This caused a certain amount +of confusion because the numbered placeholders are +already used with a somewhat different meaning by several +other libraries including Boost/Std Bind, Boost.Phoenix, +and Boost.MPL. I eventually decided that since the +placeholders represented named parameters instead of positional parameters, +letters were more appropriate than numbers. + +[endsect] + +[section:ref Why not use `boost::ref` for references?] + +Boost.Function allows you to use `boost::ref` to store +a reference to a function object. However, in the +general case treating references and values in the +same way causes inconsistent behavior that is difficult +to reason about. If Boost.TypeErasure handled references +like this, then, when you copy an __any, you would have +no idea whether the new object is a real copy or +just a new reference to the same underlying object. +Boost.Function can get away with it, because it doesn't +expose any mutating operations on the stored function object. + +Another method that has been proposed is only to +keep a reference the first time. + + int i = 2; + any x = ref(i); + any y = x; // makes a copy + +Unfortunately, this doesn't handle all use cases, +as there is no reliable way to return such a reference +from a function. In addition it adds overhead whether +it's needed or not, as we would have to add a flag +to any to keep track of whether or not it is storing +a reference. (The alternate method of storing this +in the "`clone`" method in the vtable is impossibly complex +to implement given the decoupled vtables that +Boost.TypeErasure uses and it still adds overhead.). + +[endsect] + +[endsect] + +[section:future Future Work] + +These are just some ideas. There is absolutely no +guarantee that any of them will ever be implemented. + +* Use SBO. +* Allow more control over vtable layout. +* Attempt to reuse sub-tables in conversions. +* Allow "dynamic_cast". This requires creating + a global registry of concept mappings. +* Optimize the compile-time cost. + +[endsect] + + +[section:acknowledgements Acknowledgements] + +The name `any` and an early ancestor of my placeholder +system were taken from Alexander Nasonov's DynamicAny library. + +Thanks to review manager, Lorenzo Caminiti +and all who participated in the formal review: + +* Christophe Henry +* Paul Bristow +* Karsten Ahnert +* Pete Bartlett +* Sebastian Redl +* Hossein Haeri +* Trigve Siver +* Julien Nitard +* Eric Niebler +* Fabio Fracassi +* Joel de Guzman +* Alec Chapman +* Larry Evans +* Vincente J. Botet Escriba +* Marcus Werle +* Andrey Semashev +* Dave Abrahams +* Thomas Jordan + +[endsect] + +[section:related Related Work] + +There are a number of similar libraries in existence. I'm aware +of at least three. + +* [@http://www.coderage.com/interfaces/ Boost.Interfaces] by Jonathan Turkanis +* [@http://stlab.adobe.com/group__poly__related.html Adobe Poly] +* [@http://cpp-experiment.sourceforge.net/boost/libs/dynamic_any/doc/ Boost.dynamic_any] by Alexander Nasonov + +[endsect] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/Jamfile.jam b/tools/boost_1_65_1/libs/type_erasure/example/Jamfile.jam new file mode 100644 index 0000000000000000000000000000000000000000..d96922f46330e2babc057687fd9ced093022dc62 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/Jamfile.jam @@ -0,0 +1,24 @@ +# Boost.TypeErasure library +# +# Copyright 2011 Steven Watanabe +# +# Distributed under the Boost Software License version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import testing ; + +compile basic.cpp ; +compile multi.cpp ; +compile convert.cpp ; +compile references.cpp ; +compile custom.cpp ; +compile construction.cpp ; +compile concept_map.cpp ; +compile compose.cpp ; +compile overload.cpp ; +compile associated.cpp ; + +run print_sequence.cpp ; +run printf.cpp ; +run multifunction.cpp ; diff --git a/tools/boost_1_65_1/libs/type_erasure/example/associated.cpp b/tools/boost_1_65_1/libs/type_erasure/example/associated.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ca4ef26e42979be8f6292718f193740b25b9d709 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/associated.cpp @@ -0,0 +1,147 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +//[associated1 +/*` + Associated types such as `typename T::value_type` or + `typename std::iterator_traits::reference` are + quite common in template programming. + Boost.TypeErasure handles them using the __deduced + template. __deduced is just like an ordinary + __placeholder, except that the type that it binds + to is determined by calling a metafunction and + does not need to be specified explicitly. + + For example, we can define a concept for + holding an iterator, raw pointer, or + smart pointer as follows. + First, we define a metafunction called `pointee` + defining the associated type. +*/ + +template +struct pointee +{ + typedef typename mpl::eval_if, + mpl::identity, + boost::pointee + >::type type; +}; + +/*` + Note that we can't just use `boost::pointee`, because + this metafunction needs to be safe to instantiate + with placeholders. It doesn't matter what it returns + as long as it doesn't give an error. (The library + never tries to instantiate it with a placeholder, but + argument dependent lookup can cause spurious instantiations.) +*/ + +template +struct pointer : + mpl::vector< + copy_constructible, + dereferenceable >&, T> + > +{ + // provide a typedef for convenience + typedef deduced > element_type; +}; + +//] + +void associated2() { + //[associated2 + /*` + Now the Concept of `x` uses two placeholders, `_self` + and `pointer<>::element_type`. When we construct `x`, + with an `int*`, `pointer<>::element_type` is deduced + as `pointee::type` which is `int`. Thus, dereferencing + `x` returns an __any that contains an `int`. + */ + int i = 10; + any< + mpl::vector< + pointer<>, + typeid_::element_type> + > + > x(&i); + int j = any_cast(*x); // j == i + //] +} + +void associated3() { + //[associated3 + /*` + Sometimes we want to require that the associated + type be a specific type. This can be solved using + the __same_type concept. Here we create an any that + can hold any pointer whose element type is `int`. + */ + int i = 10; + any< + mpl::vector< + pointer<>, + same_type::element_type, int> + > + > x(&i); + std::cout << *x << std::endl; // prints 10 + /*` + Using __same_type like this effectively causes the library to + replace all uses of `pointer<>::element_type` with `int` + and validate that it is always bound to `int`. + Thus, dereferencing `x` now returns an `int`. + */ + //] +} + +void associated4() { + //[associated4 + /*` + __same_type can also be used for two placeholders. + This allows us to use a simple name instead of + writing out an associated type over and over. + */ + int i = 10; + any< + mpl::vector< + pointer<>, + same_type::element_type, _a>, + typeid_<_a>, + copy_constructible<_a>, + addable<_a>, + ostreamable + > + > x(&i); + std::cout << (*x + *x) << std::endl; // prints 20 + //] +} + +//[associated +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/associated.cpp associated.cpp]) +//` [associated1] +//` [associated2] +//` [associated3] +//` [associated4] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/basic.cpp b/tools/boost_1_65_1/libs/type_erasure/example/basic.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b0817f4169140a4fb08988ee92697307f3714fb9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/basic.cpp @@ -0,0 +1,160 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +void basic1() { + //[basic1 + /*` + The main class in the library is __any. An __any can + store objects that meet whatever requirements we specify. + These requirements are passed to __any as an MPL sequence. + + [note The MPL sequence combines multiple concepts. + In the rare case when we only want a single concept, it doesn't + need to be wrapped in an MPL sequence.] + */ + any, typeid_<>, relaxed> > x(10); + int i = any_cast(x); // i == 10 + /*` + __copy_constructible is a builtin concept that allows us to + copy and destroy the object. __typeid_ provides run-time + type information so that we can use __any_cast. __relaxed + enables various useful defaults. Without __relaxed, + __any supports /exactly/ what you specify and nothing else. + In particular, it allows default construction and assignment of __any. + */ + //] +} + +void basic2() { + //[basic2 + /*` + Now, this example doesn't do very much. `x` is approximately + equivalent to a [@boost:/libs/any/index.html boost::any]. + We can make it more interesting by adding some operators, + such as `operator++` and `operator<<`. + */ + any< + mpl::vector< + copy_constructible<>, + typeid_<>, + incrementable<>, + ostreamable<> + > + > x(10); + ++x; + std::cout << x << std::endl; // prints 11 + //] +} + +//[basic3 +/*` + The library provides concepts for most C++ operators, but this + obviously won't cover all use cases; we often need to + define our own requirements. Let's take the `push_back` + member, defined by several STL containers. +*/ + +BOOST_TYPE_ERASURE_MEMBER((has_push_back), push_back, 1) + +void append_many(any, _self&> container) { + for(int i = 0; i < 10; ++i) + container.push_back(i); +} + +/*` + We use the macro __BOOST_TYPE_ERASURE_MEMBER + to define a concept called `has_push_back`. + The second parameter is the name of the member + function and the last macro parameter indicates + the number of arguments which is `1` since `push_back` + is unary. When we use `has_push_back`, we have to + tell it the signature of the function, `void(int)`. + This means that the type we store in the any + has to have a member that looks like: + + `` + void push_back(int); + `` + + Thus, we could call `append_many` with `std::vector`, + `std::list`, or `std::vector` (because `int` is + convertible to `long`), but not `std::list` + or `std::set`. + + Also, note that `append_many` has to operate directly + on its argument. It cannot make a copy. To handle this + we use `_self&` as the second argument of __any. `_self` + is a __placeholder. By using `_self&`, we indicate that + the __any stores a reference to an external object instead of + allocating its own object. +*/ + +/*` + There's actually another __placeholder here. The second + parameter of `has_push_back` defaults to `_self`. If + we wanted to define a const member function, we would + have to change it to `const _self`, as shown below. + */ +BOOST_TYPE_ERASURE_MEMBER((has_empty), empty, 0) +bool is_empty(any, const _self&> x) { + return x.empty(); +} + +/*` + For free functions, we can use the macro __BOOST_TYPE_ERASURE_FREE. +*/ + +BOOST_TYPE_ERASURE_FREE((has_getline), getline, 2) +std::vector read_lines(any, _self&> stream) +{ + std::vector result; + std::string tmp; + while(getline(stream, tmp)) + result.push_back(tmp); + return result; +} + +/*` + The use of `has_getline` is very similar to `has_push_back` above. + The difference is that the placeholder `_self` is passed in + the function signature instead of as a separate argument. + + The __placeholder doesn't have to be the first argument. + We could just as easily make it the second argument. +*/ + + +void read_line(any, _self&> str) +{ + getline(std::cin, str); +} + +//] + +//[basic +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/basic.cpp basic.cpp]) +//` [basic1] +//` [basic2] +//` [basic3] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/compose.cpp b/tools/boost_1_65_1/libs/type_erasure/example/compose.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a629af49de7ca239ae4ce06ee4a1b7a48eff17e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/compose.cpp @@ -0,0 +1,44 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +//[compose1 +/*` + Multiple concepts can be composed using an MPL sequence. +*/ +template +struct arithmetic : + mpl::vector< + copy_constructible, + addable, + subtractable, + multipliable, + dividable, + equality_comparable, + less_than_comparable + > +{}; +/*` + Now, `arithmetic` is a concept that can be used just + like any of the base concepts. +*/ +//] + +//[compose +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/compose.cpp compose.cpp]) +//` [compose1] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/concept_map.cpp b/tools/boost_1_65_1/libs/type_erasure/example/concept_map.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e35ef11db437264253525d9fe5a91ce8c7c6f195 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/concept_map.cpp @@ -0,0 +1,50 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +//[concept_map1 +/*` + Sometimes it is useful to non-intrusively adapt a + type to model a concept. For example, suppose that + we want to make `std::type_info` model __less_than_comparable. + To do this, we simply specialize the concept definition. +*/ +namespace boost { +namespace type_erasure { + +template<> +struct less_than_comparable +{ + static bool apply(const std::type_info& lhs, const std::type_info& rhs) + { return lhs.before(rhs) != 0; } +}; + +} +} + +/*` + [note Most, but not all of the builtin concepts can be specialized. + Constructors, destructors, and RTTI need special treatment from the + library and cannot be specialized. Only primitive concepts can + be specialized, so the iterator concepts are also out.] +*/ + +//] + +//[concept_map +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/concept_map.cpp concept_map.cpp]) +//` [concept_map1] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/construction.cpp b/tools/boost_1_65_1/libs/type_erasure/example/construction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1a9d327d96c2e56780ccdc226635856fa6357b1e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/construction.cpp @@ -0,0 +1,93 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +void construction1() { + //[construction1 + /*` + The library provides the __constructible concept to + allow an __any to capture constructors. The single + template argument should be a function signature. + The return type must be a placeholder specifying + the type to be constructed. The arguments are + the arguments of the constructor. + */ + typedef mpl::vector< + copy_constructible<_a>, + copy_constructible<_b>, + copy_constructible<_c>, + constructible<_a(const _b&, const _c&)> + > construct; + + typedef mpl::map< + mpl::pair<_a, std::vector >, + mpl::pair<_b, std::size_t>, + mpl::pair<_c, double> + > types; + + any size(std::size_t(10), make_binding()); + any val(2.5, make_binding()); + any v(size, val); + // v holds std::vector(10, 2.5); + //] +} + +void construction3() { + //[construction3 + /*` + Now, suppose that we want a default constructor? + We can't have the default constructor of __any + call the default constructor of the contained type, + because it would have no way of knowing what the + contained type is. So, we'll need to pass + the placeholder binding information explicitly. + */ + typedef mpl::vector< + copy_constructible<>, + constructible<_self()> + > construct; + + any x(std::string("Test")); + any y(binding_of(x)); // y == "" + //] +} + +void construction4() { + //[construction4 + /*` + This method is not restricted to the default constructor. If + the constructor takes arguments, they can be passed after the + bindings. + */ + typedef mpl::vector< + copy_constructible<>, + constructible<_self(std::size_t, char)> + > construct; + + any x(std::string("Test")); + any y(binding_of(x), 5, 'A'); + //] +} + +//[construction +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/construction.cpp construction.cpp]) +//` [construction1] +//` [construction3] +//` [construction4] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/convert.cpp b/tools/boost_1_65_1/libs/type_erasure/example/convert.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ef488796ffb310bcaed69c219652e19a7c73b93e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/convert.cpp @@ -0,0 +1,58 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +void convert1() { +//[convert1 + /*` + An __any can be converted to another __any + as long as the conversion is an "upcast." + */ + + typedef any< + mpl::vector< + copy_constructible<>, + typeid_<>, + ostreamable<> + > + > any_printable; + typedef any< + mpl::vector< + copy_constructible<>, + typeid_<> + > + > common_any; + any_printable x(10); + common_any y(x); + + /*` + This conversion is okay because the requirements of `common_any` + are a subset of the requirements of `any_printable`. Conversion + in the other direction is illegal. + + `` + common_any x(10); + any_printable y(x); // error + `` + */ +//] +} + +//[convert +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/convert.cpp convert.cpp]) +//` [convert1] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/custom.cpp b/tools/boost_1_65_1/libs/type_erasure/example/custom.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ded58294d225767bb83bc193826a60e604d892c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/custom.cpp @@ -0,0 +1,107 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +//[custom1 +/*` + Earlier, we used __BOOST_TYPE_ERASURE_MEMBER to define + a concept for containers that support `push_back`. Sometimes + this interface isn't flexible enough, however. The library + also provides a lower level interface that gives full + control of the behavior. Let's take a look at what we + would need in order to define `has_push_back.` First, + we need to define the `has_push_back` template itself. We'll + give it two template parameters, one for the container + and one for the element type. This template must have + a static member function called apply which is used + to execute the operation. +*/ + +template +struct has_push_back +{ + static void apply(C& cont, const T& arg) { cont.push_back(arg); } +}; +//] + +//[custom3 +/*` + Our second task is to customize __any so that we can call `c.push_back(10)`. + We do this by specializing __concept_interface. + The first argument is `has_push_back`, since we want to inject a member + into every __any that uses the `has_push_back` concept. The second argument, + `Base`, is used by the library to chain multiple uses of __concept_interface + together. We have to inherit from it publicly. `Base` is also used + to get access to the full __any type. The third argument is the placeholder + that represents this any. If someone used `push_back<_c, _b>`, + we only want to insert a `push_back` member in the container, + not the value type. Thus, the third argument is the container + placeholder. + + When we define `push_back` the argument type uses the metafunction + __as_param. This is just to handle the case where `T` is a + placeholder. If `T` is not a placeholder, then the metafunction + just returns its argument, `const T&`, unchanged. +*/ +namespace boost { +namespace type_erasure { +template +struct concept_interface, Base, C> : Base +{ + void push_back(typename as_param::type arg) + { call(has_push_back(), *this, arg); } +}; +} +} +//] + +void custom2() { + //[custom2 + /*` + Now, we can use this in an __any using + __call to dispatch the operation. + */ + std::vector vec; + any, _self&> c(vec); + int i = 10; + call(has_push_back<_self, int>(), c, i); + // vec is [10]. + //] +} + +void custom4() { + //[custom4 + /*` + Our example now becomes + */ + std::vector vec; + any, _self&> c(vec); + c.push_back(10); + /*` + which is what we want. + */ + //] +} + +//[custom +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/custom.cpp custom.cpp]) +//` [custom1] +//` [custom2] +//` [custom3] +//` [custom4] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/multi.cpp b/tools/boost_1_65_1/libs/type_erasure/example/multi.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d34e0da49c3198b61b8ea659fcc9de0ce61a78c8 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/multi.cpp @@ -0,0 +1,116 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +void multi1() { + //[multi1 + /*` + Operations can have more than one __any argument. + Let's use binary addition as an example. + */ + typedef any< + mpl::vector< + copy_constructible<>, + typeid_<>, + addable<>, + ostreamable<> + > + > any_type; + any_type x(10); + any_type y(7); + any_type z(x + y); + std::cout << z << std::endl; // prints 17 + /*` + This is /not/ a multimethod. The underlying types of the + arguments of `+` must be the same or the behavior is undefined. + This example is correct because the arguments both hold + `int`'s. + + [note Adding __relaxed leads an exception rather than undefined + behavior if the argument types are wrong.] + */ + //] +} + +void multi2() { + //[multi2 + /*` + __addable`<>` requires the types of the arguments to be exactly + the same. This doesn't cover all uses of addition though. For + example, pointer arithmetic takes a pointer and an integer and + returns a pointer. We can capture this kind of relationship among + several types by identifying each type involved with a placeholder. + We'll let the placeholder `_a` represent the pointer and the + placeholder `_b` represent the integer. + */ + + int array[5]; + + typedef mpl::vector< + copy_constructible<_a>, + copy_constructible<_b>, + typeid_<_a>, + addable<_a, _b, _a> + > requirements; + + /*` + Our new concept, `addable<_a, _b, _a>` captures the + rules of pointer addition: `_a + _b -> _a`. + + Also, we can no longer capture the variables + independently. + `` + any ptr(&array[0]); // illegal + `` + This doesn't work because the library needs + to know the type that _b binds to when it + captures the concept bindings. We need to + specify the bindings of both placeholders + when we construct the __any. + */ + + typedef mpl::map, mpl::pair<_b, int> > types; + any ptr(&array[0], make_binding()); + any idx(2, make_binding()); + any x(ptr + idx); + // x now holds array + 2 + + /*` + Now that the arguments of `+` aren't the same type, + we require that both arguments agree that `_a` maps + to `int*` and that `_b` maps to `int`. + + We can also use __tuple to avoid having to + write out the map out explicitly. __tuple is + just a convenience class that combines the + placeholder bindings it gets from all its arguments. + */ + tuple t(&array[0], 2); + any y(get<0>(t) + get<1>(t)); + //] +} + + +//[multi +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/multi.cpp multi.cpp]) +//` [multi1] +//` [multi2] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/multifunction.cpp b/tools/boost_1_65_1/libs/type_erasure/example/multifunction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e2d5d1c9b92e5c110b37a0375c200721afb30392 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/multifunction.cpp @@ -0,0 +1,105 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +//[multifunction +/*` + (For the source of this example see + [@boost:/libs/type_erasure/example/multifunction.cpp multifunction.cpp]) + + This example implements an extension of Boost.Function that supports + multiple signatures. + + [note This example uses C++11 features. You'll need a + recent compiler for it to work.] + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; +namespace phoenix = boost::phoenix; + +// First of all we'll declare the multifunction template. +// multifunction is like Boost.Function but instead of +// taking one signature, it takes any number of them. +template +using multifunction = + any< + mpl::vector< + copy_constructible<>, + typeid_<>, + relaxed, + callable... + > + >; + +// Let's use multifunction to process a variant. We'll start +// by defining a simple recursive variant to use. +typedef boost::make_recursive_variant< + int, + double, + std::string, + std::vector >::type variant_type; +typedef std::vector vector_type; + +// Now we'll define a multifunction that can operate +// on the leaf nodes of the variant. +typedef multifunction function_type; + +class variant_handler +{ +public: + void handle(const variant_type& arg) + { + boost::apply_visitor(impl, arg); + } + void set_handler(function_type f) + { + impl.f = f; + } +private: + // A class that works with boost::apply_visitor + struct dispatcher : boost::static_visitor + { + // used for the leaves + template + void operator()(const T& t) { f(t); } + // For a vector, we recursively operate on the elements + void operator()(const vector_type& v) + { + boost::for_each(v, boost::apply_visitor(*this)); + } + function_type f; + }; + dispatcher impl; +}; + +int main() { + variant_handler x; + x.set_handler(std::cout << phoenix::val("Value: ") << phoenix::placeholders::_1 << std::endl); + + x.handle(1); + x.handle(2.718); + x.handle("The quick brown fox jumps over the lazy dog."); + x.handle(vector_type{ 1.618, "Gallia est omnis divisa in partes tres", 42 }); +} + +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/overload.cpp b/tools/boost_1_65_1/libs/type_erasure/example/overload.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dcd69ba8559a0b9f65a4a241e28d1ac9e46d2876 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/overload.cpp @@ -0,0 +1,165 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +//[overload1 +/*` + __concept_interface allows us to inject arbitrary declarations + into an __any. This is very flexible, but there are some pitfalls + to watch out for. Sometimes we want to use the same concept several + times with different parameters. Specializing __concept_interface + in a way that handles overloads correctly is a bit tricky. + Given a concept foo, we'd like the following to work: + + `` + any< + mpl::vector< + foo<_self, int>, + foo<_self, double>, + copy_constructible<> + > + > x = ...; + x.foo(1); // calls foo(int) + x.foo(1.0); // calls foo(double) + `` + + Because __concept_interface creates a linear + inheritance chain, without some extra work, + one overload of foo will hide the other. + + Here are the techniques that I found work reliably. + + For member functions I couldn't find a way to + avoid using two specializations. +*/ + +template +struct foo +{ + static void apply(T& t, const U& u) { t.foo(u); } +}; + +namespace boost { +namespace type_erasure { + +template +struct concept_interface< ::foo, Base, T, Enable> : Base +{ + typedef void _fun_defined; + void foo(typename as_param::type arg) + { + call(::foo(), *this, arg); + } +}; + +template +struct concept_interface< ::foo, Base, T, typename Base::_fun_defined> : Base +{ + using Base::foo; + void foo(typename as_param::type arg) + { + call(::foo(), *this, arg); + } +}; + +} +} + +/*` + This uses SFINAE to detect whether a using declaration is + needed. Note that the fourth argument of __concept_interface + is a dummy parameter which is always void and is + intended to be used for SFINAE. + Another solution to the problem that I've used + in the past is to inject a dummy declaration of `fun` + and always put in a using declaration. This is an + inferior solution for several reasons. It requires an + extra interface to add the dummy overload. It also + means that `fun` is always overloaded, even if the + user only asked for one overload. This makes it + harder to take the address of fun. + + Note that while using SFINAE requires some code + to be duplicated, the amount of code that has to + be duplicated is relatively small, since the implementation + of __concept_interface is usually a one liner. It's + a bit annoying, but I believe it's an acceptable cost + in lieu of a better solution. +*/ + +//] +//[overload2 +/*` + For free functions you can use inline friends. +*/ + +template +struct bar_concept +{ + static void apply(T& t, const U& u) { bar(t, u); } +}; + +namespace boost { +namespace type_erasure { + +template +struct concept_interface< ::bar_concept, Base, T> : Base +{ + friend void bar(typename derived::type& t, typename as_param::type u) + { + call(::bar_concept(), t, u); + } +}; + +template +struct concept_interface< ::bar_concept, Base, U, typename boost::disable_if >::type> : Base +{ + using Base::bar; + friend void bar(T& t, const typename derived::type& u) + { + call(::bar_concept(), t, u); + } +}; + +} +} + +/*` + Basically we have to specialize __concept_interface once for + each argument to make sure that an overload is injected into + the first argument that's a placeholder. + As you might have noticed, the argument types are a bit tricky. + In the first specialization, the first argument uses __derived + instead of __as_param. The reason for this is that if we used + __as_param, then we could end up violating the one definition + rule by defining the same function twice. Similarly, we use + SFINAE in the second specialization to make sure that bar is + only defined once when both arguments are placeholders. It's + possible to merge the two specializations with a bit of metaprogramming, + but unless you have a lot of arguments, it's probably not + worth while. +*/ + +//] + +//[overload +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/overload.cpp overload.cpp]) +//` [overload1] +//` [overload2] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/print_sequence.cpp b/tools/boost_1_65_1/libs/type_erasure/example/print_sequence.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e977a7977c8bfe75912070fdb7ab7adaec79c13e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/print_sequence.cpp @@ -0,0 +1,248 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +//[print_sequence + +/*` + (For the source of this example see + [@boost:/libs/type_erasure/example/print_sequence.cpp print_sequence.cpp]) + + This example defines a class hierarchy that allows a sequence + to be formatted in several different ways. We'd like to be + able to handle any sequence and any stream type, since the + range formatting is independent of the formatting of + individual elements. Thus, our interface needs to look + something like this: + + `` + class abstract_printer { + public: + template + virtual void print(std::basic_ostream& os, const Range& r) const = 0; + }; + `` + + Unfortunately, this is illegal because a virtual function + cannot be a template. However, we can define a + class with much the same behavior using Boost.TypeErasure. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace boost::type_erasure; + +struct _t : placeholder {}; +struct _iter : placeholder {}; +struct _os : placeholder {}; + +template +struct base_and_derived +{ + static T& apply(U& arg) { return arg; } +}; + +namespace boost { +namespace type_erasure { + +template +struct concept_interface, Base, U> : Base +{ + operator typename rebind_any::type() const + { + return call(base_and_derived(), const_cast(*this)); + } + operator typename rebind_any::type() + { + return call(base_and_derived(), *this); + } +}; + +} +} + +// abstract_printer - An abstract base class for formatting sequences. +class abstract_printer { +public: + // print - write a sequence to a std::ostream in a manner + // specific to the derived class. + // + // Requires: Range must be a Forward Range whose elements can be + // printed to os. + template + void print(std::basic_ostream& os, const Range& r) const { + // Capture the arguments + typename boost::range_iterator::type + first(boost::begin(r)), + last(boost::end(r)); + tuple args(os, first, last); + // and forward to the real implementation + do_print(get<0>(args), get<1>(args), get<2>(args)); + } + virtual ~abstract_printer() {} +protected: + // define the concept requirements of the arguments of + // print and typedef the any types. + typedef boost::mpl::vector< + base_and_derived, + ostreamable<_os, _t>, + ostreamable<_os, const char*>, + forward_iterator<_iter, const _t&>, + same_type<_t, forward_iterator<_iter, const _t&>::value_type> + > requirements; + typedef boost::type_erasure::any ostream_type; + typedef boost::type_erasure::any iterator_type; + // do_print - This method must be implemented by derived classes + virtual void do_print( + ostream_type os, iterator_type first, iterator_type last) const = 0; +}; + +// separator_printer - writes the elements of a sequence +// separated by a fixed string. For example, if +// the separator is ", " separator_printer produces +// a comma separated list. +class separator_printer : public abstract_printer { +public: + explicit separator_printer(const std::string& sep) : separator(sep) {} +protected: + virtual void do_print( + ostream_type os, iterator_type first, iterator_type last) const { + if(first != last) { + os << *first; + ++first; + for(; first != last; ++first) { + os << separator.c_str() << *first; + } + } + } +private: + std::string separator; +}; + +// column_separator_printer - like separator_printer, but +// also inserts a line break after every n elements. +class column_separator_printer : public abstract_printer { +public: + column_separator_printer(const std::string& sep, std::size_t num_columns) + : separator(sep), + cols(num_columns) + {} +protected: + virtual void do_print( + ostream_type os, iterator_type first, iterator_type last) const { + std::size_t count = 0; + for(; first != last; ++first) { + os << *first; + boost::type_erasure::any temp = first; + ++temp; + if(temp != last) { + os << separator.c_str(); + } + if(++count % cols == 0) { + os << "\n"; + } + } + } +private: + std::string separator; + std::size_t cols; +}; + +// aligned_column_printer - formats a sequence in columns +// reading down. For example, given the sequence +// { 1, 2, 3, 4, 5 }, aligned_column_printer might print +// 1 4 +// 2 5 +// 3 +class aligned_column_printer : public abstract_printer { +public: + aligned_column_printer(std::size_t column_width, std::size_t num_columns) + : width(column_width), + cols(num_columns) + {} +protected: + virtual void do_print( + ostream_type os, iterator_type first, iterator_type last) const + { + if(first == last) return; + std::vector column_iterators; + + // find the tops of the columns + std::size_t count = 0; + for(iterator_type iter = first; iter != last; ++iter) { + ++count; + } + std::size_t rows = (count + cols - 1) / cols; + count = 0; + for(iterator_type iter = first; iter != last; ++iter) { + if(count % rows == 0) { + column_iterators.push_back(iter); + } + ++count; + } + + iterator_type last_col = column_iterators.back(); + + // print the full rows + while(column_iterators.back() != last) { + for(std::vector::iterator + iter = column_iterators.begin(), + end = column_iterators.end(); iter != end; ++iter) + { + static_cast(os).width(width); + os << **iter; + ++*iter; + } + os << "\n"; + } + + // print the rows that are missing the last column + column_iterators.pop_back(); + if(!column_iterators.empty()) { + while(column_iterators.back() != last_col) { + for(std::vector::iterator + iter = column_iterators.begin(), + end = column_iterators.end(); iter != end; ++iter) + { + static_cast(os).width(width); + os << **iter; + ++*iter; + } + os << "\n"; + } + } + } +private: + std::size_t width; + std::size_t cols; +}; + +int main() { + int test[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + separator_printer p1(","); + p1.print(std::cout, test); + std::cout << std::endl; + column_separator_printer p2(",", 4); + p2.print(std::cout, test); + std::cout << std::endl; + aligned_column_printer p3(16, 4); + p3.print(std::cout, test); +} + +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/printf.cpp b/tools/boost_1_65_1/libs/type_erasure/example/printf.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c9dbc08a97ff3d3e57e62728951ebcbb03f53b97 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/printf.cpp @@ -0,0 +1,293 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +//[printf +/*` + (For the source of this example see + [@boost:/libs/type_erasure/example/printf.cpp printf.cpp]) + + This example uses the library to implement a type safe printf. + + [note This example uses C++11 features. You'll need a + recent compiler for it to work.] + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; +using namespace boost::io; + +// We capture the arguments by reference and require nothing +// except that each one must provide a stream insertion operator. +typedef any< + mpl::vector< + typeid_<>, + ostreamable<> + >, + const _self& +> any_printable; +typedef std::vector print_storage; + +// Forward declaration of the implementation function +void print_impl(std::ostream& os, const char * format, const print_storage& args); + +// print +// +// Writes values to a stream like the classic C printf function. The +// arguments are formatted based on specifiers in the format string, +// which match the pattern: +// +// '%' [ argument-number '$' ] flags * [ width ] [ '.' precision ] [ type-code ] format-specifier +// +// Other characters in the format string are written to the stream unchanged. +// In addition the sequence, "%%" can be used to print a literal '%' character. +// Each component is explained in detail below +// +// argument-number: +// The value must be between 1 and sizeof... T. It indicates the +// index of the argument to be formatted. If no index is specified +// the arguments will be processed sequentially. If an index is +// specified for one argument, then it must be specified for every argument. +// +// flags: +// Consists of zero or more of the following: +// '-': Left justify the argument +// '+': Print a plus sign for positive integers +// '0': Use leading 0's to pad instead of filling with spaces. +// ' ': If the value doesn't begin with a sign, prepend a space +// '#': Print 0x or 0 for hexadecimal and octal numbers. +// +// width: +// Indicates the minimum width to print. This can be either +// an integer or a '*'. an asterisk means to read the next +// argument (which must have type int) as the width. +// +// precision: +// For numeric arguments, indicates the number of digits to print. For +// strings (%s) the precision indicates the maximum number of characters +// to print. Longer strings will be truncated. As with width +// this can be either an integer or a '*'. an asterisk means +// to read the next argument (which must have type int) as +// the width. If both the width and the precision are specified +// as '*', the width is read first. +// +// type-code: +// This is ignored, but provided for compatibility with C printf. +// +// format-specifier: +// Must be one of the following characters: +// d, i, u: The argument is formatted as a decimal integer +// o: The argument is formatted as an octal integer +// x, X: The argument is formatted as a hexadecimal integer +// p: The argument is formatted as a pointer +// f: The argument is formatted as a fixed point decimal +// e, E: The argument is formatted in exponential notation +// g, G: The argument is formatted as either fixed point or using +// scientific notation depending on its magnitude +// c: The argument is formatted as a character +// s: The argument is formatted as a string +// +template +void print(std::ostream& os, const char * format, const T&... t) +{ + // capture the arguments + print_storage args = { any_printable(t)... }; + // and forward to the real implementation + print_impl(os, format, args); +} + +// This overload of print with no explicit stream writes to std::cout. +template +void print(const char * format, const T&... t) +{ + print(std::cout, format, t...); +} + +// The implementation from here on can be separately compiled. + +// utility function to parse an integer +int parse_int(const char *& format) { + int result = 0; + while(char ch = *format) { + switch(ch) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + result = result * 10 + (ch - '0'); + break; + default: return result; + } + ++format; + } + return result; +} + +// printf implementation +void print_impl(std::ostream& os, const char * format, const print_storage& args) { + int idx = 0; + ios_flags_saver savef_outer(os, std::ios_base::dec); + bool has_positional = false; + bool has_indexed = false; + while(char ch = *format++) { + if (ch == '%') { + if (*format == '%') { os << '%'; continue; } + + ios_flags_saver savef(os); + ios_precision_saver savep(os); + ios_fill_saver savefill(os); + + int precision = 0; + bool pad_space = false; + bool pad_zero = false; + + // parse argument index + if (*format != '0') { + int i = parse_int(format); + if (i != 0) { + if(*format == '$') { + idx = i - 1; + has_indexed = true; + ++format; + } else { + os << std::setw(i); + has_positional = true; + goto parse_precision; + } + } else { + has_positional = true; + } + } else { + has_positional = true; + } + + // Parse format modifiers + while((ch = *format)) { + switch(ch) { + case '-': os << std::left; break; + case '+': os << std::showpos; break; + case '0': pad_zero = true; break; + case ' ': pad_space = true; break; + case '#': os << std::showpoint << std::showbase; break; + default: goto parse_width; + } + ++format; + } + + parse_width: + int width; + if (*format == '*') { + ++format; + width = any_cast(args.at(idx++)); + } else { + width = parse_int(format); + } + os << std::setw(width); + + parse_precision: + if (*format == '.') { + ++format; + if (*format == '*') { + ++format; + precision = any_cast(args.at(idx++)); + } else { + precision = parse_int(format); + } + os << std::setprecision(precision); + } + + // parse (and ignore) the type modifier + switch(*format) { + case 'h': ++format; if(*format == 'h') ++format; break; + case 'l': ++format; if(*format == 'l') ++format; break; + case 'j': + case 'L': + case 'q': + case 't': + case 'z': + ++format; break; + } + + std::size_t truncate = 0; + + // parse the format code + switch(*format++) { + case 'd': case 'i': case 'u': os << std::dec; break; + case 'o': os << std::oct; break; + case 'p': case 'x': os << std::hex; break; + case 'X': os << std::uppercase << std::hex; break; + case 'f': os << std::fixed; break; + case 'e': os << std::scientific; break; + case 'E': os << std::uppercase << std::scientific; break; + case 'g': break; + case 'G': os << std::uppercase; break; + case 'c': case 'C': break; + case 's': case 'S': truncate = precision; os << std::setprecision(6); break; + default: assert(!"Bad format string"); + } + + if (pad_zero && !(os.flags() & std::ios_base::left)) { + os << std::setfill('0') << std::internal; + pad_space = false; + } + + if (truncate != 0 || pad_space) { + // These can't be handled by std::setw. Write to a stringstream and + // pad/truncate manually. + std::ostringstream oss; + oss.copyfmt(os); + oss << args.at(idx++); + std::string data = oss.str(); + + if (pad_space) { + if (data.empty() || (data[0] != '+' && data[0] != '-' && data[0] != ' ')) { + os << ' '; + } + } + if (truncate != 0 && data.size() > truncate) { + data.resize(truncate); + } + os << data; + } else { + os << args.at(idx++); + } + + // we can't have both positional and indexed arguments in + // the format string. + assert(has_positional ^ has_indexed); + + } else { + std::cout << ch; + } + } +} + +int main() { + print("int: %d\n", 10); + print("int: %0#8X\n", 0xA56E); + print("double: %g\n", 3.14159265358979323846); + print("double: %f\n", 3.14159265358979323846); + print("double: %+20.9e\n", 3.14159265358979323846); + print("double: %0+20.9g\n", 3.14159265358979323846); + print("double: %*.*g\n", 20, 5, 3.14159265358979323846); + print("string: %.10s\n", "Hello World!"); + print("double: %2$*.*g int: %1$d\n", 10, 20, 5, 3.14159265358979323846); +} + +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/example/references.cpp b/tools/boost_1_65_1/libs/type_erasure/example/references.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5ba69e5fc242dc3c7294239fb2ff42f0c0cb560 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/example/references.cpp @@ -0,0 +1,142 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +void references1() { + //[references1 + /*` + To capture by reference, we simply add a reference + to the __placeholder. + */ + int i; + any, _self&> x(i); + any_cast(x) = 5; // now i is 5 + /*` + [note `_self` is the default __placeholder, so it is + easiest to use `_self&`. We could use another + __placeholder instead. __any`<`__typeid_`<_a>, _a&>` has + exactly the same behavior.] + */ + //] +} + +void references2() { + //[references2 + /*` + References cannot be rebound. Just like a built-in C++ reference, + once you've initialized it you can't change it to point to + something else. + `` + int i, j; + any, _self&> x(i), y(j); + x = y; // error + `` + + [note As with any other operation, `x = y` for references + acts on `i` and `j`. Assignment like this is legal + if __assignable`<>` is in the Concept, but `x` would + still hold a reference to `i`.] + */ + //] +} + +void references3() { + //[references3 + /*` + A reference can be bound to another __any. + */ + typedef mpl::vector< + copy_constructible<>, + incrementable<> + > requirements; + + any x(10); + any y(x); + ++y; // x is now 11 + //] +} + +void references4() { + //[references4 + /*` + If a reference is used after the underlying object + goes out of scope or is reset, the behavior is undefined. + */ + typedef mpl::vector< + copy_constructible<>, + incrementable<>, + relaxed + > requirements; + any x(10); + any y(x); + x = 1.0; + ++y; // undefined behavior. + //] +} + +void references5() { + typedef mpl::vector< + copy_constructible<>, + incrementable<> + > requirements; + //[references5 + /*` + This only applies when a reference is constructed + from a value. If a reference is constructed from another + reference, the new reference does not depend on the old one. + */ + any x(10); + boost::shared_ptr > p( + new any(x)); + any y(*p); // equivalent to y(x); + p.reset(); + ++y; // okay + //] +} + +void references6() { + //[references6 + /*` + Both const and non-const references are supported. + */ + int i = 0; + any, _self&> x(i); + any, const _self&> y(x); + /*` + A reference to non-const can be converted to a reference + to const, but not the other way around. Naturally, + we can't apply mutating operations to a const reference. + + any, _self&> z(y); // error + ++y; // error + */ + //] +} + +//[references +//` (For the source of the examples in this section see +//` [@boost:/libs/type_erasure/example/references.cpp references.cpp]) +//` [references1] +//` [references2] +//` [references3] +//` [references4] +//` [references5] +//` [references6] +//] diff --git a/tools/boost_1_65_1/libs/type_erasure/index.html b/tools/boost_1_65_1/libs/type_erasure/index.html new file mode 100644 index 0000000000000000000000000000000000000000..319dc65ded7af0b5d8e3f7bf09b7842e20c91d36 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/index.html @@ -0,0 +1,20 @@ + + + + + +Automatic redirection failed, please go to +../../doc/html/boost_typeerasure.html +
+ +Boost.TypeErasure
+
+Copyright (C) 2011 Steven Watanabe
+
+Distributed under the Boost Software License, Version 1.0. (See +accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt)
+
+
+ + diff --git a/tools/boost_1_65_1/libs/type_erasure/meta/libraries.json b/tools/boost_1_65_1/libs/type_erasure/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..024afaa4072047757c7158f52503bdab78f9d9a7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/meta/libraries.json @@ -0,0 +1,14 @@ +{ + "key": "type_erasure", + "name": "Type Erasure", + "authors": [ + "Steven Watanabe" + ], + "description": "Runtime polymorphism based on concepts.", + "category": [ + "Data" + ], + "maintainers": [ + "Steven Watanabe " + ] +} diff --git a/tools/boost_1_65_1/libs/type_erasure/src/dynamic_binding.cpp b/tools/boost_1_65_1/libs/type_erasure/src/dynamic_binding.cpp new file mode 100644 index 0000000000000000000000000000000000000000..77c59093580aca595b4633bb908713e3fbf3a007 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/src/dynamic_binding.cpp @@ -0,0 +1,57 @@ +// Boost.TypeErasure library +// +// Copyright 2015 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#define BOOST_TYPE_ERASURE_SOURCE + +#include +#include +#include +#include +#include + +namespace { + +using ::boost::type_erasure::detail::key_type; +using ::boost::type_erasure::detail::value_type; + +typedef ::std::map map_type; +typedef ::boost::shared_mutex mutex_type; + +// std::pair can have problems on older implementations +// when it tries to use the copy constructor of the mutex. +struct data_type +{ + map_type first; + mutex_type second; +}; + +data_type * get_data() { + static data_type result; + return &result; +} + +} + +BOOST_TYPE_ERASURE_DECL void boost::type_erasure::detail::register_function_impl(const key_type& key, value_type fn) { + ::data_type * data = ::get_data(); + ::boost::unique_lock lock(data->second); + data->first.insert(std::make_pair(key, fn)); +} + +BOOST_TYPE_ERASURE_DECL value_type boost::type_erasure::detail::lookup_function_impl(const key_type& key) { + ::data_type * data = ::get_data(); + ::boost::shared_lock lock(data->second); + ::map_type::const_iterator pos = data->first.find(key); + if(pos != data->first.end()) { + return pos->second; + } else { + throw bad_any_cast(); + } +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/Jamfile.jam b/tools/boost_1_65_1/libs/type_erasure/test/Jamfile.jam new file mode 100644 index 0000000000000000000000000000000000000000..b15ba0d42eb00b6765f3864ec92c63732f110a1e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/Jamfile.jam @@ -0,0 +1,68 @@ +# Boost.TypeErasure library +# +# Copyright 2011 Steven Watanabe +# +# Distributed under the Boost Software License version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import testing ; + +run test_binding.cpp /boost//unit_test_framework ; +run test_increment.cpp /boost//unit_test_framework ; +run test_add.cpp /boost//unit_test_framework ; +run test_add_assign.cpp /boost//unit_test_framework ; +run test_callable.cpp /boost//unit_test_framework ; +run test_reference.cpp /boost//unit_test_framework ; +run test_construct.cpp /boost//unit_test_framework ; +run test_relaxed.cpp /boost//unit_test_framework ; +run test_assign.cpp /boost//unit_test_framework ; +run test_construct_ref.cpp /boost//unit_test_framework ; +run test_construct_cref.cpp /boost//unit_test_framework ; +run test_any_cast.cpp /boost//unit_test_framework ; +run test_binding_of.cpp /boost//unit_test_framework ; +run test_typeid_of.cpp /boost//unit_test_framework ; +run test_nested.cpp /boost//unit_test_framework ; +run test_less.cpp /boost//unit_test_framework ; +run test_equal.cpp /boost//unit_test_framework ; +run test_negate.cpp /boost//unit_test_framework ; +run test_dereference.cpp /boost//unit_test_framework ; +run test_subscript.cpp /boost//unit_test_framework ; +run test_forward_iterator.cpp /boost//unit_test_framework ; +run test_tuple.cpp /boost//unit_test_framework ; +run test_stream.cpp /boost//unit_test_framework ; +run test_deduced.cpp /boost//unit_test_framework ; +run test_same_type.cpp /boost//unit_test_framework ; +run test_member.cpp /boost//unit_test_framework ; +run test_null.cpp /boost//unit_test_framework ; +run test_free.cpp /boost//unit_test_framework ; +run test_is_empty.cpp /boost//unit_test_framework ; +run test_dynamic_any_cast.cpp /boost//unit_test_framework /boost//type_erasure ; + +compile test_param.cpp ; +compile test_is_subconcept.cpp ; + +compile-fail fail_default_construct.cpp ; +compile-fail fail_construct_mismatch.cpp ; +compile-fail fail_construct_mismatch_ref.cpp ; +compile-fail fail_construct_mismatch_cref.cpp ; +compile-fail fail_binding_convert_no_mapping.cpp ; +compile-fail fail_increment_discard_const.cpp ; + +compile-fail fail_ref_assign.cpp ; +compile-fail fail_cref_assign.cpp ; + +compile-fail fail_ref_discard_const.cpp ; +compile-fail fail_ref_discard_const_convert.cpp ; +compile-fail fail_ref_discard_const_convert_ref.cpp ; +compile-fail fail_ref_discard_const_convert_cref.cpp ; +compile-fail fail_ref_discard_const_init.cpp ; + +compile-fail fail_any_cast_discard_const1.cpp ; +compile-fail fail_any_cast_discard_const2.cpp ; +compile-fail fail_any_cast_discard_const3.cpp ; +compile-fail fail_any_cast_discard_const4.cpp ; +compile-fail fail_any_cast_discard_const5.cpp ; +compile-fail fail_any_cast_discard_const6.cpp ; +compile-fail fail_any_cast_pointer_to_ref.cpp ; +compile-fail fail_any_cast_pointer_to_val.cpp ; diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const1.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec8b1803caeeaabbe76b6c5126d6d0ab31893f76 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const1.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + const any< ::boost::mpl::vector, typeid_<> > > y(2); + int i = any_cast(y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const2.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3114ef4663947e268988726a5651364396cfcc7c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const2.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + const any< ::boost::mpl::vector, typeid_<> > > y(2); + int i = *any_cast(&y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const3.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..32bd9cf9cfbc8b2780df130ced23b891383ff496 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const3.cpp @@ -0,0 +1,23 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i = 2; + any< ::boost::mpl::vector, typeid_<> >, const _self&> y(i); + int j = any_cast(y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const4.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a1f89ef6affc1113bc2f12a4e0168bc2d3239e5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const4.cpp @@ -0,0 +1,23 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i = 2; + const any< ::boost::mpl::vector, typeid_<> >, const _self&> y(i); + int j = any_cast(y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const5.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const5.cpp new file mode 100644 index 0000000000000000000000000000000000000000..486e1449af957b5d6b4d4bb5fe699faa73860252 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const5.cpp @@ -0,0 +1,23 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i = 2; + any< ::boost::mpl::vector, typeid_<> >, const _self&> y(i); + int j = *any_cast(&y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const6.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const6.cpp new file mode 100644 index 0000000000000000000000000000000000000000..47424479557eb14a90b53e4ddd101b23e01f6de2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_discard_const6.cpp @@ -0,0 +1,23 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i = 2; + const any< ::boost::mpl::vector, typeid_<> >, const _self&> y(i); + int j = *any_cast(&y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_pointer_to_ref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_pointer_to_ref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2af8da94fafc7a844b1b4ee0e19231eb18d5b7ca --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_pointer_to_ref.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + any< ::boost::mpl::vector, typeid_<> > > y(2); + int i = any_cast(&y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_pointer_to_val.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_pointer_to_val.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f5dd7cc16e4ccd4a276ec24e5471180e2b358bad --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_any_cast_pointer_to_val.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + any< ::boost::mpl::vector, typeid_<> > > y(2); + int i = any_cast(&y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_binding_convert_no_mapping.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_binding_convert_no_mapping.cpp new file mode 100644 index 0000000000000000000000000000000000000000..88d70b6e8fca0c532c2730c6691a75eab6e11c90 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_binding_convert_no_mapping.cpp @@ -0,0 +1,25 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + binding< boost::mpl::vector, typeid_<_b> > > b1( + make_binding, boost::mpl::pair<_b, int> > >()); + binding< typeid_<_a> > b2(b1, make_binding >()); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..847e38380b50f4e22ec40b5238c83eb553b21217 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch.cpp @@ -0,0 +1,21 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; +namespace mpl = boost::mpl; + +int main() +{ + any > x(1, make_binding > >()); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch_cref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch_cref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bda7343e8760ca035cb6cf4ca033f5d22a1a2feb --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch_cref.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; +namespace mpl = boost::mpl; + +int main() +{ + int i; + any, _self&> x(i, make_binding > >()); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch_ref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch_ref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bda7343e8760ca035cb6cf4ca033f5d22a1a2feb --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_construct_mismatch_ref.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; +namespace mpl = boost::mpl; + +int main() +{ + int i; + any, _self&> x(i, make_binding > >()); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_cref_assign.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_cref_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..92898c9096af362cd818251ece1fe1ba1ec4a88e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_cref_assign.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i; + any, const _self&> x(i); + x = x; +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_default_construct.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_default_construct.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8fff301ed612ce8f77ff41bf8c89441b67d9cdad --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_default_construct.cpp @@ -0,0 +1,19 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + any > y; +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_increment_discard_const.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_increment_discard_const.cpp new file mode 100644 index 0000000000000000000000000000000000000000..367967a795c7c9a39d1b86abcf556ca2e87ddd14 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_increment_discard_const.cpp @@ -0,0 +1,21 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + const int i = 0; + any, const _self&> x(i); + ++x; +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_assign.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55fae3339d061214f43d50b8394d9b1ee0c7e032 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_assign.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i; + any, _self&> x(i); + x = x; +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const.cpp new file mode 100644 index 0000000000000000000000000000000000000000..336856cf2a5f54ea11e446f00ee97ddd2c0b0729 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const.cpp @@ -0,0 +1,21 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + const any > x(1); + any, _self&> y(x); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f136a0f21b326ecb9054c2d5746c8c2cce97d945 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert.cpp @@ -0,0 +1,21 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + const any, typeid_<> > > x(1); + any, _self&> y(x); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert_cref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert_cref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..171df660d5c079fdf8f8626accbe0722ec2ba376 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert_cref.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i = 1; + const any, typeid_<> >, const _self&> x(i); + any, _self&> y(x); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert_ref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert_ref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..44c689ebd8d058df75596d739743b9e4ea13f4a2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_convert_ref.cpp @@ -0,0 +1,22 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + int i = 1; + any, typeid_<> >, const _self&> x(i); + any, _self&> y(x); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_init.cpp b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_init.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b190b47dcee0f61f0862664c32f18c9fc3841d9f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/fail_ref_discard_const_init.cpp @@ -0,0 +1,21 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +int main() +{ + const int i = 1; + any, _self&> y(i); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_add.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_add.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3a1dc9c61cf1d995c6a99e6919792e4c4542ec3f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_add.cpp @@ -0,0 +1,118 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + destructible, + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_same) +{ + typedef ::boost::mpl::vector, addable<> > test_concept; + any x(1); + any y(2); + any z(x + y); + int i = any_cast(z); + BOOST_CHECK_EQUAL(i, 3); +} + +BOOST_AUTO_TEST_CASE(test_int1) +{ + typedef ::boost::mpl::vector, addable<_self, int> > test_concept; + any x(1); + any z(x + 2); + int i = any_cast(z); + BOOST_CHECK_EQUAL(i, 3); +} + +BOOST_AUTO_TEST_CASE(test_int2) +{ + typedef ::boost::mpl::vector, addable > test_concept; + any x(1); + any z(2 + x); + int i = any_cast(z); + BOOST_CHECK_EQUAL(i, 3); +} + +BOOST_AUTO_TEST_CASE(test_mixed) +{ + typedef ::boost::mpl::vector, common<_b>, addable<_a, _b> > test_concept; + tuple x(1.0, 2); + any z(get<0>(x) + get<1>(x)); + double d = any_cast(z); + BOOST_CHECK_EQUAL(d, 3); +} + +BOOST_AUTO_TEST_CASE(test_overload) +{ + typedef ::boost::mpl::vector< + common<_a>, + common<_b>, + addable<_a>, + addable<_a, int>, + addable, + addable<_b>, + addable<_b, int>, + addable, + addable<_a, _b> + > test_concept; + tuple t(1.0, 2); + any x(get<0>(t)); + any y(get<1>(t)); + + { + any z(x + x); + BOOST_CHECK_EQUAL(any_cast(z), 2.0); + } + + { + any z(x + 3); + BOOST_CHECK_EQUAL(any_cast(z), 4.0); + } + + { + any z(3 + x); + BOOST_CHECK_EQUAL(any_cast(z), 4.0); + } + + { + any z(y + y); + BOOST_CHECK_EQUAL(any_cast(z), 4); + } + + { + any z(y + 3); + BOOST_CHECK_EQUAL(any_cast(z), 5); + } + + { + any z(3 + y); + BOOST_CHECK_EQUAL(any_cast(z), 5); + } + + { + any z(x + y); + BOOST_CHECK_EQUAL(any_cast(z), 3); + } +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_add_assign.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_add_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ea0b31b8d05019651c111c4fc8b4265ca7f3ee9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_add_assign.cpp @@ -0,0 +1,140 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + destructible, + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_same) +{ + typedef ::boost::mpl::vector, add_assignable<> > test_concept; + any x(1); + any y(2); + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 3); + BOOST_CHECK_EQUAL(&x, &z); +} + +BOOST_AUTO_TEST_CASE(test_int1) +{ + typedef ::boost::mpl::vector, add_assignable<_self, int> > test_concept; + any x(1); + any& z(x += 2); + BOOST_CHECK_EQUAL(any_cast(x), 3); + BOOST_CHECK_EQUAL(&x, &z); +} + +BOOST_AUTO_TEST_CASE(test_int2) +{ + typedef ::boost::mpl::vector, add_assignable > test_concept; + int x = 1; + any y(2); + int& z(x += y); + BOOST_CHECK_EQUAL(x, 3); + BOOST_CHECK_EQUAL(&x, &z); +} + +BOOST_AUTO_TEST_CASE(test_mixed) +{ + typedef ::boost::mpl::vector, common<_b>, add_assignable<_a, _b> > test_concept; + tuple t(1.0, 2); + any x(get<0>(t)); + any y(get<1>(t)); + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 3.0); + BOOST_CHECK_EQUAL(&x, &z); +} + +BOOST_AUTO_TEST_CASE(test_overload) +{ + typedef ::boost::mpl::vector< + common<_a>, + common<_b>, + add_assignable<_a>, + add_assignable<_a, int>, + add_assignable, + add_assignable<_b>, + add_assignable<_b, int>, + add_assignable, + add_assignable<_a, _b> + > test_concept; + tuple t(1.0, 2); + + { + any x(get<0>(t)); + any y(get<0>(t)); + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 2.0); + BOOST_CHECK_EQUAL(&x, &z); + } + + { + any x(get<0>(t)); + int y = 5; + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 6.0); + BOOST_CHECK_EQUAL(&x, &z); + } + + { + double x = 11; + any y(get<0>(t)); + double& z(x += y); + BOOST_CHECK_EQUAL(x, 12); + BOOST_CHECK_EQUAL(&x, &z); + } + + { + any x(get<1>(t)); + any y(get<1>(t)); + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 4); + BOOST_CHECK_EQUAL(&x, &z); + } + + { + any x(get<1>(t)); + int y = 5; + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 7); + BOOST_CHECK_EQUAL(&x, &z); + } + + { + double x = 11; + any y(get<1>(t)); + double& z(x += y); + BOOST_CHECK_EQUAL(x, 13); + BOOST_CHECK_EQUAL(&x, &z); + } + + { + any x(get<0>(t)); + any y(get<1>(t)); + any& z(x += y); + BOOST_CHECK_EQUAL(any_cast(x), 3.0); + BOOST_CHECK_EQUAL(&x, &z); + } +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_any_cast.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_any_cast.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c38428654f9328f77623371c157f9f71f5cd9373 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_any_cast.cpp @@ -0,0 +1,168 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_value_to_value) +{ + typedef ::boost::mpl::vector > test_concept; + any x(2); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + const any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); +} + +BOOST_AUTO_TEST_CASE(test_value_to_ref) +{ + typedef ::boost::mpl::vector > test_concept; + any x(2); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + const any y(x); + // BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_EQUAL(any_cast(y), 2); + // BOOST_CHECK_THROW(any_cast(y), bad_any_cast); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); +} + +BOOST_AUTO_TEST_CASE(test_value_to_pointer) +{ + typedef ::boost::mpl::vector > test_concept; + any x(2); + BOOST_CHECK_EQUAL(*any_cast(&x), 2); + BOOST_CHECK_EQUAL(*any_cast(&x), 2); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&x)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&x)); + BOOST_CHECK_EQUAL(any_cast(&x), (double*)0); + BOOST_CHECK_EQUAL(any_cast(&x), (double*)0); + const any y(x); + // BOOST_CHECK_EQUAL(*any_cast(&y), 2); + BOOST_CHECK_EQUAL(*any_cast(&y), 2); + // BOOST_CHECK_EQUAL(any_cast(&y), any_cast(&y)); + BOOST_CHECK_EQUAL(any_cast(&y), any_cast(&y)); + // BOOST_CHECK_EQUAL(any_cast(&y), (double*)0); + BOOST_CHECK_EQUAL(any_cast(&y), (double*)0); +} + +BOOST_AUTO_TEST_CASE(test_ref_to_value) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 2; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + const any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); +} + +BOOST_AUTO_TEST_CASE(test_ref_to_ref) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 2; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + const any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); +} + +BOOST_AUTO_TEST_CASE(test_ref_to_pointer) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 2; + any x(i); + BOOST_CHECK_EQUAL(*any_cast(&x), 2); + BOOST_CHECK_EQUAL(*any_cast(&x), 2); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&x)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&x)); + BOOST_CHECK_EQUAL(any_cast(&x), (double*)0); + BOOST_CHECK_EQUAL(any_cast(&x), (double*)0); + const any y(x); + BOOST_CHECK_EQUAL(*any_cast(&y), 2); + BOOST_CHECK_EQUAL(*any_cast(&y), 2); + BOOST_CHECK_EQUAL(any_cast(&y), any_cast(&y)); + BOOST_CHECK_EQUAL(any_cast(&y), any_cast(&y)); + BOOST_CHECK_EQUAL(any_cast(&y), (double*)0); + BOOST_CHECK_EQUAL(any_cast(&y), (double*)0); +} + +BOOST_AUTO_TEST_CASE(test_cref_to_value) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 2; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + const any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); +} + +BOOST_AUTO_TEST_CASE(test_cref_to_ref) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 2; + any x(i); + // BOOST_CHECK_EQUAL(any_cast(x), 2); + BOOST_CHECK_EQUAL(any_cast(x), 2); + // BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + BOOST_CHECK_THROW(any_cast(x), bad_any_cast); + const any y(x); + // BOOST_CHECK_EQUAL(any_cast(y), 2); + BOOST_CHECK_EQUAL(any_cast(y), 2); + // BOOST_CHECK_THROW(any_cast(y), bad_any_cast); + BOOST_CHECK_THROW(any_cast(y), bad_any_cast); +} + +BOOST_AUTO_TEST_CASE(test_cref_to_pointer) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 2; + any x(i); + // BOOST_CHECK_EQUAL(*any_cast(&x), 2); + BOOST_CHECK_EQUAL(*any_cast(&x), 2); + // BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&x)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&x)); + // BOOST_CHECK_EQUAL(any_cast(&x), (double*)0); + BOOST_CHECK_EQUAL(any_cast(&x), (double*)0); + const any y(x); + // BOOST_CHECK_EQUAL(*any_cast(&y), 2); + BOOST_CHECK_EQUAL(*any_cast(&y), 2); + // BOOST_CHECK_EQUAL(any_cast(&y), any_cast(&y)); + BOOST_CHECK_EQUAL(any_cast(&y), any_cast(&y)); + // BOOST_CHECK_EQUAL(any_cast(&y), (double*)0); + BOOST_CHECK_EQUAL(any_cast(&y), (double*)0); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_assign.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5196e3b2a9657cdb81a4ce11865b5a08668881bd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_assign.cpp @@ -0,0 +1,197 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef ::boost::mpl::vector, assignable<> > test_concept; + any x(1); + int* ip = any_cast(&x); + any y(2); + x = y; + BOOST_CHECK_EQUAL(any_cast(x), 2); + // make sure that we're actually using assignment + // of the underlying object, not copy and swap. + BOOST_CHECK_EQUAL(any_cast(&x), ip); +} + +BOOST_AUTO_TEST_CASE(test_basic_relaxed) +{ + typedef ::boost::mpl::vector, assignable<>, relaxed > test_concept; + any x(1); + int* ip = any_cast(&x); + any y(2); + x = y; + BOOST_CHECK_EQUAL(any_cast(x), 2); + // make sure that we're actually using assignment + // of the underlying object, not copy and swap. + BOOST_CHECK_EQUAL(any_cast(&x), ip); +} + +BOOST_AUTO_TEST_CASE(test_relaxed_no_copy) +{ + typedef ::boost::mpl::vector< + destructible<>, + typeid_<>, + assignable<>, + relaxed + > test_concept; + any x(1); + int* ip = any_cast(&x); + any y(2); + x = y; + BOOST_CHECK_EQUAL(any_cast(x), 2); + // make sure that we're actually using assignment + // of the underlying object, not copy and swap. + BOOST_CHECK_EQUAL(any_cast(&x), ip); +} + +BOOST_AUTO_TEST_CASE(test_relaxed_no_assign) +{ + typedef ::boost::mpl::vector< + common<>, + relaxed + > test_concept; + any x(1); + any y(2); + x = y; + BOOST_CHECK_EQUAL(any_cast(x), 2); +} + +BOOST_AUTO_TEST_CASE(test_dynamic_fallback) +{ + typedef ::boost::mpl::vector, assignable<>, relaxed> test_concept; + any x(1); + any y(2.0); + x = y; + BOOST_CHECK_EQUAL(any_cast(x), 2.0); +} + +BOOST_AUTO_TEST_CASE(test_dynamic_fail) +{ + typedef ::boost::mpl::vector, typeid_<>, assignable<>, relaxed> test_concept; + any x(1); + any y(2.0); + BOOST_CHECK_THROW(x = y, bad_function_call); +} + +BOOST_AUTO_TEST_CASE(test_basic_int) +{ + typedef ::boost::mpl::vector, assignable<_self, int> > test_concept; + any x(1); + int* ip = any_cast(&x); + x = 2; + BOOST_CHECK_EQUAL(any_cast(x), 2); + // make sure that we're actually using assignment + // of the underlying object, not copy and swap. + BOOST_CHECK_EQUAL(any_cast(&x), ip); +} + +BOOST_AUTO_TEST_CASE(test_basic_relaxed_int) +{ + typedef ::boost::mpl::vector, assignable<_self, int>, relaxed > test_concept; + any x(1); + int* ip = any_cast(&x); + x = 2; + BOOST_CHECK_EQUAL(any_cast(x), 2); + // make sure that we're actually using assignment + // of the underlying object, not copy and swap. + BOOST_CHECK_EQUAL(any_cast(&x), ip); +} + +BOOST_AUTO_TEST_CASE(test_relaxed_no_copy_int) +{ + typedef ::boost::mpl::vector< + destructible<>, + typeid_<>, + assignable<_self, int>, + relaxed + > test_concept; + any x(1); + int* ip = any_cast(&x); + x = 2; + BOOST_CHECK_EQUAL(any_cast(x), 2); + // make sure that we're actually using assignment + // of the underlying object, not copy and swap. + BOOST_CHECK_EQUAL(any_cast(&x), ip); +} + +BOOST_AUTO_TEST_CASE(test_relaxed_no_assign_int) +{ + typedef ::boost::mpl::vector< + common<>, + relaxed + > test_concept; + any x(1); + x = 2; + BOOST_CHECK_EQUAL(any_cast(x), 2); +} + +BOOST_AUTO_TEST_CASE(test_basic_ref) +{ + typedef ::boost::mpl::vector, assignable<> > test_concept; + int i = 1; + any x(i); + any y(2); + x = y; + BOOST_CHECK_EQUAL(i, 2); +} + +BOOST_AUTO_TEST_CASE(test_basic_relaxed_ref) +{ + typedef ::boost::mpl::vector, assignable<>, relaxed > test_concept; + int i = 1; + any x(i); + any y(2); + x = y; + BOOST_CHECK_EQUAL(i, 2); +} + +BOOST_AUTO_TEST_CASE(test_relaxed_no_assign_ref) +{ + typedef ::boost::mpl::vector< + common<>, + relaxed + > test_concept; + int i = 1; + any x(i); + any y(2); + x = y; + BOOST_CHECK_EQUAL(i, 1); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&y)); +} + +BOOST_AUTO_TEST_CASE(test_dynamic_fallback_ref) +{ + typedef ::boost::mpl::vector, assignable<>, relaxed> test_concept; + int i = 1; + any x(i); + any y(2.0); + x = y; + BOOST_CHECK_EQUAL(any_cast(x), 2.0); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_binding.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_binding.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9a731a49cc1cbbcb9cc05523e3d4a56b09703d69 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_binding.cpp @@ -0,0 +1,128 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_empty_binding) +{ + boost::mpl::map<> m1; + binding > b1(m1); + binding > b2(make_binding >()); + BOOST_CHECK(b1 == b2); + BOOST_CHECK(!(b1 != b2)); + + boost::mpl::map > m2; + binding > b3(m2); + BOOST_CHECK(b3 == b1); + BOOST_CHECK(!(b3 != b1)); + binding > b4(make_binding > >()); + BOOST_CHECK(b4 == b1); + BOOST_CHECK(!(b4 != b1)); + + binding > b5(b1, m1); + BOOST_CHECK(b5 == b1); + BOOST_CHECK(!(b5 != b1)); + binding > b6(b1, make_binding >()); + BOOST_CHECK(b6 == b1); + BOOST_CHECK(!(b6 != b1)); + + boost::mpl::map > m3; + binding > b7(b1, m3); + BOOST_CHECK(b7 == b1); + BOOST_CHECK(!(b7 != b1)); + binding > b8(b1, make_binding > >()); + BOOST_CHECK(b8 == b1); + BOOST_CHECK(!(b8 != b1)); +} + +BOOST_AUTO_TEST_CASE(test_binding_one) +{ + boost::mpl::map > m1; + binding > b1(m1); + BOOST_CHECK(b1.find >()() == typeid(int)); + binding > b2(make_binding > >()); + BOOST_CHECK(b2.find >()() == typeid(int)); + BOOST_CHECK(b1 == b2); + BOOST_CHECK(!(b1 != b2)); + + boost::mpl::map > m2; + binding > b3(b1, m2); + BOOST_CHECK(b3.find >()() == typeid(int)); + BOOST_CHECK(b3 == b1); + BOOST_CHECK(!(b3 != b1)); + binding > b4(b1, make_binding > >()); + BOOST_CHECK(b4.find >()() == typeid(int)); + BOOST_CHECK(b4 == b1); + BOOST_CHECK(!(b4 != b1)); + + boost::mpl::map > m3; + binding > b5(b1, m3); + BOOST_CHECK(b5.find >()() == typeid(int)); + binding > b6(b1, make_binding > >()); + BOOST_CHECK(b6.find >()() == typeid(int)); +} + +BOOST_AUTO_TEST_CASE(test_binding_two) +{ + boost::mpl::map, boost::mpl::pair<_b, char> > m1; + binding, typeid_<_b> > > b1(m1); + BOOST_CHECK(b1.find >()() == typeid(int)); + BOOST_CHECK(b1.find >()() == typeid(char)); + binding, typeid_<_b> > > b2( + make_binding, boost::mpl::pair<_b, char> > >()); + BOOST_CHECK(b2.find >()() == typeid(int)); + BOOST_CHECK(b2.find >()() == typeid(char)); + BOOST_CHECK(b1 == b2); + BOOST_CHECK(!(b1 != b2)); + + // select the first + boost::mpl::map > m2; + binding > b3(b1, m2); + BOOST_CHECK(b3.find >()() == typeid(int)); + binding > b4(b1, make_binding > >()); + BOOST_CHECK(b4.find >()() == typeid(int)); + + // select the second + boost::mpl::map > m3; + binding > b5(b1, m3); + BOOST_CHECK(b5.find >()() == typeid(char)); + binding > b6(b1, make_binding > >()); + BOOST_CHECK(b6.find >()() == typeid(char)); + + // rename both + boost::mpl::map, boost::mpl::pair<_d, _b> > m4; + binding, typeid_<_d> > > b7(b1, m4); + BOOST_CHECK(b7.find >()() == typeid(int)); + BOOST_CHECK(b7.find >()() == typeid(char)); + binding, typeid_<_d> > > b8(b1, + make_binding, boost::mpl::pair<_d, _b> > >()); + BOOST_CHECK(b8.find >()() == typeid(int)); + BOOST_CHECK(b8.find >()() == typeid(char)); + + // switch the placeholders + boost::mpl::map, boost::mpl::pair<_b, _a> > m5; + binding, typeid_<_b> > > b9(b1, m5); + BOOST_CHECK(b9.find >()() == typeid(int)); + BOOST_CHECK(b9.find >()() == typeid(char)); + binding, typeid_<_b> > > b10(b1, + make_binding, boost::mpl::pair<_b, _a> > >()); + BOOST_CHECK(b10.find >()() == typeid(int)); + BOOST_CHECK(b10.find >()() == typeid(char)); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_binding_of.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_binding_of.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cfc52105587b30f50ae78babd6ff4834872c21ea --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_binding_of.cpp @@ -0,0 +1,40 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_binding_of) +{ + typedef ::boost::mpl::vector > test_concept; + any x(2); + binding b = binding_of(x); + binding expected( + make_binding< + ::boost::mpl::map< ::boost::mpl::pair<_self, int> > + >()); + BOOST_CHECK(b == expected); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_callable.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_callable.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2a271651dd55cc482d7e0cd09ac39d332fa1c3e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_callable.cpp @@ -0,0 +1,536 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +int f1_val; +void f1() { ++f1_val; } + +int f2_val; +int f2() { return ++f2_val; } + +BOOST_AUTO_TEST_CASE(test_void) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + any x1(&f1); + f1_val = 0; + x1(); + BOOST_CHECK_EQUAL(f1_val, 1); + + any x2(&f2); + f2_val = 0; + x2(); + BOOST_CHECK_EQUAL(f2_val, 1); + + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept_int; + any x3(&f2); + f2_val = 0; + int i = x3(); + BOOST_CHECK_EQUAL(i, 1); + BOOST_CHECK_EQUAL(f2_val, 1); +} + +BOOST_AUTO_TEST_CASE(test_void_const) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + const any x1(&f1); + f1_val = 0; + x1(); + BOOST_CHECK_EQUAL(f1_val, 1); + + const any x2(&f2); + f2_val = 0; + x2(); + BOOST_CHECK_EQUAL(f2_val, 1); + + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept_int; + const any x3(&f2); + f2_val = 0; + int i = x3(); + BOOST_CHECK_EQUAL(i, 1); + BOOST_CHECK_EQUAL(f2_val, 1); +} + +int f3_val; +void f3(int i) { f3_val += i; } + +int f4_val; +int f4(int i) { return f4_val += i; } + +BOOST_AUTO_TEST_CASE(test_int) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + any x1(&f3); + f3_val = 1; + x1(3); + BOOST_CHECK_EQUAL(f3_val, 4); + + any x2(&f4); + f4_val = 1; + x2(2); + BOOST_CHECK_EQUAL(f4_val, 3); + + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept_int; + any x3(&f4); + f4_val = 1; + int i = x3(4); + BOOST_CHECK_EQUAL(i, 5); + BOOST_CHECK_EQUAL(f4_val, 5); +} + +BOOST_AUTO_TEST_CASE(test_int_const) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + const any x1(&f3); + f3_val = 1; + x1(3); + BOOST_CHECK_EQUAL(f3_val, 4); + + const any x2(&f4); + f4_val = 1; + x2(2); + BOOST_CHECK_EQUAL(f4_val, 3); + + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept_int; + const any x3(&f4); + f4_val = 1; + int i = x3(4); + BOOST_CHECK_EQUAL(i, 5); + BOOST_CHECK_EQUAL(f4_val, 5); +} + +BOOST_AUTO_TEST_CASE(test_any) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable + > test_concept; + tuple t1(&f3, 3); + any x1(get<0>(t1)); + f3_val = 1; + x1(get<1>(t1)); + BOOST_CHECK_EQUAL(f3_val, 4); + + tuple t2(&f4, 2); + any x2(get<0>(t2)); + f4_val = 1; + x2(get<1>(t2)); + BOOST_CHECK_EQUAL(f4_val, 3); + + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable<_a(_a)> + > test_concept_int; + tuple t3(&f4, 4); + any x3(get<0>(t3)); + f4_val = 1; + int i = any_cast(x3(get<1>(t3))); + BOOST_CHECK_EQUAL(i, 5); + BOOST_CHECK_EQUAL(f4_val, 5); +} + +BOOST_AUTO_TEST_CASE(test_any_const) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable + > test_concept; + tuple t1(&f3, 3); + const any x1(get<0>(t1)); + f3_val = 1; + x1(get<1>(t1)); + BOOST_CHECK_EQUAL(f3_val, 4); + + tuple t2(&f4, 2); + const any x2(get<0>(t2)); + f4_val = 1; + x2(get<1>(t2)); + BOOST_CHECK_EQUAL(f4_val, 3); + + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable<_a(_a), const _self> + > test_concept_int; + tuple t3(&f4, 4); + const any x3(get<0>(t3)); + f4_val = 1; + int i = any_cast(x3(get<1>(t3))); + BOOST_CHECK_EQUAL(i, 5); + BOOST_CHECK_EQUAL(f4_val, 5); +} + +int overload1; +int overload2; +int overload3; + +struct overloaded_function +{ + int operator()() const { return ++overload1; } + int operator()(int i) const { return overload2 += i; } + int operator()(short i) const { return overload3 += i; } +}; + +BOOST_AUTO_TEST_CASE(test_result_of) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable, + callable, + callable + > test_concept; + + BOOST_MPL_ASSERT((boost::is_same()>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same(int)>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same(any)>::type, long>)); +} + +BOOST_AUTO_TEST_CASE(test_result_of_const) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable, + callable, + callable + > test_concept; + + BOOST_MPL_ASSERT((boost::is_same()>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same(int)>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same(any)>::type, long>)); +} + +BOOST_AUTO_TEST_CASE(test_overload) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable, + callable, + callable + > test_concept; + tuple t(overloaded_function(), static_cast(3)); + any f(get<0>(t)); + any a(get<1>(t)); + + overload1 = 0; + f(); + BOOST_CHECK_EQUAL(overload1, 1); + + overload2 = 0; + f(2); + BOOST_CHECK_EQUAL(overload2, 2); + + overload3 = 0; + f(a); + BOOST_CHECK_EQUAL(overload3, 3); + + BOOST_MPL_ASSERT((boost::is_same()>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same(int)>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same(any)>::type, void>)); +} + +BOOST_AUTO_TEST_CASE(test_overload_return) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable, + callable, + callable + > test_concept; + tuple t(overloaded_function(), static_cast(3)); + any f(get<0>(t)); + any a(get<1>(t)); + + overload1 = 0; + BOOST_CHECK_EQUAL(f(), 1); + BOOST_CHECK_EQUAL(overload1, 1); + + overload2 = 0; + BOOST_CHECK_EQUAL(f(2), 2); + BOOST_CHECK_EQUAL(overload2, 2); + + overload3 = 0; + BOOST_CHECK_EQUAL(f(a), 3); + BOOST_CHECK_EQUAL(overload3, 3); + + //BOOST_MPL_ASSERT((boost::is_same()>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same(int)>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same(any)>::type, int>)); +} + + +BOOST_AUTO_TEST_CASE(test_overload_const) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable, + callable, + callable + > test_concept; + tuple t(overloaded_function(), static_cast(3)); + any f(get<0>(t)); + any a(get<1>(t)); + + overload1 = 0; + f(); + BOOST_CHECK_EQUAL(overload1, 1); + + overload2 = 0; + f(2); + BOOST_CHECK_EQUAL(overload2, 2); + + overload3 = 0; + f(a); + BOOST_CHECK_EQUAL(overload3, 3); + + BOOST_MPL_ASSERT((boost::is_same()>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same(int)>::type, void>)); + BOOST_MPL_ASSERT((boost::is_same(any)>::type, void>)); +} + +BOOST_AUTO_TEST_CASE(test_overload_return_const) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable, + callable, + callable + > test_concept; + tuple t(overloaded_function(), static_cast(3)); + any f(get<0>(t)); + any a(get<1>(t)); + + overload1 = 0; + BOOST_CHECK_EQUAL(f(), 1); + BOOST_CHECK_EQUAL(overload1, 1); + + overload2 = 0; + BOOST_CHECK_EQUAL(f(2), 2); + BOOST_CHECK_EQUAL(overload2, 2); + + overload3 = 0; + BOOST_CHECK_EQUAL(f(a), 3); + BOOST_CHECK_EQUAL(overload3, 3); + + //BOOST_MPL_ASSERT((boost::is_same()>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same(int)>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same(any)>::type, int>)); +} + +struct model_ret_ref +{ + model_ret_ref& operator()() { return *this; } +}; + +BOOST_AUTO_TEST_CASE(test_ref_any_result) +{ + typedef ::boost::mpl::vector< + common<>, + callable<_self&()> + > test_concept; + + any x1 = model_ret_ref(); + any x2(x1()); + BOOST_CHECK_EQUAL(any_cast(&x1), any_cast(&x2)); +} + +int f_ret_ref_val; +int& f_ret_ref() { return f_ret_ref_val; } + +BOOST_AUTO_TEST_CASE(test_ref_int_result) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + + any x1 = f_ret_ref; + int& result = x1(); + BOOST_CHECK_EQUAL(&result, &f_ret_ref_val); +} + +struct model_ret_cref +{ + const model_ret_cref& operator()() { return *this; } +}; + +BOOST_AUTO_TEST_CASE(test_cref_any_result) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + + any x1 = model_ret_ref(); + any x2(x1()); + BOOST_CHECK_EQUAL(any_cast(&x1), any_cast(&x2)); +} + +int f_ret_cref_val; +const int& f_ret_cref() { return f_ret_cref_val; } + +BOOST_AUTO_TEST_CASE(test_cref_int_result) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + + any x1 = f_ret_cref; + const int& result = x1(); + BOOST_CHECK_EQUAL(&result, &f_ret_cref_val); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +int f_rv_value = 0; +void f_rv(int&& i) { f_rv_value += i; } + +BOOST_AUTO_TEST_CASE(test_rvalue_int) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + any f(&f_rv); + + f_rv_value = 1; + f(2); + BOOST_CHECK_EQUAL(f_rv_value, 3); +} + +BOOST_AUTO_TEST_CASE(test_rvalue_any) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable + > test_concept; + + tuple t1(&f_rv, 3); + any x1(get<0>(t1)); + f_rv_value = 1; + x1(std::move(get<1>(t1))); + BOOST_CHECK_EQUAL(f_rv_value, 4); +} + +BOOST_AUTO_TEST_CASE(test_const_rvalue_int) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + const any f(&f_rv); + + f_rv_value = 1; + f(2); + BOOST_CHECK_EQUAL(f_rv_value, 3); +} + +BOOST_AUTO_TEST_CASE(test_const_rvalue_any) +{ + typedef ::boost::mpl::vector< + common<>, + common<_a>, + callable + > test_concept; + + tuple t1(&f_rv, 3); + const any x1(get<0>(t1)); + f_rv_value = 1; + x1(std::move(get<1>(t1))); + BOOST_CHECK_EQUAL(f_rv_value, 4); +} + +struct model_ret_rref +{ + model_ret_rref&& operator()() { return std::move(*this); } +}; + +BOOST_AUTO_TEST_CASE(test_rvalue_any_result) +{ + typedef ::boost::mpl::vector< + common<>, + callable<_self&&()> + > test_concept; + + any x1 = model_ret_rref(); + any x2(x1()); + BOOST_CHECK_EQUAL(any_cast(&x1), any_cast(&x2)); +} + +int f_ret_rv_val; +int&& f_ret_rv() { return std::move(f_ret_rv_val); } + +BOOST_AUTO_TEST_CASE(test_rvalue_int_result) +{ + typedef ::boost::mpl::vector< + common<>, + callable + > test_concept; + + any x1 = f_ret_rv; + int&& result = x1(); + BOOST_CHECK_EQUAL(&result, &f_ret_rv_val); +} + +#endif diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_construct.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_construct.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8b352b145a510e83f0455b7f87db6331fd246d15 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_construct.cpp @@ -0,0 +1,1152 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_implicit) { + any > x = 1; + BOOST_CHECK_EQUAL(any_cast(x), 1); +} + +void func() {} + +BOOST_AUTO_TEST_CASE(test_decay) { + char array[] = "Hello World!"; + const char carray[] = "Hello World!"; + + any > x1(array); + any > y1(func); + any > z1(carray); + BOOST_CHECK_EQUAL(any_cast(x1), &array[0]); + BOOST_CHECK(any_cast(y1) == &func); + BOOST_CHECK_EQUAL(any_cast(z1), &carray[0]); + + any > x2(array, make_binding > >()); + any > y2(func, make_binding > >()); + any > z2(carray, make_binding > >()); + BOOST_CHECK_EQUAL(any_cast(x2), &array[0]); + BOOST_CHECK(any_cast(y2) == &func); + BOOST_CHECK_EQUAL(any_cast(z2), &carray[0]); + + static_binding > > bx3; + static_binding > > by3; + static_binding > > bz3; + any > x3(array, bx3); + any > y3(func, by3); + any > z3(carray, bz3); + BOOST_CHECK_EQUAL(any_cast(x3), &array[0]); + BOOST_CHECK(any_cast(y3) == &func); + BOOST_CHECK_EQUAL(any_cast(z3), &carray[0]); +} + +enum { + lvalue, + const_lvalue, + rvalue +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + = lvalue +#endif +}; + +template +int make_arg_type(); + +template<> +int make_arg_type() { return rvalue; } +template<> +int make_arg_type() { return lvalue; } +template<> +int make_arg_type() { return const_lvalue; } + +enum { id_int = 4, id_copy = 8 }; + +std::vector make_vector() { return std::vector(); } + +template +std::vector make_vector(T t0) { + std::vector result; + result.push_back(t0); + return result; +} +template +std::vector make_vector(T t0, T t1) { + std::vector result; + result.push_back(t0); + result.push_back(t1); + return result; +} + +struct test_class +{ + + test_class() {} + + test_class(const test_class &) + : args(make_vector(const_lvalue | id_copy)) + {} + + test_class(test_class &) + : args(make_vector(lvalue | id_copy)) + {} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + + test_class(test_class &&) + : args(make_vector(rvalue | id_copy)) + {} + + template + test_class(T0&& t0) + : args(make_vector(t0 | make_arg_type())) + {} + + template + test_class(T0&& t0, T1&& t1) + : args(make_vector(t0 | make_arg_type(), t1 | make_arg_type())) + {} + +#else + + test_class(int& i0) + : args(make_vector(i0 | lvalue)) + {} + test_class(const int& i0) + : args(make_vector(i0 | const_lvalue)) + {} + test_class(int& i0, int& i1) + : args(make_vector(i0 | lvalue, i1 | lvalue)) + {} + test_class(int& i0, const int& i1) + : args(make_vector(i0 | lvalue, i1 | const_lvalue)) + {} + test_class(const int& i0, int& i1) + : args(make_vector(i0 | const_lvalue, i1 | lvalue)) + {} + test_class(const int& i0, const int& i1) + : args(make_vector(i0 | const_lvalue, i1 | const_lvalue)) + {} + +#endif + std::vector args; +}; + +template +struct make_arg_impl; + +template<> +struct make_arg_impl +{ + static int apply() + { + return id_int; + } +}; + +template +struct make_arg_impl > +{ + static binding apply() + { + return make_binding< ::boost::mpl::map< + ::boost::mpl::pair<_a, test_class>, + ::boost::mpl::pair<_b, int> + > >(); + } +}; + +template +struct make_arg_impl > +{ + static any apply() + { + return any( + test_class(), + make_binding< ::boost::mpl::map< + ::boost::mpl::pair<_a, test_class>, + ::boost::mpl::pair<_b, int> + > >()); + } +}; + +template +struct make_arg_impl > +{ + static any apply() + { + return any( + (int)id_int, + make_binding< ::boost::mpl::map< + ::boost::mpl::pair<_a, test_class>, + ::boost::mpl::pair<_b, int> + > >()); + } +}; + +template +struct make_arg_impl > +{ + static any apply() + { + return make_arg_impl&>::apply(); + } +}; + +template +struct make_arg_impl > +{ + static any apply() + { + return make_arg_impl&>::apply(); + } +}; + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +template +struct make_arg_impl > +{ + static any apply() + { + return std::move(make_arg_impl&>::apply()); + } +}; + +#endif + +template +struct make_arg_impl : make_arg_impl {}; + +template +struct make_arg_impl +{ + static T& apply() + { + static T result = make_arg_impl::apply(); + return result; + } +}; + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +template +struct make_arg_impl +{ + static T&& apply() + { + static T result = make_arg_impl::apply(); + return std::move(result); + } +}; + +#endif + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + +template +T make_arg() +{ + return make_arg_impl::apply(); +} + +#else + +template +T&& make_arg() +{ + return make_arg_impl::apply(); +} + +#endif + +int get_value(int i) { return i; } +template +int get_value(const T& t) { return any_cast(t); } + +template +struct tester; + +template +struct tester +{ + static std::vector apply() + { + any x(make_arg()); + const test_class& result = any_cast(x); + return result.args; + } +}; + +template +struct tester +{ + static std::vector apply() + { + any x(make_arg(), make_arg()); + const test_class& result = any_cast(x); + return result.args; + } +}; + +template +struct tester +{ + static std::vector apply() + { + any x(make_arg(), make_arg(), make_arg()); + const test_class& result = any_cast(x); + return result.args; + } +}; + +#define TEST_CONSTRUCT(sig, args, expected_) \ +{\ + typedef ::boost::mpl::vector<\ + common<_a>, \ + common<_b>,\ + constructible\ + > C;\ + std::vector result = tester::apply();\ + std::vector expected = make_vector expected_;\ + BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), \ + expected.begin(), expected.end());\ +} + +BOOST_AUTO_TEST_CASE(test_default) +{ + TEST_CONSTRUCT(_a(), (binding), ()); + TEST_CONSTRUCT(_a(), (binding&), ()); + TEST_CONSTRUCT(_a(), (const binding&), ()); +} + +// test all forms of direct construction that take 1 argument +BOOST_AUTO_TEST_CASE(test_construct1) +{ + // construction from int + TEST_CONSTRUCT(_a(int&), (binding, int&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(int&), (binding&, int&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(int&), (const binding&, int&), (lvalue | id_int)); + + TEST_CONSTRUCT(_a(const int&), (binding, int), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (binding, int&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (binding, const int&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (binding&, int), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (binding&, int&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (binding&, const int&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (const binding&, int), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (const binding&, int&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const int&), (const binding&, const int&), (const_lvalue | id_int)); + + TEST_CONSTRUCT(_a(int), (binding, int), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (binding, int&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (binding, const int&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (binding&, int), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (binding&, int&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (binding&, const int&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (const binding&, int), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (const binding&, int&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int), (const binding&, const int&), (rvalue | id_int)); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + TEST_CONSTRUCT(_a(int&&), (binding, int), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int&&), (binding&, int), (rvalue | id_int)); + TEST_CONSTRUCT(_a(int&&), (const binding&, int), (rvalue | id_int)); +#endif + + // Test same any type + +#ifndef BOOST_NO_FUNCTION_REFERENCE_QUALIFIERS + // ambiguous with the copy constructor in C++03 + TEST_CONSTRUCT(_a(_a&), (any&), (lvalue | id_copy)); + TEST_CONSTRUCT(_a(_a&), (binding, any&), (lvalue | id_copy)); + TEST_CONSTRUCT(_a(_a&), (binding&, any&), (lvalue | id_copy)); + TEST_CONSTRUCT(_a(_a&), (const binding&, any&), (lvalue | id_copy)); +#endif + + TEST_CONSTRUCT(_a(const _a&), (any), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (const any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (binding, any), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (binding, any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (binding, const any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (binding&, any), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (binding&, any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (binding&, const any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (const binding&, any), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (const binding&, any&), (const_lvalue | id_copy)); + TEST_CONSTRUCT(_a(const _a&), (const binding&, const any&), (const_lvalue | id_copy)); + +#ifndef BOOST_NO_FUNCTION_REFERENCE_QUALIFIERS + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + TEST_CONSTRUCT(_a(_a&&), (any), (rvalue | id_copy)); + TEST_CONSTRUCT(_a(_a&&), (binding, any), (rvalue | id_copy)); + TEST_CONSTRUCT(_a(_a&&), (binding&, any), (rvalue | id_copy)); + TEST_CONSTRUCT(_a(_a&&), (const binding&, any), (rvalue | id_copy)); +#endif + +#endif + + // test other any type + TEST_CONSTRUCT(_a(_b&), (any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding, any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding&, any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (const binding&, any&), (lvalue | id_int)); + + TEST_CONSTRUCT(_a(const _b&), (any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, const any&), (const_lvalue | id_int)); + + TEST_CONSTRUCT(_a(_b), (any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, const any&), (rvalue | id_int)); + +#ifndef BOOST_NO_FUNCTION_REFERENCE_QUALIFIERS + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + TEST_CONSTRUCT(_a(_b&&), (any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (const binding&, any), (rvalue | id_int)); +#endif + +#endif + + // test any reference type + TEST_CONSTRUCT(_a(_b&), (any), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (const any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding, any), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding, any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding, const any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding&, any), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding&, any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (binding&, const any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (const binding&, any), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (const binding&, any&), (lvalue | id_int)); + TEST_CONSTRUCT(_a(_b&), (const binding&, const any&), (lvalue | id_int)); + + TEST_CONSTRUCT(_a(const _b&), (any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, const any&), (const_lvalue | id_int)); + + TEST_CONSTRUCT(_a(_b), (any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, const any&), (rvalue | id_int)); + + // test const any reference type + TEST_CONSTRUCT(_a(const _b&), (any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, const any&), (const_lvalue | id_int)); + + TEST_CONSTRUCT(_a(_b), (any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, const any&), (rvalue | id_int)); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + + // test any rvalue reference type + TEST_CONSTRUCT(_a(const _b&), (any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (binding&, const any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, any&), (const_lvalue | id_int)); + TEST_CONSTRUCT(_a(const _b&), (const binding&, const any&), (const_lvalue | id_int)); + + TEST_CONSTRUCT(_a(_b), (any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (binding&, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b), (const binding&, const any&), (rvalue | id_int)); + + TEST_CONSTRUCT(_a(_b&&), (any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (binding&, const any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (const binding&, any), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (const binding&, any&), (rvalue | id_int)); + TEST_CONSTRUCT(_a(_b&&), (const binding&, const any&), (rvalue | id_int)); + +#endif + +} + +// test constructors with 2 parameters +BOOST_AUTO_TEST_CASE(test_construct2) +{ + TEST_CONSTRUCT(_a(int, int), (binding, int, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, int, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, int, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, int&, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, int&, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, int&, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, const int&, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, const int&, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding, const int&, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, int, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, int, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, int, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, int&, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, int&, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, int&, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, const int&, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, const int&, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (binding&, const int&, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, int, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, int, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, int, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, int&, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, int&, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, int&, const int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, const int&, int), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, const int&, int&), (rvalue | id_int, rvalue | id_int)); + TEST_CONSTRUCT(_a(int, int), (const binding&, const int&, const int&), (rvalue | id_int, rvalue | id_int)); +} + +BOOST_AUTO_TEST_CASE(test_overload) +{ + typedef ::boost::mpl::vector< + common<_a>, + common<_b>, + constructible<_a(_b)>, + constructible<_a(std::size_t)> + > test_concept; + typedef ::boost::mpl::map< + ::boost::mpl::pair<_a, std::vector >, + ::boost::mpl::pair<_b, std::size_t> + > types; + binding table = make_binding(); + any x(static_cast(10), make_binding()); + any y(x); + any z(table, 17); + std::vector vec1(any_cast >(y)); + BOOST_CHECK_EQUAL(vec1.size(), 10u); + std::vector vec2(any_cast >(z)); + BOOST_CHECK_EQUAL(vec2.size(), 17u); +} + +template +T as_rvalue(const T& arg) { return arg; } +template +const T& as_const(const T& arg) { return arg; } + +BOOST_AUTO_TEST_CASE(test_from_int_with_binding) +{ + typedef ::boost::mpl::vector > test_concept; + static_binding > > binding = + make_binding > >(); + int value = 4; + + any x1(value, binding); + BOOST_CHECK_EQUAL(any_cast(x1), 4); + any x2(value, as_rvalue(binding)); + BOOST_CHECK_EQUAL(any_cast(x2), 4); + any x3(value, as_const(binding)); + BOOST_CHECK_EQUAL(any_cast(x3), 4); + + any y1(as_rvalue(value), binding); + BOOST_CHECK_EQUAL(any_cast(y1), 4); + any y2(as_rvalue(value), as_rvalue(binding)); + BOOST_CHECK_EQUAL(any_cast(y2), 4); + any y3(as_rvalue(value), as_const(binding)); + BOOST_CHECK_EQUAL(any_cast(y3), 4); + + any z1(as_const(value), binding); + BOOST_CHECK_EQUAL(any_cast(z1), 4); + any z2(as_const(value), as_rvalue(binding)); + BOOST_CHECK_EQUAL(any_cast(z2), 4); + any z3(as_const(value), as_const(binding)); + BOOST_CHECK_EQUAL(any_cast(z3), 4); +} + +BOOST_AUTO_TEST_CASE(test_copy) +{ + typedef ::boost::mpl::vector > test_concept; + any x(4); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z(as_rvalue(x)); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w(as_const(x)); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_copy_implicit) +{ + typedef ::boost::mpl::vector, common<_a> > test_concept; + any x(4, make_binding< ::boost::mpl::map< ::boost::mpl::pair<_self, int>, ::boost::mpl::pair<_a, int> > >()); + BOOST_CHECK_EQUAL(any_cast(x), 4); + + any y = x; + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_convert) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y = x; + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + static_binding s_table(make_binding()); + binding table(make_binding()); + + any x(4); + BOOST_CHECK_EQUAL(any_cast(x), 4); + + // lvalues + any y1(x, s_table); + BOOST_CHECK_EQUAL(any_cast(y1), 4); + any y2(x, as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(y2), 4); + any y3(x, as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(y3), 4); + any z1(x, table); + BOOST_CHECK_EQUAL(any_cast(z1), 4); + any z2(x, as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(z2), 4); + any z3(x, as_const(table)); + BOOST_CHECK_EQUAL(any_cast(z3), 4); + + // rvalues + any ry1(as_rvalue(x), s_table); + BOOST_CHECK_EQUAL(any_cast(ry1), 4); + any ry2(as_rvalue(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry2), 4); + any ry3(as_rvalue(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry3), 4); + any rz1(as_rvalue(x), table); + BOOST_CHECK_EQUAL(any_cast(rz1), 4); + any rz2(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz2), 4); + any rz3(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz3), 4); + + // const lvalues + any cy1(as_const(x), s_table); + BOOST_CHECK_EQUAL(any_cast(cy1), 4); + any cy2(as_const(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy2), 4); + any cy3(as_const(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy3), 4); + any cz1(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(cz1), 4); + any cz2(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz2), 4); + any cz3(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz3), 4); +} + +BOOST_AUTO_TEST_CASE(test_copy_from_ref) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_convert_from_ref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_from_ref) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_from_ref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding_from_ref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + static_binding s_table(make_binding()); + binding table(make_binding()); + + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + + // lvalues + any y1(x, s_table); + BOOST_CHECK_EQUAL(any_cast(y1), 4); + any y2(x, as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(y2), 4); + any y3(x, as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(y3), 4); + any z1(x, table); + BOOST_CHECK_EQUAL(any_cast(z1), 4); + any z2(x, as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(z2), 4); + any z3(x, as_const(table)); + BOOST_CHECK_EQUAL(any_cast(z3), 4); + + // rvalues + any ry1(as_rvalue(x), s_table); + BOOST_CHECK_EQUAL(any_cast(ry1), 4); + any ry2(as_rvalue(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry2), 4); + any ry3(as_rvalue(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry3), 4); + any rz1(as_rvalue(x), table); + BOOST_CHECK_EQUAL(any_cast(rz1), 4); + any rz2(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz2), 4); + any rz3(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz3), 4); + + // const lvalues + any cy1(as_const(x), s_table); + BOOST_CHECK_EQUAL(any_cast(cy1), 4); + any cy2(as_const(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy2), 4); + any cy3(as_const(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy3), 4); + any cz1(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(cz1), 4); + any cz2(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz2), 4); + any cz3(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz3), 4); +} + +BOOST_AUTO_TEST_CASE(test_copy_from_cref) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_convert_from_cref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_from_cref) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_from_cref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding_from_cref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + static_binding s_table(make_binding()); + binding table(make_binding()); + + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(x), 4); + + // lvalues + any y1(x, s_table); + BOOST_CHECK_EQUAL(any_cast(y1), 4); + any y2(x, as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(y2), 4); + any y3(x, as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(y3), 4); + any z1(x, table); + BOOST_CHECK_EQUAL(any_cast(z1), 4); + any z2(x, as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(z2), 4); + any z3(x, as_const(table)); + BOOST_CHECK_EQUAL(any_cast(z3), 4); + + // rvalues + any ry1(as_rvalue(x), s_table); + BOOST_CHECK_EQUAL(any_cast(ry1), 4); + any ry2(as_rvalue(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry2), 4); + any ry3(as_rvalue(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry3), 4); + any rz1(as_rvalue(x), table); + BOOST_CHECK_EQUAL(any_cast(rz1), 4); + any rz2(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz2), 4); + any rz3(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz3), 4); + + // const lvalues + any cy1(as_const(x), s_table); + BOOST_CHECK_EQUAL(any_cast(cy1), 4); + any cy2(as_const(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy2), 4); + any cy3(as_const(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy3), 4); + any cz1(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(cz1), 4); + any cz2(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz2), 4); + any cz3(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz3), 4); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +struct move_only +{ + explicit move_only(int i) : value(i) {} + move_only(move_only&& other) : value(other.value) { other.value = 0; } + int value; +private: + move_only(const move_only&); +}; + +BOOST_AUTO_TEST_CASE(test_move_only) +{ + typedef ::boost::mpl::vector, typeid_<> > test_concept; + move_only source(2); + any x(std::move(source)); + BOOST_CHECK_EQUAL(source.value, 0); + BOOST_CHECK_EQUAL(any_cast(x).value, 2); +} + +BOOST_AUTO_TEST_CASE(test_copy_from_rref) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(std::move(i)); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_convert_from_rref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(std::move(i)); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_from_rref) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(std::move(i)); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_from_rref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(std::move(i)); + BOOST_CHECK_EQUAL(any_cast(x), 4); + any y(x); + BOOST_CHECK_EQUAL(any_cast(y), 4); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(z), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(w), 4); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding_from_rref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + static_binding s_table(make_binding()); + binding table(make_binding()); + + int i = 4; + any x(std::move(i)); + BOOST_CHECK_EQUAL(any_cast(x), 4); + + // lvalues + any y1(x, s_table); + BOOST_CHECK_EQUAL(any_cast(y1), 4); + any y2(x, as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(y2), 4); + any y3(x, as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(y3), 4); + any z1(x, table); + BOOST_CHECK_EQUAL(any_cast(z1), 4); + any z2(x, as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(z2), 4); + any z3(x, as_const(table)); + BOOST_CHECK_EQUAL(any_cast(z3), 4); + + // rvalues + any ry1(as_rvalue(x), s_table); + BOOST_CHECK_EQUAL(any_cast(ry1), 4); + any ry2(as_rvalue(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry2), 4); + any ry3(as_rvalue(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(ry3), 4); + any rz1(as_rvalue(x), table); + BOOST_CHECK_EQUAL(any_cast(rz1), 4); + any rz2(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz2), 4); + any rz3(as_rvalue(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(rz3), 4); + + // const lvalues + any cy1(as_const(x), s_table); + BOOST_CHECK_EQUAL(any_cast(cy1), 4); + any cy2(as_const(x), as_rvalue(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy2), 4); + any cy3(as_const(x), as_const(s_table)); + BOOST_CHECK_EQUAL(any_cast(cy3), 4); + any cz1(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(cz1), 4); + any cz2(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz2), 4); + any cz3(as_const(x), as_rvalue(table)); + BOOST_CHECK_EQUAL(any_cast(cz3), 4); +} + +#endif diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_construct_cref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_construct_cref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2e428a719889a3366b9205a4bbb51671e3d8b89 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_construct_cref.cpp @@ -0,0 +1,283 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +template +T as_rvalue(const T& arg) { return arg; } +template +const T& as_const(const T& arg) { return arg; } + +BOOST_AUTO_TEST_CASE(test_implicit) { + int i = 4; + any, const _self&> x = i; + BOOST_CHECK_EQUAL(any_cast(&x), &i); +} + +BOOST_AUTO_TEST_CASE(test_from_int_with_binding) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i, make_binding > >()); + BOOST_CHECK_EQUAL(any_cast(&x), &i); +} + +BOOST_AUTO_TEST_CASE(test_copy) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_convert) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + binding table(make_binding()); + + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x, make_binding()); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z(x, table); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + + any cy(as_const(x), make_binding()); + BOOST_CHECK_EQUAL(any_cast(&cy), &i); + any cz(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(&cz), &i); +} + +BOOST_AUTO_TEST_CASE(test_copy_from_ref) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_convert_from_ref) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_from_ref) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_from_ref) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding_from_ref) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + binding table(make_binding()); + + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x, make_binding()); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z(x, table); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + + any cy(as_const(x), make_binding()); + BOOST_CHECK_EQUAL(any_cast(&cy), &i); + any cz(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(&cz), &i); +} + +BOOST_AUTO_TEST_CASE(test_copy_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > test_concept; + any x(4); + const int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); + BOOST_CHECK_EQUAL(any_cast(any(as_rvalue(x))), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), ip); +} + +BOOST_AUTO_TEST_CASE(test_convert_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + const int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); + BOOST_CHECK_EQUAL(any_cast(any(as_rvalue(x))), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), ip); +} + +BOOST_AUTO_TEST_CASE(test_rebind_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector, typeid_<_a> > dst_concept; + any x(4); + const int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); + BOOST_CHECK_EQUAL(any_cast(any(as_rvalue(x))), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), ip); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + const int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); + BOOST_CHECK_EQUAL(any_cast(any(as_rvalue(x))), 4); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), ip); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding_from_value) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + binding table(make_binding()); + + any x(4); + const int* ip = any_cast(&x); + any y(x, make_binding()); + BOOST_CHECK_EQUAL(any_cast(&y), ip); + any z(x, table); + BOOST_CHECK_EQUAL(any_cast(&z), ip); + + any cy(as_const(x), make_binding()); + BOOST_CHECK_EQUAL(any_cast(&cy), ip); + any cz(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(&cz), ip); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_construct_ref.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_construct_ref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ad2d6e46f7615c4824342cb4b10c7e6135e1b6ba --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_construct_ref.cpp @@ -0,0 +1,184 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +template +T as_rvalue(const T& arg) { return arg; } +template +const T& as_const(const T& arg) { return arg; } + +BOOST_AUTO_TEST_CASE(test_implicit) { + int i = 4; + any, _self&> x = i; + BOOST_CHECK_EQUAL(any_cast(&x), &i); +} + +BOOST_AUTO_TEST_CASE(test_from_int_with_binding) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i, make_binding > >()); + BOOST_CHECK_EQUAL(any_cast(&x), &i); +} + +BOOST_AUTO_TEST_CASE(test_copy) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_convert) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind) +{ + typedef ::boost::mpl::vector > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z = as_rvalue(x); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + any w = as_const(x); + BOOST_CHECK_EQUAL(any_cast(&w), &i); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + binding table(make_binding()); + + int i = 4; + any x(i); + BOOST_CHECK_EQUAL(any_cast(&x), &i); + any y(x, make_binding()); + BOOST_CHECK_EQUAL(any_cast(&y), &i); + any z(x, table); + BOOST_CHECK_EQUAL(any_cast(&z), &i); + + any cy(as_const(x), make_binding()); + BOOST_CHECK_EQUAL(any_cast(&cy), &i); + any cz(as_const(x), table); + BOOST_CHECK_EQUAL(any_cast(&cz), &i); +} + +BOOST_AUTO_TEST_CASE(test_copy_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > test_concept; + any x(4); + int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); +} + +BOOST_AUTO_TEST_CASE(test_convert_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); +} + +BOOST_AUTO_TEST_CASE(test_rebind_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector, typeid_<_a> > dst_concept; + any x(4); + int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_from_value) +{ + typedef ::boost::mpl::vector, typeid_<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + any x(4); + int* ip = any_cast(&x); + any y(x); + BOOST_CHECK_EQUAL(any_cast(&y), ip); +} + +BOOST_AUTO_TEST_CASE(test_rebind_and_convert_with_binding_from_value) +{ + typedef ::boost::mpl::vector, incrementable<> > src_concept; + typedef ::boost::mpl::vector > dst_concept; + typedef ::boost::mpl::map > map; + typedef ::boost::mpl::map > types; + + binding table(make_binding()); + + any x(4); + int* ip = any_cast(&x); + any y(x, make_binding()); + BOOST_CHECK_EQUAL(any_cast(&y), ip); + any z(x, table); + BOOST_CHECK_EQUAL(any_cast(&z), ip); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_deduced.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_deduced.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7e019cd4e35c1efd78b6fbc70db195ed1abefa1b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_deduced.cpp @@ -0,0 +1,51 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_deduce_dereference) +{ + typedef ::boost::mpl::vector< + copy_constructible<>, + typeid_ >::type>, + dereferenceable >&> + > test_concept; + int i; + any x(&i); + any >&> y(*x); + BOOST_CHECK_EQUAL(&any_cast(y), &i); +} + +BOOST_MPL_ASSERT(( + boost::is_same< + deduced >::type, + deduced > >)); + +BOOST_MPL_ASSERT(( + boost::is_same >::type, int >)); diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_dereference.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_dereference.cpp new file mode 100644 index 0000000000000000000000000000000000000000..92ed1c87d68683455e1e66eaf8067b82caabc61d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_dereference.cpp @@ -0,0 +1,60 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef ::boost::mpl::vector, dereferenceable > test_concept; + int i; + any x(&i); + BOOST_CHECK_EQUAL(&*x, &i); +} + +BOOST_AUTO_TEST_CASE(test_any_result) +{ + typedef ::boost::mpl::vector, common<_a>, dereferenceable<_a&> > test_concept; + typedef ::boost::mpl::map< + ::boost::mpl::pair<_self, int*>, + ::boost::mpl::pair<_a, int> + > types; + int i; + any x(&i, make_binding()); + any y(*x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); +} + +BOOST_AUTO_TEST_CASE(test_any_result_const) +{ + typedef ::boost::mpl::vector, common<_a>, dereferenceable > test_concept; + typedef ::boost::mpl::map< + ::boost::mpl::pair<_self, const int*>, + ::boost::mpl::pair<_a, int> + > types; + const int i = 0; + any x(&i, make_binding()); + any y(*x); + BOOST_CHECK_EQUAL(any_cast(&y), &i); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_dynamic_any_cast.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_dynamic_any_cast.cpp new file mode 100644 index 0000000000000000000000000000000000000000..42842dc1e0f025342b9cd6a4511cc564d6ddcce7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_dynamic_any_cast.cpp @@ -0,0 +1,265 @@ +// Boost.TypeErasure library +// +// Copyright 2015 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +struct fixture +{ + fixture() + { + register_binding, int>(); + register_binding, int>(); + register_binding >(make_binding, boost::mpl::pair<_a, int> > >()); + } +}; + +BOOST_GLOBAL_FIXTURE(fixture); + +BOOST_AUTO_TEST_CASE(test_identical) +{ + any > x(1); + any > y = dynamic_any_cast > >(x); + BOOST_CHECK_EQUAL(any_cast(y), 1); +} + +BOOST_AUTO_TEST_CASE(test_downcast) +{ + any > x(1); + typedef any< ::boost::mpl::vector, incrementable<> > > incrementable_any; + incrementable_any y = dynamic_any_cast(x); + ++y; + BOOST_CHECK_EQUAL(any_cast(y), 2); +} + +BOOST_AUTO_TEST_CASE(test_cross_cast) +{ + any< ::boost::mpl::vector, decrementable<> > > x(1); + typedef any< ::boost::mpl::vector, incrementable<> > > incrementable_any; + incrementable_any y = dynamic_any_cast(x); + ++y; + BOOST_CHECK_EQUAL(any_cast(y), 2); +} + +BOOST_AUTO_TEST_CASE(test_cast_placeholder) +{ + any > x(1); + typedef any< ::boost::mpl::vector, incrementable<_a> >, _a> incrementable_any; + incrementable_any y = dynamic_any_cast(x); + ++y; + BOOST_CHECK_EQUAL(any_cast(y), 2); +} + +BOOST_AUTO_TEST_CASE(test_throw) +{ + any > x("42"); + typedef any< ::boost::mpl::vector, incrementable<_a> >, _a> incrementable_any; + BOOST_CHECK_THROW(dynamic_any_cast(x), bad_any_cast); +} + +// make sure that a function registered with _self can +// be found with _a. +BOOST_AUTO_TEST_CASE(test_other_placeholder) +{ + any, _a> x(1); + typedef any< ::boost::mpl::vector, incrementable<_a> >, _a> incrementable_any; + incrementable_any y = dynamic_any_cast(x); + ++y; + BOOST_CHECK_EQUAL(any_cast(y), 2); +} + +// Casting to a value only requires the target to provide +// a copy constructor. +BOOST_AUTO_TEST_CASE(test_add_copy) +{ + any< ::boost::mpl::vector, typeid_<> > > x(1); + any > y = dynamic_any_cast > >(x); + BOOST_CHECK_EQUAL(any_cast(y), 1); +} + +template +struct choose_second +{ + typedef U type; +}; + +BOOST_AUTO_TEST_CASE(test_deduced) +{ + typedef deduced > _p2; + any< ::boost::mpl::vector, common<_p2> > > x(1); + typedef ::boost::mpl::vector, common<_p2>, incrementable<_p2>, addable<_self, _self, _p2> > dest_concept; + any y = dynamic_any_cast >(x); + any z = y + y; + ++z; + BOOST_CHECK_EQUAL(any_cast(z), 3); +} + +BOOST_AUTO_TEST_CASE(test_multiple_placeholders) +{ + typedef ::boost::mpl::map< ::boost::mpl::pair<_a, int>, boost::mpl::pair<_b, int> > init_map; + any< ::boost::mpl::vector, common<_b> >, _a> x(1, make_binding()); + typedef ::boost::mpl::vector, common<_b>, incrementable<_b>, addable<_a, _a, _b> > dest_concept; + typedef ::boost::mpl::map< ::boost::mpl::pair<_a, _a>, ::boost::mpl::pair<_b, _b> > placeholder_map; + any y = dynamic_any_cast >(x, make_binding()); + any z = y + y; + ++z; + BOOST_CHECK_EQUAL(any_cast(z), 3); +} + +BOOST_AUTO_TEST_CASE(test_multiple_placeholders_switch) +{ + typedef ::boost::mpl::map< ::boost::mpl::pair<_a, int>, boost::mpl::pair<_b, int> > init_map; + any< ::boost::mpl::vector, common<_b> >, _a> x(1, make_binding()); + typedef ::boost::mpl::vector, common<_d>, incrementable<_d>, addable<_c, _c, _d> > dest_concept; + typedef ::boost::mpl::map< ::boost::mpl::pair<_c, _a>, ::boost::mpl::pair<_d, _b> > placeholder_map; + any y = dynamic_any_cast >(x, make_binding()); + any z = y + y; + ++z; + BOOST_CHECK_EQUAL(any_cast(z), 3); +} + +template +T as_rvalue(const T& arg) { return arg; } +template +const T& as_const(const T& arg) { return arg; } + +BOOST_AUTO_TEST_CASE(test_val) +{ + any > x(1); + // value + any > y1 = dynamic_any_cast > >(x); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(y1)); + any > y2 = dynamic_any_cast > >(as_rvalue(x)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(y2)); + any > y3 = dynamic_any_cast > >(as_const(x)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(y3)); + + // lvalue reference + any, _self&> r(x); + any > z1 = dynamic_any_cast > >(r); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(z1)); + any > z2 = dynamic_any_cast > >(as_rvalue(r)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(z2)); + any > z3 = dynamic_any_cast > >(as_const(r)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(z3)); + + // const reference + any, const _self&> cr(x); + any > w1 = dynamic_any_cast > >(cr); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(w1)); + any > w2 = dynamic_any_cast > >(as_rvalue(cr)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(w2)); + any > w3 = dynamic_any_cast > >(as_const(cr)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(w3)); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + // rvalue reference + any, _self&&> rr(std::move(x)); + any > v1 = dynamic_any_cast > >(rr); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(v1)); + any > v2 = dynamic_any_cast > >(as_rvalue(rr)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(v2)); + any > v3 = dynamic_any_cast > >(as_const(rr)); + BOOST_CHECK_EQUAL(any_cast(x), any_cast(v3)); +#endif +} + +BOOST_AUTO_TEST_CASE(test_ref) +{ + // A non-const reference can only bind to a few cases + any > x(1); + any, _self&> y = dynamic_any_cast, _self&> >(x); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&y)); + + any, _self&> z = dynamic_any_cast, _self&> >(y); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&z)); + any, _self&> w = dynamic_any_cast, _self&> >(as_rvalue(y)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&w)); + any, _self&> v = dynamic_any_cast, _self&> >(as_const(y)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&v)); +} + +BOOST_AUTO_TEST_CASE(test_cref) +{ + any > x(1); + typedef any, const _self&> dest_type; + + // value + dest_type y1 = dynamic_any_cast(x); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&y1)); + // as_rvalue creates a temporary + BOOST_CHECK_EQUAL(any_cast(x), any_cast(dynamic_any_cast(as_rvalue(x)))); + dest_type y3 = dynamic_any_cast(as_const(x)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&y3)); + + // lvalue reference + any, _self&> r(x); + dest_type z1 = dynamic_any_cast(r); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&z1)); + dest_type z2 = dynamic_any_cast(as_rvalue(r)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&z2)); + dest_type z3 = dynamic_any_cast(as_const(r)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&z3)); + + // const reference + any, const _self&> cr(x); + dest_type w1 = dynamic_any_cast(cr); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&w1)); + dest_type w2 = dynamic_any_cast(as_rvalue(cr)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&w2)); + dest_type w3 = dynamic_any_cast(as_const(cr)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&w3)); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + // rvalue reference + any, _self&&> rr(std::move(x)); + dest_type v1 = dynamic_any_cast(rr); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&v1)); + dest_type v2 = dynamic_any_cast(as_rvalue(rr)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&v2)); + dest_type v3 = dynamic_any_cast(as_const(rr)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&v3)); +#endif +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +BOOST_AUTO_TEST_CASE(test_rref) +{ + any > x(1); + typedef any, _self&&> dest_type; + + // value + dest_type y2 = dynamic_any_cast(std::move(x)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&y2)); + + // rvalue reference + any, _self&&> rr(std::move(x)); + dest_type v2 = dynamic_any_cast(std::move(rr)); + BOOST_CHECK_EQUAL(any_cast(&x), any_cast(&v2)); +} + +#endif diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_equal.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_equal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e0989cd1307e45e7abee4cc42c436cde5e7fd665 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_equal.cpp @@ -0,0 +1,147 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef boost::mpl::vector, equality_comparable<> > test_concept; + any x(1); + any y(2); + + BOOST_CHECK(!(x == y)); + BOOST_CHECK((x == x)); + BOOST_CHECK((x != y)); + BOOST_CHECK(!(x != x)); +} + +BOOST_AUTO_TEST_CASE(test_mixed_unequal) +{ + typedef boost::mpl::vector, copy_constructible<_b>, equality_comparable<_a, _b> > test_concept; + tuple t(1, 2.0); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK(!(x == y)); + BOOST_CHECK((x != y)); +} + +BOOST_AUTO_TEST_CASE(test_mixed_equal) +{ + typedef boost::mpl::vector, copy_constructible<_b>, equality_comparable<_a, _b> > test_concept; + tuple t(1, 1); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK((x == y)); + BOOST_CHECK(!(x != y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_lhs_unequal) +{ + typedef boost::mpl::vector, equality_comparable > test_concept; + int x(1); + any y(2.0); + + BOOST_CHECK(!(x == y)); + BOOST_CHECK((x != y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_lhs_equal) +{ + typedef boost::mpl::vector, equality_comparable > test_concept; + int x(1); + any y(1); + + BOOST_CHECK((x == y)); + BOOST_CHECK(!(x != y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_rhs_unequal) +{ + typedef boost::mpl::vector, equality_comparable<_self, int> > test_concept; + any x(2.0); + int y(1); + + BOOST_CHECK(!(x == y)); + BOOST_CHECK((x != y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_rhs_equal) +{ + typedef boost::mpl::vector, equality_comparable<_self, int> > test_concept; + any x(1); + int y(1); + + BOOST_CHECK((x == y)); + BOOST_CHECK(!(x != y)); +} + +BOOST_AUTO_TEST_CASE(test_relaxed) +{ + typedef boost::mpl::vector, equality_comparable<>, relaxed> test_concept; + any x(1); + any y(2); + any z(std::string("test")); + + BOOST_CHECK(!(x == y)); + BOOST_CHECK((x == x)); + BOOST_CHECK((x != y)); + BOOST_CHECK(!(x != x)); + + BOOST_CHECK(!(x == z)); + BOOST_CHECK((x != z)); +} + +BOOST_AUTO_TEST_CASE(test_overload) +{ + typedef boost::mpl::vector< + copy_constructible<_a>, + copy_constructible<_b>, + equality_comparable<_a>, + equality_comparable<_a, int>, + equality_comparable, + equality_comparable<_b>, + equality_comparable<_b, int>, + equality_comparable, + equality_comparable<_a, _b> + > test_concept; + + tuple t(1, 2.0); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK(x == x); + BOOST_CHECK(!(x != x)); + BOOST_CHECK(x == 1); + BOOST_CHECK(x != 2); + BOOST_CHECK(1 == x); + BOOST_CHECK(2 != x); + + BOOST_CHECK(y == y); + BOOST_CHECK(!(y != y)); + BOOST_CHECK(y == 2); + BOOST_CHECK(y != 3); + BOOST_CHECK(2 == y); + BOOST_CHECK(3 != y); + + BOOST_CHECK(!(x == y)); + BOOST_CHECK(x != y); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_forward_iterator.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_forward_iterator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..159cffb076fae4d2423f466b4383ad156d8a8ea4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_forward_iterator.cpp @@ -0,0 +1,99 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef boost::mpl::vector< + forward_iterator<>, + same_type::value_type, int> + > test_concept; + std::vector vec(10); + any x(vec.begin()); + any y(vec.end()); + + for(int i = 0; x != y; ++x, ++i) { + *x = i; + } + int expected[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + BOOST_CHECK_EQUAL_COLLECTIONS(vec.begin(), vec.end(), &expected[0], &expected[0] + 10); + + BOOST_MPL_ASSERT((boost::is_same::value_type, int>)); + BOOST_MPL_ASSERT((boost::is_same::reference, int&>)); + BOOST_MPL_ASSERT((boost::is_same::pointer, int*>)); + BOOST_MPL_ASSERT((boost::is_same::difference_type, std::ptrdiff_t>)); + BOOST_MPL_ASSERT((boost::is_same::iterator_category, std::forward_iterator_tag>)); +} + +BOOST_AUTO_TEST_CASE(test_any_value_type) +{ + typedef boost::mpl::vector< + forward_iterator<>, + same_type::value_type, _a>, + copy_constructible<_a>, + assignable<_a>, + incrementable<_a> + > test_concept; + std::vector vec(10); + any x(vec.begin()); + any y(vec.end()); + + for(any i = *x; x != y; ++x, ++i) { + *x = i; + } + int expected[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + BOOST_CHECK_EQUAL_COLLECTIONS(vec.begin(), vec.end(), &expected[0], &expected[0] + 10); + + BOOST_MPL_ASSERT((boost::is_same::value_type, any >)); + BOOST_MPL_ASSERT((boost::is_same::reference, any >)); + BOOST_MPL_ASSERT((boost::is_same::pointer, any*>)); + BOOST_MPL_ASSERT((boost::is_same::difference_type, std::ptrdiff_t>)); + BOOST_MPL_ASSERT((boost::is_same::iterator_category, std::forward_iterator_tag>)); +} + +BOOST_AUTO_TEST_CASE(test_relaxed) +{ + typedef boost::mpl::vector< + forward_iterator<>, + same_type::value_type, int>, + relaxed + > test_concept; + std::vector vec(10); + any x(vec.begin()); + any y(vec.end()); + + for(int i = 0; x != y; ++x, ++i) { + *x = i; + } + int expected[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + BOOST_CHECK_EQUAL_COLLECTIONS(vec.begin(), vec.end(), &expected[0], &expected[0] + 10); + + BOOST_MPL_ASSERT((boost::is_same::value_type, int>)); + BOOST_MPL_ASSERT((boost::is_same::reference, int&>)); + BOOST_MPL_ASSERT((boost::is_same::pointer, int*>)); + BOOST_MPL_ASSERT((boost::is_same::difference_type, std::ptrdiff_t>)); + BOOST_MPL_ASSERT((boost::is_same::iterator_category, std::forward_iterator_tag>)); + + BOOST_CONCEPT_ASSERT((boost::ForwardIterator >)); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_free.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_free.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4878837a804fcd4bebec77e75c6660368beca95c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_free.cpp @@ -0,0 +1,112 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +struct model { + explicit model(int v) : val(v) {} + int val; +}; + +int f1(model& m) { return m.val; } +int f1(model& m, int i) { return m.val + i; } + +BOOST_TYPE_ERASURE_FREE((global_has_f1_1), f1, 1); + +BOOST_AUTO_TEST_CASE(test_global_has_f1_1) { + typedef ::boost::mpl::vector< + global_has_f1_1, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(f1(x), 10); +} + +BOOST_TYPE_ERASURE_FREE((ns1)(ns2)(ns_has_f1_1), f1, 1); + +BOOST_AUTO_TEST_CASE(test_ns_has_f1_1) { + typedef ::boost::mpl::vector< + ns1::ns2::ns_has_f1_1, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(f1(x), 10); +} + +struct model_const { + explicit model_const(int v) : val(v) {} + int val; +}; + +int f1(const model_const& m) { return m.val; } +int f1(const model_const& m, int i) { return m.val + i; } + +BOOST_AUTO_TEST_CASE(test_global_has_f1_1_const) { + typedef ::boost::mpl::vector< + ns1::ns2::ns_has_f1_1, + copy_constructible<> > concept_type; + model_const m(10); + const any x(m); + BOOST_CHECK_EQUAL(f1(x), 10); +} + +BOOST_AUTO_TEST_CASE(test_global_has_f1_1_void) { + typedef ::boost::mpl::vector< + global_has_f1_1, + copy_constructible<> > concept_type; + model m(10); + any x(m); + f1(x); +} + +BOOST_TYPE_ERASURE_FREE((global_has_f1_2), f1, 2); + +BOOST_AUTO_TEST_CASE(test_global_has_f1_overload) { + typedef ::boost::mpl::vector< + global_has_f1_1, + global_has_f1_2, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(f1(x), 10); + BOOST_CHECK_EQUAL(f1(x, 5), 15); +} + +BOOST_AUTO_TEST_CASE(test_global_has_f1_overload_const) { + typedef ::boost::mpl::vector< + global_has_f1_1, + global_has_f1_2, + copy_constructible<> > concept_type; + model_const m(10); + const any x(m); + BOOST_CHECK_EQUAL(f1(x), 10); + BOOST_CHECK_EQUAL(f1(x, 5), 15); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +BOOST_AUTO_TEST_CASE(test_global_has_f1_rv) { + typedef ::boost::mpl::vector< + global_has_f1_2, + copy_constructible<> > concept_type; + model_const m(10); + any x(m); + BOOST_CHECK_EQUAL(f1(std::move(x), 5), 15); +} + +#endif diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_increment.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_increment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f864dfaf363f9fafeba10d08b36b805001fa983c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_increment.cpp @@ -0,0 +1,51 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + destructible, + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_value) +{ + typedef ::boost::mpl::vector, incrementable<> > test_concept; + any x(1); + ++x; + BOOST_CHECK_EQUAL(any_cast(x), 2); + any y(x++); + BOOST_CHECK_EQUAL(any_cast(x), 3); + BOOST_CHECK_EQUAL(any_cast(y), 2); +} + +BOOST_AUTO_TEST_CASE(test_reference) +{ + typedef ::boost::mpl::vector, incrementable<> > test_concept; + int i = 1; + any x(i); + ++x; + BOOST_CHECK_EQUAL(i, 2); + any y(x++); + BOOST_CHECK_EQUAL(i, 3); + BOOST_CHECK_EQUAL(any_cast(y), 2); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_is_empty.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_is_empty.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb416c66f60a436e3402324bf47e678306db048d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_is_empty.cpp @@ -0,0 +1,35 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_non_relaxed) +{ + typedef copy_constructible<> test_concept; + any x(2); + BOOST_CHECK(!is_empty(x)); +} + +BOOST_AUTO_TEST_CASE(test_relaxed) +{ + typedef boost::mpl::vector, relaxed> test_concept; + any x(2); + BOOST_CHECK(!is_empty(x)); + any y; + BOOST_CHECK(is_empty(y)); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_is_subconcept.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_is_subconcept.cpp new file mode 100644 index 0000000000000000000000000000000000000000..995779410f0f5dc7f8ecb256b54415f283117909 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_is_subconcept.cpp @@ -0,0 +1,34 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +using namespace boost::type_erasure; + +BOOST_MPL_ASSERT((is_subconcept, typeid_<> >)); +BOOST_MPL_ASSERT_NOT((is_subconcept, incrementable<> >)); +BOOST_MPL_ASSERT_NOT((is_subconcept, incrementable<> >, typeid_<> >)); +BOOST_MPL_ASSERT_NOT((is_subconcept, incrementable<> >, incrementable<> >)); +BOOST_MPL_ASSERT((is_subconcept, mpl::vector, incrementable<> > >)); +BOOST_MPL_ASSERT((is_subconcept, mpl::vector, incrementable<> > >)); +BOOST_MPL_ASSERT((is_subconcept, incrementable<> >, mpl::vector, typeid_<> > >)); + +BOOST_MPL_ASSERT((is_subconcept, typeid_<_b>, mpl::map > >)); +BOOST_MPL_ASSERT_NOT((is_subconcept, incrementable<_b>, mpl::map > >)); +BOOST_MPL_ASSERT_NOT((is_subconcept, incrementable<_a> >, typeid_<_b>, mpl::map > >)); +BOOST_MPL_ASSERT_NOT((is_subconcept, incrementable<_a> >, incrementable<_b>, mpl::map > >)); +BOOST_MPL_ASSERT((is_subconcept, mpl::vector, incrementable<_b> >, mpl::map > >)); +BOOST_MPL_ASSERT((is_subconcept, mpl::vector, incrementable<_b> >, mpl::map > >)); +BOOST_MPL_ASSERT((is_subconcept, incrementable<_a> >, mpl::vector, typeid_<_b> >, mpl::map > >)); diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_less.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_less.cpp new file mode 100644 index 0000000000000000000000000000000000000000..343bb51addcbeda383c17b390a38574e0d416916 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_less.cpp @@ -0,0 +1,260 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef boost::mpl::vector, less_than_comparable<> > test_concept; + any x(1); + any y(2); + + BOOST_CHECK((x < y)); + BOOST_CHECK(!(y < x)); + BOOST_CHECK(!(x < x)); + + BOOST_CHECK(!(x > y)); + BOOST_CHECK((y > x)); + BOOST_CHECK(!(x > x)); + + BOOST_CHECK((x <= y)); + BOOST_CHECK(!(y <= x)); + BOOST_CHECK((x <= x)); + + BOOST_CHECK(!(x >= y)); + BOOST_CHECK((y >= x)); + BOOST_CHECK((x >= x)); +} + +BOOST_AUTO_TEST_CASE(test_mixed_less) +{ + typedef boost::mpl::vector, copy_constructible<_b>, less_than_comparable<_a, _b> > test_concept; + tuple t(1, 2.0); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK((x < y)); + BOOST_CHECK((y > x)); + BOOST_CHECK(!(y <= x)); + BOOST_CHECK(!(x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_mixed_equal) +{ + typedef boost::mpl::vector, copy_constructible<_b>, less_than_comparable<_a, _b> > test_concept; + tuple t(1, 1); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK(!(x < y)); + BOOST_CHECK(!(y > x)); + BOOST_CHECK((y <= x)); + BOOST_CHECK((x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_mixed_greater) +{ + typedef boost::mpl::vector, copy_constructible<_b>, less_than_comparable<_a, _b> > test_concept; + tuple t(2.0, 1); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK(!(x < y)); + BOOST_CHECK(!(y > x)); + BOOST_CHECK((y <= x)); + BOOST_CHECK((x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_lhs_less) +{ + typedef boost::mpl::vector, less_than_comparable > test_concept; + int x(1); + any y(2.0); + + BOOST_CHECK((x < y)); + BOOST_CHECK((y > x)); + BOOST_CHECK(!(y <= x)); + BOOST_CHECK(!(x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_lhs_equal) +{ + typedef boost::mpl::vector, less_than_comparable > test_concept; + int x(1); + any y(1); + + BOOST_CHECK(!(x < y)); + BOOST_CHECK(!(y > x)); + BOOST_CHECK((y <= x)); + BOOST_CHECK((x >= y)); +} + + +BOOST_AUTO_TEST_CASE(test_fixed_lhs_greater) +{ + typedef boost::mpl::vector, less_than_comparable > test_concept; + int x(1); + any y(0.5); + + BOOST_CHECK(!(x < y)); + BOOST_CHECK(!(y > x)); + BOOST_CHECK((y <= x)); + BOOST_CHECK((x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_rhs_less) +{ + typedef boost::mpl::vector, less_than_comparable<_self, int> > test_concept; + any x(1.0); + int y(2); + + BOOST_CHECK((x < y)); + BOOST_CHECK((y > x)); + BOOST_CHECK(!(y <= x)); + BOOST_CHECK(!(x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_fixed_rhs_equal) +{ + typedef boost::mpl::vector, less_than_comparable<_self, int> > test_concept; + any x(1); + int y(1); + + BOOST_CHECK(!(x < y)); + BOOST_CHECK(!(y > x)); + BOOST_CHECK((y <= x)); + BOOST_CHECK((x >= y)); +} + + +BOOST_AUTO_TEST_CASE(test_fixed_rhs_greater) +{ + typedef boost::mpl::vector, less_than_comparable<_self, int> > test_concept; + any x(2.0); + int y(1); + + BOOST_CHECK(!(x < y)); + BOOST_CHECK(!(y > x)); + BOOST_CHECK((y <= x)); + BOOST_CHECK((x >= y)); +} + +BOOST_AUTO_TEST_CASE(test_relaxed) +{ + typedef boost::mpl::vector, less_than_comparable<>, relaxed> test_concept; + any x(1); + any y(2); + any z(std::string("test")); + + BOOST_CHECK((x < y)); + BOOST_CHECK(!(y < x)); + BOOST_CHECK(!(x < x)); + + BOOST_CHECK(!(x > y)); + BOOST_CHECK((y > x)); + BOOST_CHECK(!(x > x)); + + BOOST_CHECK((x <= y)); + BOOST_CHECK(!(y <= x)); + BOOST_CHECK((x <= x)); + + BOOST_CHECK(!(x >= y)); + BOOST_CHECK((y >= x)); + BOOST_CHECK((x >= x)); + + bool expected = x < z; + + BOOST_CHECK_EQUAL((x < z), expected); + BOOST_CHECK_EQUAL(!(z < x), expected); + + BOOST_CHECK_EQUAL(!(x > z), expected); + BOOST_CHECK_EQUAL((z > x), expected); + + BOOST_CHECK_EQUAL((x <= z), expected); + BOOST_CHECK_EQUAL(!(z <= x), expected); + + BOOST_CHECK_EQUAL(!(x >= z), expected); + BOOST_CHECK_EQUAL((z >= x), expected); + + BOOST_CHECK_EQUAL((y < z), expected); + BOOST_CHECK_EQUAL(!(z < y), expected); + + BOOST_CHECK_EQUAL(!(y > z), expected); + BOOST_CHECK_EQUAL((z > y), expected); + + BOOST_CHECK_EQUAL((y <= z), expected); + BOOST_CHECK_EQUAL(!(z <= y), expected); + + BOOST_CHECK_EQUAL(!(y >= z), expected); + BOOST_CHECK_EQUAL((z >= y), expected); +} + +BOOST_AUTO_TEST_CASE(test_overload) +{ + typedef boost::mpl::vector< + copy_constructible<_a>, + copy_constructible<_b>, + less_than_comparable<_a>, + less_than_comparable<_a, int>, + less_than_comparable, + less_than_comparable<_b>, + less_than_comparable<_b, int>, + less_than_comparable, + less_than_comparable<_a, _b> + > test_concept; + tuple t(1, 2); + any x(get<0>(t)); + any y(get<1>(t)); + + BOOST_CHECK(!(x < x)); + BOOST_CHECK(x <= x); + BOOST_CHECK(!(x > x)); + BOOST_CHECK(x >= x); + + BOOST_CHECK(!(x < 1)); + BOOST_CHECK(x <= 1); + BOOST_CHECK(!(x > 1)); + BOOST_CHECK(x >= 1); + + BOOST_CHECK(!(1 < x)); + BOOST_CHECK(1 <= x); + BOOST_CHECK(!(1 > x)); + BOOST_CHECK(1 >= x); + + BOOST_CHECK(!(y < y)); + BOOST_CHECK(y <= y); + BOOST_CHECK(!(y > y)); + BOOST_CHECK(y >= y); + + BOOST_CHECK(!(y < 2)); + BOOST_CHECK(y <= 2); + BOOST_CHECK(!(y > 2)); + BOOST_CHECK(y >= 2); + + BOOST_CHECK(!(2 < y)); + BOOST_CHECK(2 <= y); + BOOST_CHECK(!(2 > y)); + BOOST_CHECK(2 >= y); + + BOOST_CHECK(x < y); + BOOST_CHECK(y > x); + BOOST_CHECK(!(y <= x)); + BOOST_CHECK(!(x >= y)); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_member.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_member.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8ab84b83f913617eee03f3c1c808224c6c2b4555 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_member.cpp @@ -0,0 +1,138 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_TYPE_ERASURE_MEMBER((ns)(ns2)(has_fun), fun, 0); + +struct model { + explicit model(int v) : val(v) {} + int f1() { return val; } + int f1(int i) { return val + i; } + int val; +}; + +BOOST_TYPE_ERASURE_MEMBER((global_has_f1_0), f1, 0); + +BOOST_AUTO_TEST_CASE(test_global_has_f1_0) { + typedef ::boost::mpl::vector< + global_has_f1_0, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(x.f1(), 10); +} + +BOOST_TYPE_ERASURE_MEMBER((ns1)(ns2)(ns_has_f1_0), f1, 0); + +BOOST_AUTO_TEST_CASE(test_ns_has_f1_0) { + typedef ::boost::mpl::vector< + ns1::ns2::ns_has_f1_0, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(x.f1(), 10); +} + +struct model_const { + explicit model_const(int v) : val(v) {} + int f1() const { return val; } + int f1(int i) const { return val + i; } + int val; +}; + +BOOST_AUTO_TEST_CASE(test_global_has_f1_0_const) { + typedef ::boost::mpl::vector< + ns1::ns2::ns_has_f1_0, + copy_constructible<> > concept_type; + model_const m(10); + any x(m); + BOOST_CHECK_EQUAL(x.f1(), 10); +} + +BOOST_AUTO_TEST_CASE(test_global_has_f1_0_void) { + typedef ::boost::mpl::vector< + global_has_f1_0, + copy_constructible<> > concept_type; + model m(10); + any x(m); + x.f1(); +} + +BOOST_TYPE_ERASURE_MEMBER((global_has_f1_1), f1, 1); + +BOOST_AUTO_TEST_CASE(test_global_has_f1_overload) { + typedef ::boost::mpl::vector< + global_has_f1_0, + global_has_f1_1, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(x.f1(), 10); + BOOST_CHECK_EQUAL(x.f1(5), 15); +} + +BOOST_AUTO_TEST_CASE(test_global_has_f1_overload_const) { + typedef ::boost::mpl::vector< + global_has_f1_0, + global_has_f1_1, + copy_constructible<> > concept_type; + model_const m(10); + any x(m); + BOOST_CHECK_EQUAL(x.f1(), 10); + BOOST_CHECK_EQUAL(x.f1(5), 15); +} + +struct model_overload_const_non_const { + int f1() { return 1; } + int f1() const { return 2; } +}; + +BOOST_AUTO_TEST_CASE(test_global_has_f1_overload_const_non_const) { + typedef ::boost::mpl::vector< + global_has_f1_0, + global_has_f1_0, + copy_constructible<> > concept_type; + model_overload_const_non_const m; + any x1(m); + BOOST_CHECK_EQUAL(x1.f1(), 1); + const any x2(m); + BOOST_CHECK_EQUAL(x2.f1(), 2); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +BOOST_AUTO_TEST_CASE(test_global_has_f1_rv) { + typedef ::boost::mpl::vector< + global_has_f1_1, + copy_constructible<> > concept_type; + model m(10); + any x(m); + BOOST_CHECK_EQUAL(x.f1(5), 15); +} + +BOOST_AUTO_TEST_CASE(test_global_has_f1_rv_const) { + typedef ::boost::mpl::vector< + global_has_f1_1, + copy_constructible<> > concept_type; + model_const m(10); + const any x(m); + BOOST_CHECK_EQUAL(x.f1(5), 15); +} + +#endif diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_negate.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_negate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fc35681f35f9296699a532985ca747ca32f89c97 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_negate.cpp @@ -0,0 +1,34 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_negate) +{ + typedef ::boost::mpl::vector, negatable<> > test_concept; + any x(1); + any y(-x); + BOOST_CHECK_EQUAL(any_cast(y), -1); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_nested.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_nested.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5eca488e06f271b93027f815d6dae3d61e78beec --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_nested.cpp @@ -0,0 +1,62 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +typedef any > > any1_type; + +struct test_class +{ + int i; +}; + +test_class operator+(const test_class& lhs, const any1_type& rhs) +{ + test_class result = { lhs.i + any_cast(rhs) }; + return result; +} + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef boost::mpl::vector, addable<_self, any1_type> > test_concept; + any1_type a1(1); + test_class v = { 2 }; + any x(v); + any y(x + a1); + BOOST_CHECK_EQUAL(any_cast(y).i, 3); +} + +BOOST_AUTO_TEST_CASE(test_relaxed) +{ + typedef boost::mpl::vector, addable<_a, any1_type>, relaxed> test_concept; + typedef boost::mpl::vector, addable<_b, any1_type>, relaxed> dest_concept; + any1_type a1(1); + test_class v = { 2 }; + any x(v); + any y(x + a1); + BOOST_CHECK_EQUAL(any_cast(y).i, 3); + + any z(x); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_null.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_null.cpp new file mode 100644 index 0000000000000000000000000000000000000000..166f4dd6a312283e9f23c1ec7d688593ca2966b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_null.cpp @@ -0,0 +1,44 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + relaxed +> {}; + +BOOST_AUTO_TEST_CASE(test_typeid) { + any > val; + BOOST_CHECK(typeid_of(val) == typeid(void)); +} + +BOOST_AUTO_TEST_CASE(test_any_cast) { + any > val; + BOOST_CHECK_EQUAL(any_cast(&val), (void*)0); + BOOST_CHECK_EQUAL(any_cast(&val), (int*)0); +} + +BOOST_AUTO_TEST_CASE(test_copy) { + any > val; + any > val2(val); + BOOST_CHECK(typeid_of(val2) == typeid(void)); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_param.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_param.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2f5f94213cf2b06a2d20e3883ab1c9dc4e08814a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_param.cpp @@ -0,0 +1,251 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include + +using namespace boost::type_erasure; + +template +struct size { typedef char (&type)[N]; }; + +// lvalues +extern any, _self> a1; +extern const any, _self> a2; +extern any, _self&> a3; +extern const any, _self&> a4; +extern any, const _self&> a5; +extern const any, const _self&> a6; + +// rvalues +any, _self> a7(); +const any, _self> a8(); +any, _self&> a9(); +const any, _self&> a10(); +any, const _self&> a11(); +const any, const _self&> a12(); + +extern int i; + +size<1>::type f1(param, _self&>); +size<2>::type f1(...); + +void test_ref() { + BOOST_STATIC_ASSERT(sizeof(f1(a1)) == 1); + BOOST_STATIC_ASSERT(sizeof(f1(a2)) == 2); + BOOST_STATIC_ASSERT(sizeof(f1(a3)) == 1); + BOOST_STATIC_ASSERT(sizeof(f1(a4)) == 1); + BOOST_STATIC_ASSERT(sizeof(f1(a5)) == 2); + BOOST_STATIC_ASSERT(sizeof(f1(a6)) == 2); + + BOOST_STATIC_ASSERT(sizeof(f1(a7())) == 2); + BOOST_STATIC_ASSERT(sizeof(f1(a8())) == 2); + BOOST_STATIC_ASSERT(sizeof(f1(a9())) == 1); + BOOST_STATIC_ASSERT(sizeof(f1(a10())) == 1); + BOOST_STATIC_ASSERT(sizeof(f1(a11())) == 2); + BOOST_STATIC_ASSERT(sizeof(f1(a12())) == 2); + + BOOST_STATIC_ASSERT(sizeof(f1(i)) == 2); + BOOST_STATIC_ASSERT(sizeof(f1(1)) == 2); + + // Make sure that the constructors are actually instantiated + param, _self&> c1 = a1; + // param, _self&> c2 = a2; + param, _self&> c3 = a3; + param, _self&> c4 = a4; + // param, _self&> c5 = a5; + // param, _self&> c6 = a6; + + // param, _self&> c7 = a7(); + // param, _self&> c8 = a8(); + param, _self&> c9 = a9(); + param, _self&> c10 = a10(); + // param, _self&> c11 = a11(); + // param, _self&> c12 = a12(); +} + +size<1>::type f2(param, const _self&>); +size<2>::type f2(...); + +void test_cref() { + BOOST_STATIC_ASSERT(sizeof(f2(a1)) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a2)) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a3)) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a4)) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a5)) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a6)) == 1); + + BOOST_STATIC_ASSERT(sizeof(f2(a7())) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a8())) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a9())) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a10())) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a11())) == 1); + BOOST_STATIC_ASSERT(sizeof(f2(a12())) == 1); + + BOOST_STATIC_ASSERT(sizeof(f2(i)) == 2); + BOOST_STATIC_ASSERT(sizeof(f2(1)) == 2); + + // Make sure that the constructors are actually instantiated + param, const _self&> c1 = a1; + param, const _self&> c2 = a2; + param, const _self&> c3 = a3; + param, const _self&> c4 = a4; + param, const _self&> c5 = a5; + param, const _self&> c6 = a6; + + param, const _self&> c7 = a7(); + param, const _self&> c8 = a8(); + param, const _self&> c9 = a9(); + param, const _self&> c10 = a10(); + param, const _self&> c11 = a11(); + param, const _self&> c12 = a12(); +} + +size<1>::type f3(param, _self>); +size<2>::type f3(...); + +void test_val() { + BOOST_STATIC_ASSERT(sizeof(f3(a1)) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a2)) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a3)) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a4)) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a5)) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a6)) == 1); + + BOOST_STATIC_ASSERT(sizeof(f3(a7())) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a8())) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a9())) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a10())) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a11())) == 1); + BOOST_STATIC_ASSERT(sizeof(f3(a12())) == 1); + + BOOST_STATIC_ASSERT(sizeof(f3(i)) == 2); + BOOST_STATIC_ASSERT(sizeof(f3(1)) == 2); + + // Make sure that the constructors are actually instantiated + param, _self> c1 = a1; + param, _self> c2 = a2; + param, _self> c3 = a3; + param, _self> c4 = a4; + param, _self> c5 = a5; + param, _self> c6 = a6; + + param, _self> c7 = a7(); + param, _self> c8 = a8(); + param, _self> c9 = a9(); + param, _self> c10 = a10(); + param, _self> c11 = a11(); + param, _self> c12 = a12(); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +size<1>::type f4(param, _self&&>); +size<2>::type f4(...); + +void test_rref() { + BOOST_STATIC_ASSERT(sizeof(f4(a1)) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a2)) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a3)) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a4)) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a5)) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a6)) == 2); + + BOOST_STATIC_ASSERT(sizeof(f4(a7())) == 1); + BOOST_STATIC_ASSERT(sizeof(f4(a8())) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a9())) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a10())) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a11())) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(a12())) == 2); + + BOOST_STATIC_ASSERT(sizeof(f4(i)) == 2); + BOOST_STATIC_ASSERT(sizeof(f4(1)) == 2); + + // Make sure that the constructors are actually instantiated + // param, _self&&> c1 = a1; + // param, _self&&> c2 = a2; + // param, _self&&> c3 = a3; + // param, _self&&> c4 = a4; + // param, _self&&> c5 = a5; + // param, _self&&> c6 = a6; + + param, _self&&> c7 = a7(); + // param, _self&&> c8 = a8(); + // param, _self&&> c9 = a9(); + // param, _self&&> c10 = a10(); + // param, _self&&> c11 = a11(); + // param, _self&&> c12 = a12(); +} + +#endif + +#ifndef BOOST_NO_FUNCTION_REFERENCE_QUALIFIERS + +// Test conversion sequence rank + +size<1>::type f5(param, _self&>); +size<2>::type f5(param, const _self&>); + +void test_ref_cref() { + BOOST_STATIC_ASSERT(sizeof(f5(a1)) == 1); + BOOST_STATIC_ASSERT(sizeof(f5(a2)) == 2); + BOOST_STATIC_ASSERT(sizeof(f5(a3)) == 1); + BOOST_STATIC_ASSERT(sizeof(f5(a4)) == 1); + BOOST_STATIC_ASSERT(sizeof(f5(a5)) == 2); + BOOST_STATIC_ASSERT(sizeof(f5(a6)) == 2); + + BOOST_STATIC_ASSERT(sizeof(f5(a7())) == 2); + BOOST_STATIC_ASSERT(sizeof(f5(a8())) == 2); + BOOST_STATIC_ASSERT(sizeof(f5(a9())) == 1); + BOOST_STATIC_ASSERT(sizeof(f5(a10())) == 1); + BOOST_STATIC_ASSERT(sizeof(f5(a11())) == 2); + BOOST_STATIC_ASSERT(sizeof(f5(a12())) == 2); +} + +size<1>::type f6(param, _self&>); +size<2>::type f6(param, _self&&>); + +void test_ref_rref() { + BOOST_STATIC_ASSERT(sizeof(f6(a1)) == 1); + // BOOST_STATIC_ASSERT(sizeof(f6(a2)) == 2); + BOOST_STATIC_ASSERT(sizeof(f6(a3)) == 1); + BOOST_STATIC_ASSERT(sizeof(f6(a4)) == 1); + // BOOST_STATIC_ASSERT(sizeof(f6(a5)) == 2); + // BOOST_STATIC_ASSERT(sizeof(f6(a6)) == 2); + + BOOST_STATIC_ASSERT(sizeof(f6(a7())) == 2); + // BOOST_STATIC_ASSERT(sizeof(f6(a8())) == 2); + BOOST_STATIC_ASSERT(sizeof(f6(a9())) == 1); + BOOST_STATIC_ASSERT(sizeof(f6(a10())) == 1); + // BOOST_STATIC_ASSERT(sizeof(f6(a11())) == 2); + // BOOST_STATIC_ASSERT(sizeof(f6(a12())) == 2); +} + +size<1>::type f7(param, const _self&>); +size<2>::type f7(param, _self&&>); + +void test_cref_rref() { + BOOST_STATIC_ASSERT(sizeof(f7(a1)) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a2)) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a3)) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a4)) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a5)) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a6)) == 1); + + BOOST_STATIC_ASSERT(sizeof(f7(a7())) == 2); + BOOST_STATIC_ASSERT(sizeof(f7(a8())) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a9())) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a10())) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a11())) == 1); + BOOST_STATIC_ASSERT(sizeof(f7(a12())) == 1); +} + +#endif diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_reference.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_reference.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abf4b0cc3a3c2e0536e8137288236a59670e6891 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_reference.cpp @@ -0,0 +1,82 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +class no_destroy +{ +protected: + ~no_destroy() {} +}; + +class with_destroy : public no_destroy +{ +public: + ~with_destroy() {} +}; + +template +struct common : ::boost::mpl::vector< + destructible, + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef ::boost::mpl::vector > test_concept; + with_destroy val; + any x(static_cast(val)); + no_destroy& ref = any_cast(x); + BOOST_CHECK_EQUAL(&ref, &val); +} + +BOOST_AUTO_TEST_CASE(test_increment) +{ + typedef ::boost::mpl::vector > test_concept; + int i = 0; + any x(i); + ++x; + BOOST_CHECK_EQUAL(i, 1); +} + +BOOST_AUTO_TEST_CASE(test_add) +{ + typedef ::boost::mpl::vector, addable<> > test_concept; + int i = 1; + int j = 2; + any x(i); + any y(j); + any z(x + y); + int k = any_cast(z); + BOOST_CHECK_EQUAL(k, 3); +} + +BOOST_AUTO_TEST_CASE(test_mixed_add) +{ + typedef ::boost::mpl::vector, addable<> > test_concept; + int i = 1; + int j = 2; + any x(i); + any y(j); + any z(x + y); + int k = any_cast(z); + BOOST_CHECK_EQUAL(k, 3); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_relaxed.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_relaxed.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e92ec379321a954cbe50d2ba005019ccb9f2b41d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_relaxed.cpp @@ -0,0 +1,36 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_simple) +{ + typedef ::boost::mpl::vector, addable<>, relaxed> src_concept; + any x(1); + any y(2.0); + BOOST_CHECK_THROW(x + y, bad_function_call); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_same_type.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_same_type.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f02f2ac0c167ea571244309a30a329cdd13d4720 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_same_type.cpp @@ -0,0 +1,87 @@ +// Boost.TypeErasure library +// +// Copyright 2012 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_deduce_dereference) +{ + typedef ::boost::mpl::vector< + copy_constructible<>, + typeid_<_a>, + dereferenceable >&>, + same_type >, _a> + > test_concept; + int i; + + any x(&i); + any y(*x); + BOOST_CHECK_EQUAL(&any_cast(y), &i); +} + +BOOST_MPL_ASSERT(( + boost::is_same< + deduced >::type, + deduced > >)); + +BOOST_MPL_ASSERT(( + boost::is_same >::type, int >)); + +BOOST_AUTO_TEST_CASE(test_duplicate) +{ + typedef ::boost::mpl::vector< + copy_constructible<>, + typeid_<_a>, + dereferenceable >&>, + same_type >, _a>, + same_type >, _a> + > test_concept; + int i; + + any x(&i); + any y(*x); + BOOST_CHECK_EQUAL(&any_cast(y), &i); +} + +BOOST_AUTO_TEST_CASE(test_convert) +{ + typedef ::boost::mpl::vector< + copy_constructible<>, + typeid_<_a>, + dereferenceable >&>, + same_type >, _a> + > test_concept_src; + typedef ::boost::mpl::vector< + copy_constructible<_b>, + typeid_<_c>, + dereferenceable >&, _b>, + same_type >, _c> + > test_concept_dest; + int i; + + any x1(&i); + any y1(*x1); + any x2(x1); + any y2(*x2); + BOOST_CHECK_EQUAL(&any_cast(y2), &i); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_stream.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_stream.cpp new file mode 100644 index 0000000000000000000000000000000000000000..30b3482da9c31018b671e099538fd5a8b99bf43d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_stream.cpp @@ -0,0 +1,245 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +BOOST_AUTO_TEST_CASE(test_output_int) +{ + typedef ostreamable<_a, int> test_concept; + std::ostringstream ss; + any x(ss); + x << 17; + BOOST_CHECK_EQUAL(ss.str(), "17"); +} + +BOOST_AUTO_TEST_CASE(test_output_int_wide) +{ + typedef ostreamable<_a, int> test_concept; + std::wostringstream ss; + any x(ss); + x << 17; + BOOST_CHECK(ss.str() == L"17"); +} + +BOOST_AUTO_TEST_CASE(test_output_int_any) +{ + typedef boost::mpl::vector, copy_constructible<> > test_concept; + std::ostringstream ss; + any x(10); + ss << x; + BOOST_CHECK_EQUAL(ss.str(), "10"); +} + +BOOST_AUTO_TEST_CASE(test_output_int_any_wide) +{ + typedef boost::mpl::vector, copy_constructible<> > test_concept; + std::wostringstream ss; + any x(10); + ss << x; + BOOST_CHECK(ss.str() == L"10"); +} + +BOOST_AUTO_TEST_CASE(test_output_both_any) +{ + typedef boost::mpl::vector, copy_constructible<> > test_concept; + std::ostringstream ss; + int val = 19; + tuple t(ss, val); + get<0>(t) << get<1>(t); + BOOST_CHECK_EQUAL(ss.str(), "19"); +} + +BOOST_AUTO_TEST_CASE(test_output_both_any_wide) +{ + typedef boost::mpl::vector, copy_constructible<> > test_concept; + std::wostringstream ss; + int val = 19; + tuple t(ss, val); + get<0>(t) << get<1>(t); + BOOST_CHECK(ss.str() == L"19"); +} + +BOOST_AUTO_TEST_CASE(test_output_overload_all) +{ + typedef boost::mpl::vector< + ostreamable<_a>, + ostreamable<_a, int>, + ostreamable<_b>, + ostreamable<_b, int>, + ostreamable<>, + ostreamable, + copy_constructible<> + > test_concept; + { + std::ostringstream ss; + std::wostringstream wss; + int val = 2; + tuple t(ss, wss, val); + get<0>(t) << get<2>(t); + get<1>(t) << get<2>(t); + BOOST_CHECK_EQUAL(ss.str(), "2"); + BOOST_CHECK(wss.str() == L"2"); + } + { + std::ostringstream ss; + std::wostringstream wss; + int val = 2; + tuple t(ss, wss, val); + get<0>(t) << 3; + get<1>(t) << 3; + BOOST_CHECK_EQUAL(ss.str(), "3"); + BOOST_CHECK(wss.str() == L"3"); + } + { + std::ostringstream ss; + std::wostringstream wss; + int val = 5; + tuple t(ss, wss, val); + ss << get<2>(t); + wss << get<2>(t); + BOOST_CHECK_EQUAL(ss.str(), "5"); + BOOST_CHECK(wss.str() == L"5"); + } + { + std::ostringstream ss; + std::wostringstream wss; + int val = 5; + tuple t(ss, wss, val); + // we can't do anything with these, but it should + // still compile. + any os(get<0>(t)); + any wos(get<1>(t)); + } +} + + +BOOST_AUTO_TEST_CASE(test_input_int) +{ + typedef istreamable<_a, int> test_concept; + std::istringstream ss("17"); + int i; + any x(ss); + x >> i; + BOOST_CHECK_EQUAL(i, 17); +} + +BOOST_AUTO_TEST_CASE(test_input_int_wide) +{ + typedef istreamable<_a, int> test_concept; + std::wistringstream ss(L"17"); + int i; + any x(ss); + x >> i; + BOOST_CHECK_EQUAL(i, 17); +} + +BOOST_AUTO_TEST_CASE(test_input_int_any) +{ + typedef istreamable<> test_concept; + std::istringstream ss("10"); + int i; + any x(i); + ss >> x; + BOOST_CHECK_EQUAL(i, 10); +} + +BOOST_AUTO_TEST_CASE(test_input_int_any_wide) +{ + typedef istreamable test_concept; + std::wistringstream ss(L"10"); + int i; + any x(i); + ss >> x; + BOOST_CHECK_EQUAL(i, 10); +} + +BOOST_AUTO_TEST_CASE(test_input_both_any) +{ + typedef istreamable<_a> test_concept; + std::istringstream ss("19"); + int i; + tuple t(ss, i); + get<0>(t) >> get<1>(t); + BOOST_CHECK_EQUAL(i, 19); +} + +BOOST_AUTO_TEST_CASE(test_input_both_any_wide) +{ + typedef istreamable<_a> test_concept; + std::wistringstream ss(L"19"); + int i; + tuple t(ss, i); + get<0>(t) >> get<1>(t); + BOOST_CHECK_EQUAL(i, 19); +} + +BOOST_AUTO_TEST_CASE(test_input_overload_all) +{ + typedef boost::mpl::vector< + istreamable<_a>, + istreamable<_a, int>, + istreamable<_b>, + istreamable<_b, int>, + istreamable<>, + istreamable + > test_concept; + { + std::istringstream ss("2"); + std::wistringstream wss(L"3"); + int i = 0; + tuple t(ss, wss, i); + get<0>(t) >> get<2>(t); + BOOST_CHECK_EQUAL(i, 2); + get<1>(t) >> get<2>(t); + BOOST_CHECK_EQUAL(i, 3); + } + { + std::istringstream ss("5"); + std::wistringstream wss(L"7"); + int i = 0; + tuple t(ss, wss, i); + get<0>(t) >> i; + BOOST_CHECK_EQUAL(i, 5); + get<1>(t) >> i; + BOOST_CHECK_EQUAL(i, 7); + } + { + std::istringstream ss("11"); + std::wistringstream wss(L"13"); + int i = 0; + tuple t(ss, wss, i); + ss >> get<2>(t); + BOOST_CHECK_EQUAL(i, 11); + wss >> get<2>(t); + BOOST_CHECK_EQUAL(i, 13); + } + { + std::istringstream ss; + std::wistringstream wss; + int val = 5; + tuple t(ss, wss, val); + // we can't do anything with these, but it should + // still compile. + any is(get<0>(t)); + any wis(get<1>(t)); + } +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_subscript.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_subscript.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8cacc059ac8cb1d3e344647633708e66f85c5f23 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_subscript.cpp @@ -0,0 +1,68 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_basic) +{ + typedef ::boost::mpl::vector, subscriptable > test_concept; + int i[5]; + any x(&i[0]); + BOOST_CHECK_EQUAL(&x[0], &i[0]); +} + +BOOST_AUTO_TEST_CASE(test_basic_const) +{ + typedef ::boost::mpl::vector, subscriptable > test_concept; + int i[5]; + const any x(&i[0]); + BOOST_CHECK_EQUAL(&x[0], &i[0]); +} + +BOOST_AUTO_TEST_CASE(test_any_result) +{ + typedef ::boost::mpl::vector, common<_a>, subscriptable<_a&, const _self> > test_concept; + typedef ::boost::mpl::map< + ::boost::mpl::pair<_self, int*>, + ::boost::mpl::pair<_a, int> + > types; + int i[5]; + any x(&i[0], make_binding()); + any y(x[0]); + BOOST_CHECK_EQUAL(any_cast(&y), &i[0]); +} + +BOOST_AUTO_TEST_CASE(test_any_result_const) +{ + typedef ::boost::mpl::vector, common<_a>, subscriptable > test_concept; + typedef ::boost::mpl::map< + ::boost::mpl::pair<_self, const int*>, + ::boost::mpl::pair<_a, int> + > types; + const int i[5] = { 0, 0, 0, 0, 0 }; + any x(&i[0], make_binding()); + any y(x[0]); + BOOST_CHECK_EQUAL(any_cast(&y), &i[0]); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_tuple.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_tuple.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aa8efd58a826e2b7582c523ab22ffff93e75e241 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_tuple.cpp @@ -0,0 +1,92 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_same) +{ + tuple, _a, _a> t(1, 2); + BOOST_CHECK_EQUAL(any_cast(get<0>(t)), 1); + BOOST_CHECK_EQUAL(any_cast(get<1>(t)), 2); +} + +BOOST_AUTO_TEST_CASE(test_degenerate) +{ + tuple > t; +} + +template +typename T::value_type get_static(T) { return T::value; } + +BOOST_AUTO_TEST_CASE(test_fusion) +{ + typedef boost::mpl::vector, common<_b>, addable<_a, _b> > test_concept; + tuple t(2.0, 1); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::at_c<0>(t)), 2.0); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::at_c<1>(t)), 1); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::front(t)), 2.0); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::back(t)), 1); + BOOST_CHECK_EQUAL(get_static(boost::fusion::empty(t)), false); + BOOST_CHECK_EQUAL(get_static(boost::fusion::size(t)), 2); + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::begin(t), boost::fusion::end(t))), 2); + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::next(boost::fusion::begin(t)), boost::fusion::end(t))), 1); + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::begin(t), boost::fusion::prior(boost::fusion::end(t)))), 1); + + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::advance_c<2>(boost::fusion::begin(t)), boost::fusion::end(t))), 0); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::deref(boost::fusion::begin(t))), 2.0); +} + +BOOST_AUTO_TEST_CASE(test_fusion_const) +{ + typedef boost::mpl::vector, common<_b>, addable<_a, _b> > test_concept; + const tuple t(2.0, 1); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::at_c<0>(t)), 2.0); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::at_c<1>(t)), 1); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::front(t)), 2.0); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::back(t)), 1); + BOOST_CHECK_EQUAL(get_static(boost::fusion::empty(t)), false); + BOOST_CHECK_EQUAL(get_static(boost::fusion::size(t)), 2); + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::begin(t), boost::fusion::end(t))), 2); + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::next(boost::fusion::begin(t)), boost::fusion::end(t))), 1); + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::begin(t), boost::fusion::prior(boost::fusion::end(t)))), 1); + + BOOST_CHECK_EQUAL(get_static(boost::fusion::distance(boost::fusion::advance_c<2>(boost::fusion::begin(t)), boost::fusion::end(t))), 0); + BOOST_CHECK_EQUAL(any_cast(boost::fusion::deref(boost::fusion::begin(t))), 2.0); +} diff --git a/tools/boost_1_65_1/libs/type_erasure/test/test_typeid_of.cpp b/tools/boost_1_65_1/libs/type_erasure/test/test_typeid_of.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6fe77ae99ab0c35c1fdd103eb17e5689374b62a5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_erasure/test/test_typeid_of.cpp @@ -0,0 +1,71 @@ +// Boost.TypeErasure library +// +// Copyright 2011 Steven Watanabe +// +// Distributed under the Boost Software License Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// $Id$ + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using namespace boost::type_erasure; + +template +struct common : ::boost::mpl::vector< + copy_constructible, + typeid_ +> {}; + +BOOST_AUTO_TEST_CASE(test_val) +{ + typedef common<> test_concept; + any x(2); + BOOST_CHECK(typeid_of(x) == typeid(int)); + const any y(2); + BOOST_CHECK(typeid_of(y) == typeid(int)); +} + +BOOST_AUTO_TEST_CASE(test_ref) +{ + typedef common<> test_concept; + int i; + any x(i); + BOOST_CHECK(typeid_of(x) == typeid(int)); + const any y(i); + BOOST_CHECK(typeid_of(y) == typeid(int)); +} + +BOOST_AUTO_TEST_CASE(test_cref) +{ + typedef common<> test_concept; + int i; + any x(i); + BOOST_CHECK(typeid_of(x) == typeid(int)); + const any y(i); + BOOST_CHECK(typeid_of(y) == typeid(int)); +} + +BOOST_AUTO_TEST_CASE(test_binding) +{ + typedef boost::mpl::vector, common<_b> > test_concept; + binding b = + make_binding< + boost::mpl::map< + boost::mpl::pair<_a, int>, + boost::mpl::pair<_b, double> + > + >(); + BOOST_CHECK(typeid_of<_a>(b) == typeid(int)); + BOOST_CHECK(typeid_of<_b>(b) == typeid(double)); +} diff --git a/tools/boost_1_65_1/libs/type_index/README.md b/tools/boost_1_65_1/libs/type_index/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4a99a28d9721b0208da66891a2a3ac535c860b3f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/README.md @@ -0,0 +1,18 @@ +# [Boost.TypeIndex](http://boost.org/libs/type_index) +Boost.TypeIndex is a part of the [Boost C++ Libraries](http://github.com/boostorg). It is a runtime/compile time copyable type info. + +### Test results + +@ | Build | Tests coverage | More info +----------------|-------------- | -------------- |----------- +Develop branch: | [![Build Status](https://travis-ci.org/apolukhin/type_index.svg?branch=develop)](https://travis-ci.org/apolukhin/type_index) [![Build status](https://ci.appveyor.com/api/projects/status/197a5imq10dqx6r8/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/type-index/branch/develop) | [![Coverage Status](https://coveralls.io/repos/apolukhin/type_index/badge.png?branch=develop)](https://coveralls.io/r/apolukhin/type_index?branch=develop) | [details...](http://www.boost.org/development/tests/develop/developer/type_index.html) +Master branch: | [![Build Status](https://travis-ci.org/apolukhin/type_index.svg?branch=master)](https://travis-ci.org/apolukhin/type_index) [![Build status](https://ci.appveyor.com/api/projects/status/197a5imq10dqx6r8/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/type-index/branch/master) | [![Coverage Status](https://coveralls.io/repos/apolukhin/type_index/badge.png?branch=master)](https://coveralls.io/r/apolukhin/type_index?branch=master) | [details...](http://www.boost.org/development/tests/master/developer/type_index.html) + + +[Open Issues](https://svn.boost.org/trac/boost/query?status=!closed&component=type_index) + +[Latest developer documentation](http://boostorg.github.com/type_index/index.html) + +### License + +Distributed under the [Boost Software License, Version 1.0](http://boost.org/LICENSE_1_0.txt). diff --git a/tools/boost_1_65_1/libs/type_index/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/type_index/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..6ebc089df5b095f136b769979a42c890a5fce42b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/doc/Jamfile.v2 @@ -0,0 +1,47 @@ +# Copyright Antony Polukhin 2011-2016. +# Use, modification, and distribution are +# subject to the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using quickbook ; +import boostbook : boostbook ; +import doxygen ; + +doxygen autodoc + : + [ glob ../../../boost/type_index.hpp ] + [ glob ../../../boost/type_index/*.hpp ] + [ glob ../../../boost/type_index/runtime_cast/*.hpp ] + : + EXTRACT_ALL=NO + HIDE_UNDOC_MEMBERS=YES + EXTRACT_PRIVATE=NO + ENABLE_PREPROCESSING=YES + EXPAND_ONLY_PREDEF=YES + MACRO_EXPANSION=YES + "PREDEFINED=\"stl_type_info=std::type_info\" \\ + \"BOOST_TYPE_INDEX_DOXYGEN_INVOKED\" \\ + \"BOOST_CXX14_CONSTEXPR=constexpr\" \\ + \"detail::stl_type_info=std::type_info\"" + "boost.doxygen.reftitle=Boost.TypeIndex Header Reference" + ; + +xml type_index : type_index.qbk : autodoc ; +boostbook standalone + : + type_index + : + boost.root=http://www.boost.org/doc/libs/1_53_0 +# boost.root=../../../.. + pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html + ; + +############################################################################### +alias boostdoc + : type_index + : + : autodoc + : ; +explicit boostdoc ; +alias boostrelease ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/type_index/doc/autodoc.xml b/tools/boost_1_65_1/libs/type_index/doc/autodoc.xml new file mode 100644 index 0000000000000000000000000000000000000000..f3981ab50ad4d5da69e9ba75aca7050b0517bbb2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/doc/autodoc.xml @@ -0,0 +1,494 @@ + +Boost.TypeIndex Header Reference
+Includes minimal set of headers required to use the Boost.TypeIndex library. By inclusion of this file most optimal type index classes will be included and used as a boost::typeindex::type_index and boost::typeindex::type_info. + +Depending on a compiler flags, optimal implementation of type_index will be used as a default boost::typeindex::type_index.Could be a boost::typeindex::stl_type_index, boost::typeindex::ctti_type_index or user defined type_index class.See boost::typeindex::type_index_facade for a full description of type_index functions. platform_specific +Depending on a compiler flags, optimal implementation of type_info will be used as a default boost::typeindex::type_info.Could be a std::type_info, boost::typeindex::detail::ctti_data or some user defined class.type_info is not copyable or default constructible. It is not assignable too! type_index::type_info_t +type_indexFunction to get boost::typeindex::type_index for a type T. Removes const, volatile && and & modifiers from T.Example: type_index ti = type_id<int&>(); +std::cout << ti.pretty_name(); // Outputs 'int' + + + +boost::typeindex::type_index with information about the specified type T. Nothing. +type_indexFunction for constructing boost::typeindex::type_index instance for type T. Does not remove const, volatile, & and && modifiers from T.If T has no const, volatile, & and && modifiers, then returns exactly the same result as in case of calling type_id<T>().Example: type_index ti = type_id_with_cvr<int&>(); +std::cout << ti.pretty_name(); // Outputs 'int&' + + + +boost::typeindex::type_index with information about the specified type T. Nothing. +type_indexconst T &Variable which runtime type must be returned. Function that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index.Returns runtime information about specified type.Requirements: RTTI available or Base and Derived classes must be marked with BOOST_TYPE_INDEX_REGISTER_CLASS.Example: struct Base { virtual ~Base(){} }; +struct Derived: public Base {}; +... +Derived d; +Base& b = d; +type_index ti = type_id_runtime(b); +std::cout << ti.pretty_name(); // Outputs 'Derived' + + + +boost::typeindex::type_index with information about the specified variable. Nothing. + + + + + + + + + + + + + + + + + +BOOST_TYPE_INDEX_REGISTER_CLASS is used to help to emulate RTTI. Put this macro into the public section of polymorphic class to allow runtime type detection.Depending on the typeid() availability this macro will expand to nothing or to virtual helper function virtual const type_info& boost_type_info_type_id_runtime_() const noexcept.Example: class A { +public: + BOOST_TYPE_INDEX_REGISTER_CLASS + virtual ~A(){} +}; + +struct B: public A { + BOOST_TYPE_INDEX_REGISTER_CLASS +}; + +struct C: public B { + BOOST_TYPE_INDEX_REGISTER_CLASS +}; + +... + +C c1; +A* pc1 = &c1; +assert(boost::typeindex::type_id<C>() == boost::typeindex::type_id_runtime(*pc1)); + +BOOST_TYPE_INDEX_FUNCTION_SIGNATURE is used by boost::typeindex::ctti_type_index class to deduce the name of a type. If your compiler is not recognized by the TypeIndex library and you wish to work with boost::typeindex::ctti_type_index, you may define this macro by yourself.BOOST_TYPE_INDEX_FUNCTION_SIGNATURE must be defined to a compiler specific macro that outputs the whole function signature including template parameters.If your compiler is not recognised and BOOST_TYPE_INDEX_FUNCTION_SIGNATURE is not defined, then a compile-time error will arise at any attempt to use boost::typeindex::ctti_type_index classes.See BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS and BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING for an information of how to tune the implementation to make a nice pretty_name() output. +This is a helper macro for making correct pretty_names() with RTTI off.BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro may be defined to '(begin_skip, end_skip, runtime_skip, runtime_skip_until)' with parameters for adding a support for compilers, that by default are not recognized by TypeIndex library.Example: Imagine the situation when boost::typeindex::ctti_type_index::type_id<int>().pretty_name() + returns the following string: "static const char *boost::detail::ctti<int>::n() [T = int]" + andboost::typeindex::ctti_type_index::type_id<short>().pretty_name() + returns the following: "static const char *boost::detail::ctti<short>::n() [T = short]" +As we may see first 39 characters are "static const char *boost::detail::ctti<" and they do not depend on the type T. After first 39 characters we have a human readable type name which is duplicated at the end of a string. String always ends on ']', which consumes 1 character.Now if we define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING to (39, 1, false, "") we'll be getting"int>::n() [T = int" + for boost::typeindex::ctti_type_index::type_id<int>().pretty_name() and"short>::n() [T = short" + for boost::typeindex::ctti_type_index::type_id<short>().pretty_name().Now we need to take additional care of the characters that go before the last mention of our type. We'll do that by telling the macro that we need to cut off everything that goes before the "T = " including the "T = " itself:(39, 1, true, "T = ") +In case of GCC or Clang command line we need to add the following line while compiling all the sources:-DBOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING='(39, 1, true, "T = ")' + +See RTTI emulation limitations for more info. +BOOST_TYPE_INDEX_USER_TYPEINDEX can be defined to the path to header file with user provided implementation of type_index.See Making a custom type_index section of documentation for usage example. +BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY is a helper macro that must be defined if mixing RTTI on/off modules. See Mixing sources with RTTI on and RTTI off section of documentation for more info. +
+
+Contains boost::typeindex::ctti_type_index class that is constexpr if C++14 constexpr is supported by compiler. boost::typeindex::ctti_type_index class can be used as a drop-in replacement for std::type_index.It is used in situations when typeid() method is not available or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined. + +This class is a wrapper that pretends to work exactly like stl_type_index, but does not require RTTI support. For description of functions see type_index_facade.This class on C++14 compatible compilers has following functions marked as constexpr: +default constructorcopy constructors and assignemnt operationsclass methods: name(), before(const ctti_type_index& rhs), equal(const ctti_type_index& rhs)static methods type_id<T>(), type_id_with_cvr<T>()comparison operators +This class produces slightly longer type names, so consider using stl_type_index in situations when typeid() is working. unspecified + +std::size_t + +const char * + +const type_info_t & +constexpr const char * +constexpr const char * +std::string +std::size_t +constexpr boolconst ctti_type_index & +constexpr boolconst ctti_type_index & + + +const type_info_t & + +constexpr ctti_type_index +constexpr ctti_type_index +ctti_type_indexconst T & + + + + + + + + + +unspecifiedHelper method for getting detail::ctti_data of a template parameter T. + + + + + + + + + + + +
+
+Contains the basic utilities necessary to fully emulate dynamic_cast for language level constructs (raw pointers and references). boost::typeindex::runtime_cast is a drop in replacement for dynamic_cast that can be used in situations where traditional rtti is either unavailable or undesirable.
+
+Contains the overload of boost::typeindex::runtime_pointer_cast for boost::shared_ptr types. + + + + + + + + + + + + + + + + + +boost::shared_ptr< T >boost::shared_ptr< U > const &Creates a new instance of std::shared_ptr whose stored pointer is obtained from u's stored pointer using a runtime_cast. The new shared_ptr will share ownership with u, except that it is empty if the runtime_cast performed by runtime_pointer_cast returns a null pointer. + +If there exists a valid conversion from U* to T*, returns a boost::shared_ptr<T> that points to an address suitably offset from u. If no such conversion exists, returns boost::shared_ptr<T>(); + + + +
+
+ + + + + + + + + + + + + + +TU *Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy. + +If there exists a valid conversion from U* to T, returns a T that points to an address suitably offset from u. If no such conversion exists, returns NULL. +TU const *Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy. + +If there exists a valid conversion from U* to T, returns a T that points to an address suitably offset from u. If no such conversion exists, returns NULL. +T *U *Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy. + +If there exists a valid conversion from U const* to T*, returns a T* that points to an address suitably offset from u. If no such conversion exists, returns NULL. +T const *U const *Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy. + +If there exists a valid conversion from U const* to T const*, returns a T const* that points to an address suitably offset from u. If no such conversion exists, returns NULL. + + + + +
+
+Contains the overload of boost::typeindex::runtime_cast for reference types. + +exceptionIndicates that runtime_cast was unable to perform the desired cast operation because the source instance was not also an instance of the target type. + + + + + + + + + +boost::add_reference< T >::typeU &Safely converts references to classes up, down, and sideways along the inheritance hierarchy. + +If there exists a valid conversion from U& to T, returns a T that references an address suitably offset from u. If no such conversion exists, throws boost::typeindex::bad_runtime_cast. +boost::add_reference< const T >::typeU const &Safely converts references to classes up, down, and sideways along the inheritance hierarchy. + +If there exists a valid conversion from U const& to T const, returns a T const that references an address suitably offset from u. If no such conversion exists, throws boost::typeindex::bad_runtime_cast. + + + + + + + + +
+
+Contains the macros BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST and BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS. + + + + + + + + + + + + + + + + + + + + + +A Boost.Preprocessor sequence of the current class' direct bases, or BOOST_TYPE_INDEX_NO_BASE_CLASS if this class has no direct base classes. Macro used to make a class compatible with boost::typeindex::runtime_cast. BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS generates a virtual function in the current class that, when combined with the supplied base class information, allows boost::typeindex::runtime_cast to accurately convert between dynamic types of instances of the current class.BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS also adds support for boost::typeindex::type_id_runtime by including BOOST_TYPE_INDEX_REGISTER_CLASS. It is typical that these features are used together, but in the event that BOOST_TYPE_INDEX_REGISTER_CLASS is undesirable in the current class, BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST is provided.Example: struct base1 { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS(BOOST_TYPE_INDEX_NO_BASE_CLASS) + virtual ~base1(); +}; + +struct base2 { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS(BOOST_TYPE_INDEX_NO_BASE_CLASS) + virtual ~base2(); +}; + +struct derived1 : base1 { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS((base1)) +}; + +struct derived2 : base1, base2 { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS((base1)(base2)) +}; + +... + +base1* pb1 = get_object(); +if(derived2* pb2 = boost::typeindex::runtime_cast<derived2*>(pb1)) { + assert(boost::typeindex::type_id_runtime(*pb1)) == boost::typeindex::type_id<derived2>()); +} + + +A Boost.Preprocessor sequence of the current class' direct bases, or BOOST_TYPE_INDEX_NO_BASE_CLASS if this class has no direct base classes. Macro used to make a class compatible with boost::typeindex::runtime_cast without including support for boost::typeindex::type_id_runtime. BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST is provided as an alternative to BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS in the event that support for boost::typeindex::type_id_runtime is undesirable.Example: struct base1 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST(BOOST_TYPE_INDEX_NO_BASE_CLASS) + virtual ~base1(); +}; + +struct base2 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST(BOOST_TYPE_INDEX_NO_BASE_CLASS) + virtual ~base2(); +}; + +struct derived1 : base1 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base1)) +}; + +struct derived2 : base1, base2 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base1)(base2)) +}; + +... + +base1* pb1 = get_object(); +if(derived2* pb2 = boost::typeindex::runtime_cast<derived2*>(pb1)) +{ /* can't call boost::typeindex::type_id_runtime(*pb1) here */ } + + +Instructs BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS and BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST that this class has no base classes. +
+
+Contains the overload of boost::typeindex::runtime_pointer_cast for std::shared_ptr types. + + + + + + + + + + +std::shared_ptr< T >std::shared_ptr< U > const &Creates a new instance of std::shared_ptr whose stored pointer is obtained from u's stored pointer using a runtime_cast. The new shared_ptr will share ownership with u, except that it is empty if the runtime_cast performed by runtime_pointer_cast returns a null pointer. + +If there exists a valid conversion from U* to T*, returns a std::shared_ptr<T> that points to an address suitably offset from u. If no such conversion exists, returns std::shared_ptr<T>(); + + + + + + + + + + +
+
+Contains boost::typeindex::stl_type_index class. boost::typeindex::stl_type_index class can be used as a drop-in replacement for std::type_index.It is used in situations when RTTI is enabled or typeid() method is available. When typeid() is disabled or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined boost::typeindex::ctti is usually used instead of boost::typeindex::stl_type_index. + +boost::typeindex::type_index_facade< stl_type_index, std::type_info >This class is a wrapper around std::type_info, that workarounds issues and provides much more rich interface. For description of functions see type_index_facade.This class requires typeid() to work. For cases when RTTI is disabled see ctti_type_index. std::type_info + +const type_info_t & +const char * +const char * +std::string +std::size_t +boolconst stl_type_index & +boolconst stl_type_index & + + +const type_info_t & + +stl_type_index +stl_type_index +stl_type_indexconst T & + + + + + + + + + + + + + + + + + + + + + +
+
+ + +This class takes care about the comparison operators, hash functions and ostream operators. Use this class as a public base class for defining new type_info-conforming classes.Example: class stl_type_index: public type_index_facade<stl_type_index, std::type_info> +{ +public: + typedef std::type_info type_info_t; +private: + const type_info_t* data_; + +public: + stl_type_index(const type_info_t& data) noexcept + : data_(&data) + {} +// ... +}; + +Take a look at the protected methods. They are not defined in type_index_facade. Protected member functions raw_name() must be defined in Derived class. All the other methods are mandatory. +See Also:'Making a custom type_index' section for more information about creating your own type_index using type_index_facade. +TypeInfo + +const char *Override: This function may be redefined in Derived class. Overrides must not throw. +Name of a type. By default returns Derived::raw_name(). +std::stringOverride: This function may be redefined in Derived class. Overrides may throw. +Human readable type name. By default returns Derived::name(). +boolconst Derived &Override: This function may be redefined in Derived class. Overrides must not throw. +True if two types are equal. By default compares types by raw_name(). +boolconst Derived &Override: This function may be redefined in Derived class. Overrides must not throw. +True if rhs is greater than this. By default compares types by raw_name(). +std::size_tOverride: This function may be redefined in Derived class. Overrides must not throw. +Derived class header must include <boost/functional/hash.hpp>, unless this function is redefined in Derived class to not use boost::hash_range(). +Hash code of a type. By default hashes types by raw_name(). + + +const char *Override: This function must be redefined in Derived class. Overrides must not throw. +Pointer to unredable/raw type name. +const type_info_t &Override: This function may be redefined in Derived class. Overrides must not throw. +Const reference to underlying low level type_info_t. + + +DerivedThis is a factory method that is used to create instances of Derived classes. boost::typeindex::type_id() will call this method, if Derived has same type as boost::typeindex::type_index.Override: This function may be redefined and made public in Derived class. Overrides must not throw. Overrides must remove const, volatile && and & modifiers from T. + +type_index for type T. +DerivedThis is a factory method that is used to create instances of Derived classes. boost::typeindex::type_id_with_cvr() will call this method, if Derived has same type as boost::typeindex::type_index.Override: This function may be redefined and made public in Derived class. Overrides must not throw. Overrides must not remove const, volatile && and & modifiers from T. + +type_index for type T. +Derivedconst T &Variable which runtime type will be stored in type_index. This is a factory method that is used to create instances of Derived classes. boost::typeindex::type_id_runtime(const T&) will call this method, if Derived has same type as boost::typeindex::type_index.Override: This function may be redefined and made public in Derived class. + +type_index with runtime type of variable. + + + + +boolconst type_index_facade &const type_index_facade &noexcept comparison operators for type_index_facade classes. +boolconst type_index_facade &const TypeInfo &noexcept comparison operators for type_index_facade and it's TypeInfo classes. +boolconst TypeInfo &const type_index_facade &noexcept comparison operators for type_index_facade's TypeInfo and type_index_facade classes. +std::basic_ostream< CharT, TriatT > &std::basic_ostream< CharT, TriatT > &const type_index_facade< Derived, TypeInfo > &Ostream operator that will output demangled name. +std::size_tconst type_index_facade< Derived, TypeInfo > &This free function is used by Boost's unordered containers. <boost/functional/hash.hpp> has to be included if this function is used. + + + + + + + + + + + +std::size_tItIt + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/type_index/doc/type_index.qbk b/tools/boost_1_65_1/libs/type_index/doc/type_index.qbk new file mode 100644 index 0000000000000000000000000000000000000000..539fc83be7c88257224aa2ed65dd1b18ef55eef6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/doc/type_index.qbk @@ -0,0 +1,483 @@ +[library Boost.TypeIndex + [quickbook 1.6] + [version 4.1] + [copyright 2012-2016 Antony Polukhin] + [category Language Features Emulation] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[section Motivation] +Sometimes getting and storing information about a type at runtime is required. For such cases a construction like `&typeid(T)` or C++11 class `std::type_index` is usually used, which is where problems start: + +* `typeid(T)` and `std::type_index` require Run Time Type Info (RTTI) +* some implementations of `typeid(T)` erroneously do not strip const, volatile and references from type +* some compilers have bugs and do not correctly compare `std::type_info` objects across shared libraries +* only a few implementations of Standard Library currently provide `std::type_index` +* no easy way to store type info without stripping const, volatile and references +* no nice and portable way to get human readable type names +* no way to easily make your own type info class + +Boost.TypeIndex library was designed to work around all those issues. + +[note `T` means type here. Think of it as of `T` in `template ` ] + +[endsect] + +[section Getting started] + +[classref boost::typeindex::type_info boost::typeindex::type_info] is a drop-in replacement for `std::type_info` and +[classref boost::typeindex::type_index boost::typeindex::type_index] +is a drop-in replacement for `std::type_index`. Unlike Standard Library versions those classes can work without RTTI. + +`type_index` provides the full set of comparison operators, hashing functions and ostream +operators, so it can be used with any container class. + +[section How to use] + +To start using Boost.TypeIndex: + +[table:porting +[[Replace this:][With the following:][More Info]] +[[`` + #include + #include +``][`` + #include +``][ + [headerref boost/type_index.hpp more... ] +]] + +[[`` + std::type_index +``][`` + boost::typeindex::type_index +``][ + [classref boost::typeindex::type_index more... ] +]] + +[[`` + typeid(T) + typeid(T).name() // not human readable + typeid(variable) +``][`` + boost::typeindex::type_id() + boost::typeindex::type_id().pretty_name() // human readable + boost::typeindex::type_id_runtime(variable) +``][ + [funcref boost::typeindex::type_id more... ] + + [classref boost::typeindex::type_index more... ] + + [funcref boost::typeindex::type_id_runtime more... ] +]] + +[[`` + // attempt to save const, volatile, reference + typeid(please_save_modifiers) +``][`` + // cvr = const, volatile, reference + boost::typeindex::type_id_with_cvr() +``][ + [funcref boost::typeindex::type_id_with_cvr more... ] +]] + +[[`` + // when reference to `std::type_info` is required + const std::type_info& v1 = typeid(int); + + // other cases + const std::type_info* v2 = &typeid(int); +``][`` + const boost::typeindex::type_info& v1 + = boost::typeindex::type_id().type_info(); + + boost::typeindex::type_index v2 + = boost::typeindex::type_id(); +``][ + [classref boost::typeindex::type_index more... ] + + [funcref boost::typeindex::type_id more... ] +]] +] + +If you are using [funcref boost::typeindex::type_id_runtime type_id_runtime()] methods +and RTTI is disabled, make sure that classes that are passed to +`type_id_runtime()` are marked with +[macroref BOOST_TYPE_INDEX_REGISTER_CLASS BOOST_TYPE_INDEX_REGISTER_CLASS] macro. + +[endsect] + +[section Example with Boost.Any] + +Here is how TypeIndex could be used in `boost/any.hpp`: +[table:any +[[Before] [With TypeIndex]] +[[``#include ``][``#include ``]] +[[`` + virtual const std::type_info & type() const BOOST_NOEXCEPT + { + // requires RTTI + return typeid(ValueType); + } +``] [`` + virtual const boost::typeindex::type_info & type() const BOOST_NOEXCEPT + { + // now works even with RTTI disabled + return boost::typeindex::type_id().type_info(); + } +``]] +] + +[endsect] + + +[section Example with Boost.Variant] + +Here is how TypeIndex could be used in `boost/variant/variant.hpp`: +[table:variant +[[Before] [With TypeIndex]] + +[[`` +#if !defined(BOOST_NO_TYPEID) +#include // for typeid, std::type_info +#endif // BOOST_NO_TYPEID +``][`` +#include +``]] +[[`` +#if !defined(BOOST_NO_TYPEID) + +class reflect + : public static_visitor +{ +public: // visitor interfaces + + template + const std::type_info& operator()(const T&) const BOOST_NOEXCEPT + { + return typeid(T); + } + +}; + +#endif // BOOST_NO_TYPEID +``][`` +class reflect + : public static_visitor +{ +public: // visitor interfaces + + template + const boost::typeindex::type_info& operator()(const T&) const BOOST_NOEXCEPT + { + return boost::typeindex::type_id().type_info(); + } + +}; +``]] +[[`` +#if !defined(BOOST_NO_TYPEID) + const std::type_info& type() const + { + detail::variant::reflect visitor; + return this->apply_visitor(visitor); + } +#endif +``] [`` + const boost::typeindex::type_info& type() const + { + detail::variant::reflect visitor; + return this->apply_visitor(visitor); + } +``]] +] + +[endsect] +[endsect] + +[section:config Configuring and building the library] + +TypeIndex is a header only library and it does not use Boost libraries that require +building. You just need to `#include ` to start using it. + +The library supports a number of configuration macros, defining which require full +rebuild of all the projects that use TypeIndex: + +[table Configuration macros + [[Macro name] [Short description]] + [[[macroref BOOST_TYPE_INDEX_USER_TYPEINDEX]] [ Macro that allows you to use your +own implementation of TypeIndex instead of the default all around the projects and libraries.]] + + [[[macroref BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY]] [ Macro that must be defined +if you are mixing RTTI-on and RTTI-off.]] + + [[[macroref BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING] and +[macroref BOOST_TYPE_INDEX_FUNCTION_SIGNATURE]] [ Macros that allow you to specify +parsing options and type name generating macro for RTTI-off cases. ]] +] + +You can define configuration macros in the `bjam` command line using one of the following +approaches: + +[pre + b2 variant=release define=BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY stage +] + +[pre + b2 variant=release "define=BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING='(39, 1, true, \\"T = \\")'" stage +] + +However, it may be more convenient to define configuration macros in the "boost/config/user.hpp" +file in order to automatically define them both for the library and user's projects. + +[endsect] + +[section How it works] +`type_index` is just a typedef for [classref boost::typeindex::stl_type_index] +or [classref boost::typeindex::ctti_type_index]. + +Depending on the `typeid()` availability TypeIndex library will choose an optimal class for +`type_index`. In cases when at least basic support for `typeid()` is available `stl_type_index` will be used. + +[macroref BOOST_TYPE_INDEX_REGISTER_CLASS] macro is a helper macro that places some virtual helper functions or +expands to nothing. + +[macroref BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS] macro is a helper macro that places the same +helpers as BOOST_TYPE_INDEX_REGISTER_CLASS plus some additional helpers for boost::typeindex::runtime_cast +to function. + +Issues with cross module type comparison on a bugged compilers are bypassed by directly comparing strings with type +(latest versions of those compilers resolved that issue using exactly the same approach). + +[endsect] + +[section Examples] + +[import ../examples/demangled_names.cpp] +[section Getting human readable and mangled type names] [type_index_names_example] [endsect] + +[import ../examples/registry.cpp] +[section Storing information about a type in container ] [type_index_registry_example] [endsect] + +[import ../examples/inheritance.cpp] +[section Getting through the inheritance to receive a real type name ] [type_index_derived_example] [endsect] + +[import ../examples/runtime_cast.cpp] +[section Using runtime_cast where RTTI is unavailable or undesirable ] [type_index_runtime_cast_example] [endsect] + +[import ../examples/exact_types_match.cpp] +[section Exact type matching: storing type with const, volatile and reference qualifiers] [type_index_exact_type_match_example] [endsect] + +[import ../examples/table_of_names.cpp] +[section Table of raw_name() and pretty_name() outputs with and without RTTI ] [type_index_names_table] [endsect] + +[import ../examples/constexpr14_namespace_check.cpp] +[section C++14: Checking namespace at compile time ] [type_index_constexpr14_namespace_example] [endsect] + +[import ../examples/constexpr14_sort_check.cpp] +[section C++14: Checking lexigraphical order of provided types ] [type_index_constexpr14_sort_check_example] [endsect] + +[endsect] + +[xinclude autodoc.xml] + +[section Making a custom type_index] + +Sometimes there may be a need to create your own type info system. This may be useful if you wish to store some more info about types (PODness, size of a type, pointers to common functions...) or if you have an idea of a more compact types representations. + +[import ../examples/user_defined_typeinfo.hpp] +[import ../examples/user_defined_typeinfo.cpp] + +[section Basics] +[type_index_userdefined_usertypes] +[type_index_userdefined_enum] +[type_index_my_type_index] +[type_index_my_type_index_usage] +[endsect] + +[section Getting type infos at runtime] +[type_index_my_type_index_register_class] +[type_index_my_type_index_type_id_runtime_implmentation] +[type_index_my_type_index_type_id_runtime_classes] +[type_index_my_type_index_type_id_runtime_test] +[endsect] + +[section Using new type infos all around the code] +[type_index_my_type_index_worldwide_macro] +[type_index_my_type_index_worldwide_typedefs] +[type_index_my_type_index_worldwide_usage] +[endsect] + +[endsect] + + +[section Space and Performance] + +* `ctti_type_index` uses macro for getting full text representation of function name which could lead to code bloat, +so prefer using `stl_type_index` type when possible. +* All the type_index classes hold a single pointer and are fast to copy. +* Calls to `const char* raw_name()` do not require dynamic memory allocation and usually just return a pointer to an array of chars in a read-only section of the binary image. +* Comparison operators are optimized as much as possible and execute a single `std::strcmp` in worst case. +* Calls to `std::string pretty_name()` usually require dynamic memory allocation and some computations, so they are not recommended for usage in performance critical sections. + +[endsect] + +[section Code bloat] + +Without RTTI TypeIndex library will switch from using `boost::typeindex::stl_type_index` class to +`boost::typeindex::ctti_type_index`. `boost::typeindex::ctti_type_index` uses macro for getting full +text representation of function name for each type that is passed to `type_id()` and +`type_id_with_cvr()` functions. + +This leads to big strings in binary file: +``` +static const char* boost::detail::ctti::n() [with T = int] +static const char* boost::detail::ctti::n() [with T = user_defined_type] +``` +While using RTTI, you'll get the following (more compact) string in binary file: + +``` +i +17user_defined_type +``` + +[endsect] + +[section RTTI emulation limitations] + +TypeIndex has been tested and successfully work on many compilers. + +[warning + With RTTI off classes with exactly the same names defined in different modules in anonymous namespaces may collapse: + ``` + // In A.cpp + namespace { struct user_defined{}; } + type_index foo_a() { return type_id(); } + + // In B.cpp + namespace { struct user_defined{}; } + type_index foo_b() { return type_id(); } + + // In main.cpp + assert(foo_a() != foo_b()); // will fail on some compilers + ``` + + *Compilers that have that limitation:* GCC, CLANG, Intel. + + *Test:* you can test this issue by runing the `testing_crossmodule_anonymous_no_rtti` that can be build if you run `../../../b2` in `type_index/test/` folder. +] + +[section Define the BOOST_TYPE_INDEX_FUNCTION_SIGNATURE macro] + +If you get the following error during compilation +`` + TypeIndex library could not detect your compiler. + Please make the BOOST_TYPE_INDEX_FUNCTION_SIGNATURE macro use + correct compiler macro for getting the whole function name. + Define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING to correct value after that. +`` +then you are using a compiler that was not tested with this library. + +[macroref BOOST_TYPE_INDEX_FUNCTION_SIGNATURE] must be defined to a compiler specific macro, that outputs the *whole* +function signature including template parameters. + + +[endsect] + +[section Fixing pretty_name() output] + +If the output of `boost::typeindex::ctti_type_index::type_id().name()` +* returns not just `int` but also a lot of text around the `int` +* or does not return type at all +then you are using a compiler that was not tested with this library and you need to setup the +[macroref BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING] macro. + +Here is a short instruction: + +# get the output of `boost::typeindex::ctti_type_index::type_id().name()` +# define [macroref BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING] to +`(skip_at_begin, skip_at_end, false, "")`, where + * `skip_at_begin` is equal to characters count before the first occurrence of `int` in output + * `skip_at_end` is equal to characters count after last occurrence of `int` in output +# check that `boost::typeindex::ctti_type_index::type_id().name_demangled()` returns "int" +# if it does not return `int`, then define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING to +`(skip_at_begin, skip_at_end, true, "T = ")`, where + * `skip_at_begin` is equal to `skip_at_begin` at step 2 + * `skip_at_end` is equal to `skip_at_end` at step 2 + * `"T = "` is equal to characters that are right before the `int` in output +# (optional, but highly recommended) [@http://www.boost.org/support/bugs.html create ticket] with +feature request to add your compiler to supported compilers list. Include +parameters provided to `BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING` macro. + + +Consider the following example: + +`boost::typeindex::ctti_type_index::type_id().raw_name()` returns +"const char *__cdecl boost::detail::ctti::n(void)". Then you shall set +`skip_at_begin` to `sizeof("const char *__cdecl boost::detail::ctti<") - 1` +and `skip_at_end` to `sizeof(">::n(void)") - 1`. + +`` +#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (39, 6, false, "") +`` + +Another example: + +`boost::typeindex::ctti_type_index::type_id().raw_name()` returns +"static const char *boost::detail::ctti::n() [T = int]"". Then you shall set +`skip_at_begin` to `sizeof("static const char *boost::detail::ctti<") - 1` +and `skip_at_end` to `sizeof("]") - 1` and last parameter of macro to "T = ". + +`` +#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (39, 1, true, "T = ") +`` + +[endsect] + +[endsect] + +[section Mixing sources with RTTI on and RTTI off] + +Linking a binary from source files that were compiled with different RTTI flags is not a very good +idea and may lead to a lot of surprises. However if there is a very strong need, TypeIndex library +provides a solution for mixing sources: just define [macroref BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY] +macro. This would lead to usage of same type_index class (`boost::typeindex::ctti_type_index` or +`boost::typeindex::stl_type_index`) all around the project. + +[note Do not forget to rebuild *all* the projects with `BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY` macro defined ] + +You must know that linking RTTI on and RTTI off binaries may succeed even without defining the +`BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY` macro, but that does not mean that you'll get a +working binary. Such actions may break the One Definition Rule. Take a look at the table below, +that shows how the `boost::type_index get_integer();` function will look like with different +RTTI flags: + +[table:diffs +[[RTTI on] [RTTI off]] +[[`boost::typeindex::stl_type_index get_integer();`] [`boost::typeindex::ctti_type_index get_integer();`]] +] + +Such differences are usually not detected by linker and lead to errors at runtime. + +[warning + Even with `BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY` defined there is no guarantee + that everything will be OK. Libraries that use their own workarounds for disabled RTTI + may fail to link or to work correctly. +] + +[endsect] + +[section Acknowledgements] + +In order of helping and advising: + +* Peter Dimov for writing source codes in late 2007, that gave me an idea of how to emulate RTTI. +* Agustín Bergé K-ballo for helping with docs and fixing a lot of typos. +* Niall Douglas for generating a lot of great ideas, reviewing the sources and being the review manager for the library. +* All the library reviewers, especially Andrey Semashev, for making good notes and proposing improvements to the library. + +[endsect] diff --git a/tools/boost_1_65_1/libs/type_index/examples/constexpr14_namespace_check.cpp b/tools/boost_1_65_1/libs/type_index/examples/constexpr14_namespace_check.cpp new file mode 100644 index 0000000000000000000000000000000000000000..98a5e40fff9e6ba9e41b11cdaed057657286b0f4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/constexpr14_namespace_check.cpp @@ -0,0 +1,97 @@ +// Copyright 2013-2017 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +#include + +template +void do_something(const T&) {} + + +#if !defined(BOOST_NO_CXX14_CONSTEXPR) && !defined(BOOST_NO_CXX11_CONSTEXPR) +// Implementation of this function is not essential for the example +template +constexpr bool starts_with(const char* name, const char (&ns)[N]) noexcept { + for (std::size_t i = 0; i < N - 1; ++i) + if (name[i] != ns[i]) + return false; + + return true; +} + +//[type_index_constexpr14_namespace_example +/*` + The following example shows that `boost::typeindex::ctti_type_index` is usable at compile time on + a C++14 compatible compilers. + + In this example we'll create and use a constexpr function that checks namespace of the provided type. +*/ + +#include + +// Helper function that returns true if `name` starts with `substr` +template +constexpr bool starts_with(const char* name, const char (&substr)[N]) noexcept; + + +// Function that returns true if `T` declared in namespace `ns` +template +constexpr bool in_namespace(const char (&ns)[N]) noexcept { + const char* name = boost::typeindex::ctti_type_index::type_id().raw_name(); + + // Some compilers add `class ` or `struct ` before the namespace, so we need to skip those words first + if (starts_with(name, "class ")) { + name += sizeof("class ") - 1; + } else if (starts_with(name, "struct ")) { + name += sizeof("struct ") - 1; + } + + return starts_with(name, ns) && starts_with(name + N - 1, "::"); +} + +/*` + Now when we have that wonderfull function, we can do static assertions and other compile-time validations: +*/ + +namespace my_project { + struct serializer { + template + void serialize(const T& value) { + static_assert( + in_namespace("my_project::types") || in_namespace("my_project::types_ext"), + "Only types from namespaces `my_project::types` and `my_project::types_ext` are allowed to be serialized using `my_project::serializer`" + ); + + // Actual implementation of the serialization goes below + // ... + do_something(value); + } + }; + + namespace types { + struct foo{}; + struct bar{}; + } +} // namespace my_project + +int main() { + my_project::serializer s; + my_project::types::foo f; + my_project::types::bar b; + + s.serialize(f); + s.serialize(b); + + // short sh = 0; + // s.serialize(sh); // Fails the static_assert! +} +//] [/type_index_constexpr14_namespace_example] + +#else // #if !defined(BOOST_NO_CXX14_CONSTEXPR) && !defined(BOOST_NO_CXX11_CONSTEXPR) + +int main() {} + +#endif + diff --git a/tools/boost_1_65_1/libs/type_index/examples/constexpr14_sort_check.cpp b/tools/boost_1_65_1/libs/type_index/examples/constexpr14_sort_check.cpp new file mode 100644 index 0000000000000000000000000000000000000000..452b98a0ec31b5bb76463742549074873eaf86c7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/constexpr14_sort_check.cpp @@ -0,0 +1,76 @@ +// Copyright 2013-2016 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +#include + +#if !defined(BOOST_NO_CXX14_CONSTEXPR) && !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + +//[type_index_constexpr14_sort_check_example +/*` + The following example shows that `boost::typeindex::ctti_type_index` is usable at compile time on + a C++14 compatible compilers to check order of template parameters. + + Consider the situation when we have a function that accepts std::tuple, boost::variant or some other class that uses variadic templates: +*/ + +template class types{}; + +template +void do_something(const types& t) noexcept; + +/*` + Such functions may be very usefull, however they may significantly increase the size of the resulting program. Each instantionation of such function with different templates order + consumes space in the resulting program: + + // Types are same, but different order leads to new instantionation of do_something function. + types + types + types + types + types + types + + One of the ways to reduce instantinations count is to force the types to have some order: +*/ + + +#include + +// Implementing type trait that returns true if the types are sorted lexographicaly +template +constexpr bool is_asc_sorted(types) noexcept { + return true; +} + +template +constexpr bool is_asc_sorted(types) noexcept { + using namespace boost::typeindex; + return ctti_type_index::type_id() <= ctti_type_index::type_id() + && is_asc_sorted(types()); +} + + +// Using the newly created `is_asc_sorted` trait: +template +void do_something(const types& /*value*/) noexcept { + static_assert( + is_asc_sorted( types() ), + "T... for do_something(const types& t) must be sorted ascending" + ); +} + +int main() { + do_something( types() ); + // do_something( types() ); // Fails the static_assert! +} +//] [/type_index_constexpr14_sort_check_example] + +#else // #if !defined(BOOST_NO_CXX14_CONSTEXPR) && !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + +int main() {} + +#endif + diff --git a/tools/boost_1_65_1/libs/type_index/examples/demangled_names.cpp b/tools/boost_1_65_1/libs/type_index/examples/demangled_names.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d148b5d3c9e13e7f6c75f451f94748f67f90bdee --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/demangled_names.cpp @@ -0,0 +1,76 @@ +// Copyright 2013-2014 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + + +//[type_index_names_example +/*` + The following example shows how short (mangled) and human readable type names could be obtained from a type. + Works with and without RTTI. +*/ + + +#include +#include + +template +void foo(T) { + std::cout << "\n Short name: " << boost::typeindex::type_id().raw_name(); + std::cout << "\n Readable name: " << boost::typeindex::type_id().pretty_name(); +} + +struct user_defined_type{}; + +namespace ns1 { namespace ns2 { + struct user_defined_type{}; +}} // namespace ns1::ns2 + +namespace { + struct in_anon_type{}; +} // anonymous namespace + +int main() { + // Call to + foo(1); + // will output something like this: + // + // (RTTI on) (RTTI off) + // Short name: i Short name: int] + // Readable name: int Readable name: int + + user_defined_type t; + foo(t); + // Will output: + // + // (RTTI on) (RTTI off) + // Short name: 17user_defined_type user_defined_type] + // Readable name: user_defined_type user_defined_type + + ns1::ns2::user_defined_type t_in_ns; + foo(t_in_ns); + // Will output: + // + // (RTTI on) (RTTI off) + // Short name: N3ns13ns217user_defined_typeE ns1::ns2::user_defined_type] + // Readable name: ns1::ns2::user_defined_type ns1::ns2::user_defined_type + + in_anon_type anon_t; + foo(anon_t); + // Will output: + // + // (RTTI on) (RTTI off) + // Short name: N12_GLOBAL__N_112in_anon_typeE {anonymous}::in_anon_type] + // Readable name: (anonymous namespace)::in_anon_type {anonymous}::in_anon_type +} + +/*` + Short names are very compiler dependant: some compiler will output `.H`, others `i`. + + Readable names may also differ between compilers: `struct user_defined_type`, `user_defined_type`. + + [warning With RTTI off different classes with same names in anonymous namespace may collapse. See 'RTTI emulation limitations'. ] +*/ + +//] [/type_index_names_example] diff --git a/tools/boost_1_65_1/libs/type_index/examples/exact_types_match.cpp b/tools/boost_1_65_1/libs/type_index/examples/exact_types_match.cpp new file mode 100644 index 0000000000000000000000000000000000000000..498d662b739303bf3a6dcd1cfc5b9a550ca7eac8 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/exact_types_match.cpp @@ -0,0 +1,74 @@ +// Copyright 2013-2015 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +//[type_index_exact_type_match_example +/*` + The following example shows that `type_index` (and `type_info`) is able to store the exact type, + without stripping const, volatile and references. Example works with and without RTTI. + + In this example we'll create a class that stores a pointer to function and remembers the exact type of the + parameter the function accepts. When the call to the bound function is made, he actual input parameter + type is checked against the stored parameter type and an exception is thrown in case of mismatch. +*/ + +#include +#include +#include +#include + +//<- +// Making `#include ` visible in docs, while actually using hand-made check +// instead of `assert`. This is required to verify correct behavior even if NDEBUG +// is defined and to avoid `unused local variable` warnings with defined NDEBUG. +#ifdef assert +# undef assert +#endif +#define assert(X) if (!(X)) std::exit(__LINE__) + /* !Comment block is not closed intentionaly! +//-> +#include +//<- + !Closing comment block! */ +//-> + +class type_erased_unary_function { + void* function_ptr_; + boost::typeindex::type_index exact_param_t_; + +public: + template + type_erased_unary_function(void(*ptr)(ParamT)) + : function_ptr_(reinterpret_cast(ptr)) // ptr - is a pointer to function returning `void` and accepting parameter of type `ParamT` + , exact_param_t_(boost::typeindex::type_id_with_cvr()) + {} + + template + void call(ParamT v) { + if (exact_param_t_ != boost::typeindex::type_id_with_cvr()) { + throw std::runtime_error("Incorrect `ParamT`"); + } + + return (reinterpret_cast(function_ptr_))(v); + } +}; + +void foo(int){} + +int main() { + type_erased_unary_function func(&foo); + func.call(100); // OK, `100` has type `int` + + try { + int i = 100; + + // An attempt to convert stored function to a function accepting reference + func.call(i); // Will throw, because types `int&` and `int` mismatch + + assert(false); + } catch (const std::runtime_error& /*e*/) {} +} + +//] [/type_index_exact_type_match_example] diff --git a/tools/boost_1_65_1/libs/type_index/examples/inheritance.cpp b/tools/boost_1_65_1/libs/type_index/examples/inheritance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3da75271e81a45d35a379c9139045f99ebef1c53 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/inheritance.cpp @@ -0,0 +1,47 @@ +// Copyright 2013-2014 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +//[type_index_derived_example +/*` + The following example shows that `type_info` is able to store the real type, successfully getting through + all the inheritances. + + Example works with and without RTTI." +*/ + +#include +#include +#include + +struct A { + BOOST_TYPE_INDEX_REGISTER_CLASS + virtual ~A(){} +}; +struct B: public A { BOOST_TYPE_INDEX_REGISTER_CLASS }; +struct C: public B { BOOST_TYPE_INDEX_REGISTER_CLASS }; +struct D: public C { BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS(BOOST_TYPE_INDEX_NO_BASE_CLASS) }; + +void print_real_type(const A& a) { + std::cout << boost::typeindex::type_id_runtime(a).pretty_name() << '\n'; +} + +int main() { + C c; + const A& c_as_a = c; + print_real_type(c_as_a); // Outputs `struct C` + print_real_type(B()); // Outputs `struct B` + +/*` + It's also possible to use type_id_runtime with the BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS, which adds additional + information for runtime_cast to work. +*/ + D d; + const A& d_as_a = d; + print_real_type(d_as_a); // Outputs `struct D` + +} + +//] [/type_index_derived_example] diff --git a/tools/boost_1_65_1/libs/type_index/examples/registry.cpp b/tools/boost_1_65_1/libs/type_index/examples/registry.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4f1eaa8683aeeb832176c5c7c6e61f4b32d71fae --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/registry.cpp @@ -0,0 +1,50 @@ +// Copyright 2013-2015 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +//[type_index_registry_example +/*` + The following example shows how an information about a type could be stored. + Example works with and without RTTI. +*/ + +#include +#include +//<- +// Making `#include ` visible in docs, while actually using `BOOST_TEST` +// instead of `assert`. This is required to verify correct behavior even if NDEBUG +// is defined and to avoid `unused local variable` warnings with defined NDEBUG. +#include +#ifdef assert +# undef assert +#endif +#define assert(X) BOOST_TEST(X) + /* !Comment block is not closed intentionaly! +//-> +#include +//<- + !Closing comment block! */ +//-> + +int main() { + boost::unordered_set types; + + // Storing some `boost::type_info`s + types.insert(boost::typeindex::type_id()); + types.insert(boost::typeindex::type_id()); + + // `types` variable contains two `boost::type_index`es: + assert(types.size() == 2); + + // Const, volatile and reference will be striped from the type: + bool is_inserted = types.insert(boost::typeindex::type_id()).second; + assert(!is_inserted); + assert(types.erase(boost::typeindex::type_id()) == 1); + + // We have erased the `float` type, only `int` remains + assert(*types.begin() == boost::typeindex::type_id()); +} + +//] [/type_index_registry_example] diff --git a/tools/boost_1_65_1/libs/type_index/examples/runtime_cast.cpp b/tools/boost_1_65_1/libs/type_index/examples/runtime_cast.cpp new file mode 100644 index 0000000000000000000000000000000000000000..43e7aa70f4ca1f295eda8444259ab4837fdac248 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/runtime_cast.cpp @@ -0,0 +1,90 @@ +// +// Copyright (c) Chris Glover, 2016. +// +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +//[type_index_runtime_cast_example +/*` + The following example shows that `runtime_cast` is able to find a valid pointer + in various class hierarchies regardless of inheritance or type relation. + + Example works with and without RTTI." +*/ + +#include +#include + +struct A { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS(BOOST_TYPE_INDEX_NO_BASE_CLASS) + virtual ~A() + {} +}; + +struct B { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS(BOOST_TYPE_INDEX_NO_BASE_CLASS) + virtual ~B() + {} +}; + +struct C : A { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS((A)) +}; + +struct D : B { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS((B)) +}; + +struct E : C, D { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS((C)(D)) +}; + +int main() { + C c; + A* a = &c; + + if(C* cp = boost::typeindex::runtime_cast(a)) { + std::cout << "Yes, a points to a C: " + << a << "->" << cp << '\n'; + } + else { + std::cout << "Error: Expected a to point to a C" << '\n'; + } + + if(E* ce = boost::typeindex::runtime_cast(a)) { + std::cout << "Error: Expected a to not points to an E: " + << a << "->" << ce << '\n'; + } + else { + std::cout << "But, a does not point to an E" << '\n'; + } + + E e; + C* cp2 = &e; + if(D* dp = boost::typeindex::runtime_cast(cp2)) { + std::cout << "Yes, we can cross-cast from a C* to a D* when we actually have an E: " + << cp2 << "->" << dp << '\n'; + } + else { + std::cout << "Error: Expected cp to point to a D" << '\n'; + } + +/*` + Alternatively, we can use runtime_pointer_cast so we don't need to specity the target as a pointer. + This works for smart_ptr types too. +*/ + A* ap = &e; + if(B* bp = boost::typeindex::runtime_pointer_cast(ap)) { + std::cout << "Yes, we can cross-cast and up-cast at the same time." + << ap << "->" << bp << '\n'; + } + else { + std::cout << "Error: Expected ap to point to a B" << '\n'; + } + + return 0; +} + +//] [/type_index_runtime_cast_example] diff --git a/tools/boost_1_65_1/libs/type_index/examples/table_of_names.cpp b/tools/boost_1_65_1/libs/type_index/examples/table_of_names.cpp new file mode 100644 index 0000000000000000000000000000000000000000..262e5f4fe0d6c9c6e4137673c0d9626e9973031d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/table_of_names.cpp @@ -0,0 +1,90 @@ +// Copyright 2013-2014 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + + +//[type_index_names_table +/*` + The following example shows how different type names look when we explicitly use classes for RTTI and RTT off. + + This example requires RTTI. For a more portable example see 'Getting human readable and mangled type names': +*/ + + +#include +#include +#include + +template +void print(const char* name) { + boost::typeindex::stl_type_index sti = boost::typeindex::stl_type_index::type_id(); + boost::typeindex::ctti_type_index cti = boost::typeindex::ctti_type_index::type_id(); + std::cout << "\t[" /* start of the row */ + << "[" << name << "]" + << "[`" << sti.raw_name() << "`] " + << "[`" << sti.pretty_name() << "`] " + << "[`" << cti.raw_name() << "`] " + << "]\n" /* end of the row */ ; +} + +struct user_defined_type{}; + +namespace ns1 { namespace ns2 { + struct user_defined_type{}; +}} // namespace ns1::ns2 + +namespace { + struct in_anon_type{}; +} // anonymous namespace + +namespace ns3 { namespace { namespace ns4 { + struct in_anon_type{}; +}}} // namespace ns3::{anonymous}::ns4 + + +template +class templ {}; + +template <> +class templ {}; + +int main() { + std::cout << "[table:id Table of names\n"; + std::cout << "\t[[Type] [RTTI & raw_name] [RTTI & pretty_name] [noRTTI & raw_name]]\n"; + + print("User defined type"); + print("In anonymous namespace"); + print("In ns3::{anonymous}::ns4 namespace"); + print >("Template class"); + print >("Template class (full specialization)"); + print, + templ + > >("Template class with templae classes"); + + + std::cout << "]\n"; +} + +/*` + Code from the example will produce the following table: + + [table:id Table of names + [[Type] [RTTI & raw_name] [RTTI & pretty_name] [noRTTI & raw_name]] + [[User defined type][`17user_defined_type`] [`user_defined_type`] [`user_defined_type]`] ] + [[In anonymous namespace][`N12_GLOBAL__N_112in_anon_typeE`] [`(anonymous namespace)::in_anon_type`] [`{anonymous}::in_anon_type]`] ] + [[In ns3::{anonymous}::ns4 namespace][`N3ns312_GLOBAL__N_13ns412in_anon_typeE`] [`ns3::(anonymous namespace)::ns4::in_anon_type`] [`ns3::{anonymous}::ns4::in_anon_type]`] ] + [[Template class][`5templIsiE`] [`templ`] [`templ]`] ] + [[Template class (full specialization)][`5templIiiE`] [`templ`] [`templ]`] ] + [[Template class with template classes][`5templIS_IcaES_Ii17user_defined_typeEE`] [`templ, templ >`] [`templ, templ >]`] ] + ] + + We have not show the "noRTTI & pretty_name" column in the table because it is almost equal + to "noRTTI & raw_name" column. + + [warning With RTTI off different classes with same names in anonymous namespace may collapse. See 'RTTI emulation limitations'. ] +*/ + +//] [/type_index_names_table] diff --git a/tools/boost_1_65_1/libs/type_index/examples/user_defined_typeinfo.cpp b/tools/boost_1_65_1/libs/type_index/examples/user_defined_typeinfo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b4fd076ff8ee60099ff60c00e47c1d45a962db55 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/user_defined_typeinfo.cpp @@ -0,0 +1,69 @@ +// Copyright 2013-2015 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + + +//[type_index_my_type_index_worldwide_macro +/*` + There is an easy way to force `boost::typeindex::type_id` to use your own type_index class. + + All we need to do is just define `BOOST_TYPE_INDEX_USER_TYPEINDEX` to the full path to header file + of your type index class: +*/ + +// BOOST_TYPE_INDEX_USER_TYPEINDEX must be defined *BEFORE* first inclusion of +#define BOOST_TYPE_INDEX_USER_TYPEINDEX +#include +//] [/type_index_my_type_index_worldwide_macro] + +#include +#ifdef assert +# undef assert +#endif +#define assert(X) BOOST_TEST(X) + + +using namespace my_namespace; + +int main() { +//[type_index_my_type_index_usage +/*` + Finally we can use the my_type_index class for getting type indexes: +*/ + + my_type_index + cl1 = my_type_index::type_id(), + st1 = my_type_index::type_id(), + st2 = my_type_index::type_id(), + vec = my_type_index::type_id() + ; + + assert(cl1 != st1); + assert(st2 == st1); + assert(vec.pretty_name() == "my_classes"); + assert(cl1.pretty_name() == "my_class"); + +//] [/type_index_my_type_index_usage] + +//[type_index_my_type_index_type_id_runtime_test +/*` + Now the following example will compile and work. +*/ + my_struct str; + my_class& reference = str; + assert(my_type_index::type_id() == my_type_index::type_id_runtime(reference)); +//][/type_index_my_type_index_type_id_runtime_test] + +//[type_index_my_type_index_worldwide_usage +/*` + That's it! Now all TypeIndex global methods and typedefs will be using your class: +*/ + boost::typeindex::type_index worldwide = boost::typeindex::type_id(); + assert(worldwide.pretty_name() == "my_classes"); + assert(worldwide == my_type_index::type_id()); +//][/type_index_my_type_index_worldwide_usage] +} + + diff --git a/tools/boost_1_65_1/libs/type_index/examples/user_defined_typeinfo.hpp b/tools/boost_1_65_1/libs/type_index/examples/user_defined_typeinfo.hpp new file mode 100644 index 0000000000000000000000000000000000000000..dc2caab6436709dedda3b334812d8d92f2e26305 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/examples/user_defined_typeinfo.hpp @@ -0,0 +1,204 @@ +// Copyright 2013-2014 Antony Polukhin + +// Distributed under the Boost Software License, Version 1.0. +// (See the accompanying file LICENSE_1_0.txt +// or a copy at .) + +#ifndef USER_DEFINED_TYPEINFO_HPP +#define USER_DEFINED_TYPEINFO_HPP + +//[type_index_userdefined_usertypes +/*` + The following example shows how a user defined type_info can be created and used. + Example works with and without RTTI. + + Consider situation when user uses only those types in `typeid()`: +*/ + +#include +#include + +namespace my_namespace { + +class my_class; +struct my_struct; + +typedef std::vector my_classes; +typedef std::string my_string; + +} // namespace my_namespace + +//] [/type_index_userdefined_usertypes] + + +//[type_index_userdefined_enum +/*` + In that case user may wish to save space in binary and create it's own type system. + For that case `detail::typenum<>` meta function is added. Depending on the input type T + this function will return different numeric values. +*/ +#include + +namespace my_namespace { namespace detail { + template struct typenum; + template <> struct typenum{ enum {value = 0}; }; + template <> struct typenum{ enum {value = 1}; }; + template <> struct typenum{ enum {value = 2}; }; + template <> struct typenum{ enum {value = 3}; }; + template <> struct typenum{ enum {value = 4}; }; + + // my_typeinfo structure is used to save type number + struct my_typeinfo { + const char* const type_; + }; + + const my_typeinfo infos[5] = { + {"void"}, {"my_class"}, {"my_struct"}, {"my_classes"}, {"my_string"} + }; + + template + inline const my_typeinfo& my_typeinfo_construct() { + return infos[typenum::value]; + } +}} // my_namespace::detail + +//] [/type_index_userdefined_usertypes] + + +//[type_index_my_type_index +/*` + `my_type_index` is a user created type_index class. If in doubt during this phase, you can always + take a look at the `` or `` + files. Documentation for `type_index_facade` could be also useful. +*/ + +/*` + Since we are not going to override `type_index_facade::hash_code()` we must additionally include + ``. +*/ +#include + +/*` + See implementation of `my_type_index`: +*/ +namespace my_namespace { + +class my_type_index: public boost::typeindex::type_index_facade { + const detail::my_typeinfo* data_; + +public: + typedef detail::my_typeinfo type_info_t; + + inline my_type_index() BOOST_NOEXCEPT + : data_(&detail::my_typeinfo_construct()) + {} + + inline my_type_index(const type_info_t& data) BOOST_NOEXCEPT + : data_(&data) + {} + + inline const type_info_t& type_info() const BOOST_NOEXCEPT { + return *data_; + } + + inline const char* raw_name() const BOOST_NOEXCEPT { + return data_->type_; + } + + inline std::string pretty_name() const { + return data_->type_; + } + + template + inline static my_type_index type_id() BOOST_NOEXCEPT { + return detail::my_typeinfo_construct(); + } + + template + inline static my_type_index type_id_with_cvr() BOOST_NOEXCEPT { + return detail::my_typeinfo_construct(); + } + + template + inline static my_type_index type_id_runtime(const T& variable) BOOST_NOEXCEPT; +}; + +} // namespace my_namespace + +/*` + Note that we have used the boost::typeindex::type_index_facade class as base. + That class took care about all the helper function and operators (comparison, hashing, ostreaming and others). +*/ + +//] [/type_index_my_type_index] + +//[type_index_my_type_index_register_class +/*` + Usually to allow runtime type info we need to register class with some macro. + Let's see how a `MY_TYPEINDEX_REGISTER_CLASS` macro could be implemented for our `my_type_index` class: +*/ +namespace my_namespace { namespace detail { + + template + inline const my_typeinfo& my_typeinfo_construct_ref(const T*) { + return my_typeinfo_construct(); + } + +#define MY_TYPEINDEX_REGISTER_CLASS \ + virtual const my_namespace::detail::my_typeinfo& type_id_runtime() const { \ + return my_namespace::detail::my_typeinfo_construct_ref(this); \ + } + +}} // namespace my_namespace::detail + +//] [/type_index_my_type_index_register_class] + +//[type_index_my_type_index_type_id_runtime_implmentation +/*` + Now when we have a MY_TYPEINDEX_REGISTER_CLASS, let's implement a `my_type_index::type_id_runtime` method: +*/ +namespace my_namespace { + template + my_type_index my_type_index::type_id_runtime(const T& variable) BOOST_NOEXCEPT { + // Classes that were marked with `MY_TYPEINDEX_REGISTER_CLASS` will have a + // `type_id_runtime()` method. + return variable.type_id_runtime(); + } +} +//] [/type_index_my_type_index_type_id_runtime_implmentation] + +//[type_index_my_type_index_type_id_runtime_classes +/*` + Consider the situation, when `my_class` and `my_struct` are polymorphic classes: +*/ + +namespace my_namespace { + +class my_class { +public: + MY_TYPEINDEX_REGISTER_CLASS + virtual ~my_class() {} +}; + +struct my_struct: public my_class { + MY_TYPEINDEX_REGISTER_CLASS +}; + +} // namespace my_namespace + +//] [/type_index_my_type_index_type_id_runtime_classes] + + +//[type_index_my_type_index_worldwide_typedefs +/*` + You'll also need to add some typedefs and macro to your "user_defined_typeinfo.hpp" header file: +*/ +#define BOOST_TYPE_INDEX_REGISTER_CLASS MY_TYPEINDEX_REGISTER_CLASS +namespace boost { namespace typeindex { + typedef my_namespace::my_type_index type_index; +}} +//] [/type_index_my_type_index_worldwide_typedefs] + + +#endif // USER_DEFINED_TYPEINFO_HPP + diff --git a/tools/boost_1_65_1/libs/type_index/index.html b/tools/boost_1_65_1/libs/type_index/index.html new file mode 100644 index 0000000000000000000000000000000000000000..52e48da7869d87195b528f87a53e576306e31550 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/index.html @@ -0,0 +1,35 @@ + + + + + + +Boost.TypeIndex + + + +

+ Automatic redirection failed, please go to + ../../doc/html/boost_typeindex.html +

+

+ © 2014 Antony Polukhin +

+ + diff --git a/tools/boost_1_65_1/libs/type_index/meta/libraries.json b/tools/boost_1_65_1/libs/type_index/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..5fff00aaf76e5c0b3fa27159cfc160a86287d117 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/meta/libraries.json @@ -0,0 +1,14 @@ +{ + "key": "type_index", + "name": "Type Index", + "authors": [ + "Antony Polukhin" + ], + "maintainers": [ + "Antony Polukhin " + ], + "description": "Runtime/Compile time copyable type info.", + "category": [ + "Emulation" + ] +} diff --git a/tools/boost_1_65_1/libs/type_index/patched/README.md b/tools/boost_1_65_1/libs/type_index/patched/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4dab0d6903fd8d9ab74a96b7f15606e69e5bd617 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/patched/README.md @@ -0,0 +1,9 @@ +patches for Boost libraries to work without RTTI +========== + +Here are the patches that are TESTED and work well with RTTI disabled and enabled. +Patches add tests for some of the libraries to make sure that library compile and work without RTTI. + +Patches remove duplicate code, improve output, allow compilation with RTTI off... + +Libraries Boost.Graph, Boost.XPressive, Boost.PropertyMap and others may also benefit from TypeIndex library. diff --git a/tools/boost_1_65_1/libs/type_index/patched/boost_detail_sp_typeinfo.patch b/tools/boost_1_65_1/libs/type_index/patched/boost_detail_sp_typeinfo.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0649e0d33160f616665b9940dcf3121792de52d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/patched/boost_detail_sp_typeinfo.patch @@ -0,0 +1,151 @@ +From b77c0af6af8bc4797defc3627878acc3cf7a6f39 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 17:57:24 +0400 +Subject: [PATCH] detail/sp_typeinfo.hpp now uses TypeIndex + +--- + include/boost/detail/sp_typeinfo.hpp | 123 +++-------------------------------- + 1 file changed, 8 insertions(+), 115 deletions(-) + +diff --git a/include/boost/detail/sp_typeinfo.hpp b/include/boost/detail/sp_typeinfo.hpp +index 43fae78..fbdf86d 100644 +--- a/include/boost/detail/sp_typeinfo.hpp ++++ b/include/boost/detail/sp_typeinfo.hpp +@@ -10,126 +10,19 @@ + // detail/sp_typeinfo.hpp + // + // Copyright 2007 Peter Dimov ++// Copyright 2014 Antony Polukhin + // + // Distributed under the Boost Software License, Version 1.0. + // See accompanying file LICENSE_1_0.txt or copy at + // http://www.boost.org/LICENSE_1_0.txt) + +-#include ++#include ++namespace boost { namespace detail { ++ ++typedef boost::typeind::type_info sp_typeinfo; ++ ++}} // namespace boost::detail + +-#if defined( BOOST_NO_TYPEID ) +- +-#include +-#include +- +-namespace boost +-{ +- +-namespace detail +-{ +- +-class sp_typeinfo +-{ +-private: +- +- sp_typeinfo( sp_typeinfo const& ); +- sp_typeinfo& operator=( sp_typeinfo const& ); +- +- char const * name_; +- +-public: +- +- explicit sp_typeinfo( char const * name ): name_( name ) +- { +- } +- +- bool operator==( sp_typeinfo const& rhs ) const +- { +- return this == &rhs; +- } +- +- bool operator!=( sp_typeinfo const& rhs ) const +- { +- return this != &rhs; +- } +- +- bool before( sp_typeinfo const& rhs ) const +- { +- return std::less< sp_typeinfo const* >()( this, &rhs ); +- } +- +- char const* name() const +- { +- return name_; +- } +-}; +- +-template struct sp_typeid_ +-{ +- static sp_typeinfo ti_; +- +- static char const * name() +- { +- return BOOST_CURRENT_FUNCTION; +- } +-}; +- +-#if defined(__SUNPRO_CC) +-// see #4199, the Sun Studio compiler gets confused about static initialization +-// constructor arguments. But an assignment works just fine. +-template sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name(); +-#else +-template sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name()); +-#endif +- +-template struct sp_typeid_< T & >: sp_typeid_< T > +-{ +-}; +- +-template struct sp_typeid_< T const >: sp_typeid_< T > +-{ +-}; +- +-template struct sp_typeid_< T volatile >: sp_typeid_< T > +-{ +-}; +- +-template struct sp_typeid_< T const volatile >: sp_typeid_< T > +-{ +-}; +- +-} // namespace detail +- +-} // namespace boost +- +-#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_::ti_) +- +-#else +- +-#include +- +-namespace boost +-{ +- +-namespace detail +-{ +- +-#if defined( BOOST_NO_STD_TYPEINFO ) +- +-typedef ::type_info sp_typeinfo; +- +-#else +- +-typedef std::type_info sp_typeinfo; +- +-#endif +- +-} // namespace detail +- +-} // namespace boost +- +-#define BOOST_SP_TYPEID(T) typeid(T) +- +-#endif ++#define BOOST_SP_TYPEID(T) (boost::typeind::type_id().type_info()) + + #endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED +-- +1.8.5.3 + diff --git a/tools/boost_1_65_1/libs/type_index/patched/boost_exception.patch b/tools/boost_1_65_1/libs/type_index/patched/boost_exception.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b3643e05232c65dc28dbc0a64996b5afd5ac46f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/patched/boost_exception.patch @@ -0,0 +1,156 @@ +From 8f57d59bfbc978673a2493a90b4f3e7e54ddbf18 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 18:30:11 +0400 +Subject: [PATCH] Boost.Exception now uses TypeIndex to reduce duplicate code + and simplify name demanglings + +--- + include/boost/exception/detail/type_info.hpp | 43 +++------------------- + include/boost/exception/diagnostic_information.hpp | 2 +- + include/boost/exception/exception.hpp | 3 +- + include/boost/exception/info.hpp | 2 +- + test/Jamfile.v2 | 2 + + 5 files changed, 12 insertions(+), 40 deletions(-) + +diff --git a/include/boost/exception/detail/type_info.hpp b/include/boost/exception/detail/type_info.hpp +index 6e5942d..a247b71 100644 +--- a/include/boost/exception/detail/type_info.hpp ++++ b/include/boost/exception/detail/type_info.hpp +@@ -12,13 +12,7 @@ + #pragma warning(push,1) + #endif + +-#include +-#include +-#include +-//#ifndef BOOST_NO_TYPEID +-//#include +-//#endif +-#include ++#include + + namespace + boost +@@ -28,11 +22,7 @@ boost + std::string + tag_type_name() + { +-#ifdef BOOST_NO_TYPEID +- return BOOST_CURRENT_FUNCTION; +-#else +- return /*units::detail::demangle*/(typeid(T*).name()); +-#endif ++ return boost::typeind::type_id().pretty_name(); + } + + template +@@ -40,41 +30,20 @@ boost + std::string + type_name() + { +-#ifdef BOOST_NO_TYPEID +- return BOOST_CURRENT_FUNCTION; +-#else +- return /*units::detail::demangle*/(typeid(T).name()); +-#endif ++ return boost::typeind::type_id().pretty_name(); + } + + namespace + exception_detail + { +- struct +- type_info_ +- { +- detail::sp_typeinfo const * type_; +- +- explicit +- type_info_( detail::sp_typeinfo const & type ): +- type_(&type) +- { +- } +- +- friend +- bool +- operator<( type_info_ const & a, type_info_ const & b ) +- { +- return 0!=(a.type_->before(*b.type_)); +- } +- }; ++ typedef boost::typeind::type_index type_info_; + } + } + +-#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T)) ++#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::typeind::type_id() + + #ifndef BOOST_NO_RTTI +-#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x)) ++#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::typeind::type_id_runtime(x) + #endif + + #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp +index 2f5cb88..0f8b5e8 100644 +--- a/include/boost/exception/diagnostic_information.hpp ++++ b/include/boost/exception/diagnostic_information.hpp +@@ -151,7 +151,7 @@ boost + #ifndef BOOST_NO_RTTI + if ( verbose ) + tmp << std::string("Dynamic exception type: ") << +- /*units::detail::demangle*/((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n'; ++ /*units::detail::demangle*/((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)))) << '\n'; + #endif + if( with_what && se && verbose ) + tmp << "std::exception::what: " << wh << '\n'; +diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp +index 9f20a04..53c341f 100644 +--- a/include/boost/exception/exception.hpp ++++ b/include/boost/exception/exception.hpp +@@ -12,6 +12,8 @@ + #pragma warning(push,1) + #endif + ++#include ++ + namespace + boost + { +@@ -151,7 +153,6 @@ boost + exception_detail + { + class error_info_base; +- struct type_info_; + + struct + error_info_container +diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp +index edbf058..e0f4950 100644 +--- a/include/boost/exception/info.hpp ++++ b/include/boost/exception/info.hpp +@@ -96,7 +96,7 @@ boost + { + shared_ptr const & p = i->second; + #ifndef BOOST_NO_RTTI +- BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); ++ BOOST_ASSERT(BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti ); + #endif + return p; + } +diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 +index d2dfcd6..5bd076d 100644 +--- a/test/Jamfile.v2 ++++ b/test/Jamfile.v2 +@@ -35,7 +35,9 @@ run enable_error_info_test.cpp helper1.cpp ; + run throw_exception_test.cpp helper2.cpp ; + run errno_test.cpp ; + run error_info_test.cpp ; ++run error_info_test.cpp : : : off : error_info_test_rtti ; + run diagnostic_information_test.cpp ; ++run diagnostic_information_test.cpp : : : off : diagnostic_information_test_rtti ; + run refcount_ptr_test.cpp ; + run current_exception_cast_test.cpp ; + run no_exceptions_test.cpp : : : off ; +-- +1.8.5.3 + diff --git a/tools/boost_1_65_1/libs/type_index/patched/boost_smart_ptr.patch b/tools/boost_1_65_1/libs/type_index/patched/boost_smart_ptr.patch new file mode 100644 index 0000000000000000000000000000000000000000..5120199ceb2a43f4a69dc2559648d66ca60136b3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/patched/boost_smart_ptr.patch @@ -0,0 +1,26 @@ +From 03194eefcb9c3314054855d28bd9a90d3188768d Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 18:50:10 +0400 +Subject: [PATCH] Use TypeIndex features in Boost.SharedPtr to avoid type_info + related bugs + +--- + include/boost/smart_ptr/detail/sp_counted_impl.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/boost/smart_ptr/detail/sp_counted_impl.hpp b/include/boost/smart_ptr/detail/sp_counted_impl.hpp +index a7b43ae..5955036 100644 +--- a/include/boost/smart_ptr/detail/sp_counted_impl.hpp ++++ b/include/boost/smart_ptr/detail/sp_counted_impl.hpp +@@ -155,7 +155,7 @@ public: + + virtual void * get_deleter( detail::sp_typeinfo const & ti ) + { +- return ti == BOOST_SP_TYPEID(D)? &reinterpret_cast( del ): 0; ++ return ti == boost::typeind::type_id()? &reinterpret_cast( del ): 0; + } + + virtual void * get_untyped_deleter() +-- +1.8.5.3 + diff --git a/tools/boost_1_65_1/libs/type_index/test/Jamfile.v2 b/tools/boost_1_65_1/libs/type_index/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..8a1d3a46f82e4e4a0010cee3cb19758df8c35c94 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/Jamfile.v2 @@ -0,0 +1,77 @@ +# Copyright (C) 2012-2014 Antony Polukhin +# +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +# + +import testing ; +import feature ; +import os ; + +# Variable that contains all the stuff required for linking together on and off +compat = BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY ; + +# Making own `nortti` that is link compatible. +# We explicitly define BOOST_NO_RTTI because it sometimes can not be detected by build system. +nortti = gcc:"-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" clang:"-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" intel:"-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" darwin:"-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID" msvc:/GR- ; + +norttidefines = gcc:"-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" clang:"-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" intel:"-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" darwin:"-DBOOST_NO_RTTI -DBOOST_NO_TYPEID" msvc:-DBOOST_NO_RTTI ; + + +# Making libraries that CANNOT work between rtti-on/rtti-off modules +obj test_lib_nortti-obj : test_lib.cpp : shared off $(norttidefines) ; +obj test_lib_anonymous_nortti-obj : test_lib_anonymous.cpp : shared off $(norttidefines) ; +lib test_lib_nortti : test_lib_nortti-obj : shared off $(norttidefines) ; +lib test_lib_anonymous_nortti : test_lib_anonymous_nortti-obj : shared off $(norttidefines) ; + +obj test_lib_rtti-obj : test_lib.cpp : shared ; +obj test_lib_anonymous_rtti-obj : test_lib_anonymous.cpp : shared ; +lib test_lib_rtti : test_lib_rtti-obj : shared ; +lib test_lib_anonymous_rtti : test_lib_anonymous_rtti-obj : shared ; + +# Making libraries that can work between rtti-on/rtti-off modules +obj test_lib_nortti_compat-obj : test_lib.cpp : shared $(nortti) $(compat) ; +obj test_lib_rtti_compat-obj : test_lib.cpp : shared $(nortti) $(compat) ; +lib test_lib_nortti_compat : test_lib_nortti_compat-obj : shared $(nortti) $(compat) ; +lib test_lib_rtti_compat : test_lib_rtti_compat-obj : shared $(nortti) $(compat) ; + +exe testing_crossmodule_anonymous_no_rtti : testing_crossmodule_anonymous.cpp test_lib_anonymous_nortti : off $(norttidefines) ; + +test-suite type_index + : + [ run type_index_test.cpp ] + [ run type_index_runtime_cast_test.cpp ] + [ run type_index_constexpr_test.cpp ] + [ run type_index_test.cpp : : : off $(norttidefines) : type_index_test_no_rtti ] + [ run ctti_print_name.cpp : : : always_show_run_output ] + [ run testing_crossmodule.cpp test_lib_rtti ] + [ run testing_crossmodule.cpp test_lib_nortti : : : off $(norttidefines) : testing_crossmodule_no_rtti ] + [ run testing_crossmodule_anonymous.cpp test_lib_anonymous_rtti ] + [ run compare_ctti_stl.cpp ] + + [ compile-fail type_index_test_ctti_copy_fail.cpp ] + [ compile-fail type_index_test_ctti_construct_fail.cpp ] + [ compile type_index_test_ctti_alignment.cpp ] + + # Mixing RTTI on and off + [ link-fail testing_crossmodule.cpp test_lib_rtti : $(nortti) : link_fail_nortti_rtti ] + # MSVC sometimes overrides the /GR-, without `detect_missmatch` this test may link + [ link-fail testing_crossmodule.cpp test_lib_nortti : : link_fail_rtti_nortti ] + [ run testing_crossmodule.cpp test_lib_rtti_compat : : : $(nortti) $(compat) : testing_crossmodule_nortti_rtti_compat ] + [ run testing_crossmodule.cpp test_lib_nortti_compat : : : $(compat) : testing_crossmodule_rtti_nortti_compat ] + ; + +# Assuring that examples compile and run. Adding sources from `examples` directory to the `type_index` test suite. +for local p in [ glob ../examples/*.cpp ] +{ + # RTTI on + type_index += [ run $(p) ] ; + + # RTTI off + local target_name = $(p[1]:B)_no_rtti ; + if $(target_name) != "table_of_names_no_rtti" + { + type_index += [ run $(p) : : : off $(norttidefines) : $(target_name) ] ; + } +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/compare_ctti_stl.cpp b/tools/boost_1_65_1/libs/type_index/test/compare_ctti_stl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3388ffd1c316f56c5d1bb9323fbc6c8f09bf4fac --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/compare_ctti_stl.cpp @@ -0,0 +1,67 @@ +// +// Copyright Klemens Morgenstern, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + + +namespace my_namespace1 { + class my_class{}; +} + + +namespace my_namespace2 { + class my_class{}; +} + +namespace my_namespace3 +{ +template +struct my_template {}; + +} + +#if !defined( BOOST_NO_RTTI ) + +template +void compare() +{ + typedef boost::typeindex::ctti_type_index ctti; + typedef boost::typeindex::stl_type_index stl; + BOOST_TEST_EQ( + ctti::type_id().pretty_name(), + stl::type_id().pretty_name() + ); +} + + +int main() +{ + compare(); + compare(); + compare(); + compare(); + compare(); + + compare >(); + + + return boost::report_errors(); +} + +#else + +int main() +{ + return 0; +} + +#endif + diff --git a/tools/boost_1_65_1/libs/type_index/test/ctti_print_name.cpp b/tools/boost_1_65_1/libs/type_index/test/ctti_print_name.cpp new file mode 100644 index 0000000000000000000000000000000000000000..34f03d070d1ce79c3d0c6b728ad04f9e58d0e7ed --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/ctti_print_name.cpp @@ -0,0 +1,36 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +// This cpp file: +// * tests BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro +// * outputs full ctti name so that TypeIndex library could be adjust to new compiler without requesting regression tester's help +#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (0,0,false,"") +#include + +namespace user_defined_namespace { + class user_defined_class {}; +} + +int main() +{ + using namespace boost::typeindex; + + std::cout << "int: " + << ctti_type_index::type_id() << '\n'; + + std::cout << "double: " + << ctti_type_index::type_id() << '\n'; + + std::cout << "user_defined_namespace::user_defined_class: " + << ctti_type_index::type_id() << '\n'; + + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/test_lib.cpp b/tools/boost_1_65_1/libs/type_index/test/test_lib.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c3fa68708a30018eefbc7a48c8034d0b7448fb3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/test_lib.cpp @@ -0,0 +1,40 @@ +// +// Copyright (c) Antony Polukhin, 2012-2015. +// +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#define TEST_LIB_SOURCE +#include "test_lib.hpp" + +namespace user_defined_namespace { + class user_defined{}; +} + +namespace test_lib { + +boost::typeindex::type_index get_integer() { + return boost::typeindex::type_id(); +} + +boost::typeindex::type_index get_user_defined_class() { + return boost::typeindex::type_id(); +} + +boost::typeindex::type_index get_const_integer() { + return boost::typeindex::type_id_with_cvr(); +} + +boost::typeindex::type_index get_const_user_defined_class() { + return boost::typeindex::type_id_with_cvr(); +} + +#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH +// Just do nothing +void accept_typeindex(const boost::typeindex::type_index&) {} +#endif + +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/test_lib.hpp b/tools/boost_1_65_1/libs/type_index/test/test_lib.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a18c3503374837867a385acc55ca79ee8446d335 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/test_lib.hpp @@ -0,0 +1,42 @@ +// +// Copyright (c) Antony Polukhin, 2012-2015. +// +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_TYPE_INDEX_TESTS_TEST_LIB_HPP +#define BOOST_TYPE_INDEX_TESTS_TEST_LIB_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +// This is ALWAYS a dynamic library +#if defined(TEST_LIB_SOURCE) +# define TEST_LIB_DECL BOOST_SYMBOL_EXPORT +# else +# define TEST_LIB_DECL BOOST_SYMBOL_IMPORT +# endif + +namespace test_lib { + +TEST_LIB_DECL boost::typeindex::type_index get_integer(); +TEST_LIB_DECL boost::typeindex::type_index get_user_defined_class(); + +TEST_LIB_DECL boost::typeindex::type_index get_const_integer(); +TEST_LIB_DECL boost::typeindex::type_index get_const_user_defined_class(); + +#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH +// This is required for checking RTTI on/off linkage +TEST_LIB_DECL void accept_typeindex(const boost::typeindex::type_index&); +#endif + +} + +#endif // BOOST_TYPE_INDEX_TESTS_LIB1_HPP + diff --git a/tools/boost_1_65_1/libs/type_index/test/test_lib_anonymous.cpp b/tools/boost_1_65_1/libs/type_index/test/test_lib_anonymous.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a1fd808eed3d2659317adda4986e82db8de107e4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/test_lib_anonymous.cpp @@ -0,0 +1,27 @@ +// +// Copyright (c) Antony Polukhin, 2012-2015. +// +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#define TEST_LIB_SOURCE +#include "test_lib_anonymous.hpp" + +namespace { + class user_defined{}; +} // anonymous namespace + +namespace test_lib { + +boost::typeindex::type_index get_anonymous_user_defined_class() { + return boost::typeindex::type_id(); +} + +boost::typeindex::type_index get_const_anonymous_user_defined_class() { + return boost::typeindex::type_id_with_cvr(); +} + +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/test_lib_anonymous.hpp b/tools/boost_1_65_1/libs/type_index/test/test_lib_anonymous.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7ec6be4186a3db7458a64bf9f95ef50b835912a4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/test_lib_anonymous.hpp @@ -0,0 +1,34 @@ +// +// Copyright (c) Antony Polukhin, 2012-2015. +// +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_TYPE_INDEX_TESTS_TEST_LIB_ANONYMOUS_HPP +#define BOOST_TYPE_INDEX_TESTS_TEST_LIB_ANONYMOUS_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +#include + +// This is ALWAYS a dynamic library +#if defined(TEST_LIB_SOURCE) +# define TEST_LIB_DECL BOOST_SYMBOL_EXPORT +# else +# define TEST_LIB_DECL BOOST_SYMBOL_IMPORT +# endif + +namespace test_lib { + +TEST_LIB_DECL boost::typeindex::type_index get_anonymous_user_defined_class(); +TEST_LIB_DECL boost::typeindex::type_index get_const_anonymous_user_defined_class(); + +} + +#endif // BOOST_TYPE_INDEX_TESTS_TEST_LIB_ANONYMOUS_HPP + diff --git a/tools/boost_1_65_1/libs/type_index/test/testing_crossmodule.cpp b/tools/boost_1_65_1/libs/type_index/test/testing_crossmodule.cpp new file mode 100644 index 0000000000000000000000000000000000000000..25ff5085b16433df765cd6905b13461563a738ed --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/testing_crossmodule.cpp @@ -0,0 +1,55 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include "test_lib.hpp" + +#include + +namespace user_defined_namespace { + class user_defined{}; +} + +void comparing_types_between_modules() +{ + boost::typeindex::type_index t_const_int = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t_int = boost::typeindex::type_id(); + + BOOST_TEST_EQ(t_int, test_lib::get_integer()); + BOOST_TEST_EQ(t_const_int, test_lib::get_const_integer()); + BOOST_TEST_NE(t_const_int, test_lib::get_integer()); + BOOST_TEST_NE(t_int, test_lib::get_const_integer()); + + + boost::typeindex::type_index t_const_userdef + = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t_userdef + = boost::typeindex::type_id(); + + BOOST_TEST_EQ(t_userdef, test_lib::get_user_defined_class()); + BOOST_TEST_EQ(t_const_userdef, test_lib::get_const_user_defined_class()); + BOOST_TEST_NE(t_const_userdef, test_lib::get_user_defined_class()); + BOOST_TEST_NE(t_userdef, test_lib::get_const_user_defined_class()); + + + BOOST_TEST_NE(t_userdef, test_lib::get_integer()); + BOOST_TEST_NE(t_const_userdef, test_lib::get_integer()); + BOOST_TEST_NE(t_int, test_lib::get_user_defined_class()); + BOOST_TEST_NE(t_const_int, test_lib::get_const_user_defined_class()); + + #ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH + test_lib::accept_typeindex(t_int); + #endif +} + + +int main() { + comparing_types_between_modules(); + + return boost::report_errors(); +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/testing_crossmodule_anonymous.cpp b/tools/boost_1_65_1/libs/type_index/test/testing_crossmodule_anonymous.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c68f69f5b68e11f3cff9b3627458e64d65f8d573 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/testing_crossmodule_anonymous.cpp @@ -0,0 +1,35 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include +#include "test_lib_anonymous.hpp" + +#define BOOST_CHECK_NE(x, y) BOOST_CHECK(x != y) + +namespace { + class user_defined{}; +} + +void comparing_anonymous_types_between_modules() +{ + boost::typeindex::type_index t_const_userdef = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t_userdef = boost::typeindex::type_id(); + + BOOST_TEST_NE(t_userdef, test_lib::get_anonymous_user_defined_class()); + BOOST_TEST_NE(t_const_userdef, test_lib::get_const_anonymous_user_defined_class()); + BOOST_TEST_NE(t_const_userdef, test_lib::get_anonymous_user_defined_class()); + BOOST_TEST_NE(t_userdef, test_lib::get_const_anonymous_user_defined_class()); +} + +int main() { + comparing_anonymous_types_between_modules(); + + return boost::report_errors(); +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/type_index_constexpr_test.cpp b/tools/boost_1_65_1/libs/type_index/test/type_index_constexpr_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..acc55e9ed94bc84c6d47e8ba5b72570cb477ae24 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/type_index_constexpr_test.cpp @@ -0,0 +1,148 @@ +// +// Copyright Antony Polukhin, 2015-2016. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include +#include +#include + +#include +#define BOOST_TEST_LE(x, y) BOOST_TEST(x <= y) +#define BOOST_TEST_GE(x, y) BOOST_TEST(x >= y) + +const char* hello1 = "Hello word"; +const char* hello1_end = hello1 + sizeof("Hello word"); +const char* hello2 = "Hello word, pal!"; +const char* hello2_end = hello2 + sizeof("Hello word, pal!"); + +void strcmp_same() { + using boost::typeindex::detail::constexpr_strcmp; + + BOOST_TEST( + constexpr_strcmp(hello1, hello1) == 0 + ); + + BOOST_TEST( + constexpr_strcmp(hello2, hello2) == 0 + ); + + BOOST_TEST( + constexpr_strcmp(hello1, hello2) != 0 + ); + + BOOST_TEST( + constexpr_strcmp(hello2, hello1) != 0 + ); + + BOOST_TEST( + (constexpr_strcmp(hello2, hello1) < 0) + == + (std::strcmp(hello2, hello1) < 0) + ); + + BOOST_TEST( + (constexpr_strcmp(hello1, hello2) < 0) + == + (std::strcmp(hello1, hello2) < 0) + ); +} + +void search_same() { + using boost::typeindex::detail::constexpr_search; + BOOST_TEST( + constexpr_search(hello1, hello1_end, hello2, hello2_end) == std::search(hello1, hello1_end, hello2, hello2_end) + ); + + BOOST_TEST( + constexpr_search(hello2, hello2_end, hello1, hello1_end) == std::search(hello2, hello2_end, hello1, hello1_end) + ); + + const char* word = "word"; + const char* word_end = word + sizeof("word") - 1; + BOOST_TEST( + constexpr_search(hello1, hello1_end, word, word_end) == std::search(hello1, hello1_end, word, word_end) + ); + + BOOST_TEST( + constexpr_search(hello2, hello2_end, word, word_end) == std::search(hello2, hello2_end, word, word_end) + ); +} + +template +BOOST_CXX14_CONSTEXPR bool in_namespace(const char (&ns)[N]) BOOST_NOEXCEPT { + BOOST_CXX14_CONSTEXPR const char* name = boost::typeindex::ctti_type_index::type_id().raw_name(); + for (std::size_t i = 0; i < N - 1; ++i) + if (name[i] != ns[i]) + return false; + + return true; +} + +template +BOOST_CXX14_CONSTEXPR bool is_boost_namespace() BOOST_NOEXCEPT { + return in_namespace("boost::") || in_namespace("class boost::") || in_namespace("struct boost::"); +} + +void constexpr_test() { + using namespace boost::typeindex; + + BOOST_CXX14_CONSTEXPR ctti_type_index t_int0 = ctti_type_index::type_id(); + BOOST_CXX14_CONSTEXPR ctti_type_index t_short0 = ctti_type_index::type_id(); + BOOST_CXX14_CONSTEXPR ctti_type_index t_int1 = ctti_type_index::type_id(); + BOOST_CXX14_CONSTEXPR ctti_type_index t_short1 = ctti_type_index::type_id(); + + BOOST_CXX14_CONSTEXPR bool same0 = (t_int0 == t_int1); + BOOST_TEST(same0); + + BOOST_CXX14_CONSTEXPR bool same1 = (t_short1 == t_short0); + BOOST_TEST(same1); + + BOOST_CXX14_CONSTEXPR bool same2 = (t_int1 == t_int1); + BOOST_TEST(same2); + + BOOST_CXX14_CONSTEXPR bool same3 = (t_short0 == t_short0); + BOOST_TEST(same3); + + BOOST_CXX14_CONSTEXPR bool same4 = !(t_short0 < t_short0 || t_short0 > t_short0); + BOOST_TEST(same4); + + BOOST_CXX14_CONSTEXPR bool same5 = (t_short0 <= t_short0 && t_short0 >= t_short0); + BOOST_TEST(same5); + + + BOOST_CXX14_CONSTEXPR bool not_same0 = (t_int0 != t_short1); + BOOST_TEST(not_same0); + + BOOST_CXX14_CONSTEXPR bool not_same1 = (t_int1 != t_short0); + BOOST_TEST(not_same1); + + BOOST_CXX14_CONSTEXPR bool not_same2 = (t_int1 < t_short0 || t_int1 > t_short0); + BOOST_TEST(not_same2); + + + BOOST_CXX14_CONSTEXPR const char* int_name = t_int0.name(); + BOOST_TEST(*int_name != '\0'); + + BOOST_CXX14_CONSTEXPR const char* short_name = t_short0.name(); + BOOST_TEST(*short_name != '\0'); + + BOOST_CXX14_CONSTEXPR bool in_namespace = is_boost_namespace(); + BOOST_TEST(in_namespace); + + BOOST_CXX14_CONSTEXPR bool not_in_namespace = !is_boost_namespace(); + BOOST_TEST(not_in_namespace); +} + + +int main() { + strcmp_same(); + search_same(); + constexpr_test(); + return boost::report_errors(); +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/type_index_runtime_cast_test.cpp b/tools/boost_1_65_1/libs/type_index/test/type_index_runtime_cast_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1f5344ef5e174be6a2e15cf8bd804294f3d408b0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/type_index_runtime_cast_test.cpp @@ -0,0 +1,296 @@ +// +// Copyright Chris Glover, 2016. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// #include +// #include + +#include +#include +#include + +#include + +#if !defined(BOOST_NO_CXX11_SMART_PTR) +# include +#endif + +// Classes include a member variable "name" with the +// name of the class hard coded so we can be sure that +// the pointer offsets are all working, since we're doing +// a cast from void* at some point. + +#define IMPLEMENT_CLASS(type_name) \ + type_name() : name( #type_name ) {} \ + std::string name; + +struct base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST(BOOST_TYPE_INDEX_NO_BASE_CLASS) + IMPLEMENT_CLASS(base) +}; + +struct single_derived : base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(single_derived) +}; + +struct base1 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST(BOOST_TYPE_INDEX_NO_BASE_CLASS) + IMPLEMENT_CLASS(base1) +}; + +struct base2 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST(BOOST_TYPE_INDEX_NO_BASE_CLASS) + IMPLEMENT_CLASS(base2) +}; + +struct multiple_derived : base1, base2 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base1)(base2)) + IMPLEMENT_CLASS(multiple_derived) +}; + +struct baseV1 : virtual base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(baseV1) +}; + +struct baseV2 : virtual base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(baseV2) +}; + +struct multiple_virtual_derived : baseV1, baseV2 { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((baseV1)(baseV2)) + IMPLEMENT_CLASS(multiple_virtual_derived) +}; + +struct unrelated { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST(BOOST_TYPE_INDEX_NO_BASE_CLASS) + IMPLEMENT_CLASS(unrelated) +}; + +struct unrelated_with_base : base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(unrelated_with_base) +}; + +struct unrelatedV1 : virtual base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(unrelatedV1) +}; + +struct level1_a : base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(level1_a) +}; + +struct level1_b : base { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((base)) + IMPLEMENT_CLASS(level1_b) +}; + +struct level2 : level1_a, level1_b { + BOOST_TYPE_INDEX_IMPLEMENT_RUNTIME_CAST((level1_a)(level1_b)) + IMPLEMENT_CLASS(level2) +}; + +struct reg_base { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS(BOOST_TYPE_INDEX_NO_BASE_CLASS) +}; + +struct reg_derived : reg_base { + BOOST_TYPE_INDEX_REGISTER_RUNTIME_CLASS((reg_base)) +}; + +void no_base() +{ + using namespace boost::typeindex; + base b; + base* b2 = runtime_pointer_cast(&b); + BOOST_TEST_NE(b2, (base*)NULL); + BOOST_TEST_EQ(b2->name, "base"); + + BOOST_TEST_EQ(runtime_pointer_cast(&b), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(&b), (single_derived*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(&b), (unrelatedV1*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(&b), (unrelated_with_base*)NULL); +} + +void single_base() +{ + using namespace boost::typeindex; + single_derived d; + base* b = &d; + single_derived* d2 = runtime_pointer_cast(b); + BOOST_TEST_NE(d2, (single_derived*)NULL); + BOOST_TEST_EQ(d2->name, "single_derived"); + + BOOST_TEST_EQ(runtime_pointer_cast(&d), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(b), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(b), (unrelated_with_base*)NULL); +} + +void multiple_base() +{ + using namespace boost::typeindex; + multiple_derived d; + base1* b1 = &d; + multiple_derived* d2 = runtime_pointer_cast(b1); + BOOST_TEST_NE(d2, (multiple_derived*)NULL); + BOOST_TEST_EQ(d2->name, "multiple_derived"); + + base2* b2 = runtime_pointer_cast(b1); + BOOST_TEST_NE(b2, (base2*)NULL); + BOOST_TEST_EQ(b2->name, "base2"); + + BOOST_TEST_EQ(runtime_pointer_cast(&d), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(b1), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(b1), (unrelated_with_base*)NULL); +} + +void virtual_base() +{ + using namespace boost::typeindex; + multiple_virtual_derived d; + base* b = &d; + multiple_virtual_derived* d2 = runtime_pointer_cast(b); + baseV1* bv1 = runtime_pointer_cast(b); + baseV2* bv2 = runtime_pointer_cast(b); + + BOOST_TEST_NE(d2, (multiple_virtual_derived*)NULL); + BOOST_TEST_EQ(d2->name, "multiple_virtual_derived"); + + BOOST_TEST_NE(bv1, (baseV1*)NULL); + BOOST_TEST_EQ(bv1->name, "baseV1"); + + BOOST_TEST_NE(bv2, (baseV2*)NULL); + BOOST_TEST_EQ(bv2->name, "baseV2"); + + BOOST_TEST_EQ(runtime_pointer_cast(b), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(&d), (unrelated*)NULL); + BOOST_TEST_EQ(runtime_pointer_cast(b), (unrelated_with_base*)NULL); +} + +void pointer_interface() +{ + using namespace boost::typeindex; + single_derived d; + base* b = &d; + single_derived* d2 = runtime_cast(b); + BOOST_TEST_NE(d2, (single_derived*)NULL); + BOOST_TEST_EQ(d2->name, "single_derived"); + BOOST_TEST_EQ(runtime_pointer_cast(b), (unrelated*)NULL); +} + +void reference_interface() +{ + using namespace boost::typeindex; + single_derived d; + base& b = d; + single_derived& d2 = runtime_cast(b); + BOOST_TEST_EQ(d2.name, "single_derived"); + + try { + unrelated& u = runtime_cast(b); + (void)u; + BOOST_TEST(!"should throw bad_runtime_cast"); + } + catch(boost::typeindex::bad_runtime_cast&) { + } + catch(...) { + BOOST_TEST(!"should throw bad_runtime_cast"); + } +} + +void const_pointer_interface() +{ + using namespace boost::typeindex; + const single_derived d; + base const* b = &d; + single_derived const* d2 = runtime_cast(b); + BOOST_TEST_NE(d2, (single_derived*)NULL); + BOOST_TEST_EQ(d2->name, "single_derived"); + BOOST_TEST_EQ(runtime_pointer_cast(b), (unrelated*)NULL); +} + +void const_reference_interface() +{ + using namespace boost::typeindex; + const single_derived d; + base const& b = d; + single_derived const& d2 = runtime_cast(b); + BOOST_TEST_EQ(d2.name, "single_derived"); + + try { + unrelated const& u = runtime_cast(b); + (void)u; + BOOST_TEST(!"should throw bad_runtime_cast"); + } + catch(boost::typeindex::bad_runtime_cast&) { + } + catch(...) { + BOOST_TEST(!"should throw bad_runtime_cast"); + } +} + +void diamond_non_virtual() +{ + using namespace boost::typeindex; + level2 inst; + level1_a* l1a = &inst; + base* b1 = l1a; + level1_b* l1_b = runtime_cast(b1); + BOOST_TEST_NE(l1_b, (level1_b*)NULL); + BOOST_TEST_EQ(l1_b->name, "level1_b"); +} + +void boost_shared_ptr() +{ + using namespace boost::typeindex; + boost::shared_ptr d = boost::make_shared(); + boost::shared_ptr b = d; + boost::shared_ptr d2 = runtime_pointer_cast(b); + BOOST_TEST_NE(d2, boost::shared_ptr()); + BOOST_TEST_EQ(d2->name, "single_derived"); +} + +void std_shared_ptr() +{ +#if !defined(BOOST_NO_CXX11_SMART_PTR) + using namespace boost::typeindex; + std::shared_ptr d = std::make_shared(); + std::shared_ptr b = d; + std::shared_ptr d2 = runtime_pointer_cast(b); + BOOST_TEST_NE(d2, std::shared_ptr()); + BOOST_TEST_EQ(d2->name, "single_derived"); +#endif +} + +void register_runtime_class() +{ + using namespace boost::typeindex; + reg_derived rd; + reg_base* rb = &rd; + reg_derived* prd = runtime_pointer_cast(rb); + BOOST_TEST_NE(prd, (reg_derived*)NULL); + BOOST_TEST_EQ(type_id_runtime(*prd), type_id()); +} + +int main() { + no_base(); + single_derived(); + multiple_base(); + virtual_base(); + pointer_interface(); + reference_interface(); + const_pointer_interface(); + const_reference_interface(); + diamond_non_virtual(); + boost_shared_ptr(); + std_shared_ptr(); + register_runtime_class(); + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/type_index/test/type_index_test.cpp b/tools/boost_1_65_1/libs/type_index/test/type_index_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b7925d2ecf6c5d82f4fbb3445fba4f48a755ada9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/type_index_test.cpp @@ -0,0 +1,403 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include + +#include +#define BOOST_TEST_LE(x, y) BOOST_TEST(x <= y) +#define BOOST_TEST_GE(x, y) BOOST_TEST(x >= y) + + +namespace my_namespace1 { + class my_class{}; +} + + +namespace my_namespace2 { + class my_class{}; +} + + +void names_matches_type_id() +{ + using namespace boost::typeindex; + BOOST_TEST_EQ(type_id().pretty_name(), "int"); + BOOST_TEST_EQ(type_id().pretty_name(), "double"); + + BOOST_TEST_EQ(type_id().name(), type_id().name()); + BOOST_TEST_NE(type_id().name(), type_id().name()); + BOOST_TEST_NE(type_id().name(), type_id().name()); + BOOST_TEST_EQ(type_id().name(), type_id().name()); +} + +void default_construction() +{ + using namespace boost::typeindex; + type_index ti1, ti2; + BOOST_TEST_EQ(ti1, ti2); + BOOST_TEST_EQ(type_id(), ti1); + + BOOST_TEST_EQ(type_id().name(), ti1.name()); + BOOST_TEST_NE(type_id(), ti1); +} + + +void copy_construction() +{ + using namespace boost::typeindex; + type_index ti1, ti2 = type_id(); + BOOST_TEST_NE(ti1, ti2); + ti1 = ti2; + BOOST_TEST_EQ(ti2, ti1); + + const type_index ti3(ti1); + BOOST_TEST_EQ(ti3, ti1); +} + +void comparators_type_id() +{ + using namespace boost::typeindex; + type_index t_int = type_id(); + type_index t_double = type_id(); + + BOOST_TEST_EQ(t_int, t_int); + BOOST_TEST_LE(t_int, t_int); + BOOST_TEST_GE(t_int, t_int); + BOOST_TEST_NE(t_int, t_double); + + BOOST_TEST_LE(t_double, t_double); + BOOST_TEST_GE(t_double, t_double); + BOOST_TEST_NE(t_double, t_int); + + BOOST_TEST(t_double < t_int || t_int < t_double); + BOOST_TEST(t_double > t_int || t_int > t_double); +} + +void hash_code_type_id() +{ + using namespace boost::typeindex; + std::size_t t_int1 = type_id().hash_code(); + std::size_t t_double1 = type_id().hash_code(); + + std::size_t t_int2 = type_id().hash_code(); + std::size_t t_double2 = type_id().hash_code(); + + BOOST_TEST_EQ(t_int1, t_int2); + BOOST_TEST_NE(t_int1, t_double2); + BOOST_TEST_LE(t_double1, t_double2); +} + + + +template +static void test_with_modofiers() { + using namespace boost::typeindex; + + type_index t1 = type_id_with_cvr(); + type_index t2 = type_id_with_cvr(); + + BOOST_TEST_NE(t2, t1); + BOOST_TEST(t2 != t1.type_info()); + BOOST_TEST(t2.type_info() != t1); + + BOOST_TEST(t1 < t2 || t2 < t1); + BOOST_TEST(t1 > t2 || t2 > t1); + BOOST_TEST(t1.type_info() < t2 || t2.type_info() < t1); + BOOST_TEST(t1.type_info() > t2 || t2.type_info() > t1); + BOOST_TEST(t1 < t2.type_info() || t2 < t1.type_info()); + BOOST_TEST(t1 > t2.type_info() || t2 > t1.type_info()); + + // Chaecking that comparison operators overloads compile + BOOST_TEST(t1 <= t2 || t2 <= t1); + BOOST_TEST(t1 >= t2 || t2 >= t1); + BOOST_TEST(t1.type_info() <= t2 || t2.type_info() <= t1); + BOOST_TEST(t1.type_info() >= t2 || t2.type_info() >= t1); + BOOST_TEST(t1 <= t2.type_info() || t2 <= t1.type_info()); + BOOST_TEST(t1 >= t2.type_info() || t2 >= t1.type_info()); + + BOOST_TEST_EQ(t1, type_id_with_cvr()); + BOOST_TEST_EQ(t2, type_id_with_cvr()); + BOOST_TEST(t1 == type_id_with_cvr().type_info()); + BOOST_TEST(t2 == type_id_with_cvr().type_info()); + BOOST_TEST(t1.type_info() == type_id_with_cvr()); + BOOST_TEST(t2.type_info() == type_id_with_cvr()); + + BOOST_TEST_EQ(t1.hash_code(), type_id_with_cvr().hash_code()); + BOOST_TEST_EQ(t2.hash_code(), type_id_with_cvr().hash_code()); + + BOOST_TEST_NE(t1.hash_code(), type_id_with_cvr().hash_code()); + BOOST_TEST_NE(t2.hash_code(), type_id_with_cvr().hash_code()); +} + +void type_id_storing_modifiers() +{ + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); + test_with_modofiers(); +#endif +} + +template +static void test_storing_nonstoring_modifiers_templ() { + using namespace boost::typeindex; + + type_index t1 = type_id_with_cvr(); + type_index t2 = type_id(); + + BOOST_TEST_EQ(t2, t1); + BOOST_TEST_EQ(t1, t2); + BOOST_TEST(t1 <= t2); + BOOST_TEST(t1 >= t2); + BOOST_TEST(t2 <= t1); + BOOST_TEST(t2 >= t1); + + BOOST_TEST_EQ(t2.pretty_name(), t1.pretty_name()); +} + +void type_id_storing_modifiers_vs_nonstoring() +{ + test_storing_nonstoring_modifiers_templ(); + test_storing_nonstoring_modifiers_templ(); + test_storing_nonstoring_modifiers_templ(); + + boost::typeindex::type_index t1 = boost::typeindex::type_id_with_cvr(); + boost::typeindex::type_index t2 = boost::typeindex::type_id(); + BOOST_TEST_NE(t2, t1); + BOOST_TEST(t1.pretty_name() == "const int" || t1.pretty_name() == "int const"); +} + +void type_index_stream_operator_via_lexical_cast_testing() +{ + using namespace boost::typeindex; + + std::string s_int2 = boost::lexical_cast(type_id()); + BOOST_TEST_EQ(s_int2, "int"); + + std::string s_double2 = boost::lexical_cast(type_id()); + BOOST_TEST_EQ(s_double2, "double"); +} + +void type_index_stripping_cvr_test() +{ + using namespace boost::typeindex; + + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + + + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); +} + + +void type_index_user_defined_class_test() +{ + using namespace boost::typeindex; + + BOOST_TEST_EQ(type_id(), type_id()); + BOOST_TEST_EQ(type_id(), type_id()); + +#ifndef BOOST_NO_RTTI + BOOST_TEST(type_id() == typeid(my_namespace1::my_class)); + BOOST_TEST(type_id() == typeid(my_namespace2::my_class)); + BOOST_TEST(typeid(my_namespace1::my_class) == type_id()); + BOOST_TEST(typeid(my_namespace2::my_class) == type_id()); +#endif + + BOOST_TEST_NE(type_id(), type_id()); + BOOST_TEST_NE( + type_id().pretty_name().find("my_namespace1::my_class"), + std::string::npos); +} + + + + + +struct A { +public: + BOOST_TYPE_INDEX_REGISTER_CLASS + virtual ~A(){} +}; + +struct B: public A { + BOOST_TYPE_INDEX_REGISTER_CLASS +}; + +struct C: public B { + BOOST_TYPE_INDEX_REGISTER_CLASS +}; + +void comparators_type_id_runtime() +{ + C c1; + B b1; + A* pc1 = &c1; + A& rc1 = c1; + A* pb1 = &b1; + A& rb1 = b1; + +#ifndef BOOST_NO_RTTI + BOOST_TEST(typeid(rc1) == typeid(*pc1)); + BOOST_TEST(typeid(rb1) == typeid(*pb1)); + + BOOST_TEST(typeid(rc1) != typeid(*pb1)); + BOOST_TEST(typeid(rb1) != typeid(*pc1)); + + BOOST_TEST(typeid(&rc1) == typeid(pb1)); + BOOST_TEST(typeid(&rb1) == typeid(pc1)); +#else + BOOST_TEST(boost::typeindex::type_index(pc1->boost_type_index_type_id_runtime_()).raw_name()); +#endif + + BOOST_TEST_EQ(boost::typeindex::type_id_runtime(rc1), boost::typeindex::type_id_runtime(*pc1)); + BOOST_TEST_EQ(boost::typeindex::type_id(), boost::typeindex::type_id_runtime(*pc1)); + BOOST_TEST_EQ(boost::typeindex::type_id_runtime(rb1), boost::typeindex::type_id_runtime(*pb1)); + BOOST_TEST_EQ(boost::typeindex::type_id(), boost::typeindex::type_id_runtime(*pb1)); + + BOOST_TEST_NE(boost::typeindex::type_id_runtime(rc1), boost::typeindex::type_id_runtime(*pb1)); + BOOST_TEST_NE(boost::typeindex::type_id_runtime(rb1), boost::typeindex::type_id_runtime(*pc1)); + +#ifndef BOOST_NO_RTTI + BOOST_TEST_EQ(boost::typeindex::type_id_runtime(&rc1), boost::typeindex::type_id_runtime(pb1)); + BOOST_TEST_EQ(boost::typeindex::type_id_runtime(&rb1), boost::typeindex::type_id_runtime(pc1)); + + BOOST_TEST(boost::typeindex::type_id_runtime(rc1) == typeid(*pc1)); + BOOST_TEST(boost::typeindex::type_id_runtime(rb1) == typeid(*pb1)); + + BOOST_TEST(boost::typeindex::type_id_runtime(rc1) != typeid(*pb1)); + BOOST_TEST(boost::typeindex::type_id_runtime(rb1) != typeid(*pc1)); + BOOST_TEST(boost::typeindex::type_id_runtime(&rc1) == typeid(pb1)); + BOOST_TEST(boost::typeindex::type_id_runtime(&rb1) == typeid(pc1)); +#endif +} + + +#ifndef BOOST_NO_RTTI + +void comparators_type_id_vs_type_info() +{ + using namespace boost::typeindex; + type_index t_int = type_id(); + + BOOST_TEST(t_int == typeid(int)); + BOOST_TEST(typeid(int) == t_int); + BOOST_TEST(t_int <= typeid(int)); + BOOST_TEST(typeid(int) <= t_int); + BOOST_TEST(t_int >= typeid(int)); + BOOST_TEST(typeid(int) >= t_int); + + type_index t_double = type_id(); + + BOOST_TEST(t_double == typeid(double)); + BOOST_TEST(typeid(double) == t_double); + BOOST_TEST(t_double <= typeid(double)); + BOOST_TEST(typeid(double) <= t_double); + BOOST_TEST(t_double >= typeid(double)); + BOOST_TEST(typeid(double) >= t_double); + + if (t_double < t_int) { + BOOST_TEST(t_double < typeid(int)); + BOOST_TEST(typeid(double) < t_int); + BOOST_TEST(typeid(int) > t_double); + BOOST_TEST(t_int > typeid(double)); + + + BOOST_TEST(t_double <= typeid(int)); + BOOST_TEST(typeid(double) <= t_int); + BOOST_TEST(typeid(int) >= t_double); + BOOST_TEST(t_int >= typeid(double)); + } else { + BOOST_TEST(t_double > typeid(int)); + BOOST_TEST(typeid(double) > t_int); + BOOST_TEST(typeid(int) < t_double); + BOOST_TEST(t_int < typeid(double)); + + + BOOST_TEST(t_double >= typeid(int)); + BOOST_TEST(typeid(double) >= t_int); + BOOST_TEST(typeid(int) <= t_double); + BOOST_TEST(t_int <= typeid(double)); + } + +} + +#endif // BOOST_NO_RTTI + +int main() { + names_matches_type_id(); + default_construction(); + copy_construction(); + comparators_type_id(); + hash_code_type_id(); + + type_id_storing_modifiers(); + type_id_storing_modifiers_vs_nonstoring(); + type_index_stream_operator_via_lexical_cast_testing(); + type_index_stripping_cvr_test(); + type_index_user_defined_class_test(); + + comparators_type_id_runtime(); +#ifndef BOOST_NO_RTTI + comparators_type_id_vs_type_info(); +#endif + + return boost::report_errors(); +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_alignment.cpp b/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_alignment.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f30c8e8e8645a384f1674203d90f6c2e9ad9bc50 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_alignment.cpp @@ -0,0 +1,18 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +int main() { + BOOST_STATIC_ASSERT_MSG( + boost::alignment_of::value == boost::alignment_of::value, + "Alignments of boost::typeindex::detail::ctti_data and char differ. " + "It is unsafe to reinterpret_cast between them." + ); +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_construct_fail.cpp b/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_construct_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a376882d3baa366a71c36b0c73cc949af923b2b0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_construct_fail.cpp @@ -0,0 +1,15 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +int main() { + using namespace boost::typeindex; + ctti_type_index::type_info_t t; + (void)t; +} + diff --git a/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_copy_fail.cpp b/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_copy_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c23dc3841c8f9e55657d7ac2f324ea025509980b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_index/test/type_index_test_ctti_copy_fail.cpp @@ -0,0 +1,15 @@ +// +// Copyright Antony Polukhin, 2012-2015. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +int main() { + using namespace boost::typeindex; + ctti_type_index::type_info_t t = ctti_type_index::type_id().type_info(); + (void)t; +} + diff --git a/tools/boost_1_65_1/libs/type_traits/cxx_type_traits.htm b/tools/boost_1_65_1/libs/type_traits/cxx_type_traits.htm new file mode 100644 index 0000000000000000000000000000000000000000..40222127804a414f83afb7fd4cfc34f5a64b9c47 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/cxx_type_traits.htm @@ -0,0 +1,19 @@ + + + + + + +

+ Automatic redirection failed, please go to + doc/html/boost_typetraits/background.html.

+

Copyright John Maddock 2006

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt).

+ + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_const.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_const.qbk new file mode 100644 index 0000000000000000000000000000000000000000..8f81025f93d3ca23afc757f7c45dc42427eaacb1 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_const.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_const add_const] + + template + struct add_const + { + typedef __below type; + }; + + template using add_const_t = typename add_const::type; // C++11 and above + +__type The same type as `T const` for all `T`. + +__std_ref 3.9.3. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_const::type`][`int const`]] + +[[`add_const::type`] [`int&`]] + +[[`add_const::type`] [`int* const`]] + +[[`add_const::type`] [`int const`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_cv.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_cv.qbk new file mode 100644 index 0000000000000000000000000000000000000000..3c6622afb58ab98c1cb609e737a9dd08a20b83be --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_cv.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_cv add_cv] + + template + struct add_cv + { + typedef __below type; + }; + + template using add_cv_t = typename add_cv::type; // C++11 and above + +__type The same type as `T const volatile` for all `T`. + +__std_ref 3.9.3. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_cv::type`][`int const volatile`]] + +[[`add_cv::type`] [`int&`]] + +[[`add_cv::type`] [`int* const volatile`]] + +[[`add_cv::type`] [`int const volatile`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_lvalue_reference.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_lvalue_reference.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b3be371bc9fb1f9bc5daf9e121a9c0e1748dfaf5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_lvalue_reference.qbk @@ -0,0 +1,47 @@ +[/ + Copyright 2010 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_lvalue_reference add_lvalue_reference] + + template + struct add_lvalue_reference + { + typedef __below type; + }; + + template using add_lvalue_reference_t = typename add_lvalue_reference::type; // C++11 and above + +__type If `T` names an object or function type then the member typedef `type` +shall name `T&`; otherwise, if `T` names a type ['rvalue reference to U] then +the member typedef type shall name `U&`; otherwise, type shall name `T`. + +__std_ref 20.7.6.2. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_lvalue_reference::type`][`int&`]] + +[[`add_lvalue_reference::type`] [`int const&`]] + +[[`add_lvalue_reference::type`] [`int*&`]] + +[[`add_lvalue_reference::type`] [`int*&`]] + +[[`add_lvalue_reference::type`][`int&`]] + +[[`add_lvalue_reference::type`][`void`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_pointer.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_pointer.qbk new file mode 100644 index 0000000000000000000000000000000000000000..72b9c2bc28dafffab6f0c14cd26803293e25f96f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_pointer.qbk @@ -0,0 +1,45 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_pointer add_pointer] + + template + struct add_pointer + { + typedef __below type; + }; + + template using add_pointer_t = typename add_pointer::type; // C++11 and above + +__type The same type as `remove_reference::type*`. + +The rationale for this template +is that it produces the same type as `decltype(&t)`, +where `t` is an object of type `T`. + +__std_ref 8.3.1. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_pointer::type`][`int*`]] + +[[`add_pointer::type`] [`int const*`]] + +[[`add_pointer::type`] [`int**`]] + +[[`add_pointer::type`] [`int**`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_reference.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_reference.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9d8bb4c115faf1a6a4f415de253c1dbe566be4b4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_reference.qbk @@ -0,0 +1,47 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_reference add_reference] + +[note This trait has been made obsolete by __add_lvalue_reference and __add_rvalue_reference, +and new code should use these new traits rather than __is_reference which is retained +for backwards compatibility only. +] + + + template + struct add_reference + { + typedef __below type; + }; + + template using add_reference_t = typename add_reference::type; // C++11 and above + +__type If `T` is not a reference type then `T&`, otherwise `T`. + +__std_ref 8.3.2. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_reference::type`][`int&`]] + +[[`add_reference::type`] [`int const&`]] + +[[`add_reference::type`] [`int*&`]] + +[[`add_reference::type`] [`int*&`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_rvalue_reference.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_rvalue_reference.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c490615a3a804fb572a8cf4f2f5dee4f5d06969a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_rvalue_reference.qbk @@ -0,0 +1,49 @@ +[/ + Copyright 2010 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_rvalue_reference add_rvalue_reference] + + template + struct add_rvalue_reference + { + typedef __below type; + }; + + template using add_rvalue_reference_t = typename add_rvalue_reference::type; // C++11 and above + +__type If `T` names an object or function type then the member typedef type +shall name `T&&`; otherwise, type shall name `T`. ['\[Note: This rule reflects +the semantics of reference collapsing. For example, when a type `T` names +a type U&, the type `add_rvalue_reference::type` is not an rvalue +reference. -end note\]]. + +__std_ref 20.7.6.2. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_rvalue_reference::type`][`int&&`]] + +[[`add_rvalue_reference::type`] [`int const&`]] + +[[`add_rvalue_reference::type`] [`int*&&`]] + +[[`add_rvalue_reference::type`] [`int*&`]] + +[[`add_rvalue_reference::type`][`int&&`]] + +[[`add_rvalue_reference::type`][`void`]] + +] + +__compat In the absence of rvalue-reference support this trait has no effect. + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/add_volatile.qbk b/tools/boost_1_65_1/libs/type_traits/doc/add_volatile.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9a306962fc255717ce4058fc1fac163fa0d7f4d7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/add_volatile.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:add_volatile add_volatile] + + template + struct add_volatile + { + typedef __below type; + }; + + template using add_volatile_t = typename add_volatile::type; // C++11 and above + +__type The same type as `T volatile` for all `T`. + +__std_ref 3.9.3. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_volatile::type`][`int volatile`]] + +[[`add_volatile::type`] [`int&`]] + +[[`add_volatile::type`] [`int* volatile`]] + +[[`add_volatile::type`] [`int const volatile`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/aligned_storage.qbk b/tools/boost_1_65_1/libs/type_traits/doc/aligned_storage.qbk new file mode 100644 index 0000000000000000000000000000000000000000..92ecca165772f5504f1feeaa9baaf92f26e396ef --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/aligned_storage.qbk @@ -0,0 +1,54 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:aligned_storage aligned_storage] + + template + struct aligned_storage + { + typedef __below type; + }; + +__type a built-in or POD type with size `Size` and an alignment +that is a multiple of `Align`. + +__header ` #include ` or ` #include ` + +On the GCC and Visual C++ compilers (or compilers that are compatible with them), we support +requests for types with alignments greater than any built in type (up to 128-bit alignment). +Visual C++ users should note that such "extended" types can not be passed down the stack as +by-value function arguments. + +[important +Visual C++ users should be aware that MSVC has an elastic definition of alignment, for +example consider the following code: + +`` + typedef boost::aligned_storage<8,8>::type align_t; + assert(boost::alignment_of::value % 8 == 0); + align_t a; + assert(((std::uintptr_t)&a % 8) == 0); + char c = 0; + align_t a1; + assert(((std::uintptr_t)&a1 % 8) == 0); +`` + +In this code the final assert will fail for a 32-bit build because variable `a1` is not +aligned on an 8-byte boundary. Had we used the MSVC intrinsic `__alignof` in +place of `alignment_of` or `std::aligned_storage` in place of `boost::aligned_storage` +the result would have been no different. In MSVC alignment requirements/promises only +really apply to variables on the heap, not on the stack. + +Further, although MSVC has a mechanism for generating new types with arbitrary alignment +requirements, such types cannot be passed as function arguments on the program stack. +Therefore had `boost::aligned_storage<8,8>::type` been a type declared with +`__declspec(align(8))` we would break a great deal of existing code that relies on +being able to pass such types through the program stack. +] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/alignment_of.qbk b/tools/boost_1_65_1/libs/type_traits/doc/alignment_of.qbk new file mode 100644 index 0000000000000000000000000000000000000000..0b9f0b51fb31e51d9463b715336bfbe5cd86008c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/alignment_of.qbk @@ -0,0 +1,55 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:alignment_of alignment_of] + template + struct alignment_of : public __integral_constant {}; + +__inherit Class template `alignment_of` inherits from +`__integral_constant`, where `ALIGNOF(T)` is the +alignment of type T. + +['Note: strictly speaking you should only rely on +the value of `ALIGNOF(T)` being a multiple of the true alignment of T, although +in practice it does compute the correct value in all the cases we know about.] + +__header ` #include ` or ` #include ` + +__examples + +[:`alignment_of` inherits from `__integral_constant`.] + +[:`alignment_of::type` is the type `__integral_constant`.] + +[:`alignment_of::value` is an integral constant +expression with value `ALIGNOF(double)`.] + +[:`alignment_of::value_type` is the type `std::size_t`.] + +[important +Visual C++ users should note that MSVC has varying definitions of "alignment". +For example consider the following code: + +`` + typedef long long align_t; + assert(boost::alignment_of::value % 8 == 0); + align_t a; + assert(((std::uintptr_t)&a % 8) == 0); + char c = 0; + align_t a1; + assert(((std::uintptr_t)&a1 % 8) == 0); +`` + +In this code, even though `boost::alignment_of` reports that `align_t` has 8-byte +alignment, the final assert will fail for a 32-bit build because `a1` is not aligned on an +8 byte boundary. Note that had we used the MSVC intrinsic `__alignof` in place of `boost::alignment_of` +we would still get the same result. In fact for MSVC alignment requirements (and promises) only really +apply to dynamic storage, and not the stack. +] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/alignment_traits.qbk b/tools/boost_1_65_1/libs/type_traits/doc/alignment_traits.qbk new file mode 100644 index 0000000000000000000000000000000000000000..56a133c144d165bbb867042360eb0c18b9c2cb5e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/alignment_traits.qbk @@ -0,0 +1,24 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:alignment Synthesizing Types with Specific Alignments] + +Some low level memory management routines need to synthesize a POD type with +specific alignment properties. The template `__type_with_alignment` finds the smallest +type with a specified alignment, while template `__aligned_storage` creates a type +with a specific size and alignment. + +[*Synopsis] + + template + struct __type_with_alignment; + + template + struct __aligned_storage; + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/background.qbk b/tools/boost_1_65_1/libs/type_traits/doc/background.qbk new file mode 100644 index 0000000000000000000000000000000000000000..11ce618071324e160483ec7b0b35d03b3837d78e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/background.qbk @@ -0,0 +1,322 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:background Background and Tutorial] + +The following is an updated version of the article "C++ Type traits" +by John Maddock and Steve Cleary that appeared in the October 2000 +issue of [@http://www.ddj.com Dr Dobb's Journal]. + +Generic programming (writing code which works with any data type meeting a +set of requirements) has become the method of choice for providing reusable code. +However, there are times in generic programming when "generic" just isn't +good enough - sometimes the differences between types are too large for an +efficient generic implementation. This is when the traits technique +becomes important - by encapsulating those properties that need to be +considered on a type by type basis inside a traits class, we can +minimize the amount of code that has to differ from one type to another, +and maximize the amount of generic code. + +Consider an example: when working with character strings, one common operation is +to determine the length of a null terminated string. Clearly it's possible to +write generic code that can do this, but it turns out that there are much more +efficient methods available: for example, the C library functions `strlen` and +`wcslen` are usually written in assembler, and with suitable hardware support +can be considerably faster than a generic version written in C++. +The authors of the C++ standard library realized this, and abstracted the +properties of `char` and `wchar_t` into the class `char_traits`. Generic code +that works with character strings can simply use `char_traits<>::length` to +determine the length of a null terminated string, safe in the knowledge +that specializations of `char_traits` will use the most appropriate method +available to them. + +[h4 Type Traits] + +Class `char_traits` is a classic example of a collection of type specific +properties wrapped up in a single class - what Nathan Myers termed a +/baggage class/[link background.references \[1\]]. In the Boost type-traits library, we[link background.references \[2\]] have written a +set of very specific traits classes, each of which encapsulate a single trait +from the C++ type system; for example, is a type a pointer or a reference type? +Or does a type have a trivial constructor, or a const-qualifier? +The type-traits classes share a unified design: each class inherits from +the type __true_type if the type has the specified property and inherits from +__false_type otherwise. As we will show, these classes can be used in +generic programming to determine the properties of a given type and introduce +optimizations that are appropriate for that case. + +The type-traits library also contains a set of classes that perform a +specific transformation on a type; for example, they can remove a +top-level const or volatile qualifier from a type. Each class that +performs a transformation defines a single typedef-member `type` +that is the result of the transformation. All of the type-traits +classes are defined inside namespace `boost`; for brevity, namespace-qualification +is omitted in most of the code samples given. + +[h4 Implementation] + +There are far too many separate classes contained in the type-traits library +to give a full implementation here - see the source code in the Boost library +for the full details - however, most of the implementation is fairly repetitive +anyway, so here we will just give you a flavor for how some of the classes are +implemented. Beginning with possibly the simplest class in the library, +`is_void` inherits from `__true_type` only if `T` is `void`. + + template + struct __is_void : public __false_type{}; + + template <> + struct __is_void : public __true_type{}; + +Here we define a primary version of the template class `__is_void`, and +provide a full-specialization when `T` is `void`. While full specialization +of a template class is an important technique, sometimes we need a +solution that is halfway between a fully generic solution, and a full +specialization. This is exactly the situation for which the standards committee +defined partial template-class specialization. As an example, consider the +class `boost::is_pointer`: here we needed a primary version that handles +all the cases where T is not a pointer, and a partial specialization to +handle all the cases where T is a pointer: + + template + struct __is_pointer : public __false_type{}; + + template + struct __is_pointer : public __true_type{}; + +The syntax for partial specialization is somewhat arcane and could easily +occupy an article in its own right; like full specialization, in order to +write a partial specialization for a class, you must first declare the +primary template. The partial specialization contains an extra <...> after the +class name that contains the partial specialization parameters; these define +the types that will bind to that partial specialization rather than the +default template. The rules for what can appear in a partial specialization +are somewhat convoluted, but as a rule of thumb if you can legally write two +function overloads of the form: + + void foo(T); + void foo(U); + +Then you can also write a partial specialization of the form: + + template + class c{ /*details*/ }; + + template + class c{ /*details*/ }; + +This rule is by no means foolproof, but it is reasonably simple to remember +and close enough to the actual rule to be useful for everyday use. + +As a more complex example of partial specialization consider the class +`remove_extent`. This class defines a single typedef-member `type` that +is the same type as T but with any top-level array bounds removed; +this is an example of a traits class that performs a transformation on a type: + + template + struct __remove_extent + { typedef T type; }; + + template + struct __remove_extent + { typedef T type; }; + +The aim of `__remove_extent` is this: imagine a generic algorithm that is +passed an array type as a template parameter, `__remove_extent` provides a +means of determining the underlying type of the array. For example +`remove_extent::type` would evaluate to the type `int[5]`. +This example also shows that the number of template parameters in a +partial specialization does not have to match the number in the +default template. However, the number of parameters that appear after the +class name do have to match the number and type of the parameters in the +default template. + +[h4 Optimized copy] + +As an example of how the type traits classes can be used, consider the +standard library algorithm copy: + + template + Iter2 copy(Iter1 first, Iter1 last, Iter2 out); + +Obviously, there's no problem writing a generic version of copy that works +for all iterator types `Iter1` and `Iter2`; however, there are some +circumstances when the copy operation can best be performed by a call to +`memcpy`. In order to implement copy in terms of `memcpy` all of the +following conditions need to be met: + +* Both of the iterator types `Iter1` and `Iter2` must be pointers. +* Both `Iter1` and `Iter2` must point to the same type - excluding const and +volatile-qualifiers. +* The type pointed to by `Iter1` must have a trivial assignment operator. + +By trivial assignment operator we mean that the type is either a scalar type[link background.references \[3\]] or: + +* The type has no user defined assignment operator. +* The type does not have any data members that are references. +* All base classes, and all data member objects must have trivial assignment operators. + +If all these conditions are met then a type can be copied using `memcpy` +rather than using a compiler generated assignment operator. The type-traits +library provides a class `__has_trivial_assign`, such that +`has_trivial_assign::value` is true only if T has a trivial assignment operator. +This class "just works" for scalar types, but has to be explicitly +specialised for class/struct types that also happen to have a trivial assignment +operator. In other words if __has_trivial_assign gives the wrong answer, +it will give the "safe" wrong answer - that trivial assignment is not allowable. + +The code for an optimized version of copy that uses `memcpy` where appropriate is +given in [link boost_typetraits.examples.copy the examples]. The code begins by defining a template +function `do_copy` that performs a "slow but safe" copy. The last parameter passed +to this function may be either a `__true_type` or a `__false_type`. Following that +there is an overload of do_copy that uses `memcpy`: this time the iterators are required +to actually be pointers to the same type, and the final parameter must be a +`__true_type`. Finally, the version of `copy` calls `do_copy`, passing +`__has_trivial_assign()` as the final parameter: this will dispatch +to the optimized version where appropriate, otherwise it will call the +"slow but safe version". + +[h4 Was it worth it?] + +It has often been repeated in these columns that "premature optimization is the +root of all evil" [link background.references \[4\]]. So the question must be asked: was our optimization +premature? To put this in perspective the timings for our version of copy +compared a conventional generic copy[link background.references \[5\]] are shown in table 1. + +Clearly the optimization makes a difference in this case; but, to be fair, +the timings are loaded to exclude cache miss effects - without this +accurate comparison between algorithms becomes difficult. However, perhaps +we can add a couple of caveats to the premature optimization rule: + +*If you use the right algorithm for the job in the first place then optimization +will not be required; in some cases, memcpy is the right algorithm. +*If a component is going to be reused in many places by many people then +optimizations may well be worthwhile where they would not be so for a single +case - in other words, the likelihood that the optimization will be +absolutely necessary somewhere, sometime is that much higher. +Just as importantly the perceived value of the stock implementation will be +higher: there is no point standardizing an algorithm if users reject it on +the grounds that there are better, more heavily optimized versions available. + +[table Time taken to copy 1000 elements using `copy` (times in micro-seconds) + +[[Version] [T] [Time]] +[["Optimized" copy] [char] [0.99]] +[[Conventional copy] [char] [8.07]] +[["Optimized" copy] [int] [2.52]] +[[Conventional copy] [int] [8.02]] +] + +[h4 Pair of References] +The optimized copy example shows how type traits may be used to perform +optimization decisions at compile-time. Another important usage of type traits +is to allow code to compile that otherwise would not do so unless excessive +partial specialization is used. This is possible by delegating partial +specialization to the type traits classes. Our example for this form of +usage is a pair that can hold references [link background.references \[6\]]. + +First, let us examine the definition of `std::pair`, omitting the +comparison operators, default constructor, and template copy constructor for +simplicity: + + template + struct pair + { + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + + pair(const T1 & nfirst, const T2 & nsecond) + :first(nfirst), second(nsecond) { } + }; + +Now, this "pair" cannot hold references as it currently stands, because the +constructor would require taking a reference to a reference, which is +currently illegal [link background.references \[7\]]. Let us consider what the constructor's parameters +would have to be in order to allow "pair" to hold non-reference types, +references, and constant references: + +[table Required Constructor Argument Types +[[Type of `T1`] [Type of parameter to initializing constructor]] +[[T] [const T &]] +[[T &] [T &]] +[[const T &] [const T &]] +] + +A little familiarity with the type traits classes allows us to construct a +single mapping that allows us to determine the type of parameter from the +type of the contained class. The type traits classes provide a +transformation __add_reference, which adds a reference to its type, +unless it is already a reference. + +[table Using add_reference to synthesize the correct constructor type +[[Type of `T1`] [Type of `const T1`] [Type of `add_reference::type`]] +[[T] [const T] [const T &]] +[[T &] [T & \[8\]] [T &]] +[[const T &] [const T &] [const T &]] +] + +This allows us to build a primary template definition for `pair` that can +contain non-reference types, reference types, and constant reference types: + + template + struct pair + { + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + + pair(boost::__add_reference::type nfirst, + boost::__add_reference::type nsecond) + :first(nfirst), second(nsecond) { } + }; + +Add back in the standard comparison operators, default constructor, +and template copy constructor (which are all the same), and you have a +`std::pair` that can hold reference types! + +This same extension could have been done using partial template specialization +of `pair`, but to specialize `pair` in this way would require three partial +specializations, plus the primary template. Type traits allows us to +define a single primary template that adjusts itself auto-magically to +any of these partial specializations, instead of a brute-force partial +specialization approach. Using type traits in this fashion allows +programmers to delegate partial specialization to the type traits classes, +resulting in code that is easier to maintain and easier to understand. + +[h4 Conclusion] + +We hope that in this article we have been able to give you some idea of +what type-traits are all about. A more complete listing of the available +classes are in the boost documentation, along with further examples using +type traits. Templates have enabled C++ uses to take the advantage of the +code reuse that generic programming brings; hopefully this article has +shown that generic programming does not have to sink to the lowest common +denominator, and that templates can be optimal as well as generic. + +[h4 Acknowledgements] + +The authors would like to thank Beman Dawes and Howard Hinnant for their +helpful comments when preparing this article. + +[h4 [#background.references]References] + +# Nathan C. Myers, C++ Report, June 1995. +# The type traits library is based upon contributions by Steve Cleary, Beman Dawes, Howard Hinnant and John Maddock: it can be found at www.boost.org. +# A scalar type is an arithmetic type (i.e. a built-in integer or floating point type), an enumeration type, a pointer, a pointer to member, or a const- or volatile-qualified version of one of these types. +# This quote is from Donald Knuth, ACM Computing Surveys, December 1974, pg 268. +# The test code is available as part of the boost utility library (see algo_opt_examples.cpp), the code was compiled with gcc 2.95 with all optimisations turned on, tests were conducted on a 400MHz Pentium II machine running Microsoft Windows 98. +# John Maddock and Howard Hinnant have submitted a "compressed_pair" library to Boost, which uses a technique similar to the one described here to hold references. Their pair also uses type traits to determine if any of the types are empty, and will derive instead of contain to conserve space -- hence the name "compressed". +# This is actually an issue with the C++ Core Language Working Group (issue #106), submitted by Bjarne Stroustrup. The tentative resolution is to allow a "reference to a reference to T" to mean the same thing as a "reference to T", but only in template instantiation, in a method similar to multiple cv-qualifiers. +# For those of you who are wondering why this shouldn't be const-qualified, remember that references are always implicitly constant (for example, you can't re-assign a reference). Remember also that "const T &" is something completely different. For this reason, cv-qualifiers on template type arguments that are references are ignored. + +[endsect] + + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/common_type.qbk b/tools/boost_1_65_1/libs/type_traits/doc/common_type.qbk new file mode 100644 index 0000000000000000000000000000000000000000..3bf6058c52d2dd47b6dfaaecba76ecd0661893c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/common_type.qbk @@ -0,0 +1,218 @@ +[/ + Copyright 2008 Howard Hinnant + Copyright 2008 Beman Dawes + Copyright 2010 John Maddock + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[/===================================================================] +[section:common_type common_type] +[/===================================================================] + +__header ` #include ` or ` #include ` + + namespace boost { + template struct common_type; + template using common_type_t = typename common_type::type; // C++11 and above + } + + +`common_type` is a traits class used to deduce a type common to a several types, useful as the return type of functions +operating on multiple input types such as in mixed-mode arithmetic.. + +The nested typedef `::type` could be defined as follows: + + template + struct common_type; + + template + struct common_type { + typedef typename common_type::type, V...>::type type; + }; + + template <> + struct common_type<> { + }; + + template + struct common_type { + typedef typename __decay::type type; + }; + + template + struct common_type { + typedef typename __decay< + decltype( __declval()? + __declval::type>(): + __declval::type>() ) + >::type type; + }; + +All parameter types must be complete. This trait is permitted to be specialized by a user if at least one +template parameter is a user-defined type. [*Note:] Such specializations are required when only explicit conversions +are desired among the `common_type` arguments. + +Note that when the compiler does not support variadic templates (and the macro `BOOST_NO_CXX11_VARIADIC_TEMPLATES` is defined) +then the maximum number of template arguments is 9. + + +[h4 Tutorial] + +In a nutshell, `common_type` is a trait that takes 1 or more types, and returns a type which +all of the types will convert to. The default definition demands this conversion be implicit. +However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, +and yet still want to interoperate with the `common_type` facility. + +[*Example:] + + template + complex::type> + operator+(complex, complex); + + +In the above example, "mixed-mode" complex arithmetic is allowed. The return type is described by `common_type`. +For example the resulting type of adding a `complex` and `complex` might be a `complex`. + +Here is how someone might produce a variadic comparison function: + + template + typename common_type::type + min(T... t); + +This is a very useful and broadly applicable utility. + +[h4 How to get the common type of types with explicit conversions?] + +Another choice for the author of the preceding operator could be + + template + typename common_type, complex >::type + operator+(complex, complex); + +As the default definition of `common_type` demands the conversion be implicit, we need to specialize the trait for complex types as follows. + + template + struct common_type, complex > { + typedef complex< common_type > type; + }; + +[h4 How important is the order of the `common_type<>` template arguments?] + +The order of the template parameters is important. + +`common_type::type` is not equivalent to `common_type::type`, but to `common_type::type, C>::type`. + +Consider + + struct A {}; + struct B {}; + struct C { + C() {} + C(A const&) {} + C(B const&) {} + C& operator=(C const&) { + return *this; + } + }; + +The following doesn't compile + + typedef boost::common_type::type ABC; // Does not compile + +while + + typedef boost::common_type::type ABC; + +compiles. + +Thus, as `common_type::type` is undefined, `common_type::type` is also undefined. + +It is intended that clients who wish for `common_type` to be well +defined to define it themselves: + + namespace boost + { + + template <> + struct common_type {typedef C type;}; + + } + +Now this client can ask for `common_type` (and get +the same answer). + +Clients wanting to ask `common_type` in any order and get the same result need to add in addition: + + namespace boost + { + + template <> struct common_type + : public common_type {}; + + } + +This is needed as the specialization of `common_type` is not be used implicitly for `common_type`. + +[h4 Can the `common_type` of two types be a third type?] + +Given the preceding example, one might expect `common_type::type` to be `C` without any intervention from the user. +But the default `common_type<>` implementation doesn't grant that. It is intended that clients who wish for `common_type` +to be well defined to define it themselves: + + namespace boost + { + + template <> + struct common_type {typedef C type;}; + + template <> struct common_type + : public common_type {}; + + } + +Now this client can ask for `common_type`. + +[h4 How does `common_type` behave with pointers?] + +Consider + + struct C { }: + struct B : C { }; + struct A : C { }; + + +Shouldn't `common_type::type` be `C*`? I would say yes, but the default implementation will make it ill-formed. + +The library could add a specialization for pointers, as + + namespace boost + { + + template + struct common_type { + typedef common_type* type; + }; + } + +But in the absence of a motivating use cases, we prefer not to add more than the standard specifies. + +Of course the user can always make this specialization. + +[h4 Can you explain the pros/cons of `common_type` against Boost.Typeof?] + +Even if they appear to be close, `common_type` and `typeof` have +different purposes. You use `typeof` to get the type of an expression, while +you use `common_type` to set explicitly the type returned of a template +function. Both are complementary, and indeed `common_type` is approximately equivalent to +`decltype(__declval() ? __declval() : __declval())`. + +`common_type` is also similar to `promote_args` in `boost/math/tools/promotion.hpp`, +though it is not exactly the same as `promote_args` either. `common_type::type` simply represents the result of some +operation on `T1` and `T2`, and defaults to the type obtained by putting `T1` and `T2` into a conditional statement. + +It is meant to be customizable (via specialization) if this default is not appropriate. + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/conditional.qbk b/tools/boost_1_65_1/libs/type_traits/doc/conditional.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b0aea68835e1746ebf1041f4d9d6230cf75c0511 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/conditional.qbk @@ -0,0 +1,23 @@ +[/ + Copyright 2010 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[/===================================================================] +[section:conditional conditional] +[/===================================================================] + + +__header ` #include ` or ` #include ` + + namespace boost { + template struct __conditional; + template using conditional_t = typename conditional::type; // C++11 and above + } + +If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U. + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/copy_cv.qbk b/tools/boost_1_65_1/libs/type_traits/doc/copy_cv.qbk new file mode 100644 index 0000000000000000000000000000000000000000..26a6e2102c01971cec163a7bf345bdbddb8d7cfd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/copy_cv.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2015 Peter Dimov. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:copy_cv copy_cv] + + template + struct copy_cv + { + typedef __below type; + }; + + template using copy_cv_t = typename copy_cv::type; // C++11 and above + +__type [^T /cv/], where /cv/ are the cv-qualifiers of `U`. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`copy_cv::type`][`int`]] + +[[`copy_cv::type`][`int const`]] + +[[`copy_cv::type`][`int const`]] + +[[`copy_cv::type`][`int const volatile`]] + +[[`copy_cv::type`] [`int&`]] + +[[`copy_cv::type`] [`int* volatile`]] + +] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/credits.qbk b/tools/boost_1_65_1/libs/type_traits/doc/credits.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b51382f51d1b4ce176cf7a2a933f400a16d793c6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/credits.qbk @@ -0,0 +1,42 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:credits Credits] + +This documentation was pulled together by John Maddock, using +[@../../../../doc/html/quickbook.html Boost.Quickbook] +and [@../../../../doc/html/boostbook.html Boost.DocBook]. + +The original version of this library was created by Steve Cleary, +Beman Dawes, Howard Hinnant, and John Maddock. John Maddock is the +current maintainer of the library. + +This version of type traits library is based on contributions by +Adobe Systems Inc, David Abrahams, Steve Cleary, +Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, +Itay Maman, John Maddock, Thorsten Ottosen, Robert Ramey, Jeremy Siek +and Antony Polukhin. + +Mat Marcus and Jesse Jones invented, and +[@http://opensource.adobe.com/project4/project.shtml published a paper describing], +the partial specialization workarounds used in this library. + +Aleksey Gurtovoy added MPL integration to the library. + +The __is_convertible template is based on code originally devised by +Andrei Alexandrescu, see +"[@http://www.cuj.com/experts/1810/alexandr.htm?topic=experts +Generic: Mappings between Types and Values]". + +The latest version of this library and documentation can be found at +[@http://www.boost.org www.boost.org]. Bugs, suggestions and discussion +should be directed to boost@lists.boost.org +(see [@http://www.boost.org/more/mailing_lists.htm#main +www.boost.org/more/mailing_lists.htm#main] for subscription details). + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/decay.qbk b/tools/boost_1_65_1/libs/type_traits/doc/decay.qbk new file mode 100644 index 0000000000000000000000000000000000000000..cfa00cb5dbf5d121000eabb8a9842cdb6c0fe3a0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/decay.qbk @@ -0,0 +1,44 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:decay decay] + + template + struct decay + { + typedef __below type; + }; + + template using decay_t = typename decay::type; // C++11 and above + +__type Let `U` be the result of `remove_reference::type`, then if `U` is +an array type, the result is `remove_extent::type*`, otherwise if `U` is a +function type then the result is `U*`, otherwise the result is `U`. + +__std_ref 3.9.1. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`decay::type`][`int[3]*`]] + +[[`decay::type`] [`int*`]] + +[[`decay::type`] [`int(*)(double)`]] + +[[`int(*)(double)`] [`int(*)(double)`]] +[[`int(double)`] [`int(*)(double)`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/declval.qbk b/tools/boost_1_65_1/libs/type_traits/doc/declval.qbk new file mode 100644 index 0000000000000000000000000000000000000000..7b151aed64bdb55f455f1ee69f2cfe5958b5c609 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/declval.qbk @@ -0,0 +1,21 @@ +[/ + Copyright 2015 Peter Dimov. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:declval declval] + + template + typename add_rvalue_reference::type declval() noexcept; // as unevaluated operand + +__std_ref C++11 20.2.4 [declval]. + +__header ` #include ` or ` #include ` + +The function template `declval` is used when a value of a certain type is required in +a type computation context. For example, the type of the result of adding an `int` and +a `float` can be obtained with the expression `decltype( declval() + declval() )`. + +[endsect] diff --git a/tools/boost_1_65_1/libs/type_traits/doc/decomposing_func.qbk b/tools/boost_1_65_1/libs/type_traits/doc/decomposing_func.qbk new file mode 100644 index 0000000000000000000000000000000000000000..4ddf5ca155be991be4f67cafe73d0d16e0406e4a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/decomposing_func.qbk @@ -0,0 +1,20 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:function Decomposing Function Types] + +The class template __function_traits extracts information from function types +(see also __is_function). This traits class allows you to tell how many arguments +a function takes, what those argument types are, and what the return type is. + +[*Synopsis] + + template + struct __function_traits; + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/examples.qbk b/tools/boost_1_65_1/libs/type_traits/doc/examples.qbk new file mode 100644 index 0000000000000000000000000000000000000000..489b91ec113305aedd07a672eff6ad7c4acbc756 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/examples.qbk @@ -0,0 +1,237 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:examples Examples] + +[section:copy An Optimized Version of std::copy] + +Demonstrates a version of `std::copy` that uses `__has_trivial_assign` to +determine whether to use `memcpy` to optimise the copy operation +(see [@../../examples/copy_example.cpp copy_example.cpp]): + + // + // opt::copy + // same semantics as std::copy + // calls memcpy where appropriate. + // + + namespace detail{ + + template + I2 copy_imp(I1 first, I1 last, I2 out, const boost::__integral_constant&) + { + while(first != last) + { + *out = *first; + ++out; + ++first; + } + return out; + } + + template + T* copy_imp(const T* first, const T* last, T* out, const boost::__true_type&) + { + memmove(out, first, (last-first)*sizeof(T)); + return out+(last-first); + } + + + } + + template + inline I2 copy(I1 first, I1 last, I2 out) + { + // + // We can copy with memcpy if T has a trivial assignment operator, + // and if the iterator arguments are actually pointers (this last + // requirement we detect with overload resolution): + // + typedef typename std::iterator_traits::value_type value_type; + return detail::copy_imp(first, last, out, boost::__has_trivial_assign()); + } + + +[endsect] + +[section:fill An Optimised Version of std::fill] + +Demonstrates a version of `std::fill` that uses `__has_trivial_assign` to +determine whether to use `memset` to optimise the fill operation +(see [@../../examples/fill_example.cpp fill_example.cpp]): + + // + // fill + // same as std::fill, but uses memset where appropriate + // + namespace detail{ + + template + void do_fill(I first, I last, const T& val, const boost::__integral_constant&) + { + while(first != last) + { + *first = val; + ++first; + } + } + + template + void do_fill(T* first, T* last, const T& val, const boost::__true_type&) + { + std::memset(first, val, last-first); + } + + } + + template + inline void fill(I first, I last, const T& val) + { + // + // We can do an optimised fill if T has a trivial assignment + // operator and if it's size is one: + // + typedef boost::__integral_constant::value && (sizeof(T) == 1)> truth_type; + detail::do_fill(first, last, val, truth_type()); + } + + +[endsect] + +[section:destruct An Example that Omits Destructor Calls For Types with Trivial Destructors] + +Demonstrates a simple algorithm that uses `__has_trivial_destruct` to +determine whether to destructors need to be called +(see [@../../examples/trivial_destructor_example.cpp trivial_destructor_example.cpp]): + + // + // algorithm destroy_array: + // The reverse of std::unitialized_copy, takes a block of + // initialized memory and calls destructors on all objects therein. + // + + namespace detail{ + + template + void do_destroy_array(T* first, T* last, const boost::__false_type&) + { + while(first != last) + { + first->~T(); + ++first; + } + } + + template + inline void do_destroy_array(T* first, T* last, const boost::__true_type&) + { + } + + } // namespace detail + + template + inline void destroy_array(T* p1, T* p2) + { + detail::do_destroy_array(p1, p2, ::boost::__has_trivial_destructor()); + } + + +[endsect] + +[section:iter An improved Version of std::iter_swap] + +Demonstrates a version of `std::iter_swap` that use type traits to +determine whether an it's arguments are proxy iterators or not, +if they're not then it just does a `std::swap` of it's dereferenced +arguments (the +same as `std::iter_swap` does), however if they are proxy iterators +then takes special care over the swap to ensure that the algorithm +works correctly for both proxy iterators, and even iterators of +different types +(see [@../../examples/iter_swap_example.cpp iter_swap_example.cpp]): + + // + // iter_swap: + // tests whether iterator is a proxy iterator or not, and + // uses optimal form accordingly: + // + namespace detail{ + + template + static void do_swap(I one, I two, const boost::__false_type&) + { + typedef typename std::iterator_traits::value_type v_t; + v_t v = *one; + *one = *two; + *two = v; + } + template + static void do_swap(I one, I two, const boost::__true_type&) + { + using std::swap; + swap(*one, *two); + } + + } + + template + inline void iter_swap(I1 one, I2 two) + { + // + // See is both arguments are non-proxying iterators, + // and if both iterator the same type: + // + typedef typename std::iterator_traits::reference r1_t; + typedef typename std::iterator_traits::reference r2_t; + + typedef boost::__integral_constant::value + && ::boost::__is_reference::value + && ::boost::__is_same::value> truth_type; + + detail::do_swap(one, two, truth_type()); + } + + +[endsect] + +[section:to_double Convert Numeric Types and Enums to double] + +Demonstrates a conversion of +[@../../../../libs/numeric/conversion/doc/html/boost_numericconversion/definitions.html#boost_numericconversion.definitions.numeric_types +Numeric Types] +and enum types to double: + + template + inline double to_double(T const& value) + { + typedef typename boost::promote::type promoted; + return boost::numeric::converter::convert(value); + } + +[endsect] + +[section:improved_min Improving std::min with common_type] + +An improved `std::min` function could be written like this: + + template + typename __common_type::type min(T t, U u) + { + return t < u ? t : u; + } + +And now expressions such as: + + min(1, 2.0) + +will actually compile and return the correct type! + +[endsect] +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/extent.qbk b/tools/boost_1_65_1/libs/type_traits/doc/extent.qbk new file mode 100644 index 0000000000000000000000000000000000000000..43002ef65499c3810e4c0b4cedaac5379b4d5ab4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/extent.qbk @@ -0,0 +1,50 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:extent extent] + template + struct extent : public __integral_constant {}; + +__inherit Class template extent inherits from `__integral_constant`, +where `EXTENT(T,N)` is the number of elements in the N'th array dimension of type `T`. + +If `T` is not a (built-in) array type, or if `N > __rank::value`, or if the N'th array bound +is incomplete, then `EXTENT(T,N)` is zero. + +__header ` #include ` or ` #include ` + +__examples + +[:`extent` inherits from `__integral_constant`.] + +[:`extent::type` is the type `__integral_constant`.] + +[:`extent::type` is the type `__integral_constant`.] + +[:`extent::type` is the type `__integral_constant`.] + +[:`extent::value` is an integral constant +expression that evaluates to /4/.] + +[:`extent::value` is an integral constant +expression that evaluates to /0/.] + +[:`extent::value` is an integral constant +expression that evaluates to /2/.] + +[:`extent::value` is an integral constant +expression that evaluates to /0/.] + +[:`extent >::value` is an integral constant +expression that evaluates to /0/: `boost::array` is a class type and [*not an array type]!] + +[:`extent::value_type` is the type `std::size_t`.] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/floating_point_promotion.qbk b/tools/boost_1_65_1/libs/type_traits/doc/floating_point_promotion.qbk new file mode 100644 index 0000000000000000000000000000000000000000..27695865705d1f44fa4c5f927ebc715b054e558d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/floating_point_promotion.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:floating_point_promotion floating_point_promotion] + + template + struct floating_point_promotion + { + typedef __below type; + }; + + template using floating_point_promotion_t = typename floating_point_promotion::type; // C++11 and above + +__type If floating point promotion can be applied to an rvalue of type `T`, +then applies floating point promotion to `T` and keeps cv-qualifiers of `T`, +otherwise leaves `T` unchanged. + +__std_ref 4.6. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`floating_point_promotion::type`][`double const`]] + +[[`floating_point_promotion::type`][`float&`]] + +[[`floating_point_promotion::type`][`short`]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/function_traits.qbk b/tools/boost_1_65_1/libs/type_traits/doc/function_traits.qbk new file mode 100644 index 0000000000000000000000000000000000000000..54a2e0d37eff861bab586b52783de000aaa07700 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/function_traits.qbk @@ -0,0 +1,58 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:function_traits function_traits] +[def __argN '''argN_type'''] + + template + struct function_traits + { + static const std::size_t arity = __below; + typedef __below result_type; + typedef __below __argN; + }; + +The class template function_traits will only compile if: + +* The compiler supports partial specialization of class templates. +* The template argument `F` is a /function type/, note that this ['[*is not]] +the same thing as a /pointer to a function/. + +[tip +function_traits is intended to introspect only C++ functions of the +form R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or +class member functions. To convert a function pointer type to a suitable +type use __remove_pointer.] + +[table Function Traits Members +[[Member] [Description]] +[[`function_traits::arity`] + [An integral constant expression that gives the number of arguments accepted by the function type `F`.]] +[[`function_traits::result_type`] + [The type returned by function type `F`.]] +[[`function_traits::__argN`] + [The '''Nth''' argument type of function type `F`, where `1 <= N <= arity` of `F`.]] +] + +[table Examples +[[Expression] [Result]] +[[`function_traits::arity`] [An integral constant expression that has the value 0.]] +[[`function_traits::arity`] [An integral constant expression that has the value 1.]] +[[`function_traits::arity`] [An integral constant expression that has the value 4.]] +[[`function_traits::result_type`] [The type `void`.]] +[[`function_traits::result_type`] [The type `long`.]] +[[`function_traits::arg1_type`] [The type `int`.]] +[[`function_traits::arg4_type`] [The type `void*`.]] +[[`function_traits::arg5_type`] [A compiler error: there is no `arg5_type` since there are only four arguments.]] +[[`function_traits::arity`] [A compiler error: argument type is a /function pointer/, and not a /function type/.]] + +] + +[all_compilers] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_bit_and.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_and.qbk new file mode 100644 index 0000000000000000000000000000000000000000..bf91a7c503e220b6536b6ce9ed69f1a3bcd40eb1 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_and.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_bit_and has_bit_and] + template + struct has_bit_and : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs&rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs&rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator&`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs&rhs); // is valid if has_bit_and::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +__examples + +[:`has_bit_and::value_type` is the type `bool`.] +[:`has_bit_and::value` is a `bool` integral constant expression.] +[:`has_bit_and::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_bit_and` inherits from `__true_type`.] + +[:`has_bit_and` inherits from `__true_type`.] +[:`has_bit_and` inherits from `__true_type`.] + +[:`has_bit_and` inherits from `__false_type`.] +[:`has_bit_and` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[has_binary_operator_compat] + +[*Known issues:] + +* This trait cannot detect whether binary `operator&` is public or not: +if `operator&` is defined as a private member of `Lhs` then +instantiating `has_bit_and` will produce a compiler error. +For this reason `has_bit_and` cannot be used to determine whether a type has a public `operator&` or not. +`` +struct A { private: void operator&(const A&); }; +boost::has_bit_and::value; // error: A::operator&(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator&(const A&, const A&); +struct B { operator A(); }; +boost::has_bit_and::value; // this is fine +boost::has_bit_and::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator&` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator&(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g&g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b&b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_bit_and_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_and_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..200f8ae26f351ef180d5070eb4ebe683181365f3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_and_assign.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_bit_and_assign has_bit_and_assign] + template + struct has_bit_and_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs&=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs&=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator&=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs&=rhs); // is valid if has_bit_and_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_bit_and_assign::value_type` is the type `bool`.] +[:`has_bit_and_assign::value` is a `bool` integral constant expression.] +[:`has_bit_and_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_bit_and_assign` inherits from `__true_type`.] + +[:`has_bit_and_assign` inherits from `__true_type`.] + +[:`has_bit_and_assign` inherits from `__false_type`.] +[:`has_bit_and_assign` inherits from `__false_type`.] +[:`has_bit_and_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator&=` is public or not: +if `operator&=` is defined as a private member of `Lhs` then +instantiating `has_bit_and_assign` will produce a compiler error. +For this reason `has_bit_and_assign` cannot be used to determine whether a type has a public `operator&=` or not. +`` +struct A { private: void operator&=(const A&); }; +boost::has_bit_and_assign::value; // error: A::operator&=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator&=(const A&, const A&); +struct B { operator A(); }; +boost::has_bit_and_assign::value; // this is fine +boost::has_bit_and_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator&=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator&=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g&=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b&=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_bit_or.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_or.qbk new file mode 100644 index 0000000000000000000000000000000000000000..4ec707d06739c00d6d05f4b4e1805ac25bbc8241 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_or.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_bit_or has_bit_or] + template + struct has_bit_or : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs|rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs|rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator|`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs|rhs); // is valid if has_bit_or::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_bit_or::value_type` is the type `bool`.] +[:`has_bit_or::value` is a `bool` integral constant expression.] +[:`has_bit_or::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_bit_or` inherits from `__true_type`.] + +[:`has_bit_or` inherits from `__true_type`.] +[:`has_bit_or` inherits from `__true_type`.] + +[:`has_bit_or` inherits from `__false_type`.] +[:`has_bit_or` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator|` is public or not: +if `operator|` is defined as a private member of `Lhs` then +instantiating `has_bit_or` will produce a compiler error. +For this reason `has_bit_or` cannot be used to determine whether a type has a public `operator|` or not. +`` +struct A { private: void operator|(const A&); }; +boost::has_bit_or::value; // error: A::operator|(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator|(const A&, const A&); +struct B { operator A(); }; +boost::has_bit_or::value; // this is fine +boost::has_bit_or::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator|` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator|(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g|g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b|b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_bit_or_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_or_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9f07d470f0748a188d490a8694113aa7a576352e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_or_assign.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_bit_or_assign has_bit_or_assign] + template + struct has_bit_or_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs|=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs|=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator|=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs|=rhs); // is valid if has_bit_or_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_bit_or_assign::value_type` is the type `bool`.] +[:`has_bit_or_assign::value` is a `bool` integral constant expression.] +[:`has_bit_or_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_bit_or_assign` inherits from `__true_type`.] + +[:`has_bit_or_assign` inherits from `__true_type`.] + +[:`has_bit_or_assign` inherits from `__false_type`.] +[:`has_bit_or_assign` inherits from `__false_type`.] +[:`has_bit_or_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator|=` is public or not: +if `operator|=` is defined as a private member of `Lhs` then +instantiating `has_bit_or_assign` will produce a compiler error. +For this reason `has_bit_or_assign` cannot be used to determine whether a type has a public `operator|=` or not. +`` +struct A { private: void operator|=(const A&); }; +boost::has_bit_or_assign::value; // error: A::operator|=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator|=(const A&, const A&); +struct B { operator A(); }; +boost::has_bit_or_assign::value; // this is fine +boost::has_bit_or_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator|=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator|=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g|=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b|=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_bit_xor.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_xor.qbk new file mode 100644 index 0000000000000000000000000000000000000000..8018beb86e928c93d2fa9ad200a43b7da875d78c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_xor.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_bit_xor has_bit_xor] + template + struct has_bit_xor : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs^rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs^rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator^`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs^rhs); // is valid if has_bit_xor::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_bit_xor::value_type` is the type `bool`.] +[:`has_bit_xor::value` is a `bool` integral constant expression.] +[:`has_bit_xor::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_bit_xor` inherits from `__true_type`.] + +[:`has_bit_xor` inherits from `__true_type`.] +[:`has_bit_xor` inherits from `__true_type`.] + +[:`has_bit_xor` inherits from `__false_type`.] +[:`has_bit_xor` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator^` is public or not: +if `operator^` is defined as a private member of `Lhs` then +instantiating `has_bit_xor` will produce a compiler error. +For this reason `has_bit_xor` cannot be used to determine whether a type has a public `operator^` or not. +`` +struct A { private: void operator^(const A&); }; +boost::has_bit_xor::value; // error: A::operator^(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator^(const A&, const A&); +struct B { operator A(); }; +boost::has_bit_xor::value; // this is fine +boost::has_bit_xor::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator^` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator^(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g^g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b^b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_bit_xor_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_xor_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9791c27c0ab8f4614668e7d52dc9c2539728cb7e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_bit_xor_assign.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_bit_xor_assign has_bit_xor_assign] + template + struct has_bit_xor_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs^=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs^=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator^=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs^=rhs); // is valid if has_bit_xor_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_bit_xor_assign::value_type` is the type `bool`.] +[:`has_bit_xor_assign::value` is a `bool` integral constant expression.] +[:`has_bit_xor_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_bit_xor_assign` inherits from `__true_type`.] + +[:`has_bit_xor_assign` inherits from `__true_type`.] + +[:`has_bit_xor_assign` inherits from `__false_type`.] +[:`has_bit_xor_assign` inherits from `__false_type`.] +[:`has_bit_xor_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator^=` is public or not: +if `operator^=` is defined as a private member of `Lhs` then +instantiating `has_bit_xor_assign` will produce a compiler error. +For this reason `has_bit_xor_assign` cannot be used to determine whether a type has a public `operator^=` or not. +`` +struct A { private: void operator^=(const A&); }; +boost::has_bit_xor_assign::value; // error: A::operator^=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator^=(const A&, const A&); +struct B { operator A(); }; +boost::has_bit_xor_assign::value; // this is fine +boost::has_bit_xor_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator^=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator^=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g^=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b^=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_complement.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_complement.qbk new file mode 100644 index 0000000000000000000000000000000000000000..f6b567bdc4b360ff72f60ada81cc29bc80a981c3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_complement.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_complement has_complement] + template + struct has_complement : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `~rhs`, +and (ii) `Ret=dont_care` or the result of expression `~rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator~`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(~rhs); // is valid if has_complement::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_complement::value_type` is the type `bool`.] +[:`has_complement::value` is a `bool` integral constant expression.] +[:`has_complement::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_complement` inherits from `__true_type`.] + +[:`has_complement` inherits from `__true_type`.] +[:`has_complement` inherits from `__true_type`.] +[:`has_complement` inherits from `__true_type`.] + +[:`has_complement` inherits from `__false_type`.] +[:`has_complement` inherits from `__false_type`.] +[:`has_complement` inherits from `__false_type`.] +[:`has_complement` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator~` is public or not: +if `operator~` is defined as a private member of `Rhs` then +instantiating `has_complement` will produce a compiler error. +For this reason `has_complement` cannot be used to determine whether a type has a public `operator~` or not. +`` +struct A { private: void operator~(); }; +boost::has_complement::value; // error: A::operator~() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator~(const A&); +struct B { operator A(); }; +boost::has_complement::value; // this is fine +boost::has_complement::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator~` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator~(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + ~g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + ~b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_dereference.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_dereference.qbk new file mode 100644 index 0000000000000000000000000000000000000000..49b8fea5766c2b7fcae46ed07e796c9e622f6ffb --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_dereference.qbk @@ -0,0 +1,112 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_dereference has_dereference] + template + struct has_dereference : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `*rhs`, +and (ii) `Ret=dont_care` or the result of expression `*rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator*`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(*rhs); // is valid if has_dereference::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_dereference::value_type` is the type `bool`.] +[:`has_dereference::value` is a `bool` integral constant expression.] +[:`has_dereference::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_dereference` inherits from `__true_type`.] + + +[:`has_dereference` inherits from `__true_type`.] +[:`has_dereference` inherits from `__true_type`.] +[:`has_dereference` inherits from `__true_type`.] +[:`has_dereference` inherits from `__true_type`.] +[:`has_dereference` inherits from `__true_type`.] + +[:`has_dereference` inherits from `__false_type`.] +[:`has_dereference` inherits from `__false_type`.] +[:`has_dereference` inherits from `__false_type`.] +[:`has_dereference` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator*` is public or not: +if `operator*` is defined as a private member of `Rhs` then +instantiating `has_dereference` will produce a compiler error. +For this reason `has_dereference` cannot be used to determine whether a type has a public `operator*` or not. +`` +struct A { private: void operator*(); }; +boost::has_dereference::value; // error: A::operator*() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator*(const A&); +struct B { operator A(); }; +boost::has_dereference::value; // this is fine +boost::has_dereference::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator*` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator*(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + *g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + *b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_divides.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_divides.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9a758ec9d0c000bbb672738a01bb1c7b81c6c376 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_divides.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_divides has_divides] + template + struct has_divides : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs/rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs/rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator/`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs/rhs); // is valid if has_divides::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_divides::value_type` is the type `bool`.] +[:`has_divides::value` is a `bool` integral constant expression.] +[:`has_divides::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_divides` inherits from `__true_type`.] + +[:`has_divides` inherits from `__true_type`.] +[:`has_divides` inherits from `__true_type`.] +[:`has_divides` inherits from `__true_type`.] +[:`has_divides` inherits from `__true_type`.] +[:`has_divides::value` inherits from `__true_type`.] + +[:`has_divides` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator/` is public or not: +if `operator/` is defined as a private member of `Lhs` then +instantiating `has_divides` will produce a compiler error. +For this reason `has_divides` cannot be used to determine whether a type has a public `operator/` or not. +`` +struct A { private: void operator/(const A&); }; +boost::has_divides::value; // error: A::operator/(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator/(const A&, const A&); +struct B { operator A(); }; +boost::has_divides::value; // this is fine +boost::has_divides::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator/` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator/(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g/g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b/b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_divides_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_divides_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..7968b8f008c97281e10298417d5ec91b6a6ed177 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_divides_assign.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_divides_assign has_divides_assign] + template + struct has_divides_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs/=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs/=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator/=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs/=rhs); // is valid if has_divides_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_divides_assign::value_type` is the type `bool`.] +[:`has_divides_assign::value` is a `bool` integral constant expression.] +[:`has_divides_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_divides_assign` inherits from `__true_type`.] + +[:`has_divides_assign` inherits from `__true_type`.] +[:`has_divides_assign` inherits from `__true_type`.] +[:`has_divides_assign` inherits from `__true_type`.] +[:`has_divides_assign` inherits from `__true_type`.] + +[:`has_divides_assign::value` inherits from `__false_type`.] +[:`has_divides_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator/=` is public or not: +if `operator/=` is defined as a private member of `Lhs` then +instantiating `has_divides_assign` will produce a compiler error. +For this reason `has_divides_assign` cannot be used to determine whether a type has a public `operator/=` or not. +`` +struct A { private: void operator/=(const A&); }; +boost::has_divides_assign::value; // error: A::operator/=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator/=(const A&, const A&); +struct B { operator A(); }; +boost::has_divides_assign::value; // this is fine +boost::has_divides_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator/=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator/=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g/=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b/=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_equal_to.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_equal_to.qbk new file mode 100644 index 0000000000000000000000000000000000000000..d33e7906e671192aef6289acb6affa270aab9d94 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_equal_to.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_equal_to has_equal_to] + template + struct has_equal_to : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs==rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs==rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator==`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs==rhs); // is valid if has_equal_to::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_equal_to::value_type` is the type `bool`.] +[:`has_equal_to::value` is a `bool` integral constant expression.] +[:`has_equal_to::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_equal_to` inherits from `__true_type`.] + +[:`has_equal_to` inherits from `__true_type`.] +[:`has_equal_to` inherits from `__true_type`.] +[:`has_equal_to` inherits from `__true_type`.] + +[:`has_equal_to` inherits from `__false_type`.] +[:`has_equal_to` inherits from `__false_type`.] +[:`has_equal_to` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator==` is public or not: +if `operator==` is defined as a private member of `Lhs` then +instantiating `has_equal_to` will produce a compiler error. +For this reason `has_equal_to` cannot be used to determine whether a type has a public `operator==` or not. +`` +struct A { private: void operator==(const A&); }; +boost::has_equal_to::value; // error: A::operator==(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator==(const A&, const A&); +struct B { operator A(); }; +boost::has_equal_to::value; // this is fine +boost::has_equal_to::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator==` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator==(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g==g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b==b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_greater.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_greater.qbk new file mode 100644 index 0000000000000000000000000000000000000000..d3444204f1cd3654f0e469805961d121b7cf833a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_greater.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_greater has_greater] + template + struct has_greater : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs>rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs>rhs); // is valid if has_greater::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_greater::value_type` is the type `bool`.] +[:`has_greater::value` is a `bool` integral constant expression.] +[:`has_greater::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_greater` inherits from `__true_type`.] + +[:`has_greater` inherits from `__true_type`.] +[:`has_greater` inherits from `__true_type`.] +[:`has_greater` inherits from `__true_type`.] + +[:`has_greater` inherits from `__false_type`.] +[:`has_greater` inherits from `__false_type`.] +[:`has_greater` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator>` is public or not: +if `operator>` is defined as a private member of `Lhs` then +instantiating `has_greater` will produce a compiler error. +For this reason `has_greater` cannot be used to determine whether a type has a public `operator>` or not. +`` +struct A { private: void operator>(const A&); }; +boost::has_greater::value; // error: A::operator>(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator>(const A&, const A&); +struct B { operator A(); }; +boost::has_greater::value; // this is fine +boost::has_greater::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator>` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator>(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_greater_equal.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_greater_equal.qbk new file mode 100644 index 0000000000000000000000000000000000000000..bed504218feef0290a3414194c6ee93dee262641 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_greater_equal.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_greater_equal has_greater_equal] + template + struct has_greater_equal : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs>=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs>=rhs); // is valid if has_greater_equal::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_greater_equal::value_type` is the type `bool`.] +[:`has_greater_equal::value` is a `bool` integral constant expression.] +[:`has_greater_equal::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_greater_equal` inherits from `__true_type`.] + +[:`has_greater_equal` inherits from `__true_type`.] +[:`has_greater_equal` inherits from `__true_type`.] +[:`has_greater_equal` inherits from `__true_type`.] + +[:`has_greater_equal` inherits from `__false_type`.] +[:`has_greater_equal` inherits from `__false_type`.] +[:`has_greater_equal` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator>=` is public or not: +if `operator>=` is defined as a private member of `Lhs` then +instantiating `has_greater_equal` will produce a compiler error. +For this reason `has_greater_equal` cannot be used to determine whether a type has a public `operator>=` or not. +`` +struct A { private: void operator>=(const A&); }; +boost::has_greater_equal::value; // error: A::operator>=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator>=(const A&, const A&); +struct B { operator A(); }; +boost::has_greater_equal::value; // this is fine +boost::has_greater_equal::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator>=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator>=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_left_shift.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_left_shift.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b807a36dfa4b300ac16ba6e8c02e8517b438891b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_left_shift.qbk @@ -0,0 +1,110 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_left_shift has_left_shift] + template + struct has_left_shift : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_left_shift::value_type` is the type `bool`.] +[:`has_left_shift::value` is a `bool` integral constant expression.] +[:`has_left_shift::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_left_shift` inherits from `__true_type`.] + +[:`has_left_shift` inherits from `__true_type`.] +[:`has_left_shift` inherits from `__true_type`.] +[:`has_left_shift` inherits from `__true_type`.] +[:`has_left_shift` inherits from `__true_type`.] +[:`has_left_shift` inherits from `__true_type`.] + +[:`has_left_shift` inherits from `__false_type`.] +[:`has_left_shift` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator<<` is public or not: +if `operator<<` is defined as a private member of `Lhs` then +instantiating `has_left_shift` will produce a compiler error. +For this reason `has_left_shift` cannot be used to determine whether a type has a public `operator<<` or not. +`` +struct A { private: void operator<<(const A&); }; +boost::has_left_shift::value; // error: A::operator<<(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator<<(const A&, const A&); +struct B { operator A(); }; +boost::has_left_shift::value; // this is fine +boost::has_left_shift::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator<<` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator<<(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g< + std::cout< >::value<<'\n'; // true, should be false + contains b; + b< + struct has_left_shift_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<<=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs<<=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator<<=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs<<=rhs); // is valid if has_left_shift_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_left_shift_assign::value_type` is the type `bool`.] +[:`has_left_shift_assign::value` is a `bool` integral constant expression.] +[:`has_left_shift_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_left_shift_assign` inherits from `__true_type`.] + +[:`has_left_shift_assign` inherits from `__true_type`.] + +[:`has_left_shift_assign` inherits from `__false_type`.] +[:`has_left_shift_assign` inherits from `__false_type`.] +[:`has_left_shift_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator<<=` is public or not: +if `operator<<=` is defined as a private member of `Lhs` then +instantiating `has_left_shift_assign` will produce a compiler error. +For this reason `has_left_shift_assign` cannot be used to determine whether a type has a public `operator<<=` or not. +`` +struct A { private: void operator<<=(const A&); }; +boost::has_left_shift_assign::value; // error: A::operator<<=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator<<=(const A&, const A&); +struct B { operator A(); }; +boost::has_left_shift_assign::value; // this is fine +boost::has_left_shift_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator<<=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator<<=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g<<=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b<<=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_less.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_less.qbk new file mode 100644 index 0000000000000000000000000000000000000000..daa81cbd86c83a084202101d840c56af8f1b6a97 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_less.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_less has_less] + template + struct has_less : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_less::value_type` is the type `bool`.] +[:`has_less::value` is a `bool` integral constant expression.] +[:`has_less::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_less` inherits from `__true_type`.] + +[:`has_less` inherits from `__true_type`.] +[:`has_less` inherits from `__true_type`.] +[:`has_less` inherits from `__true_type`.] + +[:`has_less` inherits from `__false_type`.] +[:`has_less` inherits from `__false_type`.] +[:`has_less` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator<` is public or not: +if `operator<` is defined as a private member of `Lhs` then +instantiating `has_less` will produce a compiler error. +For this reason `has_less` cannot be used to determine whether a type has a public `operator<` or not. +`` +struct A { private: void operator<(const A&); }; +boost::has_less::value; // error: A::operator<(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator<(const A&, const A&); +struct B { operator A(); }; +boost::has_less::value; // this is fine +boost::has_less::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator<` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator<(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g + std::cout< >::value<<'\n'; // true, should be false + contains b; + b + struct has_less_equal : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs<=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs<=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator<=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs<=rhs); // is valid if has_less_equal::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_less_equal::value_type` is the type `bool`.] +[:`has_less_equal::value` is a `bool` integral constant expression.] +[:`has_less_equal::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_less_equal` inherits from `__true_type`.] + +[:`has_less_equal` inherits from `__true_type`.] +[:`has_less_equal` inherits from `__true_type`.] +[:`has_less_equal` inherits from `__true_type`.] + +[:`has_less_equal` inherits from `__false_type`.] +[:`has_less_equal` inherits from `__false_type`.] +[:`has_less_equal` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator<=` is public or not: +if `operator<=` is defined as a private member of `Lhs` then +instantiating `has_less_equal` will produce a compiler error. +For this reason `has_less_equal` cannot be used to determine whether a type has a public `operator<=` or not. +`` +struct A { private: void operator<=(const A&); }; +boost::has_less_equal::value; // error: A::operator<=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator<=(const A&, const A&); +struct B { operator A(); }; +boost::has_less_equal::value; // this is fine +boost::has_less_equal::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator<=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator<=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g<=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b<=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_logical_and.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_logical_and.qbk new file mode 100644 index 0000000000000000000000000000000000000000..62f26728dac37ace02cf8102339aa03ed81935d2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_logical_and.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_logical_and has_logical_and] + template + struct has_logical_and : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs&&rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs&&rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator&&`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs&&rhs); // is valid if has_logical_and::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_logical_and::value_type` is the type `bool`.] +[:`has_logical_and::value` is a `bool` integral constant expression.] +[:`has_logical_and::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_logical_and` inherits from `__true_type`.] + +[:`has_logical_and` inherits from `__true_type`.] +[:`has_logical_and` inherits from `__true_type`.] +[:`has_logical_and` inherits from `__true_type`.] +[:`has_logical_and::value` inherits from `__true_type`.] + +[:`has_logical_and` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator&&` is public or not: +if `operator&&` is defined as a private member of `Lhs` then +instantiating `has_logical_and` will produce a compiler error. +For this reason `has_logical_and` cannot be used to determine whether a type has a public `operator&&` or not. +`` +struct A { private: void operator&&(const A&); }; +boost::has_logical_and::value; // error: A::operator&&(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator&&(const A&, const A&); +struct B { operator A(); }; +boost::has_logical_and::value; // this is fine +boost::has_logical_and::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator&&` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator&&(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g&&g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b&&b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_logical_not.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_logical_not.qbk new file mode 100644 index 0000000000000000000000000000000000000000..2eec31ca1fb298a85fa33c04969ef691c5ea12e7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_logical_not.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_logical_not has_logical_not] + template + struct has_logical_not : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `!rhs`, +and (ii) `Ret=dont_care` or the result of expression `!rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator!`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(!rhs); // is valid if has_logical_not::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_logical_not::value_type` is the type `bool`.] +[:`has_logical_not::value` is a `bool` integral constant expression.] +[:`has_logical_not::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_logical_not` inherits from `__true_type`.] + +[:`has_logical_not` inherits from `__true_type`.] +[:`has_logical_not` inherits from `__true_type`.] +[:`has_logical_not` inherits from `__true_type`.] +[:`has_logical_not` inherits from `__true_type`.] +[:`has_logical_not` inherits from `__true_type`.] + +[:`has_logical_not` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator!` is public or not: +if `operator!` is defined as a private member of `Rhs` then +instantiating `has_logical_not` will produce a compiler error. +For this reason `has_logical_not` cannot be used to determine whether a type has a public `operator!` or not. +`` +struct A { private: void operator!(); }; +boost::has_logical_not::value; // error: A::operator!() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator!(const A&); +struct B { operator A(); }; +boost::has_logical_not::value; // this is fine +boost::has_logical_not::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator!` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator!(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + !g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + !b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_logical_or.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_logical_or.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9bf2fd234c1702e1167f989d08d1d695a440fd3f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_logical_or.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_logical_or has_logical_or] + template + struct has_logical_or : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs||rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs||rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator||`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs||rhs); // is valid if has_logical_or::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_logical_or::value_type` is the type `bool`.] +[:`has_logical_or::value` is a `bool` integral constant expression.] +[:`has_logical_or::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_logical_or` inherits from `__true_type`.] + +[:`has_logical_or` inherits from `__true_type`.] +[:`has_logical_or` inherits from `__true_type`.] +[:`has_logical_or` inherits from `__true_type`.] +[:`has_logical_or::value` inherits from `__true_type`.] + +[:`has_logical_or` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator||` is public or not: +if `operator||` is defined as a private member of `Lhs` then +instantiating `has_logical_or` will produce a compiler error. +For this reason `has_logical_or` cannot be used to determine whether a type has a public `operator||` or not. +`` +struct A { private: void operator||(const A&); }; +boost::has_logical_or::value; // error: A::operator||(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator||(const A&, const A&); +struct B { operator A(); }; +boost::has_logical_or::value; // this is fine +boost::has_logical_or::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator||` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator||(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g||g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b||b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_minus.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_minus.qbk new file mode 100644 index 0000000000000000000000000000000000000000..06141ce90f8c48294962018301f7cb386b05a4d0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_minus.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_minus has_minus] + template + struct has_minus : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs-rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs-rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator-`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs-rhs); // is valid if has_minus::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_minus::value_type` is the type `bool`.] +[:`has_minus::value` is a `bool` integral constant expression.] +[:`has_minus::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_minus` inherits from `__true_type`.] + +[:`has_minus` inherits from `__true_type`.] +[:`has_minus` inherits from `__true_type`.] +[:`has_minus` inherits from `__true_type`.] +[:`has_minus` inherits from `__true_type`.] +[:`has_minus::value` inherits from `__true_type`.] + +[:`has_minus` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator-` is public or not: +if `operator-` is defined as a private member of `Lhs` then +instantiating `has_minus` will produce a compiler error. +For this reason `has_minus` cannot be used to determine whether a type has a public `operator-` or not. +`` +struct A { private: void operator-(const A&); }; +boost::has_minus::value; // error: A::operator-(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator-(const A&, const A&); +struct B { operator A(); }; +boost::has_minus::value; // this is fine +boost::has_minus::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator-` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator-(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g-g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b-b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_minus_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_minus_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..cb39468c962e4951ac02d5f463cf8c32b00e8237 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_minus_assign.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_minus_assign has_minus_assign] + template + struct has_minus_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs-=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs-=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator-=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs-=rhs); // is valid if has_minus_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_minus_assign::value_type` is the type `bool`.] +[:`has_minus_assign::value` is a `bool` integral constant expression.] +[:`has_minus_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_minus_assign` inherits from `__true_type`.] + +[:`has_minus_assign` inherits from `__true_type`.] +[:`has_minus_assign` inherits from `__true_type`.] +[:`has_minus_assign` inherits from `__true_type`.] +[:`has_minus_assign` inherits from `__true_type`.] + +[:`has_minus_assign::value` inherits from `__false_type`.] +[:`has_minus_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator-=` is public or not: +if `operator-=` is defined as a private member of `Lhs` then +instantiating `has_minus_assign` will produce a compiler error. +For this reason `has_minus_assign` cannot be used to determine whether a type has a public `operator-=` or not. +`` +struct A { private: void operator-=(const A&); }; +boost::has_minus_assign::value; // error: A::operator-=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator-=(const A&, const A&); +struct B { operator A(); }; +boost::has_minus_assign::value; // this is fine +boost::has_minus_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator-=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator-=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g-=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b-=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_modulus.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_modulus.qbk new file mode 100644 index 0000000000000000000000000000000000000000..5f1384e79210b3835d8d40c48a01f64ba9a970e7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_modulus.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_modulus has_modulus] + template + struct has_modulus : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs%rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs%rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator%`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs%rhs); // is valid if has_modulus::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_modulus::value_type` is the type `bool`.] +[:`has_modulus::value` is a `bool` integral constant expression.] +[:`has_modulus::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_modulus` inherits from `__true_type`.] + +[:`has_modulus` inherits from `__true_type`.] +[:`has_modulus` inherits from `__true_type`.] +[:`has_modulus::value` inherits from `__true_type`.] + +[:`has_modulus` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator%` is public or not: +if `operator%` is defined as a private member of `Lhs` then +instantiating `has_modulus` will produce a compiler error. +For this reason `has_modulus` cannot be used to determine whether a type has a public `operator%` or not. +`` +struct A { private: void operator%(const A&); }; +boost::has_modulus::value; // error: A::operator%(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator%(const A&, const A&); +struct B { operator A(); }; +boost::has_modulus::value; // this is fine +boost::has_modulus::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator%` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator%(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g%g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b%b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_modulus_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_modulus_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..636a250edbe32ae27678226909f7e3e00495defe --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_modulus_assign.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_modulus_assign has_modulus_assign] + template + struct has_modulus_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs%=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs%=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator%=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs%=rhs); // is valid if has_modulus_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_modulus_assign::value_type` is the type `bool`.] +[:`has_modulus_assign::value` is a `bool` integral constant expression.] +[:`has_modulus_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_modulus_assign` inherits from `__true_type`.] + +[:`has_modulus_assign` inherits from `__true_type`.] +[:`has_modulus_assign` inherits from `__true_type`.] + +[:`has_modulus_assign::value` inherits from `__false_type`.] +[:`has_modulus_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator%=` is public or not: +if `operator%=` is defined as a private member of `Lhs` then +instantiating `has_modulus_assign` will produce a compiler error. +For this reason `has_modulus_assign` cannot be used to determine whether a type has a public `operator%=` or not. +`` +struct A { private: void operator%=(const A&); }; +boost::has_modulus_assign::value; // error: A::operator%=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator%=(const A&, const A&); +struct B { operator A(); }; +boost::has_modulus_assign::value; // this is fine +boost::has_modulus_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator%=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator%=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g%=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b%=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_multiplies.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_multiplies.qbk new file mode 100644 index 0000000000000000000000000000000000000000..fed1e653717a2b047946064c0f6ddfe5c48766ac --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_multiplies.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_multiplies has_multiplies] + template + struct has_multiplies : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs*rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs*rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator*`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs*rhs); // is valid if has_multiplies::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_multiplies::value_type` is the type `bool`.] +[:`has_multiplies::value` is a `bool` integral constant expression.] +[:`has_multiplies::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_multiplies` inherits from `__true_type`.] + +[:`has_multiplies` inherits from `__true_type`.] +[:`has_multiplies` inherits from `__true_type`.] +[:`has_multiplies` inherits from `__true_type`.] +[:`has_multiplies` inherits from `__true_type`.] +[:`has_multiplies::value` inherits from `__true_type`.] + +[:`has_multiplies` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator*` is public or not: +if `operator*` is defined as a private member of `Lhs` then +instantiating `has_multiplies` will produce a compiler error. +For this reason `has_multiplies` cannot be used to determine whether a type has a public `operator*` or not. +`` +struct A { private: void operator*(const A&); }; +boost::has_multiplies::value; // error: A::operator*(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator*(const A&, const A&); +struct B { operator A(); }; +boost::has_multiplies::value; // this is fine +boost::has_multiplies::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator*` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator*(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g*g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b*b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_multiplies_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_multiplies_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..7bd67ad44b77de86d8824edba44bdca4c5013af5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_multiplies_assign.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_multiplies_assign has_multiplies_assign] + template + struct has_multiplies_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs*=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs*=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator*=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs*=rhs); // is valid if has_multiplies_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_multiplies_assign::value_type` is the type `bool`.] +[:`has_multiplies_assign::value` is a `bool` integral constant expression.] +[:`has_multiplies_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_multiplies_assign` inherits from `__true_type`.] + +[:`has_multiplies_assign` inherits from `__true_type`.] +[:`has_multiplies_assign` inherits from `__true_type`.] +[:`has_multiplies_assign` inherits from `__true_type`.] +[:`has_multiplies_assign` inherits from `__true_type`.] + +[:`has_multiplies_assign::value` inherits from `__false_type`.] +[:`has_multiplies_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator*=` is public or not: +if `operator*=` is defined as a private member of `Lhs` then +instantiating `has_multiplies_assign` will produce a compiler error. +For this reason `has_multiplies_assign` cannot be used to determine whether a type has a public `operator*=` or not. +`` +struct A { private: void operator*=(const A&); }; +boost::has_multiplies_assign::value; // error: A::operator*=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator*=(const A&, const A&); +struct B { operator A(); }; +boost::has_multiplies_assign::value; // this is fine +boost::has_multiplies_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator*=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator*=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g*=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b*=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_negate.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_negate.qbk new file mode 100644 index 0000000000000000000000000000000000000000..e25c1d38438bb07254e9c97a3f506a2f29af1aff --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_negate.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_negate has_negate] + template + struct has_negate : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `-rhs`, +and (ii) `Ret=dont_care` or the result of expression `-rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator-`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(-rhs); // is valid if has_negate::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_negate::value_type` is the type `bool`.] +[:`has_negate::value` is a `bool` integral constant expression.] +[:`has_negate::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_negate` inherits from `__true_type`.] + +[:`has_negate` inherits from `__true_type`.] +[:`has_negate` inherits from `__true_type`.] +[:`has_negate` inherits from `__true_type`.] +[:`has_negate` inherits from `__true_type`.] +[:`has_negate` inherits from `__true_type`.] + +[:`has_negate` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator-` is public or not: +if `operator-` is defined as a private member of `Rhs` then +instantiating `has_negate` will produce a compiler error. +For this reason `has_negate` cannot be used to determine whether a type has a public `operator-` or not. +`` +struct A { private: void operator-(); }; +boost::has_negate::value; // error: A::operator-() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator-(const A&); +struct B { operator A(); }; +boost::has_negate::value; // this is fine +boost::has_negate::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator-` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator-(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + -g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + -b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_new_operator.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_new_operator.qbk new file mode 100644 index 0000000000000000000000000000000000000000..a40c34ee0f2f19979bbc027c167ef42c8969f672 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_new_operator.qbk @@ -0,0 +1,47 @@ +[/ + Copyright 2009 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_new_operator has_new_operator] + template + struct has_new_operator : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with an overloaded new-operator +then inherits from __true_type, otherwise inherits from __false_type. + +[has_binary_operator_compat] Also known to be broken with the Borland/Codegear compilers. + +__std_ref 12.5. + +__header ` #include ` or ` #include ` + +__examples + +Given: + + class A { void* operator new(std::size_t); }; + class B { void* operator new(std::size_t, const std::nothrow&); }; + class C { void* operator new(std::size_t, void*); }; + class D { void* operator new[](std::size_t); }; + class E { void* operator new[](std::size_t, const std::nothrow&); }; + class F { void* operator new[](std::size_t, void*); }; + +Then: + +[:`has_new_operator` inherits from `__true_type`.] + +[:`has_new_operator` inherits from `__true_type`.] + +[:`has_new_operator` inherits from `__true_type`.] + +[:`has_new_operator` inherits from `__true_type`.] + +[:`has_new_operator` inherits from `__true_type`.] + +[:`has_new_operator` inherits from `__true_type`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_not_equal_to.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_not_equal_to.qbk new file mode 100644 index 0000000000000000000000000000000000000000..83a857ee7abc4337b258171cf835ae6cc1fbaa26 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_not_equal_to.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_not_equal_to has_not_equal_to] + template + struct has_not_equal_to : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs!=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs!=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator!=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs!=rhs); // is valid if has_not_equal_to::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_not_equal_to::value_type` is the type `bool`.] +[:`has_not_equal_to::value` is a `bool` integral constant expression.] +[:`has_not_equal_to::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_not_equal_to` inherits from `__true_type`.] + +[:`has_not_equal_to` inherits from `__true_type`.] +[:`has_not_equal_to` inherits from `__true_type`.] +[:`has_not_equal_to` inherits from `__true_type`.] + +[:`has_not_equal_to` inherits from `__false_type`.] +[:`has_not_equal_to` inherits from `__false_type`.] +[:`has_not_equal_to` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator!=` is public or not: +if `operator!=` is defined as a private member of `Lhs` then +instantiating `has_not_equal_to` will produce a compiler error. +For this reason `has_not_equal_to` cannot be used to determine whether a type has a public `operator!=` or not. +`` +struct A { private: void operator!=(const A&); }; +boost::has_not_equal_to::value; // error: A::operator!=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator!=(const A&, const A&); +struct B { operator A(); }; +boost::has_not_equal_to::value; // this is fine +boost::has_not_equal_to::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator!=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator!=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g!=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b!=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c80a6d3e7daedb2e77a083609f9524c5ece4b3f3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_assign.qbk @@ -0,0 +1,26 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_nothrow_assign has_nothrow_assign] + + template + struct has_nothrow_assign : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing assignment-operator +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler __intrinsics to ensure that this +trait "just works". You may test to see if the necessary support is available +by checking to see if `defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT))` is true. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_constructor.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_constructor.qbk new file mode 100644 index 0000000000000000000000000000000000000000..8295ad9137688c11f965300e94af0ee75720d40c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_constructor.qbk @@ -0,0 +1,31 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_nothrow_constructor has_nothrow_constructor] + + template + struct has_nothrow_constructor : public __tof {}; + + template + struct has_nothrow_default_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing default-constructor +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +These two traits are synonyms for each other. + +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler __intrinsics to ensure that this +trait "just works". You may test to see if the necessary support is available +by checking to see if `defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT))` is true. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_copy.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_copy.qbk new file mode 100644 index 0000000000000000000000000000000000000000..28c251e917af2b06942895b6817d906abe9432e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_copy.qbk @@ -0,0 +1,31 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_nothrow_copy has_nothrow_copy] + + template + struct has_nothrow_copy : public __tof {}; + + template + struct has_nothrow_copy_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing copy-constructor +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +These two traits are synonyms for each other. + +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler __intrinsics to ensure that this +trait "just works". You may test to see if the necessary support is available +by checking to see if `defined(BOOST_HAS_NOTHROW_COPY) || (!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT))` is true. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_destruct.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_destruct.qbk new file mode 100644 index 0000000000000000000000000000000000000000..3d865c13c9e539baf90ca7bd40652566e88f1e4c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_nothrow_destruct.qbk @@ -0,0 +1,29 @@ +[/ + Copyright 2015 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_nothrow_destruct has_nothrow_destructor] + + template + struct has_nothrow_destructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing destructor +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +You may test to see if the necessary support is available +by checking to see if `!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT)` is true. + +__header ` #include ` or ` #include ` + +[note +Note that destructors are assumed to be non-throwing unless they are explicitly marked otherwise with a `throw(something)` specification. +This is in line with the C++11 standard. +] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_plus.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_plus.qbk new file mode 100644 index 0000000000000000000000000000000000000000..48f4281973ddb3f151856f9895f7505c4e6199c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_plus.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_plus has_plus] + template + struct has_plus : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs+rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs+rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator+`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs+rhs); // is valid if has_plus::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_plus::value_type` is the type `bool`.] +[:`has_plus::value` is a `bool` integral constant expression.] +[:`has_plus::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_plus` inherits from `__true_type`.] + +[:`has_plus` inherits from `__true_type`.] +[:`has_plus` inherits from `__true_type`.] +[:`has_plus` inherits from `__true_type`.] +[:`has_plus` inherits from `__true_type`.] +[:`has_plus::value` inherits from `__true_type`.] + +[:`has_plus` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator+` is public or not: +if `operator+` is defined as a private member of `Lhs` then +instantiating `has_plus` will produce a compiler error. +For this reason `has_plus` cannot be used to determine whether a type has a public `operator+` or not. +`` +struct A { private: void operator+(const A&); }; +boost::has_plus::value; // error: A::operator+(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator+(const A&, const A&); +struct B { operator A(); }; +boost::has_plus::value; // this is fine +boost::has_plus::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator+` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator+(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g+g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b+b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_plus_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_plus_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..400ec434c3d56dbf116a8a77d1e02d45bde9a9e4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_plus_assign.qbk @@ -0,0 +1,109 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_plus_assign has_plus_assign] + template + struct has_plus_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs+=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs+=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator+=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs+=rhs); // is valid if has_plus_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_plus_assign::value_type` is the type `bool`.] +[:`has_plus_assign::value` is a `bool` integral constant expression.] +[:`has_plus_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_plus_assign` inherits from `__true_type`.] + +[:`has_plus_assign` inherits from `__true_type`.] +[:`has_plus_assign` inherits from `__true_type`.] +[:`has_plus_assign` inherits from `__true_type`.] +[:`has_plus_assign` inherits from `__true_type`.] + +[:`has_plus_assign::value` inherits from `__false_type`.] +[:`has_plus_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator+=` is public or not: +if `operator+=` is defined as a private member of `Lhs` then +instantiating `has_plus_assign` will produce a compiler error. +For this reason `has_plus_assign` cannot be used to determine whether a type has a public `operator+=` or not. +`` +struct A { private: void operator+=(const A&); }; +boost::has_plus_assign::value; // error: A::operator+=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator+=(const A&, const A&); +struct B { operator A(); }; +boost::has_plus_assign::value; // this is fine +boost::has_plus_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator+=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator+=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g+=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b+=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_post_decrement.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_post_decrement.qbk new file mode 100644 index 0000000000000000000000000000000000000000..2b76d3f762f2a32f8781aed837754be45a52a78b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_post_decrement.qbk @@ -0,0 +1,110 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_post_decrement has_post_decrement] + template + struct has_post_decrement : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` can be used in expression `lhs--`, +and (ii) `Ret=dont_care` or the result of expression `lhs--` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of postfix `operator--`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +f(lhs--); // is valid if has_post_decrement::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_post_decrement::value_type` is the type `bool`.] +[:`has_post_decrement::value` is a `bool` integral constant expression.] +[:`has_post_decrement::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_post_decrement` inherits from `__true_type`.] + +[:`has_post_decrement` inherits from `__true_type`.] +[:`has_post_decrement` inherits from `__true_type`.] +[:`has_post_decrement` inherits from `__true_type`.] +[:`has_post_decrement` inherits from `__true_type`.] + +[:`has_post_decrement` inherits from `__false_type`.] +[:`has_post_decrement` inherits from `__false_type`.] +[:`has_post_decrement` inherits from `__false_type`.] +[:`has_post_decrement` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether postfix `operator--` is public or not: +if `operator--` is defined as a private member of `Lhs` then +instantiating `has_post_decrement` will produce a compiler error. +For this reason `has_post_decrement` cannot be used to determine whether a type has a public `operator--` or not. +`` +struct A { private: void operator--(int); }; +boost::has_post_decrement::value; // error: A::operator--(int) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator--(const A&, int); +struct B { operator A(); }; +boost::has_post_decrement::value; // this is fine +boost::has_post_decrement::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator--` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator--(const contains &lhs, int) { + return f(lhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g--; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b--; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_post_increment.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_post_increment.qbk new file mode 100644 index 0000000000000000000000000000000000000000..06121ece08ba8d60d19ace5a63d2ff038948261e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_post_increment.qbk @@ -0,0 +1,110 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_post_increment has_post_increment] + template + struct has_post_increment : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` can be used in expression `lhs++`, +and (ii) `Ret=dont_care` or the result of expression `lhs++` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of postfix `operator++`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +f(lhs++); // is valid if has_post_increment::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_post_increment::value_type` is the type `bool`.] +[:`has_post_increment::value` is a `bool` integral constant expression.] +[:`has_post_increment::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_post_increment` inherits from `__true_type`.] + +[:`has_post_increment` inherits from `__true_type`.] +[:`has_post_increment` inherits from `__true_type`.] +[:`has_post_increment` inherits from `__true_type`.] +[:`has_post_increment` inherits from `__true_type`.] +[:`has_post_increment` inherits from `__true_type`.] + +[:`has_post_increment` inherits from `__false_type`.] +[:`has_post_increment` inherits from `__false_type`.] +[:`has_post_increment` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether postfix `operator++` is public or not: +if `operator++` is defined as a private member of `Lhs` then +instantiating `has_post_increment` will produce a compiler error. +For this reason `has_post_increment` cannot be used to determine whether a type has a public `operator++` or not. +`` +struct A { private: void operator++(int); }; +boost::has_post_increment::value; // error: A::operator++(int) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator++(const A&, int); +struct B { operator A(); }; +boost::has_post_increment::value; // this is fine +boost::has_post_increment::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator++` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator++(const contains &lhs, int) { + return f(lhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g++; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b++; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_pre_decrement.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_pre_decrement.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b23938801eef4d5c0640e9b905f69f1fc34a13bc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_pre_decrement.qbk @@ -0,0 +1,110 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_pre_decrement has_pre_decrement] + template + struct has_pre_decrement : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `--rhs`, +and (ii) `Ret=dont_care` or the result of expression `--rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator--`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(--rhs); // is valid if has_pre_decrement::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_pre_decrement::value_type` is the type `bool`.] +[:`has_pre_decrement::value` is a `bool` integral constant expression.] +[:`has_pre_decrement::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_pre_decrement` inherits from `__true_type`.] + +[:`has_pre_decrement` inherits from `__true_type`.] +[:`has_pre_decrement` inherits from `__true_type`.] +[:`has_pre_decrement` inherits from `__true_type`.] +[:`has_pre_decrement` inherits from `__true_type`.] + +[:`has_pre_decrement` inherits from `__false_type`.] +[:`has_pre_decrement` inherits from `__false_type`.] +[:`has_pre_decrement` inherits from `__false_type`.] +[:`has_pre_decrement` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator--` is public or not: +if `operator--` is defined as a private member of `Rhs` then +instantiating `has_pre_decrement` will produce a compiler error. +For this reason `has_pre_decrement` cannot be used to determine whether a type has a public `operator--` or not. +`` +struct A { private: void operator--(); }; +boost::has_pre_decrement::value; // error: A::operator--() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator--(const A&); +struct B { operator A(); }; +boost::has_pre_decrement::value; // this is fine +boost::has_pre_decrement::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator--` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator--(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + --g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + --b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_pre_increment.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_pre_increment.qbk new file mode 100644 index 0000000000000000000000000000000000000000..400869242a3d54a3fd467db906e5ff3b291f664a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_pre_increment.qbk @@ -0,0 +1,110 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_pre_increment has_pre_increment] + template + struct has_pre_increment : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `++rhs`, +and (ii) `Ret=dont_care` or the result of expression `++rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator++`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(++rhs); // is valid if has_pre_increment::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_pre_increment::value_type` is the type `bool`.] +[:`has_pre_increment::value` is a `bool` integral constant expression.] +[:`has_pre_increment::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_pre_increment` inherits from `__true_type`.] + +[:`has_pre_increment` inherits from `__true_type`.] +[:`has_pre_increment` inherits from `__true_type`.] +[:`has_pre_increment` inherits from `__true_type`.] +[:`has_pre_increment` inherits from `__true_type`.] +[:`has_pre_increment` inherits from `__true_type`.] + +[:`has_pre_increment` inherits from `__false_type`.] +[:`has_pre_increment` inherits from `__false_type`.] +[:`has_pre_increment` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator++` is public or not: +if `operator++` is defined as a private member of `Rhs` then +instantiating `has_pre_increment` will produce a compiler error. +For this reason `has_pre_increment` cannot be used to determine whether a type has a public `operator++` or not. +`` +struct A { private: void operator++(); }; +boost::has_pre_increment::value; // error: A::operator++() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator++(const A&); +struct B { operator A(); }; +boost::has_pre_increment::value; // this is fine +boost::has_pre_increment::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator++` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator++(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + ++g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + ++b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_right_shift.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_right_shift.qbk new file mode 100644 index 0000000000000000000000000000000000000000..dee8852e02774b71388d0029920253f609b537a8 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_right_shift.qbk @@ -0,0 +1,110 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_right_shift has_right_shift] + template + struct has_right_shift : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>>rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs>>rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>>`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs>>rhs); // is valid if has_right_shift::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_right_shift::value_type` is the type `bool`.] +[:`has_right_shift::value` is a `bool` integral constant expression.] +[:`has_right_shift::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_right_shift` inherits from `__true_type`.] + +[:`has_right_shift` inherits from `__true_type`.] +[:`has_right_shift` inherits from `__true_type`.] +[:`has_right_shift` inherits from `__true_type`.] +[:`has_right_shift` inherits from `__true_type`.] +[:`has_right_shift` inherits from `__true_type`.] + +[:`has_right_shift` inherits from `__false_type`.] +[:`has_right_shift` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator>>` is public or not: +if `operator>>` is defined as a private member of `Lhs` then +instantiating `has_right_shift` will produce a compiler error. +For this reason `has_right_shift` cannot be used to determine whether a type has a public `operator>>` or not. +`` +struct A { private: void operator>>(const A&); }; +boost::has_right_shift::value; // error: A::operator>>(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator>>(const A&, const A&); +struct B { operator A(); }; +boost::has_right_shift::value; // this is fine +boost::has_right_shift::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator>>` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator>>(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>>g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>>b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_right_shift_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_right_shift_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..d45dea58dd6ff29b07370cafd3545ee5ef222426 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_right_shift_assign.qbk @@ -0,0 +1,107 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_right_shift_assign has_right_shift_assign] + template + struct has_right_shift_assign : public __tof {}; + +__inherit +If (i) `lhs` of type `Lhs` and `rhs` of type `Rhs` can be used in expression `lhs>>=rhs`, +and (ii) `Ret=dont_care` or the result of expression `lhs>>=rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of binary `operator>>=`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Lhs lhs; +Rhs rhs; +f(lhs>>=rhs); // is valid if has_right_shift_assign::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_right_shift_assign::value_type` is the type `bool`.] +[:`has_right_shift_assign::value` is a `bool` integral constant expression.] +[:`has_right_shift_assign::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_right_shift_assign` inherits from `__true_type`.] + +[:`has_right_shift_assign` inherits from `__true_type`.] + +[:`has_right_shift_assign` inherits from `__false_type`.] +[:`has_right_shift_assign` inherits from `__false_type`.] +[:`has_right_shift_assign` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether binary `operator>>=` is public or not: +if `operator>>=` is defined as a private member of `Lhs` then +instantiating `has_right_shift_assign` will produce a compiler error. +For this reason `has_right_shift_assign` cannot be used to determine whether a type has a public `operator>>=` or not. +`` +struct A { private: void operator>>=(const A&); }; +boost::has_right_shift_assign::value; // error: A::operator>>=(const A&) is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator>>=(const A&, const A&); +struct B { operator A(); }; +boost::has_right_shift_assign::value; // this is fine +boost::has_right_shift_assign::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator>>=` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator>>=(const contains &lhs, const contains &rhs) { + return f(lhs.data, rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&, const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + g>>=g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + b>>=b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..30fa5608fbafcac087f72bea1e3f71690420874a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_assign.qbk @@ -0,0 +1,49 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_trivial_assign has_trivial_assign] + template + struct has_trivial_assign : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial assignment-operator +then inherits from __true_type, otherwise inherits from __false_type. + +If a type has a trivial assignment-operator then the operator has the same effect +as copying the bits of one object to the other: +calls to the operator can be safely replaced with a call to `memcpy`. + +__compat Without some (as yet unspecified) help from the compiler, +has_trivial_assign will never report that a user-defined class or struct has a +trivial constructor; this is always safe, if possibly sub-optimal. In order to +correctly handle deleted or private assignment operators, the compiler must also +support C++11's `decltype`. +Currently (May 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_ASSIGN` is defined. + + +__std_ref 12.8p11. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_assign` inherits from `__true_type`.] + +[:`has_trivial_assign::type` is the type `__true_type`.] + +[:`has_trivial_assign::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_assign::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_assign::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_constructor.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_constructor.qbk new file mode 100644 index 0000000000000000000000000000000000000000..cf964c4188c25c920a0bd15a24e11fec86e81763 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_constructor.qbk @@ -0,0 +1,57 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_trivial_constructor has_trivial_constructor] + + template + struct has_trivial_constructor : public __tof {}; + + template + struct has_trivial_default_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial default-constructor +then inherits from __true_type, otherwise inherits from __false_type. + +These two traits are synonyms for each other. + +If a type has a trivial default-constructor then the constructor have no effect: +calls to the constructor can be safely omitted. Note that using meta-programming +to omit a call to a single trivial-constructor call is of no benefit whatsoever. +However, if loops and/or exception handling code can also be omitted, then some +benefit in terms of code size and speed can be obtained. + +__compat Without some (as yet unspecified) help from the compiler, +has_trivial_constructor will never report that a user-defined class or struct has a +trivial constructor; this is always safe, if possibly sub-optimal. +In addition, in order to correctly handle private or deleted default-constructors then +C++11's `deltype` is required. +Currently (May 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_CONSTRUCTOR` is defined. + + +__std_ref 12.1p6. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_constructor` inherits from `__true_type`.] + +[:`has_trivial_constructor::type` is the type `__true_type`.] + +[:`has_trivial_constructor::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_constructor::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_constructor::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_copy.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_copy.qbk new file mode 100644 index 0000000000000000000000000000000000000000..084374b94a1145305e546128ad22ee52608f781c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_copy.qbk @@ -0,0 +1,55 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_trivial_copy has_trivial_copy] + + template + struct has_trivial_copy : public __tof {}; + + template + struct has_trivial_copy_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial copy-constructor +then inherits from __true_type, otherwise inherits from __false_type. + +These two traits are synonyms for each other. + +If a type has a trivial copy-constructor then the constructor has the same effect +as copying the bits of one object to the other: +calls to the constructor can be safely replaced with a call to `memcpy`. + +__compat Without some (as yet unspecified) help from the compiler, +has_trivial_copy will never report that a user-defined class or struct has a +trivial constructor; this is always safe, if possibly sub-optimal. +In addition, in order to correctly handle deleted or private copy-constructors +then C++11's `dectype` is required. +Currently (May 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_COPY` is defined. + + +__std_ref 12.8p6. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_copy` inherits from `__true_type`.] + +[:`has_trivial_copy::type` is the type `__true_type`.] + +[:`has_trivial_copy::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_copy::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_copy::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_destructor.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_destructor.qbk new file mode 100644 index 0000000000000000000000000000000000000000..051edf3461e88a1f0060fab5a7a2b8a38b2b0995 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_destructor.qbk @@ -0,0 +1,51 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_trivial_destructor has_trivial_destructor] + template + struct has_trivial_destructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial destructor +then inherits from __true_type, otherwise inherits from __false_type. + +If a type has a trivial destructor then the destructor has no effect: +calls to the destructor can be safely omitted. Note that using meta-programming +to omit a call to a single trivial-constructor call is of no benefit whatsoever. +However, if loops and/or exception handling code can also be omitted, then some +benefit in terms of code size and speed can be obtained. + +__compat Without some (as yet unspecified) help from the compiler, +has_trivial_destructor will never report that a user-defined class or struct has a +trivial destructor; this is always safe, if possibly sub-optimal. +In addition, in order to correctly handle deleted or private destructors then +support for C++11's `decltype` is required. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_DESTRUCTOR` is defined. + + +__std_ref 12.4p3. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_destructor` inherits from `__true_type`.] + +[:`has_trivial_destructor::type` is the type `__true_type`.] + +[:`has_trivial_destructor::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_destructor::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_destructor::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_move_assign.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_move_assign.qbk new file mode 100644 index 0000000000000000000000000000000000000000..373d5f04ad1d624248858c5e45f0c6b16202cf82 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_move_assign.qbk @@ -0,0 +1,48 @@ +[/ + Copyright 2007 John Maddock. + Copyright 2013 Antony Polukhin. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_trivial_move_assign has_trivial_move_assign] + template + struct has_trivial_move_assign : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial move assignment-operator +then inherits from __true_type, otherwise inherits from __false_type. + +If a type has a trivial move assignment-operator then the operator has the same effect +as copying the bits of one object to the other: +calls to the operator can be safely replaced with a call to `memcpy`. + +__compat Without some (as yet unspecified) help from the compiler, +has_trivial_move_assign will never report that a user-defined class or struct has a +trivial move assign; this is always safe, if possibly sub-optimal. +In addition, in order to correctly handle private or deleted move assignment +operators then c++11's `decltype` is required. +Currently (June 2015) compilers that have the necessary __intrinsics to ensure that this +trait "just works" include Clang, GCC-5.1 and MSVC-12.0. +You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_MOVE_ASSIGN` is defined. + + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_move_assign` inherits from `__true_type`.] + +[:`has_trivial_move_assign::type` is the type `__true_type`.] + +[:`has_trivial_move_assign::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_move_assign::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_move_assign::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_move_constructor.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_move_constructor.qbk new file mode 100644 index 0000000000000000000000000000000000000000..92d6bb7a0eeb1067d0bc07e354bcab9e1ba00e35 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_trivial_move_constructor.qbk @@ -0,0 +1,49 @@ +[/ + Copyright 2007 John Maddock. + Copyright 2013 Antony Polukhin. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_trivial_move_constructor has_trivial_move_constructor] + + template + struct has_trivial_move_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial move-constructor +then inherits from __true_type, otherwise inherits from __false_type. + +If a type has a trivial move-constructor then the constructor has the same effect +as copying the bits of one object to the other: +calls to the constructor can be safely replaced with a call to `memcpy`. + +__compat Without some (as yet unspecified) help from the compiler, +has_trivial_move_constructor will never report that a user-defined class or struct has a +trivial constructor; this is always safe, if possibly sub-optimal. +In addition C++11's `decltype` is required to correctly support deleted or private +move constructors. +Currently (June 2015) compilers that have the necessary __intrinsics to ensure that this +trait "just works" include Clang, GCC-5.1, and MSVC-12.0. +You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR` is defined. + + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_move_constructor` inherits from `__true_type`.] + +[:`has_trivial_move_constructor::type` is the type `__true_type`.] + +[:`has_trivial_move_constructor::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_move_constructor::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_move_constructor::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_unary_minus.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_unary_minus.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9ba7988ea0c46038ff226937ab43c6d71ff102f2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_unary_minus.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_unary_minus has_unary_minus] + template + struct has_unary_minus : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `-rhs`, +and (ii) `Ret=dont_care` or the result of expression `-rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator-`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(-rhs); // is valid if has_unary_minus::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_unary_minus::value_type` is the type `bool`.] +[:`has_unary_minus::value` is a `bool` integral constant expression.] +[:`has_unary_minus::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_unary_minus` inherits from `__true_type`.] + +[:`has_unary_minus` inherits from `__true_type`.] +[:`has_unary_minus` inherits from `__true_type`.] +[:`has_unary_minus` inherits from `__true_type`.] +[:`has_unary_minus` inherits from `__true_type`.] +[:`has_unary_minus` inherits from `__true_type`.] + +[:`has_unary_minus` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator-` is public or not: +if `operator-` is defined as a private member of `Rhs` then +instantiating `has_unary_minus` will produce a compiler error. +For this reason `has_unary_minus` cannot be used to determine whether a type has a public `operator-` or not. +`` +struct A { private: void operator-(); }; +boost::has_unary_minus::value; // error: A::operator-() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator-(const A&); +struct B { operator A(); }; +boost::has_unary_minus::value; // this is fine +boost::has_unary_minus::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator-` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator-(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + -g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + -b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_unary_plus.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_unary_plus.qbk new file mode 100644 index 0000000000000000000000000000000000000000..65401643c483ae5482317a617571ed86c8baea75 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_unary_plus.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright 2009-2011 Frederic Bron. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_unary_plus has_unary_plus] + template + struct has_unary_plus : public __tof {}; + +__inherit +If (i) `rhs` of type `Rhs` can be used in expression `+rhs`, +and (ii) `Ret=dont_care` or the result of expression `+rhs` is convertible to `Ret` +then inherits from __true_type, +otherwise inherits from __false_type. + +The default behaviour (`Ret=dont_care`) is to not check for the return value of prefix `operator+`. +If `Ret` is different from the default `dont_care` type, the return value is checked to be convertible to `Ret`. +Convertible to `Ret` means that the return value of the operator can be used as argument to a function expecting `Ret`: +`` +void f(Ret); +Rhs rhs; +f(+rhs); // is valid if has_unary_plus::value==true +`` +If `Ret=void`, the return type is checked to be exactly `void`. + +__header `#include ` or `#include ` or `#include ` + +[has_binary_operator_compat] + +__examples + +[:`has_unary_plus::value_type` is the type `bool`.] +[:`has_unary_plus::value` is a `bool` integral constant expression.] +[:`has_unary_plus::value` is a `bool` integral constant expression that evaluates to `true`.] +[:`has_unary_plus` inherits from `__true_type`.] + +[:`has_unary_plus` inherits from `__true_type`.] +[:`has_unary_plus` inherits from `__true_type`.] +[:`has_unary_plus` inherits from `__true_type`.] +[:`has_unary_plus` inherits from `__true_type`.] +[:`has_unary_plus` inherits from `__true_type`.] + +[:`has_unary_plus` inherits from `__false_type`.] + + +[*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] + +[*Known issues:] + +* This trait cannot detect whether prefix `operator+` is public or not: +if `operator+` is defined as a private member of `Rhs` then +instantiating `has_unary_plus` will produce a compiler error. +For this reason `has_unary_plus` cannot be used to determine whether a type has a public `operator+` or not. +`` +struct A { private: void operator+(); }; +boost::has_unary_plus::value; // error: A::operator+() is private +`` + +* There is an issue if the operator exists only for type `A` and `B` is +convertible to `A`. In this case, the compiler will report an ambiguous overload. +`` +struct A { }; +void operator+(const A&); +struct B { operator A(); }; +boost::has_unary_plus::value; // this is fine +boost::has_unary_plus::value; // error: ambiguous overload +`` + +* There is an issue when applying this trait to template classes. +If `operator+` is defined but does not bind for a given template type, +it is still detected by the trait which returns `true` instead of `false`. +Example: +`` +#include +#include + +template +struct contains { T data; }; + +template +bool operator+(const contains &rhs) { + return f(rhs.data); +} + +class bad { }; +class good { }; +bool f(const good&) { } + +int main() { + std::cout< + std::cout< >::value<<'\n'; // true + contains g; + +g; // ok + // does not work for contains + std::cout< >::value<<'\n'; // true, should be false + contains b; + +b; // compile time error + return 0; +} +`` + +* `volatile` qualifier is not properly handled and would lead to undefined behavior + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/has_virtual_destructor.qbk b/tools/boost_1_65_1/libs/type_traits/doc/has_virtual_destructor.qbk new file mode 100644 index 0000000000000000000000000000000000000000..d7fb8bf9af10ba9769b2d1c2903a2b1682c32a9b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/has_virtual_destructor.qbk @@ -0,0 +1,31 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:has_virtual_destructor has_virtual_destructor] + template + struct has_virtual_destructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a virtual destructor +then inherits from __true_type, otherwise inherits from __false_type. + +__compat There is currently no +way to portably implement this trait: the default version +always inherits from __false_type, and has to be explicitly specialized for +types with virtual destructors unless the compiler used has compiler __intrinsics +that enable the trait to do the right thing: +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, plus Codegear and Clang have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_VIRTUAL_DESTRUCTOR` is defined. + + +__std_ref 12.4. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/history.qbk b/tools/boost_1_65_1/libs/type_traits/doc/history.qbk new file mode 100644 index 0000000000000000000000000000000000000000..ed49f57fa3b7a0247eb8eef82b4b601255138d3f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/history.qbk @@ -0,0 +1,71 @@ +[/ + Copyright 2009 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:history History] + +[h4 Boost 1.64.0] + +* Added new trait __make_void. + +[h4 Boost 1.60.0] + +* Refactored traits to depend only on Boost.Config. Greatly simplified code to improve readability and remove workarounds for old compilers no longer supported. +* Fix __decay to follow C++11 semantics, see [@https://svn.boost.org/trac/boost/ticket/7760 #7760]. +* Added a number of new traits __is_assignable, __is_default_constructible, __is_constructible and __is_destructible required to fix bugs in a number of other traits, +see for example [@https://svn.boost.org/trac/boost/ticket/7760 #11324]. + +[h4 Boost 1.58.0] + +* Fixed issue with CUDA on Clang compiler see [@https://svn.boost.org/trac/boost/ticket/10694 #10694]. +* Fixed __is_nothrow_move_assignable and __is_nothrow_move_constructible to work on VC12 and later. + +[h4 Boost 1.57.0] + +* Added new traits __is_copy_assignable and __is_final. +* Misc fixes for newer versions of clang and msvc-14. + +[h4 Boost 1.56.0] + +* Fixed issues [@https://svn.boost.org/trac/boost/ticket/7317 #7317], +[@https://svn.boost.org/trac/boost/ticket/9474 #9474]. + + +[h4 Boost 1.55.0] + +* Added new trait __is_copy_constructible. + +[h4 Boost 1.54.0] + +* Added new traits __is_nothrow_move_assignable, __is_nothrow_move_constructible, __has_trivial_move_assign, +__has_trivial_move_constructor. + +[h4 Boost 1.47.0] + +* [* Breaking change]: changed __is_convertible to C++0x behaviour when possible. +* Fixed issues [@https://svn.boost.org/trac/boost/ticket/5271 #5271], +[@https://svn.boost.org/trac/boost/ticket/4530 #4530]. + + +[h4 Boost 1.45.0] + +* Added new traits __add_rvalue_reference, __add_lvalue_reference and __common_type. +* Minor fixes to __is_signed, __is_unsigned and __is_virtual_base_of. + +[h4 Boost 1.44.0] + +* Added support for rvalue references throughout the library, plus two new traits classes +__is_rvalue_reference and __is_lvalue_reference. Fixes [@https://svn.boost.org/trac/boost/ticket/4407 #4407] +and [@https://svn.boost.org/trac/boost/ticket/3804 #3804]. +* Fixed ticket [@https://svn.boost.org/trac/boost/ticket/3621 #3621]. + +[h4 Boost 1.42.0] + +* Fixed issue [@https://svn.boost.org/trac/boost/ticket/3704 #3704]. + + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/background.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/background.html new file mode 100644 index 0000000000000000000000000000000000000000..3625bd69c557d08701ac3d4d8e4a477a66179d05 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/background.html @@ -0,0 +1,691 @@ + + + +Background and Tutorial + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+
+ +

+ The following is an updated version of the article "C++ Type traits" + by John Maddock and Steve Cleary that appeared in the October 2000 issue of + Dr Dobb's Journal. +

+

+ Generic programming (writing code which works with any data type meeting a + set of requirements) has become the method of choice for providing reusable + code. However, there are times in generic programming when "generic" + just isn't good enough - sometimes the differences between types are too large + for an efficient generic implementation. This is when the traits technique + becomes important - by encapsulating those properties that need to be considered + on a type by type basis inside a traits class, we can minimize the amount of + code that has to differ from one type to another, and maximize the amount of + generic code. +

+

+ Consider an example: when working with character strings, one common operation + is to determine the length of a null terminated string. Clearly it's possible + to write generic code that can do this, but it turns out that there are much + more efficient methods available: for example, the C library functions strlen and wcslen + are usually written in assembler, and with suitable hardware support can be + considerably faster than a generic version written in C++. The authors of the + C++ standard library realized this, and abstracted the properties of char and wchar_t + into the class char_traits. + Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null + terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate + method available to them. +

+
+ + Type + Traits +
+

+ Class char_traits is a classic + example of a collection of type specific properties wrapped up in a single + class - what Nathan Myers termed a baggage class[1]. In the Boost type-traits library, + we[2] have written a set of very + specific traits classes, each of which encapsulate a single trait from the + C++ type system; for example, is a type a pointer or a reference type? Or does + a type have a trivial constructor, or a const-qualifier? The type-traits classes + share a unified design: each class inherits from the type true_type + if the type has the specified property and inherits from false_type + otherwise. As we will show, these classes can be used in generic programming + to determine the properties of a given type and introduce optimizations that + are appropriate for that case. +

+

+ The type-traits library also contains a set of classes that perform a specific + transformation on a type; for example, they can remove a top-level const or + volatile qualifier from a type. Each class that performs a transformation defines + a single typedef-member type + that is the result of the transformation. All of the type-traits classes are + defined inside namespace boost; + for brevity, namespace-qualification is omitted in most of the code samples + given. +

+
+ + Implementation +
+

+ There are far too many separate classes contained in the type-traits library + to give a full implementation here - see the source code in the Boost library + for the full details - however, most of the implementation is fairly repetitive + anyway, so here we will just give you a flavor for how some of the classes + are implemented. Beginning with possibly the simplest class in the library, + is_void<T> inherits + from true_type + only if T is void. +

+
template <typename T>
+struct is_void : public false_type{};
+
+template <>
+struct is_void<void> : public true_type{};
+
+

+ Here we define a primary version of the template class is_void, + and provide a full-specialization when T + is void. While full specialization + of a template class is an important technique, sometimes we need a solution + that is halfway between a fully generic solution, and a full specialization. + This is exactly the situation for which the standards committee defined partial + template-class specialization. As an example, consider the class boost::is_pointer<T>: + here we needed a primary version that handles all the cases where T is not + a pointer, and a partial specialization to handle all the cases where T is + a pointer: +

+
template <typename T>
+struct is_pointer : public false_type{};
+
+template <typename T>
+struct is_pointer<T*> : public true_type{};
+
+

+ The syntax for partial specialization is somewhat arcane and could easily occupy + an article in its own right; like full specialization, in order to write a + partial specialization for a class, you must first declare the primary template. + The partial specialization contains an extra <...> after the class name + that contains the partial specialization parameters; these define the types + that will bind to that partial specialization rather than the default template. + The rules for what can appear in a partial specialization are somewhat convoluted, + but as a rule of thumb if you can legally write two function overloads of the + form: +

+
void foo(T);
+void foo(U);
+
+

+ Then you can also write a partial specialization of the form: +

+
template <typename T>
+class c{ /*details*/ };
+
+template <typename T>
+class c<U>{ /*details*/ };
+
+

+ This rule is by no means foolproof, but it is reasonably simple to remember + and close enough to the actual rule to be useful for everyday use. +

+

+ As a more complex example of partial specialization consider the class remove_extent<T>. This + class defines a single typedef-member type + that is the same type as T but with any top-level array bounds removed; this + is an example of a traits class that performs a transformation on a type: +

+
template <typename T>
+struct remove_extent
+{ typedef T type; };
+
+template <typename T, std::size_t N>
+struct remove_extent<T[N]>
+{ typedef T type; };
+
+

+ The aim of remove_extent + is this: imagine a generic algorithm that is passed an array type as a template + parameter, remove_extent + provides a means of determining the underlying type of the array. For example + remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number of + template parameters in a partial specialization does not have to match the + number in the default template. However, the number of parameters that appear + after the class name do have to match the number and type of the parameters + in the default template. +

+
+ + Optimized + copy +
+

+ As an example of how the type traits classes can be used, consider the standard + library algorithm copy: +

+
template<typename Iter1, typename Iter2>
+Iter2 copy(Iter1 first, Iter1 last, Iter2 out);
+
+

+ Obviously, there's no problem writing a generic version of copy that works + for all iterator types Iter1 + and Iter2; however, there are + some circumstances when the copy operation can best be performed by a call + to memcpy. In order to implement + copy in terms of memcpy all + of the following conditions need to be met: +

+
    +
  • + Both of the iterator types Iter1 + and Iter2 must be pointers. +
  • +
  • + Both Iter1 and Iter2 must point to the same type - excluding + const and volatile-qualifiers. +
  • +
  • + The type pointed to by Iter1 + must have a trivial assignment operator. +
  • +
+

+ By trivial assignment operator we mean that the type is either a scalar type[3] or: +

+
    +
  • + The type has no user defined assignment operator. +
  • +
  • + The type does not have any data members that are references. +
  • +
  • + All base classes, and all data member objects must have trivial assignment + operators. +
  • +
+

+ If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated + assignment operator. The type-traits library provides a class has_trivial_assign, + such that has_trivial_assign<T>::value is true only if T has a trivial assignment + operator. This class "just works" for scalar types, but has to be + explicitly specialised for class/struct types that also happen to have a trivial + assignment operator. In other words if has_trivial_assign + gives the wrong answer, it will give the "safe" wrong answer - that + trivial assignment is not allowable. +

+

+ The code for an optimized version of copy that uses memcpy + where appropriate is given in the + examples. The code begins by defining a template function do_copy that performs a "slow but safe" + copy. The last parameter passed to this function may be either a true_type + or a false_type. + Following that there is an overload of do_copy that uses memcpy: + this time the iterators are required to actually be pointers to the same type, + and the final parameter must be a true_type. + Finally, the version of copy + calls do_copy, passing has_trivial_assign<value_type>() as the final parameter: this will dispatch + to the optimized version where appropriate, otherwise it will call the "slow + but safe version". +

+
+ + Was + it worth it? +
+

+ It has often been repeated in these columns that "premature optimization + is the root of all evil" [4]. + So the question must be asked: was our optimization premature? To put this + in perspective the timings for our version of copy compared a conventional + generic copy[5] are shown in table + 1. +

+

+ Clearly the optimization makes a difference in this case; but, to be fair, + the timings are loaded to exclude cache miss effects - without this accurate + comparison between algorithms becomes difficult. However, perhaps we can add + a couple of caveats to the premature optimization rule: +

+
    +
  • + If you use the right algorithm for the job in the first place then optimization + will not be required; in some cases, memcpy is the right algorithm. +
  • +
  • + If a component is going to be reused in many places by many people then + optimizations may well be worthwhile where they would not be so for a single + case - in other words, the likelihood that the optimization will be absolutely + necessary somewhere, sometime is that much higher. Just as importantly + the perceived value of the stock implementation will be higher: there is + no point standardizing an algorithm if users reject it on the grounds that + there are better, more heavily optimized versions available. +
  • +
+
+

Table 1.1. Time taken to copy 1000 elements using `copy<const T*, T*>` (times + in micro-seconds)

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Version +

+
+

+ T +

+
+

+ Time +

+
+

+ "Optimized" copy +

+
+

+ char +

+
+

+ 0.99 +

+
+

+ Conventional copy +

+
+

+ char +

+
+

+ 8.07 +

+
+

+ "Optimized" copy +

+
+

+ int +

+
+

+ 2.52 +

+
+

+ Conventional copy +

+
+

+ int +

+
+

+ 8.02 +

+
+
+
+ + Pair + of References +
+

+ The optimized copy example shows how type traits may be used to perform optimization + decisions at compile-time. Another important usage of type traits is to allow + code to compile that otherwise would not do so unless excessive partial specialization + is used. This is possible by delegating partial specialization to the type + traits classes. Our example for this form of usage is a pair that can hold + references [6]. +

+

+ First, let us examine the definition of std::pair, omitting + the comparison operators, default constructor, and template copy constructor + for simplicity: +

+
template <typename T1, typename T2>
+struct pair
+{
+typedef T1 first_type;
+typedef T2 second_type;
+
+T1 first;
+T2 second;
+
+pair(const T1 & nfirst, const T2 & nsecond)
+:first(nfirst), second(nsecond) { }
+};
+
+

+ Now, this "pair" cannot hold references as it currently stands, because + the constructor would require taking a reference to a reference, which is currently + illegal [7]. Let us consider what + the constructor's parameters would have to be in order to allow "pair" + to hold non-reference types, references, and constant references: +

+
+

Table 1.2. Required Constructor Argument Types

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Type of T1 +

+
+

+ Type of parameter to initializing constructor +

+
+

+ T +

+
+

+ const T & +

+
+

+ T & +

+
+

+ T & +

+
+

+ const T & +

+
+

+ const T & +

+
+
+

+ A little familiarity with the type traits classes allows us to construct a + single mapping that allows us to determine the type of parameter from the type + of the contained class. The type traits classes provide a transformation add_reference, which + adds a reference to its type, unless it is already a reference. +

+
+

Table 1.3. Using add_reference to synthesize the correct constructor type

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Type of T1 +

+
+

+ Type of const T1 +

+
+

+ Type of add_reference<const + T1>::type +

+
+

+ T +

+
+

+ const T +

+
+

+ const T & +

+
+

+ T & +

+
+

+ T & [8] +

+
+

+ T & +

+
+

+ const T & +

+
+

+ const T & +

+
+

+ const T & +

+
+
+

+ This allows us to build a primary template definition for pair + that can contain non-reference types, reference types, and constant reference + types: +

+
template <typename T1, typename T2>
+struct pair
+{
+typedef T1 first_type;
+typedef T2 second_type;
+
+T1 first;
+T2 second;
+
+pair(boost::add_reference<const T1>::type nfirst,
+      boost::add_reference<const T2>::type nsecond)
+:first(nfirst), second(nsecond) { }
+};
+
+

+ Add back in the standard comparison operators, default constructor, and template + copy constructor (which are all the same), and you have a std::pair that + can hold reference types! +

+

+ This same extension could have been done using partial template specialization + of pair, but to specialize + pair in this way would require + three partial specializations, plus the primary template. Type traits allows + us to define a single primary template that adjusts itself auto-magically to + any of these partial specializations, instead of a brute-force partial specialization + approach. Using type traits in this fashion allows programmers to delegate + partial specialization to the type traits classes, resulting in code that is + easier to maintain and easier to understand. +

+
+ + Conclusion +
+

+ We hope that in this article we have been able to give you some idea of what + type-traits are all about. A more complete listing of the available classes + are in the boost documentation, along with further examples using type traits. + Templates have enabled C++ uses to take the advantage of the code reuse that + generic programming brings; hopefully this article has shown that generic programming + does not have to sink to the lowest common denominator, and that templates + can be optimal as well as generic. +

+
+ + Acknowledgements +
+

+ The authors would like to thank Beman Dawes and Howard Hinnant for their helpful + comments when preparing this article. +

+
+ + References +
+
    +
  1. + Nathan C. Myers, C++ Report, June 1995. +
  2. +
  3. + The type traits library is based upon contributions by Steve Cleary, Beman + Dawes, Howard Hinnant and John Maddock: it can be found at www.boost.org. +
  4. +
  5. + A scalar type is an arithmetic type (i.e. a built-in integer or floating + point type), an enumeration type, a pointer, a pointer to member, or a + const- or volatile-qualified version of one of these types. +
  6. +
  7. + This quote is from Donald Knuth, ACM Computing Surveys, December 1974, + pg 268. +
  8. +
  9. + The test code is available as part of the boost utility library (see algo_opt_examples.cpp), + the code was compiled with gcc 2.95 with all optimisations turned on, tests + were conducted on a 400MHz Pentium II machine running Microsoft Windows + 98. +
  10. +
  11. + John Maddock and Howard Hinnant have submitted a "compressed_pair" + library to Boost, which uses a technique similar to the one described here + to hold references. Their pair also uses type traits to determine if any + of the types are empty, and will derive instead of contain to conserve + space -- hence the name "compressed". +
  12. +
  13. + This is actually an issue with the C++ Core Language Working Group (issue + #106), submitted by Bjarne Stroustrup. The tentative resolution is to allow + a "reference to a reference to T" to mean the same thing as a + "reference to T", but only in template instantiation, in a method + similar to multiple cv-qualifiers. +
  14. +
  15. + For those of you who are wondering why this shouldn't be const-qualified, + remember that references are always implicitly constant (for example, you + can't re-assign a reference). Remember also that "const T &" + is something completely different. For this reason, cv-qualifiers on template + type arguments that are references are ignored. +
  16. +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category.html new file mode 100644 index 0000000000000000000000000000000000000000..8d0acadfc3e572ef0bf8fea5a93290df1b23ebfd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category.html @@ -0,0 +1,67 @@ + + + +Type Traits by Category + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/alignment.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/alignment.html new file mode 100644 index 0000000000000000000000000000000000000000..8573d5f9315c8ba9faf49076d3b088e65ae4ef03 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/alignment.html @@ -0,0 +1,63 @@ + + + +Synthesizing Types with Specific Alignments + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Some low level memory management routines need to synthesize a POD type with + specific alignment properties. The template type_with_alignment + finds the smallest type with a specified alignment, while template aligned_storage + creates a type with a specific size and alignment. +

+

+ Synopsis +

+
template <std::size_t Align>
+struct type_with_alignment;
+
+template <std::size_t Size, std::size_t Align>
+struct aligned_storage;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/function.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/function.html new file mode 100644 index 0000000000000000000000000000000000000000..062f61e8eb7b34a29765dcaf200d3818ba64c816 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/function.html @@ -0,0 +1,60 @@ + + + +Decomposing Function Types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The class template function_traits + extracts information from function types (see also is_function). + This traits class allows you to tell how many arguments a function takes, + what those argument types are, and what the return type is. +

+

+ Synopsis +

+
template <std::size_t Align>
+struct function_traits;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/transform.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/transform.html new file mode 100644 index 0000000000000000000000000000000000000000..93489ca7d61cd7632ba13fea9c8ecdebb1c17fcc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/transform.html @@ -0,0 +1,129 @@ + + + +Type Traits that Transform One Type to Another + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The following templates transform one type to another, based upon some well-defined + rule. Each template has a single member called type + that is the result of applying the transformation to the template argument + T. +

+

+ Synopsis: +

+
template <class T>
+struct add_const;
+
+template <class T>
+struct add_cv;
+
+template <class T>
+struct add_lvalue_reference;
+
+template <class T>
+struct add_pointer;
+
+template <class T>
+struct add_reference;
+
+template <class T>
+struct add_rvalue_reference;
+
+template <class T>
+struct add_volatile;
+
+template <bool B, class T, class U>
+struct conditional;
+
+template <class... T>
+struct common_type;
+
+template <class T, class U>
+struct copy_cv;
+
+template <class T>
+struct decay;
+
+template <class T>
+struct floating_point_promotion;
+
+template <class T>
+struct integral_promotion;
+
+template <class T>
+struct make_signed;
+
+template <class T>
+struct make_unsigned;
+
+template <class T>
+struct promote;
+
+template <class T>
+struct remove_all_extents;
+
+template <class T>
+struct remove_const;
+
+template <class T>
+struct remove_cv;
+
+template <class T>
+struct remove_extent;
+
+template <class T>
+struct remove_pointer;
+
+template <class T>
+struct remove_reference;
+
+template <class T>
+struct remove_volatile;
+
+template <class T>
+struct type_identity;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits.html new file mode 100644 index 0000000000000000000000000000000000000000..92ce93b36eb948d16817b507879e916bf5738d89 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits.html @@ -0,0 +1,68 @@ + + + +Type Traits that Describe the Properties of a Type + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ These traits are all value traits, which is to say the + traits classes all inherit from integral_constant, + and are used to access some numerical property of a type. Often this is a + simple true or false Boolean value, but in a few cases may be some other + integer value (for example when dealing with type alignments, or array bounds: + see alignment_of, + rank + and extent). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html new file mode 100644 index 0000000000000000000000000000000000000000..0b329e8d0423c0c5ada961635c79d1d09a04d134 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/operators.html @@ -0,0 +1,1441 @@ + + + +Operator Type Traits + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Introduction +
+

+ These traits are all value traits inheriting from + integral_constant + and providing a simple true + or false boolean value which reflects the fact that given + types can or cannot be used with given operators. +

+

+ For example, has_plus<int, double>::value + is a bool which value is + true because it is possible + to add a double to an int like in the following code: +

+
int i;
+double d;
+i+d;
+
+

+ It is also possible to know if the result of the operator can be used as + function argument of a given type. For example, has_plus<int, double, float>::value + is true because it is possible + to add a double to an int and the result (double) + can be converted to a float + argument like in the following code: +

+
void f(float) { };
+int i;
+double d;
+f(i+d);
+
+

+

+
+ + Example + of application +
+

+ These traits can be useful to optimize the code for types supporting given + operations. For example a function std::advance + that increases an iterator of a given number of steps could be implemented + as follows: +

+

+

+
#include <boost/type_traits/has_plus_assign.hpp>
+
+namespace detail {
+template < class Iterator, class Distance, bool has_plus_assign >
+struct advance_impl;
+
+// this is used if += exists (efficient)
+template < class Iterator, class Distance >
+struct advance_impl<Iterator, Distance, true> {
+   void operator()(Iterator &i, Distance n) {
+      i+=n;
+   }
+};
+
+// this is use if += does not exists (less efficient but cannot do better)
+template < class Iterator, class Distance >
+struct advance_impl<Iterator, Distance, false> {
+   void operator()(Iterator &i, Distance n) {
+      if (n>0) {
+         while (n--) ++i;
+      } else {
+         while (n++) --i;
+      }
+   }
+};
+} // namespace detail
+
+template < class Iterator, class Distance >
+inline void advance(Iterator &i, Distance n) {
+   detail::advance_impl< Iterator, Distance, ::boost::has_plus_assign<Iterator>::value >()(i, n);
+}
+
+

+

+

+ Then the compiler chooses the most efficient implementation according to + the type's ability to perform += + operation: +

+

+

+
#include <iostream>
+
+class with {
+      int m_i;
+   public:
+      with(int i=0) : m_i(i) { }
+      with &operator+=(int rhs) { m_i+=rhs; return *this; }
+      operator int const () { return m_i; }
+};
+
+class without {
+      int m_i;
+   public:
+      without(int i=0) : m_i(i) { }
+      without &operator++() { ++m_i; return *this; }
+      without &operator--() { --m_i; return *this; }
+      operator int const () { return m_i; }
+};
+
+int main() {
+   with i=0;
+   advance(i, 10); // uses +=
+   std::cout<<"with: "<<i<<'\n';
+   without j=0;
+   advance(j, 10); // uses ++
+   std::cout<<"without: "<<j<<'\n';
+   return 0;
+}
+
+

+

+
+ + Description +
+

+ The syntax is the following: +

+
template < class Rhs, class Ret=dont_care > has_op; // prefix operator
+template < class Lhs, class Ret=dont_care > has_op; // postfix operator
+template < class Lhs, class Rhs=Lhs, class Ret=dont_care > has_op; // binary operator
+
+

+ where: +

+
    +
  • + op represents the operator name +
  • +
  • + Lhs is the type used + at the left hand side of operator + op, +
  • +
  • + Rhs is the type used + at the right hand side of operator + op, +
  • +
  • + Ret is the type for + which we want to know if the result of operator + op can be converted to. +
  • +
+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of the operator. If Ret is different from the default dont_care, the return value is checked + to be convertible to Ret. + Convertible to Ret means + that the return value can be used as argument to a function expecting + Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs+rhs); // is valid if has_plus<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ The following tables give the list of supported binary, prefix and postfix + operators. +

+
+

Table 1.4. Supported prefix operators

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ prefix operator +

+
+

+ trait name +

+
+

+ ! +

+
+

+ has_logical_not < class + Rhs, + class Ret=dont_care + > +

+
+

+ + +

+
+

+ has_unary_plus +

+
+

+ - +

+
+

+ has_unary_minus and + has_negate +

+
+

+ ~ +

+
+

+ has_complement +

+
+

+ * +

+
+

+ has_dereference +

+
+

+ ++ +

+
+

+ has_pre_increment +

+
+

+ -- +

+
+

+ has_pre_decrement +

+
+
+
+

Table 1.5. Supported postfix operators

+
++++ + + + + + + + + + + + + + + +
+

+ postfix operator +

+
+

+ trait name +

+
+

+ ++ +

+
+

+ has_post_increment + < class + Lhs, + class Ret=dont_care + > +

+
+

+ -- +

+
+

+ has_post_decrement +

+
+
+
+

Table 1.6. Supported binary operators

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ binary operator +

+
+

+ trait name +

+
+

+ + +

+
+

+ has_plus < class + Lhs, + class Rhs=Lhs, class + Ret=dont_care > +

+
+

+ - +

+
+

+ has_minus +

+
+

+ * +

+
+

+ has_multiplies +

+
+

+ / +

+
+

+ has_divides +

+
+

+ % +

+
+

+ has_modulus +

+
+

+ += +

+
+

+ has_plus_assign +

+
+

+ -= +

+
+

+ has_minus_assign +

+
+

+ *= +

+
+

+ has_multiplies_assign +

+
+

+ /= +

+
+

+ has_divides_assign +

+
+

+ %= +

+
+

+ has_modulus_assign +

+
+

+ & +

+
+

+ has_bit_and +

+
+

+ | +

+
+

+ has_bit_or +

+
+

+ ^ +

+
+

+ has_bit_xor +

+
+

+ &= +

+
+

+ has_bit_and_assign +

+
+

+ |= +

+
+

+ has_bit_or_assign +

+
+

+ ^= +

+
+

+ has_bit_xor_assign +

+
+

+ << +

+
+

+ has_left_shift +

+
+

+ >> +

+
+

+ has_right_shift +

+
+

+ <<= +

+
+

+ has_left_shift_assign +

+
+

+ >>= +

+
+

+ has_right_shift_assign +

+
+

+ == +

+
+

+ has_equal_to +

+
+

+ != +

+
+

+ has_not_equal_to +

+
+

+ < +

+
+

+ has_less +

+
+

+ <= +

+
+

+ has_less_equal +

+
+

+ > +

+
+

+ has_greater +

+
+

+ >= +

+
+

+ has_greater_equal +

+
+

+ && +

+
+

+ has_logical_and +

+
+

+ || +

+
+

+ has_logical_or +

+
+
+

+ The following operators are not supported because they could not be implemented + using the same technique: operator=, operator->, operator&, operator[], operator,, operator(), operator + new. +

+
+ + cv + qualifiers and references +
+

+ A reference sign & in + the operator argument is ignored so that has_plus< int&, double& >::value==has_plus< + int, double >::value. This has been chosen because if + the following code works (does not work): +

+
int i;
+double d;
+i+d;
+
+

+ the following code also works (does not work): +

+
int &ir=i;
+double &dr=d;
+ir+dr;
+
+

+

+

+ It was not possible to handle properly the volatile + qualifier so that any construct using this qualifier has undefined behavior. +

+

+ As a help, the following tables give the necessary conditions over each + trait template argument for the trait value + to be true. They are non sufficient + conditions because the conditions must be true + for all arguments and return type for value + to be true. +

+
+

Table 1.7. necessary and non sufficient condition on operator argument for + value to be true

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ operator declaration +

+
+

+ has_op< + void > +

+
+

+ has_op< + Arg > + and has_op< + Arg& + > +

+
+

+ has_op< + Arg const + > and has_op< + Arg const& > +

+
+

+ operator@(Arg) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+

+ operator@(Arg + const) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+

+ operator@(Arg + &) +

+
+

+ false +

+
+

+ true +

+
+

+ false +

+
+

+ operator@(Arg + const &) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+
+
+

Table 1.8. necessary and non sufficient condition on operator return type for + value to be true

+
++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ operator declaration +

+
+

+ has_op< + ..., void + > +

+
+

+ has_op< + ..., Ret + > +

+
+

+ has_op< + ..., Ret + const > +

+
+

+ has_op< + ..., Ret + & > +

+
+

+ has_op< + ..., Ret + const & + > +

+
+

+ void operator@(...) +

+
+

+ true +

+
+

+ false +

+
+

+ false +

+
+

+ false +

+
+

+ false +

+
+

+ Ret operator@(...) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+

+ false +

+
+

+ true +

+
+

+ Ret const + operator@(...) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+

+ false +

+
+

+ true +

+
+

+ Ret & + operator@(...) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+

+ true +

+
+

+ true +

+
+

+ Ret const + & operator@(...) +

+
+

+ false +

+
+

+ true +

+
+

+ true +

+
+

+ false +

+
+

+ true +

+
+
+
+ + Implementation +
+

+ The implementation consists in only header files. The following headers + should included first: +

+
#include <boost/type_traits/has_operator.hpp>
+

+ or +

+
#include <boost/type_traits/has_op.hpp>
+

+ where op is the textual name chosen for the wanted operator. + The first method includes all operator traits. +

+

+ All traits are implemented the same way using preprocessor macros to avoid + code duplication. The main files are in boost/type_traits/detail: + has_binary_operator.hpp, has_prefix_operator.hpp + and has_postfix_operator.hpp. The example of prefix + operator- + is presented below: +

+

+

+
namespace boost {
+namespace detail {
+
+// This namespace ensures that argument-dependent name lookup does not mess things up.
+namespace has_unary_minus_impl {
+
+// 1. a function to have an instance of type T without requiring T to be default
+// constructible
+template <typename T> T &make();
+
+
+// 2. we provide our operator definition for types that do not have one already
+
+// a type returned from operator- when no such operator is
+// found in the type's own namespace (our own operator is used) so that we have
+// a means to know that our operator was used
+struct no_operator { };
+
+// this class allows implicit conversions and makes the following operator
+// definition less-preferred than any other such operators that might be found
+// via argument-dependent name lookup
+struct any { template <class T> any(T const&); };
+
+// when operator- is not available, this one is used
+no_operator operator-(const any&);
+
+
+// 3. checks if the operator returns void or not
+// conditions: Rhs!=void
+
+// we first redefine "operator," so that we have no compilation error if
+// operator- returns void and we can use the return type of
+// (-rhs, returns_void_t()) to deduce if operator- returns void or not:
+// - operator- returns void   -> (-rhs, returns_void_t()) returns returns_void_t
+// - operator- returns !=void -> (-rhs, returns_void_t()) returns int
+struct returns_void_t { };
+template <typename T> int operator,(const T&, returns_void_t);
+template <typename T> int operator,(const volatile T&, returns_void_t);
+
+// this intermediate trait has member value of type bool:
+// - value==true  -> operator- returns void
+// - value==false -> operator- does not return void
+template < typename Rhs >
+struct operator_returns_void {
+   // overloads of function returns_void make the difference
+   // yes_type and no_type have different size by construction
+   static ::boost::type_traits::yes_type returns_void(returns_void_t);
+   static ::boost::type_traits::no_type returns_void(int);
+   static const bool value = sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((-make<Rhs>(),returns_void_t())));
+};
+
+
+// 4. checks if the return type is Ret or Ret==dont_care
+// conditions: Rhs!=void
+
+struct dont_care { };
+
+template < typename Rhs, typename Ret, bool Returns_void >
+struct operator_returns_Ret;
+
+template < typename Rhs >
+struct operator_returns_Ret < Rhs, dont_care, true > {
+   static const bool value = true;
+};
+
+template < typename Rhs >
+struct operator_returns_Ret < Rhs, dont_care, false > {
+   static const bool value = true;
+};
+
+template < typename Rhs >
+struct operator_returns_Ret < Rhs, void, true > {
+   static const bool value = true;
+};
+
+template < typename Rhs >
+struct operator_returns_Ret < Rhs, void, false > {
+   static const bool value = false;
+};
+
+template < typename Rhs, typename Ret >
+struct operator_returns_Ret < Rhs, Ret, true > {
+   static const bool value = false;
+};
+
+// otherwise checks if it is convertible to Ret using the sizeof trick
+// based on overload resolution
+// condition: Ret!=void and Ret!=dont_care and the operator does not return void
+template < typename Rhs, typename Ret >
+struct operator_returns_Ret < Rhs, Ret, false > {
+   static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret
+   static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise
+
+   static const bool value = sizeof(is_convertible_to_Ret(-make<Rhs>()))==sizeof(::boost::type_traits::yes_type);
+};
+
+
+// 5. checks for operator existence
+// condition: Rhs!=void
+
+// checks if our definition of operator- is used or an other
+// existing one;
+// this is done with redefinition of "operator," that returns no_operator or has_operator
+struct has_operator { };
+no_operator operator,(no_operator, has_operator);
+
+template < typename Rhs >
+struct operator_exists {
+   static ::boost::type_traits::yes_type check(has_operator); // this version is preferred when operator exists
+   static ::boost::type_traits::no_type check(no_operator); // this version is used otherwise
+
+   static const bool value = sizeof(check(((-make<Rhs>()),make<has_operator>())))==sizeof(::boost::type_traits::yes_type);
+};
+
+
+// 6. main trait: to avoid any compilation error, this class behaves
+// differently when operator-(Rhs) is forbidden by the standard.
+// Forbidden_if is a bool that is:
+// - true when the operator-(Rhs) is forbidden by the standard
+//   (would yield compilation error if used)
+// - false otherwise
+template < typename Rhs, typename Ret, bool Forbidden_if >
+struct trait_impl1;
+
+template < typename Rhs, typename Ret >
+struct trait_impl1 < Rhs, Ret, true > {
+   static const bool value = false;
+};
+
+template < typename Rhs, typename Ret >
+struct trait_impl1 < Rhs, Ret, false > {
+   static const bool value =
+      ::boost::type_traits::ice_and<
+         operator_exists < Rhs >::value,
+         operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value
+      >::value
+   ;
+};
+
+// specialization needs to be declared for the special void case
+template < typename Ret >
+struct trait_impl1 < void, Ret, false > {
+   static const bool value = false;
+};
+
+// defines some typedef for convenience
+template < typename Rhs, typename Ret >
+struct trait_impl {
+   typedef typename ::boost::remove_reference<Rhs>::type Rhs_noref;
+   typedef typename ::boost::remove_cv<Rhs_noref>::type Rhs_nocv;
+   typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer<Rhs_noref>::type >::type >::type Rhs_noptr;
+   static const bool value = trait_impl1 < Rhs_noref, Ret, ::boost::is_pointer< Rhs_noref >::value >::value;
+};
+
+} // namespace impl
+} // namespace detail
+
+// this is the accessible definition of the trait to end user
+template < typename Rhs, typename Ret=::boost::detail::has_unary_minus_impl::dont_care >
+struct has_unary_minus : ::boost::integral_constant<bool,(::boost::detail::has_unary_minus_impl::trait_impl < Rhs, Ret >::value)> { };
+
+} // namespace boost
+
+

+

+
+ + Limitation +
+
  • + Requires a compiler with working SFINAE. +
+
+ + Known + issues +
+
    +
  • + These traits cannot detect whether the operators are public or not: + if an operator is defined as a private member of type T then the instantiation of the corresponding + trait will produce a compiler error. For this reason these traits cannot + be used to determine whether a type has a public operator or not. +
    struct A { private: A operator-(); };
    +boost::has_unary_minus<A>::value; // error: A::operator-() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload because + both the existing operator and the one we provide (with argument of + type any) need type + conversion, so that none is preferred. +
    struct A { };
    +void operator-(const A&);
    +struct B { operator A(); };
    +boost::has_unary_minus<A>::value; // this is fine
    +boost::has_unary_minus<B>::value; // error: ambiguous overload between
    +                                  // operator-(const any&) and
    +                                  // operator-(const A&)
    +                                  // both need type conversion
    +
    +
    struct B { };
    +struct A { A(const B&) { } };
    +void operator-(const A&);
    +boost::has_unary_minus<A>::value; // this is fine
    +boost::has_unary_minus<B>::value; // error: ambiguous overload between
    +                                  // operator-(const any&) and
    +                                  // operator-(const A&)
    +                                  // both need type conversion
    +
    +
  • +
  • + There is an issue when applying these traits to template classes. If + the operator is defined but does not bind for a given template type, + it is still detected by the trait which returns true + instead of false. This + applies in particular to the containers of the standard library and + operator==. + Example: +
    #include <boost/type_traits/has_equal_to.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator==(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_equal_to< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g==g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_equal_to< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b==b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is + not properly handled and would lead to undefined behavior +
  • +
+
+ + Acknowledgments +
+

+ Frederic Bron is very thankful to numerous people from the boost mailing + list for their kind help and patience. In particular, the following persons + have been very helpful for the implementation: Edward Diener, Eric Niebler, + Jeffrey Lee Hellrung (Jr.), Robert Stewart, Roman Perepelitsa, Steven Watanabe, + Vicente Botet. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/primary.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/primary.html new file mode 100644 index 0000000000000000000000000000000000000000..e31df42ca8380106f3dd1b69cc8c7f04d16d92e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/primary.html @@ -0,0 +1,137 @@ + + + +Categorizing a Type + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ These traits identify what "kind" of type some type T is. These are split into two groups: + primary traits which are all mutually exclusive, and composite traits that + are compositions of one or more primary traits. +

+

+ For any given type, exactly one primary type trait will inherit from true_type, + and all the others will inherit from false_type, + in other words these traits are mutually exclusive. +

+

+ This means that is_integral<T>::value + and is_floating_point<T>::value + will only ever be true for built-in types; if you want to check for a user-defined + class type that behaves "as if" it is an integral or floating + point type, then use the std::numeric_limits + template instead. +

+

+ Synopsis: +

+
template <class T>
+struct is_array;
+
+template <class T>
+struct is_class;
+
+template <class T>
+struct is_complex;
+
+template <class T>
+struct is_enum;
+
+template <class T>
+struct is_floating_point;
+
+template <class T>
+struct is_function;
+
+template <class T>
+struct is_integral;
+
+template <class T>
+struct is_member_function_pointer;
+
+template <class T>
+struct is_member_object_pointer;
+
+template <class T>
+struct is_pointer;
+
+template <class T>
+struct is_lvalue_reference;
+
+template <class T>
+struct is_rvalue_reference;
+
+template <class T>
+struct is_union;
+
+template <class T>
+struct is_void;
+
+

+ The following traits are made up of the union of one or more type categorizations. + A type may belong to more than one of these categories, in addition to + one of the primary categories. +

+
template <class T>
+struct is_arithmetic;
+
+template <class T>
+struct is_compound;
+
+template <class T>
+struct is_fundamental;
+
+template <class T>
+struct is_member_pointer;
+
+template <class T>
+struct is_object;
+
+template <class T>
+struct is_reference;
+
+template <class T>
+struct is_scalar;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/properties.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/properties.html new file mode 100644 index 0000000000000000000000000000000000000000..09ab51c00a8cc5d526bd722097d4240635093b02 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/properties.html @@ -0,0 +1,153 @@ + + + +General Type Properties + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The following templates describe the general properties of a type. +

+

+ Synopsis: +

+
template <class T>
+struct alignment_of;
+
+template <class T>
+struct has_new_operator;
+
+template <class T>
+struct has_nothrow_assign;
+
+template <class T>
+struct has_nothrow_constructor;
+
+template <class T>
+struct has_nothrow_default_constructor;
+
+template <class T>
+struct has_nothrow_copy;
+
+template <class T>
+struct has_nothrow_copy_constructor;
+
+template <class T>
+struct has_nothrow_destructor;
+
+template <class T>
+struct has_trivial_assign;
+
+template <class T>
+struct has_trivial_constructor;
+
+template <class T>
+struct has_trivial_default_constructor;
+
+template <class T>
+struct has_trivial_copy;
+
+template <class T>
+struct has_trivial_copy_constructor;
+
+template <class T>
+struct has_trivial_destructor;
+
+template <class T>
+struct has_virtual_destructor;
+
+template <class T>
+struct is_abstract;
+
+template <class T, class U>
+struct is_assignable;
+
+template <class T>
+struct is_copy_constructible;
+
+template <class T>
+struct is_copy_assignable;
+
+template <class T, class... Args>
+struct is_constructible;
+
+template <class T>
+struct is_default_constructible;
+
+template <class T>
+struct is_destructible;
+
+template <class T>
+struct is_const;
+
+template <class T>
+struct is_empty;
+
+template <class T>
+struct is_final;
+
+template <class T>
+struct is_stateless;
+
+template <class T>
+struct is_pod;
+
+template <class T>
+struct is_polymorphic;
+
+template <class T>
+struct is_signed;
+
+template <class T>
+struct is_unsigned;
+
+template <class T>
+struct is_volatile;
+
+template <class T, std::size_t N = 0>
+struct extent;
+
+template <class T>
+struct rank;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/relate.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/relate.html new file mode 100644 index 0000000000000000000000000000000000000000..f9b1d67168d4a199f72e605b51511f4c26c3179c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/category/value_traits/relate.html @@ -0,0 +1,67 @@ + + + +Relationships Between Two Types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ These templates determine the whether there is a relationship between two + types: +

+

+ Synopsis: +

+
template <class Base, class Derived>
+struct is_base_of;
+
+template <class Base, class Derived>
+struct is_virtual_base_of;
+
+template <class From, class To>
+struct is_convertible;
+
+template <class T, class U>
+struct is_same;
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/credits.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/credits.html new file mode 100644 index 0000000000000000000000000000000000000000..e3ffa9bc7f7affc081285f574baf52bd3d720e0b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/credits.html @@ -0,0 +1,80 @@ + + + +Credits + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This documentation was pulled together by John Maddock, using Boost.Quickbook + and Boost.DocBook. +

+

+ The original version of this library was created by Steve Cleary, Beman Dawes, + Howard Hinnant, and John Maddock. John Maddock is the current maintainer of + the library. +

+

+ This version of type traits library is based on contributions by Adobe Systems + Inc, David Abrahams, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, + Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Thorsten Ottosen, Robert + Ramey, Jeremy Siek and Antony Polukhin. +

+

+ Mat Marcus and Jesse Jones invented, and published + a paper describing, the partial specialization workarounds used in + this library. +

+

+ Aleksey Gurtovoy added MPL integration to the library. +

+

+ The is_convertible + template is based on code originally devised by Andrei Alexandrescu, see "Generic<Programming>: + Mappings between Types and Values". +

+

+ The latest version of this library and documentation can be found at www.boost.org. Bugs, suggestions and discussion + should be directed to boost@lists.boost.org (see www.boost.org/more/mailing_lists.htm#main + for subscription details). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples.html new file mode 100644 index 0000000000000000000000000000000000000000..ea799f4eb2bb101c7f898a9be74fae304538a896 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples.html @@ -0,0 +1,61 @@ + + + +Examples + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/copy.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/copy.html new file mode 100644 index 0000000000000000000000000000000000000000..eb399855c88c88bd34f75d2201634aa80534ba96 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/copy.html @@ -0,0 +1,96 @@ + + + +An Optimized Version of std::copy + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a version of std::copy + that uses has_trivial_assign + to determine whether to use memcpy + to optimise the copy operation (see copy_example.cpp): +

+
//
+// opt::copy
+// same semantics as std::copy
+// calls memcpy where appropriate.
+//
+
+namespace detail{
+
+template<typename I1, typename I2, bool b>
+I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant<bool, b>&)
+{
+   while(first != last)
+   {
+      *out = *first;
+      ++out;
+      ++first;
+   }
+   return out;
+}
+
+template<typename T>
+T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&)
+{
+   memmove(out, first, (last-first)*sizeof(T));
+   return out+(last-first);
+}
+
+
+}
+
+template<typename I1, typename I2>
+inline I2 copy(I1 first, I1 last, I2 out)
+{
+   //
+   // We can copy with memcpy if T has a trivial assignment operator,
+   // and if the iterator arguments are actually pointers (this last
+   // requirement we detect with overload resolution):
+   //
+   typedef typename std::iterator_traits<I1>::value_type value_type;
+   return detail::copy_imp(first, last, out, boost::has_trivial_assign<value_type>());
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/destruct.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/destruct.html new file mode 100644 index 0000000000000000000000000000000000000000..94f34d0a812b8fe280f04e93988eb1788b84e2c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/destruct.html @@ -0,0 +1,83 @@ + + + +An Example that Omits Destructor Calls For Types with Trivial Destructors + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a simple algorithm that uses __has_trivial_destruct + to determine whether to destructors need to be called (see trivial_destructor_example.cpp): +

+
//
+// algorithm destroy_array:
+// The reverse of std::unitialized_copy, takes a block of
+// initialized memory and calls destructors on all objects therein.
+//
+
+namespace detail{
+
+template <class T>
+void do_destroy_array(T* first, T* last, const boost::false_type&)
+{
+   while(first != last)
+   {
+      first->~T();
+      ++first;
+   }
+}
+
+template <class T>
+inline void do_destroy_array(T* first, T* last, const boost::true_type&)
+{
+}
+
+} // namespace detail
+
+template <class T>
+inline void destroy_array(T* p1, T* p2)
+{
+   detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor<T>());
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/fill.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/fill.html new file mode 100644 index 0000000000000000000000000000000000000000..d46895b2b13457dc5727aa3b8016f2ea6902e6c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/fill.html @@ -0,0 +1,90 @@ + + + +An Optimised Version of std::fill + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a version of std::fill + that uses has_trivial_assign + to determine whether to use memset + to optimise the fill operation (see fill_example.cpp): +

+
//
+// fill
+// same as std::fill, but uses memset where appropriate
+//
+namespace detail{
+
+template <typename I, typename T, bool b>
+void do_fill(I first, I last, const T& val, const boost::integral_constant<bool, b>&)
+{
+   while(first != last)
+   {
+      *first = val;
+      ++first;
+   }
+}
+
+template <typename T>
+void do_fill(T* first, T* last, const T& val, const boost::true_type&)
+{
+   std::memset(first, val, last-first);
+}
+
+}
+
+template <class I, class T>
+inline void fill(I first, I last, const T& val)
+{
+   //
+   // We can do an optimised fill if T has a trivial assignment 
+   // operator and if it's size is one:
+   //
+   typedef boost::integral_constant<bool,
+      ::boost::has_trivial_assign<T>::value && (sizeof(T) == 1)> truth_type;
+   detail::do_fill(first, last, val, truth_type());
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/improved_min.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/improved_min.html new file mode 100644 index 0000000000000000000000000000000000000000..11a5b5691d55cf46c9624732426f38a2eeb1fdf6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/improved_min.html @@ -0,0 +1,65 @@ + + + +Improving std::min with common_type + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ An improved std::min function could be written like this: +

+
template <class T, class U>
+typename common_type<T, U>::type min(T t, U u)
+{
+   return t < u ? t : u;
+}
+
+

+ And now expressions such as: +

+
min(1, 2.0)
+
+

+ will actually compile and return the correct type! +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/iter.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/iter.html new file mode 100644 index 0000000000000000000000000000000000000000..0306d7a1fe940f3fe6122d378e4a1e9fdb1d3344 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/iter.html @@ -0,0 +1,99 @@ + + + +An improved Version of std::iter_swap + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a version of std::iter_swap + that use type traits to determine whether an it's arguments are proxy iterators + or not, if they're not then it just does a std::swap + of it's dereferenced arguments (the same as std::iter_swap + does), however if they are proxy iterators then takes special care over the + swap to ensure that the algorithm works correctly for both proxy iterators, + and even iterators of different types (see iter_swap_example.cpp): +

+
//
+// iter_swap:
+// tests whether iterator is a proxy iterator or not, and
+// uses optimal form accordingly:
+//
+namespace detail{
+
+template <typename I>
+static void do_swap(I one, I two, const boost::false_type&)
+{
+   typedef typename std::iterator_traits<I>::value_type v_t;
+   v_t v = *one;
+   *one = *two;
+   *two = v;
+}
+template <typename I>
+static void do_swap(I one, I two, const boost::true_type&)
+{
+   using std::swap;
+   swap(*one, *two);
+}
+
+}
+
+template <typename I1, typename I2>
+inline void iter_swap(I1 one, I2 two)
+{
+   //
+   // See is both arguments are non-proxying iterators, 
+   // and if both iterator the same type:
+   //
+   typedef typename std::iterator_traits<I1>::reference r1_t;
+   typedef typename std::iterator_traits<I2>::reference r2_t;
+
+   typedef boost::integral_constant<bool,
+      ::boost::is_reference<r1_t>::value
+      && ::boost::is_reference<r2_t>::value
+      && ::boost::is_same<r1_t, r2_t>::value> truth_type;
+
+   detail::do_swap(one, two, truth_type());
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/to_double.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/to_double.html new file mode 100644 index 0000000000000000000000000000000000000000..268c89536695c04e7d19e23398baee92bcd53fb1 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/examples/to_double.html @@ -0,0 +1,59 @@ + + + +Convert Numeric Types and Enums to double + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a conversion of Numeric + Types and enum types to double: +

+
template<class T>
+inline double to_double(T const& value)
+{
+    typedef typename boost::promote<T>::type promoted;
+    return boost::numeric::converter<double,promoted>::convert(value);
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/history.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/history.html new file mode 100644 index 0000000000000000000000000000000000000000..3dcf2fb204e89d35623029f64f09b55e217909b4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/history.html @@ -0,0 +1,192 @@ + + + +History + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Boost + 1.64.0 +
+
+
+ + Boost + 1.60.0 +
+
    +
  • + Refactored traits to depend only on Boost.Config. Greatly simplified code + to improve readability and remove workarounds for old compilers no longer + supported. +
  • +
  • + Fix decay to follow + C++11 semantics, see #7760. +
  • +
  • + Added a number of new traits is_assignable, + is_default_constructible, + is_constructible + and is_destructible + required to fix bugs in a number of other traits, see for example #11324. +
  • +
+
+ + Boost + 1.58.0 +
+
+
+ + Boost + 1.57.0 +
+
+
+ + Boost + 1.56.0 +
+
+
+ + Boost + 1.55.0 +
+
+
+ + Boost + 1.54.0 +
+ +
+ + Boost + 1.47.0 +
+
+
+ + Boost + 1.45.0 +
+
+
+ + Boost + 1.44.0 +
+
+
+ + Boost + 1.42.0 +
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/intrinsics.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/intrinsics.html new file mode 100644 index 0000000000000000000000000000000000000000..c1081987d40d8930394ff89b0ef09b943f8b04b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/intrinsics.html @@ -0,0 +1,438 @@ + + + +Support for Compiler Intrinsics + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ There are some traits that can not be implemented within the current C++ language: + to make these traits "just work" with user defined types, some kind + of additional help from the compiler is required. Currently (April 2008) Visual + C++ 8 and 9, GNU GCC 4.3 and MWCW 9 provide at least some of the the necessary + intrinsics, and other compilers will no doubt follow in due course. +

+

+ The Following traits classes always need compiler support to do the right thing + for all types (but all have safe fallback positions if this support is unavailable): +

+ +

+ The following traits classes can't be portably implemented in the C++ language, + although in practice, the implementations do in fact do the right thing on + all the compilers we know about: +

+ +

+ The following traits classes are dependent on one or more of the above: +

+
+

+ The hooks for compiler-intrinsic support are defined in boost/type_traits/intrinsics.hpp, + adding support for new compilers is simply a matter of defining one of more + of the following macros: +

+
+

Table 1.9. Macros for Compiler Intrinsics

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ BOOST_ALIGNMENT_OF(T) +

+
+

+ Should evaluate to the alignment requirements of type T +

+
+

+ BOOST_IS_ABSTRACT(T) +

+
+

+ Should evaluate to true if T is an abstract type +

+
+

+ BOOST_IS_BASE_OF(T,U) +

+
+

+ Should evaluate to true if T is a base class of U +

+
+

+ BOOST_IS_CLASS(T) +

+
+

+ Should evaluate to true if T is a class type +

+
+

+ BOOST_IS_CONVERTIBLE(T,U) +

+
+

+ Should evaluate to true if T is convertible to U +

+
+

+ BOOST_IS_EMPTY(T) +

+
+

+ Should evaluate to true if T is an empty struct or union +

+
+

+ BOOST_IS_ENUM(T) +

+
+

+ Should evaluate to true is T is an enum +

+
+

+ BOOST_IS_FINAL(T) +

+
+

+ Should evaluate to true if T is a class type declared with the final + specifier +

+
+

+ BOOST_IS_NOTHROW_MOVE_ASSIGN(T) +

+
+

+ Should evaluate to true T has a non-throwing move assign operator. +

+
+

+ BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) +

+
+

+ Should evaluate to true T has a non-throwing move constructor. +

+
+

+ BOOST_IS_POLYMORPHIC(T) +

+
+

+ Should evaluate to true if T is a polymorphic type +

+
+

+ BOOST_IS_POD(T) +

+
+

+ Should evaluate to true if T is a POD type +

+
+

+ BOOST_IS_UNION(T) +

+
+

+ Should evaluate to true if T is a union type +

+
+

+ BOOST_HAS_NOTHROW_ASSIGN(T) +

+
+

+ Should evaluate to true if T + t, + u; + t = + u can not throw +

+
+

+ BOOST_HAS_NOTHROW_CONSTRUCTOR(T) +

+
+

+ Should evaluate to true if T + x; + can not throw +

+
+

+ BOOST_HAS_NOTHROW_COPY(T) +

+
+

+ Should evaluate to true if T(t) can not throw +

+
+

+ BOOST_HAS_TRIVIAL_ASSIGN(T) +

+
+

+ Should evaluate to true if T has a trivial assignment operator (and + can therefore be replaced by a call to memcpy) +

+
+

+ BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) +

+
+

+ Should evaluate to true if the default constructor for T is trivial + (i.e. has no effect) +

+
+

+ BOOST_HAS_TRIVIAL_COPY(T) +

+
+

+ Should evaluate to true if T has a trivial copy constructor (and + can therefore be replaced by a call to memcpy) +

+
+

+ BOOST_HAS_TRIVIAL_DESTRUCTOR(T) +

+
+

+ Should evaluate to true if T has a trivial destructor (i.e. ~T() + has no effect) +

+
+

+ BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) +

+
+

+ Should evaluate to true if T has a trivial move constructor (and + can therefore be replaced by a call to memcpy) +

+
+

+ BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) +

+
+

+ Should evaluate to true if T has a trivial move assignment operator + (and can therefore be replaced by a call to memcpy) +

+
+

+ BOOST_HAS_VIRTUAL_DESTRUCTOR(T) +

+
+

+ Should evaluate to true T has a virtual destructor +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/intro.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/intro.html new file mode 100644 index 0000000000000000000000000000000000000000..bea549ba84abb6669efd296f9b2df5a9ff618aa2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/intro.html @@ -0,0 +1,66 @@ + + + +Introduction + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The Boost type-traits library contains a set of very specific traits classes, + each of which encapsulate a single trait from the C++ type system; for example, + is a type a pointer or a reference type? Or does a type have a trivial constructor, + or a const-qualifier? +

+

+ The type-traits classes share a unified design: each class inherits from the + type true_type + if the type has the specified property and inherits from false_type + otherwise. +

+

+ The type-traits library also contains a set of classes that perform a specific + transformation on a type; for example, they can remove a top-level const or + volatile qualifier from a type. Each class that performs a transformation defines + a single typedef-member type + that is the result of the transformation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/mpl.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/mpl.html new file mode 100644 index 0000000000000000000000000000000000000000..edaee1db90e5a1ceb81eacfb769b6c3d3f742f7d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/mpl.html @@ -0,0 +1,60 @@ + + + +MPL Interoperability + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ All the value based traits in this library conform to MPL's requirements for + an Integral + Constant type. +

+

+ Please note that these types no longer inherit from mpl::true_ or + mpl::false_ etc, and the library will no longer + implicitly include any MPL header. However there is an implicit conversion + from integral_constant to the + corresponding MPL types, therefore tag-dispatching that uses MPL types in function + overloads will still work as before. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference.html new file mode 100644 index 0000000000000000000000000000000000000000..54ce513be6c04d7429ea3f977d589b6a4e69cd8d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference.html @@ -0,0 +1,180 @@ + + + +Alphabetical Reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
add_const
+
add_cv
+
add_lvalue_reference
+
add_pointer
+
add_reference
+
add_rvalue_reference
+
add_volatile
+
aligned_storage
+
alignment_of
+
conditional
+
common_type
+
copy_cv
+
decay
+
declval
+
extent
+
floating_point_promotion
+
function_traits
+
has_bit_and
+
has_bit_and_assign
+
has_bit_or
+
has_bit_or_assign
+
has_bit_xor
+
has_bit_xor_assign
+
has_complement
+
has_dereference
+
has_divides
+
has_divides_assign
+
has_equal_to
+
has_greater
+
has_greater_equal
+
has_left_shift
+
has_left_shift_assign
+
has_less
+
has_less_equal
+
has_logical_and
+
has_logical_not
+
has_logical_or
+
has_minus
+
has_minus_assign
+
has_modulus
+
has_modulus_assign
+
has_multiplies
+
has_multiplies_assign
+
has_negate
+
has_new_operator
+
has_not_equal_to
+
has_nothrow_assign
+
has_nothrow_constructor
+
has_nothrow_copy
+
has_nothrow_destructor
+
has_nothrow_copy_constructor
+
has_nothrow_default_constructor
+
has_plus
+
has_plus_assign
+
has_post_decrement
+
has_post_increment
+
has_pre_decrement
+
has_pre_increment
+
has_right_shift
+
has_right_shift_assign
+
has_trivial_assign
+
has_trivial_constructor
+
has_trivial_copy
+
has_trivial_copy_constructor
+
has_trivial_default_constructor
+
has_trivial_destructor
+
has_trivial_move_assign
+
has_trivial_move_constructor
+
has_unary_minus
+
has_unary_plus
+
has_virtual_destructor
+
integral_constant
+
integral_promotion
+
is_abstract
+
is_arithmetic
+
is_array
+
is_assignable
+
is_base_of
+
is_class
+
is_complex
+
is_compound
+
is_const
+
is_constructible
+
is_convertible
+
is_copy_assignable
+
is_copy_constructible
+
is_default_constructible
+
is_destructible
+
is_empty
+
is_enum
+
is_final
+
is_floating_point
+
is_function
+
is_fundamental
+
is_integral
+
is_lvalue_reference
+
is_member_function_pointer
+
is_member_object_pointer
+
is_member_pointer
+
is_nothrow_move_assignable
+
is_nothrow_move_constructible
+
is_object
+
is_pod
+
is_pointer
+
is_polymorphic
+
is_reference
+
is_rvalue_reference
+
is_same
+
is_scalar
+
is_signed
+
is_stateless
+
is_union
+
is_unsigned
+
is_virtual_base_of
+
is_void
+
is_volatile
+
make_signed
+
make_unsigned
+
make_void
+
promote
+
rank
+
remove_all_extents
+
remove_const
+
remove_cv
+
remove_cv_ref
+
remove_extent
+
remove_pointer
+
remove_reference
+
remove_volatile
+
type_identity
+
type_with_alignment
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_const.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_const.html new file mode 100644 index 0000000000000000000000000000000000000000..6cfc1e4bc99bb7449847ce49ea4d459d818add03 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_const.html @@ -0,0 +1,143 @@ + + + +add_const + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct add_const
+{
+   typedef see-below type;
+};
+
+template <class T> using add_const_t = typename add_const<T>::type; // C++11 and above
+
+

+ type: The same type as T + const for all T. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Header: #include + <boost/type_traits/add_const.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.10. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_const<int>::type +

+
+

+ int const +

+
+

+ add_const<int&>::type +

+
+

+ int& +

+
+

+ add_const<int*>::type +

+
+

+ int* + const +

+
+

+ add_const<int const>::type +

+
+

+ int const +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_cv.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_cv.html new file mode 100644 index 0000000000000000000000000000000000000000..fb2cdb5a8f08ab57e92efd8501b83fc6454da131 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_cv.html @@ -0,0 +1,146 @@ + + + +add_cv + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+add_cv +

+
template <class T>
+struct add_cv
+{
+   typedef see-below type;
+};
+
+template <class T> using add_cv_t = typename add_cv<T>::type; // C++11 and above
+
+

+ type: The same type as T + const volatile + for all T. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Header: #include + <boost/type_traits/add_cv.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.11. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_cv<int>::type +

+
+

+ int const + volatile +

+
+

+ add_cv<int&>::type +

+
+

+ int& +

+
+

+ add_cv<int*>::type +

+
+

+ int* + const volatile +

+
+

+ add_cv<int const>::type +

+
+

+ int const + volatile +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_lvalue_reference.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_lvalue_reference.html new file mode 100644 index 0000000000000000000000000000000000000000..7c023b793e19058bd7de0e750802fdff44c134ce --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_lvalue_reference.html @@ -0,0 +1,172 @@ + + + +add_lvalue_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct add_lvalue_reference
+{
+   typedef see-below type;
+};
+
+template <class T> using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++11 and above
+
+

+ type: If T + names an object or function type then the member typedef type + shall name T&; + otherwise, if T names a type + rvalue reference to U then the member typedef type shall + name U&; + otherwise, type shall name T. +

+

+ C++ Standard Reference: 20.7.6.2. +

+

+ Header: #include + <boost/type_traits/add_lvalue_reference.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.12. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_lvalue_reference<int>::type +

+
+

+ int& +

+
+

+ add_lvalue_reference<int + const&>::type +

+
+

+ int const& +

+
+

+ add_lvalue_reference<int*>::type +

+
+

+ int*& +

+
+

+ add_lvalue_reference<int*&>::type +

+
+

+ int*& +

+
+

+ add_lvalue_reference<int&&>::type +

+
+

+ int& +

+
+

+ add_lvalue_reference<void>::type +

+
+

+ void +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_pointer.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_pointer.html new file mode 100644 index 0000000000000000000000000000000000000000..ea5d17f2ff08ba24c84fee4ea0a35b1bad5c4a69 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_pointer.html @@ -0,0 +1,145 @@ + + + +add_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct add_pointer
+{
+   typedef see-below type;
+};
+
+template <class T> using add_pointer_t = typename add_pointer<T>::type; // C++11 and above
+
+

+ type: The same type as remove_reference<T>::type*. +

+

+ The rationale for this template is that it produces the same type as decltype(&t), where + t is an object of type T. +

+

+ C++ Standard Reference: 8.3.1. +

+

+ Header: #include + <boost/type_traits/add_pointer.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.13. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_pointer<int>::type +

+
+

+ int* +

+
+

+ add_pointer<int const&>::type +

+
+

+ int const* +

+
+

+ add_pointer<int*>::type +

+
+

+ int** +

+
+

+ add_pointer<int*&>::type +

+
+

+ int** +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_reference.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_reference.html new file mode 100644 index 0000000000000000000000000000000000000000..6ba4194375e1af46ee76cac056e73f040d66be9b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_reference.html @@ -0,0 +1,154 @@ + + + +add_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + + + + +
[Note]Note

+ This trait has been made obsolete by add_lvalue_reference + and add_rvalue_reference, + and new code should use these new traits rather than is_reference + which is retained for backwards compatibility only. +

+
template <class T>
+struct add_reference
+{
+   typedef see-below type;
+};
+
+template <class T> using add_reference_t = typename add_reference<T>::type; // C++11 and above
+
+

+ type: If T + is not a reference type then T&, otherwise T. +

+

+ C++ Standard Reference: 8.3.2. +

+

+ Header: #include + <boost/type_traits/add_reference.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.14. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_reference<int>::type +

+
+

+ int& +

+
+

+ add_reference<int const&>::type +

+
+

+ int const& +

+
+

+ add_reference<int*>::type +

+
+

+ int*& +

+
+

+ add_reference<int*&>::type +

+
+

+ int*& +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_rvalue_reference.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_rvalue_reference.html new file mode 100644 index 0000000000000000000000000000000000000000..b015c98790f8d69ab6fa6e6c04eed42d0246ca8c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_rvalue_reference.html @@ -0,0 +1,172 @@ + + + +add_rvalue_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct add_rvalue_reference
+{
+   typedef see-below type;
+};
+
+template <class T> using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++11 and above
+
+

+ type: If T + names an object or function type then the member typedef type shall name + T&&; + otherwise, type shall name T. + [Note: This rule reflects the semantics of reference collapsing. + For example, when a type T + names a type U&, the type add_rvalue_reference<T>::type is not an rvalue reference. -end note]. +

+

+ C++ Standard Reference: 20.7.6.2. +

+

+ Header: #include + <boost/type_traits/add_rvalue_reference.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.15. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_rvalue_reference<int>::type +

+
+

+ int&& +

+
+

+ add_rvalue_reference<int + const&>::type +

+
+

+ int const& +

+
+

+ add_rvalue_reference<int*>::type +

+
+

+ int*&& +

+
+

+ add_rvalue_reference<int*&>::type +

+
+

+ int*& +

+
+

+ add_rvalue_reference<int&&>::type +

+
+

+ int&& +

+
+

+ add_rvalue_reference<void>::type +

+
+

+ void +

+
+
+

+ Compiler Compatibility: In the absence of + rvalue-reference support this trait has no effect. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_volatile.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_volatile.html new file mode 100644 index 0000000000000000000000000000000000000000..862e0a59d000b27a5cca0be4b48554a4e657aba0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/add_volatile.html @@ -0,0 +1,144 @@ + + + +add_volatile + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct add_volatile
+{
+   typedef see-below type;
+};
+
+template <class T> using add_volatile_t = typename add_volatile<T>::type; // C++11 and above
+
+

+ type: The same type as T + volatile for all T. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Header: #include + <boost/type_traits/add_volatile.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.16. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ add_volatile<int>::type +

+
+

+ int volatile +

+
+

+ add_volatile<int&>::type +

+
+

+ int& +

+
+

+ add_volatile<int*>::type +

+
+

+ int* + volatile +

+
+

+ add_volatile<int const>::type +

+
+

+ int const + volatile +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html new file mode 100644 index 0000000000000000000000000000000000000000..db738605c0531b316603666c8d11bee9d76c176a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html @@ -0,0 +1,111 @@ + + + +aligned_storage + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <std::size_t Size, std::size_t Align>
+struct aligned_storage
+{
+   typedef see-below type;
+};
+
+

+ type: a built-in or POD type with size + Size and an alignment that + is a multiple of Align. +

+

+ Header: #include + <boost/type_traits/aligned_storage.hpp> + or #include <boost/type_traits.hpp> +

+

+ On the GCC and Visual C++ compilers (or compilers that are compatible with + them), we support requests for types with alignments greater than any built + in type (up to 128-bit alignment). Visual C++ users should note that such + "extended" types can not be passed down the stack as by-value function + arguments. +

+
+ + + + + +
[Important]Important
+

+ Visual C++ users should be aware that MSVC has an elastic definition of + alignment, for example consider the following code: +

+

+

+
typedef boost::aligned_storage<8,8>::type align_t;
+assert(boost::alignment_of<align_t>::value % 8 == 0);
+align_t a;
+assert(((std::uintptr_t)&a % 8) == 0);
+char c = 0;
+align_t a1;
+assert(((std::uintptr_t)&a1 % 8) == 0);
+
+

+

+

+ In this code the final assert will fail for a 32-bit build because variable + a1 is not aligned on an + 8-byte boundary. Had we used the MSVC intrinsic __alignof + in place of alignment_of + or std::aligned_storage in place of boost::aligned_storage the result would have + been no different. In MSVC alignment requirements/promises only really + apply to variables on the heap, not on the stack. +

+

+ Further, although MSVC has a mechanism for generating new types with arbitrary + alignment requirements, such types cannot be passed as function arguments + on the program stack. Therefore had boost::aligned_storage<8,8>::type + been a type declared with __declspec(align(8)) + we would break a great deal of existing code that relies on being able + to pass such types through the program stack. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/alignment_of.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/alignment_of.html new file mode 100644 index 0000000000000000000000000000000000000000..490761e87d81d8fb96f588c698b28bd1f33733bc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/alignment_of.html @@ -0,0 +1,115 @@ + + + +alignment_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};
+
+

+ Inherits: Class template alignment_of + inherits from integral_constant<std::size_t, ALIGNOF(T)>, + where ALIGNOF(T) is the + alignment of type T. +

+

+ Note: strictly speaking you should only rely on the value of ALIGNOF(T) being + a multiple of the true alignment of T, although in practice it does compute + the correct value in all the cases we know about. +

+

+ Header: #include + <boost/type_traits/alignment_of.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ alignment_of<int> + inherits from integral_constant<std::size_t, ALIGNOF(int)>. +

+

+ alignment_of<char>::type is the type integral_constant<std::size_t, ALIGNOF(char)>. +

+

+ alignment_of<double>::value is an integral constant expression + with value ALIGNOF(double). +

+

+ alignment_of<T>::value_type is the type std::size_t. +

+
+ + + + + +
[Important]Important
+

+ Visual C++ users should note that MSVC has varying definitions of "alignment". + For example consider the following code: +

+

+

+
typedef long long align_t;
+assert(boost::alignment_of<align_t>::value % 8 == 0);
+align_t a;
+assert(((std::uintptr_t)&a % 8) == 0);
+char c = 0;
+align_t a1;
+assert(((std::uintptr_t)&a1 % 8) == 0);
+
+

+

+

+ In this code, even though boost::alignment_of<align_t> reports that align_t + has 8-byte alignment, the final assert will fail for a 32-bit build because + a1 is not aligned on an + 8 byte boundary. Note that had we used the MSVC intrinsic __alignof in place of boost::alignment_of + we would still get the same result. In fact for MSVC alignment requirements + (and promises) only really apply to dynamic storage, and not the stack. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/common_type.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/common_type.html new file mode 100644 index 0000000000000000000000000000000000000000..5db5c9909d0855e16ddc63e591c1c47818772a95 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/common_type.html @@ -0,0 +1,338 @@ + + + +common_type + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Header: #include + <boost/type_traits/common_type.hpp> + or #include <boost/type_traits.hpp> +

+
namespace boost {
+  template <class... T> struct common_type;
+  template<class... T> using common_type_t = typename common_type<T...>::type; // C++11 and above
+}
+
+

+ common_type is a traits class + used to deduce a type common to a several types, useful as the return type + of functions operating on multiple input types such as in mixed-mode arithmetic.. +

+

+ The nested typedef ::type + could be defined as follows: +

+
template <class... T>
+struct common_type;
+
+template <class T, class U, class... V>
+struct common_type<T, U, V...> {
+    typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
+};
+
+template <>
+struct common_type<> {
+};
+
+template <class T>
+struct common_type<T> {
+    typedef typename decay<T>::type type;
+};
+
+template <class T, class U>
+struct common_type<T, U> {
+    typedef typename decay<
+        decltype( declval<bool>()?
+            declval<typename decay<T>::type>():
+            declval<typename decay<U>::type>() )
+    >::type type;
+};
+
+

+ All parameter types must be complete. This trait is permitted to be specialized + by a user if at least one template parameter is a user-defined type. Note: Such specializations are required when only + explicit conversions are desired among the common_type + arguments. +

+

+ Note that when the compiler does not support variadic templates (and the + macro BOOST_NO_CXX11_VARIADIC_TEMPLATES + is defined) then the maximum number of template arguments is 9. +

+
+ + Tutorial +
+

+ In a nutshell, common_type + is a trait that takes 1 or more types, and returns a type which all of the + types will convert to. The default definition demands this conversion be + implicit. However the trait can be specialized for user-defined types which + want to limit their inter-type conversions to explicit, and yet still want + to interoperate with the common_type + facility. +

+

+ Example: +

+
template <class T, class U>
+complex<typename common_type<T, U>::type>
+operator+(complex<T>, complex<U>);
+
+

+ In the above example, "mixed-mode" complex arithmetic is allowed. + The return type is described by common_type. + For example the resulting type of adding a complex<float> and complex<double> might be a complex<double>. +

+

+ Here is how someone might produce a variadic comparison function: +

+
template <class ...T>
+typename common_type<T...>::type
+min(T... t);
+
+

+ This is a very useful and broadly applicable utility. +

+
+ + How + to get the common type of types with explicit conversions? +
+

+ Another choice for the author of the preceding operator could be +

+
template <class T, class U>
+typename common_type<complex<T>, complex<U> >::type
+operator+(complex<T>, complex<U>);
+
+

+ As the default definition of common_type + demands the conversion be implicit, we need to specialize the trait for complex + types as follows. +

+
template <class T, class U>
+struct common_type<complex<T>, complex<U> > {
+    typedef complex< common_type<T, U> > type;
+};
+
+
+ + How + important is the order of the common_type<> template arguments? +
+

+ The order of the template parameters is important. +

+

+ common_type<A,B,C>::type is not equivalent to common_type<C,A,B>::type, but to common_type<common_type<A,B>::type, C>::type. +

+

+ Consider +

+
struct A {};
+struct B {};
+struct C {
+    C() {}
+    C(A const&) {}
+    C(B const&) {}
+    C& operator=(C const&) {
+        return *this;
+    }
+};
+
+

+ The following doesn't compile +

+
typedef boost::common_type<A, B, C>::type ABC; // Does not compile
+
+

+ while +

+
typedef boost::common_type<C, A, B>::type ABC;
+
+

+ compiles. +

+

+ Thus, as common_type<A,B>::type + is undefined, common_type<A,B,C>::type + is also undefined. +

+

+ It is intended that clients who wish for common_type<A, + B> + to be well defined to define it themselves: +

+
namespace boost
+{
+
+template <>
+struct common_type<A, B> {typedef C type;};
+
+}
+
+

+ Now this client can ask for common_type<A, + B, C> (and + get the same answer). +

+

+ Clients wanting to ask common_type<A, + B, C> in + any order and get the same result need to add in addition: +

+
namespace boost
+{
+
+template <> struct common_type<B, A>
+: public common_type<A, B> {};
+
+}
+
+

+ This is needed as the specialization of common_type<A, + B> + is not be used implicitly for common_type<B, + A>. +

+
+ + Can + the common_type of two types + be a third type? +
+

+ Given the preceding example, one might expect common_type<A,B>::type to be C + without any intervention from the user. But the default common_type<> implementation doesn't grant that. + It is intended that clients who wish for common_type<A, + B> + to be well defined to define it themselves: +

+
namespace boost
+{
+
+template <>
+struct common_type<A, B> {typedef C type;};
+
+template <> struct common_type<B, A>
+: public common_type<A, B> {};
+
+}
+
+

+ Now this client can ask for common_type<A, + B>. +

+
+ + How + does common_type behave with + pointers? +
+

+ Consider +

+
struct C { }:
+struct B : C { };
+struct A : C { };
+
+

+ Shouldn't common_type<A*,B*>::type + be C*? + I would say yes, but the default implementation will make it ill-formed. +

+

+ The library could add a specialization for pointers, as +

+
namespace boost
+{
+
+    template <typename A, typename B>
+    struct common_type<A*, B*> {
+        typedef common_type<A, B>* type;
+    };
+}
+
+

+ But in the absence of a motivating use cases, we prefer not to add more than + the standard specifies. +

+

+ Of course the user can always make this specialization. +

+
+ + Can + you explain the pros/cons of common_type + against Boost.Typeof? +
+

+ Even if they appear to be close, common_type + and typeof have different + purposes. You use typeof + to get the type of an expression, while you use common_type + to set explicitly the type returned of a template function. Both are complementary, + and indeed common_type is + approximately equivalent to decltype(declval<bool>() + ? declval<T>() + : declval<U>()). +

+

+ common_type is also similar + to promote_args<class ...T> in + boost/math/tools/promotion.hpp, though + it is not exactly the same as promote_args + either. common_type<T1, T2>::type + simply represents the result of some operation on T1 + and T2, and defaults to the + type obtained by putting T1 + and T2 into a conditional + statement. +

+

+ It is meant to be customizable (via specialization) if this default is not + appropriate. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html new file mode 100644 index 0000000000000000000000000000000000000000..28268e8ceb614b8403c59d414bdcc4684fbb5fd2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html @@ -0,0 +1,61 @@ + + + +conditional + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Header: #include + <boost/type_traits/conditional.hpp> + or #include <boost/type_traits.hpp> +

+
namespace boost {
+  template <bool B, class T, class U>  struct conditional;
+  template <bool B, class T, class U>  using conditional_t = typename conditional<B, T, U>::type; // C++11 and above
+}
+
+

+ If B is true, the member typedef type shall equal T. If B is false, the member + typedef type shall equal U. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/copy_cv.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/copy_cv.html new file mode 100644 index 0000000000000000000000000000000000000000..cbde9b3e253e7600f6f12228fa4cd6912a8e2c89 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/copy_cv.html @@ -0,0 +1,165 @@ + + + +copy_cv + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T, class U>
+struct copy_cv
+{
+   typedef see-below type;
+};
+
+template <class T, class U> using copy_cv_t = typename copy_cv<T, U>::type; // C++11 and above
+
+

+ type: T cv, + where cv are the cv-qualifiers of U. +

+

+ Header: #include + <boost/type_traits/copy_cv.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.17. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ copy_cv<int, void>::type +

+
+

+ int +

+
+

+ copy_cv<int const, void>::type +

+
+

+ int const +

+
+

+ copy_cv<int, void const>::type +

+
+

+ int const +

+
+

+ copy_cv<int volatile, void + const>::type +

+
+

+ int const + volatile +

+
+

+ copy_cv<int&, + void const>::type +

+
+

+ int& +

+
+

+ copy_cv<int*, + void volatile>::type +

+
+

+ int* + volatile +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/decay.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/decay.html new file mode 100644 index 0000000000000000000000000000000000000000..b05e9a5e56d7dfd8ec64f35f230bc1ce8e31e4e6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/decay.html @@ -0,0 +1,157 @@ + + + +decay + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+decay +

+
template <class T>
+struct decay
+{
+   typedef see-below type;
+};
+
+template <class T> using decay_t = typename decay<T>::type; // C++11 and above
+
+

+ type: Let U + be the result of remove_reference<T>::type, then if U + is an array type, the result is remove_extent<U>::type*, + otherwise if U is a function + type then the result is U*, otherwise the result is U. +

+

+ C++ Standard Reference: 3.9.1. +

+

+ Header: #include + <boost/type_traits/decay.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.18. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ decay<int[2][3]>::type +

+
+

+ int[3]* +

+
+

+ decay<int(&)[2]>::type +

+
+

+ int* +

+
+

+ decay<int(&)(double)>::type +

+
+

+ int(*)(double) +

+
+

+ int(*)(double) +

+
+

+ int(*)(double) +

+
+

+ int(double) +

+
+

+ int(*)(double) +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/declval.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/declval.html new file mode 100644 index 0000000000000000000000000000000000000000..0aea4895558a440d69c052c4449cf464ad02fc00 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/declval.html @@ -0,0 +1,66 @@ + + + +declval + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+typename add_rvalue_reference<T>::type declval() noexcept; // as unevaluated operand
+
+

+ C++ Standard Reference: C++11 20.2.4 [declval]. +

+

+ Header: #include + <boost/type_traits/declval.hpp> + or #include <boost/type_traits.hpp> +

+

+ The function template declval + is used when a value of a certain type is required in a type computation + context. For example, the type of the result of adding an int + and a float can be obtained + with the expression decltype( declval<int>() + + declval<float>() ). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/extent.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/extent.html new file mode 100644 index 0000000000000000000000000000000000000000..d2e4add67a29009902f82380127fc9bb20dd3772 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/extent.html @@ -0,0 +1,113 @@ + + + +extent + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+extent +

+
template <class T, std::size_t N = 0>
+struct extent : public integral_constant<std::size_t, EXTENT(T,N)> {};
+
+

+ Inherits: Class template extent inherits + from integral_constant<std::size_t, EXTENT(T,N)>, + where EXTENT(T,N) is the number of elements in the N'th array + dimension of type T. +

+

+ If T is not a (built-in) + array type, or if N > + rank<T>::value, or if the N'th array bound is incomplete, + then EXTENT(T,N) is zero. +

+

+ Header: #include + <boost/type_traits/extent.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ extent<int[1]> inherits from integral_constant<std::size_t, 1>. +

+

+ extent<double[2][3][4], + 0>::type is the type integral_constant<std::size_t, 2>. +

+

+ extent<double[2][3][4], + 1>::type is the type integral_constant<std::size_t, 3>. +

+

+ extent<double[2][3][4], + 2>::type is the type integral_constant<std::size_t, 4>. +

+

+ extent<int[4]>::value + is an integral constant expression that evaluates to 4. +

+

+ extent<int[][2]>::value + is an integral constant expression that evaluates to 0. +

+

+ extent<int[][2], 1>::value is an integral constant expression + that evaluates to 2. +

+

+ extent<int*>::value is an integral constant expression + that evaluates to 0. +

+

+ extent<boost::array<int, 3> >::value is an integral constant expression + that evaluates to 0: boost::array + is a class type and not an array type! +

+

+ extent<T>::value_type is the type std::size_t. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/floating_point_promotion.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/floating_point_promotion.html new file mode 100644 index 0000000000000000000000000000000000000000..8e9219da0bcf595454106260ff57a3895974c552 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -0,0 +1,134 @@ + + + +floating_point_promotion + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct floating_point_promotion
+{
+   typedef see-below type;
+};
+
+template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type; // C++11 and above
+
+

+ type: If floating point promotion can be + applied to an rvalue of type T, + then applies floating point promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. +

+

+ C++ Standard Reference: 4.6. +

+

+ Header: #include + <boost/type_traits/floating_point_promotion.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.19. Examples

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ floating_point_promotion<float + const>::type +

+
+

+ double const +

+
+

+ floating_point_promotion<float&>::type +

+
+

+ float& +

+
+

+ floating_point_promotion<short>::type +

+
+

+ short +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/function_traits.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/function_traits.html new file mode 100644 index 0000000000000000000000000000000000000000..3760571519f897f7f3a871ed8bd6aaf085f10bfd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/function_traits.html @@ -0,0 +1,288 @@ + + + +function_traits + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class F>
+struct function_traits
+{
+   static const std::size_t    arity = see-below;
+   typedef see-below           result_type;
+   typedef see-below           argN_type;
+};
+
+

+ The class template function_traits will only compile if: +

+
    +
  • + The compiler supports partial specialization of class templates. +
  • +
  • + The template argument F + is a function type, note that this is not the same thing as a pointer + to a function. +
  • +
+
+ + + + + +
[Tip]Tip

+ function_traits is intended to introspect only C++ functions of the form + R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or class member + functions. To convert a function pointer type to a suitable type use remove_pointer. +

+
+

Table 1.20. Function Traits Members

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Member +

+
+

+ Description +

+
+

+ function_traits<F>::arity +

+
+

+ An integral constant expression that gives the number of arguments + accepted by the function type F. +

+
+

+ function_traits<F>::result_type +

+
+

+ The type returned by function type F. +

+
+

+ function_traits<F>::argN_type +

+
+

+ The Nth argument type of function type F, + where 1 <= + N <= + arity of F. +

+
+
+
+

Table 1.21. Examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result +

+
+

+ function_traits<void + (void)>::arity +

+
+

+ An integral constant expression that has the value 0. +

+
+

+ function_traits<long + (int)>::arity +

+
+

+ An integral constant expression that has the value 1. +

+
+

+ function_traits<long + (int, long, double, void*)>::arity +

+
+

+ An integral constant expression that has the value 4. +

+
+

+ function_traits<void + (void)>::result_type +

+
+

+ The type void. +

+
+

+ function_traits<long + (int)>::result_type +

+
+

+ The type long. +

+
+

+ function_traits<long + (int)>::arg1_type +

+
+

+ The type int. +

+
+

+ function_traits<long + (int, long, double, void*)>::arg4_type +

+
+

+ The type void*. +

+
+

+ function_traits<long + (int, long, double, void*)>::arg5_type +

+
+

+ A compiler error: there is no arg5_type + since there are only four arguments. +

+
+

+ function_traits<long + (*)(void)>::arity +

+
+

+ A compiler error: argument type is a function pointer, + and not a function type. +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html new file mode 100644 index 0000000000000000000000000000000000000000..fbb512fd419ccfcbd193fc113f3ec3dece0f3d07 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and.html @@ -0,0 +1,190 @@ + + + +has_bit_and + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_bit_and : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs&rhs, + and (ii) Ret=dont_care or the result of expression + lhs&rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator&. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs&rhs); // is valid if has_bit_and<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_bit_and.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_bit_and<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_bit_and<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_bit_and<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_bit_and<long> + inherits from true_type. +

+

+ has_bit_and<int, int, int> + inherits from true_type. +

+

+ has_bit_and<const int, int> + inherits from true_type. +

+

+ has_bit_and<int, double, bool> + inherits from false_type. +

+

+ has_bit_and<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator& is public or not: if operator& + is defined as a private member of Lhs + then instantiating has_bit_and<Lhs> will produce a compiler error. For + this reason has_bit_and + cannot be used to determine whether a type has a public operator& + or not. +
    struct A { private: void operator&(const A&); };
    +boost::has_bit_and<A>::value; // error: A::operator&(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator&(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_bit_and<A>::value; // this is fine
    +boost::has_bit_and<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator& + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_bit_and.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator&(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_bit_and< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g&g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_bit_and< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b&b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..53b48850ceb1c623904d6a2090ba0bed890d57c0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_and_assign.html @@ -0,0 +1,190 @@ + + + +has_bit_and_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_bit_and_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs&=rhs, + and (ii) Ret=dont_care or the result of expression + lhs&=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator&=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs&=rhs); // is valid if has_bit_and_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_bit_and_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_bit_and_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_bit_and_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_bit_and_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_bit_and_assign<long> + inherits from true_type. +

+

+ has_bit_and_assign<int, int, int> + inherits from true_type. +

+

+ has_bit_and_assign<const int, int> + inherits from false_type. +

+

+ has_bit_and_assign<int, double, bool> + inherits from false_type. +

+

+ has_bit_and_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator&= is public or not: if operator&= + is defined as a private member of Lhs + then instantiating has_bit_and_assign<Lhs> will produce a compiler error. For + this reason has_bit_and_assign + cannot be used to determine whether a type has a public operator&= + or not. +
    struct A { private: void operator&=(const A&); };
    +boost::has_bit_and_assign<A>::value; // error: A::operator&=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator&=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_bit_and_assign<A>::value; // this is fine
    +boost::has_bit_and_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator&= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_bit_and_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator&=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_bit_and_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g&=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_bit_and_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b&=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html new file mode 100644 index 0000000000000000000000000000000000000000..79925571d488d391f44a803839324b938894c9a1 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or.html @@ -0,0 +1,188 @@ + + + +has_bit_or + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_bit_or : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs|rhs, and + (ii) Ret=dont_care or the result of expression + lhs|rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator|. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs|rhs); // is valid if has_bit_or<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_bit_or.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_bit_or<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_bit_or<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_bit_or<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_bit_or<long> + inherits from true_type. +

+

+ has_bit_or<int, int, int> + inherits from true_type. +

+

+ has_bit_or<const int, int> + inherits from true_type. +

+

+ has_bit_or<int, double, bool> + inherits from false_type. +

+

+ has_bit_or<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator| is public or not: if operator| is defined as a private member of Lhs then instantiating has_bit_or<Lhs> + will produce a compiler error. For this reason has_bit_or + cannot be used to determine whether a type has a public operator| + or not. +
    struct A { private: void operator|(const A&); };
    +boost::has_bit_or<A>::value; // error: A::operator|(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator|(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_bit_or<A>::value; // this is fine
    +boost::has_bit_or<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator| + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_bit_or.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator|(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_bit_or< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g|g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_bit_or< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b|b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..11fcd03c7f63652f472c686af682a70579348eba --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_or_assign.html @@ -0,0 +1,190 @@ + + + +has_bit_or_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_bit_or_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs|=rhs, + and (ii) Ret=dont_care or the result of expression + lhs|=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator|=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs|=rhs); // is valid if has_bit_or_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_bit_or_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_bit_or_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_bit_or_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_bit_or_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_bit_or_assign<long> + inherits from true_type. +

+

+ has_bit_or_assign<int, int, int> + inherits from true_type. +

+

+ has_bit_or_assign<const int, int> + inherits from false_type. +

+

+ has_bit_or_assign<int, double, bool> + inherits from false_type. +

+

+ has_bit_or_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator|= is public or not: if operator|= + is defined as a private member of Lhs + then instantiating has_bit_or_assign<Lhs> will produce a compiler error. For + this reason has_bit_or_assign + cannot be used to determine whether a type has a public operator|= + or not. +
    struct A { private: void operator|=(const A&); };
    +boost::has_bit_or_assign<A>::value; // error: A::operator|=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator|=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_bit_or_assign<A>::value; // this is fine
    +boost::has_bit_or_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator|= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_bit_or_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator|=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_bit_or_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g|=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_bit_or_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b|=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html new file mode 100644 index 0000000000000000000000000000000000000000..5e13aa2141a1d1fd7a330ebd3b078161dac0717f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor.html @@ -0,0 +1,188 @@ + + + +has_bit_xor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_bit_xor : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs^rhs, and + (ii) Ret=dont_care or the result of expression + lhs^rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator^. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs^rhs); // is valid if has_bit_xor<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_bit_xor.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_bit_xor<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_bit_xor<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_bit_xor<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_bit_xor<long> + inherits from true_type. +

+

+ has_bit_xor<int, int, int> + inherits from true_type. +

+

+ has_bit_xor<const int, int> + inherits from true_type. +

+

+ has_bit_xor<int, double, bool> + inherits from false_type. +

+

+ has_bit_xor<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator^ is public or not: if operator^ is defined as a private member of Lhs then instantiating has_bit_xor<Lhs> + will produce a compiler error. For this reason has_bit_xor + cannot be used to determine whether a type has a public operator^ + or not. +
    struct A { private: void operator^(const A&); };
    +boost::has_bit_xor<A>::value; // error: A::operator^(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator^(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_bit_xor<A>::value; // this is fine
    +boost::has_bit_xor<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator^ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_bit_xor.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator^(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_bit_xor< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g^g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_bit_xor< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b^b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..0e0e4a3747ad2d381070e7415f6f16501e888375 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_bit_xor_assign.html @@ -0,0 +1,190 @@ + + + +has_bit_xor_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_bit_xor_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs^=rhs, + and (ii) Ret=dont_care or the result of expression + lhs^=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator^=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs^=rhs); // is valid if has_bit_xor_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_bit_xor_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_bit_xor_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_bit_xor_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_bit_xor_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_bit_xor_assign<long> + inherits from true_type. +

+

+ has_bit_xor_assign<int, int, int> + inherits from true_type. +

+

+ has_bit_xor_assign<const int, int> + inherits from false_type. +

+

+ has_bit_xor_assign<int, double, bool> + inherits from false_type. +

+

+ has_bit_xor_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator^= is public or not: if operator^= + is defined as a private member of Lhs + then instantiating has_bit_xor_assign<Lhs> will produce a compiler error. For + this reason has_bit_xor_assign + cannot be used to determine whether a type has a public operator^= + or not. +
    struct A { private: void operator^=(const A&); };
    +boost::has_bit_xor_assign<A>::value; // error: A::operator^=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator^=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_bit_xor_assign<A>::value; // this is fine
    +boost::has_bit_xor_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator^= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_bit_xor_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator^=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_bit_xor_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g^=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_bit_xor_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b^=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html new file mode 100644 index 0000000000000000000000000000000000000000..0b05503bb94243acf6e5779c4babe54879c9591e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_complement.html @@ -0,0 +1,197 @@ + + + +has_complement + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_complement : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression ~rhs, + and (ii) Ret=dont_care or the result of expression + ~rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator~. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(~rhs); // is valid if has_complement<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_complement.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_complement<Rhs, Ret>::value_type is the type bool. +

+

+ has_complement<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_complement<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_complement<long> + inherits from true_type. +

+

+ has_complement<int, int> inherits from true_type. +

+

+ has_complement<int, long> inherits from true_type. +

+

+ has_complement<const int> inherits from true_type. +

+

+ has_complement<int*> + inherits from false_type. +

+

+ has_complement<double, double> + inherits from false_type. +

+

+ has_complement<double, int> + inherits from false_type. +

+

+ has_complement<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator~ is public or not: if operator~ is defined as a private member of Rhs then instantiating has_complement<Rhs> + will produce a compiler error. For this reason has_complement + cannot be used to determine whether a type has a public operator~ + or not. +
    struct A { private: void operator~(); };
    +boost::has_complement<A>::value; // error: A::operator~() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator~(const A&);
    +struct B { operator A(); };
    +boost::has_complement<A>::value; // this is fine
    +boost::has_complement<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator~ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_complement.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator~(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_complement< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	~g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_complement< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	~b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html new file mode 100644 index 0000000000000000000000000000000000000000..147fb99bc39ccf5d440c0f3ef90bf25e9d9b9cc8 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_dereference.html @@ -0,0 +1,206 @@ + + + +has_dereference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_dereference : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression *rhs, + and (ii) Ret=dont_care or the result of expression + *rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator*. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(*rhs); // is valid if has_dereference<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_dereference.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_dereference<Rhs, Ret>::value_type is the type bool. +

+

+ has_dereference<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_dereference<int*>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_dereference<long*> + inherits from true_type. +

+

+ has_dereference<int*, int> inherits from true_type. +

+

+ has_dereference<int*, const + int> + inherits from true_type. +

+

+ has_dereference<int const *> inherits from true_type. +

+

+ has_dereference<int * const> inherits from true_type. +

+

+ has_dereference<int const * const> inherits from true_type. +

+

+ has_dereference<int> + inherits from false_type. +

+

+ has_dereference<double> + inherits from false_type. +

+

+ has_dereference<void*> + inherits from false_type. +

+

+ has_dereference<const int*, int&> + inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator* is public or not: if operator* is defined as a private member of Rhs then instantiating has_dereference<Rhs> + will produce a compiler error. For this reason has_dereference + cannot be used to determine whether a type has a public operator* + or not. +
    struct A { private: void operator*(); };
    +boost::has_dereference<A>::value; // error: A::operator*() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator*(const A&);
    +struct B { operator A(); };
    +boost::has_dereference<A>::value; // this is fine
    +boost::has_dereference<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator* + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_dereference.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator*(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_dereference< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	*g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_dereference< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	*b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html new file mode 100644 index 0000000000000000000000000000000000000000..a441ca80f588c6bb6c84c6cd1024d7a8e9bde9bf --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_divides.html @@ -0,0 +1,194 @@ + + + +has_divides + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_divides : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs/rhs, and + (ii) Ret=dont_care or the result of expression + lhs/rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator/. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs/rhs); // is valid if has_divides<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_divides.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_divides<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_divides<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_divides<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_divides<long> + inherits from true_type. +

+

+ has_divides<int, int, int> + inherits from true_type. +

+

+ has_divides<int, int, long> + inherits from true_type. +

+

+ has_divides<int, double, double> inherits from true_type. +

+

+ has_divides<int, double, int> + inherits from true_type. +

+

+ has_divides<const int, int>::value inherits from true_type. +

+

+ has_divides<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator/ is public or not: if operator/ is defined as a private member of Lhs then instantiating has_divides<Lhs> + will produce a compiler error. For this reason has_divides + cannot be used to determine whether a type has a public operator/ + or not. +
    struct A { private: void operator/(const A&); };
    +boost::has_divides<A>::value; // error: A::operator/(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator/(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_divides<A>::value; // this is fine
    +boost::has_divides<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator/ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_divides.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator/(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_divides< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g/g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_divides< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b/b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..c59a87c60559d58aafc11fda3144346b67940a6f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_divides_assign.html @@ -0,0 +1,196 @@ + + + +has_divides_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_divides_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs/=rhs, + and (ii) Ret=dont_care or the result of expression + lhs/=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator/=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs/=rhs); // is valid if has_divides_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_divides_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_divides_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_divides_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_divides_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_divides_assign<long> + inherits from true_type. +

+

+ has_divides_assign<int, int, int> + inherits from true_type. +

+

+ has_divides_assign<int, int, long> + inherits from true_type. +

+

+ has_divides_assign<int, double, double> inherits from true_type. +

+

+ has_divides_assign<int, double, int> + inherits from true_type. +

+

+ has_divides_assign<const int, int>::value inherits from false_type. +

+

+ has_divides_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator/= is public or not: if operator/= + is defined as a private member of Lhs + then instantiating has_divides_assign<Lhs> will produce a compiler error. For + this reason has_divides_assign + cannot be used to determine whether a type has a public operator/= + or not. +
    struct A { private: void operator/=(const A&); };
    +boost::has_divides_assign<A>::value; // error: A::operator/=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator/=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_divides_assign<A>::value; // this is fine
    +boost::has_divides_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator/= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_divides_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator/=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_divides_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g/=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_divides_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b/=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html new file mode 100644 index 0000000000000000000000000000000000000000..1a321af222918ac11d5cb2b8a13ac834f08f9f4a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_equal_to.html @@ -0,0 +1,195 @@ + + + +has_equal_to + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_equal_to : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs==rhs, + and (ii) Ret=dont_care or the result of expression + lhs==rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator==. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs==rhs); // is valid if has_equal_to<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_equal_to.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_equal_to<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_equal_to<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_equal_to<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_equal_to<long> + inherits from true_type. +

+

+ has_equal_to<int, int, bool> + inherits from true_type. +

+

+ has_equal_to<int, double, bool> + inherits from true_type. +

+

+ has_equal_to<const int> inherits from true_type. +

+

+ has_equal_to<int*, int> inherits from false_type. +

+

+ has_equal_to<int*, double*> inherits from false_type. +

+

+ has_equal_to<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator== is public or not: if operator== + is defined as a private member of Lhs + then instantiating has_equal_to<Lhs> will produce a compiler error. For + this reason has_equal_to + cannot be used to determine whether a type has a public operator== + or not. +
    struct A { private: void operator==(const A&); };
    +boost::has_equal_to<A>::value; // error: A::operator==(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator==(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_equal_to<A>::value; // this is fine
    +boost::has_equal_to<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator== + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_equal_to.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator==(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_equal_to< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g==g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_equal_to< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b==b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html new file mode 100644 index 0000000000000000000000000000000000000000..9c97c96a8ecb30a7db92b2620a90556f290461c3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_greater.html @@ -0,0 +1,195 @@ + + + +has_greater + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_greater : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs>rhs, + and (ii) Ret=dont_care or the result of expression + lhs>rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator>. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs>rhs); // is valid if has_greater<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_greater.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_greater<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_greater<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_greater<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_greater<long> + inherits from true_type. +

+

+ has_greater<int, int, bool> + inherits from true_type. +

+

+ has_greater<int, double, bool> + inherits from true_type. +

+

+ has_greater<const int> inherits from true_type. +

+

+ has_greater<int*, int> inherits from false_type. +

+

+ has_greater<int*, double*> inherits from false_type. +

+

+ has_greater<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator> is public or not: if operator> + is defined as a private member of Lhs + then instantiating has_greater<Lhs> will produce a compiler error. For + this reason has_greater + cannot be used to determine whether a type has a public operator> + or not. +
    struct A { private: void operator>(const A&); };
    +boost::has_greater<A>::value; // error: A::operator>(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator>(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_greater<A>::value; // this is fine
    +boost::has_greater<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator> + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_greater.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator>(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_greater< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g>g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_greater< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b>b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html new file mode 100644 index 0000000000000000000000000000000000000000..12241d9d855a4d506de10667fad3d7ee77c07636 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_greater_equal.html @@ -0,0 +1,195 @@ + + + +has_greater_equal + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_greater_equal : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs>=rhs, + and (ii) Ret=dont_care or the result of expression + lhs>=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator>=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs>=rhs); // is valid if has_greater_equal<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_greater_equal.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_greater_equal<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_greater_equal<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_greater_equal<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_greater_equal<long> + inherits from true_type. +

+

+ has_greater_equal<int, int, bool> + inherits from true_type. +

+

+ has_greater_equal<int, double, bool> + inherits from true_type. +

+

+ has_greater_equal<const int> inherits from true_type. +

+

+ has_greater_equal<int*, int> inherits from false_type. +

+

+ has_greater_equal<int*, double*> inherits from false_type. +

+

+ has_greater_equal<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator>= is public or not: if operator>= + is defined as a private member of Lhs + then instantiating has_greater_equal<Lhs> will produce a compiler error. For + this reason has_greater_equal + cannot be used to determine whether a type has a public operator>= + or not. +
    struct A { private: void operator>=(const A&); };
    +boost::has_greater_equal<A>::value; // error: A::operator>=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator>=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_greater_equal<A>::value; // this is fine
    +boost::has_greater_equal<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator>= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_greater_equal.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator>=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_greater_equal< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g>=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_greater_equal< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b>=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html new file mode 100644 index 0000000000000000000000000000000000000000..33201081618f03b1848c868f240e867e3edbeb17 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift.html @@ -0,0 +1,202 @@ + + + +has_left_shift + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_left_shift : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs<<rhs, + and (ii) Ret=dont_care or the result of expression + lhs<<rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator<<. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs<<rhs); // is valid if has_left_shift<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_left_shift.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_left_shift<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_left_shift<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_left_shift<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_left_shift<long> + inherits from true_type. +

+

+ has_left_shift<int, int, int> + inherits from true_type. +

+

+ has_left_shift<const int, int> + inherits from true_type. +

+

+ has_left_shift<std::ostream, int> + inherits from true_type. +

+

+ has_left_shift<std::ostream, char*, std::ostream> + inherits from true_type. +

+

+ has_left_shift<std::ostream, std::string> + inherits from true_type. +

+

+ has_left_shift<int, double, bool> + inherits from false_type. +

+

+ has_left_shift<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator<< is public or not: if operator<< + is defined as a private member of Lhs + then instantiating has_left_shift<Lhs> will produce a compiler error. For + this reason has_left_shift + cannot be used to determine whether a type has a public operator<< + or not. +
    struct A { private: void operator<<(const A&); };
    +boost::has_left_shift<A>::value; // error: A::operator<<(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator<<(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_left_shift<A>::value; // this is fine
    +boost::has_left_shift<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator<< + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_left_shift.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator<<(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_left_shift< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g<<g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_left_shift< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b<<b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..88c2a9cc8831e4e6acd7310ba5a7ac3c6d40e71d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_left_shift_assign.html @@ -0,0 +1,190 @@ + + + +has_left_shift_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_left_shift_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs<<=rhs, + and (ii) Ret=dont_care or the result of expression + lhs<<=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator<<=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs<<=rhs); // is valid if has_left_shift_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_left_shift_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_left_shift_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_left_shift_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_left_shift_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_left_shift_assign<long> + inherits from true_type. +

+

+ has_left_shift_assign<int, int, int> + inherits from true_type. +

+

+ has_left_shift_assign<const int, int> + inherits from false_type. +

+

+ has_left_shift_assign<int, double, bool> + inherits from false_type. +

+

+ has_left_shift_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator<<= is public or not: if operator<<= + is defined as a private member of Lhs + then instantiating has_left_shift_assign<Lhs> will produce a compiler error. For + this reason has_left_shift_assign + cannot be used to determine whether a type has a public operator<<= + or not. +
    struct A { private: void operator<<=(const A&); };
    +boost::has_left_shift_assign<A>::value; // error: A::operator<<=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator<<=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_left_shift_assign<A>::value; // this is fine
    +boost::has_left_shift_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator<<= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_left_shift_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator<<=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_left_shift_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g<<=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_left_shift_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b<<=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html new file mode 100644 index 0000000000000000000000000000000000000000..abe7e94a2da905a9330d2a1a13dde26ec5157781 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_less.html @@ -0,0 +1,195 @@ + + + +has_less + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_less : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs<rhs, + and (ii) Ret=dont_care or the result of expression + lhs<rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator<. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs<rhs); // is valid if has_less<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_less.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_less<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_less<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_less<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_less<long> + inherits from true_type. +

+

+ has_less<int, int, bool> + inherits from true_type. +

+

+ has_less<int, double, bool> + inherits from true_type. +

+

+ has_less<const int> inherits from true_type. +

+

+ has_less<int*, int> inherits from false_type. +

+

+ has_less<int*, double*> inherits from false_type. +

+

+ has_less<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator< is public or not: if operator< + is defined as a private member of Lhs + then instantiating has_less<Lhs> will produce a compiler error. For + this reason has_less + cannot be used to determine whether a type has a public operator< + or not. +
    struct A { private: void operator<(const A&); };
    +boost::has_less<A>::value; // error: A::operator<(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator<(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_less<A>::value; // this is fine
    +boost::has_less<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator< + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_less.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator<(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_less< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g<g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_less< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b<b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html new file mode 100644 index 0000000000000000000000000000000000000000..cd6d4cd873c7e88bedb3c290c3d18a55934fd15f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_less_equal.html @@ -0,0 +1,195 @@ + + + +has_less_equal + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_less_equal : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs<=rhs, + and (ii) Ret=dont_care or the result of expression + lhs<=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator<=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs<=rhs); // is valid if has_less_equal<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_less_equal.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_less_equal<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_less_equal<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_less_equal<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_less_equal<long> + inherits from true_type. +

+

+ has_less_equal<int, int, bool> + inherits from true_type. +

+

+ has_less_equal<int, double, bool> + inherits from true_type. +

+

+ has_less_equal<const int> inherits from true_type. +

+

+ has_less_equal<int*, int> inherits from false_type. +

+

+ has_less_equal<int*, double*> inherits from false_type. +

+

+ has_less_equal<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator<= is public or not: if operator<= + is defined as a private member of Lhs + then instantiating has_less_equal<Lhs> will produce a compiler error. For + this reason has_less_equal + cannot be used to determine whether a type has a public operator<= + or not. +
    struct A { private: void operator<=(const A&); };
    +boost::has_less_equal<A>::value; // error: A::operator<=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator<=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_less_equal<A>::value; // this is fine
    +boost::has_less_equal<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator<= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_less_equal.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator<=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_less_equal< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g<=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_less_equal< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b<=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html new file mode 100644 index 0000000000000000000000000000000000000000..6f7ec40482cc0fc4816793f561c58808e2e1e12c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_and.html @@ -0,0 +1,193 @@ + + + +has_logical_and + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_logical_and : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs&&rhs, + and (ii) Ret=dont_care or the result of expression + lhs&&rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator&&. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs&&rhs); // is valid if has_logical_and<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_logical_and.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_logical_and<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_logical_and<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_logical_and<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_logical_and<bool> + inherits from true_type. +

+

+ has_logical_and<int, int, bool> + inherits from true_type. +

+

+ has_logical_and<int, int, long> + inherits from true_type. +

+

+ has_logical_and<int, double, bool> + inherits from true_type. +

+

+ has_logical_and<const int, int>::value inherits from true_type. +

+

+ has_logical_and<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator&& is public or not: if operator&& + is defined as a private member of Lhs + then instantiating has_logical_and<Lhs> will produce a compiler error. For + this reason has_logical_and + cannot be used to determine whether a type has a public operator&& + or not. +
    struct A { private: void operator&&(const A&); };
    +boost::has_logical_and<A>::value; // error: A::operator&&(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator&&(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_logical_and<A>::value; // this is fine
    +boost::has_logical_and<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator&& + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_logical_and.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator&&(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_logical_and< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g&&g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_logical_and< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b&&b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html new file mode 100644 index 0000000000000000000000000000000000000000..d7186aa7b54c22a66588fbbe4301a5af67e06599 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_not.html @@ -0,0 +1,193 @@ + + + +has_logical_not + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_logical_not : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression !rhs, + and (ii) Ret=dont_care or the result of expression + !rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator!. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(!rhs); // is valid if has_logical_not<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_logical_not.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_logical_not<Rhs, Ret>::value_type is the type bool. +

+

+ has_logical_not<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_logical_not<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_logical_not<bool> + inherits from true_type. +

+

+ has_logical_not<int, bool> inherits from true_type. +

+

+ has_logical_not<int, long> inherits from true_type. +

+

+ has_logical_not<double, double> + inherits from true_type. +

+

+ has_logical_not<double, bool> + inherits from true_type. +

+

+ has_logical_not<const bool> inherits from true_type. +

+

+ has_logical_not<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator! is public or not: if operator! is defined as a private member of Rhs then instantiating has_logical_not<Rhs> + will produce a compiler error. For this reason has_logical_not + cannot be used to determine whether a type has a public operator! + or not. +
    struct A { private: void operator!(); };
    +boost::has_logical_not<A>::value; // error: A::operator!() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator!(const A&);
    +struct B { operator A(); };
    +boost::has_logical_not<A>::value; // this is fine
    +boost::has_logical_not<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator! + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_logical_not.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator!(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_logical_not< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	!g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_logical_not< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	!b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html new file mode 100644 index 0000000000000000000000000000000000000000..fd6539bea5ad2c132a80762a6432c6ee87cb9599 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_logical_or.html @@ -0,0 +1,193 @@ + + + +has_logical_or + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_logical_or : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs||rhs, + and (ii) Ret=dont_care or the result of expression + lhs||rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator||. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs||rhs); // is valid if has_logical_or<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_logical_or.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_logical_or<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_logical_or<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_logical_or<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_logical_or<bool> + inherits from true_type. +

+

+ has_logical_or<int, int, bool> + inherits from true_type. +

+

+ has_logical_or<int, int, long> + inherits from true_type. +

+

+ has_logical_or<int, double, bool> + inherits from true_type. +

+

+ has_logical_or<const int, int>::value inherits from true_type. +

+

+ has_logical_or<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator|| is public or not: if operator|| + is defined as a private member of Lhs + then instantiating has_logical_or<Lhs> will produce a compiler error. For + this reason has_logical_or + cannot be used to determine whether a type has a public operator|| + or not. +
    struct A { private: void operator||(const A&); };
    +boost::has_logical_or<A>::value; // error: A::operator||(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator||(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_logical_or<A>::value; // this is fine
    +boost::has_logical_or<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator|| + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_logical_or.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator||(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_logical_or< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g||g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_logical_or< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b||b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html new file mode 100644 index 0000000000000000000000000000000000000000..938f005a4231be0f3c01f60e8a8e1527add3d8d6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_minus.html @@ -0,0 +1,194 @@ + + + +has_minus + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_minus : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs-rhs, and + (ii) Ret=dont_care or the result of expression + lhs-rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator-. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs-rhs); // is valid if has_minus<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_minus.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_minus<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_minus<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_minus<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_minus<long> + inherits from true_type. +

+

+ has_minus<int, int, int> + inherits from true_type. +

+

+ has_minus<int, int, long> + inherits from true_type. +

+

+ has_minus<int, double, double> inherits from true_type. +

+

+ has_minus<int, double, int> + inherits from true_type. +

+

+ has_minus<const int, int>::value inherits from true_type. +

+

+ has_minus<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator- is public or not: if operator- is defined as a private member of Lhs then instantiating has_minus<Lhs> + will produce a compiler error. For this reason has_minus + cannot be used to determine whether a type has a public operator- + or not. +
    struct A { private: void operator-(const A&); };
    +boost::has_minus<A>::value; // error: A::operator-(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator-(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_minus<A>::value; // this is fine
    +boost::has_minus<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator- + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_minus.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator-(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_minus< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g-g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_minus< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b-b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..b16a9ce330985ead43c0759dd3fd36191655fefb --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_minus_assign.html @@ -0,0 +1,196 @@ + + + +has_minus_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_minus_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs-=rhs, + and (ii) Ret=dont_care or the result of expression + lhs-=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator-=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs-=rhs); // is valid if has_minus_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_minus_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_minus_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_minus_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_minus_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_minus_assign<long> + inherits from true_type. +

+

+ has_minus_assign<int, int, int> + inherits from true_type. +

+

+ has_minus_assign<int, int, long> + inherits from true_type. +

+

+ has_minus_assign<int, double, double> inherits from true_type. +

+

+ has_minus_assign<int, double, int> + inherits from true_type. +

+

+ has_minus_assign<const int, int>::value inherits from false_type. +

+

+ has_minus_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator-= is public or not: if operator-= + is defined as a private member of Lhs + then instantiating has_minus_assign<Lhs> will produce a compiler error. For + this reason has_minus_assign + cannot be used to determine whether a type has a public operator-= + or not. +
    struct A { private: void operator-=(const A&); };
    +boost::has_minus_assign<A>::value; // error: A::operator-=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator-=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_minus_assign<A>::value; // this is fine
    +boost::has_minus_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator-= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_minus_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator-=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_minus_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g-=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_minus_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b-=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html new file mode 100644 index 0000000000000000000000000000000000000000..ebb0d347ac2499a62582ab87957afb67ec6ddeb2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus.html @@ -0,0 +1,187 @@ + + + +has_modulus + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_modulus : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs%rhs, and + (ii) Ret=dont_care or the result of expression + lhs%rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator%. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs%rhs); // is valid if has_modulus<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_modulus.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_modulus<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_modulus<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_modulus<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_modulus<long> + inherits from true_type. +

+

+ has_modulus<int, int, int> + inherits from true_type. +

+

+ has_modulus<int, int, long> + inherits from true_type. +

+

+ has_modulus<const int, int>::value inherits from true_type. +

+

+ has_modulus<int, double> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator% is public or not: if operator% is defined as a private member of Lhs then instantiating has_modulus<Lhs> + will produce a compiler error. For this reason has_modulus + cannot be used to determine whether a type has a public operator% + or not. +
    struct A { private: void operator%(const A&); };
    +boost::has_modulus<A>::value; // error: A::operator%(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator%(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_modulus<A>::value; // this is fine
    +boost::has_modulus<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator% + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_modulus.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator%(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_modulus< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g%g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_modulus< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b%b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..00c1098ae719b4c9b53ac0b03157d2e677383f31 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_modulus_assign.html @@ -0,0 +1,189 @@ + + + +has_modulus_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_modulus_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs%=rhs, + and (ii) Ret=dont_care or the result of expression + lhs%=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator%=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs%=rhs); // is valid if has_modulus_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_modulus_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_modulus_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_modulus_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_modulus_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_modulus_assign<long> + inherits from true_type. +

+

+ has_modulus_assign<int, int, int> + inherits from true_type. +

+

+ has_modulus_assign<int, int, long> + inherits from true_type. +

+

+ has_modulus_assign<const int, int>::value inherits from false_type. +

+

+ has_modulus_assign<int, double> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator%= is public or not: if operator%= + is defined as a private member of Lhs + then instantiating has_modulus_assign<Lhs> will produce a compiler error. For + this reason has_modulus_assign + cannot be used to determine whether a type has a public operator%= + or not. +
    struct A { private: void operator%=(const A&); };
    +boost::has_modulus_assign<A>::value; // error: A::operator%=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator%=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_modulus_assign<A>::value; // this is fine
    +boost::has_modulus_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator%= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_modulus_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator%=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_modulus_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g%=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_modulus_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b%=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html new file mode 100644 index 0000000000000000000000000000000000000000..ad73368d2ef901684ff34d20bc74e894eba97913 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies.html @@ -0,0 +1,194 @@ + + + +has_multiplies + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_multiplies : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs*rhs, and + (ii) Ret=dont_care or the result of expression + lhs*rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator*. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs*rhs); // is valid if has_multiplies<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_multiplies.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_multiplies<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_multiplies<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_multiplies<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_multiplies<long> + inherits from true_type. +

+

+ has_multiplies<int, int, int> + inherits from true_type. +

+

+ has_multiplies<int, int, long> + inherits from true_type. +

+

+ has_multiplies<int, double, double> inherits from true_type. +

+

+ has_multiplies<int, double, int> + inherits from true_type. +

+

+ has_multiplies<const int, int>::value inherits from true_type. +

+

+ has_multiplies<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator* is public or not: if operator* is defined as a private member of Lhs then instantiating has_multiplies<Lhs> + will produce a compiler error. For this reason has_multiplies + cannot be used to determine whether a type has a public operator* + or not. +
    struct A { private: void operator*(const A&); };
    +boost::has_multiplies<A>::value; // error: A::operator*(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator*(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_multiplies<A>::value; // this is fine
    +boost::has_multiplies<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator* + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_multiplies.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator*(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_multiplies< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g*g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_multiplies< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b*b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..fb90101e0d3fdd282cc595cb7c97edb142236d73 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_multiplies_assign.html @@ -0,0 +1,196 @@ + + + +has_multiplies_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_multiplies_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs*=rhs, + and (ii) Ret=dont_care or the result of expression + lhs*=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator*=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs*=rhs); // is valid if has_multiplies_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_multiplies_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_multiplies_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_multiplies_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_multiplies_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_multiplies_assign<long> + inherits from true_type. +

+

+ has_multiplies_assign<int, int, int> + inherits from true_type. +

+

+ has_multiplies_assign<int, int, long> + inherits from true_type. +

+

+ has_multiplies_assign<int, double, double> inherits from true_type. +

+

+ has_multiplies_assign<int, double, int> + inherits from true_type. +

+

+ has_multiplies_assign<const int, int>::value inherits from false_type. +

+

+ has_multiplies_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator*= is public or not: if operator*= + is defined as a private member of Lhs + then instantiating has_multiplies_assign<Lhs> will produce a compiler error. For + this reason has_multiplies_assign + cannot be used to determine whether a type has a public operator*= + or not. +
    struct A { private: void operator*=(const A&); };
    +boost::has_multiplies_assign<A>::value; // error: A::operator*=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator*=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_multiplies_assign<A>::value; // this is fine
    +boost::has_multiplies_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator*= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_multiplies_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator*=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_multiplies_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g*=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_multiplies_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b*=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html new file mode 100644 index 0000000000000000000000000000000000000000..e3869706ca2ac1898145a9d3fa6e603fa6c5bd1d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_negate.html @@ -0,0 +1,193 @@ + + + +has_negate + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_negate : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression -rhs, + and (ii) Ret=dont_care or the result of expression + -rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator-. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(-rhs); // is valid if has_negate<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_negate.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_negate<Rhs, Ret>::value_type is the type bool. +

+

+ has_negate<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_negate<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_negate<long> + inherits from true_type. +

+

+ has_negate<int, int> inherits from true_type. +

+

+ has_negate<int, long> inherits from true_type. +

+

+ has_negate<double, double> + inherits from true_type. +

+

+ has_negate<double, int> + inherits from true_type. +

+

+ has_negate<const int> inherits from true_type. +

+

+ has_negate<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator- is public or not: if operator- is defined as a private member of Rhs then instantiating has_negate<Rhs> + will produce a compiler error. For this reason has_negate + cannot be used to determine whether a type has a public operator- + or not. +
    struct A { private: void operator-(); };
    +boost::has_negate<A>::value; // error: A::operator-() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator-(const A&);
    +struct B { operator A(); };
    +boost::has_negate<A>::value; // this is fine
    +boost::has_negate<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator- + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_negate.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator-(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_negate< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	-g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_negate< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	-b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_new_operator.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_new_operator.html new file mode 100644 index 0000000000000000000000000000000000000000..d964db2a5bb0b8a07fc0a841cab071e0669ed527 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_new_operator.html @@ -0,0 +1,108 @@ + + + +has_new_operator + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_new_operator : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with an overloaded new-operator then inherits from true_type, + otherwise inherits from false_type. +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. Also known to be broken with the Borland/Codegear compilers. +

+

+ C++ Standard Reference: 12.5. +

+

+ Header: #include + <boost/type_traits/has_new_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ Given: +

+
class A { void* operator new(std::size_t); };
+class B { void* operator new(std::size_t, const std::nothrow&); };
+class C { void* operator new(std::size_t, void*); };
+class D { void* operator new[](std::size_t); };
+class E { void* operator new[](std::size_t, const std::nothrow&); };
+class F { void* operator new[](std::size_t, void*); };
+
+

+ Then: +

+

+ has_new_operator<A> + inherits from true_type. +

+

+ has_new_operator<B> + inherits from true_type. +

+

+ has_new_operator<C> + inherits from true_type. +

+

+ has_new_operator<D> + inherits from true_type. +

+

+ has_new_operator<E> + inherits from true_type. +

+

+ has_new_operator<F> + inherits from true_type. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html new file mode 100644 index 0000000000000000000000000000000000000000..59105fa9de8cf920f83bf09a3cd829ab92d80c62 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html @@ -0,0 +1,50 @@ + + + +has_nothrow_default_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html new file mode 100644 index 0000000000000000000000000000000000000000..a00c88c62271c4104eeaeb8f88df437ca3797fe7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_not_equal_to.html @@ -0,0 +1,195 @@ + + + +has_not_equal_to + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_not_equal_to : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs!=rhs, + and (ii) Ret=dont_care or the result of expression + lhs!=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator!=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs!=rhs); // is valid if has_not_equal_to<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_not_equal_to.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_not_equal_to<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_not_equal_to<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_not_equal_to<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_not_equal_to<long> + inherits from true_type. +

+

+ has_not_equal_to<int, int, bool> + inherits from true_type. +

+

+ has_not_equal_to<int, double, bool> + inherits from true_type. +

+

+ has_not_equal_to<const int> inherits from true_type. +

+

+ has_not_equal_to<int*, int> inherits from false_type. +

+

+ has_not_equal_to<int*, double*> inherits from false_type. +

+

+ has_not_equal_to<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator!= is public or not: if operator!= + is defined as a private member of Lhs + then instantiating has_not_equal_to<Lhs> will produce a compiler error. For + this reason has_not_equal_to + cannot be used to determine whether a type has a public operator!= + or not. +
    struct A { private: void operator!=(const A&); };
    +boost::has_not_equal_to<A>::value; // error: A::operator!=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator!=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_not_equal_to<A>::value; // this is fine
    +boost::has_not_equal_to<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator!= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_not_equal_to.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator!=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_not_equal_to< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g!=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_not_equal_to< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b!=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..648fa9f2a21fa16f68b31cb6733b74a9405e1078 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_assign.html @@ -0,0 +1,73 @@ + + + +has_nothrow_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_nothrow_assign : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing assignment-operator then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. Currently (June 2015) compilers more recent than Visual C++ + 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear and all recent GCC versions + have the necessary compiler intrinsics + to ensure that this trait "just works". You may test to see if + the necessary support is available by checking to see if defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) + && !defined(BOOST_NO_CXX11_NOEXCEPT)) + is true. +

+

+ Header: #include + <boost/type_traits/has_nothrow_assign.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_constructor.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_constructor.html new file mode 100644 index 0000000000000000000000000000000000000000..aa3cbfc44c8beba73000ecdde898a43dbf431605 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_constructor.html @@ -0,0 +1,79 @@ + + + +has_nothrow_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_nothrow_constructor : public true_type-or-false_type {};
+
+template <class T>
+struct has_nothrow_default_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing default-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ These two traits are synonyms for each other. +

+

+ Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. Currently (June 2015) compilers more recent than Visual C++ + 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear and all recent GCC versions + have the necessary compiler intrinsics + to ensure that this trait "just works". You may test to see if + the necessary support is available by checking to see if defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) + && !defined(BOOST_NO_CXX11_NOEXCEPT)) + is true. +

+

+ Header: #include + <boost/type_traits/has_nothrow_constructor.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_copy.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..bfc72d4c5c98f085649cf4084728c44aaf2b4642 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_copy.html @@ -0,0 +1,79 @@ + + + +has_nothrow_copy + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_nothrow_copy : public true_type-or-false_type {};
+
+template <class T>
+struct has_nothrow_copy_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing copy-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ These two traits are synonyms for each other. +

+

+ Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. Currently (June 2015) compilers more recent than Visual C++ + 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear and all recent GCC versions + have the necessary compiler intrinsics + to ensure that this trait "just works". You may test to see if + the necessary support is available by checking to see if defined(BOOST_HAS_NOTHROW_COPY) || (!defined(BOOST_NO_CXX11_DECLTYPE) + && !defined(BOOST_NO_CXX11_NOEXCEPT)) + is true. +

+

+ Header: #include + <boost/type_traits/has_nothrow_copy.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html new file mode 100644 index 0000000000000000000000000000000000000000..c8f9c7c20c8d2063243688877c2a22b007f4e80b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html @@ -0,0 +1,50 @@ + + + +has_nothrow_copy_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_destruct.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_destruct.html new file mode 100644 index 0000000000000000000000000000000000000000..2412717e0107b7d4ed027f42297ff7eed4d329b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_nothrow_destruct.html @@ -0,0 +1,79 @@ + + + +has_nothrow_destructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_nothrow_destructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing destructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. You may test to see if the necessary support is available by + checking to see if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT) is true. +

+

+ Header: #include + <boost/type_traits/has_nothrow_copy.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + + + +
[Note]Note

+ Note that destructors are assumed to be non-throwing unless they are explicitly + marked otherwise with a throw(something) specification. This is in line with the + C++11 standard. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html new file mode 100644 index 0000000000000000000000000000000000000000..08678af3c3ed46c2aec5239c70f1746f9c10b025 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_plus.html @@ -0,0 +1,194 @@ + + + +has_plus + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_plus : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs+rhs, and + (ii) Ret=dont_care or the result of expression + lhs+rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator+. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs+rhs); // is valid if has_plus<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_plus.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_plus<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_plus<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_plus<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_plus<long> + inherits from true_type. +

+

+ has_plus<int, int, int> + inherits from true_type. +

+

+ has_plus<int, int, long> + inherits from true_type. +

+

+ has_plus<int, double, double> inherits from true_type. +

+

+ has_plus<int, double, int> + inherits from true_type. +

+

+ has_plus<const int, int>::value inherits from true_type. +

+

+ has_plus<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator+ is public or not: if operator+ is defined as a private member of Lhs then instantiating has_plus<Lhs> + will produce a compiler error. For this reason has_plus + cannot be used to determine whether a type has a public operator+ + or not. +
    struct A { private: void operator+(const A&); };
    +boost::has_plus<A>::value; // error: A::operator+(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator+(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_plus<A>::value; // this is fine
    +boost::has_plus<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator+ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_plus.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator+(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_plus< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g+g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_plus< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b+b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..a91c7a473fd8137136def8d206976b1c9db5aaef --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_plus_assign.html @@ -0,0 +1,196 @@ + + + +has_plus_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_plus_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs+=rhs, + and (ii) Ret=dont_care or the result of expression + lhs+=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator+=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs+=rhs); // is valid if has_plus_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_plus_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_plus_assign<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_plus_assign<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_plus_assign<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_plus_assign<long> + inherits from true_type. +

+

+ has_plus_assign<int, int, int> + inherits from true_type. +

+

+ has_plus_assign<int, int, long> + inherits from true_type. +

+

+ has_plus_assign<int, double, double> inherits from true_type. +

+

+ has_plus_assign<int, double, int> + inherits from true_type. +

+

+ has_plus_assign<const int, int>::value inherits from false_type. +

+

+ has_plus_assign<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator+= is public or not: if operator+= + is defined as a private member of Lhs + then instantiating has_plus_assign<Lhs> will produce a compiler error. For + this reason has_plus_assign + cannot be used to determine whether a type has a public operator+= + or not. +
    struct A { private: void operator+=(const A&); };
    +boost::has_plus_assign<A>::value; // error: A::operator+=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator+=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_plus_assign<A>::value; // this is fine
    +boost::has_plus_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator+= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_plus_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator+=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_plus_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g+=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_plus_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b+=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html new file mode 100644 index 0000000000000000000000000000000000000000..f73b67e2aaf25c5befb278144fe9bf55b68f7a54 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_post_decrement.html @@ -0,0 +1,203 @@ + + + +has_post_decrement + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Ret=dont_care>
+struct has_post_decrement : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs can be used in + expression lhs--, + and (ii) Ret=dont_care or the result of expression + lhs-- + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of postfix operator--. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+f(lhs--); // is valid if has_post_decrement<Lhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_post_decrement.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_post_decrement<Lhs, Ret>::value_type is the type bool. +

+

+ has_post_decrement<Lhs, Ret>::value is a bool + integral constant expression. +

+

+ has_post_decrement<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_post_decrement<long> + inherits from true_type. +

+

+ has_post_decrement<int, int> inherits from true_type. +

+

+ has_post_decrement<int, long> inherits from true_type. +

+

+ has_post_decrement<double, double> + inherits from true_type. +

+

+ has_post_decrement<double, int> + inherits from true_type. +

+

+ has_post_decrement<bool> + inherits from false_type. +

+

+ has_post_decrement<const int> inherits from false_type. +

+

+ has_post_decrement<void*> + inherits from false_type. +

+

+ has_post_decrement<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether postfix operator-- is public or not: if operator-- + is defined as a private member of Lhs + then instantiating has_post_decrement<Lhs> will produce a compiler error. For + this reason has_post_decrement + cannot be used to determine whether a type has a public operator-- + or not. +
    struct A { private: void operator--(int); };
    +boost::has_post_decrement<A>::value; // error: A::operator--(int) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator--(const A&, int);
    +struct B { operator A(); };
    +boost::has_post_decrement<A>::value; // this is fine
    +boost::has_post_decrement<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator-- + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_post_decrement.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator--(const contains<T> &lhs, int) {
    +	return f(lhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_post_decrement< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g--; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_post_decrement< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b--; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html new file mode 100644 index 0000000000000000000000000000000000000000..2331124bf768ae7fe311172ec14006fc1eb59822 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_post_increment.html @@ -0,0 +1,203 @@ + + + +has_post_increment + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Ret=dont_care>
+struct has_post_increment : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs can be used in + expression lhs++, + and (ii) Ret=dont_care or the result of expression + lhs++ + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of postfix operator++. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+f(lhs++); // is valid if has_post_increment<Lhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_post_increment.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_post_increment<Lhs, Ret>::value_type is the type bool. +

+

+ has_post_increment<Lhs, Ret>::value is a bool + integral constant expression. +

+

+ has_post_increment<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_post_increment<long> + inherits from true_type. +

+

+ has_post_increment<int, int> inherits from true_type. +

+

+ has_post_increment<int, long> inherits from true_type. +

+

+ has_post_increment<double, double> + inherits from true_type. +

+

+ has_post_increment<double, int> + inherits from true_type. +

+

+ has_post_increment<bool> + inherits from true_type. +

+

+ has_post_increment<const int> inherits from false_type. +

+

+ has_post_increment<void*> + inherits from false_type. +

+

+ has_post_increment<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether postfix operator++ is public or not: if operator++ + is defined as a private member of Lhs + then instantiating has_post_increment<Lhs> will produce a compiler error. For + this reason has_post_increment + cannot be used to determine whether a type has a public operator++ + or not. +
    struct A { private: void operator++(int); };
    +boost::has_post_increment<A>::value; // error: A::operator++(int) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator++(const A&, int);
    +struct B { operator A(); };
    +boost::has_post_increment<A>::value; // this is fine
    +boost::has_post_increment<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator++ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_post_increment.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator++(const contains<T> &lhs, int) {
    +	return f(lhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_post_increment< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g++; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_post_increment< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b++; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html new file mode 100644 index 0000000000000000000000000000000000000000..5bcda060bca82deb72357337a24f999348c53bfd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_decrement.html @@ -0,0 +1,203 @@ + + + +has_pre_decrement + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_pre_decrement : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression --rhs, + and (ii) Ret=dont_care or the result of expression + --rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator--. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(--rhs); // is valid if has_pre_decrement<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_pre_decrement.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_pre_decrement<Rhs, Ret>::value_type is the type bool. +

+

+ has_pre_decrement<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_pre_decrement<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_pre_decrement<long> + inherits from true_type. +

+

+ has_pre_decrement<int, int> inherits from true_type. +

+

+ has_pre_decrement<int, long> inherits from true_type. +

+

+ has_pre_decrement<double, double> + inherits from true_type. +

+

+ has_pre_decrement<double, int> + inherits from true_type. +

+

+ has_pre_decrement<bool> + inherits from false_type. +

+

+ has_pre_decrement<const int> inherits from false_type. +

+

+ has_pre_decrement<void*> + inherits from false_type. +

+

+ has_pre_decrement<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator-- is public or not: if operator-- + is defined as a private member of Rhs + then instantiating has_pre_decrement<Rhs> will produce a compiler error. For + this reason has_pre_decrement + cannot be used to determine whether a type has a public operator-- + or not. +
    struct A { private: void operator--(); };
    +boost::has_pre_decrement<A>::value; // error: A::operator--() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator--(const A&);
    +struct B { operator A(); };
    +boost::has_pre_decrement<A>::value; // this is fine
    +boost::has_pre_decrement<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator-- + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_pre_decrement.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator--(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_pre_decrement< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	--g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_pre_decrement< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	--b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html new file mode 100644 index 0000000000000000000000000000000000000000..b4ab7d301b2ea4cd26a4a41a279eb34ec3cd4757 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_pre_increment.html @@ -0,0 +1,203 @@ + + + +has_pre_increment + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_pre_increment : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression ++rhs, + and (ii) Ret=dont_care or the result of expression + ++rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator++. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(++rhs); // is valid if has_pre_increment<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_pre_increment.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_pre_increment<Rhs, Ret>::value_type is the type bool. +

+

+ has_pre_increment<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_pre_increment<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_pre_increment<long> + inherits from true_type. +

+

+ has_pre_increment<int, int> inherits from true_type. +

+

+ has_pre_increment<int, long> inherits from true_type. +

+

+ has_pre_increment<double, double> + inherits from true_type. +

+

+ has_pre_increment<double, int> + inherits from true_type. +

+

+ has_pre_increment<bool> + inherits from true_type. +

+

+ has_pre_increment<const int> inherits from false_type. +

+

+ has_pre_increment<void*> + inherits from false_type. +

+

+ has_pre_increment<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator++ is public or not: if operator++ + is defined as a private member of Rhs + then instantiating has_pre_increment<Rhs> will produce a compiler error. For + this reason has_pre_increment + cannot be used to determine whether a type has a public operator++ + or not. +
    struct A { private: void operator++(); };
    +boost::has_pre_increment<A>::value; // error: A::operator++() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator++(const A&);
    +struct B { operator A(); };
    +boost::has_pre_increment<A>::value; // this is fine
    +boost::has_pre_increment<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator++ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_pre_increment.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator++(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_pre_increment< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	++g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_pre_increment< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	++b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html new file mode 100644 index 0000000000000000000000000000000000000000..03dc921ce986ec260e90288d443daee464c40ff5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift.html @@ -0,0 +1,202 @@ + + + +has_right_shift + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_right_shift : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs>>rhs, + and (ii) Ret=dont_care or the result of expression + lhs>>rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator>>. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs>>rhs); // is valid if has_right_shift<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_right_shift.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_right_shift<Lhs, Rhs, Ret>::value_type is the type bool. +

+

+ has_right_shift<Lhs, Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_right_shift<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_right_shift<long> + inherits from true_type. +

+

+ has_right_shift<int, int, int> + inherits from true_type. +

+

+ has_right_shift<const int, int> + inherits from true_type. +

+

+ has_right_shift<std::istream, int&> + inherits from true_type. +

+

+ has_right_shift<std::istream, char*, std::ostream> + inherits from true_type. +

+

+ has_right_shift<std::istream, std::string&> + inherits from true_type. +

+

+ has_right_shift<int, double, bool> + inherits from false_type. +

+

+ has_right_shift<int, int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator>> is public or not: if operator>> + is defined as a private member of Lhs + then instantiating has_right_shift<Lhs> will produce a compiler error. For + this reason has_right_shift + cannot be used to determine whether a type has a public operator>> + or not. +
    struct A { private: void operator>>(const A&); };
    +boost::has_right_shift<A>::value; // error: A::operator>>(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator>>(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_right_shift<A>::value; // this is fine
    +boost::has_right_shift<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator>> + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_right_shift.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator>>(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_right_shift< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g>>g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_right_shift< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b>>b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..357d5a47f0f682fa7ec2dc0a7b151bead5a6d553 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_right_shift_assign.html @@ -0,0 +1,194 @@ + + + +has_right_shift_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
+struct has_right_shift_assign : public true_type-or-false_type {};
+
+

+ Inherits: If (i) lhs + of type Lhs and rhs of type Rhs + can be used in expression lhs>>=rhs, + and (ii) Ret=dont_care or the result of expression + lhs>>=rhs is convertible to Ret + then inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of binary operator>>=. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Lhs lhs;
+Rhs rhs;
+f(lhs>>=rhs); // is valid if has_right_shift_assign<Lhs, Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_right_shift_assign.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_right_shift_assign<Lhs, Rhs, Ret>::value_type + is the type bool. +

+

+ has_right_shift_assign<Lhs, Rhs, Ret>::value + is a bool integral constant + expression. +

+

+ has_right_shift_assign<int>::value + is a bool integral constant + expression that evaluates to true. +

+

+ has_right_shift_assign<long> inherits from true_type. +

+

+ has_right_shift_assign<int, int, + int> + inherits from true_type. +

+

+ has_right_shift_assign<const int, int> inherits from false_type. +

+

+ has_right_shift_assign<int, double, bool> + inherits from false_type. +

+

+ has_right_shift_assign<int, int, + std::string> + inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether binary operator>>= is public or not: if operator>>= + is defined as a private member of Lhs + then instantiating has_right_shift_assign<Lhs> will produce a compiler error. For + this reason has_right_shift_assign + cannot be used to determine whether a type has a public operator>>= + or not. +
    struct A { private: void operator>>=(const A&); };
    +boost::has_right_shift_assign<A>::value; // error: A::operator>>=(const A&) is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator>>=(const A&, const A&);
    +struct B { operator A(); };
    +boost::has_right_shift_assign<A>::value; // this is fine
    +boost::has_right_shift_assign<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator>>= + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_right_shift_assign.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator>>=(const contains<T> &lhs, const contains<T> &rhs) {
    +	return f(lhs.data, rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&, const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_right_shift_assign< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	g>>=g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_right_shift_assign< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	b>>=b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..070c45b1bb31a997e9c0a33fb06cef243a98123b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_assign.html @@ -0,0 +1,102 @@ + + + +has_trivial_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_trivial_assign : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial assignment-operator then inherits from true_type, + otherwise inherits from false_type. +

+

+ If a type has a trivial assignment-operator then the operator has the same + effect as copying the bits of one object to the other: calls to the operator + can be safely replaced with a call to memcpy. +

+

+ Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_assign will never report + that a user-defined class or struct has a trivial constructor; this is always + safe, if possibly sub-optimal. In order to correctly handle deleted or private + assignment operators, the compiler must also support C++11's decltype. Currently (May 2015) compilers more + recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_ASSIGN + is defined. +

+

+ C++ Standard Reference: 12.8p11. +

+

+ Header: #include + <boost/type_traits/has_trivial_assign.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_trivial_assign<int> + inherits from true_type. +

+

+ has_trivial_assign<char*>::type is the type true_type. +

+

+ has_trivial_assign<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+ has_trivial_assign<MyClass>::value is an integral constant expression + that evaluates to false. +

+

+ has_trivial_assign<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_constructor.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_constructor.html new file mode 100644 index 0000000000000000000000000000000000000000..4fc94ffbc6ba806b16ffddddb6137e36dd0cb005 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_constructor.html @@ -0,0 +1,111 @@ + + + +has_trivial_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_trivial_constructor : public true_type-or-false_type {};
+
+template <class T>
+struct has_trivial_default_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial default-constructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ These two traits are synonyms for each other. +

+

+ If a type has a trivial default-constructor then the constructor have no + effect: calls to the constructor can be safely omitted. Note that using meta-programming + to omit a call to a single trivial-constructor call is of no benefit whatsoever. + However, if loops and/or exception handling code can also be omitted, then + some benefit in terms of code size and speed can be obtained. +

+

+ Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_constructor will never + report that a user-defined class or struct has a trivial constructor; this + is always safe, if possibly sub-optimal. In addition, in order to correctly + handle private or deleted default-constructors then C++11's deltype is required. Currently (May 2015) + compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, + and Codegear have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_CONSTRUCTOR + is defined. +

+

+ C++ Standard Reference: 12.1p6. +

+

+ Header: #include + <boost/type_traits/has_trivial_constructor.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_trivial_constructor<int> inherits from true_type. +

+

+ has_trivial_constructor<char*>::type + is the type true_type. +

+

+ has_trivial_constructor<int (*)(long)>::value + is an integral constant expression that evaluates to true. +

+

+ has_trivial_constructor<MyClass>::value + is an integral constant expression that evaluates to false. +

+

+ has_trivial_constructor<T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_copy.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..df7592d5d6f5653c8d2223cbf39b054b0eb0bb36 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_copy.html @@ -0,0 +1,109 @@ + + + +has_trivial_copy + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_trivial_copy : public true_type-or-false_type {};
+
+template <class T>
+struct has_trivial_copy_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial copy-constructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ These two traits are synonyms for each other. +

+

+ If a type has a trivial copy-constructor then the constructor has the same + effect as copying the bits of one object to the other: calls to the constructor + can be safely replaced with a call to memcpy. +

+

+ Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_copy will never report + that a user-defined class or struct has a trivial constructor; this is always + safe, if possibly sub-optimal. In addition, in order to correctly handle + deleted or private copy-constructors then C++11's dectype + is required. Currently (May 2015) compilers more recent than Visual C++ 8, + GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler + intrinsics to ensure that + this trait "just works". You may also test to see if the necessary + intrinsics are available + by checking to see if the macro BOOST_HAS_TRIVIAL_COPY + is defined. +

+

+ C++ Standard Reference: 12.8p6. +

+

+ Header: #include + <boost/type_traits/has_trivial_copy.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_trivial_copy<int> + inherits from true_type. +

+

+ has_trivial_copy<char*>::type is the type true_type. +

+

+ has_trivial_copy<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+ has_trivial_copy<MyClass>::value is an integral constant expression + that evaluates to false. +

+

+ has_trivial_copy<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html new file mode 100644 index 0000000000000000000000000000000000000000..170c92adafda4b0f2e4e91b57cea55d782a2c059 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html @@ -0,0 +1,50 @@ + + + +has_trivial_copy_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_def_cons.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_def_cons.html new file mode 100644 index 0000000000000000000000000000000000000000..33426acbe902d7d86260db68df8d140ad01e994d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_def_cons.html @@ -0,0 +1,50 @@ + + + +has_trivial_default_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_destructor.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_destructor.html new file mode 100644 index 0000000000000000000000000000000000000000..3e3fafb1902b16eaffcd74b4d6214562c8a293b9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_destructor.html @@ -0,0 +1,105 @@ + + + +has_trivial_destructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_trivial_destructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial destructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ If a type has a trivial destructor then the destructor has no effect: calls + to the destructor can be safely omitted. Note that using meta-programming + to omit a call to a single trivial-constructor call is of no benefit whatsoever. + However, if loops and/or exception handling code can also be omitted, then + some benefit in terms of code size and speed can be obtained. +

+

+ Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_destructor will never + report that a user-defined class or struct has a trivial destructor; this + is always safe, if possibly sub-optimal. In addition, in order to correctly + handle deleted or private destructors then support for C++11's decltype is required. Currently (June 2015) + compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, + and Codegear have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_DESTRUCTOR + is defined. +

+

+ C++ Standard Reference: 12.4p3. +

+

+ Header: #include + <boost/type_traits/has_trivial_destructor.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_trivial_destructor<int> inherits from true_type. +

+

+ has_trivial_destructor<char*>::type + is the type true_type. +

+

+ has_trivial_destructor<int (*)(long)>::value + is an integral constant expression that evaluates to true. +

+

+ has_trivial_destructor<MyClass>::value + is an integral constant expression that evaluates to false. +

+

+ has_trivial_destructor<T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_move_assign.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_move_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..0d63187d6f85656b272b6510bbc377bb2202d85b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_move_assign.html @@ -0,0 +1,99 @@ + + + +has_trivial_move_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_trivial_move_assign : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial move assignment-operator then inherits from true_type, + otherwise inherits from false_type. +

+

+ If a type has a trivial move assignment-operator then the operator has the + same effect as copying the bits of one object to the other: calls to the + operator can be safely replaced with a call to memcpy. +

+

+ Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_move_assign will never + report that a user-defined class or struct has a trivial move assign; this + is always safe, if possibly sub-optimal. In addition, in order to correctly + handle private or deleted move assignment operators then c++11's decltype is required. Currently (June 2015) + compilers that have the necessary intrinsics + to ensure that this trait "just works" include Clang, GCC-5.1 and + MSVC-12.0. You may also test to see if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_MOVE_ASSIGN + is defined. +

+

+ Header: #include + <boost/type_traits/has_trivial_move_assign.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_trivial_move_assign<int> inherits from true_type. +

+

+ has_trivial_move_assign<char*>::type + is the type true_type. +

+

+ has_trivial_move_assign<int (*)(long)>::value + is an integral constant expression that evaluates to true. +

+

+ has_trivial_move_assign<MyClass>::value + is an integral constant expression that evaluates to false. +

+

+ has_trivial_move_assign<T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html new file mode 100644 index 0000000000000000000000000000000000000000..381523ac9cd05d1d97c45adc0625f42da5f6d7fb --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html @@ -0,0 +1,99 @@ + + + +has_trivial_move_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_trivial_move_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial move-constructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ If a type has a trivial move-constructor then the constructor has the same + effect as copying the bits of one object to the other: calls to the constructor + can be safely replaced with a call to memcpy. +

+

+ Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_move_constructor will + never report that a user-defined class or struct has a trivial constructor; + this is always safe, if possibly sub-optimal. In addition C++11's decltype is required to correctly support + deleted or private move constructors. Currently (June 2015) compilers that + have the necessary intrinsics + to ensure that this trait "just works" include Clang, GCC-5.1, + and MSVC-12.0. You may also test to see if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR + is defined. +

+

+ Header: #include + <boost/type_traits/has_trivial_move_constructor.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ has_trivial_move_constructor<int> inherits from true_type. +

+

+ has_trivial_move_constructor<char*>::type + is the type true_type. +

+

+ has_trivial_move_constructor<int (*)(long)>::value + is an integral constant expression that evaluates to true. +

+

+ has_trivial_move_constructor<MyClass>::value + is an integral constant expression that evaluates to false. +

+

+ has_trivial_move_constructor<T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html new file mode 100644 index 0000000000000000000000000000000000000000..a2301a362506955169c88b27c638e5c16c6b7993 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_minus.html @@ -0,0 +1,193 @@ + + + +has_unary_minus + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_unary_minus : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression -rhs, + and (ii) Ret=dont_care or the result of expression + -rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator-. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(-rhs); // is valid if has_unary_minus<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_unary_minus.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_unary_minus<Rhs, Ret>::value_type is the type bool. +

+

+ has_unary_minus<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_unary_minus<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_unary_minus<long> + inherits from true_type. +

+

+ has_unary_minus<int, int> inherits from true_type. +

+

+ has_unary_minus<int, long> inherits from true_type. +

+

+ has_unary_minus<double, double> + inherits from true_type. +

+

+ has_unary_minus<double, int> + inherits from true_type. +

+

+ has_unary_minus<const int> inherits from true_type. +

+

+ has_unary_minus<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator- is public or not: if operator- is defined as a private member of Rhs then instantiating has_unary_minus<Rhs> + will produce a compiler error. For this reason has_unary_minus + cannot be used to determine whether a type has a public operator- + or not. +
    struct A { private: void operator-(); };
    +boost::has_unary_minus<A>::value; // error: A::operator-() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator-(const A&);
    +struct B { operator A(); };
    +boost::has_unary_minus<A>::value; // this is fine
    +boost::has_unary_minus<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator- + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_unary_minus.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator-(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_unary_minus< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	-g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_unary_minus< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	-b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html new file mode 100644 index 0000000000000000000000000000000000000000..48be41f117a2a07b5a58e174c76ad7130316f644 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_unary_plus.html @@ -0,0 +1,193 @@ + + + +has_unary_plus + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Rhs, class Ret=dont_care>
+struct has_unary_plus : public true_type-or-false_type {};
+
+

+ Inherits: If (i) rhs + of type Rhs can be used in + expression +rhs, + and (ii) Ret=dont_care or the result of expression + +rhs + is convertible to Ret then + inherits from true_type, + otherwise inherits from false_type. +

+

+ The default behaviour (Ret=dont_care) + is to not check for the return value of prefix operator+. If Ret + is different from the default dont_care + type, the return value is checked to be convertible to Ret. + Convertible to Ret means + that the return value of the operator can be used as argument to a function + expecting Ret: +

+
void f(Ret);
+Rhs rhs;
+f(+rhs); // is valid if has_unary_plus<Rhs, Ret>::value==true
+
+

+ If Ret=void, the return type is checked to be exactly + void. +

+

+ Header: #include + <boost/type_traits/has_unary_plus.hpp> + or #include <boost/type_traits/has_operator.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

+

+ Examples: +

+

+ has_unary_plus<Rhs, Ret>::value_type is the type bool. +

+

+ has_unary_plus<Rhs, Ret>::value is a bool + integral constant expression. +

+

+ has_unary_plus<int>::value is a bool + integral constant expression that evaluates to true. +

+

+ has_unary_plus<long> + inherits from true_type. +

+

+ has_unary_plus<int, int> inherits from true_type. +

+

+ has_unary_plus<int, long> inherits from true_type. +

+

+ has_unary_plus<double, double> + inherits from true_type. +

+

+ has_unary_plus<double, int> + inherits from true_type. +

+

+ has_unary_plus<const int> inherits from true_type. +

+

+ has_unary_plus<int, std::string> inherits from false_type. +

+

+ See also: Operator + Type Traits +

+

+ Known issues: +

+
    +
  • + This trait cannot detect whether prefix operator+ is public or not: if operator+ is defined as a private member of Rhs then instantiating has_unary_plus<Rhs> + will produce a compiler error. For this reason has_unary_plus + cannot be used to determine whether a type has a public operator+ + or not. +
    struct A { private: void operator+(); };
    +boost::has_unary_plus<A>::value; // error: A::operator+() is private
    +
    +
  • +
  • + There is an issue if the operator exists only for type A and B + is convertible to A. + In this case, the compiler will report an ambiguous overload. +
    struct A { };
    +void operator+(const A&);
    +struct B { operator A(); };
    +boost::has_unary_plus<A>::value; // this is fine
    +boost::has_unary_plus<B>::value; // error: ambiguous overload
    +
    +
  • +
  • + There is an issue when applying this trait to template classes. If operator+ + is defined but does not bind for a given template type, it is still detected + by the trait which returns true + instead of false. Example: +
    #include <boost/type_traits/has_unary_plus.hpp>
    +#include <iostream>
    +
    +template <class T>
    +struct contains { T data; };
    +
    +template <class T>
    +bool operator+(const contains<T> &rhs) {
    +	return f(rhs.data);
    +}
    +
    +class bad { };
    +class good { };
    +bool f(const good&) { }
    +
    +int main() {
    +	std::cout<<std::boolalpha;
    +	// works fine for contains<good>
    +	std::cout<<boost::has_unary_plus< contains< good > >::value<<'\n'; // true
    +	contains<good> g;
    +	+g; // ok
    +	// does not work for contains<bad>
    +	std::cout<<boost::has_unary_plus< contains< bad > >::value<<'\n'; // true, should be false
    +	contains<bad> b;
    +	+b; // compile time error
    +	return 0;
    +}
    +
    +
  • +
  • + volatile qualifier is not + properly handled and would lead to undefined behavior +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_virtual_destructor.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_virtual_destructor.html new file mode 100644 index 0000000000000000000000000000000000000000..3e35e2215ef53acb6f97a68b44414138c127b4ea --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/has_virtual_destructor.html @@ -0,0 +1,77 @@ + + + +has_virtual_destructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct has_virtual_destructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a virtual destructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ Compiler Compatibility: There is currently + no way to portably implement this trait: the default version always inherits + from false_type, + and has to be explicitly specialized for types with virtual destructors unless + the compiler used has compiler intrinsics + that enable the trait to do the right thing: Currently (June 2015) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, plus + Codegear and Clang have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_VIRTUAL_DESTRUCTOR + is defined. +

+

+ C++ Standard Reference: 12.4. +

+

+ Header: #include + <boost/type_traits/has_virtual_destructor.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/integral_constant.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/integral_constant.html new file mode 100644 index 0000000000000000000000000000000000000000..efebe873ba9dde2a261ba4c3acdd804900ac8658 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/integral_constant.html @@ -0,0 +1,66 @@ + + + +integral_constant + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T, T val>
+struct integral_constant
+{
+   typedef integral_constant<T, val>  type;
+   typedef T                          value_type;
+   static const T value = val;
+   constexpr operator T()const;
+};
+
+typedef integral_constant<bool, true>  true_type;
+typedef integral_constant<bool, false> false_type;
+
+

+ Class template integral_constant + is the common base class for all the value-based type traits. The two typedef's + true_type and false_type are provided for convenience: + most of the value traits are Boolean properties and so will inherit from + one of these. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/integral_promotion.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/integral_promotion.html new file mode 100644 index 0000000000000000000000000000000000000000..59ff44bf7d971d84497b3e25d7337e151b07d571 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/integral_promotion.html @@ -0,0 +1,133 @@ + + + +integral_promotion + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct integral_promotion
+{
+   typedef see-below type;
+};
+
+template <class T> using integral_promotion_t = typename integral_promotion<T>::type; // C++11 and above
+
+

+ type: If integral promotion can be applied + to an rvalue of type T, then + applies integral promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. +

+

+ C++ Standard Reference: 4.5 except 4.5/3 + (integral bit-field). +

+

+ Header: #include + <boost/type_traits/integral_promotion.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.22. Examples

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Result Type +

+
+

+ integral_promotion<short + const>::type +

+
+

+ int const +

+
+

+ integral_promotion<short&>::type +

+
+

+ short& +

+
+

+ integral_promotion<enum + std::float_round_style>::type +

+
+

+ int +

+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_abstract.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_abstract.html new file mode 100644 index 0000000000000000000000000000000000000000..9b6f4c3389802decae25cdc2666ad2b5090886b3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_abstract.html @@ -0,0 +1,93 @@ + + + +is_abstract + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_abstract : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + abstract type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 10.3. +

+

+ Header: #include + <boost/type_traits/is_abstract.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: The compiler must + support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), Intel C++ + 7 (and later), and Comeau 4.3.2). Otherwise behaves the same as is_polymorphic; + this is the "safe fallback position" for which polymorphic types + are always regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT + is used to signify that the implementation is buggy, users should check for + this in their own code if the "safe fallback" is not suitable for + their particular use-case. +

+

+ Examples: +

+

+ Given: class abc{ virtual ~abc() = 0; }; +

+

+ is_abstract<abc> + inherits from true_type. +

+

+ is_abstract<abc>::type is the type true_type. +

+

+ is_abstract<abc const>::value + is an integral constant expression that evaluates to true. +

+

+ is_abstract<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_arithmetic.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_arithmetic.html new file mode 100644 index 0000000000000000000000000000000000000000..5b7e7352480ff1ef222a4b584adbde73b833e0a5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_arithmetic.html @@ -0,0 +1,82 @@ + + + +is_arithmetic + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_arithmetic : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + arithmetic type then inherits from true_type, + otherwise inherits from false_type. + Arithmetic types include integral and floating point types (see also is_integral and + is_floating_point). +

+

+ C++ Standard Reference: 3.9.1p8. +

+

+ Header: #include + <boost/type_traits/is_arithmetic.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_arithmetic<int> + inherits from true_type. +

+

+ is_arithmetic<char>::type is the type true_type. +

+

+ is_arithmetic<double>::value is an integral constant expression + that evaluates to true. +

+

+ is_arithmetic<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_array.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_array.html new file mode 100644 index 0000000000000000000000000000000000000000..561e6f9d212ee75996bbc7abd29a0be5ab27ab0b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_array.html @@ -0,0 +1,83 @@ + + + +is_array + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_array : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + array type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.4. +

+

+ Header: #include + <boost/type_traits/is_array.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Examples: +

+

+ is_array<int[2]> inherits from true_type. +

+

+ is_array<char[2][3]>::type is the type true_type. +

+

+ is_array<double[]>::value is an integral constant expression + that evaluates to true. +

+

+ is_array<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_assignable.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_assignable.html new file mode 100644 index 0000000000000000000000000000000000000000..96333632726dfddede79e35b7548979562ba610e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_assignable.html @@ -0,0 +1,92 @@ + + + +is_assignable + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T, class U>
+struct is_assignable : public true_type-or-false_type {};
+
+

+ Inherits: If std::declval<T>() + = std::declval<U>() + then inherits from true_type, + otherwise from __flase_type. Type T + must be a complete type. +

+

+ Note that this trait is somewhat tricky to use correctly: for example: +

+
is_assignable<int, int>::value
+
+

+ is false since std::declval<int>() + is an xvalue which can not be assigned to! +

+

+ If you're intention is to check for copy-assignment from some type U then + use: +

+
is_assignable<T&, const U&>::value
+
+

+ If you're intention is to check for move-assignment then use: +

+
is_assignable<T&, U&&>::value
+
+

+ or simply: +

+
is_assignable<T&, U>::value
+
+

+ Compiler Compatibility: Requires the C++11 + features decltype and SFINAE-expressions + for full support. +

+

+ Header: #include + <boost/type_traits/is_assignable.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_base_of.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_base_of.html new file mode 100644 index 0000000000000000000000000000000000000000..e36708de5b68c57df95f1a8e2d96e2e9ba393d04 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_base_of.html @@ -0,0 +1,107 @@ + + + +is_base_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class Base, class Derived>
+struct is_base_of : public true_type-or-false_type {};
+
+

+ Inherits: If Base is base class of type + Derived or if both types are the same class type then inherits from true_type, + otherwise inherits from false_type. +

+

+ This template will detect non-public base classes, and ambiguous base classes. + It also detects indirect base classes - which is to say is_base_of<B, + D> inherits from true_type + if B is located anywhere in the inheritance tree of D. +

+

+ Note that is_base_of<X,X> will inherit from true_type + if X is a class type. This is a change in behaviour from Boost-1.39.0 in + order to track the emerging C++0x standard. +

+

+ Types Base and Derived must not be incomplete types. +

+

+ C++ Standard Reference: 10. +

+

+ Header: #include + <boost/type_traits/is_base_of.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Examples: +

+

+ Given: class Base{}; class Derived : public Base{}; +

+

+ is_base_of<Base, Derived> + inherits from true_type. +

+

+ is_base_of<Base, Derived>::type is the type true_type. +

+

+ is_base_of<Base, Derived>::value is an integral constant expression + that evaluates to true. +

+

+ is_base_of<Base, Base>::value is an integral constant expression + that evaluates to true: a class is regarded as it's + own base. +

+

+ is_base_of<T, T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_class.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_class.html new file mode 100644 index 0000000000000000000000000000000000000000..b053753a44ea3f5f2064a4572f6eb73e164d9d24 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_class.html @@ -0,0 +1,99 @@ + + + +is_class + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_class : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + class type (and not a union type) then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 9.2. +

+

+ Header: #include + <boost/type_traits/is_class.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: This trait works + correctly for almost all current compilers (as of June 2015), with just a + minority of older compilers not correctly detecting all the corner cases. + You can check the macro BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + which is defined to 1 when the class works correctly in all cases. +

+

+ Examples: +

+

+ Given: class MyClass; then: +

+

+ is_class<MyClass> + inherits from true_type. +

+

+ is_class<MyClass const>::type + is the type true_type. +

+

+ is_class<MyClass>::value is an integral constant expression + that evaluates to true. +

+

+ is_class<MyClass&>::value is an integral constant expression + that evaluates to false. +

+

+ is_class<MyClass*>::value is an integral constant expression + that evaluates to false. +

+

+ is_class<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_complex.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_complex.html new file mode 100644 index 0000000000000000000000000000000000000000..b402d25c67ac1b9f2938ef79a96d9bef42a0e20e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_complex.html @@ -0,0 +1,68 @@ + + + +is_complex + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_complex : public true_type-or-false_type {};
+
+

+ Inherits: If T + is a complex number type then true (of type std::complex<U> + for some type U), otherwise + false. +

+

+ C++ Standard Reference: 26.2. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_complex.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_compound.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_compound.html new file mode 100644 index 0000000000000000000000000000000000000000..22e6abfaa2b027cc06fec7ed9ea84aa248a5aed4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_compound.html @@ -0,0 +1,93 @@ + + + +is_compound + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_compound : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + compound type then inherits from true_type, + otherwise inherits from false_type. + Any type that is not a fundamental type is a compound type (see also is_fundamental). +

+

+ C++ Standard Reference: 3.9.2. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_compound.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_compound<MyClass> + inherits from true_type. +

+

+ is_compound<MyEnum>::type is the type true_type. +

+

+ is_compound<int*>::value is an integral constant expression + that evaluates to true. +

+

+ is_compound<int&>::value is an integral constant expression + that evaluates to true. +

+

+ is_compound<int>::value is an integral constant expression + that evaluates to false. +

+

+ is_compound<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_const.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_const.html new file mode 100644 index 0000000000000000000000000000000000000000..69b9cfc3fa24c3e660fa002f0bbd21213262ab9c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_const.html @@ -0,0 +1,97 @@ + + + +is_const + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_const : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (top level) const-qualified + type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Header: #include + <boost/type_traits/is_const.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Examples: +

+

+ is_const<int const> inherits from true_type. +

+

+ is_const<int const volatile>::type is the type true_type. +

+

+ is_const<int* const>::value + is an integral constant expression that evaluates to true. +

+

+ is_const<int const*>::value + is an integral constant expression that evaluates to false: + the const-qualifier is not at the top level in this case. +

+

+ is_const<int const&>::value + is an integral constant expression that evaluates to false: + the const-qualifier is not at the top level in this case. +

+

+ is_const<int>::value is an integral constant expression + that evaluates to false. +

+

+ is_const<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_constructible.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_constructible.html new file mode 100644 index 0000000000000000000000000000000000000000..f1398f86fb8cb7f5c0f6cc81fe84acc8fd43dac4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_constructible.html @@ -0,0 +1,98 @@ + + + +is_constructible + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T, class... Args>
+struct is_constructible : public true_type-or-false_type {};
+
+

+ Inherits: If T + can be constructed from Args, + then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ Formally the trait answers the question, is the expression: +

+
T t(std::declval<Args>()...);
+
+

+ valid? +

+

+ There are a number of important special cases for this trait: +

+
is_constructible<T>::value
+
+

+ Indicates whether T is default + constructible, while: +

+
is_constructible<T, const T&>::value
+
+

+ Indicates whether T is copy-constructible, + and: +

+
is_constructible<T, T>::value
+
+

+ Indicates whether T is move-constructible. +

+

+ Compiler Compatibility: This trait requires + the C++11 features decltype + variadic templates and SFINAE-expression support for full support. While + there is some fallback code for cases where this is not the case, the trait + should really be considered broken in that case. +

+

+ Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_convertible.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_convertible.html new file mode 100644 index 0000000000000000000000000000000000000000..6441b649679e2592ad06d266ca69b7931844cd73 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_convertible.html @@ -0,0 +1,129 @@ + + + +is_convertible + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class From, class To>
+struct is_convertible : public true_type-or-false_type {};
+
+

+ Inherits: If an imaginary rvalue of type + From is convertible to type + To then inherits from true_type, + otherwise inherits from false_type. +

+

+ Type From must not be an incomplete type. +

+

+ Type To must not be an incomplete, or function type. +

+

+ No types are considered to be convertible to array types or abstract-class + types. +

+

+ This template can not detect whether a converting-constructor is public or not: if type To + has a private converting constructor + from type From then instantiating + is_convertible<From, To> + will produce a compiler error. For this reason is_convertible + can not be used to determine whether a type has a public + copy-constructor or not. +

+

+ This template will also produce compiler errors if the conversion is ambiguous, + for example: +

+
struct A {};
+struct B : A {};
+struct C : A {};
+struct D : B, C {};
+// This produces a compiler error, the conversion is ambiguous:
+bool const y = boost::is_convertible<D*,A*>::value;
+
+

+ C++ Standard Reference: 4 and 8.5. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_convertible.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_convertible<int, double> inherits from true_type. +

+

+ is_convertible<const int, double>::type + is the type true_type. +

+

+ is_convertible<int* const, int*>::value is an integral constant expression + that evaluates to true. +

+

+ is_convertible<int const*, int*>::value is an integral constant expression + that evaluates to false: the conversion would require + a const_cast. +

+

+ is_convertible<int const&, long>::value + is an integral constant expression that evaluates to true. +

+

+ is_convertible<int, int>::value + is an integral constant expression that evaluates to true. +

+

+ is_convertible<T, T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_copy_assignable.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_copy_assignable.html new file mode 100644 index 0000000000000000000000000000000000000000..10463c128d19d99905c671fcb418667b41c082e8 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_copy_assignable.html @@ -0,0 +1,106 @@ + + + +is_copy_assignable + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_copy_assignable : public true_type-or-false_type {};
+
+

+ Inherits: If T + is CopyAssignable (i.e. has + an accessible explicit or implicit copy assignment operator), then inherits + from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ In other words, inherits from true_type + only if copy assignment of T + from const T + & is not marked with = delete, + T does not derives from + boost::noncopyable and is not marked with BOOST_MOVABLE_BUT_NOT_COPYABLE(T). +

+

+ Compiler Compatibility: Requires the C++11 + features decltype and SFINAE-expressions + for full support. +

+

+ If your compiler does not support C++11 deleted functions (= delete) + or does not support SFINAE for the deleted assignments, then derive your + classes from boost::noncopyable or mark them with BOOST_MOVABLE_BUT_NOT_COPYABLE(T) to show + that class is non-assignable. +

+

+ Trait does not care about access modifiers, so if you see errors like this: +

+
'T::operator=(const T&)' is private
+boost/type_traits/is_copy_assignable.hpp:68:5: error: within this context
+
+

+ then you are trying to call that macro for a structure with private assignment: +

+
struct T {
+    // ...
+private:
+    T &operator=(const T &);
+    // ...
+};
+
+

+ To fix that you must modify your structure, explicitly marking it as noncopyable + (= delete, + boost::noncopyable or BOOST_MOVABLE_BUT_NOT_COPYABLE(T)) + or explicitly specializing + the trait. +

+

+ Header: #include + <boost/type_traits/is_copy_assignable.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_copy_constructible.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_copy_constructible.html new file mode 100644 index 0000000000000000000000000000000000000000..fa750dbd3a9630bbc802cf6b6c2260367de53f9c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_copy_constructible.html @@ -0,0 +1,104 @@ + + + +is_copy_constructible + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_copy_constructible : public true_type-or-false_type {};
+
+

+ Inherits: If T + is a (possibly cv-qualified) type with a copy constructor, then inherits + from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ In other words, inherits from true_type + only if copy constructor of T + not marked with = delete, + T does not derives from + boost::noncopyable and does not marked with BOOST_MOVABLE_BUT_NOT_COPYABLE(T). +

+

+ Compiler Compatibility: This trait requires + the C++11 features decltype + and SFINAE-expression support for full support. +

+

+ If your compiler does not support C++11 deleted functions (= delete) + or does not support SFINAE for the deleted constructors, then derive your + classes from boost::noncopyable or mark them with BOOST_MOVABLE_BUT_NOT_COPYABLE(T) to show + that class is noncopyable. +

+

+ The trait does not care about access modifiers, so if you see errors like + this: +

+
'T::T(const T&)' is private
+boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context
+
+

+ then you are trying to call that macro for a structure with private constructor: +

+
struct T {
+    // ...
+private:
+    T(const T &);
+    // ...
+};
+
+

+ To fix that you must modify your structure, explicitly marking it as noncopyable + (= delete, + boost::noncopyable or BOOST_MOVABLE_BUT_NOT_COPYABLE(T)) + or explicitly specialize trait. +

+

+ Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_default_constructible.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_default_constructible.html new file mode 100644 index 0000000000000000000000000000000000000000..f4cd50d7d5fd0e827d29ab3197035b350b882fc5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_default_constructible.html @@ -0,0 +1,68 @@ + + + +is_default_constructible + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_default_constructible : public true_type-or-false_type {};
+
+

+ Inherits: If T + can be default-constructed then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ Compiler Compatibility: This trait requires + the C++11 feature decltype support + for full support. While there is some fallback code for cases where this + is not the case, the trait should really be considered broken in that case. +

+

+ Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_destructible.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_destructible.html new file mode 100644 index 0000000000000000000000000000000000000000..6be849fc29460fb2d49799e84e653505d737390a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_destructible.html @@ -0,0 +1,69 @@ + + + +is_destructible + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_destructible : public true_type-or-false_type {};
+
+

+ Inherits: If T + does not have its destructor deleted then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ Compiler Compatibility: This trait requires + the C++11 features decltype + and SFINAE-expression support for full support. While there is some fallback + code for cases where this is not the case, the trait should really be considered + broken in that case. +

+

+ Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_empty.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_empty.html new file mode 100644 index 0000000000000000000000000000000000000000..48ddcbac7d2b25ca56c6ba3104ed06f00733a6f9 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_empty.html @@ -0,0 +1,102 @@ + + + +is_empty + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_empty : public true_type-or-false_type {};
+
+

+ Inherits: If T is an empty class type (and + not a union type) then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 10p5. +

+

+ Header: #include + <boost/type_traits/is_empty.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: In order to correctly + detect empty classes this trait relies on either: +

+
    +
  • + the compiler implementing zero sized empty base classes, or +
  • +
  • + the compiler providing intrinsics + to detect empty classes - this latter case can be tested for by checking + to see if the macro BOOST_IS_EMPTY is defined. +
  • +
+

+ Can not be used with incomplete types. +

+

+ Examples: +

+

+ Given: struct empty_class + {}; +

+

+ is_empty<empty_class> + inherits from true_type. +

+

+ is_empty<empty_class const>::type + is the type true_type. +

+

+ is_empty<empty_class>::value is an integral constant expression + that evaluates to true. +

+

+ is_empty<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_enum.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_enum.html new file mode 100644 index 0000000000000000000000000000000000000000..c682009f35f4f6a40bdaa818c8a5452758c94309 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_enum.html @@ -0,0 +1,97 @@ + + + +is_enum + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_enum : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + enum type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 7.2. +

+

+ Header: #include + <boost/type_traits/is_enum.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Examples: +

+

+ Given: enum my_enum + { one, two }; +

+

+ is_enum<my_enum> + inherits from true_type. +

+

+ is_enum<my_enum const>::type + is the type true_type. +

+

+ is_enum<my_enum>::value is an integral constant expression + that evaluates to true. +

+

+ is_enum<my_enum&>::value is an integral constant expression + that evaluates to false. +

+

+ is_enum<my_enum*>::value is an integral constant expression + that evaluates to false. +

+

+ is_enum<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_final.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_final.html new file mode 100644 index 0000000000000000000000000000000000000000..aa589e2a2ded884bda52faa501b086cfbbaffd40 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_final.html @@ -0,0 +1,106 @@ + + + +is_final + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_final : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + class type declared with the final specifier type then inherits from true_type, + otherwise inherits from false_type. + Currently requires some kind of compiler support. +

+

+ C++ Standard Reference: 9p3. +

+

+ Compiler Compatibility: Without (some as + yet unspecified) help from the compiler, we cannot detect class types declared + with the final specifier using only standard C++, as a result this type will + never inherit from true_type, + unless the user explicitly specializes the template for their user-defined + final class types, or unless the compiler supplies some unspecified intrinsic + that implements this functionality. Currently (June 2015) compilers more + recent than GCC-4.7, Oracle-12.4, and Clang have the necessary compiler + intrinsics to ensure that + this trait "just works". You may also test to see if the necessary + intrinsics are available + by checking to see if the macro BOOST_IS_FINAL + is defined. +

+

+ Header: #include + <boost/type_traits/is_final.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ Given struct my_final + final {}; + then: +

+

+ is_final<my_final> + inherits from true_type. +

+

+ is_final<const my_final>::type + is the type true_type. +

+

+ is_final<my_final>::value is an integral constant expression + that evaluates to true. +

+

+ is_final<my_final*>::value is an integral constant expression + that evaluates to false. +

+

+ is_final<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_floating_point.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_floating_point.html new file mode 100644 index 0000000000000000000000000000000000000000..0ecbcf291d2675cb0522881f80f00158fe134fc2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_floating_point.html @@ -0,0 +1,84 @@ + + + +is_floating_point + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_floating_point : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + floating point type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1p8. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_floating_point.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_floating_point<float> + inherits from true_type. +

+

+ is_floating_point<double>::type is the type true_type. +

+

+ is_floating_point<long double>::value + is an integral constant expression that evaluates to true. +

+

+ is_floating_point<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_function.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_function.html new file mode 100644 index 0000000000000000000000000000000000000000..871a1b4b63aa78fd7fe4f5ad4bd3e477500d0a46 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_function.html @@ -0,0 +1,152 @@ + + + +is_function + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_function : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + function type then inherits from true_type, + otherwise inherits from false_type. + Note that this template does not detect pointers to functions, + or references to functions, these are detected by is_pointer and is_reference respectively: +

+
typedef int f1();      // f1 is of function type.
+typedef int (*f2)();   // f2 is a pointer to a function.
+typedef int (&f3)();   // f3 is a reference to a function.
+
+

+ C++ Standard Reference: 3.9.2p1 and 8.3.5. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_function.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_function<int (void)> inherits from true_type. +

+

+ is_function<long (double, int)>::type is the type true_type. +

+

+ is_function<long (double, int)>::value is an integral constant expression + that evaluates to true. +

+

+ is_function<long (*)(double, int)>::value is an integral constant expression + that evaluates to false: the argument in this case + is a pointer type, not a function type. +

+

+ is_function<long (&)(double, int)>::value is an integral constant expression + that evaluates to false: the argument in this case + is a reference to a function, not a function type. +

+

+ is_function<long (MyClass::*)(double, int)>::value is an integral constant expression + that evaluates to false: the argument in this case + is a pointer to a member function. +

+

+ is_function<T>::value_type is the type bool. +

+
+ + + + + +
[Tip]Tip
+

+ Don't confuse function-types with pointers to functions: +

+

+ typedef int + f(double); +

+

+ defines a function type, +

+

+ f foo; +

+

+ declares a prototype for a function of type f, +

+

+ f* + pf = + foo; +

+

+ f& + fr = + foo; +

+

+ declares a pointer and a reference to the function foo. +

+

+ If you want to detect whether some type is a pointer-to-function then use: +

+

+ is_function<remove_pointer<T>::type>::value + && is_pointer<T>::value +

+

+ or for pointers to member functions you can just use is_member_function_pointer + directly. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_fundamental.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_fundamental.html new file mode 100644 index 0000000000000000000000000000000000000000..5c422663d3e29545def735ce121883029e01baf5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_fundamental.html @@ -0,0 +1,89 @@ + + + +is_fundamental + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_fundamental : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + fundamental type then inherits from true_type, + otherwise inherits from false_type. + Fundamental types include integral, floating point and void types (see also + is_integral, + is_floating_point + and is_void) +

+

+ C++ Standard Reference: 3.9.1. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_fundamental.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_fundamental<int)> + inherits from true_type. +

+

+ is_fundamental<double const>::type + is the type true_type. +

+

+ is_fundamental<void>::value is an integral constant expression + that evaluates to true. +

+

+ is_fundamental<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_integral.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_integral.html new file mode 100644 index 0000000000000000000000000000000000000000..975a5546f600768d73353b290f5d0a4abd802604 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_integral.html @@ -0,0 +1,85 @@ + + + +is_integral + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_integral : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + integral type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1p7. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_integral.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_integral<int> + inherits from true_type. +

+

+ is_integral<const char>::type + is the type true_type. +

+

+ is_integral<long>::value is an integral constant expression + that evaluates to true. +

+

+ is_integral<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_lvalue_reference.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_lvalue_reference.html new file mode 100644 index 0000000000000000000000000000000000000000..eec407bc3b5d98680072ee9083ef01aaca3f150e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_lvalue_reference.html @@ -0,0 +1,90 @@ + + + +is_lvalue_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_lvalue_reference : public true_type-or-false_type {};
+
+

+ Inherits: If T is an lvalue reference type + then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.2. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_lvalue_reference.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_lvalue_reference<int&> + inherits from true_type. +

+

+ is_lvalue_reference<int const&>::type + is the type true_type. +

+

+ is_lvalue_reference<int const&&>::type + is the type false_type. +

+

+ is_lvalue_reference<int (&)(long)>::value is an integral constant expression + that evaluates to true (the argument in this case + is a reference to a function). +

+

+ is_lvalue_reference<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_function_pointer.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_function_pointer.html new file mode 100644 index 0000000000000000000000000000000000000000..3bd748f70636b76d33270bcb8bd919dc47554e96 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_function_pointer.html @@ -0,0 +1,92 @@ + + + +is_member_function_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_member_function_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer to a member function then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.3. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_member_function_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_member_function_pointer<int (MyClass::*)(void)> inherits from true_type. +

+

+ is_member_function_pointer<int (MyClass::*)(char)>::type + is the type true_type. +

+

+ is_member_function_pointer<int (MyClass::*)(void)const>::value is an integral constant expression + that evaluates to true. +

+

+ is_member_function_pointer<int (MyClass::*)>::value + is an integral constant expression that evaluates to false: + the argument in this case is a pointer to a data member and not a member + function, see is_member_object_pointer + and is_member_pointer +

+

+ is_member_function_pointer<T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_object_pointer.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_object_pointer.html new file mode 100644 index 0000000000000000000000000000000000000000..e76907019e89236c2e89370b8f650679e6382307 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_object_pointer.html @@ -0,0 +1,92 @@ + + + +is_member_object_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_member_object_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer to a member object (a data member) then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.3. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_member_object_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_member_object_pointer<int (MyClass::*)> inherits from true_type. +

+

+ is_member_object_pointer<double (MyClass::*)>::type + is the type true_type. +

+

+ is_member_object_pointer<const int (MyClass::*)>::value + is an integral constant expression that evaluates to true. +

+

+ is_member_object_pointer<int (MyClass::*)(void)>::value + is an integral constant expression that evaluates to false: + the argument in this case is a pointer to a member function and not a member + object, see is_member_function_pointer + and is_member_pointer +

+

+ is_member_object_pointer<T>::value_type + is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_pointer.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_pointer.html new file mode 100644 index 0000000000000000000000000000000000000000..f603aa6cf63c7c281f8bd124e4e8e48ff2d72bc4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_member_pointer.html @@ -0,0 +1,85 @@ + + + +is_member_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_member_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer to a member (either a function or a data member) then inherits from + true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.3. +

+

+ Compiler Compatibility: All current compilers + are supported by this trait. +

+

+ Header: #include + <boost/type_traits/is_member_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+

+ is_member_pointer<int (MyClass::*)> inherits from true_type. +

+

+ is_member_pointer<int (MyClass::*)(char)>::type + is the type true_type. +

+

+ is_member_pointer<int (MyClass::*)(void)const>::value is an integral constant expression + that evaluates to true. +

+

+ is_member_pointer<T>::value_type is the type bool. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html new file mode 100644 index 0000000000000000000000000000000000000000..5de7e67db716afdf7c048adf735e965991c0da2f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html @@ -0,0 +1,83 @@ + + + +is_nothrow_move_assignable + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
template <class T>
+struct is_nothrow_move_assignable : public true_type-or-false_type {};
+
+

+ Inherits: If T + is a (possibly cv-qualified) type with a non-throwing move assignment-operator + or a type without move assignment-operator but with non-throwing assignment-operator, + then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ In other words, inherits from true_type + only if expression variable1 = std::move(variable2) won't throw (variable1 + and variable2 are variables + of type T). +

+

+ Compiler Compatibility: If the compiler + does not support partial-specialization of class templates, then this template + can not be used with function types. +

+

+ Without some (C++11 noexcept shall work correctly) help from the compiler, + is_nothrow_move_assignable + will never report that a class or struct has a non-throwing assignment-operator; + this is always safe, if possibly sub-optimal. Currently (June 2015) MSVC-12.0, + Clang and GCC 4.7 have the necessary compiler support to ensure that this + trait "just works". +

+

+ Header: #include + <boost/type_traits/is_nothrow_move_assignable.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/user_defined.html b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/user_defined.html new file mode 100644 index 0000000000000000000000000000000000000000..6ce56ad4dad771b90b735e90ad6a101e1c9630df --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/boost_typetraits/user_defined.html @@ -0,0 +1,81 @@ + + + +User Defined Specializations + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Occationally the end user may need to provide their own specialization for + one of the type traits - typically where intrinsic compiler support is required + to implement a specific trait fully. These specializations should derive from + boost::true_type + or boost::false_type + as appropriate: +

+
#include <boost/type_traits/is_pod.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_union.hpp>
+
+struct my_pod{};
+struct my_union
+{
+   char c;
+   int i;
+};
+
+namespace boost
+{
+   template<>
+   struct is_pod<my_pod> : public true_type{};
+
+   template<>
+   struct is_pod<my_union> : public true_type{};
+
+   template<>
+   struct is_union<my_union> : public true_type{};
+
+   template<>
+   struct is_class<my_union> : public false_type{};
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/index.html b/tools/boost_1_65_1/libs/type_traits/doc/html/index.html new file mode 100644 index 0000000000000000000000000000000000000000..f6995908e1bf5356ade2cc37299ed5ebd5c3de0c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/index.html @@ -0,0 +1,238 @@ + + + +Chapter 1. Boost.TypeTraits + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
Next
+
+
+

+Chapter 1. Boost.TypeTraits

+

+various authors +

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+
+

Table of Contents

+
+
Introduction
+
Background and Tutorial
+
Type Traits by Category
+
+
Type Traits that + Describe the Properties of a Type
+
+
Categorizing + a Type
+
General + Type Properties
+
Relationships + Between Two Types
+
Operator + Type Traits
+
+
Type Traits that + Transform One Type to Another
+
Synthesizing Types + with Specific Alignments
+
Decomposing Function + Types
+
+
User Defined Specializations
+
Support for Compiler Intrinsics
+
MPL Interoperability
+
Examples
+
+
An Optimized Version + of std::copy
+
An Optimised Version + of std::fill
+
An Example that Omits + Destructor Calls For Types with Trivial Destructors
+
An improved Version of + std::iter_swap
+
Convert Numeric + Types and Enums to double
+
Improving std::min + with common_type
+
+
Alphabetical Reference
+
+
add_const
+
add_cv
+
add_lvalue_reference
+
add_pointer
+
add_reference
+
add_rvalue_reference
+
add_volatile
+
aligned_storage
+
alignment_of
+
conditional
+
common_type
+
copy_cv
+
decay
+
declval
+
extent
+
floating_point_promotion
+
function_traits
+
has_bit_and
+
has_bit_and_assign
+
has_bit_or
+
has_bit_or_assign
+
has_bit_xor
+
has_bit_xor_assign
+
has_complement
+
has_dereference
+
has_divides
+
has_divides_assign
+
has_equal_to
+
has_greater
+
has_greater_equal
+
has_left_shift
+
has_left_shift_assign
+
has_less
+
has_less_equal
+
has_logical_and
+
has_logical_not
+
has_logical_or
+
has_minus
+
has_minus_assign
+
has_modulus
+
has_modulus_assign
+
has_multiplies
+
has_multiplies_assign
+
has_negate
+
has_new_operator
+
has_not_equal_to
+
has_nothrow_assign
+
has_nothrow_constructor
+
has_nothrow_copy
+
has_nothrow_destructor
+
has_nothrow_copy_constructor
+
has_nothrow_default_constructor
+
has_plus
+
has_plus_assign
+
has_post_decrement
+
has_post_increment
+
has_pre_decrement
+
has_pre_increment
+
has_right_shift
+
has_right_shift_assign
+
has_trivial_assign
+
has_trivial_constructor
+
has_trivial_copy
+
has_trivial_copy_constructor
+
has_trivial_default_constructor
+
has_trivial_destructor
+
has_trivial_move_assign
+
has_trivial_move_constructor
+
has_unary_minus
+
has_unary_plus
+
has_virtual_destructor
+
integral_constant
+
integral_promotion
+
is_abstract
+
is_arithmetic
+
is_array
+
is_assignable
+
is_base_of
+
is_class
+
is_complex
+
is_compound
+
is_const
+
is_constructible
+
is_convertible
+
is_copy_assignable
+
is_copy_constructible
+
is_default_constructible
+
is_destructible
+
is_empty
+
is_enum
+
is_final
+
is_floating_point
+
is_function
+
is_fundamental
+
is_integral
+
is_lvalue_reference
+
is_member_function_pointer
+
is_member_object_pointer
+
is_member_pointer
+
is_nothrow_move_assignable
+
is_nothrow_move_constructible
+
is_object
+
is_pod
+
is_pointer
+
is_polymorphic
+
is_reference
+
is_rvalue_reference
+
is_same
+
is_scalar
+
is_signed
+
is_stateless
+
is_union
+
is_unsigned
+
is_virtual_base_of
+
is_void
+
is_volatile
+
make_signed
+
make_unsigned
+
make_void
+
promote
+
rank
+
remove_all_extents
+
remove_const
+
remove_cv
+
remove_cv_ref
+
remove_extent
+
remove_pointer
+
remove_reference
+
remove_volatile
+
type_identity
+
type_with_alignment
+
+
History
+
Credits
+
Class Index
+
Typedef Index
+
Macro Index
+
Index
+
+
+

+ A printer-friendly PDF + version of this manual is also available. +

+
+ + + +
+
+
Next
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/index/s11.html b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s11.html new file mode 100644 index 0000000000000000000000000000000000000000..e57d6ae5525a72c0174f9a155711b59555d9ca1c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s11.html @@ -0,0 +1,426 @@ + + + +Class Index + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Class Index

+

A C D E F H I M N O P R T

+
+
+A +
+
+
+C +
+
+
+D +
+
+
+E +
+
+
+F +
+
+
+H +
+
+
+I +
+
+
+M +
+
+
+N +
+
+
+O +
+
+
+P +
+
+
+R +
+
+
+T +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/index/s12.html b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s12.html new file mode 100644 index 0000000000000000000000000000000000000000..e22bbe6cbe4b86cf709c032ccb8bf12f970315b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s12.html @@ -0,0 +1,94 @@ + + + +Typedef Index + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Typedef Index

+

F R T V

+
+
+F +
+
+
+R +
+
+
+T +
+
+
+V +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/index/s13.html b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s13.html new file mode 100644 index 0000000000000000000000000000000000000000..445c47d1212890b14d0156d1cd720f3ac757de77 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s13.html @@ -0,0 +1,190 @@ + + + +Macro Index + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Macro Index

+

B

+
+
+B +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/index/s14.html b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s14.html new file mode 100644 index 0000000000000000000000000000000000000000..32fa74f64bcb341da0f51d87704b7c77b0326dde --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/index/s14.html @@ -0,0 +1,1049 @@ + + + +Index + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHome +
+
+

+Index

+

A B C D E F H I M N O P R T U V

+
+
+A +
+
+
+B +
+
+
+C +
+
+
+D +
+
+
+E +
+
+
+F +
+
+
+H +
+
+
+I +
+
+
+M +
+
+
+N +
+
+
+O +
+
+
+P +
+
+
+R +
+
+
+T +
+
+
+U +
+
+
+V +
+
+
+
+ + + +
+
+
+PrevUpHome +
+ + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/html/standalone_HTML.manifest b/tools/boost_1_65_1/libs/type_traits/doc/html/standalone_HTML.manifest new file mode 100644 index 0000000000000000000000000000000000000000..d77b4c877191599555dfc572f2f5ff20c3bcbddd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/html/standalone_HTML.manifest @@ -0,0 +1,160 @@ +index.html +boost_typetraits/intro.html +boost_typetraits/background.html +boost_typetraits/category.html +boost_typetraits/category/value_traits.html +boost_typetraits/category/value_traits/primary.html +boost_typetraits/category/value_traits/properties.html +boost_typetraits/category/value_traits/relate.html +boost_typetraits/category/value_traits/operators.html +boost_typetraits/category/transform.html +boost_typetraits/category/alignment.html +boost_typetraits/category/function.html +boost_typetraits/user_defined.html +boost_typetraits/intrinsics.html +boost_typetraits/mpl.html +boost_typetraits/examples.html +boost_typetraits/examples/copy.html +boost_typetraits/examples/fill.html +boost_typetraits/examples/destruct.html +boost_typetraits/examples/iter.html +boost_typetraits/examples/to_double.html +boost_typetraits/examples/improved_min.html +boost_typetraits/reference.html +boost_typetraits/reference/add_const.html +boost_typetraits/reference/add_cv.html +boost_typetraits/reference/add_lvalue_reference.html +boost_typetraits/reference/add_pointer.html +boost_typetraits/reference/add_reference.html +boost_typetraits/reference/add_rvalue_reference.html +boost_typetraits/reference/add_volatile.html +boost_typetraits/reference/aligned_storage.html +boost_typetraits/reference/alignment_of.html +boost_typetraits/reference/conditional.html +boost_typetraits/reference/common_type.html +boost_typetraits/reference/copy_cv.html +boost_typetraits/reference/decay.html +boost_typetraits/reference/declval.html +boost_typetraits/reference/extent.html +boost_typetraits/reference/floating_point_promotion.html +boost_typetraits/reference/function_traits.html +boost_typetraits/reference/has_bit_and.html +boost_typetraits/reference/has_bit_and_assign.html +boost_typetraits/reference/has_bit_or.html +boost_typetraits/reference/has_bit_or_assign.html +boost_typetraits/reference/has_bit_xor.html +boost_typetraits/reference/has_bit_xor_assign.html +boost_typetraits/reference/has_complement.html +boost_typetraits/reference/has_dereference.html +boost_typetraits/reference/has_divides.html +boost_typetraits/reference/has_divides_assign.html +boost_typetraits/reference/has_equal_to.html +boost_typetraits/reference/has_greater.html +boost_typetraits/reference/has_greater_equal.html +boost_typetraits/reference/has_left_shift.html +boost_typetraits/reference/has_left_shift_assign.html +boost_typetraits/reference/has_less.html +boost_typetraits/reference/has_less_equal.html +boost_typetraits/reference/has_logical_and.html +boost_typetraits/reference/has_logical_not.html +boost_typetraits/reference/has_logical_or.html +boost_typetraits/reference/has_minus.html +boost_typetraits/reference/has_minus_assign.html +boost_typetraits/reference/has_modulus.html +boost_typetraits/reference/has_modulus_assign.html +boost_typetraits/reference/has_multiplies.html +boost_typetraits/reference/has_multiplies_assign.html +boost_typetraits/reference/has_negate.html +boost_typetraits/reference/has_new_operator.html +boost_typetraits/reference/has_not_equal_to.html +boost_typetraits/reference/has_nothrow_assign.html +boost_typetraits/reference/has_nothrow_constructor.html +boost_typetraits/reference/has_nothrow_copy.html +boost_typetraits/reference/has_nothrow_destruct.html +boost_typetraits/reference/has_nothrow_cp_cons.html +boost_typetraits/reference/has_no_throw_def_cons.html +boost_typetraits/reference/has_plus.html +boost_typetraits/reference/has_plus_assign.html +boost_typetraits/reference/has_post_decrement.html +boost_typetraits/reference/has_post_increment.html +boost_typetraits/reference/has_pre_decrement.html +boost_typetraits/reference/has_pre_increment.html +boost_typetraits/reference/has_right_shift.html +boost_typetraits/reference/has_right_shift_assign.html +boost_typetraits/reference/has_trivial_assign.html +boost_typetraits/reference/has_trivial_constructor.html +boost_typetraits/reference/has_trivial_copy.html +boost_typetraits/reference/has_trivial_cp_cons.html +boost_typetraits/reference/has_trivial_def_cons.html +boost_typetraits/reference/has_trivial_destructor.html +boost_typetraits/reference/has_trivial_move_assign.html +boost_typetraits/reference/has_trivial_move_constructor.html +boost_typetraits/reference/has_unary_minus.html +boost_typetraits/reference/has_unary_plus.html +boost_typetraits/reference/has_virtual_destructor.html +boost_typetraits/reference/integral_constant.html +boost_typetraits/reference/integral_promotion.html +boost_typetraits/reference/is_abstract.html +boost_typetraits/reference/is_arithmetic.html +boost_typetraits/reference/is_array.html +boost_typetraits/reference/is_assignable.html +boost_typetraits/reference/is_base_of.html +boost_typetraits/reference/is_class.html +boost_typetraits/reference/is_complex.html +boost_typetraits/reference/is_compound.html +boost_typetraits/reference/is_const.html +boost_typetraits/reference/is_constructible.html +boost_typetraits/reference/is_convertible.html +boost_typetraits/reference/is_copy_assignable.html +boost_typetraits/reference/is_copy_constructible.html +boost_typetraits/reference/is_default_constructible.html +boost_typetraits/reference/is_destructible.html +boost_typetraits/reference/is_empty.html +boost_typetraits/reference/is_enum.html +boost_typetraits/reference/is_final.html +boost_typetraits/reference/is_floating_point.html +boost_typetraits/reference/is_function.html +boost_typetraits/reference/is_fundamental.html +boost_typetraits/reference/is_integral.html +boost_typetraits/reference/is_lvalue_reference.html +boost_typetraits/reference/is_member_function_pointer.html +boost_typetraits/reference/is_member_object_pointer.html +boost_typetraits/reference/is_member_pointer.html +boost_typetraits/reference/is_nothrow_move_assignable.html +boost_typetraits/reference/is_nothrow_move_constructible.html +boost_typetraits/reference/is_object.html +boost_typetraits/reference/is_pod.html +boost_typetraits/reference/is_pointer.html +boost_typetraits/reference/is_polymorphic.html +boost_typetraits/reference/is_reference.html +boost_typetraits/reference/is_rvalue_reference.html +boost_typetraits/reference/is_same.html +boost_typetraits/reference/is_scalar.html +boost_typetraits/reference/is_signed.html +boost_typetraits/reference/is_stateless.html +boost_typetraits/reference/is_union.html +boost_typetraits/reference/is_unsigned.html +boost_typetraits/reference/is_virtual_base_of.html +boost_typetraits/reference/is_void.html +boost_typetraits/reference/is_volatile.html +boost_typetraits/reference/make_signed.html +boost_typetraits/reference/make_unsigned.html +boost_typetraits/reference/make_void.html +boost_typetraits/reference/promote.html +boost_typetraits/reference/rank.html +boost_typetraits/reference/remove_all_extents.html +boost_typetraits/reference/remove_const.html +boost_typetraits/reference/remove_cv.html +boost_typetraits/reference/remove_cv_ref.html +boost_typetraits/reference/remove_extent.html +boost_typetraits/reference/remove_pointer.html +boost_typetraits/reference/remove_reference.html +boost_typetraits/reference/remove_volatile.html +boost_typetraits/reference/type_identity.html +boost_typetraits/reference/type_with_alignment.html +boost_typetraits/history.html +boost_typetraits/credits.html +index/s11.html +index/s12.html +index/s13.html +index/s14.html diff --git a/tools/boost_1_65_1/libs/type_traits/doc/index.idx b/tools/boost_1_65_1/libs/type_traits/doc/index.idx new file mode 100644 index 0000000000000000000000000000000000000000..e050a9e1f7cc11d60ac18392ba8b9da24818b735 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/index.idx @@ -0,0 +1,23 @@ + +!define-scanner class_name "BOOST_TT_AUX_TYPE_TRAIT_DEF\d\s*\(\s*(\w+)\s*[,)]" "(?:class|struct)[^;{]+\\<\1\\>[^;{]+\\{" \1 +!define-scanner class_name "BOOST_TT_AUX_BOOL_TRAIT_DEF\d\s*\(\s*(\w+)\s*[,)]" "(?:class|struct)[^;{]+\\<\1\\>[^;{]+\\{" \1 +!define-scanner class_name "BOOST_TT_AUX_SIZE_T_TRAIT_DEF\d\s*\(\s*(\w+)\s*[,)]" "(?:class|struct)[^;{]+\\<\1\\>[^;{]+\\{" \1 +!define-scanner class_name "BOOST_TT_TRAIT_NAME\s*(\w+)" "(?:class|struct)[^;{]+\\<\1\\>[^;{]+\\{" \1 + +!define-scanner class_name "^[[:space:]]*(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\<\w+\>([[:blank:]]*\([^)]*\))?[[:space:]]*)*(\<\w*\>)[[:space:]]*(<[^;:{]+>)?[[:space:]]*(\{|:[^;\{()]*\{)" "(?:class|struct)[^;{]+\\<\5\\>[^;{]+\\{" \5 +!define-scanner typedef_name "typedef[^;{}#]+?(\w+)\s*;" "typedef[^;]+\\<\1\\>\\s*;" "\1" +!define-scanner "macro_name" "^\s*#\s*define\s+(\w+)" "\\<\1\\>" "\1" +!define-scanner "function_name" "\w+\s+(\w+)\s*\([^\)]*\)\s*[;{]" "\\<\\w+\\>\\s+\\<\1\\>\\s*\\([^;{]*\\)\\s*[;{]" "\1" + +!scan-path boost/type_traits .*\.hpp true +!scan boost/aligned_storage.hpp +!scan boost/type_traits.hpp + +!exclude type arg1_type arg2_type arg3_type arg4_type arg5_type B D +!exclude result + +!rewrite-name "(?:A|An|The)\s+(.*)" "\1" + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/integral_constant.qbk b/tools/boost_1_65_1/libs/type_traits/doc/integral_constant.qbk new file mode 100644 index 0000000000000000000000000000000000000000..663ff08efb95a72bce6e4e26451578258a03c977 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/integral_constant.qbk @@ -0,0 +1,27 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:integral_constant integral_constant] + template + struct integral_constant + { + typedef integral_constant type; + typedef T value_type; + static const T value = val; + constexpr operator T()const; + }; + + typedef integral_constant true_type; + typedef integral_constant false_type; + +Class template `integral_constant` is the common base class for all the value-based +type traits. The two typedef's `true_type` and `false_type` are provided for +convenience: most of the value traits are Boolean properties and so will inherit from +one of these. + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/integral_promotion.qbk b/tools/boost_1_65_1/libs/type_traits/doc/integral_promotion.qbk new file mode 100644 index 0000000000000000000000000000000000000000..1b69792013b86b9ac84607a861ae3532503b3e93 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/integral_promotion.qbk @@ -0,0 +1,39 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:integral_promotion integral_promotion] + + template + struct integral_promotion + { + typedef __below type; + }; + + template using integral_promotion_t = typename integral_promotion::type; // C++11 and above + +__type If integral promotion can be applied to an rvalue of type `T`, then +applies integral promotion to `T` and keeps cv-qualifiers of `T`, +otherwise leaves `T` unchanged. + +__std_ref 4.5 except 4.5/3 (integral bit-field). + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`integral_promotion::type`][`int const`]] + +[[`integral_promotion::type`][`short&`]] + +[[`integral_promotion::type`][`int`]] + +] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/intrinsics.qbk b/tools/boost_1_65_1/libs/type_traits/doc/intrinsics.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c824a1f2e1146a85787155a4c675a82159437b38 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/intrinsics.qbk @@ -0,0 +1,82 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:intrinsics Support for Compiler Intrinsics] + +There are some traits that can not be implemented within the current C++ language: +to make these traits "just work" with user defined types, some kind of additional +help from the compiler is required. Currently (April 2008) Visual C++ 8 and 9, +GNU GCC 4.3 and MWCW 9 provide at least some of the the necessary intrinsics, +and other compilers will no doubt follow in due course. + +The Following traits classes always need compiler support to do the right thing +for all types +(but all have safe fallback positions if this support is unavailable): + +* __is_final +* __is_union +* __is_pod +* __is_nothrow_move_assignable +* __is_nothrow_move_constructible +* __has_trivial_constructor +* __has_trivial_copy +* __has_trivial_move_constructor +* __has_trivial_assign +* __has_trivial_move_assign +* __has_trivial_destructor +* __has_nothrow_constructor +* __has_nothrow_copy +* __has_nothrow_assign +* __has_virtual_destructor + +The following traits classes can't be portably implemented in the C++ language, +although in practice, the implementations do in fact do the right thing on all +the compilers we know about: + +* __is_empty +* __is_polymorphic +* __is_virtual_base_of + +The following traits classes are dependent on one or more of the above: + +* __is_class +* __is_stateless + +The hooks for compiler-intrinsic support are defined in +[@../../../../boost/type_traits/intrinsics.hpp boost/type_traits/intrinsics.hpp], adding support for new compilers is simply +a matter of defining one of more of the following macros: + +[table Macros for Compiler Intrinsics + [[BOOST_ALIGNMENT_OF(T)][Should evaluate to the alignment requirements of type T]] + [[BOOST_IS_ABSTRACT(T)][Should evaluate to true if T is an abstract type]] + [[BOOST_IS_BASE_OF(T,U)][Should evaluate to true if T is a base class of U]] + [[BOOST_IS_CLASS(T)][Should evaluate to true if T is a class type]] + [[BOOST_IS_CONVERTIBLE(T,U)][Should evaluate to true if T is convertible to U]] + [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]] + [[BOOST_IS_ENUM(T)][Should evaluate to true is T is an enum]] + [[BOOST_IS_FINAL(T)][Should evaluate to true if T is a class type declared with the final specifier]] + [[BOOST_IS_NOTHROW_MOVE_ASSIGN(T)][Should evaluate to true T has a non-throwing move assign operator.]] + [[BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T)][Should evaluate to true T has a non-throwing move constructor.]] + [[BOOST_IS_POLYMORPHIC(T)][Should evaluate to true if T is a polymorphic type]] + [[BOOST_IS_POD(T)][Should evaluate to true if T is a POD type]] + [[BOOST_IS_UNION(T)][Should evaluate to true if T is a union type]] + [[BOOST_HAS_NOTHROW_ASSIGN(T)][Should evaluate to true if `T t, u; t = u` can not throw]] + [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]] + [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]] + [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]] + [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]] + [[BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)][Should evaluate to true if T has a trivial move constructor (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)][Should evaluate to true if T has a trivial move assignment operator (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_VIRTUAL_DESTRUCTOR(T)][Should evaluate to true T has a virtual destructor]] + + +] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_abstract.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_abstract.qbk new file mode 100644 index 0000000000000000000000000000000000000000..3f5415d989fd1f40346feda27174839187343a19 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_abstract.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_abstract is_abstract] + template + struct is_abstract : public __tof {}; + +__inherit If T is a (possibly cv-qualified) abstract type then inherits from +__true_type, otherwise inherits from __false_type. + +__std_ref 10.3. + +__header ` #include ` or ` #include ` + +__compat The compiler must support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), + Intel C++ 7 (and later), and Comeau 4.3.2). +Otherwise behaves the same as __is_polymorphic; +this is the "safe fallback position" for which polymorphic types are always +regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT is used to +signify that the implementation is buggy, users should check for this in their +own code if the "safe fallback" is not suitable for their particular use-case. + +__examples + +[:Given: `class abc{ virtual ~abc() = 0; };` ] + +[:`is_abstract` inherits from `__true_type`.] + +[:`is_abstract::type` is the type `__true_type`.] + +[:`is_abstract::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_abstract::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_arithmetic.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_arithmetic.qbk new file mode 100644 index 0000000000000000000000000000000000000000..efea08725e2abb7a7ee6979c775436c0690cc907 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_arithmetic.qbk @@ -0,0 +1,32 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_arithmetic is_arithmetic] + template + struct is_arithmetic : public __tof {}; + +__inherit If T is a (possibly cv-qualified) arithmetic type then inherits from +__true_type, otherwise inherits from __false_type. Arithmetic types include +integral and floating point types (see also __is_integral and __is_floating_point). + +__std_ref 3.9.1p8. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_arithmetic` inherits from `__true_type`.] + +[:`is_arithmetic::type` is the type `__true_type`.] + +[:`is_arithmetic::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_arithmetic::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_array.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_array.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c8a4543b156bb456f5fdbf3fed0eca848ce2355a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_array.qbk @@ -0,0 +1,33 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_array is_array] + template + struct is_array : public __tof {}; + +__inherit If T is a (possibly cv-qualified) array type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 8.3.4. + +__header ` #include ` or ` #include ` + +[all_compilers] + +__examples + +[:`is_array` inherits from `__true_type`.] + +[:`is_array::type` is the type `__true_type`.] + +[:`is_array::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_array::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_assignable.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_assignable.qbk new file mode 100644 index 0000000000000000000000000000000000000000..fe4089ea0bc4589853e64205fabaffabf2b8721c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_assignable.qbk @@ -0,0 +1,40 @@ +[/ + Copyright 2015 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_assignable is_assignable] + + template + struct is_assignable : public __tof {}; + +__inherit If `std::declval() = std::declval()` then inherits from __true_type, +otherwise from __flase_type. Type `T` must be a complete type. + +Note that this trait is somewhat tricky to use correctly: for example: + + is_assignable::value + +is `false` since `std::declval()` is an ['xvalue] which can not be assigned to! + +If you're intention is to check for copy-assignment from some type U then use: + + is_assignable::value + +If you're intention is to check for move-assignment then use: + + is_assignable::value + +or simply: + + is_assignable::value + + +__compat Requires the C++11 features `decltype` and SFINAE-expressions for full support. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_base_of.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_base_of.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c65eb9a5cbc5f0233f906d9896fe3d98d89d5314 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_base_of.qbk @@ -0,0 +1,52 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_base_of is_base_of] + + template + struct is_base_of : public __tof {}; + +__inherit If Base is base class of type Derived or if both types are the same +class type then inherits from __true_type, +otherwise inherits from __false_type. + +This template will detect non-public base classes, and ambiguous base classes. +It also detects indirect base classes - which is to say __is_base_of inherits +from __true_type if B is located anywhere in the inheritance tree of D. + +Note that `is_base_of` will inherit from __true_type if X is a class type. +This is a change in behaviour +from Boost-1.39.0 in order to track the emerging C++0x standard. + +Types `Base` and `Derived` must not be incomplete types. + +__std_ref 10. + +__header ` #include ` or ` #include ` + +[all_compilers] + +__examples + +[:Given: ` class Base{}; class Derived : public Base{};` ] + +[:`is_base_of` inherits from `__true_type`.] + +[:`is_base_of::type` is the type `__true_type`.] + +[:`is_base_of::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_base_of::value` is an integral constant +expression that evaluates to /true/: a class is regarded as it's own base.] + +[:`is_base_of::value_type` is the type `bool`.] + +[endsect] + + + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_class.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_class.qbk new file mode 100644 index 0000000000000000000000000000000000000000..f5d56cb85ff3b1dac4198b8c453e76af373495dc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_class.qbk @@ -0,0 +1,43 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_class is_class] + template + struct is_class : public __tof {}; + +__inherit If T is a (possibly cv-qualified) class type (and not a union type) then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 9.2. + +__header ` #include ` or ` #include ` + +__compat This trait works correctly for almost all current compilers (as of June 2015), with just a minority +of older compilers not correctly detecting all the corner cases. You can check the macro `BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION` +which is defined to 1 when the class works correctly in all cases. + +__examples + +[:Given: `class MyClass;` then:] + +[:`is_class` inherits from `__true_type`.] + +[:`is_class::type` is the type `__true_type`.] + +[:`is_class::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_class::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_class::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_class::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_complex.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_complex.qbk new file mode 100644 index 0000000000000000000000000000000000000000..56469108d7c4da7d86ab07938b4bd21839383a26 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_complex.qbk @@ -0,0 +1,23 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_complex is_complex] + + template + struct is_complex : public __tof {}; + +__inherit If `T` is a complex number type then true (of type `std::complex` for +some type `U`), otherwise false. + +__std_ref 26.2. + +[all_compilers] + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_compound.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_compound.qbk new file mode 100644 index 0000000000000000000000000000000000000000..80e9f2707fc1cd520b6a319f9ff90f6edea1ea6d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_compound.qbk @@ -0,0 +1,40 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_compound is_compound] + template + struct is_compound : public __tof {}; + +__inherit If T is a (possibly cv-qualified) compound type then inherits from __true_type, +otherwise inherits from __false_type. Any type that is not a fundamental type is +a compound type (see also __is_fundamental). + +__std_ref 3.9.2. + +[all_compilers] + +__header ` #include ` or ` #include ` + +__examples + +[:`is_compound` inherits from `__true_type`.] + +[:`is_compound::type` is the type `__true_type`.] + +[:`is_compound::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_compound::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_compound::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_compound::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_const.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_const.qbk new file mode 100644 index 0000000000000000000000000000000000000000..585327498bd43841ed9642fdee6d7110757f967c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_const.qbk @@ -0,0 +1,45 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_const is_const] + + template + struct is_const : public __tof {}; + +__inherit If T is a (top level) const-qualified type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.3. + +__header ` #include ` or ` #include ` + +[all_compilers] + +__examples + +[:`is_const` inherits from `__true_type`.] + +[:`is_const::type` is the type `__true_type`.] + +[:`is_const::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_const::value` is an integral constant +expression that evaluates to /false/: the const-qualifier is not +at the top level in this case.] + +[:`is_const::value` is an integral constant +expression that evaluates to /false/: the const-qualifier is not +at the top level in this case.] + +[:`is_const::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_const::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_constructible.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_constructible.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b301a25ff36b724485b035c974b56eb48134d73e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_constructible.qbk @@ -0,0 +1,44 @@ +[/ + Copyright 2015 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_constructible is_constructible] + + template + struct is_constructible : public __tof {}; + +__inherit If `T` can be constructed from `Args`, +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +Formally the trait answers the question, is the expression: + + T t(std::declval()...); + +valid? + +There are a number of important special cases for this trait: + + is_constructible::value + +Indicates whether `T` is default constructible, while: + + is_constructible::value + +Indicates whether `T` is copy-constructible, and: + + is_constructible::value + +Indicates whether `T` is move-constructible. + + +__compat This trait requires the C++11 features `decltype` variadic templates and SFINAE-expression support for full support. +While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_convertible.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_convertible.qbk new file mode 100644 index 0000000000000000000000000000000000000000..63305cb452dff6a3ebeb5f17ed41d664adb1514c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_convertible.qbk @@ -0,0 +1,64 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_convertible is_convertible] + template + struct is_convertible : public __tof {}; + +__inherit If an imaginary rvalue of type `From` is convertible to type `To` then +inherits from __true_type, otherwise inherits from __false_type. + +Type From must not be an incomplete type. + +Type To must not be an incomplete, or function type. + +No types are considered to be convertible to array types or abstract-class types. + +This template can not detect whether a converting-constructor is `public` or not: if +type `To` has a `private` converting constructor from type `From` then instantiating +`is_convertible` will produce a compiler error. For this reason `is_convertible` +can not be used to determine whether a type has a `public` copy-constructor or not. + +This template will also produce compiler errors if the conversion is ambiguous, +for example: + + struct A {}; + struct B : A {}; + struct C : A {}; + struct D : B, C {}; + // This produces a compiler error, the conversion is ambiguous: + bool const y = boost::is_convertible::value; + +__std_ref 4 and 8.5. + +[all_compilers] + +__header ` #include ` or ` #include ` + +__examples + +[:`is_convertible` inherits from `__true_type`.] + +[:`is_convertible::type` is the type `__true_type`.] + +[:`is_convertible::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_convertible::value` is an integral constant +expression that evaluates to /false/: the conversion would require a `const_cast`.] + +[:`is_convertible::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_convertible::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_convertible::value_type` is the type `bool`.] + +[endsect] + + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_copy_assignable.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_copy_assignable.qbk new file mode 100644 index 0000000000000000000000000000000000000000..55554418fc124f67b352af569786b9cc1f9c71f7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_copy_assignable.qbk @@ -0,0 +1,50 @@ +[/ + Copyright 2007 John Maddock. + Copyright 2014 Ion Gaztanaga. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_copy_assignable is_copy_assignable] + + template + struct is_copy_assignable : public __tof {}; + +__inherit If `T` is `CopyAssignable` (i.e. has an accessible explicit or implicit copy assignment operator), +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +In other words, inherits from __true_type only if copy assignment of `T` from `const T &` is not +marked with `= delete`, `T` does not derives from `boost::noncopyable` and +is not marked with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`. + +__compat Requires the C++11 features `decltype` and SFINAE-expressions for full support. + +If your compiler does not support C++11 deleted functions (`= delete`) or does not support +SFINAE for the deleted assignments, then derive your classes from `boost::noncopyable` or +mark them with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)` to show that class is non-assignable. + +Trait does not care about access modifiers, so if you see errors like this: + + 'T::operator=(const T&)' is private + boost/type_traits/is_copy_assignable.hpp:68:5: error: within this context + +then you are trying to call that macro for a structure with private assignment: + + struct T { + // ... + private: + T &operator=(const T &); + // ... + }; + +To fix that you must modify your structure, explicitly marking it as noncopyable (`= delete`, +`boost::noncopyable` or `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`) or explicitly +[link boost_typetraits.user_defined specializing the trait]. + + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_copy_constructible.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_copy_constructible.qbk new file mode 100644 index 0000000000000000000000000000000000000000..12a7d6d844df3f1db604b8f8d6089672419df2a0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_copy_constructible.qbk @@ -0,0 +1,50 @@ +[/ + Copyright 2007 John Maddock. + Copyright 2013 Antony Polukhin. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_copy_constructible is_copy_constructible] + + template + struct is_copy_constructible : public __tof {}; + +__inherit If `T` is a (possibly cv-qualified) type with a copy constructor, +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +In other words, inherits from __true_type only if copy constructor of `T` not +marked with `= delete`, `T` does not derives from `boost::noncopyable` and +does not marked with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`. + +__compat This trait requires the C++11 features `decltype` and SFINAE-expression support for full support. + +If your compiler does not support C++11 deleted functions (`= delete`) or does not support +SFINAE for the deleted constructors, then derive your classes from `boost::noncopyable` or +mark them with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)` to show that class is noncopyable. + +The trait does not care about access modifiers, so if you see errors like this: + + 'T::T(const T&)' is private + boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context + +then you are trying to call that macro for a structure with private constructor: + + struct T { + // ... + private: + T(const T &); + // ... + }; + +To fix that you must modify your structure, explicitly marking it as noncopyable (`= delete`, +`boost::noncopyable` or `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`) or explicitly +[link boost_typetraits.user_defined specialize trait]. + + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_default_constructible.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_default_constructible.qbk new file mode 100644 index 0000000000000000000000000000000000000000..94caf2536b9d95c46957caf148e666a80a3b4bbd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_default_constructible.qbk @@ -0,0 +1,23 @@ +[/ + Copyright 2015 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_default_constructible is_default_constructible] + + template + struct is_default_constructible : public __tof {}; + +__inherit If `T` can be default-constructed +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat This trait requires the C++11 feature `decltype` support for full support. +While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_destructible.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_destructible.qbk new file mode 100644 index 0000000000000000000000000000000000000000..335b2459d47e7dc8644fe02e6ca62bd67ff45236 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_destructible.qbk @@ -0,0 +1,23 @@ +[/ + Copyright 2015 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_destructible is_destructible] + + template + struct is_destructible : public __tof {}; + +__inherit If `T` does not have its destructor deleted +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat This trait requires the C++11 features `decltype` and SFINAE-expression support for full support. +While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_empty.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_empty.qbk new file mode 100644 index 0000000000000000000000000000000000000000..029a300e30da487b40ef9f22eb833bd680a11307 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_empty.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_empty is_empty] + template + struct is_empty : public __tof {}; + +__inherit If T is an empty class type (and not a union type) then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 10p5. + +__header ` #include ` or ` #include ` + +__compat In order to correctly detect empty classes this trait relies on either: + +* the compiler implementing zero sized empty base classes, or +* the compiler providing __intrinsics to detect empty classes - this latter case can be tested for +by checking to see if the macro BOOST_IS_EMPTY is defined. + +Can not be used with incomplete types. + +__examples + +[:Given: `struct empty_class {};` ] + +[:`is_empty` inherits from `__true_type`.] + +[:`is_empty::type` is the type `__true_type`.] + +[:`is_empty::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_empty::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_enum.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_enum.qbk new file mode 100644 index 0000000000000000000000000000000000000000..f31617d90a99078c436d0017f4162d50bd5746e5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_enum.qbk @@ -0,0 +1,41 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_enum is_enum] + template + struct is_enum : public __tof {}; + +__inherit If T is a (possibly cv-qualified) enum type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 7.2. + +__header ` #include ` or ` #include ` + +[all_compilers] + +__examples + +[:Given: `enum my_enum { one, two };` ] + +[:`is_enum` inherits from `__true_type`.] + +[:`is_enum::type` is the type `__true_type`.] + +[:`is_enum::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_enum::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_enum::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_enum::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_final.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_final.qbk new file mode 100644 index 0000000000000000000000000000000000000000..e0b5f653cd51480d0f6ee4873074ee12274d9cc2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_final.qbk @@ -0,0 +1,47 @@ +[/ + Copyright (c) 2014 Agustin Berge + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_final is_final] + template + struct is_final : public __tof {}; + +__inherit If T is a (possibly cv-qualified) class type declared with the final +specifier type then inherits from __true_type, otherwise inherits from __false_type. +Currently requires some kind of compiler support. + +__std_ref 9p3. + +__compat Without (some as yet unspecified) help from the compiler, we cannot detect +class types declared with the final specifier using only standard C++, +as a result this type will never inherit from __true_type, unless the user explicitly +specializes the template for their user-defined final class types, or unless the compiler +supplies some unspecified intrinsic that implements this functionality. +Currently (June 2015) compilers more recent than GCC-4.7, Oracle-12.4, and Clang +have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_IS_FINAL` is defined. + +__header ` #include ` or ` #include ` + +__examples + +Given `struct my_final final {};` then: + +[:`is_final` inherits from `__true_type`.] + +[:`is_final::type` is the type `__true_type`.] + +[:`is_final::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_final::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_final::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_floating_point.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_floating_point.qbk new file mode 100644 index 0000000000000000000000000000000000000000..22d4b0bde4004e474e7a31a752ecafe7c0583616 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_floating_point.qbk @@ -0,0 +1,33 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_floating_point is_floating_point] + template + struct is_floating_point : public __tof {}; + +__inherit If T is a (possibly cv-qualified) floating point type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1p8. + +[all_compilers] + +__header ` #include ` or ` #include ` + +__examples + +[:`is_floating_point` inherits from `__true_type`.] + +[:`is_floating_point::type` is the type `__true_type`.] + +[:`is_floating_point::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_floating_point::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_function.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_function.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9c3c91efd3d3e4a9291b0e527abc83a4aa6df67a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_function.qbk @@ -0,0 +1,77 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_function is_function] + + template + struct is_function : public __tof {}; + +__inherit If T is a (possibly cv-qualified) function type then inherits from __true_type, +otherwise inherits from __false_type. Note that this template does not detect /pointers +to functions/, or /references to functions/, these are detected by __is_pointer and +__is_reference respectively: + + typedef int f1(); // f1 is of function type. + typedef int (*f2)(); // f2 is a pointer to a function. + typedef int (&f3)(); // f3 is a reference to a function. + +__std_ref 3.9.2p1 and 8.3.5. + +[all_compilers] + +__header ` #include ` or ` #include ` + +__examples + +[:`is_function` inherits from `__true_type`.] + +[:`is_function::type` is the type `__true_type`.] + +[:`is_function::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_function::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a pointer type, +not a function type.] + +[:`is_function::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a +reference to a function, not a function type.] + +[:`is_function::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a pointer +to a member function.] + +[:`is_function::value_type` is the type `bool`.] + +[tip Don't confuse function-types with pointers to functions: + +`typedef int f(double);` + +defines a function type, + +`f foo;` + +declares a prototype for a function of type `f`, + +`f* pf = foo;` + +`f& fr = foo;` + +declares a pointer and a reference to the function `foo`. + +If you want to detect whether some type is a pointer-to-function then use: + +`__is_function<__remove_pointer::type>::value && __is_pointer::value` + +or for pointers to member functions you can just use +__is_member_function_pointer directly. +] + +[endsect] + + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_fundamental.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_fundamental.qbk new file mode 100644 index 0000000000000000000000000000000000000000..da71a8c247758536887fe9b6c0111fcc1bb937ba --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_fundamental.qbk @@ -0,0 +1,34 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_fundamental is_fundamental] + template + struct is_fundamental : public __tof {}; + +__inherit If T is a (possibly cv-qualified) fundamental type then inherits from __true_type, +otherwise inherits from __false_type. Fundamental types include integral, floating +point and void types (see also __is_integral, __is_floating_point and __is_void) + +__std_ref 3.9.1. + +[all_compilers] + +__header ` #include ` or ` #include ` + +__examples + +[:`is_fundamental` inherits from `__true_type`.] + +[:`is_fundamental::type` is the type `__true_type`.] + +[:`is_fundamental::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_fundamental::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/doc/is_integral.qbk b/tools/boost_1_65_1/libs/type_traits/doc/is_integral.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b26275b38c35db2806171aed639cc4b96d4db128 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/doc/is_integral.qbk @@ -0,0 +1,33 @@ +[/ + Copyright 2007 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:is_integral is_integral] + template + struct is_integral : public __tof {}; + +__inherit If T is a (possibly cv-qualified) integral type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1p7. + +[all_compilers] + +__header ` #include ` or ` #include ` + +__examples + +[:`is_integral` inherits from `__true_type`.] + +[:`is_integral::type` is the type `__true_type`.] + +[:`is_integral::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_integral::value_type` is the type `bool`.] + +[endsect] + diff --git a/tools/boost_1_65_1/libs/type_traits/examples/copy_example.cpp b/tools/boost_1_65_1/libs/type_traits/examples/copy_example.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ba60a821976b48e94f866decbaa0e4539849ad6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/examples/copy_example.cpp @@ -0,0 +1,197 @@ + +/* + * + * (C) Copyright John Maddock 1999-2005. + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file provides some example of type_traits usage - + * by "optimising" various algorithms: + * + * opt::copy - optimised for trivial copy (cf std::copy) + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +using std::cout; +using std::endl; +using std::cin; + +namespace opt{ + +// +// opt::copy +// same semantics as std::copy +// calls memcpy where appropriate. +// + +namespace detail{ + +template +I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant&) +{ + while(first != last) + { + *out = *first; + ++out; + ++first; + } + return out; +} + +template +T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&) +{ + memmove(out, first, (last-first)*sizeof(T)); + return out+(last-first); +} + + +} + +template +inline I2 copy(I1 first, I1 last, I2 out) +{ + // + // We can copy with memcpy if T has a trivial assignment operator, + // and if the iterator arguments are actually pointers (this last + // requirement we detect with overload resolution): + // + typedef typename std::iterator_traits::value_type value_type; + return detail::copy_imp(first, last, out, boost::has_trivial_assign()); +} + +} // namespace opt + +namespace non_opt +{ + +template +inline I2 copy(I1 first, I1 last, I2 out) +{ + return opt::detail::copy_imp(first, last, out, boost::false_type()); +} + +} + +// +// define some global data: +// +const int array_size = 1000; +int i_array_[array_size] = {0,}; +const int ci_array_[array_size] = {0,}; +char c_array_[array_size] = {0,}; +const char cc_array_[array_size] = { 0,}; +// +// since arrays aren't iterators we define a set of pointer +// aliases into the arrays (otherwise the compiler is entitled +// to deduce the type passed to the template functions as +// T (&)[N] rather than T*). +int* i_array = i_array_; +const int* ci_array = ci_array_; +char* c_array = c_array_; +const char* cc_array = cc_array_; + +const int iter_count = 1000000; + +int cpp_main(int argc, char* argv[]) +{ + boost::timer t; + double result; + int i; + cout << "Measuring times in micro-seconds per 1000 elements processed" << endl << endl; + cout << "testing copy...\n" + "[Some standard library versions may already perform this optimisation.]" << endl; + + // cache load: + opt::copy(ci_array, ci_array + array_size, i_array); + + // time optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::copy(ci_array, ci_array + array_size, i_array); + } + result = t.elapsed(); + cout << "opt::copy: " << result << endl; + + // cache load: + non_opt::copy(ci_array, ci_array + array_size, i_array); + + // time non-optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + non_opt::copy(ci_array, ci_array + array_size, i_array); + } + result = t.elapsed(); + cout << "non_opt::copy: " << result << endl; + + // cache load: + std::copy(ci_array, ci_array + array_size, i_array); + + // time standard version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + std::copy(ci_array, ci_array + array_size, i_array); + } + result = t.elapsed(); + cout << "std::copy: " << result << endl; + + // cache load: + opt::copy(cc_array, cc_array + array_size, c_array); + + // time optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::copy(cc_array, cc_array + array_size, c_array); + } + result = t.elapsed(); + cout << "opt::copy: " << result << endl; + + // cache load: + non_opt::copy(cc_array, cc_array + array_size, c_array); + + // time optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + non_opt::copy(cc_array, cc_array + array_size, c_array); + } + result = t.elapsed(); + cout << "non_opt::copy: " << result << endl; + + // cache load: + std::copy(cc_array, cc_array + array_size, c_array); + + // time standard version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + std::copy(cc_array, cc_array + array_size, c_array); + } + result = t.elapsed(); + cout << "std::copy: " << result << endl; + + return 0; +} + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/examples/fill_example.cpp b/tools/boost_1_65_1/libs/type_traits/examples/fill_example.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3e3af061590ead9f959bab99c31c2780c6e3ad79 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/examples/fill_example.cpp @@ -0,0 +1,200 @@ + +/* + * + * (C) Copyright John Maddock 1999-2005. + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file provides some example of type_traits usage - + * by "optimising" various algorithms: + * + * opt::fill - optimised for trivial copy/small types (cf std::fill) + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) || (defined(std) && defined(__SGI_STL_PORT)) +namespace std{ using :: memset; } +#endif + +using std::cout; +using std::endl; +using std::cin; + +namespace opt{ +// +// fill +// same as std::fill, but uses memset where appropriate +// +namespace detail{ + +template +void do_fill(I first, I last, const T& val, const boost::integral_constant&) +{ + while(first != last) + { + *first = val; + ++first; + } +} + +template +void do_fill(T* first, T* last, const T& val, const boost::true_type&) +{ + std::memset(first, val, last-first); +} + +} + +template +inline void fill(I first, I last, const T& val) +{ + // + // We can do an optimised fill if T has a trivial assignment + // operator and if it's size is one: + // + typedef boost::integral_constant::value && (sizeof(T) == 1)> truth_type; + detail::do_fill(first, last, val, truth_type()); +} + +} // namespace opt + +namespace non_opt{ + +template +inline void fill(I first, I last, const T& val) +{ + opt::detail::do_fill(first, last, val, boost::false_type()); +} + +} + +// +// define some global data: +// +const int array_size = 1000; +int i_array_[array_size] = {0,}; +const int ci_array_[array_size] = {0,}; +char c_array_[array_size] = {0,}; +const char cc_array_[array_size] = { 0,}; +// +// since arrays aren't iterators we define a set of pointer +// aliases into the arrays (otherwise the compiler is entitled +// to deduce the type passed to the template functions as +// T (&)[N] rather than T*). +int* i_array = i_array_; +const int* ci_array = ci_array_; +char* c_array = c_array_; +const char* cc_array = cc_array_; + +const int iter_count = 1000000; + +int cpp_main(int argc, char* argv[]) +{ + boost::timer t; + double result; + int i; + // + // test destroy_array, + // compare destruction time of an array of ints + // with unoptimised form. + // + cout << "Measuring times in micro-seconds per 1000 elements processed" << endl << endl; + + cout << "testing fill(char)...\n" + "[Some standard library versions may already perform this optimisation.]" << endl; + + // cache load: + opt::fill(c_array, c_array + array_size, (char)3); + + // time optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::fill(c_array, c_array + array_size, (char)3); + } + result = t.elapsed(); + cout << "opt::fill: " << result << endl; + + // cache load: + non_opt::fill(c_array, c_array + array_size, (char)3); + + // time optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + non_opt::fill(c_array, c_array + array_size, (char)3); + } + result = t.elapsed(); + cout << "non_opt::fill: " << result << endl; + + // cache load: + std::fill(c_array, c_array + array_size, (char)3); + + // time standard version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + std::fill(c_array, c_array + array_size, (char)3); + } + result = t.elapsed(); + cout << "std::fill: " << result << endl << endl; + + cout << "testing fill(int)...\n" << endl; + + // cache load: + opt::fill(i_array, i_array + array_size, 3); + + // timer optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::fill(i_array, i_array + array_size, 3); + } + result = t.elapsed(); + cout << "opt::fill: " << result << endl; + + // cache load: + non_opt::fill(i_array, i_array + array_size, 3); + + // timer optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + non_opt::fill(i_array, i_array + array_size, 3); + } + result = t.elapsed(); + cout << "non_opt::fill: " << result << endl; + + // cache load: + std::fill(i_array, i_array + array_size, 3); + + // time standard version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + std::fill(i_array, i_array + array_size, 3); + } + result = t.elapsed(); + cout << "std::fill: " << result << endl << endl; + + return 0; +} + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/examples/iter_swap_example.cpp b/tools/boost_1_65_1/libs/type_traits/examples/iter_swap_example.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ea04747f719c4ca243d07c0c52e84688f8a048dd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/examples/iter_swap_example.cpp @@ -0,0 +1,97 @@ + +/* + * + * (C) Copyright John Maddock 1999-2005. + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file provides some example of type_traits usage - + * by "optimising" various algorithms: + * + * opt::iter_swap - uses type_traits to determine whether the iterator is a proxy + * in which case it uses a "safe" approach, otherwise calls swap + * on the assumption that swap may be specialised for the pointed-to type. + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +using std::cout; +using std::endl; +using std::cin; + +namespace opt{ + +// +// iter_swap: +// tests whether iterator is a proxy iterator or not, and +// uses optimal form accordingly: +// +namespace detail{ + +template +static void do_swap(I one, I two, const boost::false_type&) +{ + typedef typename std::iterator_traits::value_type v_t; + v_t v = *one; + *one = *two; + *two = v; +} +template +static void do_swap(I one, I two, const boost::true_type&) +{ + using std::swap; + swap(*one, *two); +} + +} + +template +inline void iter_swap(I1 one, I2 two) +{ + // + // See is both arguments are non-proxying iterators, + // and if both iterator the same type: + // + typedef typename std::iterator_traits::reference r1_t; + typedef typename std::iterator_traits::reference r2_t; + + typedef boost::integral_constant::value + && ::boost::is_reference::value + && ::boost::is_same::value> truth_type; + + detail::do_swap(one, two, truth_type()); +} + + +}; // namespace opt + +int cpp_main(int argc, char* argv[]) +{ + // + // testing iter_swap + // really just a check that it does in fact compile... + std::vector v1; + v1.push_back(0); + v1.push_back(1); + std::vector v2; + v2.push_back(0); + v2.push_back(1); + opt::iter_swap(v1.begin(), v1.begin()+1); + opt::iter_swap(v2.begin(), v2.begin()+1); + + return 0; +} + + + diff --git a/tools/boost_1_65_1/libs/type_traits/examples/trivial_destructor_example.cpp b/tools/boost_1_65_1/libs/type_traits/examples/trivial_destructor_example.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49ee63ab6922608a3f6616f380ce2fd74f71e00a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/examples/trivial_destructor_example.cpp @@ -0,0 +1,153 @@ + +/* + * + * (C) Copyright John Maddock 1999-2005. + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * This file provides some example of type_traits usage - + * by "optimising" various algorithms: + * + * opt::destroy_array - an example of optimisation based upon omitted destructor calls + * + */ + + +#include +#include +#include +#include + +using std::cout; +using std::endl; +using std::cin; + +namespace opt{ + +// +// algorithm destroy_array: +// The reverse of std::unitialized_copy, takes a block of +// initialized memory and calls destructors on all objects therein. +// + +namespace detail{ + +template +void do_destroy_array(T* first, T* last, const boost::false_type&) +{ + while(first != last) + { + first->~T(); + ++first; + } +} + +template +inline void do_destroy_array(T* first, T* last, const boost::true_type&) +{ +} + +} // namespace detail + +template +inline void destroy_array(T* p1, T* p2) +{ + detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor()); +} + +// +// unoptimised versions of destroy_array: +// +template +void destroy_array1(T* first, T* last) +{ + while(first != last) + { + first->~T(); + ++first; + } +} +template +void destroy_array2(T* first, T* last) +{ + for(; first != last; ++first) first->~T(); +} + +} // namespace opt + +// +// define some global data: +// +const int array_size = 1000; +int i_array[array_size] = {0,}; +const int ci_array[array_size] = {0,}; +char c_array[array_size] = {0,}; +const char cc_array[array_size] = { 0,}; + +const int iter_count = 1000000; + + +int cpp_main(int argc, char* argv[]) +{ + boost::timer t; + double result; + int i; + // + // test destroy_array, + // compare destruction time of an array of ints + // with unoptimised form. + // + cout << "Measuring times in micro-seconds per 1000 elements processed" << endl << endl; + cout << "testing destroy_array...\n" + "[Some compilers may be able to optimise the \"unoptimised\"\n versions as well as type_traits does.]" << endl; + + // cache load: + opt::destroy_array(i_array, i_array + array_size); + + // time optimised version: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::destroy_array(i_array, i_array + array_size); + } + result = t.elapsed(); + cout << "destroy_array: " << result << endl; + + // cache load: + opt::destroy_array1(i_array, i_array + array_size); + + // time unoptimised version #1: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::destroy_array1(i_array, i_array + array_size); + } + result = t.elapsed(); + cout << "destroy_array(unoptimised#1): " << result << endl; + + // cache load: + opt::destroy_array2(i_array, i_array + array_size); + + // time unoptimised version #2: + t.restart(); + for(i = 0; i < iter_count; ++i) + { + opt::destroy_array2(i_array, i_array + array_size); + } + result = t.elapsed(); + cout << "destroy_array(unoptimised#2): " << result << endl << endl; + + return 0; +} + + + + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/index.html b/tools/boost_1_65_1/libs/type_traits/index.html new file mode 100644 index 0000000000000000000000000000000000000000..030742009eebb6ee68d1b63ca52fec0bf099e223 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/index.html @@ -0,0 +1,19 @@ + + + + + + +

Automatic redirection failed, please go to + doc/html/index.html.

+

Copyright John Maddock 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt).

+ + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/meta/libraries.json b/tools/boost_1_65_1/libs/type_traits/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..97fcb65ecc9bacf2e0d3a3c4e0e722dfb87f2416 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/meta/libraries.json @@ -0,0 +1,18 @@ +{ + "key": "type_traits", + "name": "Type Traits", + "authors": [ + "John Maddock, Steve Cleary, et al" + ], + "description": "Templates for fundamental properties of types.", + "std": [ + "tr1" + ], + "category": [ + "Generic", + "Metaprogramming" + ], + "maintainers": [ + "John Maddock " + ] +} diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_const_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_const_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b91535b791fe4c0dbcf6a7dbb4291bce22f4572d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_const_test.cpp @@ -0,0 +1,61 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(add_const_test_1, ::tt::add_const, const, const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_2, ::tt::add_const, volatile, volatile const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_3, ::tt::add_const, *, *const) +BOOST_DECL_TRANSFORM_TEST2(add_const_test_4, ::tt::add_const, const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_7, ::tt::add_const, *volatile, *volatile const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_10, ::tt::add_const, const*, const*const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_11, ::tt::add_const, volatile*, volatile*const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_5, ::tt::add_const, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_const_test_6, ::tt::add_const, &, &) +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_DECL_TRANSFORM_TEST(add_const_test_5a, ::tt::add_const, const &&, const&&) +BOOST_DECL_TRANSFORM_TEST(add_const_test_6a, ::tt::add_const, &&, &&) +#endif +BOOST_DECL_TRANSFORM_TEST(add_const_test_8, ::tt::add_const, const [2], const [2]) +BOOST_DECL_TRANSFORM_TEST(add_const_test_9, ::tt::add_const, volatile &, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_const_test_12, ::tt::add_const, [2][3], const[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_const_test_13, ::tt::add_const, (&)[2], (&)[2]) + +TT_TEST_BEGIN(add_const) + + add_const_test_1(); + add_const_test_2(); + add_const_test_3(); + add_const_test_4(); + add_const_test_7(); + add_const_test_10(); + add_const_test_11(); + add_const_test_5(); + add_const_test_6(); + add_const_test_8(); + add_const_test_9(); + add_const_test_12(); + add_const_test_13(); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + add_const_test_5a(); + add_const_test_6a(); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_cv_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_cv_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c1f435315f0c94cca5edc0ee0ff9bdb02223c682 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_cv_test.cpp @@ -0,0 +1,61 @@ + +// (C) Copyright John Maddock 2005. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(add_cv_test_1, ::tt::add_cv, const, const volatile) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_2, ::tt::add_cv, volatile, volatile const) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_3, ::tt::add_cv, *, *const volatile) +BOOST_DECL_TRANSFORM_TEST2(add_cv_test_4, ::tt::add_cv, const volatile) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_7, ::tt::add_cv, *volatile, *volatile const) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_10, ::tt::add_cv, const*, const*const volatile) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_11, ::tt::add_cv, volatile*, volatile*const volatile ) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_5, ::tt::add_cv, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_6, ::tt::add_cv, &, &) +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_DECL_TRANSFORM_TEST(add_cv_test_5a, ::tt::add_cv, const &&, const&&) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_6a, ::tt::add_cv, &&, &&) +#endif +BOOST_DECL_TRANSFORM_TEST(add_cv_test_8, ::tt::add_cv, const [2], const volatile [2]) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_9, ::tt::add_cv, volatile &, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_12, ::tt::add_cv, [2][3], const volatile[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_cv_test_13, ::tt::add_cv, (&)[2], (&)[2]) + +TT_TEST_BEGIN(add_const) + + add_cv_test_1(); + add_cv_test_2(); + add_cv_test_3(); + add_cv_test_4(); + add_cv_test_7(); + add_cv_test_10(); + add_cv_test_11(); + add_cv_test_5(); + add_cv_test_6(); + add_cv_test_8(); + add_cv_test_9(); + add_cv_test_12(); + add_cv_test_13(); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + add_cv_test_5a(); + add_cv_test_6a(); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_lvalue_reference_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_lvalue_reference_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0dd1af1b70373bdccaaa6a4fd59c7a09b1fa881a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_lvalue_reference_test.cpp @@ -0,0 +1,68 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_1, ::tt::add_lvalue_reference, const, const&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_2, ::tt::add_lvalue_reference, volatile, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_3, ::tt::add_lvalue_reference, *, *&) +BOOST_DECL_TRANSFORM_TEST2(add_lvalue_reference_test_4, ::tt::add_lvalue_reference, &) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_5, ::tt::add_lvalue_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_6, ::tt::add_lvalue_reference, &, &) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_7, ::tt::add_lvalue_reference, *volatile, *volatile&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_8, ::tt::add_lvalue_reference, const [2], const (&)[2]) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_9, ::tt::add_lvalue_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_10, ::tt::add_lvalue_reference, const*, const*&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_11, ::tt::add_lvalue_reference, volatile*, volatile*&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_12, ::tt::add_lvalue_reference, const[2][3], const (&)[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_13, ::tt::add_lvalue_reference, (&)[2], (&)[2]) +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_5a, ::tt::add_lvalue_reference, const &&, const&) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_6a, ::tt::add_lvalue_reference, &&, &) +BOOST_DECL_TRANSFORM_TEST(add_lvalue_reference_test_13a, ::tt::add_lvalue_reference, (&&)[2], (&)[2]) +#endif + +TT_TEST_BEGIN(add_lvalue_reference) + + add_lvalue_reference_test_1(); + add_lvalue_reference_test_2(); + add_lvalue_reference_test_3(); + add_lvalue_reference_test_4(); + add_lvalue_reference_test_5(); + add_lvalue_reference_test_6(); + add_lvalue_reference_test_7(); + add_lvalue_reference_test_8(); + add_lvalue_reference_test_9(); + add_lvalue_reference_test_10(); + add_lvalue_reference_test_11(); + add_lvalue_reference_test_12(); + add_lvalue_reference_test_13(); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + add_lvalue_reference_test_5a(); + add_lvalue_reference_test_6a(); + add_lvalue_reference_test_13a(); +#endif + + BOOST_CHECK_TYPE(tt::add_lvalue_reference::type, void); + BOOST_CHECK_TYPE(tt::add_lvalue_reference::type, const void); + BOOST_CHECK_TYPE(tt::add_lvalue_reference::type, const volatile void); + BOOST_CHECK_TYPE(tt::add_lvalue_reference::type, volatile void); + + TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_pointer_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_pointer_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b52eda7f7843242c21ec55257a8c6081f472a50 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_pointer_test.cpp @@ -0,0 +1,41 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_1, ::tt::add_pointer, const, const*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_2, ::tt::add_pointer, volatile, volatile*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_3, ::tt::add_pointer, *, **) +BOOST_DECL_TRANSFORM_TEST2(add_pointer_test_4, ::tt::add_pointer, *) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_7, ::tt::add_pointer, *volatile, *volatile*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_10, ::tt::add_pointer, const*, const**) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_11, ::tt::add_pointer, volatile*, volatile**) + +TT_TEST_BEGIN(add_pointer) + + add_pointer_test_1(); + add_pointer_test_2(); + add_pointer_test_3(); + add_pointer_test_4(); + add_pointer_test_7(); + add_pointer_test_10(); + add_pointer_test_11(); + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_reference_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_reference_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..35cf76ca252424daede572c433c2a859fbaecbcd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_reference_test.cpp @@ -0,0 +1,68 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(add_reference_test_1, ::tt::add_reference, const, const&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_2, ::tt::add_reference, volatile, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_3, ::tt::add_reference, *, *&) +BOOST_DECL_TRANSFORM_TEST2(add_reference_test_4, ::tt::add_reference, &) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_5, ::tt::add_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_6, ::tt::add_reference, &, &) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_7, ::tt::add_reference, *volatile, *volatile&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_8, ::tt::add_reference, const [2], const (&)[2]) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_9, ::tt::add_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_10, ::tt::add_reference, const*, const*&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_11, ::tt::add_reference, volatile*, volatile*&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_12, ::tt::add_reference, const[2][3], const (&)[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_13, ::tt::add_reference, (&)[2], (&)[2]) +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_DECL_TRANSFORM_TEST(add_reference_test_5a, ::tt::add_reference, const &&, const&&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_6a, ::tt::add_reference, &&, &&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_13a, ::tt::add_reference, (&&)[2], (&&)[2]) +#endif + +TT_TEST_BEGIN(add_reference) + + add_reference_test_1(); + add_reference_test_2(); + add_reference_test_3(); + add_reference_test_4(); + add_reference_test_5(); + add_reference_test_6(); + add_reference_test_7(); + add_reference_test_8(); + add_reference_test_9(); + add_reference_test_10(); + add_reference_test_11(); + add_reference_test_12(); + add_reference_test_13(); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + add_reference_test_5a(); + add_reference_test_6a(); + add_reference_test_13a(); +#endif + + BOOST_CHECK_TYPE(tt::add_reference::type, void); + BOOST_CHECK_TYPE(tt::add_reference::type, const void); + BOOST_CHECK_TYPE(tt::add_reference::type, const volatile void); + BOOST_CHECK_TYPE(tt::add_reference::type, volatile void); + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_rvalue_reference_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_rvalue_reference_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..caa28691bd0965032776abcba4283b9cad75559e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_rvalue_reference_test.cpp @@ -0,0 +1,85 @@ + +// Copyright 2010 Vicente J. Botet Escriba +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "../../type_traits/test/test.hpp" +#include "../../type_traits/test/check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_1, ::tt::add_rvalue_reference, const, const) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_2, ::tt::add_rvalue_reference, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_3, ::tt::add_rvalue_reference, *, *) +BOOST_DECL_TRANSFORM_TEST0(add_rvalue_reference_test_4, ::tt::add_rvalue_reference) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_5, ::tt::add_rvalue_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_6, ::tt::add_rvalue_reference, &, &) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_7, ::tt::add_rvalue_reference, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_8, ::tt::add_rvalue_reference, const [2], const [2]) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_9, ::tt::add_rvalue_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_10, ::tt::add_rvalue_reference, const*, const*) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_11, ::tt::add_rvalue_reference, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_12, ::tt::add_rvalue_reference, const[2][3], const [2][3]) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_13, ::tt::add_rvalue_reference, (&)[2], (&)[2]) +#else + +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_1, ::tt::add_rvalue_reference, const, const&&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_2, ::tt::add_rvalue_reference, volatile, volatile&&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_3, ::tt::add_rvalue_reference, *, *&&) +BOOST_DECL_TRANSFORM_TEST2(add_rvalue_reference_test_4, ::tt::add_rvalue_reference, &&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_5, ::tt::add_rvalue_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_6, ::tt::add_rvalue_reference, &, &) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_7, ::tt::add_rvalue_reference, *volatile, *volatile&&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_8, ::tt::add_rvalue_reference, const [2], const (&&) [2]) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_9, ::tt::add_rvalue_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_10, ::tt::add_rvalue_reference, const*, const*&&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_11, ::tt::add_rvalue_reference, volatile*, volatile*&&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_12, ::tt::add_rvalue_reference, const[2][3], const (&&) [2][3]) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_13, ::tt::add_rvalue_reference, (&)[2], (&)[2]) + +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_5a, ::tt::add_rvalue_reference, const &&, const&&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_6a, ::tt::add_rvalue_reference, &&, &&) +BOOST_DECL_TRANSFORM_TEST(add_rvalue_reference_test_13a, ::tt::add_rvalue_reference, (&&)[2], (&&)[2]) +#endif + +TT_TEST_BEGIN(add_rvalue_reference) + + add_rvalue_reference_test_1(); + add_rvalue_reference_test_2(); + add_rvalue_reference_test_3(); + add_rvalue_reference_test_4(); + add_rvalue_reference_test_5(); + add_rvalue_reference_test_6(); + add_rvalue_reference_test_7(); + add_rvalue_reference_test_8(); + add_rvalue_reference_test_9(); + add_rvalue_reference_test_10(); + add_rvalue_reference_test_11(); + add_rvalue_reference_test_12(); + add_rvalue_reference_test_13(); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + add_rvalue_reference_test_5a(); + add_rvalue_reference_test_6a(); + add_rvalue_reference_test_13a(); +#endif + + BOOST_CHECK_TYPE(tt::add_rvalue_reference::type, void); + BOOST_CHECK_TYPE(tt::add_rvalue_reference::type, const void); + BOOST_CHECK_TYPE(tt::add_rvalue_reference::type, const volatile void); + BOOST_CHECK_TYPE(tt::add_rvalue_reference::type, volatile void); + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/add_volatile_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/add_volatile_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cc9aeed58879b7913da0ae810437e6f4ba2def7b --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/add_volatile_test.cpp @@ -0,0 +1,59 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_1, ::tt::add_volatile, const, const volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_2, ::tt::add_volatile, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_3, ::tt::add_volatile, *, *volatile) +BOOST_DECL_TRANSFORM_TEST2(add_volatile_test_4, ::tt::add_volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_7, ::tt::add_volatile, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_10, ::tt::add_volatile, const*, const*volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_11, ::tt::add_volatile, volatile*, volatile*volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_5, ::tt::add_volatile, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_6, ::tt::add_volatile, &, &) +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_6a, ::tt::add_volatile, &&, &&) +#endif +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_8, ::tt::add_volatile, const [2], const volatile [2]) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_9, ::tt::add_volatile, volatile &, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_12, ::tt::add_volatile, [2][3], volatile[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_13, ::tt::add_volatile, (&)[2], (&)[2]) + +TT_TEST_BEGIN(add_volatile) + + add_volatile_test_1(); + add_volatile_test_2(); + add_volatile_test_3(); + add_volatile_test_4(); + add_volatile_test_7(); + add_volatile_test_10(); + add_volatile_test_11(); + add_volatile_test_5(); + add_volatile_test_6(); + add_volatile_test_8(); + add_volatile_test_9(); + add_volatile_test_12(); + add_volatile_test_13(); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + add_volatile_test_6a(); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_a2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_a2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..229f40200ee00ca21366f4e0a9b4eb080e5ec192 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_a2_test.cpp @@ -0,0 +1,128 @@ + +#ifdef _MSC_VER +#pragma pack(2) +#endif + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +# include // max_align and long_long_type +#else +# include +# include +# include +#endif + +template +union must_be_pod +{ + int i; + T t; +}; + +template +inline void no_unused_warning(const volatile T&) +{ +} + +template +void do_check(const T&) +{ + typedef typename tt::aligned_storage::type t1; +#if defined(BOOST_GCC) && (BOOST_GCC < 40800) + // In order to test this with warnings-as-errors with GCC, we need + // a slightly different initializer here to suppress spurious + // GCC warnings (ie to work around a GCC buglet). + t1 as1 = {{{ 0, }}}; +#else + t1 as1 = { 0, }; +#endif + must_be_pod pod1; + no_unused_warning(as1); + no_unused_warning(pod1); + BOOST_TEST_MESSAGE(typeid(t1).name()); + BOOST_CHECK(::tt::alignment_of::value == T::value); + BOOST_CHECK(sizeof(t1) == T::value); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK(::tt::is_pod::value == true); +#endif + typedef typename tt::aligned_storage::type t2; +#if defined(BOOST_GCC) && (BOOST_GCC < 40800) + t2 as2 = {{{ 0, }}}; +#else + t2 as2 = { 0, }; +#endif + must_be_pod pod2; + no_unused_warning(as2); + no_unused_warning(pod2); + BOOST_TEST_MESSAGE(typeid(t2).name()); + BOOST_CHECK(::tt::alignment_of::value == T::value); + BOOST_CHECK(sizeof(t2) == T::value*2); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK(::tt::is_pod::value == true); +#endif + +#ifndef TEST_STD + // Non-Tr1 behaviour: + typedef typename tt::aligned_storage::type t3; +#if defined(BOOST_GCC) && (BOOST_GCC < 40800) + t3 as3 = {{{ 0, }}}; +#else + t3 as3 = { 0, }; +#endif + must_be_pod pod3; + no_unused_warning(as3); + no_unused_warning(pod3); + BOOST_TEST_MESSAGE(typeid(t3).name()); + BOOST_CHECK(::tt::alignment_of::value == ::tt::alignment_of< ::boost::detail::max_align>::value); + BOOST_CHECK((sizeof(t3) % T::value) == 0); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK(::tt::is_pod::value == true); +#endif +#endif +} + +TT_TEST_BEGIN(type_with_alignment) + +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); + +#ifdef BOOST_HAS_LONG_LONG +do_check(tt::integral_constant::value>()); +#endif +#ifdef BOOST_HAS_MS_INT64 +do_check(tt::integral_constant::value>()); +#endif +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); + +TT_TEST_END + + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_empy_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_empy_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..536b06dc78ce3801d93df44ce6da7174aa91c8f0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_empy_test.cpp @@ -0,0 +1,128 @@ + +// (C) Copyright Thorsten Ottosen 2009. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +# include // max_align and long_long_type +#else +# include +# include +# include +#endif + + +namespace +{ + template< unsigned N, unsigned Alignment > + struct alignment_implementation1 + { + boost::detail::aligned_storage::aligned_storage_imp type; + const void* address() const { return type.address(); } + }; + + template< unsigned N, unsigned Alignment > + struct alignment_implementation2 : +#ifndef __BORLANDC__ + private +#else + public +#endif + boost::detail::aligned_storage::aligned_storage_imp + { + typedef boost::detail::aligned_storage::aligned_storage_imp type; + const void* address() const { return static_cast(this)->address(); } + }; + + template< unsigned N, class T > + std::ptrdiff_t get_address1() + { + static alignment_implementation1::value> imp1; + return static_cast(imp1.address()) - reinterpret_cast(&imp1); + } + + template< unsigned N, class T > + std::ptrdiff_t get_address2() + { + static alignment_implementation2::value> imp2; + return static_cast(imp2.address()) - reinterpret_cast(&imp2); + } + + template< class T > + void do_check() + { + std::ptrdiff_t addr1 = get_address1<0,T>(); + std::ptrdiff_t addr2 = get_address2<0,T>(); + // + // @remark: only the empty case differs + // + BOOST_CHECK( addr1 != addr2 ); + + addr1 = get_address1<1,T>(); + addr2 = get_address2<1,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<2,T>(); + addr2 = get_address2<2,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<3,T>(); + addr2 = get_address2<3,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<4,T>(); + addr2 = get_address2<4,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<17,T>(); + addr2 = get_address2<17,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<32,T>(); + addr2 = get_address2<32,T>(); + BOOST_CHECK( addr1 == addr2 ); + } +} + +TT_TEST_BEGIN(type_with_empty_alignment_buffer) + +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); + +#ifdef BOOST_HAS_MS_INT64 +do_check<__int64>(); +#endif +#ifdef BOOST_HAS_LONG_LONG +do_check(); +#endif + +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); +do_check(); + +TT_TEST_END + + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..496ae2cf9feaf51c1ea42774b2a511dfa18a0abd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/aligned_storage_test.cpp @@ -0,0 +1,116 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +# include // max_align and long_long_type +#else +# include +# include +# include +#endif + +template +union must_be_pod +{ + int i; + T t; +}; + +template +inline void no_unused_warning(const volatile T&) +{ +} + +#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(BOOST_INTEL) +#pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + +template +void do_check(const T&) +{ + typedef typename tt::aligned_storage::type t1; + t1 as1 = { 0, }; + must_be_pod pod1; + no_unused_warning(as1); + no_unused_warning(pod1); + BOOST_TEST_MESSAGE(typeid(t1).name()); + BOOST_CHECK(::tt::alignment_of::value == T::value); + BOOST_CHECK(sizeof(t1) == T::value); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK(::tt::is_pod::value == true); +#endif + typedef typename tt::aligned_storage::type t2; + t2 as2 = { 0, }; + must_be_pod pod2; + no_unused_warning(as2); + no_unused_warning(pod2); + BOOST_TEST_MESSAGE(typeid(t2).name()); + BOOST_CHECK(::tt::alignment_of::value == T::value); + BOOST_CHECK(sizeof(t2) == T::value*2); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK(::tt::is_pod::value == true); +#endif + +#ifndef TEST_STD + // Non-Tr1 behaviour: + typedef typename tt::aligned_storage(0UL)>::type t3; + t3 as3 = { 0, }; + must_be_pod pod3; + no_unused_warning(as3); + no_unused_warning(pod3); + BOOST_TEST_MESSAGE(typeid(t3).name()); + BOOST_CHECK(::tt::alignment_of::value == ::tt::alignment_of< ::boost::detail::max_align>::value); + BOOST_CHECK((sizeof(t3) % T::value) == 0); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK(::tt::is_pod::value == true); +#endif + BOOST_CHECK(as3.address() == &as3); + const t3 as4 = { 0, }; + BOOST_CHECK(as4.address() == static_cast(&as4)); +#endif +} + +TT_TEST_BEGIN(type_with_alignment) + +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); + +#ifdef BOOST_HAS_LONG_LONG +do_check(tt::integral_constant::value>()); +#endif +#ifdef BOOST_HAS_MS_INT64 +do_check(tt::integral_constant::value>()); +#endif +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); +do_check(tt::integral_constant::value>()); + +TT_TEST_END + + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/alignment_of_a2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/alignment_of_a2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fe6b66ebbf7bac4b5827aee68946950262338c78 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/alignment_of_a2_test.cpp @@ -0,0 +1,126 @@ + +#ifdef _MSC_VER +#pragma pack(2) +#endif + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +// +// Need to defined some member functions for empty_UDT, +// we don't want to put these in the test.hpp as that +// causes overly-clever compilers to figure out that they can't throw +// which in turn breaks other tests. +// +empty_UDT::empty_UDT(){} +empty_UDT::~empty_UDT(){} +empty_UDT::empty_UDT(const empty_UDT&){} +empty_UDT& empty_UDT::operator=(const empty_UDT&){ return *this; } +bool empty_UDT::operator==(const empty_UDT&)const{ return true; } + + +// +// VC++ emits an awful lot of warnings unless we define these: +#ifdef BOOST_MSVC +# pragma warning(disable:4244 4121) +// +// What follows here is the test case for issue 1946. +// +#include +// This kind of packing is set within MSVC 9.0 headers. +// E.g. std::ostream has it. +#pragma pack(push,8) + +// The issue is gone if Root has no data members +struct Root { int a; }; +// The issue is gone if Root is inherited non-virtually +struct A : virtual public Root {}; + +#pragma pack(pop) +// +// This class has 8-byte alignment but is 44 bytes in size, which means +// that elements in an array of this type will not actually be 8 byte +// aligned. This appears to be an MSVC bug, and throws off our +// alignment calculations: causing us to report a non-sensical 12-byte +// alignment for this type. This is fixed by using the native __alignof +// operator. +// +class issue1946 : + public A +{ +public: + // The issue is gone if the type is not a boost::function. The signature doesn't matter. + typedef boost::function0< void > function_type; + function_type m_function; +}; + +#endif + + +template +struct align_calc +{ + char padding; + T instance; + static std::ptrdiff_t get() + { + static align_calc a; + return reinterpret_cast(&(a.instance)) - reinterpret_cast(&(a.padding)); + } +}; + +#define ALIGNOF(x) align_calc< x>::get() + +TT_TEST_BEGIN(alignment_of) + +#ifndef TEST_STD +// This test is not required to work for non-boost implementations: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, 0); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(char)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(short)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(float)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(double)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long double)); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of< ::boost::long_long_type>::value, ALIGNOF(::boost::long_long_type)); +#endif +#ifdef BOOST_HAS_MS_INT64 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<__int64>::value, ALIGNOF(__int64)); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int[4])); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int(*)(int))); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int*)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(VB)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(VD)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(enum_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(mf2)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(POD_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(empty_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(union_UDT)); + +#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(issue1946)); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/alignment_of_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/alignment_of_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7faaf84d7549af1c8e4c5009c32487270e21f4a5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/alignment_of_test.cpp @@ -0,0 +1,121 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +// +// Need to defined some member function for empty_UDT, +// we don't want to put these in the test.hpp as that +// causes overly-clever compilers to figure out that they can't throw +// which in turn breaks other tests. +// +empty_UDT::empty_UDT(){} +empty_UDT::~empty_UDT(){} +empty_UDT::empty_UDT(const empty_UDT&){} +empty_UDT& empty_UDT::operator=(const empty_UDT&){ return *this; } +bool empty_UDT::operator==(const empty_UDT&)const{ return true; } + +// +// VC++ emits an awful lot of warnings unless we define these: +#ifdef BOOST_MSVC +# pragma warning(disable:4244) +// +// What follows here is the test case for issue 1946. +// +#include +// This kind of packing is set within MSVC 9.0 headers. +// E.g. std::ostream has it. +#pragma pack(push,8) + +// The issue is gone if Root has no data members +struct Root { int a; }; +// The issue is gone if Root is inherited non-virtually +struct A : virtual public Root {}; + +#pragma pack(pop) +// +// This class has 8-byte alignment but is 44 bytes in size, which means +// that elements in an array of this type will not actually be 8 byte +// aligned. This appears to be an MSVC bug, and throws off our +// alignment calculations: causing us to report a non-sensical 12-byte +// alignment for this type. This is fixed by using the native __alignof +// operator. +// +class issue1946 : + public A +{ +public: + // The issue is gone if the type is not a boost::function. The signature doesn't matter. + typedef boost::function0< void > function_type; + function_type m_function; +}; + +#endif + + +template +struct align_calc +{ + char padding; + T instance; + static std::ptrdiff_t get() + { + static align_calc a; + return reinterpret_cast(&(a.instance)) - reinterpret_cast(&(a.padding)); + } +}; + +#define ALIGNOF(x) align_calc< x>::get() + +TT_TEST_BEGIN(alignment_of) + +#ifndef TEST_STD +// This test is not required to work for non-boost implementations: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, 0); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(char)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(short)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(float)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(double)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long double)); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of< ::boost::long_long_type>::value, ALIGNOF(::boost::long_long_type)); +#endif +#ifdef BOOST_HAS_MS_INT64 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<__int64>::value, ALIGNOF(__int64)); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int[4])); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int(*)(int))); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int*)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(VB)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(VD)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(enum_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(mf2)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(POD_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(empty_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(union_UDT)); + +#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(issue1946)); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/check_integral_constant.hpp b/tools/boost_1_65_1/libs/type_traits/test/check_integral_constant.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a21b6c5de6619db8b3d225adf913bc6160801cba --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/check_integral_constant.hpp @@ -0,0 +1,79 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_CHECK_INTEGRAL_CONSTANT_HPP +#define BOOST_CHECK_INTEGRAL_CONSTANT_HPP + +#include "test.hpp" + +namespace boost{ + namespace detail{ + + /* + macro: + BOOST_CHECK_INTEGRAL_CONSTANT(expression, expected_value) + + expression: an integral constant expression to check. + expected_value: the value expected. + */ + + template + struct integral_constant + { + static long value() { return test_value; } + }; + + template + bool tt_compare(T found, U expected) + { return static_cast(found) == expected; } + +#define BOOST_CHECK_INTEGRAL_CONSTANT(expression, expected_value)\ + if(!::boost::detail::tt_compare(::boost::detail::integral_constant<(int)(expression)>::value(), (int)expression)){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had differing values depending upon whether it was used as an integral constant expression or not");\ + }else{\ + BOOST_CHECK_MESSAGE(true, "Validating Integral Constant Expression: \"" << BOOST_STRINGIZE(expression) << "\"");\ + }\ + if(!::boost::detail::tt_compare((int)expression, expected_value))\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had an invalid value (found " << ::boost::detail::integral_constant<(int)(expression)>::value() << ", expected " << expected_value << ")" ) + + /* + macro: + BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(expression, expected_value, alternate_value) + + expression: an integral constant expression to check. + expected_value: the value expected. + alternate_value: an alternative value that results is a warning not a failure if found. + */ + +#define BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(expression, expected_value, alternate_value)\ + if(!::boost::detail::tt_compare(::boost::detail::integral_constant<(int)(expression)>::value(), (int)expression)){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had differing values depending upon whether it was used as an integral constant expression or not");\ + }else{\ + BOOST_CHECK_MESSAGE(true, "Validating Integral Constant Expression: \"" << BOOST_STRINGIZE(expression) << "\"");\ + }\ + if(!::boost::detail::tt_compare((int)expression, expected_value))\ + {\ + if(!::boost::detail::tt_compare((int)expression, alternate_value))\ + {\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had an invalid value (found " << ::boost::detail::integral_constant<(int)(expression)>::value() << ", expected " << expected_value << ")" );\ + }\ + else\ + {\ + BOOST_WARN_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" did not have the value we wish it to have (found " << ::boost::detail::integral_constant<(int)(expression)>::value() << ", expected " << expected_value << ")" );\ + }\ + } + + + }//detail +}//boost + + +#endif + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/check_type.hpp b/tools/boost_1_65_1/libs/type_traits/test/check_type.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7bd0779fc43dc663d48ab47b254365e8751b8cdd --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/check_type.hpp @@ -0,0 +1,67 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_CHECK_TYPE_HPP +#define BOOST_CHECK_TYPE_HPP + +#include "test.hpp" +#include + +/* +macro: +BOOST_CHECK_TYPE(type_expression, expected_type) + +type_expression: an expression that evaluates to a typename. +expected_value: the type we expect to find. +*/ + +#ifdef __BORLANDC__ +#pragma option -w-8008 -w-8066 -w-8019 +#endif + + +#define BOOST_CHECK_TYPE(type_expression, expected_type)\ +do{\ + if(!::boost::is_same< type_expression, expected_type >::value){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\ + << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\ + << BOOST_STRINGIZE(type_expression) << ", " << BOOST_STRINGIZE(expected_type)\ + << ">" << "\n\tfound: "\ + << typeid(::boost::is_same< type_expression, expected_type >).name());\ + }else\ + BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\ + << BOOST_STRINGIZE(expression) << "\"");\ +}while(0) + +#define BOOST_CHECK_TYPE3(type_expression, type_expression_suffix, expected_type)\ +do{\ + if(!::boost::is_same< type_expression, type_expression_suffix, expected_type >::value){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\ + << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\ + << BOOST_STRINGIZE((type_expression, type_expression_suffix)) << ", " << BOOST_STRINGIZE(expected_type)\ + << ">" << "\n\tfound: "\ + << typeid(::boost::is_same< type_expression, type_expression_suffix, expected_type >).name());\ + }else\ + BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\ + << BOOST_STRINGIZE(expression) << "\"");\ +}while(0) + +#define BOOST_CHECK_TYPE4(type_expression, suffix1, suffix2, expected_type)\ +do{\ + if(!::boost::is_same< type_expression, suffix1, suffix2, expected_type >::value){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\ + << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\ + << BOOST_STRINGIZE((type_expression, suffix1, suffix2)) << ", " << BOOST_STRINGIZE(expected_type)\ + << ">" << "\n\tfound: "\ + << typeid(::boost::is_same< type_expression, suffix1, suffix2, expected_type >).name());\ + }else\ + BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\ + << BOOST_STRINGIZE(expression) << "\"");\ +}while(0) + +#endif + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..114b4c281f4b77c2c3a5fc7bd83ee32bdb5dee39 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_2_test.cpp @@ -0,0 +1,222 @@ +// common_type_test.cpp ----------------------------------------------------// + +// Copyright 2010 Beman Dawes + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#define BOOST_COMMON_TYPE_DONT_USE_TYPEOF 1 + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +#ifdef BOOST_INTEL +#pragma warning(disable: 304 383) +#endif + +struct C1 {}; + +struct C2 {}; + + +struct C3 : C2 {}; +struct C1C2 { + C1C2() {} + C1C2(C1 const&) {} + C1C2(C2 const&) {} + C1C2& operator=(C1C2 const&) { + return *this; + } +}; + +template +void proc2(typename boost::common_type::type const& ) {} + +template +void proc3(typename boost::common_type::type const& ) {} + +template +void assignation_2() { +typedef typename boost::common_type::type AC; + A a; + C c; + AC ac; + ac=a; + ac=c; + + proc2(a); + proc2(c); + +} + +template +void assignation_3() { +typedef typename boost::common_type::type ABC; + A a; + B b; + C c; + ABC abc; + + abc=a; + abc=b; + abc=c; + + proc3(a); + proc3(b); + proc3(c); +} + +C1C2 c1c2; +C1 c1; + +int f(C1C2 ) { return 1;} +int f(C1 ) { return 2;} +template +OSTREAM& operator<<(OSTREAM& os, C1 const&) {return os;} + +C1C2& declval_C1C2() {return c1c2;} +C1& declval_C1(){return c1;} +bool declval_bool(){return true;} + + +TT_TEST_BEGIN(common_type) +{ +#ifndef __SUNPRO_CC + assignation_2(); + typedef tt::common_type::type T1; + BOOST_CHECK_TYPE(T1, C1C2); + typedef tt::common_type::type T2; + BOOST_CHECK_TYPE(T2, C2*); + typedef tt::common_type::type T3; + BOOST_CHECK_TYPE(T3, int const*); +#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) + // fails if BOOST_COMMON_TYPE_DONT_USE_TYPEOF: + typedef tt::common_type::type T4; + BOOST_CHECK_TYPE(T4, int const volatile*); +#endif + typedef tt::common_type::type T5; + BOOST_CHECK_TYPE(T5, int volatile*); + + assignation_2(); + assignation_2(); + assignation_2(); + assignation_3(); + assignation_3(); + assignation_3(); + assignation_3(); + //assignation_3(); // fails because the common type is the third +#endif + + typedef tt::common_type::type t1; + BOOST_CHECK_TYPE(t1, C1C2); + + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE(tt::common_type::type, char); + + BOOST_CHECK_TYPE3(tt::common_type::type, char); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned char); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, short); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned short); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, double); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE4(tt::common_type::type, double); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE4(tt::common_type::type, boost::long_long_type); +#endif +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_3_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_3_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fd228b82c74d0c14d22d906588840dd6fe284bbc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_3_test.cpp @@ -0,0 +1,22 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(common_type_3) +{ + // just check whether the nullary specialization compiles + tt::common_type<> tmp; + (void)tmp; +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_4_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_4_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3a6659fa3276397ad358140956bc3fe630f31b17 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_4_test.cpp @@ -0,0 +1,57 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(common_type_4) +{ + // the unary case should be the same as decay + + BOOST_CHECK_TYPE(tt::common_type::type, void); + BOOST_CHECK_TYPE(tt::common_type::type, void); + BOOST_CHECK_TYPE(tt::common_type::type, void); + BOOST_CHECK_TYPE(tt::common_type::type, void); + + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + + BOOST_CHECK_TYPE(tt::common_type::type, char*); + BOOST_CHECK_TYPE(tt::common_type::type, char const*); + BOOST_CHECK_TYPE(tt::common_type::type, char volatile*); + BOOST_CHECK_TYPE(tt::common_type::type, char const volatile*); + + BOOST_CHECK_TYPE(tt::common_type::type, char*); + BOOST_CHECK_TYPE(tt::common_type::type, char const*); + BOOST_CHECK_TYPE(tt::common_type::type, char volatile*); + BOOST_CHECK_TYPE(tt::common_type::type, char const volatile*); + + BOOST_CHECK_TYPE(tt::common_type::type, char*); + BOOST_CHECK_TYPE(tt::common_type::type, char const*); + BOOST_CHECK_TYPE(tt::common_type::type, char volatile*); + BOOST_CHECK_TYPE(tt::common_type::type, char const volatile*); + + BOOST_CHECK_TYPE(tt::common_type::type, char(*)()); + + BOOST_CHECK_TYPE(tt::common_type::type, UDT(*)()); + BOOST_CHECK_TYPE(tt::common_type::type, UDT const(*)()); + BOOST_CHECK_TYPE(tt::common_type::type, UDT volatile(*)()); + BOOST_CHECK_TYPE(tt::common_type::type, UDT const volatile(*)()); +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_5_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_5_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0a0e237db005212650b4548c723d2a967b5a9146 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_5_test.cpp @@ -0,0 +1,56 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +template struct X +{ + T t_; + + X(): t_() {} + template X( X const & x ): t_( x.t_ ) {} +}; + +namespace boost +{ + + template struct common_type< X, X > + { + typedef X::type> type; + }; + +} // namespace boost + +TT_TEST_BEGIN(common_type_5) +{ + // user specializations, binary + + BOOST_CHECK_TYPE3( tt::common_type< X, X >::type, X ); + + BOOST_CHECK_TYPE3( tt::common_type< X&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X&, X const& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X const& >::type, X ); + + BOOST_CHECK_TYPE3( tt::common_type< X, X >::type, X ); + + BOOST_CHECK_TYPE3( tt::common_type< X&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X&, X const& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X const& >::type, X ); + + // ternary + + BOOST_CHECK_TYPE4( tt::common_type< X&, X const&, X volatile& >::type, X ); +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_6_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_6_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e5ad7745cdfb2ff204cc8c7762a6fad43732698c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_6_test.cpp @@ -0,0 +1,39 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +struct X {}; +struct Y: X {}; + +TT_TEST_BEGIN(common_type_6) +{ + // binary case + + BOOST_CHECK_TYPE3(tt::common_type::type, void); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_fail.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2b522526b276e5b2ac9a7bc0cee3b44b3ac46619 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_fail.cpp @@ -0,0 +1,27 @@ +// common_type_test.cpp ----------------------------------------------------// + +// Copyright 2010 Beman Dawes + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#define _CRT_SECURE_NO_WARNINGS // disable VC++ foolishness + +#include "test.hpp" +#ifndef TEST_STD +#include +#else +#include +#endif + +struct C1 { + //~ private: + //~ C1(); +}; + +struct C2 {}; + + + +typedef tt::common_type::type AC; + diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_sfinae2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_sfinae2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2e585cf472839a1a20dfec8f665fbe23efa653a4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_sfinae2_test.cpp @@ -0,0 +1,39 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +# include +#endif +#include + +typedef char(&s1)[1]; +typedef char(&s2)[2]; + +template s1 has_type_impl( typename T::type * ); +template s2 has_type_impl( ... ); + +template struct has_type: tt::integral_constant(0)) == sizeof(s1)> {}; + +struct X {}; +struct Y {}; + +TT_TEST_BEGIN(common_type_sfinae2) +{ +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + +#endif +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_sfinae_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_sfinae_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55aa3fea493af79f239aa749aa6e860231bbb9b2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_sfinae_test.cpp @@ -0,0 +1,45 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +struct X {}; +struct Y {}; + +TT_TEST_BEGIN(common_type_sfinae) +{ +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + + { + tt::common_type tmp; + (void)tmp; + } + + { + tt::common_type tmp; + (void)tmp; + } + + { + tt::common_type tmp; + (void)tmp; + } + + { + tt::common_type tmp; + (void)tmp; + } + +#endif +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/common_type_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/common_type_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3695a46b35c32b41b31a3a2295b892434d03ca72 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/common_type_test.cpp @@ -0,0 +1,221 @@ +// common_type_test.cpp ----------------------------------------------------// + +// Copyright 2010 Beman Dawes + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +#ifdef BOOST_INTEL +#pragma warning(disable: 304 383) +#endif + +struct C1 {}; + +struct C2 {}; + + +struct C3 : C2 {}; +struct C1C2 { + C1C2() {} + C1C2(C1 const&) {} + C1C2(C2 const&) {} + C1C2& operator=(C1C2 const&) { + return *this; + } +}; + +template +void proc2(typename boost::common_type::type const& ) {} + +template +void proc3(typename boost::common_type::type const& ) {} + +template +void assignation_2() { +typedef typename boost::common_type::type AC; + A a; + C c; + AC ac; + ac=a; + ac=c; + + proc2(a); + proc2(c); + +} + +template +void assignation_3() { +typedef typename boost::common_type::type ABC; + A a; + B b; + C c; + ABC abc; + + abc=a; + abc=b; + abc=c; + + proc3(a); + proc3(b); + proc3(c); +} + +C1C2 c1c2; +C1 c1; + +int f(C1C2 ) { return 1;} +int f(C1 ) { return 2;} +template +OSTREAM& operator<<(OSTREAM& os, C1 const&) {return os;} + +C1C2& declval_C1C2() {return c1c2;} +C1& declval_C1(){return c1;} +bool declval_bool(){return true;} + + +TT_TEST_BEGIN(common_type) +{ + assignation_2(); + typedef tt::common_type::type T1; + BOOST_CHECK_TYPE(T1, C1C2); + typedef tt::common_type::type T2; + BOOST_CHECK_TYPE(T2, C2*); + typedef tt::common_type::type T3; + BOOST_CHECK_TYPE(T3, int const*); +#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) + // fails if BOOST_COMMON_TYPE_DONT_USE_TYPEOF: + typedef tt::common_type::type T4; + BOOST_CHECK_TYPE(T4, int const volatile*); +#endif + typedef tt::common_type::type T5; + BOOST_CHECK_TYPE(T5, int volatile*); + + assignation_2(); + assignation_2(); + assignation_2(); + assignation_3(); + assignation_3(); + assignation_3(); + assignation_3(); + //assignation_3(); // fails because the common type is the third + + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE(tt::common_type::type, char); + + BOOST_CHECK_TYPE3(tt::common_type::type, char); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned char); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, short); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned short); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); + BOOST_CHECK_TYPE3(tt::common_type::type, unsigned int); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::long_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, boost::ulong_long_type); + BOOST_CHECK_TYPE3(tt::common_type::type, double); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE3(tt::common_type::type, double); + BOOST_CHECK_TYPE3(tt::common_type::type, double); +#endif + BOOST_CHECK_TYPE3(tt::common_type::type, double); + + BOOST_CHECK_TYPE4(tt::common_type::type, double); +#ifndef BOOST_NO_LONG_LONG + BOOST_CHECK_TYPE4(tt::common_type::type, boost::long_long_type); +#endif + + //changes related to defect LWG2141 + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, long); +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/conditional_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/conditional_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1cc35342df55ef3a26e1afad6376f4634c436a4f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/conditional_test.cpp @@ -0,0 +1,31 @@ + +// (C) Copyright John Maddock 2010. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(conditional) + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::conditional::type, int>::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::conditional::type, long>::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::conditional::type, long>::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::conditional::type, int>::value), false); + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/copy_cv_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/copy_cv_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2f4f2813b96b5411911894745241fe6960fb7397 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/copy_cv_test.cpp @@ -0,0 +1,44 @@ + +// Copyright Peter Dimov 2015 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(copy_cv) +{ + BOOST_CHECK_TYPE3(tt::copy_cv::type, int); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int&); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const* volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, long); +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/cxx14_aliases_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/cxx14_aliases_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f7d6ab4320018cb95a0f33e28ef718366b8a0f5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/cxx14_aliases_test.cpp @@ -0,0 +1,46 @@ + +// Copyright Peter Dimov 2017 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(cxx14_aliases_test) +{ +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + + BOOST_CHECK_TYPE(tt::add_const_t, int const); + BOOST_CHECK_TYPE(tt::add_cv_t, int const volatile); + BOOST_CHECK_TYPE(tt::add_lvalue_reference_t, int&); + BOOST_CHECK_TYPE(tt::add_pointer_t, int*); + BOOST_CHECK_TYPE(tt::add_rvalue_reference_t, int&&); + BOOST_CHECK_TYPE(tt::add_volatile_t, int volatile); + BOOST_CHECK_TYPE3(tt::common_type_t, int); + BOOST_CHECK_TYPE4(tt::conditional_t, char); + BOOST_CHECK_TYPE4(tt::conditional_t, short); + BOOST_CHECK_TYPE3(tt::copy_cv_t, char const volatile); + BOOST_CHECK_TYPE(tt::decay_t, char const*); + BOOST_CHECK_TYPE(tt::make_signed_t, signed char); + BOOST_CHECK_TYPE(tt::make_unsigned_t, unsigned char); + BOOST_CHECK_TYPE(tt::remove_all_extents_t, int); + BOOST_CHECK_TYPE(tt::remove_const_t, int); + BOOST_CHECK_TYPE(tt::remove_cv_t, int); + BOOST_CHECK_TYPE(tt::remove_extent_t, int); + BOOST_CHECK_TYPE(tt::remove_pointer_t, int); + BOOST_CHECK_TYPE(tt::remove_reference_t, int); + BOOST_CHECK_TYPE(tt::remove_volatile_t, int); + BOOST_CHECK_TYPE(tt::floating_point_promotion_t, double); + BOOST_CHECK_TYPE(tt::integral_promotion_t, int); + BOOST_CHECK_TYPE(tt::promote_t, int); + +#endif +} +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/decay_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/decay_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cf22e1567ba36b5c4233bf66df7acfd5b881075e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/decay_test.cpp @@ -0,0 +1,163 @@ + +// (C) Copyright John Maddock & Thorsten Ottosen 2005. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +# include +#endif +#include +#include +#include + +#ifdef BOOST_INTEL +// remark #383: value copied to temporary, reference to temporary used +// std::pair p2 = boost::make_pair( "foo", 1 ); +// ^ +#pragma warning(disable:383) +#endif + +namespace boost +{ + + int proc1() + { + return 0; + } + int proc2(int c) + { + return c; + } + + // + // An almost optimal version of std::make_pair() + // + template< class F, class S > + inline std::pair< BOOST_DEDUCED_TYPENAME tt::decay::type, + BOOST_DEDUCED_TYPENAME tt::decay::type > + make_pair( const F& f, const S& s ) + { + return std::pair< BOOST_DEDUCED_TYPENAME tt::decay::type, + BOOST_DEDUCED_TYPENAME tt::decay::type >( f, s ); + } + + /* + This overload will mess up vc7.1 + + template< class F, class S > + inline std::pair< BOOST_DEDUCED_TYPENAME ::tt::decay::type, + BOOST_DEDUCED_TYPENAME ::tt::decay::type > + make_pair( F& f, S& s ) + { + return std::pair< BOOST_DEDUCED_TYPENAME ::tt::decay::type, + BOOST_DEDUCED_TYPENAME ::tt::decay::type >( f, s ); + } + */ +} + +BOOST_DECL_TRANSFORM_TEST3(decay_test_1, ::tt::decay, const) +BOOST_DECL_TRANSFORM_TEST3(decay_test_2, ::tt::decay, volatile) +BOOST_DECL_TRANSFORM_TEST3(decay_test_3, ::tt::decay, const volatile) +BOOST_DECL_TRANSFORM_TEST3(decay_test_4, ::tt::decay, const&) +BOOST_DECL_TRANSFORM_TEST3(decay_test_5, ::tt::decay, volatile&) +BOOST_DECL_TRANSFORM_TEST3(decay_test_6, ::tt::decay, const volatile&) +BOOST_DECL_TRANSFORM_TEST(decay_test_7, ::tt::decay, const*, const*) +BOOST_DECL_TRANSFORM_TEST(decay_test_8, ::tt::decay, [], *) +BOOST_DECL_TRANSFORM_TEST(decay_test_9, ::tt::decay, [2], *) +BOOST_DECL_TRANSFORM_TEST(decay_test_10, ::tt::decay, [2][3], (*)[3]) +BOOST_DECL_TRANSFORM_TEST(decay_test_11, ::tt::decay, const[], const*) +BOOST_DECL_TRANSFORM_TEST(decay_test_12, ::tt::decay, const[2], const*) +BOOST_DECL_TRANSFORM_TEST(decay_test_13, ::tt::decay, const[2][3], const(*)[3]) +BOOST_DECL_TRANSFORM_TEST(decay_test_14, ::tt::decay, (int), (*)(int)) + + +TT_TEST_BEGIN(decay) + + decay_test_1(); + decay_test_2(); + decay_test_3(); + decay_test_4(); + decay_test_5(); + decay_test_6(); + decay_test_7(); + decay_test_8(); + decay_test_9(); + decay_test_10(); + decay_test_11(); + decay_test_12(); + decay_test_13(); + decay_test_14(); + + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,int>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,char*>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,char(*)[3]>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,const char*>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,wchar_t*>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,const wchar_t*>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,const wchar_t*>::value), + true ); + + typedef int f1_type(void); + typedef int f2_type(int); + + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,int (*)(void)>::value), + true ); + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + ::tt::decay::type,int (*)(int)>::value), + true ); + +#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS + // + // Don't test this if the std lib has no templated constructors (Oracle+STLPort): + // + std::pair p = boost::make_pair( "foo", "bar" ); + std::pair p2 = boost::make_pair( "foo", 1 ); +#ifndef BOOST_NO_STD_WSTRING + std::pair p3 = boost::make_pair( L"foo", "bar" ); + std::pair p4 = boost::make_pair( L"foo", 1 ); +#endif +#endif + // + // Todo: make these work sometime. The test id not directly + // related to decay::type and can be avoided for now. + // + /* + int array[10]; + std::pair p5 = boost::make_pair( array, array ); +#ifndef __BORLANDC__ + std::pair p6 = boost::make_pair(boost::proc1, boost::proc2); + p6.first(); + p6.second(1); +#endif + */ + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/extent_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/extent_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..007896cf8c23368ef182d9afbfd642e56cacd86c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/extent_test.cpp @@ -0,0 +1,49 @@ + +// (C) Copyright John Maddock 2005. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +TT_TEST_BEGIN(extent) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 5); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 5); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 0); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 0); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 10); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 10); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 10); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 0); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 0); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 0); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 40); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent::value), 0); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent::value, 0); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/function_traits_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/function_traits_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f08e8101f57fe10704219822252f789499131bc0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/function_traits_test.cpp @@ -0,0 +1,68 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +typedef void(pf_zero1)(); +typedef int(pf_zero2)(); +typedef const int& (pf_zero3)(); +typedef void(pf_one1)(int); +typedef int(pf_one2)(int); +typedef const int&(pf_one3)(const int&); +typedef void(pf_two1)(int,int); +typedef int(pf_two2)(int,int); +typedef const int&(pf_two3)(const int&,const int&); + + +TT_TEST_BEGIN(function_traits) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 1); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 1); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 1); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 2); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 2); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 2); + +BOOST_CHECK_TYPE(void, ::tt::function_traits::result_type); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, const int&); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, void); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, const int&); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, void); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, const int&); + +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, const int&); + +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, const int&); +BOOST_CHECK_TYPE(::tt::function_traits::arg2_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg2_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg2_type, const int&); + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes.hpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1ecf60de55908a428c70bfe06cd0501f1562fdb0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes.hpp @@ -0,0 +1,252 @@ +// (C) Copyright Frederic Bron 2009-2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef TT_HAS_BINARY_CLASSES_HPP +#define TT_HAS_BINARY_CLASSES_HPP + +struct ret { }; +ret ret_val; + +class C000 { C000(); public: C000(int) { } }; +void operator+(C000, C000) { } + +class C001 { C001(); public: C001(int) { } }; +ret operator+(C001, C001) { return ret_val; } + +class C002 { C002(); public: C002(int) { } }; +ret const operator+(C002, C002) { return ret_val; } + +class C005 { C005(); public: C005(int) { } }; +ret & operator+(C005, C005) { return ret_val; } + +class C006 { C006(); public: C006(int) { } }; +ret const & operator+(C006, C006) { return ret_val; } + +class C009 { C009(); public: C009(int) { } }; +void operator+(C009, C009 const) { } + +class C010 { C010(); public: C010(int) { } }; +ret operator+(C010, C010 const) { return ret_val; } + +class C011 { C011(); public: C011(int) { } }; +ret const operator+(C011, C011 const) { return ret_val; } + +class C014 { C014(); public: C014(int) { } }; +ret & operator+(C014, C014 const) { return ret_val; } + +class C015 { C015(); public: C015(int) { } }; +ret const & operator+(C015, C015 const) { return ret_val; } + +class C036 { C036(); public: C036(int) { } }; +void operator+(C036, C036 &) { } + +class C037 { C037(); public: C037(int) { } }; +ret operator+(C037, C037 &) { return ret_val; } + +class C038 { C038(); public: C038(int) { } }; +ret const operator+(C038, C038 &) { return ret_val; } + +class C041 { C041(); public: C041(int) { } }; +ret & operator+(C041, C041 &) { return ret_val; } + +class C042 { C042(); public: C042(int) { } }; +ret const & operator+(C042, C042 &) { return ret_val; } + +class C045 { C045(); public: C045(int) { } }; +void operator+(C045, C045 const &) { } + +class C046 { C046(); public: C046(int) { } }; +ret operator+(C046, C046 const &) { return ret_val; } + +class C047 { C047(); public: C047(int) { } }; +ret const operator+(C047, C047 const &) { return ret_val; } + +class C050 { C050(); public: C050(int) { } }; +ret & operator+(C050, C050 const &) { return ret_val; } + +class C051 { C051(); public: C051(int) { } }; +ret const & operator+(C051, C051 const &) { return ret_val; } + +class C072 { C072(); public: C072(int) { } }; +void operator+(C072 const, C072) { } + +class C073 { C073(); public: C073(int) { } }; +ret operator+(C073 const, C073) { return ret_val; } + +class C074 { C074(); public: C074(int) { } }; +ret const operator+(C074 const, C074) { return ret_val; } + +class C077 { C077(); public: C077(int) { } }; +ret & operator+(C077 const, C077) { return ret_val; } + +class C078 { C078(); public: C078(int) { } }; +ret const & operator+(C078 const, C078) { return ret_val; } + +class C081 { C081(); public: C081(int) { } }; +void operator+(C081 const, C081 const) { } + +class C082 { C082(); public: C082(int) { } }; +ret operator+(C082 const, C082 const) { return ret_val; } + +class C083 { C083(); public: C083(int) { } }; +ret const operator+(C083 const, C083 const) { return ret_val; } + +class C086 { C086(); public: C086(int) { } }; +ret & operator+(C086 const, C086 const) { return ret_val; } + +class C087 { C087(); public: C087(int) { } }; +ret const & operator+(C087 const, C087 const) { return ret_val; } + +class C108 { C108(); public: C108(int) { } }; +void operator+(C108 const, C108 &) { } + +class C109 { C109(); public: C109(int) { } }; +ret operator+(C109 const, C109 &) { return ret_val; } + +class C110 { C110(); public: C110(int) { } }; +ret const operator+(C110 const, C110 &) { return ret_val; } + +class C113 { C113(); public: C113(int) { } }; +ret & operator+(C113 const, C113 &) { return ret_val; } + +class C114 { C114(); public: C114(int) { } }; +ret const & operator+(C114 const, C114 &) { return ret_val; } + +class C117 { C117(); public: C117(int) { } }; +void operator+(C117 const, C117 const &) { } + +class C118 { C118(); public: C118(int) { } }; +ret operator+(C118 const, C118 const &) { return ret_val; } + +class C119 { C119(); public: C119(int) { } }; +ret const operator+(C119 const, C119 const &) { return ret_val; } + +class C122 { C122(); public: C122(int) { } }; +ret & operator+(C122 const, C122 const &) { return ret_val; } + +class C123 { C123(); public: C123(int) { } }; +ret const & operator+(C123 const, C123 const &) { return ret_val; } + +class C288 { C288(); public: C288(int) { } }; +void operator+(C288 &, C288) { } + +class C289 { C289(); public: C289(int) { } }; +ret operator+(C289 &, C289) { return ret_val; } + +class C290 { C290(); public: C290(int) { } }; +ret const operator+(C290 &, C290) { return ret_val; } + +class C293 { C293(); public: C293(int) { } }; +ret & operator+(C293 &, C293) { return ret_val; } + +class C294 { C294(); public: C294(int) { } }; +ret const & operator+(C294 &, C294) { return ret_val; } + +class C297 { C297(); public: C297(int) { } }; +void operator+(C297 &, C297 const) { } + +class C298 { C298(); public: C298(int) { } }; +ret operator+(C298 &, C298 const) { return ret_val; } + +class C299 { C299(); public: C299(int) { } }; +ret const operator+(C299 &, C299 const) { return ret_val; } + +class C302 { C302(); public: C302(int) { } }; +ret & operator+(C302 &, C302 const) { return ret_val; } + +class C303 { C303(); public: C303(int) { } }; +ret const & operator+(C303 &, C303 const) { return ret_val; } + +class C324 { C324(); public: C324(int) { } }; +void operator+(C324 &, C324 &) { } + +class C325 { C325(); public: C325(int) { } }; +ret operator+(C325 &, C325 &) { return ret_val; } + +class C326 { C326(); public: C326(int) { } }; +ret const operator+(C326 &, C326 &) { return ret_val; } + +class C329 { C329(); public: C329(int) { } }; +ret & operator+(C329 &, C329 &) { return ret_val; } + +class C330 { C330(); public: C330(int) { } }; +ret const & operator+(C330 &, C330 &) { return ret_val; } + +class C333 { C333(); public: C333(int) { } }; +void operator+(C333 &, C333 const &) { } + +class C334 { C334(); public: C334(int) { } }; +ret operator+(C334 &, C334 const &) { return ret_val; } + +class C335 { C335(); public: C335(int) { } }; +ret const operator+(C335 &, C335 const &) { return ret_val; } + +class C338 { C338(); public: C338(int) { } }; +ret & operator+(C338 &, C338 const &) { return ret_val; } + +class C339 { C339(); public: C339(int) { } }; +ret const & operator+(C339 &, C339 const &) { return ret_val; } + +class C360 { C360(); public: C360(int) { } }; +void operator+(C360 const &, C360) { } + +class C361 { C361(); public: C361(int) { } }; +ret operator+(C361 const &, C361) { return ret_val; } + +class C362 { C362(); public: C362(int) { } }; +ret const operator+(C362 const &, C362) { return ret_val; } + +class C365 { C365(); public: C365(int) { } }; +ret & operator+(C365 const &, C365) { return ret_val; } + +class C366 { C366(); public: C366(int) { } }; +ret const & operator+(C366 const &, C366) { return ret_val; } + +class C369 { C369(); public: C369(int) { } }; +void operator+(C369 const &, C369 const) { } + +class C370 { C370(); public: C370(int) { } }; +ret operator+(C370 const &, C370 const) { return ret_val; } + +class C371 { C371(); public: C371(int) { } }; +ret const operator+(C371 const &, C371 const) { return ret_val; } + +class C374 { C374(); public: C374(int) { } }; +ret & operator+(C374 const &, C374 const) { return ret_val; } + +class C375 { C375(); public: C375(int) { } }; +ret const & operator+(C375 const &, C375 const) { return ret_val; } + +class C396 { C396(); public: C396(int) { } }; +void operator+(C396 const &, C396 &) { } + +class C397 { C397(); public: C397(int) { } }; +ret operator+(C397 const &, C397 &) { return ret_val; } + +class C398 { C398(); public: C398(int) { } }; +ret const operator+(C398 const &, C398 &) { return ret_val; } + +class C401 { C401(); public: C401(int) { } }; +ret & operator+(C401 const &, C401 &) { return ret_val; } + +class C402 { C402(); public: C402(int) { } }; +ret const & operator+(C402 const &, C402 &) { return ret_val; } + +class C405 { C405(); public: C405(int) { } }; +void operator+(C405 const &, C405 const &) { } + +class C406 { C406(); public: C406(int) { } }; +ret operator+(C406 const &, C406 const &) { return ret_val; } + +class C407 { C407(); public: C407(int) { } }; +ret const operator+(C407 const &, C407 const &) { return ret_val; } + +class C410 { C410(); public: C410(int) { } }; +ret & operator+(C410 const &, C410 const &) { return ret_val; } + +class C411 { C411(); public: C411(int) { } }; +ret const & operator+(C411 const &, C411 const &) { return ret_val; } + +#endif diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes0_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes0_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a0aa635f66eeec5db0e816388217d974a1f085ec --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes0_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000, C000, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000, C000 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000, C000 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000, C000 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000, C000 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const, C000, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const, C000 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const, C000 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const, C000 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const, C000 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 &, C000, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 &, C000, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 &, C000, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 &, C000 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 &, C000 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 &, C000 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const &, C000, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const &, C000 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const &, C000 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const &, C000 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C000 const &, C000 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001, C001, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001, C001 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001, C001 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001, C001 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const, C001 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const, C001 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const, C001 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const, C001 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const, C001 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 &, C001 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C001 const &, C001 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002, C002 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const, C002, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const, C002 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const, C002 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const, C002 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const, C002 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const, C002 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 &, C002 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C002 const &, C002 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005, C005 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const, C005, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const, C005, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const, C005 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const, C005 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const, C005 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const, C005 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 &, C005 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C005 const &, C005 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006, C006, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006, C006 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006, C006 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const, C006 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 &, C006 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const &, C006, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const &, C006 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const &, C006 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const &, C006 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const &, C006 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C006 const &, C006 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009, C009 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const, C009 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 &, C009 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C009 const &, C009 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010, C010 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const, C010 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 &, C010, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 &, C010, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 &, C010 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 &, C010 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 &, C010 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C010 const &, C010 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011, C011 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const, C011 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 &, C011 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C011 const &, C011 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014, ret const >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes1_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes1_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..136e3b879d882d84a859a4f3f24a5c779f353cb4 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes1_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 &, C014 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const &, C014 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015, C015, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015, C015, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015, C015 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015, C015 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015, C015 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const, C015 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 &, C015, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 &, C015, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 &, C015 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 &, C015 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 &, C015 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const &, C015, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const &, C015 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const &, C015 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const &, C015 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C015 const &, C015 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036, C036 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const, C036, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const, C036, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const, C036 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const, C036 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const, C036 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const, C036 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 &, C036 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C036 const &, C036 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037, C037 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const, C037 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 &, C037 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const &, C037, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const &, C037, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const &, C037 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const &, C037 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const &, C037 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C037 const &, C037 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038, C038 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const, C038 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 &, C038 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const &, C038, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const &, C038, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const &, C038, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C038 const &, C038 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041, C041 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const, C041 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 &, C041 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 &, C041 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 &, C041 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 &, C041 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 &, C041 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C041 const &, C041 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042, C042 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const, C042 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 &, C042, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 &, C042 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 &, C042 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 &, C042 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 &, C042 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 &, C042 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C042 const &, C042 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045, C045 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045, C045 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045, C045 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const, C045 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 &, C045 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const &, C045 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const &, C045 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const &, C045 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const &, C045 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C045 const &, C045 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046, C046 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046, C046 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046, C046 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const, C046 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 &, C046 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 &, C046 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 &, C046 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 &, C046 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 &, C046 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 &, ret const >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4ce7f0b95e0db72f872ca825d76ea01040f18d81 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes2_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C046 const &, C046 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047, C047 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const, C047 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 &, C047 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C047 const &, C047 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050, C050 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const, C050 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 &, C050 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C050 const &, C050 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051, C051 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const, C051, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const, C051 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const, C051 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const, C051 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const, C051 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const, C051 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 &, C051, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 &, C051 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 &, C051 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 &, C051 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 &, C051 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 &, C051 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const &, C051, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const &, C051, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const &, C051 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const &, C051 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const &, C051 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C051 const &, C051 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072, C072 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const, C072 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 &, C072 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C072 const &, C072 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073, C073 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const, C073, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const, C073 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const, C073 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const, C073 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const, C073 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 &, C073, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 &, C073, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 &, C073, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 &, C073 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 &, C073 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C073 const &, C073 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074, C074 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const, C074 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 &, C074 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C074 const &, C074 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077, C077 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const, C077 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 &, C077, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 &, C077 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 &, C077 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 &, C077 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C077 const &, C077 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078, C078 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const, C078 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 const, void >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes3_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes3_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bf9355e726788d07386d1ebf15db0e2e4ef2428e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes3_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 &, C078 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C078 const &, C078 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081, C081 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const, C081 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 &, C081 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const &, C081 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const &, C081 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const &, C081 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const &, C081 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C081 const &, C081 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082, C082 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const, C082 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 &, C082 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C082 const &, C082 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083, C083 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const, C083 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 &, C083, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 &, C083, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 &, C083, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 &, C083 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 &, C083 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 &, C083 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C083 const &, C083 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086, C086 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const, C086 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 &, C086, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 &, C086 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 &, C086 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 &, C086 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 &, C086 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 &, C086 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C086 const &, C086 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087, C087 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const, C087, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const, C087, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const, C087 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const, C087 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 &, C087, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 &, C087, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 &, C087, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 &, C087 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 &, C087 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 &, C087 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const &, C087, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const &, C087, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const &, C087, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const &, C087 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const &, C087 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C087 const &, C087 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108, C108 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const, C108 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 &, C108 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const &, C108, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const &, C108 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const &, C108 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const &, C108 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C108 const &, C108 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109, C109 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const, C109 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 &, C109 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C109 const &, C109 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110, C110, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110, C110, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110, C110, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110, C110 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110, C110 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110, C110 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110, ret >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes4_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes4_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..50b8688a1a90ba9af27440dba18790d40792c948 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes4_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const, C110 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 &, C110, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 &, C110, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 &, C110 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 &, C110 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 &, C110 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 &, C110 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C110 const &, C110 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113, C113 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const, C113 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 &, C113 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C113 const &, C113 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114, C114 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const, C114 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 &, C114, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 &, C114 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 &, C114 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 &, C114 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const &, C114, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const &, C114, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const &, C114 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const &, C114 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const &, C114 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C114 const &, C114 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117, C117, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117, C117, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117, C117 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117, C117 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117, C117 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117, C117 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const, C117 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 &, C117, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 &, C117 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 &, C117 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 &, C117 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 &, C117 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 &, C117 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C117 const &, C117 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118, C118 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const, C118, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const, C118 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const, C118 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const, C118 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const, C118 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const, C118 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 &, C118 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C118 const &, C118 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119, C119 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const, C119, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const, C119 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const, C119 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const, C119 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const, C119 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const, C119 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 &, C119 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C119 const &, C119 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122, C122, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122, C122 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122, C122 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122, C122 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const, C122 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 &, C122 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 &, C122 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 &, C122 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C122 const &, C122 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123, C123, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123, C123, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123, C123 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123, C123 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123, C123 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const, C123 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 &, C123, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 &, C123 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 &, C123 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 &, C123 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 &, C123 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C123 const &, C123 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288, C288 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288 &, ret const >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes5_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes5_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ffed104d8bdec8bac249d8aeb5a7003ab55dc813 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes5_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const, C288 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 &, C288 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C288 const &, C288 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289, C289, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289, C289 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289, C289 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289, C289 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const, C289 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 &, C289 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const &, C289, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const &, C289 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const &, C289 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C289 const &, C289 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290, C290, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290, C290, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290, C290 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290, C290 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290, C290 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290, C290 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const, C290 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 &, C290 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C290 const &, C290 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293, C293 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const, C293 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 &, C293 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C293 const &, C293 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294, C294 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const, C294 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 &, C294 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C294 const &, C294 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297, C297 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const, C297 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 &, C297 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const &, C297, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const &, C297, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const &, C297 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const &, C297 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const &, C297 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C297 const &, C297 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298, C298 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const, C298, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const, C298, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const, C298 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const, C298 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const, C298 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 &, C298, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 &, C298, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 &, C298 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 &, C298 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 &, C298 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C298 const &, C298 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299, C299 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const, C299 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const, C299 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const, C299 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const, C299 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 &, C299, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 &, C299 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 &, C299 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 &, C299 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 &, C299 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 &, C299 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C299 const &, C299 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302, C302 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302, ret const >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes6_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes6_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c9f67ab794356094f0d790494e883f0ddc7d8917 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes6_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const, C302 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 &, C302, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 &, C302 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 &, C302 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 &, C302 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 &, C302 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C302 const &, C302 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303, C303 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const, C303 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 &, C303 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C303 const &, C303 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324, C324 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const, C324 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 &, C324 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C324 const &, C324 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325, C325, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325, C325 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325, C325 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325, C325 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const, C325 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 &, C325, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 &, C325 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 &, C325 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 &, C325 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 &, C325 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C325 const &, C325 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326, C326 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const, C326 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 &, C326 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const &, C326, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const &, C326 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const &, C326 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const &, C326 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C326 const &, C326 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329, C329 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const, C329, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const, C329, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const, C329 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const, C329 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const, C329 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const, C329 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 &, C329 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const &, C329 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const &, C329 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C329 const &, C329 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330, C330 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const, C330, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const, C330, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const, C330 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const, C330 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const, C330 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const, C330 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 &, C330 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const &, C330 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const &, C330 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C330 const &, C330 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333, C333 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const, C333 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const, C333 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const, C333 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const, C333 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const, C333 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const, C333 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 &, C333 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C333 const &, C333 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334, C334 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const, C334, ret const >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes7_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes7_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..25802d2148e4c93414c9b292847d091aa64c93e0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes7_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const, C334 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const, C334 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const, C334 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const, C334 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const, C334 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 &, C334 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C334 const &, C334 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335, C335, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335, C335 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335, C335 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335, C335 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335, C335 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const, C335 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 &, C335 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C335 const &, C335 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338, C338 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const, C338 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 &, C338, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 &, C338 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 &, C338 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 &, C338 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 &, C338 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 &, C338 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C338 const &, C338 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339, C339 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const, C339 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 &, C339 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C339 const &, C339 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360, C360, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360, C360 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360, C360 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360, C360 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360, C360 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const, C360, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const, C360 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const, C360 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const, C360 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 &, C360 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C360 const &, C360 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361, C361, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361, C361, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361, C361 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361, C361 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361, C361 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361, C361 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const, C361 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 &, C361 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C361 const &, C361 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362, C362 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const, C362 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 &, C362 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 &, C362 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 &, C362 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 &, C362 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 &, C362 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 &, C362 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C362 const &, C362 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365, C365, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365, C365, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365, C365 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365, C365 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365, C365 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365, C365 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const, C365 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 &, C365 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const &, C365 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const &, C365 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const &, C365 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C365 const &, C365 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366, C366 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes8_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes8_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c1eac81e01a0711308028c15287b5c4bdc0fe897 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes8_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const, C366 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 &, C366 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C366 const &, C366 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369, C369 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const, C369 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 &, C369 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C369 const &, C369 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370, C370 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const, C370 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const, C370 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const, C370 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const, C370 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const, C370 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const, C370 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 &, C370 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C370 const &, C370 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371, C371 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const, C371 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const, C371 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const, C371 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 &, C371 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C371 const &, C371 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374, C374 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const, C374 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 &, C374 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const &, C374, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const &, C374, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const &, C374 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C374 const &, C374 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375, C375 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const, C375 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 &, C375 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const &, C375, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const &, C375 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const &, C375 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const &, C375 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const &, C375 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C375 const &, C375 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396, C396 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const, C396 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 &, C396 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const &, C396, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const &, C396, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const &, C396, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const &, C396 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C396 const &, C396 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397, C397, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397, C397 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397, C397 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397, C397 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397, C397 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397, C397 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const, C397 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 &, C397 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 const, ret const & >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes9_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes9_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f9d63919068d82070ee0f24110d90cb4db215db --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_classes9_test.cpp @@ -0,0 +1,263 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_binary_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C397 const &, C397 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398, C398 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const, C398, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const, C398, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const, C398 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const, C398 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const, C398 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const, C398 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 &, C398 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C398 const &, C398 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401, C401 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401, C401 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401, C401 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401, C401 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401, C401 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401, C401 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const, C401 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 &, C401, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 &, C401, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 &, C401 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 &, C401 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 &, C401 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const &, C401, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const &, C401, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const &, C401 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C401 const &, C401 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402, C402 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const, C402 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 &, C402 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const &, C402, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const &, C402, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const &, C402 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const &, C402 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const &, C402 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C402 const &, C402 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405, C405, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405, C405, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405, C405 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405, C405 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405, C405 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405, C405 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const, C405 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 &, C405 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C405 const &, C405 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406, C406, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406, C406, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406, C406 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406, C406 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406, C406 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406, C406 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const, C406 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 &, C406, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 &, C406, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 &, C406 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 &, C406 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 &, C406 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 &, C406 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const &, C406, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const &, C406 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C406 const &, C406 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407, C407 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const, C407 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 &, C407 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C407 const &, C407 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410, C410, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410, C410 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410, C410 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410, C410 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410, C410 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410, C410 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const, C410 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 &, C410, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 &, C410 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 &, C410 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 &, C410 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 &, C410 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 &, C410 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C410 const &, C410 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411, C411, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411, C411 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411, C411 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411, C411 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const, C411 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 &, C411 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C411 const &, C411 const &, ret & >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_binary_operators.hpp b/tools/boost_1_65_1/libs/type_traits/test/has_binary_operators.hpp new file mode 100644 index 0000000000000000000000000000000000000000..681cde9f4692e4ce46cd4473e08350403c4ebb22 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_binary_operators.hpp @@ -0,0 +1,156 @@ +// (C) Copyright Frederic Bron 2009-2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef TT_HAS_BINARY_OPERATORS_HPP +#define TT_HAS_BINARY_OPERATORS_HPP + +#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40900) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +#endif + + +// test with one template parameter +#define TEST_T(TYPE,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) +// test with one template parameter plus return value +#define TEST_TR(TYPE,RET,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) +// test with two template parameters +#define TEST_TT(TYPE1,TYPE2,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) +// test with two template parameters plus return value +#define TEST_TTR(TYPE1,TYPE2,RET,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) + +namespace { + +struct without { }; + +struct ret { }; + +struct internal { ret operator BOOST_TT_TRAIT_OP (const internal&) const; }; + +struct external { }; +inline ret operator BOOST_TT_TRAIT_OP (const external&, const external&) { return ret(); } + +struct comma1_ret { }; +struct ret_with_comma1 { comma1_ret operator,(int); }; + +struct internal_comma1 { ret_with_comma1 operator BOOST_TT_TRAIT_OP (const internal_comma1&) const; }; + +struct external_comma1 { }; +ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&, const external_comma1&) { return ret_with_comma1(); } + +struct ret_with_comma2 { void operator,(int); }; + +struct internal_comma2 { ret_with_comma2 operator BOOST_TT_TRAIT_OP (const internal_comma2&) const; }; + +struct external_comma2 { }; +ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&, const external_comma2&){ return ret_with_comma2(); } + +struct returns_int { int operator BOOST_TT_TRAIT_OP (const returns_int&); }; + +struct returns_void { void operator BOOST_TT_TRAIT_OP (const returns_void&); }; + +struct returns_void_star { void *operator BOOST_TT_TRAIT_OP (const returns_void_star&); }; + +struct returns_double { double operator BOOST_TT_TRAIT_OP (const returns_double&); }; + +struct ret1 { }; +struct convertible_to_ret1 { operator ret1 () const; }; +struct returns_convertible_to_ret1 { convertible_to_ret1 operator BOOST_TT_TRAIT_OP (const returns_convertible_to_ret1&); }; + +struct convertible_to_ret2 { }; +struct ret2 { ret2(const convertible_to_ret2); }; +struct returns_convertible_to_ret2 { convertible_to_ret2 operator BOOST_TT_TRAIT_OP (const returns_convertible_to_ret2&); }; + +class Base1 { }; +class Derived1 : public Base1 { }; + +bool operator BOOST_TT_TRAIT_OP (const Base1&, const Base1&) { return true; } + +class Base2 { }; +struct Derived2 : public Base2 { + Derived2(int); // to check if it works with a class that is not default constructible +}; + +bool operator BOOST_TT_TRAIT_OP (const Derived2&, const Derived2&) { return true; } + +struct tag { }; + +struct A { }; +struct B : public A { }; + +struct C { }; +struct D { }; +inline bool operator BOOST_TT_TRAIT_OP (const C&, void*) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (void*, const D&) { return true; } +inline bool operator BOOST_TT_TRAIT_OP (const C&, const D&) { return true; } + +//class internal_private { ret operator BOOST_TT_TRAIT_OP (const internal_private&) const; }; + +void common() { + TEST_T(void, false); + TEST_TT(void, void, false); + TEST_TTR(void, void, void, false); + TEST_TTR(void, void, int, false); + + TEST_T(without, false); + TEST_T(internal, true); + TEST_T(external, true); + TEST_T(internal_comma1, true); + TEST_T(external_comma1, true); + TEST_T(internal_comma2, true); + TEST_T(external_comma2, true); + TEST_T(returns_int, true); + TEST_T(returns_void, true); + TEST_T(returns_void_star, true); + TEST_T(returns_double, true); + TEST_T(returns_convertible_to_ret1, true); + TEST_T(returns_convertible_to_ret2, true); + TEST_T(Base1, true); + TEST_T(Derived1, true); + TEST_T(Base2, false); + TEST_T(Derived2, true); + + TEST_TR(without, void, false); + TEST_TR(without, bool, false); + TEST_TR(internal, void, false); + TEST_TR(internal, bool, false); + TEST_TR(internal, ret, true); + TEST_TR(internal_comma1, void, false); + TEST_TR(internal_comma1, bool, false); + TEST_TR(internal_comma1, ret_with_comma1, true); + TEST_TR(internal_comma2, void, false); + TEST_TR(internal_comma2, bool, false); + TEST_TR(internal_comma2, ret_with_comma2, true); + TEST_TR(external, void, false); + TEST_TR(external, bool, false); + TEST_TR(external, ret, true); + TEST_TR(returns_int, void, false); + TEST_TR(returns_int, bool, true); + TEST_TR(returns_int, int, true); + TEST_TR(returns_void, void, true); + TEST_TR(returns_void, bool, false); + TEST_TR(returns_void_star, bool, true); + TEST_TR(returns_double, void, false); + TEST_TR(returns_double, bool, true); + TEST_TR(returns_double, double, true); + TEST_TR(returns_convertible_to_ret1, void, false); + TEST_TR(returns_convertible_to_ret1, ret1, true); + TEST_TR(returns_convertible_to_ret2, ret2, true); + TEST_TR(Base1, bool, true); + TEST_TR(Derived1, bool, true); + TEST_TR(Base2, bool, false); + TEST_TR(Derived2, bool, true); +// compile time error +// TEST_T(internal_private, false); +} + +} + +#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40900) +#pragma GCC diagnostic pop +#endif + +#endif + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_bit_and_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_bit_and_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3be7994a522fd6f3094f2a7a1e53219ae555ff78 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_bit_and_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_bit_and_assign +#define BOOST_TT_TRAIT_OP &= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_bit_and_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_bit_and_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4a2cfe6f9f9bd814567dfe163dbc97e5c360484e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_bit_and_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_bit_and +#define BOOST_TT_TRAIT_OP & + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_bit_or_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_bit_or_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ffacf904fb7cf77291ac2918e5667dcae0f83bc6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_bit_or_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_bit_or_assign +#define BOOST_TT_TRAIT_OP |= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_bit_or_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_bit_or_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8418e11887d0c56c71c5ccf37318b63d4b0476db --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_bit_or_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_bit_or +#define BOOST_TT_TRAIT_OP | + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_bit_xor_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_bit_xor_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49301c53a233ba62cef0ba1fc26c0b0f5f9bba18 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_bit_xor_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_bit_xor_assign +#define BOOST_TT_TRAIT_OP ^= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_bit_xor_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_bit_xor_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..659afc5305e082e217b4290401d5c7c27e0704d6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_bit_xor_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_bit_xor +#define BOOST_TT_TRAIT_OP ^ + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_complement_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_complement_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..627f7c509a3a5b52b46b53199f16212b84dbfc20 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_complement_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_complement +#define BOOST_TT_TRAIT_OP ~ + + +#include "has_prefix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_dereference_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_dereference_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..52ca7808bd541b9a4dbb7c1121578526b3bb5c75 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_dereference_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_dereference +#define BOOST_TT_TRAIT_OP * + + +#include "has_prefix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_divides_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_divides_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5b9565bd7983e85466816e0d317d891a3ac7eae6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_divides_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_divides_assign +#define BOOST_TT_TRAIT_OP /= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_divides_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_divides_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bdc129c42ffb56ae7a55703b896a2456637a7a70 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_divides_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_divides +#define BOOST_TT_TRAIT_OP / + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_equal_to_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_equal_to_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65a0ff26355fa0f674c0c94ff9b03838d5ee33b2 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_equal_to_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_equal_to +#define BOOST_TT_TRAIT_OP == + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_greater_equal_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_greater_equal_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f3d9d33791448adc06429695b855ecfbedfa92a6 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_greater_equal_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_greater_equal +#define BOOST_TT_TRAIT_OP >= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_greater_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_greater_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3082765805dce6db9672ebc9e612b2d407e8332e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_greater_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_greater +#define BOOST_TT_TRAIT_OP > + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_left_shift_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_left_shift_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..50de8292f400b6aa75d2bd410b559adba0df0af3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_left_shift_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_left_shift_assign +#define BOOST_TT_TRAIT_OP <<= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_left_shift_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_left_shift_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..556267cd40e8933e849019d4596122097b2f2fe1 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_left_shift_test.cpp @@ -0,0 +1,250 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_left_shift +#define BOOST_TT_TRAIT_OP << + +#include +#include + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, long, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, unsigned long, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, bool, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, short, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, unsigned short, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, int, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, unsigned int, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, double, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, float, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, void*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, char, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, signed char, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, unsigned char, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, const char*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, char*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, const signed char*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, signed char*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, const unsigned char*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, unsigned char*, std::ostream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, std::string, std::ostream& >::value), 1); +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_less_equal_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_less_equal_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b5b8d5e8a3fb317177f2468d6633ed6d99be52e1 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_less_equal_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_less_equal +#define BOOST_TT_TRAIT_OP <= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_less_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_less_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..12ff5b73f96a2e520f4579df9afbf0a08befd114 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_less_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_less +#define BOOST_TT_TRAIT_OP < + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_logical_and_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_logical_and_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c9eade5174d2772c7202c5c33edbee35eee147d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_logical_and_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_logical_and +#define BOOST_TT_TRAIT_OP && + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_logical_not_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_logical_not_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fdb467b9644ee4cba210959510ebd47c370a4488 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_logical_not_test.cpp @@ -0,0 +1,231 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_logical_not +#define BOOST_TT_TRAIT_OP ! + +#include + +#include "has_prefix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 1); + + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::ostream, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, bool >::value), 1); +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_logical_or_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_logical_or_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ff9b1031a3cf772b20e958942ad0448defdd4009 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_logical_or_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_logical_or +#define BOOST_TT_TRAIT_OP || + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_minus_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_minus_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a758d2d729c29c5049b8bb406df1ba5a83a10248 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_minus_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_minus_assign +#define BOOST_TT_TRAIT_OP -= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_minus_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_minus_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..01772f75ef398fa00f3bf9534109ed8aa5be8a10 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_minus_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_minus +#define BOOST_TT_TRAIT_OP - + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_modulus_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_modulus_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bf962002e94f013230e777a96f155dad15b7ae87 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_modulus_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_modulus_assign +#define BOOST_TT_TRAIT_OP %= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_modulus_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_modulus_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ab697ea0470c17acc800a24fab6e7bcd0d4a5f2d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_modulus_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_modulus +#define BOOST_TT_TRAIT_OP % + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_multiplies_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_multiplies_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..852ec01bcb598b55536475f5b25405180feb808e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_multiplies_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_multiplies_assign +#define BOOST_TT_TRAIT_OP *= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_multiplies_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_multiplies_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..89316ad1ac1a912ecd84c9ef19d1266ba4fff181 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_multiplies_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_multiplies +#define BOOST_TT_TRAIT_OP * + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_negate_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_negate_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..baa0e88a035c852fd6d7005fc32fea16e47b6202 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_negate_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_negate +#define BOOST_TT_TRAIT_OP - + + +#include "has_prefix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_not_equal_to_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_not_equal_to_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..17462ab7c6bfa427aa0479e3921f252545694659 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_not_equal_to_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_not_equal_to +#define BOOST_TT_TRAIT_OP != + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..421e91dea5435f54b6c26f8da0284fbff210cf1d --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_assign_test.cpp @@ -0,0 +1,238 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_assignable +{ + non_assignable(); + non_assignable& operator=(const non_assignable&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_assignable +{ + noexcept_assignable(); + noexcept_assignable& operator=(const noexcept_assignable&)noexcept; +}; + +#endif + +TT_TEST_BEGIN(has_nothrow_assign) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::long_long_type>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::ulong_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::long_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign< ::boost::long_long_type const volatile>::value, false); +#endif +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 const volatile>::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 const volatile>::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 const volatile>::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 const volatile>::value, false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#endif + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_constr_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_constr_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0697276dfb9c6505b01148571a2cbf69670683e3 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_constr_test.cpp @@ -0,0 +1,223 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +class bug11324_base +{ +public: + bug11324_base & operator=(const bug11324_base&){ throw int(); } + virtual ~bug11324_base() {} +}; + +class bug11324_derived : public bug11324_base +{ +public: + char data; + explicit bug11324_derived(char arg) : data(arg) {} +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_default_construct +{ + deleted_default_construct() = delete; + deleted_default_construct(char val) : member(val) {} + char member; +}; + +#endif + +struct private_default_construct +{ +private: + private_default_construct(); +public: + private_default_construct(char val) : member(val) {} + char member; +}; + +#ifndef BOOST_NO_CXX11_NOEXCEPT +struct noexcept_default_construct +{ + noexcept_default_construct()noexcept; + noexcept_default_construct(char val)noexcept : member(val) {} + char member; +}; +#endif + + +TT_TEST_BEGIN(has_nothrow_constructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#endif +#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#endif +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +#endif + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_copy_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_copy_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..68680bcf336863478e2a55b7641a55273c0d72cc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_copy_test.cpp @@ -0,0 +1,249 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +struct non_copy +{ + non_copy(); +private: + non_copy(const non_copy&); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct delete_copy +{ + delete_copy(); + delete_copy(const delete_copy&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_copy +{ + noexcept_copy(); + noexcept_copy& operator=(const noexcept_copy&)noexcept; +}; + +#endif + +TT_TEST_BEGIN(has_nothrow_copy) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::long_long_type const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy< ::boost::long_long_type const volatile>::value, false); +#endif +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 const volatile>::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 const volatile>::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 const volatile>::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 const volatile>::value, false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +// These used to be true, but are now false to match std conforming behavior: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#endif + +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) +#if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif +#endif + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_destructor_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_destructor_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..74f31bf237342f82c5abc3df8d68eeef769a5566 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_nothrow_destructor_test.cpp @@ -0,0 +1,219 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifdef BOOST_MSVC +#pragma warning(disable:4290) // exception spec ignored +#endif + +struct nothrow_destruct +{ + nothrow_destruct(int); + ~nothrow_destruct()throw(); +}; + +#if !defined(BOOST_NO_CXX11_NOEXCEPT) + +struct noexcept_destruct +{ + noexcept_destruct(int); + ~noexcept_destruct()noexcept; +}; + +#endif + +struct throwing_base +{ + ~throwing_base() throw(int); +}; + +struct throwing_derived : public throwing_base {}; + +struct throwing_contained{ throwing_base data; }; + +TT_TEST_BEGIN(has_nothrow_destructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +// +// These are commented out for now because it's not clear what the semantics should be: +// on the one hand references always have trivial destructors (in the sense that there is +// nothing to destruct), on the other hand the thing referenced may not have a trivial +// destructor, it really depends upon the users code as to what should happen here: +// +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +// +// Destructors on UDT's are non-throwing by default, unless they are explicity marked otherwise: +// +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); + +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); + +#if !defined(BOOST_NO_CXX11_NOEXCEPT) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_operator_new_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_operator_new_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..22d54c632603c74d1f5c7eb69a9dee9a5d43c474 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_operator_new_test.cpp @@ -0,0 +1,213 @@ +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include + +#ifdef BOOST_INTEL +// remark #1720: function "class_with_new_op::operator new" has no corresponding member operator delete (to be called if an exception is thrown during initialization of an allocated object) +// void * operator new(std::size_t); +// ^ +#pragma warning(disable:1720) +#endif + +#if defined(new) +# if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) +# define BOOST_TT_AUX_MACRO_NEW_DEFINED +# pragma push_macro("new") +# undef new +# else +# error "Sorry but you can't include this header if 'new' is defined as a macro." +# endif +#endif + + +struct class_with_new_op { + void * operator new(std::size_t); +}; + +struct derived_class_with_new_op : public class_with_new_op {}; + +struct class_with_new_op2 { + void* operator new(std::size_t size, const std::nothrow_t&); +}; + +struct class_with_new_op3 { + void* operator new[](std::size_t size); +}; + +struct class_with_new_op4 { + void* operator new[](std::size_t size, const std::nothrow_t&); +}; + +struct class_with_new_op5 { + void* operator new (std::size_t size, void* ptr); +}; + +struct class_with_new_op6 { + void* operator new[] (std::size_t size, void* ptr); +}; + +struct class_with_all_ops +{ + void * operator new(std::size_t); + void* operator new(std::size_t size, const std::nothrow_t&); + void* operator new[](std::size_t size); + void* operator new[](std::size_t size, const std::nothrow_t&); + void* operator new (std::size_t size, void* ptr); + void* operator new[] (std::size_t size, void* ptr); +}; + +TT_TEST_BEGIN(has_new_operator) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::ulong_long_type>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::long_long_type>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::ulong_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::long_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator< ::boost::long_long_type const volatile>::value, false); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int8>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int8 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int8 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int16>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int16 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int16 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int32>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int32 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int32 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int64>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int64 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator<__int64 const volatile>::value, false); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_new_operator::value, false); + +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_plus_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_plus_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d66c3945df58f4b989815a91e42471c5b38ca690 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_plus_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_plus_assign +#define BOOST_TT_TRAIT_OP += + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_plus_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_plus_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..af072638287c904841850e28c8356f9319d60244 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_plus_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_plus +#define BOOST_TT_TRAIT_OP + + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, double const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_post_decrement_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_post_decrement_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bae2c62ba5d495e1f2c27c622d27f08ea14b7edb --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_post_decrement_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_post_decrement +#define BOOST_TT_TRAIT_OP -- + + +#include "has_postfix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_post_increment_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_post_increment_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f96e884727ab153b735918b9b834fffe1b0e973c --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_post_increment_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_post_increment +#define BOOST_TT_TRAIT_OP ++ + + +#include "has_postfix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes.hpp b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b01f07d5f9974248c8fbad61fd98cbc9b3fdf1cc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes.hpp @@ -0,0 +1,72 @@ +// (C) Copyright Frederic Bron 2009-2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef TT_HAS_POSTFIX_CLASSES_HPP +#define TT_HAS_POSTFIX_CLASSES_HPP + +struct ret { }; +ret ret_val; + +class C000 { C000(); public: C000(int) { } }; +void operator++(C000, int) { } + +class C001 { C001(); public: C001(int) { } }; +ret operator++(C001, int) { return ret_val; } + +class C002 { C002(); public: C002(int) { } }; +ret const operator++(C002, int) { return ret_val; } + +class C005 { C005(); public: C005(int) { } }; +ret & operator++(C005, int) { return ret_val; } + +class C006 { C006(); public: C006(int) { } }; +ret const & operator++(C006, int) { return ret_val; } + +class C009 { C009(); public: C009(int) { } }; +void operator++(C009 const, int) { } + +class C010 { C010(); public: C010(int) { } }; +ret operator++(C010 const, int) { return ret_val; } + +class C011 { C011(); public: C011(int) { } }; +ret const operator++(C011 const, int) { return ret_val; } + +class C014 { C014(); public: C014(int) { } }; +ret & operator++(C014 const, int) { return ret_val; } + +class C015 { C015(); public: C015(int) { } }; +ret const & operator++(C015 const, int) { return ret_val; } + +class C036 { C036(); public: C036(int) { } }; +void operator++(C036 &, int) { } + +class C037 { C037(); public: C037(int) { } }; +ret operator++(C037 &, int) { return ret_val; } + +class C038 { C038(); public: C038(int) { } }; +ret const operator++(C038 &, int) { return ret_val; } + +class C041 { C041(); public: C041(int) { } }; +ret & operator++(C041 &, int) { return ret_val; } + +class C042 { C042(); public: C042(int) { } }; +ret const & operator++(C042 &, int) { return ret_val; } + +class C045 { C045(); public: C045(int) { } }; +void operator++(C045 const &, int) { } + +class C046 { C046(); public: C046(int) { } }; +ret operator++(C046 const &, int) { return ret_val; } + +class C047 { C047(); public: C047(int) { } }; +ret const operator++(C047 const &, int) { return ret_val; } + +class C050 { C050(); public: C050(int) { } }; +ret & operator++(C050 const &, int) { return ret_val; } + +class C051 { C051(); public: C051(int) { } }; +ret const & operator++(C051 const &, int) { return ret_val; } + +#endif diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes0_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes0_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d3affa14172d722ce004d2cef1975223c5d3b8ae --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes0_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_postfix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C000 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C001 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C002 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C005 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C006 const &, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes1_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes1_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d0ab8adb4bb68744c5e4238e9e830e45e36fcf7 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes1_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_postfix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C009 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C010 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C011 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C014 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C015 const &, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aa01ecb8c616ecddb60f540d36b3e2672a7c6313 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes2_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_postfix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C036 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C037 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C038 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C041 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C042 const &, ret const & >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes3_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes3_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e0070692c3938b9919740716253b76c54d30698e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_classes3_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_postfix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C045 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C046 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C047 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C050 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_post_increment< C051 const &, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_postfix_operators.hpp b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_operators.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c1a8f98aa2588f17cdbc8fa9efb62369a87428cc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_postfix_operators.hpp @@ -0,0 +1,132 @@ +// (C) Copyright Frederic Bron 2009-2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef TT_HAS_POSTFIX_OPERATORS_HPP +#define TT_HAS_POSTFIX_OPERATORS_HPP + +// test with one template parameter +#define TEST_T(TYPE,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) +// test with one template parameter plus return value +#define TEST_TR(TYPE,RET,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) + +namespace { + +struct without { }; + +struct ret { }; + +struct internal { ret operator BOOST_TT_TRAIT_OP (int) const; }; + +struct external { }; +inline ret operator BOOST_TT_TRAIT_OP (const external&, int){ return ret(); } + +struct comma1_ret { }; +struct ret_with_comma1 { comma1_ret operator,(int); }; + +struct internal_comma1 { ret_with_comma1 operator BOOST_TT_TRAIT_OP (int) const; }; + +struct external_comma1 { }; +inline ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&, int){ return ret_with_comma1(); } + +struct ret_with_comma2 { void operator,(int); }; + +struct internal_comma2 { ret_with_comma2 operator BOOST_TT_TRAIT_OP (int) const; }; + +struct external_comma2 { }; +inline ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&, int){ return ret_with_comma2(); } + +struct returns_int { int operator BOOST_TT_TRAIT_OP (int); }; + +struct returns_void { void operator BOOST_TT_TRAIT_OP (int); }; + +struct returns_void_star { void *operator BOOST_TT_TRAIT_OP (int); }; + +struct returns_double { double operator BOOST_TT_TRAIT_OP (int); }; + +struct ret1 { }; +struct convertible_to_ret1 { operator ret1 () const; }; +struct returns_convertible_to_ret1 { convertible_to_ret1 operator BOOST_TT_TRAIT_OP (int); }; + +struct convertible_to_ret2 { }; +struct ret2 { ret2(const convertible_to_ret2); }; +struct returns_convertible_to_ret2 { convertible_to_ret2 operator BOOST_TT_TRAIT_OP (int); }; + +class Base1 { }; +class Derived1 : public Base1 { }; + +inline bool operator BOOST_TT_TRAIT_OP (const Base1&, int) { return true; } + +class Base2 { }; +struct Derived2 : public Base2 { + Derived2(int); // to check if it works with a class that is not default constructible +}; + +inline bool operator BOOST_TT_TRAIT_OP (const Derived2&, int) { return true; } + +struct tag { }; + +//class internal_private { ret operator BOOST_TT_TRAIT_OP (int) const; }; + +void common() { + TEST_T(void, false); + TEST_TR(void, void, false); + TEST_TR(void, int, false); + + TEST_T(without, false); + TEST_T(internal, true); + TEST_T(external, true); + TEST_T(internal_comma1, true); + TEST_T(external_comma1, true); + TEST_T(internal_comma2, true); + TEST_T(external_comma2, true); + TEST_T(returns_int, true); + TEST_T(returns_void, true); + TEST_T(returns_void_star, true); + TEST_T(returns_double, true); + TEST_T(returns_convertible_to_ret1, true); + TEST_T(returns_convertible_to_ret2, true); + TEST_T(Base1, true); + TEST_T(Derived1, true); + TEST_T(Base2, false); + TEST_T(Derived2, true); + + TEST_TR(without, void, false); + TEST_TR(without, bool, false); + TEST_TR(internal, void, false); + TEST_TR(internal, bool, false); + TEST_TR(internal, ret, true); + TEST_TR(internal_comma1, void, false); + TEST_TR(internal_comma1, bool, false); + TEST_TR(internal_comma1, ret_with_comma1, true); + TEST_TR(internal_comma2, void, false); + TEST_TR(internal_comma2, bool, false); + TEST_TR(internal_comma2, ret_with_comma2, true); + TEST_TR(external, void, false); + TEST_TR(external, bool, false); + TEST_TR(external, ret, true); + TEST_TR(returns_int, void, false); + TEST_TR(returns_int, bool, true); + TEST_TR(returns_int, int, true); + TEST_TR(returns_void, void, true); + TEST_TR(returns_void, bool, false); + TEST_TR(returns_void_star, bool, true); + TEST_TR(returns_double, void, false); + TEST_TR(returns_double, bool, true); + TEST_TR(returns_double, double, true); + TEST_TR(returns_convertible_to_ret1, void, false); + TEST_TR(returns_convertible_to_ret1, ret1, true); + TEST_TR(returns_convertible_to_ret2, ret2, true); + TEST_TR(Base1, bool, true); + TEST_TR(Derived1, bool, true); + TEST_TR(Base2, bool, false); + TEST_TR(Derived2, bool, true); +// compile time error +// TEST_T(internal_private, false); +} + +} + +#endif + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_pre_decrement_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_pre_decrement_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e02d7812ccf11d3081f496a7fea116aeef490d44 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_pre_decrement_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_pre_decrement +#define BOOST_TT_TRAIT_OP -- + + +#include "has_prefix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_pre_increment_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_pre_increment_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..deeb9fece7b080b74f8332f039c1de11298ff403 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_pre_increment_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_pre_increment +#define BOOST_TT_TRAIT_OP ++ + + +#include "has_prefix_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes.hpp b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ac962032b6f03905392237863338127f771f2e95 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes.hpp @@ -0,0 +1,72 @@ +// (C) Copyright Frederic Bron 2009-2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef TT_HAS_PREFIX_CLASSES_HPP +#define TT_HAS_PREFIX_CLASSES_HPP + +struct ret { }; +ret ret_val; + +class C000 { C000(); public: C000(int) { } }; +void operator++(C000) { } + +class C001 { C001(); public: C001(int) { } }; +ret operator++(C001) { return ret_val; } + +class C002 { C002(); public: C002(int) { } }; +ret const operator++(C002) { return ret_val; } + +class C005 { C005(); public: C005(int) { } }; +ret & operator++(C005) { return ret_val; } + +class C006 { C006(); public: C006(int) { } }; +ret const & operator++(C006) { return ret_val; } + +class C009 { C009(); public: C009(int) { } }; +void operator++(C009 const) { } + +class C010 { C010(); public: C010(int) { } }; +ret operator++(C010 const) { return ret_val; } + +class C011 { C011(); public: C011(int) { } }; +ret const operator++(C011 const) { return ret_val; } + +class C014 { C014(); public: C014(int) { } }; +ret & operator++(C014 const) { return ret_val; } + +class C015 { C015(); public: C015(int) { } }; +ret const & operator++(C015 const) { return ret_val; } + +class C036 { C036(); public: C036(int) { } }; +void operator++(C036 &) { } + +class C037 { C037(); public: C037(int) { } }; +ret operator++(C037 &) { return ret_val; } + +class C038 { C038(); public: C038(int) { } }; +ret const operator++(C038 &) { return ret_val; } + +class C041 { C041(); public: C041(int) { } }; +ret & operator++(C041 &) { return ret_val; } + +class C042 { C042(); public: C042(int) { } }; +ret const & operator++(C042 &) { return ret_val; } + +class C045 { C045(); public: C045(int) { } }; +void operator++(C045 const &) { } + +class C046 { C046(); public: C046(int) { } }; +ret operator++(C046 const &) { return ret_val; } + +class C047 { C047(); public: C047(int) { } }; +ret const operator++(C047 const &) { return ret_val; } + +class C050 { C050(); public: C050(int) { } }; +ret & operator++(C050 const &) { return ret_val; } + +class C051 { C051(); public: C051(int) { } }; +ret const & operator++(C051 const &) { return ret_val; } + +#endif diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes0_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes0_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..130c630c39c918bc6410c1c78d4ad5ca36913f93 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes0_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_prefix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C000 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C001 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C002 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C005 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C006 const &, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes1_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes1_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..959ccc06d793a17418453288a584db6fe22c46dc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes1_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_prefix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C009 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C010 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C011 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C014 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C015 const &, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes2_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes2_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6bd716b498b37697c2c2371b784a1e124e8a6583 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes2_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_prefix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C036 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C037 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C038 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C041 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C042 const &, ret const & >::value), 0); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes3_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes3_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..06b56d6b26ed8f1ef5615d5879b83b8eb113a93a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_classes3_test.cpp @@ -0,0 +1,113 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#include +#include "has_prefix_classes.hpp" + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const &, void >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const &, ret >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const &, ret const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C045 const &, ret const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C046 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C047 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const &, ret & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C050 const &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 &, ret const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const &, ret >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const &, ret const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const &, ret & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_pre_increment< C051 const &, ret const & >::value), 1); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_prefix_operators.hpp b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_operators.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0c1d1ab4e1d92de8ae01f1d12b81cba4cc3bfc4a --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_prefix_operators.hpp @@ -0,0 +1,138 @@ +// (C) Copyright Frederic Bron 2009-2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef TT_HAS_PREFIX_OPERATORS_HPP +#define TT_HAS_PREFIX_OPERATORS_HPP + +#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40900) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +#endif + +// test with one template parameter +#define TEST_T(TYPE,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) +// test with one template parameter plus return value +#define TEST_TR(TYPE,RET,RESULT) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), RESULT) + +namespace { + +struct without { }; + +struct ret { }; + +struct internal { ret operator BOOST_TT_TRAIT_OP () const; }; + +struct external { }; +inline ret operator BOOST_TT_TRAIT_OP (const external&){ return ret(); } + +struct comma1_ret { }; +struct ret_with_comma1 { comma1_ret operator,(int); }; + +struct internal_comma1 { ret_with_comma1 operator BOOST_TT_TRAIT_OP () const; }; + +struct external_comma1 { }; +inline ret_with_comma1 operator BOOST_TT_TRAIT_OP (const external_comma1&){ return ret_with_comma1(); } + +struct ret_with_comma2 { void operator,(int); }; + +struct internal_comma2 { ret_with_comma2 operator BOOST_TT_TRAIT_OP () const; }; + +struct external_comma2 { }; +inline ret_with_comma2 operator BOOST_TT_TRAIT_OP (const external_comma2&){ return ret_with_comma2(); } + +struct returns_int { int operator BOOST_TT_TRAIT_OP (); }; + +struct returns_void { void operator BOOST_TT_TRAIT_OP (); }; + +struct returns_void_star { void *operator BOOST_TT_TRAIT_OP (); }; + +struct returns_double { double operator BOOST_TT_TRAIT_OP (); }; + +struct ret1 { }; +struct convertible_to_ret1 { operator ret1 () const; }; +struct returns_convertible_to_ret1 { convertible_to_ret1 operator BOOST_TT_TRAIT_OP (); }; + +struct convertible_to_ret2 { }; +struct ret2 { ret2(const convertible_to_ret2); }; +struct returns_convertible_to_ret2 { convertible_to_ret2 operator BOOST_TT_TRAIT_OP (); }; + +class Base1 { }; +class Derived1 : public Base1 { }; + +inline bool operator BOOST_TT_TRAIT_OP (const Base1&) { return true; } + +class Base2 { }; +struct Derived2 : public Base2 { + Derived2(int); // to check if it works with a class that is not default constructible +}; + +bool operator BOOST_TT_TRAIT_OP (const Derived2&) { return true; } + +struct tag { }; + +//class internal_private { ret operator BOOST_TT_TRAIT_OP () const; }; + +void common() { + TEST_T(void, false); + TEST_TR(void, void, false); + TEST_TR(void, int, false); + + TEST_T(without, false); + TEST_T(internal, true); + TEST_T(external, true); + TEST_T(internal_comma1, true); + TEST_T(external_comma1, true); + TEST_T(internal_comma2, true); + TEST_T(external_comma2, true); + TEST_T(returns_int, true); + TEST_T(returns_void, true); + TEST_T(returns_void_star, true); + TEST_T(returns_double, true); + TEST_T(returns_convertible_to_ret1, true); + TEST_T(returns_convertible_to_ret2, true); + TEST_T(Base1, true); + TEST_T(Derived1, true); + TEST_T(Base2, false); + TEST_T(Derived2, true); + + TEST_TR(without, void, false); + TEST_TR(without, bool, false); + TEST_TR(internal_comma1, void, false); + TEST_TR(internal_comma1, bool, false); + TEST_TR(internal_comma1, ret_with_comma1, true); + TEST_TR(internal_comma2, void, false); + TEST_TR(internal_comma2, bool, false); + TEST_TR(internal_comma2, ret_with_comma2, true); + TEST_TR(external, void, false); + TEST_TR(external, bool, false); + TEST_TR(external, ret, true); + TEST_TR(returns_int, void, false); + TEST_TR(returns_int, bool, true); + TEST_TR(returns_int, int, true); + TEST_TR(returns_void, void, true); + TEST_TR(returns_void, bool, false); + TEST_TR(returns_void_star, bool, true); + TEST_TR(returns_double, void, false); + TEST_TR(returns_double, bool, true); + TEST_TR(returns_double, double, true); + TEST_TR(returns_convertible_to_ret1, void, false); + TEST_TR(returns_convertible_to_ret1, ret1, true); + TEST_TR(returns_convertible_to_ret2, ret2, true); + TEST_TR(Base1, bool, true); + TEST_TR(Derived1, bool, true); + TEST_TR(Base2, bool, false); + TEST_TR(Derived2, bool, true); +// compile time error +// TEST_T(internal_private, false); +} + +} + +#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40900) +#pragma GCC diagnostic pop +#endif + +#endif + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_right_shift_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_right_shift_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1dbf91e09c27b3e9990214e517b5b57456cee5e0 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_right_shift_assign_test.cpp @@ -0,0 +1,228 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_right_shift_assign +#define BOOST_TT_TRAIT_OP >>= + + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_right_shift_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_right_shift_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..584c9713957c73c337fc7f6881d51371ffcd4ed5 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_right_shift_test.cpp @@ -0,0 +1,247 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" + +#ifdef TEST_STD +# include +#else +# include +#endif + +#define BOOST_TT_TRAIT_NAME has_right_shift +#define BOOST_TT_TRAIT_OP >> + +#include +#include + +#include "has_binary_operators.hpp" + +void specific() { + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, int &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, bool &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, void* const &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const, int* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, bool, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int const &, int const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool &, int* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< bool const &, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool const, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, void* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool &, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, bool const &, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int, bool const >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int const, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int*, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, bool const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, bool const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, void* &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int &, int* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const, int const & >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int const &, bool >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int const &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, bool const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, double const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double, void* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, bool const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, double, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, void* &, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const, int* const &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, bool const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, double const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, void* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double &, int*, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void*, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< double const &, int* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, bool const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int const, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void*, int* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, double const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, bool const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int const, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, void* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* &, int* const &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, bool const, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, int &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, double const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< void* const &, void* const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int const, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, double const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, void*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int*, int* const &, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, bool, int const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, double const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, void* >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const, int* &, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, double &, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, void* const &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int*, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* &, int* const &, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, bool const >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, bool, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int, int >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, bool & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int &, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, double const, int const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void*, bool >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, void* const &, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int*, bool const & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const, void >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 0); + + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, bool&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, short&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned short&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, int&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned int&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, long&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned long&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, float&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, double&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, void*&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, char&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, signed char&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned char&, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, char*, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, signed char*, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, unsigned char*, std::istream& >::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< std::istream, std::string&, std::istream& >::value), 1); +} + +TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) + common(); + specific(); +TT_TEST_END diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_trivial_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c5e40a374333e88fd986c23a42c33446d7a4be60 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_assign_test.cpp @@ -0,0 +1,232 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +struct non_assignable +{ + non_assignable(); +private: + non_assignable& operator=(const non_assignable&); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_assignable2 +{ + non_assignable2(); + non_assignable2& operator=(const non_assignable2&) = delete; +}; + +#endif + +TT_TEST_BEGIN(has_trivial_assign) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::long_long_type>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::ulong_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::long_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign< ::boost::long_long_type const volatile>::value, false); +#endif +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 const volatile>::value, false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +// Arrays can not be explicitly assigned: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_trivial_constr_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_constr_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..16a4e8a602cc1b3a63df20ac74f396b21915ff7f --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_constr_test.cpp @@ -0,0 +1,220 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + + +class bug11324_base +{ +public: + bug11324_base & operator=(const bug11324_base&){ throw int(); } + virtual ~bug11324_base() {} +}; + +class bug11324_derived : public bug11324_base +{ +public: + char data; + explicit bug11324_derived(char arg) : data(arg) {} +}; + +struct private_construct +{ + private_construct(int); +private: + private_construct(); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_construct +{ + deleted_construct(int); + deleted_construct() = delete; +}; + +#endif + +TT_TEST_BEGIN(has_trivial_constructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +// Can't construct type void: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +//BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, true, false); +//BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, true, false); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_trivial_copy_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_copy_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..043f76ea8466f5c2ec2ced3afbbf05680623ec7e --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_copy_test.cpp @@ -0,0 +1,240 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +class bug_10389 +{ + int m_data; +public: + bug_10389() { m_data = 0; } + bug_10389(const bug_10389&) = delete; + bug_10389(bug_10389&& r) : m_data(r.m_data) { r.m_data = 0; } +}; + +#endif + +struct private_copy +{ + private_copy(); +private: + private_copy(const private_copy&); +}; + +TT_TEST_BEGIN(has_trivial_copy) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::long_long_type const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy< ::boost::long_long_type const volatile>::value, false); +#endif +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 const volatile>::value, false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +// Arrays can not be explicitly copied: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_trivial_destructor_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_destructor_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3792004ca9d38f341958d46416cbc602e97b3383 --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_destructor_test.cpp @@ -0,0 +1,198 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_destruct +{ + deleted_destruct(); + ~deleted_destruct() = delete; +}; + +#endif + +struct private_destruct +{ + private_destruct(); +private: + ~private_destruct(); +}; + +TT_TEST_BEGIN(has_trivial_destructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +// +// These are commented out for now because it's not clear what the semantics should be: +// on the one hand references always have trivial destructors (in the sense that there is +// nothing to destruct), on the other hand the thing referenced may not have a trivial +// destructor, it really depends upon the users code as to what should happen here: +// +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +#endif + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_trivial_move_assign_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_move_assign_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..242c92fcdfc10c8a600d8d30912fd1f6bfe017bc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_move_assign_test.cpp @@ -0,0 +1,248 @@ + +// (C) Copyright John Maddock 2000. +// (C) Copyright Antony Polukhin 2013. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_copyable_movable +{ + int val; + non_copyable_movable(int); + non_copyable_movable(const non_copyable_movable&) = delete; + non_copyable_movable& operator=(const non_copyable_movable&) = delete; + //non_copyable_movable(non_copyable_movable&&) = default; +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1800) || BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) + non_copyable_movable& operator=(non_copyable_movable&& o) + { + val = std::move(o.val); + return *this; + } +#else + non_copyable_movable& operator=(non_copyable_movable&&) = default; +#endif +}; + +struct copyable_non_moveable +{ + int val; + copyable_non_moveable(int); + copyable_non_moveable(const copyable_non_moveable&) = default; + copyable_non_moveable& operator=(const copyable_non_moveable&) = default; + copyable_non_moveable(copyable_non_moveable&&) = delete; + copyable_non_moveable& operator=(copyable_non_moveable&&) = delete; +}; + +#endif + +TT_TEST_BEGIN(has_trivial_move_assign) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type const volatile>::value, false); +#endif +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 const volatile>::value, false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +// array types are not assignable: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign >::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif + +TT_TEST_END + + + diff --git a/tools/boost_1_65_1/libs/type_traits/test/has_trivial_move_constructor_test.cpp b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_move_constructor_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fe227f4da625532e6caf661e860cd133fa15f7ce --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/test/has_trivial_move_constructor_test.cpp @@ -0,0 +1,253 @@ + +// (C) Copyright John Maddock 2000. +// (C) Copyright Antony Polukhin 2013. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_copyable_movable +{ + int val; + non_copyable_movable(int); + non_copyable_movable(const non_copyable_movable&) = delete; + non_copyable_movable& operator=(const non_copyable_movable&) = delete; +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1800) || BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) + non_copyable_movable(non_copyable_movable&& o) : val(o.val){} + non_copyable_movable& operator=(non_copyable_movable&& o) + { + val = std::move(o.val); + return *this; + } +#else + non_copyable_movable(non_copyable_movable&&) = default; + non_copyable_movable& operator=(non_copyable_movable&&) = default; +#endif +}; + +struct copyable_non_moveable +{ + int val; + copyable_non_moveable(int); + copyable_non_moveable(const copyable_non_moveable&) = default; + copyable_non_moveable& operator=(const copyable_non_moveable&) = default; + copyable_non_moveable(copyable_non_moveable&&) = delete; + copyable_non_moveable& operator=(copyable_non_moveable&&) = delete; +}; + +#endif + +TT_TEST_BEGIN(has_trivial_move_constructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type const volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type const volatile>::value, false); +#endif +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 const volatile>::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 const>::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 const volatile>::value, false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor >::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + +TT_TEST_END + + + + + + + + diff --git a/tools/boost_1_65_1/libs/type_traits/tools/specialisations.cpp b/tools/boost_1_65_1/libs/type_traits/tools/specialisations.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f276bef5af86dc9e498fea828f75e4a2a8b46ecc --- /dev/null +++ b/tools/boost_1_65_1/libs/type_traits/tools/specialisations.cpp @@ -0,0 +1,122 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// +// Simple program to output some template specialisations for the type_traits library. +// + +#include + +using namespace std; + +unsigned specializations = 30; + +int main() +{ + unsigned i, j; + ofstream os("specialisations"); + + // + // generate is_function tester prototypes: + for(i = 0; i <= specializations; ++i) + { + os << "template \n::boost::type_traits::yes_type is_function_tester(R (*)("; + if(i == 0) + os << "void"; + else + { + for(j = 0; j < i; ++j) + { + if(j) os << ", "; + os << "A" << j; + } + } + os << "));" << endl; + } + os << endl << endl; + // + // generate is_function_helper partial specialisations: + // + for(i = 0; i < specializations; ++i) + { + os << "template \nstruct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); };" << endl; + } + os << endl << endl; + + + // + // generate is_member_pointer_helper tester prototypes: + for(i = 0; i <= specializations; ++i) + { + os << "template \n::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)("; + if(i == 0) + os << "void"; + else + { + for(j = 0; j < i; ++j) + { + if(j) os << ", "; + os << "A" << j; + } + } + os << "));" << endl; + } + os << endl << endl; + // + // generate is_member_pointer partial specialisations: + // + for(i = 0; i < specializations; ++i) + { + os << "template \nstruct is_member_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); };" << endl; + } + os << endl << endl; + + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/typeof/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/typeof/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..54026656917adfe408eef7d5bf00612b658e0d08 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/doc/Jamfile.v2 @@ -0,0 +1,29 @@ + +# Copyright Peder Holt 2005. Use, modification, and distribution are +# subject to the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using quickbook ; + +xml typeof : typeof.qbk ; +boostbook standalone + : + typeof + : + boost.root=../../../.. + nav.layout=none + navig.graphics=0 + ; + +install html : ../../../doc/src/boostbook.css ; +install ../ : ../../../boost.png ; + +############################################################################### +alias boostdoc + : typeof + : + : + : ; +explicit boostdoc ; +alias boostrelease ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/typeof/doc/typeof.qbk b/tools/boost_1_65_1/libs/typeof/doc/typeof.qbk new file mode 100644 index 0000000000000000000000000000000000000000..872e5ac1964c76f70500a27f3e811149eff7d61a --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/doc/typeof.qbk @@ -0,0 +1,884 @@ +[library Boost.Typeof + [authors [Vertleyb, Arkadiy], [Holt, Peder]] + [copyright 2004 2005 Arkadiy Vertleyb, Peder Holt] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + + http://www.boost.org/LICENSE_1_0.txt + ) + ] + [id typeof] + [last-revision $Date$] +] + +[section:moti Motivation] + +[c++] + +Today many template libraries supply object generators to simplify object creation +by utilizing the C++ template argument deduction facility. Consider `std::pair`. +In order to instantiate this class template and create a temporary object of this instantiation, +one has to supply template parameters, as well as parameters to the constructor: + + std::pair(5, 3.14159); + +To avoid this duplication, STL supplies the `std::make_pair` object generator. +When it is used, the types of template parameters are deduced from supplied function arguments: + + std::make_pair(5, 3.14159); + +For the temporary objects it is enough. However, when a named object needs to be allocated, +the problem appears again: + + std::pair p(5, 3.14159); + +The object generator no longer helps: + + std::pair p = std::make_pair(5, 3.14159); + +It would be nice to deduce the type of the object (on the left) from the expression +it is initialized with (on the right), but the current C++ syntax does not allow for this. + +The above example demonstrates the essence of the problem but does not demonstrate its scale. +Many libraries, especially expression template libraries, create objects of really complex types, +and go a long way to hide this complexity behind object generators. Consider a nit Boost.Lambda functor: + + _1 > 15 && _2 < 20 + +If one wanted to allocate a named copy of such an innocently looking functor, +she would have to specify something like this: + + lambda_functor< + lambda_functor_base< + logical_action, + tuple< + lambda_functor< + lambda_functor_base< + relational_action, + tuple< + lambda_functor >, + int const + > + > + >, + lambda_functor< + lambda_functor_base< + relational_action, + tuple< + lambda_functor >, + int const + > + > + > + > + > + > + f = _1 > 15 && _2 < 20; + + +Not exactly elegant. To solve this problem (as well as some other problems), +the C++ standard committee is considering +a few additions to the standard language, such as `typeof/decltype` and `auto` (see +[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf +http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf]). + +The `typeof` operator (or `decltype`, which is a slightly different flavor of `typeof`) +allows one to determine the type of an expression at compile time. Using `typeof`, +the above example can be simplified drastically: + + typeof(_1 > 15 && _2 < 20) f = _1 > 15 && _2 < 20; + +Much better, but some duplication still exists. The `auto` type solves the rest of the problem: + + auto f = _1 > 15 && _2 < 20; + +The purpose of the Boost.Typeof library is to provide a library-based solution, +which could be used until the language-based facility is added to the Standard +and becomes widely available. + +[endsect] + +[section:tuto Tutorial] + +To start using typeof include the typeof header: + + #include + +To deduce the type of an expression at compile time +use the `BOOST_TYPEOF` macro: + + namespace ex1 + { + typedef BOOST_TYPEOF(1 + 0.5) type; + + BOOST_STATIC_ASSERT((is_same::value)); + } + +In the dependent context use `BOOST_TYPEOF_TPL` instead of `BOOST_TYPEOF`: + + namespace ex2 + { + template + BOOST_TYPEOF_TPL(T() + U()) add(const T& t, const U& u) + { + return t + u; + }; + + typedef BOOST_TYPEOF(add('a', 1.5)) type; + + BOOST_STATIC_ASSERT((is_same::value)); + } + +The above examples are possible because the Typeof Library knows about +primitive types, such as `int`, `double`, `char`, etc. The Typeof Library also +knows about most types and templates defined by the +Standard C++ Library, but the appropriate headers need to be included +to take advantage of this: + + #include + + namespace ex3 + { + BOOST_AUTO(p, make_pair(1, 2)); + + BOOST_STATIC_ASSERT((is_same >::value)); + } + +Here `` includes `` and contains +knowledge about templates defined there. This naming convention +applies in general, for example to let the Typeof Library handle `std::vector`, +include ``, etc. + +To deduce the type of a variable from the expression, this variable +is initialized with, use the `BOOST_AUTO` macro (or `BOOST_AUTO_TPL` +in a dependent context: + + #include + + namespace ex4 + { + BOOST_AUTO(p, new int[20]); + + BOOST_STATIC_ASSERT((is_same::value)); + } + +Both `BOOST_TYPEOF` and `BOOST_AUTO` strip top-level qualifiers. +Therefore, to allocate for example a reference, it has to be specified explicitly: + + namespace ex5 + { + string& hello() + { + static string s = "hello"; + return s; + } + + BOOST_AUTO(&s, hello()); + } + +To better understand this syntax, note that this gets expanded into: + + BOOST_TYPEOF(hello()) &s = hello(); + +If your define your own type, the Typeof Library cannot handle it +unless you let it know about this type. You tell the Typeof Library +about a type (or template) by the means of "registering" this type/template. + +Any source or header file where types/templates are registered has to +contain the following line before any registration is done: + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +After this a type can be registered: + + namespace ex6 + { + struct MyType + {}; + } + + BOOST_TYPEOF_REGISTER_TYPE(ex6::MyType) + +The registration must be done from the context of global namespace; +fully qualified type name has to be used. + +Any number of types can be registered in one file, each on a separate line. + +Once your type is registered, the Typeof Library can handle it in any context: + + namespace ex6 + { + typedef BOOST_TYPEOF(make_pair(1, MyType())) type; + + BOOST_STATIC_ASSERT((is_same >::value)); + } + +A template is registered by specifying its fully qualified name, +and describing its parameters. In the simplest case, when all parameters +are type parameters, only their number needs to be specified: + + namespace ex7 + { + template + struct MyTemplate + {}; + } + + BOOST_TYPEOF_REGISTER_TEMPLATE(ex7::MyTemplate, 2) + + namespace ex7 + { + typedef BOOST_TYPEOF(make_pair(1, MyTemplate())) type; + + BOOST_STATIC_ASSERT((is_same > + >::value)); + } + +When a template has integral template parameters, all parameters need +to be described in the preprocessor sequence: + + namespace ex8 + { + template + struct MyTemplate + {}; + } + + BOOST_TYPEOF_REGISTER_TEMPLATE(ex8::MyTemplate, (class)(int)) + + namespace ex8 + { + typedef BOOST_TYPEOF(make_pair(1, MyTemplate, 0>())) type; + + BOOST_STATIC_ASSERT((is_same, 0> > + >::value)); + } + +Please see the reference for more details. + +[endsect] + +[section:refe Reference] + +[section:auto AUTO, AUTO_TPL] + +The `BOOST_AUTO` macro emulates the proposed `auto` keyword in C++. + +[h4 Usage] + + BOOST_AUTO(var,expr) + BOOST_AUTO_TPL(var,expr) + +[variablelist Arguments +[[var][a variable to be initialized with the expression]] +[[expr][a valid c++ expression]] +] + +[h4 Remarks] + +If you want to use `auto` in a template-context, use `BOOST_AUTO_TPL(expr)`, +which takes care of the `typename` keyword inside the `auto` expression. + +[h4 Sample Code] + + int main() + { + length::meter a(5); + force::newton b(6); + BOOST_AUTO(c, a * b); + } + +[endsect] + +[section:compl COMPLIANT] + +The `BOOST_TYPEOF_COMPLIANT` macro can be used to force the emulation mode. +Define it if your compiler by default uses another mode, such as native `typeof` +or Microsoft-specific trick, but you want to use the emulation mode, +for example for portability reasons. + +[endsect] + +[section:incr INCREMENT_REGISTRATION_GROUP] + +The `BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP` macro ensures that type registrations +in different header files receive unique identifiers. + +[h4 Usage] + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +[h4 Remarks] + +specified once in every cpp/hpp file where any registration is performed, +before any registration. + +[h4 Sample Code] + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + class X; + BOOST_TYPEOF_REGISTER_TYPE(X) + +[endsect] + +[section:inte INTEGRAL] + +The `BOOST_TYPEOF_INTEGRAL` macro is used when registering an integral +template parameter using `BOOST_TYPEOF_REGISTER_TEMPLATE`. + +Useful for `enum`s and dependent integral template parameters. + +[h4 Usage] + + BOOST_TYPEOF_INTEGRAL(x) + +[variablelist Arguments +[[x][a fully qualified integral type or enum]] +] + +[h4 Remarks] + +A short syntax has been implemented for the built in types +(int, bool, long, unsigned long, etc.) +Other non-type template parameters (e.g. pointer to member) +are not supported. + +[h4 Sample Code] + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + namespace foo + { + enum color {red, green, blue}; + + template + class class_with_enum {}; + + template + class class_with_dependent_non_type {}; + } + + BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_enum, + (BOOST_TYPEOF_INTEGRAL(foo::color)) + (typename) + ) + + BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_dependent_non_type, + (typename) + (BOOST_TYPEOF_INTEGRAL(P0)) + ) + +[endsect] + +[section:limit_func LIMIT_FUNCTION_ARITY] + +The `BOOST_TYPEOF_LIMIT_FUNCTION_ARITY` macro defines how many parameters +are supported for functios, and applies to functions, function pointers, +function references, and member function pointers. The default value is 10. +Redefine if you want the Typeof Library to handle functions with more parameters. + +[endsect] + +[section:messages MESSAGES] + +Define `BOOST_TYPEOF_MESSAGE` before including boost/typeof/typeof.hpp to +include messages "using typeof emulation" and "using native typeof". +By default, these messages will not be displayed. + +[endsect] + +[section:limit_size LIMIT_SIZE] + +The `BOOST_TYPEOF_LIMIT_SIZE` macro defines the size of the compile-time sequence +used to encode a type. The default value is 50. Increase it if you want +the Typeof Library to handle very complex types, although this +possibility is limited by the maximum number of template parameters supported +by your compiler. On the other hand, if you work only with very simple types, +decreasing this number may help to boost compile-time performance. + +[endsect] + +[section:regtype REGISTER_TYPE] + +The `BOOST_TYPEOF_REGISTER_TYPE` macro informs the Typeof Library +about the existence of a type + +[h4 Usage] + + BOOST_TYPEOF_REGISTER_TYPE(x) + +[variablelist Arguments +[[x][a fully qualified type]] +] + +[h4 Remarks] + +Must be used in the global namespace + +[h4 Sample Code] + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + namespace foo + { + class bar {}; + enum color {red, green, blue}; + } + + BOOST_TYPEOF_REGISTER_TYPE(foo::bar) + BOOST_TYPEOF_REGISTER_TYPE(foo::color) + +[endsect] + +[section:regtemp REGISTER_TEMPLATE] + +The `BOOST_TYPEOF_REGISTER_TEMPLATE` macro informs the Typeof Library +about the existence of a template and describes its parameters + +[h4 Usage] + + BOOST_TYPEOF_REGISTER_TEMPLATE(x, n) + BOOST_TYPEOF_REGISTER_TEMPLATE(x, seq) + +[variablelist Arguments +[[x][a fully qualified template]] +[[n][the number of template arguments. Only valid if all template arguments are typenames]] +[[seq][a sequence of template arguments. Must be used when integral or template template parameters are present]] +] + +[h4 Remarks] + +Must be used in the global namespace. + +The library allows registration of templates with type, integral, +and template template parameters: + +* A type template parameter is described by the `(class)` or `(typename)` sequence element +* A template parameter of a well-known integral type can be described by +simply supplying its type, like `(unsigned int)`. +The following well-known integral types are supported: + * `[signed/unsigned] char` + * `[unsigned] short` + * `[unsigned] int` + * `[unsigned] long` + * `unsigned` + * `bool` + * `size_t` +* Enums and typedefs of integral types, need to be described explicitly +with the `BOOST_TYPEOF_INTEGRAL` macro, like `(BOOST_TYPEOF_INTEGRAL(MyEnum))` +* Template template parameters are described with the `BOOST_TYPEOF_TEMPLATE` macro, +like: `(BOOST_TYPEOF_TEMPLATE((class)(unsigned int)))`. +In case of all type parameters this can be shortened to something like `(BOOST_TYPEOF_TEMPLATE(2))`. +The nested template template parameters are not supported. + +[h4 Sample Code] + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + namespace foo + { + template + class simple_template {}; + + template + class class_with_integral_constant {}; + } + + BOOST_TYPEOF_REGISTER_TEMPLATE(foo::simple_template, 2) + BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_integral_constant, (typename)(int)) + +[endsect] + +[section:temp TEMPLATE] + +The `BOOST_TYPEOF_TEMPLATE` macro is used when registering template template parameters +using `BOOST_TYPEOF_REGISTER_TEMPLATE`. + +[h4 Usage] + + BOOST_TYPEOF_TEMPLATE(n) + BOOST_TYPEOF_TEMPLATE(seq) + +[variablelist Arguments +[[n][the number of template arguments. Only valid if all template arguments are typenames]] +[[seq][a sequence of template arguments. Must be used when there are integral constants in the nested template]] +] + +[h4 Remarks] + +Can not be used to register nested template template parameters. + +[h4 Sample Code] + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + namespace foo + { + enum color {red, green, blue}; + + template class T1> + class nested_template_class {}; + + template class T1> + class nested_with_integral {}; + } + + BOOST_TYPEOF_REGISTER_TEMPLATE(foo::nested_template_class, + (foo::color) + (BOOST_TYPEOF_TEMPLATE(1)) + ) + + BOOST_TYPEOF_REGISTER_TEMPLATE(foo::nested_with_integral, + (BOOST_TYPEOF_TEMPLATE((typename)(unsigned char))) + ) + +[endsect] + +[section:typo TYPEOF, TYPEOF_TPL] + +The `BOOST_TYPEOF` macro calculates the type of an expression, +but removes the top-level qualifiers, `const&` + +[h4 Usage] + + BOOST_TYPEOF(expr) + BOOST_TYPEOF_TPL(expr) + +[variablelist Arguments +[[expr][a valid c++ expression that can be bound to const T&]] +] + +[h4 Remarks] + +If you want to use `typeof` in a template-context, use `BOOST_TYPEOF_TPL(expr)`, +which takes care of `typename` inside the `typeof` expression. + +[h4 Sample Code] + + template + struct result_of_conditional + { + typedef BOOST_TYPEOF_TPL(true?A():B()) type; + }; + + template + result_of_conditional::type min(const A& a,const B& b) + { + return a < b ? a : b; + } + +[endsect] + +[section:typn TYPEOF_NESTED_TYPEDEF, TYPEOF_NESTED_TYPEDEF_TPL] + +The `TYPEOF_NESTED_TYPEDEF` macro works in much the same way as the 'TYPEOF' macro does, but +workarounds several compiler deficiencies. + +[h4 Usage] + + BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) + +[variablelist Arguments +[[name][a valid identifier to nest the typeof operation inside] +[expr][a valid c++ expression that can be bound to const T&]] +] + +[h4 Remarks] + +'typeof_nested_typedef' nests the 'typeof' operation inside a struct. By doing this, the 'typeof' operation +can be split into two steps, deconfusing several compilers (notably VC7.1 and VC8.0) on the way. +This also removes the limitation imposed by `BOOST_TYPEOF_LIMIT_SIZE` and allows you to use 'typeof' on much +larger expressions. + +If you want to use `typeof_nested_typedef` in a template-context, use `BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr)`, +which takes care of `typename` inside the `typeof` expression. + +'typeof_nested_typedef' can not be used at function/block scope. + +[h4 Sample Code] + + template + struct result_of_conditional + { + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B()) + typedef typename nested::type type; + }; + + template + result_of_conditional::type min(const A& a,const B& b) + { + return a < b ? a : b; + } + +[endsect] + +[endsect] + +[section:other Other considerations and tips] + +[section:natem Native typeof support and emulation] + +Many compilers support typeof already, most noticeable GCC and Metrowerks. + +Igor Chesnokov discovered a method that allows to implement `typeof` +on the VC series of compilers. It uses a bug in the Microsoft compiler +that allows a nested class of base to be defined in a class derived from base: + + template struct typeof_access + { + struct id2type; //not defined + }; + + template struct typeof_register : typeof_access + { + // define base's nested class here + struct typeof_access::id2type + { + typedef T type; + }; + }; + + //Type registration function + typeof_register register_type(const T&); + + //Actually register type by instantiating typeof_register for the correct type + sizeof(register_type(some-type)); + + //Use the base class to access the type. + typedef typeof_access::id2type::type type; + +Peder Holt adapted this method to VC7.0, where the nested class +is a template class that is specialized in the derived class. + +In VC8.0, it seemed that all the bug-featire had been fixed, but +Steven Watanabe managed to implement a more rigorous version of the VC7.0 fix that +enables 'typeof' to be supported 'natively' here as well. + +For many other compilers neither native `typeof` support +nor the trick described above is an option. For such compilers +the emulation method is the only way of implementing `typeof`. + +According to a rough estimate, at the time of this writing +the introduction of the `typeof`, `auto`, etc., into the C++ standard +may not happen soon. Even after it's done, some time still has to pass +before most compilers implement this feature. But even after that, +there always are legacy compilers to support (for example now, in 2005, +many people are still using VC6, long after VC7.x, and even VC8.0 beta became available). + +Considering extreme usefulness of the feature right now, +it seems to make sense to implement it at the library level. + +The emulation mode seems to be important even if a better option is present +on some particular compiler. If a library author wants to develop portable +code using `typeof`, she needs to use emulation mode and register her types and +templates. Those users who have a better option can still take +advantage of it, since the registration macros are defined as no-op on +such compilers, while the users for whom emulation is the only option will use it. + +The other consideration applies to the users of VC7.1. Even though the more +convenient `typeof` trick is available, the possibility of upgrade to VC8, +where emulation remains the only option, should be considered. + +The emulation mode can be forced on the compilers that don't use it +by default by defining the `BOOST_TYPEOF_COMPLIANT` symbol: + + g++ -D BOOST_TYPEOF_COMPLIANT -I \boost\boost_1_32_0 main.cpp + +[endsect] + +[section:parties The three participating parties] + +The Lambda example from the Motivation section requires the following registration: + + #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::tuples::tuple, 2); + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor, 1); + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor_base, 2); + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::relational_action, 1); + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::logical_action, 1); + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::other_action, 1); + BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::greater_action); + BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::less_action); + BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::and_action); + BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::placeholder, (int)); + +It may seem that the price for the ability to discover the expression's type +is too high: rather large amount of registration is required. +However note that all of the above registration is done only once, +and after that, any combination of the registered types and templates +would be handled. Moreover, this registration is typically done +not by the end-user, but rather by a layer on top of some library +(in this example -- Boost.Lambda). + +When thinking about this, it's helpful to consider three parties: the typeof facility, +the library (probably built on expression templates principle), and the end-user. +The typeof facility is responsible for registering fundamental types. +The library can register its own types and templates. + +In the best-case scenario, if the expressions always consist of only +fundamental types and library-defined types and templates, a library author +can achieve the impression that the `typeof` is natively supported for her library. +On the other hand, the more often expressions contain user-defined types, +the more responsibility is put on the end-user, and therefore the less attractive +this approach becomes. + +Thus, the ratio of user-defined types in the expressions should be the main +factor to consider when deciding whether or not to apply the typeof facility. + +[endsect] + +[section:features Supported features] + +The Typeof library pre-registers fundamental types. For these types, +and for any other types/templates registered by the user library or end-user, +any combination of the following is supported: + +* Pointers; +* References (except top-level); +* Consts (except top-level); +* Volatiles (except top-level); +* Arrays; +* Functions, function pointers, and references; +* Pointers to member functions; +* Pointers to data members. + +For example the following type: + + int& (*)(const volatile char*, double[5], void(*)(short)) + +is supported right away, and something like: + + void (MyClass::*)(int MyClass::*, MyClass[10]) const + +is supported provided `MyClass` is registered. + +The Typeof Library also provides registration files for most STL classes/templates. +These files are located in the std subdirectory, and named after corresponding STL headers. +These files are not included by the typeof system and have to be explicitly included +by the user, as needed: + + #include + BOOST_AUTO(fun, std::bind2nd(std::less(), 21)); //create named function object for future use. + +[endsect] + +[section:what What needs to be registered?] + +It is possible to take advantage of the compiler when registering types for the Typeof Library. +Even though there is currently no direct support for typeof in the language, +the compiler is aware of what the type of an expression is, and gives an error +if it encounters an expression that has not been handled correctly. In the `typeof` context, +this error message will contain clues to what types needs to be registered with the +Typeof Library in order for `BOOST_TYPEOF` to work. + + struct X {}; + + template + struct Y {}; + + std::pair > a; + + BOOST_AUTO(a,b); + +We get the following error message from VC7.1 + +[pre + error C2504: 'boost::type_of::'anonymous-namespace'::encode_type_impl' : base + class undefined + with + \[ + V=boost::type_of::'anonymous-namespace'::encode_type_impl,std::pair>>::V0, + Type_Not_Registered_With_Typeof_System=X + \] +] + +Inspecting this error message, we see that the compiler complains about `X` + + BOOST_TYPEOF_REGISTER_TYPE(X); //register X with the typeof system + +Recompiling, we get a new error message from VC7.1 + +[pre + error C2504: 'boost::type_of::'anonymous-namespace'::encode_type_impl' : base + class undefined + with + \[ + V=boost::type_of::'anonymous-namespace'::encode_type_impl,std::pair>>::V1, + Type_Not_Registered_With_Typeof_System=Y + \] +] + +Inspecting this error message, we see that the compiler complains about `Y`. +Since `Y` is a template, and contains integral constants, we need to take more care when registering: + + BOOST_TYPEOF_REGISTER_TEMPLATE(Y,(typename)(bool)); //register template class Y + +It is a good idea to look up the exact definition of `Y` when it contains integral constants. +For simple template classes containing only typenames, you can rely solely on the compiler error. + +The above code now compiles. + +This technique can be used to get an overview of which types needs to be registered +for a given project in order to support `typeof`. + +[endsect] + +[section:limi Limitations] + +Nested template template parameters are not supported, like: + + template class> class Tpl> + class A; // can't register! + +Classes and templates nested inside other templates also can't be registered +because of the issue of nondeduced context. This limitation is most noticeable +with regards to standard iterators in Dinkumware STL, which are implemented +as nested classes. Instead, instantiations can be registered: + + BOOST_TYPEOF_REGISTER_TYPE(std::list::const_iterator) + +[endsect] + +[endsect] + +[section:cont Contributed By:] + +* Compliant compilers -- Arkadiy Vertleyb, Peder Holt +* MSVC 6.5, 7.0, 7.1 -- Igor Chesnokov, Peder Holt + +[endsect] + +[section:ackn Acknowledgements] + +The idea of representing a type as multiple compile-time integers, +and passing these integers across function boundaries using sizeof(), +was taken from Steve Dewhurst's article "A Bitwise typeof Operator", CUJ 2002. +This article can also be viewed online, at [@http://www.semantics.org/localarchive.html +http://www.semantics.org/localarchive.html]. + +Special thank you to Paul Mensonides, Vesa Karvonen, and Aleksey Gurtovoy +for the Boost Preprocessor Library and MPL. Without these two libraries, +this typeof implementation would not exist. + +The following people provided support, gave valuable comments, +or in any other way contributed to the library development +(in alphabetical order): + +* David Abrahams +* Andrey Beliakov +* Joel de Guzman +* Daniel James +* Vesa Karvonen +* Andy Little +* Paul Mensonides +* Alexander Nasonov +* Tobias Schwinger +* Martin Wille + +[endsect] diff --git a/tools/boost_1_65_1/libs/typeof/index.html b/tools/boost_1_65_1/libs/typeof/index.html new file mode 100644 index 0000000000000000000000000000000000000000..f5c3af7699bbd3c1be39085e5d833878f06ddf75 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/index.html @@ -0,0 +1,16 @@ + + + + + + + +Automatic redirection failed, please go to +../../doc/html/typeof.html + + + diff --git a/tools/boost_1_65_1/libs/typeof/meta/libraries.json b/tools/boost_1_65_1/libs/typeof/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..97474b00919d097b71ed5ab19e686b249d453159 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/meta/libraries.json @@ -0,0 +1,16 @@ +{ + "key": "typeof", + "name": "Typeof", + "authors": [ + "Arkadiy Vertleyb", + "Peder Holt" + ], + "description": "Typeof operator emulation.", + "category": [ + "Emulation" + ], + "maintainers": [ + "Arkadiy Vertleyb ", + "Peder Holt " + ] +} diff --git a/tools/boost_1_65_1/libs/typeof/test/Jamfile.v2 b/tools/boost_1_65_1/libs/typeof/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..28d7beb078a7147c90ded763201bf4e90cb24189 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/Jamfile.v2 @@ -0,0 +1,56 @@ +# Copyright (C) 2006 Vladimir Prus +# Copyright (C) 2006 Arkadiy Vertleyb +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +# Boost Typeof Library test Jamfile + +import set ; + +# The special requirement is not ported yet. +# +#local rule special-requirements ( toolset variant : properties * ) +#{ +# # Tru64/CXX6.5 hangs on most tests, so just turn it off completely. +# +# if $(UNIX) && $(OS) = OSF +# { +# switch $(toolset) +# { +# case tru64cxx65* : properties = +# [ replace-properties $(properties) : no ] ; +# } +# } +# +# return $(properties) ; +#} + +rule typeof-test ( source ) +{ + return [ compile $(source) : BOOST_TYPEOF_NATIVE : + $(source:B)_native ] + [ compile $(source) : BOOST_TYPEOF_EMULATION : + $(source:B)_emulation ] + ; +} + +rule all-tests ( ) +{ + local all ; +# for local t in [ set.difference [ glob *.cpp ] : odr1.cpp odr2.cpp ] + for local t in [ set.difference [ glob *.cpp ] : [ glob odr*.cpp ] ] + { + all += [ typeof-test $(t) ] ; + } + all += [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_NATIVE : + odr_native ] ; + all += [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_EMULATION : + odr_emulation ] ; + all += [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : BOOST_TYPEOF_EMULATION : + odr_no_uns ] ; + return $(all) ; +} + +test-suite "typeof" + : [ all-tests ] + ; diff --git a/tools/boost_1_65_1/libs/typeof/test/data_member.cpp b/tools/boost_1_65_1/libs/typeof/test/data_member.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b8fdc3aa4a05c40fff6a3cdd9441683e86a16a75 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/data_member.cpp @@ -0,0 +1,11 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x; +BOOST_TYPEOF_REGISTER_TYPE(x) + +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/tools/boost_1_65_1/libs/typeof/test/function.cpp b/tools/boost_1_65_1/libs/typeof/test/function.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f9a4e9918a3308e66abb3a2a489a9c7c779a07c5 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/function.cpp @@ -0,0 +1,10 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/tools/boost_1_65_1/libs/typeof/test/function_binding.cpp b/tools/boost_1_65_1/libs/typeof/test/function_binding.cpp new file mode 100644 index 0000000000000000000000000000000000000000..46a60169a8807fa879f113531f3b382be8606085 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/function_binding.cpp @@ -0,0 +1,22 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +int foo1(double); +int foo2(...); +int foo3(int, ...); +typedef int(&FREF1)(double); +typedef int(&FREF2)(...); +typedef int(&FREF3)(int, ...); +FREF1 fref1 = *foo1; +FREF2 fref2 = *foo2; +FREF3 fref3 = *foo3; + +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/function_ptr.cpp b/tools/boost_1_65_1/libs/typeof/test/function_ptr.cpp new file mode 100644 index 0000000000000000000000000000000000000000..977546abd7dcde643e9ec3c9c1e857ff19929a8b --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/function_ptr.cpp @@ -0,0 +1,26 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); + +// check that const gets stripped from function pointer + +int foo1(double); +int foo2(...); +typedef int(*PTR1)(double); +typedef int(*PTR2)(...); +typedef const PTR1 CPTR1; +typedef const PTR2 CPTR2; +CPTR1 cptr1 = foo1; +CPTR2 cptr2 = foo2; + +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/function_ptr_from_tpl.cpp b/tools/boost_1_65_1/libs/typeof/test/function_ptr_from_tpl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c048edeb30fcf4dbfcdb2bad56265998b9867001 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/function_ptr_from_tpl.cpp @@ -0,0 +1,28 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +void f1() {} +void f2(...) {} + +template +struct tpl1 +{ + typedef BOOST_TYPEOF_TPL(&f1) type; +}; + +template +struct tpl2 +{ + typedef BOOST_TYPEOF_TPL(&f2) type; +}; + +typedef void(*fun1_type)(); +typedef void(*fun2_type)(...); + +BOOST_STATIC_ASSERT((boost::is_same::type, fun1_type>::value)); +BOOST_STATIC_ASSERT((boost::is_same::type, fun2_type>::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/function_ref.cpp b/tools/boost_1_65_1/libs/typeof/test/function_ref.cpp new file mode 100644 index 0000000000000000000000000000000000000000..06512766ad8481165762ce0972cc74db9d09e9b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/function_ref.cpp @@ -0,0 +1,10 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/tools/boost_1_65_1/libs/typeof/test/member_function.cpp b/tools/boost_1_65_1/libs/typeof/test/member_function.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a7fbd9f24a078398d009177e6eed53b362bf393a --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/member_function.cpp @@ -0,0 +1,10 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/tools/boost_1_65_1/libs/typeof/test/modifiers.cpp b/tools/boost_1_65_1/libs/typeof/test/modifiers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..41a9da96c1583c32353733aa18ee95f815b6062e --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/modifiers.cpp @@ -0,0 +1,19 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x{}; +BOOST_TYPEOF_REGISTER_TYPE(x) + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); + diff --git a/tools/boost_1_65_1/libs/typeof/test/nested_typedef.cpp b/tools/boost_1_65_1/libs/typeof/test/nested_typedef.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7eee2ebcfc14b556cf30cc7050cfeda231a47c47 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/nested_typedef.cpp @@ -0,0 +1,37 @@ +// Copyright (C) 2006 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + + +void do_int(int) {} + +struct { + template + T operator[](const T& n) {return n;} +} int_p; + + +template struct wrap +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,int_p[& do_int]) + typedef typename nested::type type; +}; + +BOOST_TYPEOF_REGISTER_TEMPLATE(wrap,1) + +template struct parser +{ + struct __rule { + static T & a_placeholder; + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,int_p[a_placeholder]) + typedef typename nested::type type; + }; +}; + +BOOST_STATIC_ASSERT((boost::is_same::type,void(*)(int)>::value)); +BOOST_STATIC_ASSERT((boost::is_same >::__rule::type,wrap >::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/noncopyable.cpp b/tools/boost_1_65_1/libs/typeof/test/noncopyable.cpp new file mode 100644 index 0000000000000000000000000000000000000000..833fbf0b667028b531027f1e61fae3a57b527701 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/noncopyable.cpp @@ -0,0 +1,36 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x : boost::noncopyable +{ + void foo() {} + void bar() const {} +}; + +BOOST_TYPEOF_REGISTER_TYPE(x) + +x& make_ref() +{ + static x result; + return result; +} + +const x& make_const_ref() +{ + static x result; + return result; +} + +void foo() +{ + BOOST_AUTO(& v1, make_ref()); + v1.foo(); + + BOOST_AUTO(const& v2, make_const_ref()); + v2.bar(); +} diff --git a/tools/boost_1_65_1/libs/typeof/test/odr.hpp b/tools/boost_1_65_1/libs/typeof/test/odr.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9368e4cbd0bb00c4fe424ad708f35edd01a1a586 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr.hpp @@ -0,0 +1,17 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// boostinspect:nounnamed + +#include + +struct foo +{ + typedef BOOST_TYPEOF(1 + 2.5) type; +}; + +namespace +{ + typedef foo::type type; +} diff --git a/tools/boost_1_65_1/libs/typeof/test/odr1.cpp b/tools/boost_1_65_1/libs/typeof/test/odr1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5d36d6d43d2d1b2640d75bd4497a681a70370ef6 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr1.cpp @@ -0,0 +1,12 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "odr.hpp" +#include + +int main() +{ + std::cout << "No ODR violation detected" << std::endl; + return 0; +} diff --git a/tools/boost_1_65_1/libs/typeof/test/odr2.cpp b/tools/boost_1_65_1/libs/typeof/test/odr2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abfc2915f8843497c45b947d81b669a7af33c142 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr2.cpp @@ -0,0 +1,5 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "odr.hpp" diff --git a/tools/boost_1_65_1/libs/typeof/test/odr_no_uns1.cpp b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8bf5a9902b2fb3b88a31ccf5badef96b98d4a596 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns1.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "odr_no_uns1.hpp" +#include "odr_no_uns2.hpp" + +void odr_no_uns1() +{ + odr_test_1 t1; + odr_test_2 t2; + BOOST_AUTO(v1, t1); + BOOST_AUTO(v2, t2); +} + +int main() +{ + return 0; +} diff --git a/tools/boost_1_65_1/libs/typeof/test/odr_no_uns1.hpp b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ef1e34d7eee70e346f561ec70f073a2c68c38af1 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns1.hpp @@ -0,0 +1,19 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED +#define BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED + +#define BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct odr_test_1 +{}; + +BOOST_TYPEOF_REGISTER_TYPE(odr_test_1) + +#endif//BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED diff --git a/tools/boost_1_65_1/libs/typeof/test/odr_no_uns2.cpp b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..649d5812e3ddc0436112a29453fcfc3ba28cb92f --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns2.cpp @@ -0,0 +1,15 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "odr_no_uns2.hpp" +#include "odr_no_uns1.hpp" + +void odr_no_uns2() +{ + odr_test_1 t1; + odr_test_2 t2; + BOOST_AUTO(v1, t1); + BOOST_AUTO(v2, t2); +} diff --git a/tools/boost_1_65_1/libs/typeof/test/odr_no_uns2.hpp b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a384ccfb77210648ecbe1b4cff02c747ad9b4de9 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/odr_no_uns2.hpp @@ -0,0 +1,19 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED +#define BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED + +#define BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct odr_test_2 +{}; + +BOOST_TYPEOF_REGISTER_TYPE(odr_test_2) + +#endif//BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED diff --git a/tools/boost_1_65_1/libs/typeof/test/std.cpp b/tools/boost_1_65_1/libs/typeof/test/std.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e6bfdaf92485d31462f227f2d4276e200146394e --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/std.cpp @@ -0,0 +1,69 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +// STL containers + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); + +// function objects + +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test >::value); +BOOST_STATIC_ASSERT(boost::type_of::test > >::value); +BOOST_STATIC_ASSERT(boost::type_of::test > >::value); +BOOST_STATIC_ASSERT(boost::type_of::test > >::value); +BOOST_STATIC_ASSERT(boost::type_of::test > >::value); + +// valarray + +BOOST_STATIC_ASSERT(boost::type_of::test >::value); diff --git a/tools/boost_1_65_1/libs/typeof/test/template_dependent.cpp b/tools/boost_1_65_1/libs/typeof/test/template_dependent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..da5a04585b726f7b185608161233114ff9a97a71 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/template_dependent.cpp @@ -0,0 +1,15 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +template struct t{}; + +BOOST_TYPEOF_REGISTER_TEMPLATE(t, + (class) + (BOOST_TYPEOF_INTEGRAL(P0)) + ) + +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/template_enum.cpp b/tools/boost_1_65_1/libs/typeof/test/template_enum.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e72a985e4b4b3d7d2541591a44c8b3522900741 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/template_enum.cpp @@ -0,0 +1,15 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +enum E{ONE, TWO, THREE}; +template struct t{}; + +BOOST_TYPEOF_REGISTER_TEMPLATE(t, + (BOOST_TYPEOF_INTEGRAL(E)) + ) + +BOOST_STATIC_ASSERT(boost::type_of::test >::value); diff --git a/tools/boost_1_65_1/libs/typeof/test/template_int.cpp b/tools/boost_1_65_1/libs/typeof/test/template_int.cpp new file mode 100644 index 0000000000000000000000000000000000000000..92ee3e9958e18f4d1bdade8589fdc72f52f5f021 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/template_int.cpp @@ -0,0 +1,32 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x; +BOOST_TYPEOF_REGISTER_TYPE(x) + +template< + class T, char c, unsigned short us, int i, unsigned long ul, + bool b1, bool b2, signed char sc, unsigned u> + struct Tpl +{}; + +BOOST_TYPEOF_REGISTER_TEMPLATE(Tpl, + (class) + (char) + (unsigned short) + (int) + (unsigned long) + (bool) + (bool) + (signed char) + (unsigned) + ) + +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/template_multiword.cpp b/tools/boost_1_65_1/libs/typeof/test/template_multiword.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65ea15c069de554d667de4a14ccfb69a3f82f968 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/template_multiword.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +template struct t{}; + +BOOST_TYPEOF_REGISTER_TEMPLATE(t, + (BOOST_TYPEOF_INTEGRAL(unsigned long int)) + ) + +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/template_tpl.cpp b/tools/boost_1_65_1/libs/typeof/test/template_tpl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..40d85fc19b7ac5dc4e983f3946dd0660dce638ed --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/template_tpl.cpp @@ -0,0 +1,26 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +template +struct t0; + +template +struct t1; + +template class T, template class U> +struct t2; + +BOOST_TYPEOF_REGISTER_TEMPLATE(t0, 2) + +BOOST_TYPEOF_REGISTER_TEMPLATE(t1, (class)(int)) + +BOOST_TYPEOF_REGISTER_TEMPLATE(t2, + (BOOST_TYPEOF_TEMPLATE(2)) + (BOOST_TYPEOF_TEMPLATE((class)(int))) + ) + +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/template_type.cpp b/tools/boost_1_65_1/libs/typeof/test/template_type.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e4ece642b60cd7ddc151a8b9f069c6c91afbda89 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/template_type.cpp @@ -0,0 +1,17 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct P1; +struct P2; + +template struct Tpl; + +BOOST_TYPEOF_REGISTER_TYPE(P1) +BOOST_TYPEOF_REGISTER_TYPE(P2) +BOOST_TYPEOF_REGISTER_TEMPLATE(Tpl, 2) + +BOOST_STATIC_ASSERT((boost::type_of::test >::value)); diff --git a/tools/boost_1_65_1/libs/typeof/test/test.hpp b/tools/boost_1_65_1/libs/typeof/test/test.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cd694c0f4b2ca9b6b84763068a080da934dcb698 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/test.hpp @@ -0,0 +1,36 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED +#define BOOST_TYPEOF_TEST_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { namespace type_of { + + template + struct test_wrapper{}; + + template + T test_make(T*); + + template + struct test + { + BOOST_STATIC_CONSTANT(std::size_t,value = (boost::is_same< + BOOST_TYPEOF_TPL(test_make((test_wrapper*)0)), + test_wrapper + >::value) + ); + }; + +}} + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 2) + +#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED diff --git a/tools/boost_1_65_1/libs/typeof/test/type.cpp b/tools/boost_1_65_1/libs/typeof/test/type.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5d372b830ff29716447109eef578b003b8579405 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/test/type.cpp @@ -0,0 +1,11 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct A; +BOOST_TYPEOF_REGISTER_TYPE(A) + +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/tools/boost_1_65_1/libs/typeof/tools/preprocess.pl b/tools/boost_1_65_1/libs/typeof/tools/preprocess.pl new file mode 100644 index 0000000000000000000000000000000000000000..56f50c57c9957c4849e703c8e23e58f40a9d5718 --- /dev/null +++ b/tools/boost_1_65_1/libs/typeof/tools/preprocess.pl @@ -0,0 +1,122 @@ +# // (C) Copyright Tobias Schwinger +# // +# // Use modification and distribution are subject to the boost Software License +# // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). + +# // Preprocess and run this script. +# // +# // Invocation example using the GNU preprocessor: +# // +# // g++ -I$BOOST_ROOT -x c++ preprocess.pl -E |perl +# // +# // or in two steps: +# // +# // g++ -I$BOOST_ROOT -x c++ preprocess.pl -E >temp.pl +# // perl temp.pl + +#define die(x) 1 +die("ERROR: this script has to be preprocessed, stopped"); +#undef die + +use strict vars; +use File::Spec updir,curdir,catfile,canonpath,splitpath,file_name_is_absolute; + +# // --- Settings +my $up = File::Spec->updir(); + +# // Relative path to the destination directory. +my $path = File::Spec->catdir($up,$up,$up,'boost','typeof'); + +my $license = qq@ +/\/ Copyright (C) 2005 Arkadiy Vertleyb +/\/ Copyright (C) 2005 Peder Holt +/\/ +/\/ Use modification and distribution are subject to the boost Software License, +/\/ Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt). + +/\/ Preprocessed code, do not edit manually ! + +@; +# //--- + +# // Find this script's directory if run directly from the shell (not piped) +$path = File::Spec->canonpath +( File::Spec->catfile + ( File::Spec->file_name_is_absolute($0) + ? $0 : (File::Spec->curdir(),$0) + , $up + , File::Spec->splitpath($path) + ) +) unless ($0 eq '-'); +die +( ($0 eq '-') + ? "ERROR: please run from this script's directory, stopped" + : "ERROR: target directoty not found, stopped" +) unless (-d $path); + +# // Tidy up the contents and write it to a file +sub write_down(name,contents) +{ + my($name,$contents) = @_; + my $filename = $name; + + my $fqfname = File::Spec->catfile($path,$filename); + $contents =~ s"(((\n|^)\s*\#[^\n]+)|(\s*\n)){2,}"\n"g; # " + print STDERR "Writing file: '$filename'\n"; + open my($file),">$fqfname" + or die "ERROR: unable to open file '$filename' for writing, stopped"; + print $file $license; + print $file $contents; + close $file; +} + +# // Include external components to ensure they don't end up in the recorded +# // output +#define BOOST_TYPEOF_PP_INCLUDE_EXTERNAL +my $sewer = <<'%--%-EOF-%--%' +#include +#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED +%--%-EOF-%--% +; $sewer = ''; + + +#define BOOST_TYPEOF_PREPROCESSING_MODE +#define BOOST_TYPEOF_LIMIT_SIZE 50 +#define BOOST_TYPEOF_PP_NEXT_SIZE 100 + +&write_down('vector50.hpp',<<'%--%-EOF-%--%' +#include +%--%-EOF-%--% +); +#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED + +#undef BOOST_TYPEOF_LIMIT_SIZE +#define BOOST_TYPEOF_LIMIT_SIZE 100 +#define BOOST_TYPEOF_PP_NEXT_SIZE 149 + +&write_down('vector100.hpp',<<'%--%-EOF-%--%' +#include +%--%-EOF-%--% +); +#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED + +#undef BOOST_TYPEOF_LIMIT_SIZE +#define BOOST_TYPEOF_LIMIT_SIZE 150 +#define BOOST_TYPEOF_PP_NEXT_SIZE 199 + + +&write_down('vector150.hpp',<<'%--%-EOF-%--%' +#include +%--%-EOF-%--% +); +#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED + +#undef BOOST_TYPEOF_LIMIT_SIZE +#define BOOST_TYPEOF_LIMIT_SIZE 200 +#define BOOST_TYPEOF_PP_NEXT_SIZE 250 + +&write_down('vector200.hpp',<<'%--%-EOF-%--%' +#include +%--%-EOF-%--% +); + diff --git a/tools/boost_1_65_1/libs/units/README.md b/tools/boost_1_65_1/libs/units/README.md new file mode 100644 index 0000000000000000000000000000000000000000..555467722e33f2598e8df230c58b712f830eac55 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/README.md @@ -0,0 +1,26 @@ +Boost.Units +=========== + +Boost.Units, part of collection of the [Boost C++ Libraries](http://github.com/boostorg), +implements dimensional analysis in a general and extensible manner, +treating it as a generic compile-time metaprogramming problem. +With appropriate compiler optimization, no runtime execution cost is introduced, +facilitating the use of this library to provide dimension checking in performance-critical code. + +### Directories + +* **doc** - QuickBook documentation sources +* **example** - examples +* **images** - images for documention +* **include** - Interface headers +* **test** - unit tests +* **test_headers** - unit tests for self containment of headers +* **tutorial** - tutorial + +### More information + +* [Documentation](http://boost.org/libs/units) + +### License + +Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt). diff --git a/tools/boost_1_65_1/libs/units/boost.css b/tools/boost_1_65_1/libs/units/boost.css new file mode 100644 index 0000000000000000000000000000000000000000..9f8d4bda8f8ac93f82dedca44607b711456ac7eb --- /dev/null +++ b/tools/boost_1_65_1/libs/units/boost.css @@ -0,0 +1,65 @@ +/*============================================================================= + Copyright 2002 William E. Kempf + Distributed under the Boost Software License, Version 1.0. (See accompany- + ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +H1 +{ + FONT-SIZE: 200%; + COLOR: #00008B; +} +H2 +{ + FONT-SIZE: 150%; +} +H3 +{ + FONT-SIZE: 125%; +} +H4 +{ + FONT-SIZE: 108%; +} +BODY +{ + FONT-SIZE: 100%; + BACKGROUND-COLOR: #ffffff; +} +PRE +{ + MARGIN-LEFT: 2em; + FONT-FAMILY: Courier, + monospace; +} +CODE +{ + FONT-FAMILY: Courier, + monospace; +} +CODE.as_pre +{ + white-space: pre; +} +.index +{ + TEXT-ALIGN: left; +} +.page-index +{ + TEXT-ALIGN: left; +} +.definition +{ + TEXT-ALIGN: left; +} +.footnote +{ + FONT-SIZE: 66%; + VERTICAL-ALIGN: super; + TEXT-DECORATION: none; +} +.function-semantics +{ + CLEAR: left; +} \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/units/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..d06495bc79cdd7651d03b949c8e6fc8434390eb0 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/Jamfile.v2 @@ -0,0 +1,224 @@ +# Units documentation Jamfile +# +# Copyright (c) 2007-2008 +# Steven Watanabe +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt + +import path ; +import quickbook ; +using boostbook ; +using doxygen ; +import print ; +import regex ; +import sequence ; + +path-constant here : . ; + +rule run_doxygen ( target : files * : name ) +{ + doxygen $(target) + : + $(files) + : + EXTRACT_ALL=YES + EXPAND_ONLY_PREDEF=YES + + # Horribly ugly, but then macros usually are :( + "PREDEFINED= \\ + \"BOOST_MPL_ASSERT(expr)=\" \\ + \"BOOST_UNITS_STATIC_CONSTANT(a,b)=static const b a\" \\ + \"BOOST_UNITS_AUTO_STATIC_CONSTANT(a,b)=static const auto a = b\" \\ + \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\ + \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\ + \"BOOST_UNITS_HAS_TYPEOF=1\" \\ + \"BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string, symbol_, factor, other_unit, id)= \\ + namespace boost { namespace units { namespace namespace_ { \\ + struct name_ ## _base_unit : boost::units::base_unit { \\ + static const char* name(); \\ + static const char* symbol(); \\ + }; \\ + } } }\" \\ + \"BOOST_UNITS_DOXYGEN=1\"" + HIDE_UNDOC_MEMBERS=NO + EXTRACT_PRIVATE=NO + ENABLE_PREPROCESSING=YES + MACRO_EXPANSION=YES + $(expand) + SEARCH_INCLUDES=NO + $(name) + ; + +} + +run_doxygen units_reference + : + [ glob $(here)/../../../boost/units/*.hpp : + $(here)/../../../boost/units/physical_dimensions.hpp ] + : + "Units Reference" + ; + +run_doxygen si_reference + : + $(here)/../../../boost/units/systems/si.hpp + [ path.glob-tree $(here)/../../../boost/units/systems/si : *.hpp : detail ] + : + "SI System Reference" + ; + +run_doxygen cgs_reference + : + $(here)/../../../boost/units/systems/cgs.hpp + [ path.glob-tree $(here)/../../../boost/units/systems/cgs : *.hpp : detail ] + : + "CGS System Reference" + ; + +rule make_base_units_doc ( directory : name ) +{ + run_doxygen $(directory)_base_units_reference + : + [ path.glob-tree $(here)/../../../boost/units/base_units/$(directory) : *.hpp : detail conversions.hpp ] + : + "$(name) Base Units Reference" + ; +} + +make_base_units_doc angle : Angle ; +make_base_units_doc astronomical : Astronomical ; +make_base_units_doc cgs : CGS ; +make_base_units_doc imperial : Imperial ; +make_base_units_doc information : Information ; +make_base_units_doc metric : Metric ; +make_base_units_doc si : SI ; +make_base_units_doc temperature : Temperature ; +make_base_units_doc us : US ; + +all_base_units_doc = angle astronomical cgs imperial information metric si temperature us ; +all_base_units_doc = $(all_base_units_doc)_base_units_reference ; + +run_doxygen dimensions_reference + : + $(here)/../../../boost/units/physical_dimensions.hpp + [ path.glob-tree $(here)/../../../boost/units/physical_dimensions : *.hpp : detail ] + : + "Dimensions Reference" + ; + +run_doxygen trig_reference + : + #../../../boost/units/systems/trig.hpp + [ path.glob-tree $(here)/../../../boost/units/systems/angle : *.hpp : detail ] + : + "Trigonometry and Angle System Reference" + ; + +run_doxygen temperature_reference + : + [ path.glob-tree $(here)/../../../boost/units/systems/temperature : *.hpp : detail ] + : + "Temperature System Reference" + ; + +run_doxygen information_reference + : + $(here)/../../../boost/units/systems/information.hpp + [ path.glob-tree $(here)/../../../boost/units/systems/information : *.hpp : detail prefixes.hpp ] + : + "Information System Reference" + ; + +run_doxygen abstract_reference + : + $(here)/../../../boost/units/systems/abstract.hpp + : + "Abstract System Reference" + ; + +rule less ( a b ) +{ + if [ path.basename $(a) ] < [ path.basename $(b) ] + { + return true ; + } +} + +rule generate-qbk ( target : sources * : properties * ) +{ + print.output $(target) ; + local as-path = [ sequence.transform path.make : $(sources:G=) ] ; + local known = ; + local duplicated = ; + for local file in $(as-path) + { + local base = [ path.basename $(file) ] ; + if $(base) in $(known) + { + if ! $(base) in $(duplicated) + { + duplicated += $(base) ; + } + } else + { + known += $(base) ; + } + } + for local file in [ sequence.insertion-sort $(as-path) : less ] + { + local output_filename = [ path.relative-to [ path.make $(here)/../../.. ] $(file) ] ; + local base_filename = [ path.basename $(file) ] ; + local base_unit = [ regex.replace $(base_filename) "\\.hpp" "" ] ; + if $(base_filename) in $(duplicated) + { + # tack the directory name onto the end + local dir-name = [ path.basename [ path.parent $(file) ] ] ; + base_unit = "$(base_unit) ($(dir-name))" ; + } + print.text "[headerref $(output_filename) $(base_unit)][br]" : overwrite ; + } +} + +make base_units.qbk : [ path.glob-tree $(here)/../../../boost/units/base_units : *.hpp : detail conversions.hpp ] : @generate-qbk ; +explicit base_units ; + +install base_units_install : base_units.qbk : . ; + +xml units + : + units.qbk + : + base_units_install + units_reference + si_reference + cgs_reference + $(all_base_units_doc) + dimensions_reference + trig_reference + temperature_reference + information_reference + abstract_reference +; + +boostbook standalone + : + units + : + toc.max.depth=1 + toc.section.depth=8 + chunk.section.depth=8 + boost.root="../../../.." + pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html +; + +############################################################################### +alias boostdoc + : units + : + : + : ; +explicit boostdoc ; +alias boostrelease ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/units/doc/abstract_reference.xml b/tools/boost_1_65_1/libs/units/doc/abstract_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..d2354b19c3661f717459bedec6bd479874608c3a --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/abstract_reference.xml @@ -0,0 +1,65 @@ + +Abstract System Reference
+ + +abstract::length_unit_tag +std::string +std::string + +abstract::mass_unit_tag +std::string +std::string + +abstract::time_unit_tag +std::string +std::string + +abstract::current_unit_tag +std::string +std::string + +abstract::temperature_unit_tag +std::string +std::string + +abstract::amount_unit_tag +std::string +std::string + +abstract::luminous_intensity_unit_tag +std::string +std::string + +abstract::plane_angle_unit_tag +std::string +std::string + +abstract::solid_angle_unit_tag +std::string +std::string + + +base_unit< length_unit_tag, length_dimension,-30 >base_unit< mass_unit_tag, mass_dimension,-29 >base_unit< time_unit_tag, time_dimension,-28 >base_unit< current_unit_tag, current_dimension,-27 >base_unit< temperature_unit_tag, temperature_dimension,-26 >base_unit< amount_unit_tag, amount_dimension,-25 >base_unit< luminous_intensity_unit_tag, luminous_intensity_dimension,-24 >base_unit< plane_angle_unit_tag, plane_angle_dimension,-23 >base_unit< solid_angle_unit_tag, solid_angle_dimension,-22 >make_system< length_unit_tag, mass_unit_tag, time_unit_tag, current_unit_tag, temperature_unit_tag, amount_unit_tag, luminous_intensity_unit_tag, plane_angle_unit_tag, solid_angle_unit_tag >::type +abstract unit of length unit< length_dimension, system > +abstract unit of mass unit< mass_dimension, system > +abstract unit of time unit< time_dimension, system > +abstract unit of current unit< current_dimension, system > +abstract unit of temperature unit< temperature_dimension, system > +abstract unit of amount unit< amount_dimension, system > +abstract unit of luminous intensity unit< luminous_intensity_dimension, system > +abstract unit of plane angle unit< plane_angle_dimension, system > +abstract unit of solid angle unit< solid_angle_dimension, system > + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/angle_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/angle_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..42f5407346828f3670437145a8e48da47d680ed2 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/angle_base_units_reference.xml @@ -0,0 +1,92 @@ + +Angle Base Units Reference
+ + +angle::arcminute_base_unit +const char * +const char * + + +scaled_base_unit< degree_base_unit, scale< 60, static_rational<-1 > > > + + + +
+
+ + +angle::arcsecond_base_unit +const char * +const char * + + +scaled_base_unit< degree_base_unit, scale< 3600, static_rational<-1 > > > + + + +
+
+ + + +boost::units::base_unit< degree_base_unit, boost::units::angle::radian_base_unit::dimension_type,-101 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< gradian_base_unit, boost::units::angle::radian_base_unit::dimension_type,-102 > +const char * +const char * + + + + +
+
+ + + +base_unit< radian_base_unit, plane_angle_dimension,-2 > +std::string +std::string + + + + +
+
+ + +angle::revolution_base_unit +const char * +const char * + + +scaled_base_unit< degree_base_unit, scale< 360, static_rational< 1 > > > + + + +
+
+ + + +base_unit< steradian_base_unit, solid_angle_dimension,-1 > +std::string +std::string + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/astronomical_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/astronomical_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..31d24c219078ce80ce0b4cd69e58b0d6f2fb184a --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/astronomical_base_units_reference.xml @@ -0,0 +1,94 @@ + +Astronomical Base Units Reference
+ + + +boost::units::base_unit< astronomical_unit_base_unit, boost::units::si::meter_base_unit::dimension_type,-207 > +const char * +const char * + + + + +
+
+ + +astronomical::light_day_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::astronomical::light_second_base_unit, scale< 86400, static_rational< 1 > > > + + + +
+
+ + +astronomical::light_hour_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::astronomical::light_second_base_unit, scale< 3600, static_rational< 1 > > > + + + +
+
+ + +astronomical::light_minute_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::astronomical::light_second_base_unit, scale< 60, static_rational< 1 > > > + + + +
+
+ + + +boost::units::base_unit< light_second_base_unit, boost::units::si::meter_base_unit::dimension_type,-201 > +const char * +const char * + + + + +
+
+ + +astronomical::light_year_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::astronomical::light_second_base_unit, scale< 31557600, static_rational< 1 > > > + + + +
+
+ + + +boost::units::base_unit< parsec_base_unit, boost::units::si::meter_base_unit::dimension_type,-206 > +const char * +const char * + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/base_units.qbk b/tools/boost_1_65_1/libs/units/doc/base_units.qbk new file mode 100644 index 0000000000000000000000000000000000000000..ad215dca6a60e61ac296b0801de7a266fc8fe0ed --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/base_units.qbk @@ -0,0 +1,91 @@ +[headerref boost/units/base_units/si/ampere.hpp ampere][br] +[headerref boost/units/base_units/metric/angstrom.hpp angstrom][br] +[headerref boost/units/base_units/angle/arcminute.hpp arcminute][br] +[headerref boost/units/base_units/angle/arcsecond.hpp arcsecond][br] +[headerref boost/units/base_units/metric/are.hpp are][br] +[headerref boost/units/base_units/astronomical/astronomical_unit.hpp astronomical_unit][br] +[headerref boost/units/base_units/metric/atmosphere.hpp atmosphere][br] +[headerref boost/units/base_units/metric/bar.hpp bar][br] +[headerref boost/units/base_units/metric/barn.hpp barn][br] +[headerref boost/units/base_units/cgs/biot.hpp biot][br] +[headerref boost/units/base_units/information/bit.hpp bit][br] +[headerref boost/units/base_units/information/byte.hpp byte][br] +[headerref boost/units/base_units/si/candela.hpp candela][br] +[headerref boost/units/base_units/temperature/celsius.hpp celsius][br] +[headerref boost/units/base_units/cgs/centimeter.hpp centimeter][br] +[headerref boost/units/base_units/us/cup.hpp cup][br] +[headerref boost/units/base_units/metric/day.hpp day][br] +[headerref boost/units/base_units/angle/degree.hpp degree][br] +[headerref boost/units/base_units/imperial/drachm.hpp drachm][br] +[headerref boost/units/base_units/us/dram.hpp dram][br] +[headerref boost/units/base_units/temperature/fahrenheit.hpp fahrenheit][br] +[headerref boost/units/base_units/metric/fermi.hpp fermi][br] +[headerref boost/units/base_units/us/fluid_dram.hpp fluid_dram][br] +[headerref boost/units/base_units/imperial/fluid_ounce.hpp fluid_ounce (imperial)][br] +[headerref boost/units/base_units/us/fluid_ounce.hpp fluid_ounce (us)][br] +[headerref boost/units/base_units/imperial/foot.hpp foot (imperial)][br] +[headerref boost/units/base_units/us/foot.hpp foot (us)][br] +[headerref boost/units/base_units/imperial/furlong.hpp furlong][br] +[headerref boost/units/base_units/imperial/gallon.hpp gallon (imperial)][br] +[headerref boost/units/base_units/us/gallon.hpp gallon (us)][br] +[headerref boost/units/base_units/imperial/gill.hpp gill (imperial)][br] +[headerref boost/units/base_units/us/gill.hpp gill (us)][br] +[headerref boost/units/base_units/angle/gradian.hpp gradian][br] +[headerref boost/units/base_units/imperial/grain.hpp grain (imperial)][br] +[headerref boost/units/base_units/us/grain.hpp grain (us)][br] +[headerref boost/units/base_units/cgs/gram.hpp gram][br] +[headerref boost/units/base_units/information/hartley.hpp hartley][br] +[headerref boost/units/base_units/metric/hectare.hpp hectare][br] +[headerref boost/units/base_units/metric/hour.hpp hour][br] +[headerref boost/units/base_units/imperial/hundredweight.hpp hundredweight (imperial)][br] +[headerref boost/units/base_units/us/hundredweight.hpp hundredweight (us)][br] +[headerref boost/units/base_units/imperial/inch.hpp inch (imperial)][br] +[headerref boost/units/base_units/us/inch.hpp inch (us)][br] +[headerref boost/units/base_units/si/kelvin.hpp kelvin][br] +[headerref boost/units/base_units/si/kilogram.hpp kilogram][br] +[headerref boost/units/base_units/metric/knot.hpp knot][br] +[headerref boost/units/base_units/imperial/league.hpp league][br] +[headerref boost/units/base_units/astronomical/light_day.hpp light_day][br] +[headerref boost/units/base_units/astronomical/light_hour.hpp light_hour][br] +[headerref boost/units/base_units/astronomical/light_minute.hpp light_minute][br] +[headerref boost/units/base_units/astronomical/light_second.hpp light_second][br] +[headerref boost/units/base_units/astronomical/light_year.hpp light_year][br] +[headerref boost/units/base_units/metric/liter.hpp liter][br] +[headerref boost/units/base_units/si/meter.hpp meter][br] +[headerref boost/units/base_units/metric/micron.hpp micron][br] +[headerref boost/units/base_units/us/mil.hpp mil][br] +[headerref boost/units/base_units/imperial/mile.hpp mile (imperial)][br] +[headerref boost/units/base_units/us/mile.hpp mile (us)][br] +[headerref boost/units/base_units/us/minim.hpp minim][br] +[headerref boost/units/base_units/metric/minute.hpp minute][br] +[headerref boost/units/base_units/metric/mmHg.hpp mmHg][br] +[headerref boost/units/base_units/si/mole.hpp mole][br] +[headerref boost/units/base_units/information/nat.hpp nat][br] +[headerref boost/units/base_units/metric/nautical_mile.hpp nautical_mile][br] +[headerref boost/units/base_units/imperial/ounce.hpp ounce (imperial)][br] +[headerref boost/units/base_units/us/ounce.hpp ounce (us)][br] +[headerref boost/units/base_units/astronomical/parsec.hpp parsec][br] +[headerref boost/units/base_units/imperial/pint.hpp pint (imperial)][br] +[headerref boost/units/base_units/us/pint.hpp pint (us)][br] +[headerref boost/units/base_units/imperial/pound.hpp pound (imperial)][br] +[headerref boost/units/base_units/us/pound.hpp pound (us)][br] +[headerref boost/units/base_units/us/pound_force.hpp pound_force][br] +[headerref boost/units/base_units/imperial/quart.hpp quart (imperial)][br] +[headerref boost/units/base_units/us/quart.hpp quart (us)][br] +[headerref boost/units/base_units/imperial/quarter.hpp quarter][br] +[headerref boost/units/base_units/angle/radian.hpp radian][br] +[headerref boost/units/base_units/angle/revolution.hpp revolution][br] +[headerref boost/units/base_units/si/second.hpp second][br] +[headerref boost/units/base_units/information/shannon.hpp shannon][br] +[headerref boost/units/base_units/angle/steradian.hpp steradian][br] +[headerref boost/units/base_units/imperial/stone.hpp stone][br] +[headerref boost/units/base_units/us/tablespoon.hpp tablespoon][br] +[headerref boost/units/base_units/us/teaspoon.hpp teaspoon][br] +[headerref boost/units/base_units/imperial/thou.hpp thou][br] +[headerref boost/units/base_units/imperial/ton.hpp ton (imperial)][br] +[headerref boost/units/base_units/metric/ton.hpp ton (metric)][br] +[headerref boost/units/base_units/us/ton.hpp ton (us)][br] +[headerref boost/units/base_units/metric/torr.hpp torr][br] +[headerref boost/units/base_units/imperial/yard.hpp yard (imperial)][br] +[headerref boost/units/base_units/us/yard.hpp yard (us)][br] +[headerref boost/units/base_units/metric/year.hpp year][br] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/cgs_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/cgs_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..3ba0929d9c5ff5152b1443e844b1e4d67abd417d --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/cgs_base_units_reference.xml @@ -0,0 +1,32 @@ + +CGS Base Units Reference
+ + + +scaled_base_unit< boost::units::si::ampere_base_unit, scale< 10, static_rational<+1 > > > + + + +
+
+ + + +scaled_base_unit< boost::units::si::meter_base_unit, scale< 10, static_rational<-2 > > > + + + +
+
+ + + +base_unit< gram_base_unit, mass_dimension,-8 > +std::string +std::string + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/cgs_reference.xml b/tools/boost_1_65_1/libs/units/doc/cgs_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..89c08209b49c4f6a685e6546ddfaf9eb3f5ddf8e --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/cgs_reference.xml @@ -0,0 +1,568 @@ + +CGS System Reference
+Includes all the cgs unit headers
+
+ + + +unit< acceleration_dimension, cgs::system > +const acceleration +const acceleration + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< area_dimension, cgs::system > +const area +const area +const area +const area + + + + + + + + + + + + + + + + + + + +
+
+ + + +placeholder class defining cgs unit system make_system< centimeter_base_unit, gram_base_unit, boost::units::si::second_base_unit, biot_base_unit >::type +various unit typedefs for convenience unit< dimensionless_type, system > + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< current_dimension, cgs::system > +const current +const current + + + + + + + + + + + + + + + + + + + +
+
+ + + +const dimensionless + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< dynamic_viscosity_dimension, cgs::system > +const dynamic_viscosity + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< energy_dimension, cgs::system > +const energy +const energy + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< force_dimension, cgs::system > +const force +const force + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< frequency_dimension, cgs::system > + + + + + + + + + + + + + + + + + + + +
+
+ + +std::stringconst reduce_unit< cgs::acceleration >::type & +std::stringconst reduce_unit< cgs::acceleration >::type & +std::stringconst reduce_unit< cgs::current >::type & +std::stringconst reduce_unit< cgs::current >::type & +std::stringconst reduce_unit< cgs::dynamic_viscosity >::type & +std::stringconst reduce_unit< cgs::dynamic_viscosity >::type & +std::stringconst reduce_unit< cgs::energy >::type & +std::stringconst reduce_unit< cgs::energy >::type & +std::stringconst reduce_unit< cgs::force >::type & +std::stringconst reduce_unit< cgs::force >::type & +std::stringconst reduce_unit< cgs::kinematic_viscosity >::type & +std::stringconst reduce_unit< cgs::kinematic_viscosity >::type & +std::stringconst reduce_unit< cgs::pressure >::type & +std::stringconst reduce_unit< cgs::pressure >::type & +std::stringconst reduce_unit< cgs::wavenumber >::type & +std::stringconst reduce_unit< cgs::wavenumber >::type & + + +
+
+ + + +unit< kinematic_viscosity_dimension, cgs::system > +const kinematic_viscosity +const kinematic_viscosity + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< length_dimension, cgs::system > +const length +const length +const length +const length + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< mass_dimension, cgs::system > +const mass +const mass +const mass +const mass + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< mass_density_dimension, cgs::system > + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< momentum_dimension, cgs::system > + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< power_dimension, cgs::system > + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< pressure_dimension, cgs::system > +const pressure +const pressure + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< time_dimension, cgs::system > +const time +const time + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< velocity_dimension, cgs::system > +const velocity +const velocity +const velocity +const velocity + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< volume_dimension, cgs::system > +const volume +const volume +const volume +const volume + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< wavenumber_dimension, cgs::system > +const wavenumber +const wavenumber +const wavenumber +const wavenumber +const wavenumber +const wavenumber + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/dimensions_reference.xml b/tools/boost_1_65_1/libs/units/doc/dimensions_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..d33421e999922edf57026718953571057be55b3b --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/dimensions_reference.xml @@ -0,0 +1,438 @@ + +Dimensions Reference
+Physical dimensions according to the SI system. This header includes all physical dimension headers for both base and derived dimensions.
+
+ + +derived dimension for absorbed dose : L^2 T^-2 derived_dimension< length_base_dimension, 2, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for acceleration : L T^-2 derived_dimension< length_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for action : L^2 M T^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-1 >::type + + +
+
+ + +derived dimension for activity : T^-1 derived_dimension< time_base_dimension,-1 >::type + + +
+
+ + +boost::units::base_dimension< amount_base_dimension,-4 >base dimension of amount dimension of amount of substance (N) amount_base_dimension::dimension_type + + +
+
+ + +derived dimension for angular acceleration : T^-2 QP derived_dimension< time_base_dimension,-2, plane_angle_base_dimension, 1 >::type + + +
+
+ + +derived dimension for angular momentum : L^2 M T^-1 QP^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-1, plane_angle_base_dimension,-1 >::type + + +
+
+ + +derived dimension for angular velocity : T^-1 QP derived_dimension< time_base_dimension,-1, plane_angle_base_dimension, 1 >::type + + +
+
+ + +derived dimension for area : L^2 derived_dimension< length_base_dimension, 2 >::type + + +
+
+ + +derived dimension for capacitance : L^-2 M^-1 T^4 I^2 derived_dimension< length_base_dimension,-2, mass_base_dimension,-1, time_base_dimension, 4, current_base_dimension, 2 >::type + + +
+
+ + +derived dimension for conductance : L^-2 M^-1 T^3 I^2 derived_dimension< length_base_dimension,-2, mass_base_dimension,-1, time_base_dimension, 3, current_base_dimension, 2 >::type + + +
+
+ + +derived dimension for conductivity : L^-3 M^-1 T^3 I^2 derived_dimension< length_base_dimension,-3, mass_base_dimension,-1, time_base_dimension, 3, current_base_dimension, 2 >::type + + +
+
+ + +boost::units::base_dimension< current_base_dimension,-6 >base dimension of current dimension of electric current (I) current_base_dimension::dimension_type + + +
+
+ + +derived dimension for dose equivalent : L^2 T^-2 derived_dimension< length_base_dimension, 2, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for dynamic viscosity : M L^-1 T^-1 derived_dimension< mass_base_dimension, 1, length_base_dimension,-1, time_base_dimension,-1 >::type + + +
+
+ + +derived dimension for electric charge : T^1 I^1 derived_dimension< time_base_dimension, 1, current_base_dimension, 1 >::type + + +
+
+ + +derived dimension for electric potential : L^2 M T^-3 I^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-3, current_base_dimension,-1 >::type + + +
+
+ + +derived dimension for energy : L^2 M T^-2 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for energy density : L^-1 M^1 T^-2 derived_dimension< length_base_dimension,-1, mass_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for force : L M T^-2 derived_dimension< length_base_dimension, 1, mass_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for frequency : T^-1 derived_dimension< time_base_dimension,-1 >::type + + +
+
+ + +derived dimension for heat capacity : L^2 M T^-2 Theta^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2, temperature_base_dimension,-1 >::type + + +
+
+ + +derived dimension for illuminance : L^-2 I QS derived_dimension< length_base_dimension,-2, luminous_intensity_base_dimension, 1, solid_angle_base_dimension, 1 >::type + + +
+
+ + +derived dimension for impedance : L^2 M T^-3 I^-2 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-3, current_base_dimension,-2 >::type + + +
+
+ + +derived dimension for inductance : L^2 M T^-2 I^-2 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2, current_base_dimension,-2 >::type + + +
+
+ + +boost::units::base_dimension< information_base_dimension,-700 >base dimension of information dimension of information information_base_dimension::dimension_type + + +
+
+ + +derived dimension for kinematic viscosity : L^2 T^-1 derived_dimension< length_base_dimension, 2, time_base_dimension,-1 >::type + + +
+
+ + +boost::units::base_dimension< length_base_dimension,-9 >base dimension of length dimension of length (L) length_base_dimension::dimension_type + + +
+
+ + +derived dimension for luminance : L^-2 I derived_dimension< length_base_dimension,-2, luminous_intensity_base_dimension, 1 >::type + + +
+
+ + +derived dimension for luminous flux : I QS derived_dimension< luminous_intensity_base_dimension, 1, solid_angle_base_dimension, 1 >::type + + +
+
+ + +boost::units::base_dimension< luminous_intensity_base_dimension,-3 >base dimension of luminous intensity dimension of luminous intensity (J) luminous_intensity_base_dimension::dimension_type + + +
+
+ + +derived dimension for magnetic field intensity : L^-1 I derived_dimension< length_base_dimension,-1, current_base_dimension, 1 >::type + + +
+
+ + +derived dimension for magnetic flux : L^2 M T^-2 I^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2, current_base_dimension,-1 >::type + + +
+
+ + +derived dimension for magnetic flux density : M T^-2 I^-1 derived_dimension< mass_base_dimension, 1, time_base_dimension,-2, current_base_dimension,-1 >::type + + +
+
+ + +boost::units::base_dimension< mass_base_dimension,-8 >base dimension of mass dimension of mass (M) mass_base_dimension::dimension_type + + +
+
+ + +derived dimension for mass density : L^-3 M derived_dimension< length_base_dimension,-3, mass_base_dimension, 1 >::type + + +
+
+ + +derived dimension for molar energy : L^2 M T^-2 N^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2, amount_base_dimension,-1 >::type + + +
+
+ + +derived dimension for molar heat capacity : L^2 M T^-2 Theta^-1 N^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2, temperature_base_dimension,-1, amount_base_dimension,-1 >::type + + +
+
+ + +derived dimension for moment of inertia : L^2 M QP^-2 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, plane_angle_base_dimension,-2 >::type + + +
+
+ + +derived dimension for linear momentum : L M T^-1 derived_dimension< length_base_dimension, 1, mass_base_dimension, 1, time_base_dimension,-1 >::type + + +
+
+ + +derived dimension for permeability : L M T^-2 I^-2 derived_dimension< length_base_dimension, 1, mass_base_dimension, 1, time_base_dimension,-2, current_base_dimension,-2 >::type + + +
+
+ + +derived dimension for permittivity : L^-3 M^-1 T^4 I^2 derived_dimension< length_base_dimension,-3, mass_base_dimension,-1, time_base_dimension, 4, current_base_dimension, 2 >::type + + +
+
+ + +boost::units::base_dimension< plane_angle_base_dimension,-2 >base dimension of plane angle base dimension of plane angle (QP) plane_angle_base_dimension::dimension_type + + +
+
+ + +derived dimension for power : L^2 M T^-3 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-3 >::type + + +
+
+ + +derived dimension for pressure : L^-1 M T^-2 derived_dimension< length_base_dimension,-1, mass_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for reluctance : L^-2 M^-1 T^2 I^2 derived_dimension< length_base_dimension,-2, mass_base_dimension,-1, time_base_dimension, 2, current_base_dimension, 2 >::type + + +
+
+ + +derived dimension for resistance : L^2 M T^-3 I^-2 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-3, current_base_dimension,-2 >::type + + +
+
+ + +derived dimension for resistivity : L^3 M T^-3 I^-2 derived_dimension< length_base_dimension, 3, mass_base_dimension, 1, time_base_dimension,-3, current_base_dimension,-2 >::type + + +
+
+ + +boost::units::base_dimension< solid_angle_base_dimension,-1 >base dimension of solid angle base dimension of solid angle (QS) solid_angle_base_dimension::dimension_type + + +
+
+ + +derived dimension for specific energy : L^2 T^-2 derived_dimension< length_base_dimension, 2, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for specific heat capacity : L^2 T^-2 Theta^-1 derived_dimension< length_base_dimension, 2, time_base_dimension,-2, temperature_base_dimension,-1 >::type + + +
+
+ + +derived dimension for specific volume : L^3 M^-1 derived_dimension< length_base_dimension, 3, mass_base_dimension,-1 >::type + + +
+
+ + +derived dimension for stress : L^-1 M T^-2 derived_dimension< length_base_dimension,-1, mass_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +derived dimension for surface density : L^-2 M derived_dimension< length_base_dimension,-2, mass_base_dimension, 1 >::type + + +
+
+ + +derived dimension for surface tension : M T^-2 derived_dimension< mass_base_dimension, 1, time_base_dimension,-2 >::type + + +
+
+ + +boost::units::base_dimension< temperature_base_dimension,-5 >base dimension of temperature dimension of temperature (Theta) temperature_base_dimension::dimension_type + + +
+
+ + +derived dimension for thermal_conductivity : L^1 M^1 T^-3 Theta^-1 derived_dimension< length_base_dimension, 1, mass_base_dimension, 1, time_base_dimension,-3, temperature_base_dimension,-1 >::type + + +
+
+ + +boost::units::base_dimension< time_base_dimension,-7 >base dimension of time dimension of time (T) time_base_dimension::dimension_type + + +
+
+ + +derived dimension for torque : L^2 M T^-2 QP^-1 derived_dimension< length_base_dimension, 2, mass_base_dimension, 1, time_base_dimension,-2, plane_angle_base_dimension,-1 >::type + + +
+
+ + +derived dimension for velocity : L T^-1 derived_dimension< length_base_dimension, 1, time_base_dimension,-1 >::type + + +
+
+ + +derived dimension for volume : l^3 derived_dimension< length_base_dimension, 3 >::type + + +
+
+ + +derived dimension for wavenumber : L^-1 derived_dimension< length_base_dimension,-1 >::type + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/imperial_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/imperial_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..96726043d7054fc6265f7b172aa9b026069966df --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/imperial_base_units_reference.xml @@ -0,0 +1,276 @@ + +Imperial Base Units Reference
+ + +imperial::drachm_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 16, static_rational<-2 > > > + + + +
+
+ + +imperial::fluid_ounce_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 20, static_rational<-1 > > > + + + +
+
+ + +imperial::foot_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 3, static_rational<-1 > > > + + + +
+
+ + +imperial::furlong_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 220, static_rational< 1 > > > + + + +
+
+ + +imperial::gallon_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 8, static_rational< 1 > > > + + + +
+
+ + +imperial::gill_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 4, static_rational<-1 > > > + + + +
+
+ + +imperial::grain_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 7000, static_rational<-1 > > > + + + +
+
+ + +imperial::hundredweight_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 112, static_rational< 1 > > > + + + +
+
+ + +imperial::inch_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 36, static_rational<-1 > > > + + + +
+
+ + +imperial::league_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 5280, static_rational< 1 > > > + + + +
+
+ + +imperial::mile_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 1760, static_rational< 1 > > > + + + +
+
+ + +imperial::ounce_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 2, static_rational<-4 > > > + + + +
+
+ + + +boost::units::base_unit< pint_base_unit, si::volume::dimension_type,-303 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< pound_base_unit, cgs::gram_base_unit::dimension_type,-302 > +const char * +const char * + + + + +
+
+ + +imperial::quart_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational< 1 > > > + + + +
+
+ + +imperial::quarter_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 28, static_rational< 1 > > > + + + +
+
+ + +imperial::stone_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 14, static_rational< 1 > > > + + + +
+
+ + +imperial::thou_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 36000, static_rational<-1 > > > + + + +
+
+ + +imperial::ton_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 2240, static_rational< 1 > > > + + + +
+
+ + + +boost::units::base_unit< yard_base_unit, si::meter_base_unit::dimension_type,-301 > +const char * +const char * + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/information_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/information_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..1ba7b5dbda87fded758333107b0c0da92cac3412 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/information_base_units_reference.xml @@ -0,0 +1,66 @@ + +Information Base Units Reference
+ + + +boost::units::base_unit< bit_base_unit, information_dimension,-700 > +std::string +std::string + + + + +
+
+ + +information::byte_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::information::bit_base_unit, scale< 2, static_rational< 3 > > > + + + +
+
+ + + +boost::units::base_unit< hartley_base_unit, boost::units::information::bit_base_unit::dimension_type,-703 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< nat_base_unit, boost::units::information::bit_base_unit::dimension_type,-702 > +const char * +const char * + + + + +
+
+ + +information::shannon_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::information::bit_base_unit, scale< 1, static_rational< 1 > > > + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/information_reference.xml b/tools/boost_1_65_1/libs/units/doc/information_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..21ecd4fb696af0e800c45d65a1e2615068b39061 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/information_reference.xml @@ -0,0 +1,82 @@ + +Information System Reference
+
+
+ + + + + +unit< information_dimension, make_system< bit_base_unit >::type > + + +const hu::bit::info +const hu::bit::info + + + +
+
+ + + + + +unit< information_dimension, system > + + +make_system< byte_base_unit >::type +unit< dimensionless_type, system > +hu::byte::info +const hu::byte::info +const hu::byte::info + + + +
+
+ + + + + +unit< information_dimension, make_system< hartley_base_unit >::type > + + +const hu::hartley::info +const hu::hartley::info + + + +
+
+ + + + + +unit< information_dimension, make_system< nat_base_unit >::type > + + +const hu::nat::info +const hu::nat::info + + + +
+
+ + + + + +unit< information_dimension, make_system< shannon_base_unit >::type > + + +const hu::shannon::info +const hu::shannon::info + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/metric_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/metric_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..3fe9a62f8c4f1f6a96fad2ec6d3f5f067edd5ab8 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/metric_base_units_reference.xml @@ -0,0 +1,236 @@ + +Metric Base Units Reference
+ + +metric::angstrom_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::meter_base_unit, scale< 10, static_rational<-10 > > > + + + +
+
+ + + +boost::units::base_unit< are_base_unit, si::area::dimension_type, 10 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< atmosphere_base_unit, si::pressure::dimension_type, 33 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< bar_base_unit, si::pressure::dimension_type, 14 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< barn_base_unit, si::area::dimension_type, 11 > +const char * +const char * + + + + +
+
+ + +metric::day_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::second_base_unit, scale< 86400, static_rational< 1 > > > + + + +
+
+ + +metric::fermi_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::meter_base_unit, scale< 10, static_rational<-15 > > > + + + +
+
+ + + +boost::units::base_unit< hectare_base_unit, si::area::dimension_type, 12 > +const char * +const char * + + + + +
+
+ + +metric::hour_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::second_base_unit, scale< 60, static_rational< 2 > > > + + + +
+
+ + + +boost::units::base_unit< knot_base_unit, boost::units::si::velocity::dimension_type,-403 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< liter_base_unit, si::volume::dimension_type, 13 > +const char * +const char * + + + + +
+
+ + +metric::micron_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::meter_base_unit, scale< 10, static_rational<-6 > > > + + + +
+
+ + +metric::minute_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::second_base_unit, scale< 60, static_rational< 1 > > > + + + +
+
+ + + +boost::units::base_unit< mmHg_base_unit, si::pressure::dimension_type,-404 > +const char * +const char * + + + + +
+
+ + +metric::nautical_mile_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::meter_base_unit, scale< 1852, static_rational< 1 > > > + + + +
+
+ + +metric::ton_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::kilogram_base_unit, scale< 1000, static_rational< 1 > > > + + + +
+
+ + + +boost::units::base_unit< torr_base_unit, si::pressure::dimension_type,-401 > +const char * +const char * + + + + +
+
+ + +metric::year_base_unit +const char * +const char * + + +scaled_base_unit< boost::units::si::second_base_unit, scale< 31557600, static_rational< 1 > > > + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/si_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/si_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..6a0394f4555275086b5b574c22323cd3cb552aa4 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/si_base_units_reference.xml @@ -0,0 +1,83 @@ + +SI Base Units Reference
+ + + +base_unit< ampere_base_unit, current_dimension,-6 > +std::string +std::string + + + + +
+
+ + + +base_unit< candela_base_unit, luminous_intensity_dimension,-3 > +std::string +std::string + + + + +
+
+ + + +base_unit< kelvin_base_unit, temperature_dimension,-5 > +std::string +std::string + + + + +
+
+ + + +scaled_base_unit< boost::units::cgs::gram_base_unit, scale< 10, static_rational< 3 > > > + + + +
+
+ + + +base_unit< meter_base_unit, length_dimension,-9 > +std::string +std::string + + + + +
+
+ + + +base_unit< mole_base_unit, amount_dimension,-4 > +std::string +std::string + + + + +
+
+ + + +base_unit< second_base_unit, time_dimension,-7 > +std::string +std::string + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/si_reference.xml b/tools/boost_1_65_1/libs/units/doc/si_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..2513dd1af204c2f1f5262166f6289ffe465a257b --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/si_reference.xml @@ -0,0 +1,6622 @@ + +SI System Reference
+Includes all the si unit headers
+
+ + + +unit< absorbed_dose_dimension, si::system > +const absorbed_dose +const absorbed_dose + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< acceleration_dimension, si::system > +const acceleration +const acceleration +const acceleration +const acceleration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< action_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< activity_dimension, si::system > +const activity +const activity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< amount_dimension, si::system > +const amount +const amount + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< angular_acceleration_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< angular_momentum_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< angular_velocity_dimension, si::system > +const angular_velocity +const angular_velocity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< area_dimension, si::system > +const area +const area +const area +const area + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +placeholder class defining si unit system make_system< meter_base_unit, kilogram_base_unit, second_base_unit, ampere_base_unit, kelvin_base_unit, mole_base_unit, candela_base_unit, angle::radian_base_unit, angle::steradian_base_unit >::type +dimensionless si unit unit< dimensionless_type, system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< capacitance_dimension, si::system > +const capacitance +const capacitance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +catalytic activity : T^-1 A^1 derived_dimension< time_base_dimension,-1, amount_base_dimension, 1 >::type +unit< si::catalytic_activity_dim, si::system > +const catalytic_activity +const catalytic_activity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_alphaquantity< mass >6.64465620e-27 *3.3e-34 *CODATA recommended values of the fundamental physical constants: NIST SP 961. alpha particle mass +m_alpha_over_m_equantity< dimensionless >7294.2995365 *3.1e-6 *alpha-electron mass ratio +m_alpha_over_m_pquantity< dimensionless >3.97259968951 *4.1e-10 *alpha-proton mass ratio +M_alphaquantity< mass_over_amount >4.001506179127e-3 *kilograms/6.2e-14 *kilograms/alpha molar mass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +alphaquantity< dimensionless >7.2973525376e-3 *5.0e-12 *CODATA recommended values of the fundamental physical constants: NIST SP 961. fine structure constant +R_infinityquantity< wavenumber >10973731.568527/7.3e-5/Rydberg constant. +a_0quantity< length >0.52917720859e-10 *3.6e-20 *Bohr radius. +E_hquantity< energy >4.35974394e-18 *2.2e-25 *Hartree energy. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_dquantity< mass >3.34358320e-27 *1.7e-34 *CODATA recommended values of the fundamental physical constants: NIST SP 961. deuteron mass +m_d_over_m_equantity< dimensionless >3670.4829654 *1.6e-6 *deuteron-electron mass ratio +m_d_over_m_pquantity< dimensionless >1.99900750108 *2.2e-10 *deuteron-proton mass ratio +M_dquantity< mass_over_amount >2.013553212724e-3 *kilograms/7.8e-14 *kilograms/deuteron molar mass +R_dquantity< length >2.1402e-15 *2.8e-18 *deuteron rms charge radius +mu_dquantity< energy_over_magnetic_flux_density >0.433073465e-26 *joules/1.1e-34 *joules/deuteron magnetic moment +mu_d_over_mu_Bquantity< dimensionless >0.4669754556e-3 *3.9e-12 *deuteron-Bohr magneton ratio +mu_d_over_mu_Nquantity< dimensionless >0.8574382308 *7.2e-9 *deuteron-nuclear magneton ratio +g_dquantity< dimensionless >0.8574382308 *7.2e-9 *deuteron g-factor +mu_d_over_mu_equantity< dimensionless >-4.664345537e-4 *3.9e-12 *deuteron-electron magnetic moment ratio +mu_d_over_mu_pquantity< dimensionless >0.3070122070 *2.4e-9 *deuteron-proton magnetic moment ratio +mu_d_over_mu_nquantity< dimensionless >-0.44820652 *1.1e-7 *deuteron-neutron magnetic moment ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental electromagnetic constants. CODATA recommended values of the fundamental physical constants: NIST SP 961 CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +equantity< electric_charge >1.602176487e-19 *4.0e-27 *elementary charge +e_over_hquantity< current_over_energy >2.417989454e14 *amperes/6.0e6 *amperes/elementary charge to Planck constant ratio +Phi_0quantity< magnetic_flux >2.067833667e-15 *5.2e-23 *magnetic flux quantum +G_0quantity< conductance >7.7480917004e-5 *5.3e-14 *conductance quantum +K_Jquantity< frequency_over_electric_potential >483597.891e9 *hertz/1.2e7 *hertz/Josephson constant. +R_Kquantity< resistance >25812.807557 *1.77e-5 *von Klitzing constant +mu_Bquantity< energy_over_magnetic_flux_density >927.400915e-26 *joules/2.3e-31 *joules/Bohr magneton. +mu_Nquantity< energy_over_magnetic_flux_density >5.05078324e-27 *joules/1.3e-34 *joules/nuclear magneton + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_equantity< mass >9.10938215e-31 *4.5e-38 *CODATA recommended values of the fundamental physical constants: NIST SP 961. electron mass +m_e_over_m_muquantity< dimensionless >4.83633171e-3 *1.2e-10 *electron-muon mass ratio +m_e_over_m_tauquantity< dimensionless >2.87564e-4 *4.7e-8 *electron-tau mass ratio +m_e_over_m_pquantity< dimensionless >5.4461702177e-4 *2.4e-13 *electron-proton mass ratio +m_e_over_m_nquantity< dimensionless >5.4386734459e-4 *3.3e-13 *electron-neutron mass ratio +m_e_over_m_dquantity< dimensionless >2.7244371093e-4 *1.2e-13 *electron-deuteron mass ratio +m_e_over_m_alphaquantity< dimensionless >1.37093355570e-4 *5.8e-14 *electron-alpha particle mass ratio +e_over_m_equantity< electric_charge_over_mass >1.758820150e11 *coulombs/4.4e3 *coulombs/electron charge to mass ratio +M_equantity< mass_over_amount >5.4857990943e-7 *kilograms/2.3e-16 *kilograms/electron molar mass +lambda_Cquantity< length >2.4263102175e-12 *3.3e-21 *Compton wavelength. +r_equantity< length >2.8179402894e-15 *5.8e-24 *classical electron radius +sigma_equantity< area >0.6652458558e-28 *2.7e-37 *Thompson cross section. +mu_equantity< energy_over_magnetic_flux_density >-928.476377e-26 *joules/2.3e-31 *joules/electron magnetic moment +mu_e_over_mu_Bquantity< dimensionless >-1.00115965218111 *7.4e-13 *electron-Bohr magenton moment ratio +mu_e_over_mu_Nquantity< dimensionless >-183.28197092 *8.0e-7 *electron-nuclear magneton moment ratio +a_equantity< dimensionless >1.15965218111e-3 *7.4e-13 *electron magnetic moment anomaly +g_equantity< dimensionless >-2.0023193043622 *1.5e-12 *electron g-factor +mu_e_over_mu_muquantity< dimensionless >206.7669877 *5.2e-6 *electron-muon magnetic moment ratio +mu_e_over_mu_pquantity< dimensionless >-658.2106848 *5.4e-6 *electron-proton magnetic moment ratio +mu_e_over_mu_p_primequantity< dimensionless >-658.2275971 *7.2e-6 *electron-shielded proton magnetic moment ratio +mu_e_over_mu_nquantity< dimensionless >960.92050 *2.3e-4 *electron-neutron magnetic moment ratio +mu_e_over_mu_dquantity< dimensionless >-2143.923498 *1.8e-5 *electron-deuteron magnetic moment ratio +mu_e_over_mu_h_primequantity< dimensionless >864.058257 *1.0e-5 *electron-shielded helion magnetic moment ratio +gamma_equantity< frequency_over_magnetic_flux_density >1.760859770e11/second/4.4e3/second/electron gyromagnetic ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_hquantity< mass >5.00641192e-27 *2.5e-34 *CODATA recommended values of the fundamental physical constants: NIST SP 961. helion mass +m_h_over_m_equantity< dimensionless >5495.8852765 *5.2e-6 *helion-electron mass ratio +m_h_over_m_pquantity< dimensionless >2.9931526713 *2.6e-9 *helion-proton mass ratio +M_hquantity< mass_over_amount >3.0149322473e-3 *kilograms/2.6e-12 *kilograms/helion molar mass +mu_h_primequantity< energy_over_magnetic_flux_density >-1.074552982e-26 *joules/3.0e-34 *joules/helion shielded magnetic moment +mu_h_prime_over_mu_Bquantity< dimensionless >-1.158671471e-3 *1.4e-11 *shielded helion-Bohr magneton ratio +mu_h_prime_over_mu_Nquantity< dimensionless >-2.127497718 *2.5e-8 *shielded helion-nuclear magneton ratio +mu_h_prime_over_mu_pquantity< dimensionless >-0.761766558 *1.1e-8 *shielded helion-proton magnetic moment ratio +mu_h_prime_over_mu_p_primequantity< dimensionless >-0.7617861313 *3.3e-8 *shielded helion-shielded proton magnetic moment ratio +gamma_h_primequantity< frequency_over_magnetic_flux_density >2.037894730e8/second/5.6e-0/second/shielded helion gyromagnetic ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_muquantity< mass >1.88353130e-28 *1.1e-35 *CODATA recommended values of the fundamental physical constants: NIST SP 961. muon mass +m_mu_over_m_equantity< dimensionless >206.7682823 *5.2e-6 *muon-electron mass ratio +m_mu_over_m_tauquantity< dimensionless >5.94592e-2 *9.7e-6 *muon-tau mass ratio +m_mu_over_m_pquantity< dimensionless >0.1126095261 *2.9e-9 *muon-proton mass ratio +m_mu_over_m_nquantity< dimensionless >0.1124545167 *2.9e-9 *muon-neutron mass ratio +M_muquantity< mass_over_amount >0.1134289256e-3 *kilograms/2.9e-12 *kilograms/muon molar mass +lambda_C_muquantity< length >11.73444104e-15 *3.0e-22 *muon Compton wavelength +mu_muquantity< energy_over_magnetic_flux_density >-4.49044786e-26 *joules/1.6e-33 *joules/muon magnetic moment +mu_mu_over_mu_Bquantity< dimensionless >-4.84197049e-3 *1.2e-10 *muon-Bohr magneton ratio +mu_mu_over_mu_Nquantity< dimensionless >-8.89059705 *2.3e-7 *muon-nuclear magneton ratio +a_muquantity< dimensionless >1.16592069e-3 *6.0e-10 *muon magnetic moment anomaly +g_muquantity< dimensionless >-2.0023318414 *1.2e-9 *muon g-factor +mu_mu_over_mu_pquantity< dimensionless >-3.183345137 *8.5e-8 *muon-proton magnetic moment ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_nquantity< mass >1.674927211e-27 *8.4e-35 *CODATA recommended values of the fundamental physical constants: NIST SP 961. neutron mass +m_n_over_m_equantity< dimensionless >1838.6836605 *1.1e-6 *neutron-electron mass ratio +m_n_over_m_muquantity< dimensionless >8.89248409 *2.3e-7 *neutron-muon mass ratio +m_n_over_m_tauquantity< dimensionless >0.528740 *8.6e-5 *neutron-tau mass ratio +m_n_over_m_pquantity< dimensionless >1.00137841918 *4.6e-10 *neutron-proton mass ratio +M_nquantity< mass_over_amount >1.00866491597e-3 *kilograms/4.3e-13 *kilograms/neutron molar mass +lambda_C_nquantity< length >1.3195908951e-15 *2.0e-24 *neutron Compton wavelength +mu_nquantity< energy_over_magnetic_flux_density >-0.96623641e-26 *joules/2.3e-33 *joules/neutron magnetic moment +g_nquantity< dimensionless >-3.82608545 *9.0e-7 *neutron g-factor +mu_n_over_mu_equantity< dimensionless >1.04066882e-3 *2.5e-10 *neutron-electron magnetic moment ratio +mu_n_over_mu_pquantity< dimensionless >-0.68497934 *1.6e-7 *neutron-proton magnetic moment ratio +mu_n_over_mu_p_primequantity< dimensionless >-0.68499694 *1.6e-7 *neutron-shielded proton magnetic moment ratio +gamma_nquantity< frequency_over_magnetic_flux_density >1.83247185e8/second/4.3e1/second/neutron gyromagnetic ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental physico-chemical constants CODATA 2014 values as of 2016/04/26 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +N_Aquantity< inverse_amount >6.022140857e23/7.4e15/Avogadro constant. +m_uquantity< mass >1.660539040e-27 *2.0e-35 *atomic mass constant +Fquantity< electric_charge_over_amount >96485.33289 *coulombs/5.9e-4 *coulombs/Faraday constant. +Rquantity< energy_over_temperature_amount >8.3144598 *joules/kelvin/4.8e-06 *joules/kelvin/molar gas constant +k_Bquantity< energy_over_temperature >1.38064852e-23 *joules/7.9e-30 *joules/Boltzmann constant. +sigma_SBquantity< power_over_area_temperature_4 >5.670367e-8 *watts/square_meter/pow< 4 >1.3e-13 *watts/square_meter/pow< 4 >Stefan-Boltzmann constant. +c_1quantity< power_area >3.741771790e-16 *watt *4.6e-24 *watt *first radiation constant +c_1Lquantity< power_area_over_solid_angle >1.191042953e-16 *watt *square_meters/1.5e-24 *watt *square_meters/first radiation constant for spectral radiance +c_2quantity< length_temperature >1.43877736e-2 *meter *8.3e-9 *meter *second radiation constant +bquantity< length_temperature >2.8977729e-3 *meter *1.7e-9 *meter *Wien displacement law constant : lambda_max T. +b_primequantity< frequency_over_temperature >5.8789238e10 *hertz/3.4e4 *hertz/Wien displacement law constant : nu_max/T. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +m_pquantity< mass >1.672621637e-27 *8.3e-35 *CODATA recommended values of the fundamental physical constants: NIST SP 961. proton mass +m_p_over_m_equantity< dimensionless >1836.15267247 *8.0e-7 *proton-electron mass ratio +m_p_over_m_muquantity< dimensionless >8.88024339 *2.3e-7 *proton-muon mass ratio +m_p_over_m_tauquantity< dimensionless >0.528012 *8.6e-5 *proton-tau mass ratio +m_p_over_m_nquantity< dimensionless >0.99862347824 *4.6e-10 *proton-neutron mass ratio +e_over_m_pquantity< electric_charge_over_mass >9.57883392e7 *coulombs/2.4e0 *coulombs/proton charge to mass ratio +M_pquantity< mass_over_amount >1.00727646677e-3 *kilograms/1.0e-13 *kilograms/proton molar mass +lambda_C_pquantity< length >1.3214098446e-15 *1.9e-24 *proton Compton wavelength +R_pquantity< length >0.8768e-15 *6.9e-18 *proton rms charge radius +mu_pquantity< energy_over_magnetic_flux_density >1.410606662e-26 *joules/3.7e-34 *joules/proton magnetic moment +mu_p_over_mu_Bquantity< dimensionless >1.521032209e-3 *1.2e-11 *proton-Bohr magneton ratio +mu_p_over_mu_Nquantity< dimensionless >2.792847356 *2.3e-8 *proton-nuclear magneton ratio +g_pquantity< dimensionless >5.585694713 *4.6e-8 *proton g-factor +mu_p_over_mu_nquantity< dimensionless >-1.45989806 *3.4e-7 *proton-neutron magnetic moment ratio +mu_p_primequantity< energy_over_magnetic_flux_density >1.410570419e-26 *joules/3.8e-34 *joules/shielded proton magnetic moment +mu_p_prime_over_mu_Bquantity< dimensionless >1.520993128e-3 *1.7e-11 *shielded proton-Bohr magneton ratio +mu_p_prime_over_mu_Nquantity< dimensionless >2.792775598 *3.0e-8 *shielded proton-nuclear magneton ratio +sigma_p_primequantity< dimensionless >25.694e-6 *1.4e-8 *proton magnetic shielding correction +gamma_pquantity< frequency_over_magnetic_flux_density >2.675222099e8/second/7.0e0/second/proton gyromagnetic ratio +gamma_p_primequantity< frequency_over_magnetic_flux_density >2.675153362e8/second/7.3e0/second/shielded proton gyromagnetic ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + + + + + + + + + + + + +m_tauquantity< mass >3.16777e-27 *5.2e-31 *CODATA recommended values of the fundamental physical constants: NIST SP 961. tau mass +m_tau_over_m_equantity< dimensionless >3477.48 *5.7e-1 *tau-electron mass ratio +m_tau_over_m_muquantity< dimensionless >16.8183 *2.7e-3 *tau-muon mass ratio +m_tau_over_m_pquantity< dimensionless >1.89390 *3.1e-4 *tau-proton mass ratio +m_tau_over_m_nquantity< dimensionless >1.89129 *3.1e-4 *tau-neutron mass ratio +M_tauquantity< mass_over_amount >1.90768e-3 *kilograms/3.1e-7 *kilograms/tau molar mass +lambda_C_tauquantity< length >0.69772e-15 *1.1e-19 *tau Compton wavelength + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental atomic and nuclear constants CODATA 2006 values as of 2007/03/30 + + + + + + + + + + + + + + + +m_tquantity< mass >5.00735588e-27 *2.5e-34 *CODATA recommended values of the fundamental physical constants: NIST SP 961. triton mass +m_t_over_m_equantity< dimensionless >5496.9215269 *5.1e-6 *triton-electron mass ratio +m_t_over_m_pquantity< dimensionless >2.9937170309 *2.5e-9 *triton-proton mass ratio +M_tquantity< mass_over_amount >3.0155007134e-3 *kilograms/2.5e-12 *kilograms/triton molar mass +mu_tquantity< energy_over_magnetic_flux_density >1.504609361e-26 *joules/4.2e-34 *joules/triton magnetic moment +mu_t_over_mu_Bquantity< dimensionless >1.622393657e-3 *2.1e-11 *triton-Bohr magneton ratio +mu_t_over_mu_Nquantity< dimensionless >2.978962448 *3.8e-8 *triton-nuclear magneton ratio +g_tquantity< dimensionless >5.957924896 *7.6e-8 *triton g-factor +mu_t_over_mu_equantity< dimensionless >-1.620514423e-3 *2.1e-11 *triton-electron magnetic moment ratio +mu_t_over_mu_pquantity< dimensionless >1.066639908 *1.0e-8 *triton-proton magnetic moment ratio +mu_t_over_mu_nquantity< dimensionless >-1.55718553 *3.7e-7 *triton-neutron magnetic moment ratio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +divide_typeof_helper< frequency, electric_potential >::type +divide_typeof_helper< electric_charge, mass >::type +divide_typeof_helper< mass, amount >::type +divide_typeof_helper< energy, magnetic_flux_density >::type +divide_typeof_helper< frequency, magnetic_flux_density >::type +divide_typeof_helper< current, energy >::type +divide_typeof_helper< dimensionless, amount >::type +divide_typeof_helper< energy, temperature >::type +divide_typeof_helper< energy_over_temperature, amount >::type +divide_typeof_helper< divide_typeof_helper< power, area >::type, power_typeof_helper< temperature, static_rational< 4 > >::type >::type +multiply_typeof_helper< power, area >::type +divide_typeof_helper< power_area, solid_angle >::type +multiply_typeof_helper< length, temperature >::type +divide_typeof_helper< frequency, temperature >::type +divide_typeof_helper< divide_typeof_helper< force, current >::type, current >::type +divide_typeof_helper< capacitance, length >::type +divide_typeof_helper< divide_typeof_helper< divide_typeof_helper< volume, mass >::type, time >::type, time >::type +multiply_typeof_helper< energy, time >::type +divide_typeof_helper< electric_charge, amount >::type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+CODATA recommended values of fundamental universal constants using CODATA 2006 values as of 2007/03/30 + + + + +cquantity< velocity >299792458.0 *meters/0.0 *meters/CODATA recommended values of the fundamental physical constants: NIST SP 961. speed of light +mu_0quantity< force_over_current_squared >12.56637061435917295385057353311801153679e-7 *newtons/ampere/0.0 *newtons/ampere/magnetic constant (exactly 4 pi x 10^(-7) - error is due to finite precision of pi) +epsilon_0quantity< capacitance_over_length >8.854187817620389850536563031710750260608e-12 *farad/0.0 *farad/electric constant +Z_0quantity< resistance >376.7303134617706554681984004203193082686 *0.0 *characteristic impedance of vacuum +Gquantity< volume_over_mass_time_squared >6.67428e-11 *cubic_meters/kilogram/second/6.7e-15 *cubic_meters/kilogram/second/Newtonian constant of gravitation. +hquantity< energy_time >6.62606896e-34 *joule *3.3e-41 *joule *Planck constant. +hbarquantity< energy_time >1.054571628e-34 *joule *5.3e-42 *joule *Dirac constant. +m_Pquantity< mass >2.17644e-8 *1.1e-12 *Planck mass. +T_Pquantity< temperature >1.416785e32 *7.1e27 *Planck temperature. +l_Pquantity< length >1.616252e-35 *8.1e-40 *Planck length. +t_Pquantity< time >5.39124e-44 *2.7e-48 *Planck time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + +unit< conductance_dimension, si::system > +const conductance +const conductance +const conductance +const conductance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< conductivity_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< current_dimension, si::system > +const current +const current + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +const dimensionless + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< dose_equivalent_dimension, si::system > +const dose_equivalent +const dose_equivalent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< dynamic_viscosity_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< electric_charge_dimension, si::system > +const electric_charge +const electric_charge + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< electric_potential_dimension, si::system > +const electric_potential +const electric_potential + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< energy_dimension, si::system > +const energy +const energy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< force_dimension, si::system > +const force +const force + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< frequency_dimension, si::system > +const frequency + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< illuminance_dimension, si::system > +const illuminance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< impedance_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< inductance_dimension, si::system > +const inductance +const inductance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +std::stringconst reduce_unit< si::absorbed_dose >::type & +std::stringconst reduce_unit< si::absorbed_dose >::type & +std::stringconst reduce_unit< si::capacitance >::type & +std::stringconst reduce_unit< si::capacitance >::type & +std::stringconst reduce_unit< si::catalytic_activity >::type & +std::stringconst reduce_unit< si::catalytic_activity >::type & +std::stringconst reduce_unit< si::conductance >::type & +std::stringconst reduce_unit< si::conductance >::type & +std::stringconst reduce_unit< si::electric_charge >::type & +std::stringconst reduce_unit< si::electric_charge >::type & +std::stringconst reduce_unit< si::electric_potential >::type & +std::stringconst reduce_unit< si::electric_potential >::type & +std::stringconst reduce_unit< si::energy >::type & +std::stringconst reduce_unit< si::energy >::type & +std::stringconst reduce_unit< si::force >::type & +std::stringconst reduce_unit< si::force >::type & +std::stringconst reduce_unit< si::frequency >::type & +std::stringconst reduce_unit< si::frequency >::type & +std::stringconst reduce_unit< si::illuminance >::type & +std::stringconst reduce_unit< si::illuminance >::type & +std::stringconst reduce_unit< si::inductance >::type & +std::stringconst reduce_unit< si::inductance >::type & +std::stringconst reduce_unit< si::luminous_flux >::type & +std::stringconst reduce_unit< si::luminous_flux >::type & +std::stringconst reduce_unit< si::magnetic_flux >::type & +std::stringconst reduce_unit< si::magnetic_flux >::type & +std::stringconst reduce_unit< si::magnetic_flux_density >::type & +std::stringconst reduce_unit< si::magnetic_flux_density >::type & +std::stringconst reduce_unit< si::power >::type & +std::stringconst reduce_unit< si::power >::type & +std::stringconst reduce_unit< si::pressure >::type & +std::stringconst reduce_unit< si::pressure >::type & +std::stringconst reduce_unit< si::resistance >::type & +std::stringconst reduce_unit< si::resistance >::type & + + +
+
+ + + +unit< kinematic_viscosity_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< length_dimension, si::system > +const length +const length +const length +const length + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< luminous_flux_dimension, si::system > +const luminous_flux +const luminous_flux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< luminous_intensity_dimension, si::system > +const luminous_intensity +const luminous_intensity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< magnetic_field_intensity_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< magnetic_flux_dimension, si::system > +const magnetic_flux +const magnetic_flux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< magnetic_flux_density_dimension, si::system > +const magnetic_flux_density +const magnetic_flux_density + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< mass_dimension, si::system > +const mass +const mass +const mass +const mass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< mass_density_dimension, si::system > +const mass_density +const mass_density +const mass_density +const mass_density + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< moment_of_inertia_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< momentum_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< permeability_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< permittivity_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< plane_angle_dimension, si::system > +const plane_angle +const plane_angle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< power_dimension, si::system > +const power +const power + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +-yocto +-zepto +-atto +-femto +-pico +-nano +-micro +-milli +-centi +-deci +1deka +2hecto +3kilo +6mega +9giga +12tera +15peta +18exa +21zetta +24yotta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< pressure_dimension, si::system > +const pressure +const pressure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< reluctance_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< resistance_dimension, si::system > +const resistance +const resistance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< resistivity_dimension, si::system > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< solid_angle_dimension, si::system > +const solid_angle +const solid_angle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< surface_density_dimension, si::system > +const surface_density +const surface_density +const surface_density +const surface_density + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< surface_tension_dimension, si::system > +const surface_tension +const surface_tension + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< temperature_dimension, si::system > +const temperature +const temperature + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< time_dimension, si::system > +const time +const time + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< torque_dimension, si::system > +const torque +const torque + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< velocity_dimension, si::system > +const velocity +const velocity +const velocity +const velocity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< volume_dimension, si::system > +const volume +const volume +const volume +const volume + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +unit< wavenumber_dimension, si::system > +const wavenumber +const wavenumber +const wavenumber +const wavenumber + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/temperature_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/temperature_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..ecd5e972dc8953c9c9cf4d7ca1899c4af545f0ac --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/temperature_base_units_reference.xml @@ -0,0 +1,26 @@ + +Temperature Base Units Reference
+ + + +base_unit< celsius_base_unit, temperature_dimension,-1008 > +std::string +std::string + + + + +
+
+ + + +base_unit< fahrenheit_base_unit, temperature_dimension,-1007 > +std::string +std::string + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/temperature_reference.xml b/tools/boost_1_65_1/libs/units/doc/temperature_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..2b9d3c8247e5b01beca73cd3311454e492d15cc5 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/temperature_reference.xml @@ -0,0 +1,26 @@ + +Temperature System Reference
+ + + +make_system< boost::units::temperature::celsius_base_unit >::type +unit< temperature_dimension, system > +const temperature +const temperature + + + +
+
+ + + +make_system< boost::units::temperature::fahrenheit_base_unit >::type +unit< temperature_dimension, system > +const temperature +const temperature + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/trig_reference.xml b/tools/boost_1_65_1/libs/units/doc/trig_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..380fc8f2db4c68b81df79a6d3b5f00f041e4097d --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/trig_reference.xml @@ -0,0 +1,41 @@ + +Trigonometry and Angle System Reference
+ + + +make_system< boost::units::angle::degree_base_unit >::type +unit< dimensionless_type, system > +angle degree unit constant unit< plane_angle_dimension, system > +const plane_angle +const plane_angle + + + +
+
+ + + +make_system< boost::units::angle::gradian_base_unit >::type +unit< dimensionless_type, system > +angle gradian unit constant unit< plane_angle_dimension, system > +const plane_angle +const plane_angle + + + +
+
+ + + +make_system< boost::units::angle::revolution_base_unit >::type +unit< dimensionless_type, system > +angle revolution unit constant unit< plane_angle_dimension, system > +const plane_angle +const plane_angle + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/units.qbk b/tools/boost_1_65_1/libs/units/doc/units.qbk new file mode 100644 index 0000000000000000000000000000000000000000..618212f359b5c7584fef167a6c9d9875131a9c45 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/units.qbk @@ -0,0 +1,1475 @@ +[library Boost.Units + [quickbook 1.5] + [version 1.1.0] + [authors [Schabel, Matthias C.]] + [authors [Watanabe, Steven]] + [copyright 2003-2008 Matthias Christian Schabel, 2007-2010 Steven Watanabe] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] + [purpose zero-overhead compile-time dimensional analysis and unit computations] +] + +[/ Some links to external sources.] +[def __boost [@http://www.boost.org/ Boost]] +[def __boostroot [@boost: Boost root]] +[def __boostlicense [@http://www.boost.org/LICENSE_1_0.txt Boost License]] +[def __boost_mpl [@http://www.boost.org/libs/mpl/doc/index.html Boost Metaprogramming Library]] + +[def __mpl_forward_sequence [@http://www.boost.org/libs/mpl/doc/refmanual/forward-sequence.html MPL Forward Sequence]] + +[/Links within this document.] +[def __ordinal [classref boost::units::ordinal ordinal]] +[def __dim [classref boost::units::dim dim]] +[def __static_rational [classref boost::units::static_rational static_rational]] +[def __make_dimension_list [classref boost::units::make_dimension_list make_dimension_list]] +[def __unit [classref boost::units::unit unit]] +[def __base_unit_info [classref boost::units::base_unit_info base_unit_info]] +[def __quantity [classref boost::units::quantity quantity]] +[def __conversion_helper [classref boost::units::conversion_helper conversion_helper]] +[def __absolute [classref boost::units::absolute absolute]] +[def __base_unit [classref boost::units::base_unit base_unit]] +[def __base_dimension [classref boost::units::base_dimension base_dimension]] +[def __scaled_base_unit [classref boost::units::scaled_base_unit base_unit]] +[def __make_scaled_unit [classref boost::units::make_scaled_unit make_scaled_unit]] + +[def __unary_plus_typeof_helper [classref boost::units::unary_plus_typeof_helper unary_plus_typeof_helper]] +[def __unary_minus_typeof_helper [classref boost::units::unary_minus_typeof_helper unary_minus_typeof_helper]] +[def __add_typeof_helper [classref boost::units::add_typeof_helper add_typeof_helper]] +[def __subtract_typeof_helper [classref boost::units::subtract_typeof_helper subtract_typeof_helper]] +[def __multiply_typeof_helper [classref boost::units::multiply_typeof_helper multiply_typeof_helper]] +[def __divide_typeof_helper [classref boost::units::divide_typeof_helper divide_typeof_helper]] +[def __power_typeof_helper [classref boost::units::power_typeof_helper power_typeof_helper]] +[def __root_typeof_helper [classref boost::units::root_typeof_helper root_typeof_helper]] + +[def __static_negate [classref boost::units::static_negate static_negate]] +[def __static_add [classref boost::units::static_add static_add]] +[def __static_subtract [classref boost::units::static_subtract static_subtract]] +[def __static_multiply [classref boost::units::static_multiply static_multiply]] +[def __static_divide [classref boost::units::static_divide static_divide]] +[def __static_power [classref boost::units::static_power static_power]] +[def __static_root [classref boost::units::static_root static_root]] + +[def __get_dimension [classref boost::units::get_dimension get_dimension]] +[def __get_system [classref boost::units::get_system get_system]] + +[def __pow [funcref boost::units::pow pow]] +[def __root [funcref boost::units::root root]] +[def __quantity_cast [funcref boost::units::quantity_cast quantity_cast]] + +[def __from_value [memberref boost::units::quantity::from_value from_value]] +[def __value [memberref boost::units::quantity::value value]] + +[def __reduce_unit [classref boost::units::reduce_unit reduce_unit]] +[def __unscale [classref boost::units::unscale unscale]] + +[def __BOOST_UNITS_STATIC_CONSTANT [macroref BOOST_UNITS_STATIC_CONSTANT]] +[def __BOOST_UNITS_DEFINE_CONVERSION_FACTOR [macroref BOOST_UNITS_DEFINE_CONVERSION_FACTOR]] +[def __BOOST_UNITS_DEFINE_CONVERSION_FACTOR_TEMPLATE [macroref BOOST_UNITS_DEFINE_CONVERSION_FACTOR_TEMPLATE]] +[def __BOOST_UNITS_DEFAULT_CONVERSION [macroref BOOST_UNITS_DEFAULT_CONVERSION]] + +[section:Introduction Introduction] + +The Boost.Units library is a C++ implementation of dimensional analysis in a general +and extensible manner, treating it as a generic compile-time metaprogramming problem. With appropriate +compiler optimization, no runtime execution cost is introduced, facilitating the use of this library to +provide dimension checking in performance-critical code. Support for units +and quantities (defined as a unit and associated value) for arbitrary unit system models and arbitrary +value types is provided, as is a fine-grained general facility for unit conversions. Complete SI and CGS unit +systems are provided, along with systems for +angles measured in degrees, radians, gradians, and revolutions and +systems for temperatures measured in Kelvin, degrees Celsius and degrees Fahrenheit. +The library architecture has been designed with flexibility and extensibility in mind; demonstrations of the ease +of adding new units and unit conversions are provided in the examples. + +In order to enable complex compile-time dimensional analysis calculations with no runtime overhead, +Boost.Units relies heavily on the [___boost_mpl] (MPL) and on template metaprogramming techniques, and is, as a consequence, +fairly demanding of compiler compliance to ISO standards. At present, it has been successfully +compiled and tested on the following compilers/platforms : + +# g++ 4.0.1 on Mac OSX 10.4 +# Intel CC 9.1, 10.0, and 10.1 on Mac OSX 10.4 +# g++ 3.4.4, 4.2.3, and 4.3.0 on Windows XP +# Microsoft Visual C++ 7.1, 8.0, and 9.0 on Windows XP +# Comeau 4.3.10.1 beta2 on Windows XP +# Metrowerks CodeWarrior 9.2 on Windows XP. +# Sun CC 5.9 on Solaris and Linux + +The following compilers/platforms are known *not* to work : + +# g++ 3.3.x +# Microsoft Visual C++ 6.0 on Windows XP +# Microsoft Visual C++ 7.0 on Windows XP +# Metrowerks CodeWarrior 8.0 on Windows XP. +# All versions of Borland. + +[endsect] + +[section:Quick_Start Quick Start] + +Before discussing the basics of the library, we first define a few terms that will be used frequently +in the following : + +* *Base dimension* : A base dimension is loosely defined as a measurable entity of interest; in conventional + dimensional analysis, base dimensions include length (\[L\]), mass (\[M\]), time (\[T\]), etc... but there is + no specific restriction on what base dimensions can be used. Base dimensions are essentially a tag type and + provide no dimensional analysis functionality themselves. +* *Dimension* : A collection of zero or more base dimensions, each + potentially raised to a different rational power. + For example, length = \[L\]^1, area = \[L\]^2, velocity = \[L\]^1/\[T\]^1, and + energy = \[M\]^1 \[L\]^2/\[T\]^2 are all dimensions. +* *Base unit* : A base unit represents a specific measure of a dimension. For example, while length is an abstract measure of + distance, the meter is a concrete base unit of distance. Conversions are defined using base units. + Much like base dimensions, base units are a tag type used solely to define units and do not support dimensional + analysis algebra. +* *Unit* : A set of base units raised to rational exponents, e.g. m^1, kg^1, m^1/s^2. +* *System* : A unit system is a collection of base units representing all the measurable entities of interest for a + specific problem. For example, the SI unit system defines seven base units : length (\[L\]) in meters, + mass (\[M\]) in kilograms, time (\[T\]) in seconds, current (\[I\]) in amperes, temperature (\[theta\]) in kelvin, + amount (\[N\]) in moles, and luminous intensity (\[J\]) in candelas. All measurable entities within the SI system can + be represented as products of various integer or rational powers of these seven base units. +* *Quantity* : A quantity represents a concrete amount of a unit. Thus, while the meter is the base + unit of length in the SI system, 5.5 meters is a quantity of length in that system. + +To begin, we present two short tutorials. [@../../libs/units/tutorial/tutorial_1.cpp Tutorial1] demonstrates the use of +[@http://en.wikipedia.org/wiki/SI_units SI] units. After including the appropriate system headers +and the headers for the various SI units we will need (all SI units can be included with +[headerref boost/units/systems/si.hpp]) and for quantity I/O ([headerref boost/units/io.hpp]), we define +a function that computes the work, in joules, done by exerting a force in newtons over a specified distance in meters +and outputs the result to `std::cout`. The [___quantity] class accepts a second template parameter as its value type; +this parameter defaults to +`double` if not otherwise specified. To demonstrate the ease of using user-defined types in dimensional +calculations, we also present code for computing the complex impedance using `std::complex` +as the value type : + +[import ../example/tutorial.cpp] + +[tutorial_code] + +The intent and function of the above code should be obvious; the output produced is : + +[tutorial_output] + +While this library attempts to make simple dimensional computations easy to code, it is in no way +tied to any particular unit system (SI or otherwise). Instead, it provides a highly flexible compile-time +system for dimensional analysis, supporting arbitrary collections of base dimensions, rational +powers of units, and explicit quantity conversions. It accomplishes all of this via template metaprogramming techniques. +With modern optimizing compilers, this results in zero runtime overhead for quantity computations relative to the +same code without unit checking. + +[endsect] + +[section:Dimensional_Analysis Dimensional Analysis] + +The concept of +[@http://en.wikipedia.org/wiki/Dimensional_analysis dimensional analysis] +is normally presented early on in introductory physics and engineering classes as a means of determining the +correctness of an equation or computation by propagating the physical measurement +[@http://en.wikipedia.org/wiki/Units_of_measurement units] +of various quantities through the equation along with their numerical values. There are a number of standard +unit systems in common use, the most prominent of which is the +[@http://en.wikipedia.org/wiki/SI_units Systeme International] +(also known as SI or MKS (meter-kilogram-second), which was a metric predecessor to the SI system named +for three of the base units on which the system is based). The SI +is the only official international standard unit system and is widely utilized in science and engineering. +Other common systems include the [@http://en.wikipedia.org/wiki/Cgs_units CGS] +(centimeter-gram-second) system and the +[@http://en.wikipedia.org/wiki/English_units English] +system still in use in some problem domains in the United States and elsewhere. In physics, +there also exist a number of other systems that are in common use in specialized subdisciplines. These are +collectively referred to as [@http://en.wikipedia.org/wiki/Natural_units natural units]. When +quantities representing different measurables are combined, dimensional analysis provides the means of +assessing the consistency of the resulting calculation. For example, the sum of two lengths is also a length, +while the product of two lengths is an area, and the sum of a length and an area is undefined. The fact that the +arguments to many functions (such as exp, log, etc...) must be dimensionless quantities can be easily demonstrated by +examining their series expansions in the context of dimensional analysis. This library facilitates the enforcement +of this type of restriction in code involving dimensioned quantities where appropriate. + +In the following discussion we view dimensional analysis as an abstraction in which an arbitrary set of +[@http://en.wikipedia.org/wiki/Fundamental_units units] obey the rules of a specific algebra. +We will refer to a pair of a base dimension and a rational exponent as a *fundamental dimension*, +and a list composed of an arbitrary number of fundamental dimensions as a *composite dimension* or, simply, +*dimension*. In particular, given a set of [$../../libs/units/images/form_0.png] fundamental dimensions +denoted by [$../../libs/units/images/form_1.png] and a set of [$../../libs/units/images/form_0.png] +rational exponents [$../../libs/units/images/form_2.png], any possible (composite) dimension can be written +as [$../../libs/units/images/form_3.png]. + +Composite dimensions obey the algebraic rules for dimensional analysis. In particular, for any scalar value, +[$../../libs/units/images/form_4.png], +and composite dimensions [$../../libs/units/images/form_5.png] +and [$../../libs/units/images/form_6.png], where +[$../../libs/units/images/form_7.png], we have: + +[$../../libs/units/images/form_8.png] + +Users of a dimensional analysis library should be able to specify an arbitrary list of base dimensions to +produce a composite dimension. This potentially includes repeated tags. For example, +it should be possible to express energy as [$../../libs/units/images/form_9.png], [$../../libs/units/images/form_10.png], +[$../../libs/units/images/form_11.png], or any other permutation of mass, length, and time having aggregate exponents of +1, 2, and -2, respectively. +In order to be able to perform computations on arbitrary sets of dimensions, +all composite dimensions must be reducible to an unambiguous final composite dimension, which we will refer to as a +*reduced dimension*, for which + +# fundamental dimensions are consistently ordered +# dimensions with zero exponent are elided. Note that reduced dimensions never have more than + [$../../libs/units/images/form_0.png] base dimensions, one for each distinct fundamental dimension, but may have fewer. + +In our implementation, base dimensions are associated with tag types. As we will ultimately +represent composite dimensions as typelists, we must provide some mechanism for sorting +base dimension tags in order to make it possible to convert an arbitrary composite dimension +into a reduced dimension. For this purpose, we assign a unique integer to each base dimension. +The [___base_dimension] class (found in [headerref boost/units/base_dimension.hpp]) uses the +curiously recurring template pattern (CRTP) technique to ensure that ordinals specified for +base dimensions are unique: + + template struct base_dimension { ... }; + +With this, we can define the base dimensions for length, mass, and time as: + +[import ../example/test_system.hpp] +[test_system_snippet_1] + +It is important to note that the choice of order is completely arbitrary as long as each tag has a unique enumerable +value; non-unique ordinals are flagged as errors at compile-time. Negative ordinals are reserved for use by the library. +To define composite dimensions corresponding to the base dimensions, we +simply create MPL-conformant typelists of fundamental dimensions by using the [___dim] class to encapsulate pairs of base dimensions +and [___static_rational] exponents. The [___make_dimension_list] class acts as a wrapper to ensure +that the resulting type is in the form of a reduced dimension: + +[test_system_snippet_2] + +This can also be easily accomplished using a convenience typedef provided by [___base_dimension]: + +[test_system_snippet_3] + +so that the above code is identical to the full typelist definition. Composite dimensions are similarly defined via a typelist: + +[test_system_snippet_4] + +A convenience class for composite dimensions with integer powers is also provided: + +[test_system_snippet_5] + +[endsect] + +[section:Units Units] + +We define a *unit* as a set of base units each of which can be raised to an arbitrary rational +exponent. Thus, the SI unit corresponding to the dimension of force is kg m s^-2, where kg, m, +and s are base units. We use the notion of a *unit system* such as SI to specify the mapping +from a dimension to a particular unit so that instead of specifying the base units explicitly, +we can just ask for the representation of a dimension in a particular system. + +Units are, like dimensions, purely compile-time variables with no associated value. +Units obey the same algebra as dimensions do; the presence of the unit system serves to ensure that units having identical +reduced dimension in different systems (like feet and meters) cannot be inadvertently mixed in computations. + +There are two distinct types of systems that can be envisioned: + +* *Homogeneous systems* : Systems which hold a linearly independent set of base units which + can be used to represent many different dimensions. For example, the SI system has seven + base dimensions and seven base units corresponding to them. It can represent any unit which + uses only those seven base dimensions. Thus it is a homogeneous_system. +* *Heterogeneous systems* : Systems which store the exponents of every base unit involved + are termed heterogeneous. Some units can only be represented in this way. For example, + area in m ft is intrinsically heterogeneous, because the base units of meters and feet + have identical dimensions. As a result, simply storing a dimension and a set of base + units does not yield a unique solution. A practical example of the need for heterogeneous + units, is an empirical equation used in aviation: H = (r/C)^2 where H is the radar beam + height in feet and r is the radar range in nautical miles. In order to enforce dimensional + correctness of this equation, the constant, C, must be expressed in nautical miles per foot^(1/2), + mixing two distinct base units of length. + +Units are implemented by the [___unit] template class defined in [headerref boost/units/unit.hpp] : + + template class unit; + +In addition to supporting the compile-time dimensional analysis operations, the +, -, *, and / runtime operators are provided +for [___unit] variables. Because the dimension associated with powers and roots must be computed at compile-time, it is not +possible to provide overloads for `std::pow` that function correctly for [___unit]s. These operations are supported through +free functions [___pow] and [___root] that are templated on integer and [___static_rational] values and can take as an argument +any type for which the utility classes [___power_typeof_helper] and [___root_typeof_helper] have been defined. + +[section Base Units] + +Base units are defined much like base dimensions. + + template struct base_unit { ... }; + +Again negative ordinals are reserved. + +As an example, in the following we will implement a subset of the SI unit system based on the fundamental dimensions +given above, demonstrating all steps necessary for a completely functional system. First, we simply define a unit system +that includes type definitions for commonly used units: + +[test_system_snippet_6] + +The macro [___BOOST_UNITS_STATIC_CONSTANT] is provided in [headerref boost/units/static_constant.hpp] +to facilitate ODR- and thread-safe constant definition in header files. We then define some constants for the supported units +to simplify variable definitions: + +[test_system_snippet_7] + +If support for textual output of units is desired, we can also specialize the [___base_unit_info] class for each fundamental +dimension tag: + +[test_system_snippet_8] + +and similarly for `kilogram_base_unit` and `second_base_unit`. A future version of the library will provide a more flexible system +allowing for internationalization through a facet/locale-type mechanism. +The `name()` and `symbol()` methods of [___base_unit_info] provide full and short names for the base unit. With these definitions, +we have the rudimentary beginnings of our unit system, which can be used to determine reduced dimensions for arbitrary +unit calculations. + +[endsect] [/section Base Units] + +[section Scaled Base Units] + +Now, it is also possible to define a base unit as being a multiple of +another base unit. For example, the way that `kilogram_base_unit` is +actually defined by the library is along the following lines + + struct gram_base_unit : boost::units::base_unit {}; + typedef scaled_base_unit > > kilogram_base_unit; + +This basically defines a kilogram as being 10^3 times a gram. + +There are several advantages to this approach. + +* It reflects the real meaning of these units better than treating them as independent units. +* If a conversion is defined between grams or kilograms and some other units, + it will automatically work for both kilograms and grams, with only one specialization. +* Similarly, if the symbol for grams is defined as "g", then the symbol for kilograms + will be "kg" without any extra effort. + +[endsect] [/section Scaled Base Units] + +[section Scaled Units] + +We can also scale a [___unit] as a whole, rather than scaling the individual +base units which comprise it. For this purpose, we use the metafunction +[___make_scaled_unit]. The main motivation for this feature is the metric +prefixes defined in [headerref boost/units/systems/si/prefixes.hpp]. + +A simple example of its usage would be. + + typedef make_scaled_unit > >::type nanosecond; + +nanosecond is a specialization of [___unit], and can be used in a quantity normally. + + quantity t(1.0 * si::seconds); + std::cout << t << std::endl; // prints 1e9 ns + +[endsect] [/section Scaled Units] + +[endsect] [/section:Units Units] + +[section:Quantities Quantities] + +A *quantity* is defined as a value of an arbitrary value type that is associated with a specific unit. For example, +while meter is a unit, 3.0 meters is a quantity. Quantities obey two separate algebras: the native algebra for their +value type, and the dimensional analysis algebra for the associated unit. In addition, algebraic operations are defined +between units and quantities to simplify the definition of quantities; it is effectively equivalent to algebra with +a unit-valued quantity. + +Quantities are implemented by the [___quantity] template class defined in [headerref boost/units/quantity.hpp] : + + template class quantity; + +This class is templated on both unit type (`Unit`) and value type (`Y`), with the latter defaulting to double-precision +floating point if not otherwise specified. The value type must have a normal copy constructor and copy +assignment operator. Operators +, -, *, and / are provided for algebraic operations between +scalars and units, scalars and quantities, units and quantities, and between quantities. In addition, integral and +rational powers and roots can be computed using the [___pow] and [___root] functions. Finally, +the standard set of boolean comparison operators ( `==, !=, <, <=, >, and >=` ) are provided to allow +comparison of quantities from the same unit system. All operators simply delegate to the +corresponding operator of the value type if the units permit. + +[section:Heterogeneous_Operators Heterogeneous Operators] + +For most common value types, the result type of arithmetic operators is the same as the value type itself. For example, +the sum of two double precision floating point numbers is another double precision floating point number. However, there +are instances where this is not the case. A simple example is given by the [@http://en.wikipedia.org/wiki/Natural_number +natural numbers] where the operator arithmetic obeys the following rules (using the standard notation for +[@http://en.wikipedia.org/wiki/Number number systems]): + +* [$../../libs/units/images/form_12.png] +* [$../../libs/units/images/form_13.png] +* [$../../libs/units/images/form_14.png] +* [$../../libs/units/images/form_15.png] + +This library is designed to support arbitrary value type algebra for addition, subtraction, multiplication, division, and +rational powers and roots. It uses Boost.Typeof to deduce the result of these operators. For compilers that +support `typeof`, the appropriate value type will be automatically deduced. For compilers that do not provide +language support for `typeof` it is necessary to register all the types used. For the case of natural numbers, +this would amount to something like the following: + + BOOST_TYPEOF_REGISTER_TYPE(natural); + BOOST_TYPEOF_REGISTER_TYPE(integer); + BOOST_TYPEOF_REGISTER_TYPE(rational); + +[endsect] + +[section:Conversions Conversions] + +Conversion is only meaningful for quantities as it implies the presence of at +least a multiplicative scale factor and, possibly, and affine linear offset. +Macros for simplifying the definition of conversions between units can be found in +[headerref boost/units/conversion.hpp] and [headerref boost/units/absolute.hpp] +(for affine conversions with offsets). + +The macro [___BOOST_UNITS_DEFINE_CONVERSION_FACTOR] specifies a scale +factor for conversion from the first unit type to the second. The +first argument must be a [___base_unit]. The second argument +can be either a [___base_unit] or a [___unit]. + +Let's declare a simple base unit: + + struct foot_base_unit : base_unit { }; + +Now, we want to be able to convert feet to meters and vice versa. The foot +is defined as exactly 0.3048 meters, so we can write the following + + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(foot_base_unit, meter_base_unit, double, 0.3048); + +Alternately, we could use the SI length `typedef`: + + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(foot_base_unit, SI::length, double, 0.3048); + +Since the SI unit of length is the meter, these two definitions are equivalent. +If these conversions have been defined, then converting between +scaled forms of these units will also automatically work. + +The macro [___BOOST_UNITS_DEFAULT_CONVERSION] specifies a conversion +that will be applied to a base unit when no direct conversion is +possible. This can be used to make arbitrary conversions work +with a single specialization: + + struct my_unit_tag : boost::units::base_unit {}; + // define the conversion factor + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(my_unit_tag, SI::force, double, 3.14159265358979323846); + // make conversion to SI the default. + BOOST_UNITS_DEFAULT_CONVERSION(my_unit_tag, SI::force); + +[endsect] + +[section:Quantity_Construction_and_Conversion Construction and Conversion of Quantities] + +This library is designed to emphasize safety above convenience when performing operations with dimensioned quantities. +Specifically, construction of quantities is required to fully specify both value and unit. Direct construction from a scalar value +is prohibited (though the static member function [___from_value] is provided to enable +this functionality where it is necessary. In addition, a [___quantity_cast] to a reference allows direct access to the +underlying value of a [___quantity] variable. An explicit constructor is provided to enable conversion between +dimensionally compatible quantities in different unit systems. Implicit conversions between unit systems are +allowed only when the reduced units are identical, allowing, for example, trivial conversions between +equivalent units in different systems (such as SI seconds and CGS seconds) while simultaneously enabling +unintentional unit system mismatches to be caught at compile time and preventing potential loss of precision and +performance overhead from unintended conversions. Assignment follows the same rules. +An exception is made for quantities for which the unit reduces to dimensionless; in this case, implicit conversion +to the underlying value type is allowed via class template specialization. Quantities of different value types are implicitly +convertible only if the value types are themselves implicitly convertible. The [___quantity] class also defines +a `value()` member for directly accessing the underlying value. + +To summarize, conversions are allowed under the following conditions : + +* implicit conversion of `quantity` to `quantity` is allowed if `Y` and `Z` are implicitly convertible. +* assignment between `quantity` and `quantity` is allowed if `Y` and `Z` are implicitly convertible. +* explicit conversion between `quantity` and `quantity` is allowed if `Unit1` and `Unit2` have the same dimensions + and if `Y` and `Z` are implicitly convertible. +* implicit conversion between `quantity` and `quantity` is allowed if `Unit1` + reduces to exactly the same combination of base units as `Unit2` and if `Y` and `Z` are convertible. +* assignment between `quantity` and `quantity` is allowed under the same + conditions as implicit conversion. +* `quantity` can be directly constructed from a value of type `Y` using the static member function [___from_value]. Doing so, + naturally, bypasses any type-checking of the newly assigned value, so this method should be used only when absolutely necessary. + +Of course, any time implicit conversion is allowed, an explicit conversion is +also legal. + +Because dimensionless quantities have no associated units, they behave as normal scalars, and allow implicit conversion to and from +the underlying value type or types that are convertible to/from that value type. + +[endsect] + +[endsect] + +[section:Examples Examples] + +[section:DimensionExample Dimension Example] + +([@../../libs/units/example/dimension.cpp dimension.cpp]) + +By using MPL metafunctions and the template specializations for operations on composite dimensions +(defined in [headerref boost/units/dimension.hpp]) it is possible to perform compile time arithmetic +according to the dimensional analysis rules described [link boost_units.Dimensional_Analysis above] +to produce new composite dimensions : + +[import ../example/dimension.cpp] + +[dimension_snippet_1] + +outputting (with symbol demangling, implemented in +[@boost:/boost/units/detail/utility.hpp utility.hpp]) + +[dimension_output] + +[endsect] + +[section:UnitExample Unit Example] + +([@../../libs/units/example/unit.cpp unit.cpp]) + +This example demonstrates the use of the simple but functional unit system implemented in +[@boost:/libs/units/example/test_system.hpp test_system.hpp] + +[import ../example/unit.cpp] + +[unit_snippet_1] + +We can perform various algebraic operations on these units, resulting in the following output: + +[unit_output] + +[endsect] + +[section:QuantityExample Quantity Example] + +([@../../libs/units/example/quantity.cpp quantity.cpp]) + +This example demonstrates how to use quantities of our toy unit system : + +[import ../example/quantity.cpp] + +[quantity_snippet_1] + +giving us the basic quantity functionality : + +[quantity_output_double] + +As a further demonstration of the flexibility of the system, we replace the `double` value type +with a `std::complex` value type (ignoring the question of the meaningfulness of +complex lengths and energies) : + +[quantity_snippet_2] + +and find that the code functions exactly as expected with no additional work, delegating operations +to `std::complex` and performing the appropriate dimensional analysis : + +[quantity_output_complex] + +[endsect] + +[section:KitchenSinkExample Kitchen Sink Example using SI units] + +([@../../libs/units/example/kitchen_sink.cpp kitchen_sink.cpp]) + +This example provides a fairly extensive set of tests covering most of the [___quantity] functionality. +It uses the SI unit system defined in [headerref boost/units/systems/si.hpp]. + +If we define a few units and associated quantities, + +[import ../example/kitchen_sink.cpp] + +[kitchen_sink_snippet_1] + +the various algebraic operations between scalars, units, and quantities give + +[kitchen_sink_output_1] + +Scalar/unit operations : + +[kitchen_sink_output_2] + +Unit/unit operations and integral/rational powers of units : + +[kitchen_sink_output_3] + +Scalar/quantity operations : + +[kitchen_sink_output_4] + +Unit/quantity operations : + +[kitchen_sink_output_5] + +Quantity/quantity operations and integral/rational powers of quantities : + +[kitchen_sink_output_6] + +Logical comparison operators are also defined between quantities : + +[kitchen_sink_snippet_2] + +giving + +[kitchen_sink_output_7] + +Implicit conversion is allowed between dimensionless quantities and their corresponding value types : + +[kitchen_sink_snippet_3] + +A generic function for computing mechanical work can be defined that takes force and distance arguments +in an arbitrary unit system and returns energy in the same system: + +[kitchen_sink_function_snippet_3] + +[kitchen_sink_snippet_4] + +which functions as expected for SI quantities : + +[kitchen_sink_output_9] + +The ideal gas law can also be implemented in SI units : + +[kitchen_sink_function_snippet_4] + +[kitchen_sink_snippet_5] + +with the resulting output : + +[kitchen_sink_output_10] + +Trigonometric and inverse trigonometric functions can be implemented for any unit system +that provides an angular base dimension. For radians, these functions are found in +[headerref boost/units/cmath.hpp] These behave as one expects, with trigonometric functions +taking an angular quantity and returning a dimensionless quantity, while the inverse trigonometric functions +take a dimensionless quantity and return an angular quantity : + +Defining a few angular quantities, + +[kitchen_sink_snippet_6] + +yields + +[kitchen_sink_output_11] + +Dealing with complex quantities is trivial. Here is the calculation of complex impedance : + +[kitchen_sink_snippet_7] + +giving + +[kitchen_sink_output_12] + +[section:UDT_Quantities User-defined value types] + +User-defined value types that support the appropriate arithmetic operations are automatically supported +as quantity value types. The operators that are supported by default for quantity value types are unary plus, unary minus, +addition, subtraction, multiplication, division, equal-to, not-equal-to, less-than, less-or-equal-to, +greater-than, and greater-or-equal-to. Support for rational powers and roots can be added by overloading +the [___power_typeof_helper] and [___root_typeof_helper] classes. Here we implement a user-defined `measurement` +class that models a numerical measurement with an associated measurement error and the appropriate algebra and +demonstrates its use as a quantity value type; the full code is found in [@../../libs/units/example/measurement.hpp measurement.hpp]. + +Then, defining some `measurement` [___quantity] variables + +[kitchen_sink_snippet_8] + +gives + +[kitchen_sink_output_13] + +If we implement the overloaded helper classes for rational powers and roots +then we can also compute rational powers of measurement quantities : + +[kitchen_sink_output_14] + +[endsect] + +[endsect] + +[section:ConversionExample Conversion Example] + +([@../../libs/units/example/conversion.cpp conversion.cpp]) + +This example demonstrates the various allowed conversions between SI and CGS units. Defining some +quantities + +[import ../example/conversion.cpp] + +[conversion_snippet_1] + +illustrates implicit conversion of quantities of different value types where implicit conversion +of the value types themselves is allowed. N.B. The conversion from double to int is treated +as an explicit conversion because there is no way to emulate the exact behavior of the built-in +conversion. Explicit constructors allow conversions for two cases: + +* explicit casting of a [___quantity] to a different `value_type` : + +[conversion_snippet_3] + +* and explicit casting of a [___quantity] to a different unit : + +[conversion_snippet_4] + +giving the following output : + +[conversion_output_1] + +A few more explicit unit system conversions : + +[conversion_snippet_5] + +which produces the following output: + +[conversion_output_2] + +[endsect] + +[section:UDTExample User Defined Types] + +([@../../libs/units/example/quaternion.cpp quaternion.cpp]) + +This example demonstrates the use of `boost::math::quaternion` as a value type for [___quantity] and the converse. +For the first case, we first define specializations of [___power_typeof_helper] and [___root_typeof_helper] for +powers and roots, respectively: + +[import ../example/quaternion.cpp] + +[quaternion_class_snippet_1a] + +[quaternion_class_snippet_1b] + +We can now declare a [___quantity] of a `quaternion` : + +[quaternion_snippet_1] + +so that all operations that are defined in the `quaternion` class behave correctly. If rational +powers were defined for this class, it would be possible to compute rational powers and roots with +no additional changes. + +[quaternion_output_1] + +Now, if for some reason we preferred the [___quantity] to be the value type of the `quaternion` class we would have : + +[quaternion_snippet_2] + +Here, the unary plus and minus and addition and subtraction operators function correctly. Unfortunately, +the multiplication and division operations fail because `quaternion` implements them in terms of the `*=` and +`/=` operators, respectively, which are incapable of representing the heterogeneous unit algebra needed for +quantities (an identical problem +occurs with `std::complex`, for the same reason). In order to compute rational powers and roots, we need to +specialize [___power_typeof_helper] and [___root_typeof_helper] as follows: + +[quaternion_class_snippet_2a] + +[quaternion_class_snippet_2b] + +giving: + +[quaternion_output_2] + +[endsect] + +[section:ComplexExample Complex Example] + +([@../../libs/units/example/complex.cpp complex.cpp]) + +This example demonstrates how to implement a replacement `complex` class that functions correctly both as a +quantity value type and as a quantity container class, including heterogeneous multiplication and division +operations and rational powers and roots. Naturally, heterogeneous operations are only supported on +compilers that implement `typeof`. The primary differences are that binary operations are not implemented +using the `op=` operators and use the utility classes [___add_typeof_helper], [___subtract_typeof_helper], +[___multiply_typeof_helper], and [___divide_typeof_helper]. In addition, [___power_typeof_helper] and +[___root_typeof_helper] are defined for both cases : + +[import ../example/complex.cpp] + +[complex_class_snippet_1] + +With this replacement `complex` class, we can declare a complex variable : + +[complex_snippet_1] + +to get the correct behavior for all cases supported by [___quantity] with a `complex` value type : + +[complex_output_1] + +and, similarly, `complex` with a [___quantity] value type + +[complex_snippet_2] + +gives + +[complex_output_2] + +[endsect] + +[section:PerformanceExample Performance Example] + +([@../../libs/units/example/performance.cpp performance.cpp]) + +This example provides an ad hoc performance test to verify that zero runtime overhead +is incurred when using [___quantity] in place of `double`. Note that performance +optimization and testing is not trivial, so some care must be taken in profiling. It +is also critical to have a compiler capable of optimizing the many template instantiations +and inline calls effectively to achieve maximal performance. Zero overhead for this test +has been verified using gcc 4.0.1, and icc 9.0, 10.0, and 10.1 on Mac OS 10.4 and 10.5, and +using msvc 8.0 on Windows XP. + +[endsect] + +[section:RadarBeamHeightExample Radar Beam Height] + +([@../../libs/units/example/radar_beam_height.cpp radar_beam_height.cpp]) + +[import ../example/radar_beam_height.cpp] + +This example demonstrates the implementation of two non-SI units of length, the +nautical mile : + +[radar_beam_height_class_snippet_1] + +and the imperial foot : + +[radar_beam_height_class_snippet_2] + +These units include conversions between themselves and the meter. Three functions +for computing radar beam height from radar range and the local earth radius are +defined. The first takes arguments in one system and returns a value in the same +system : + +[radar_beam_height_function_snippet_1] + +The second is similar, but is templated on return type, so that the arguments are +converted to the return unit system internally : + +[radar_beam_height_function_snippet_2] + +Finally, the third function is an empirical approximation that is only valid for +radar ranges specified in nautical miles, returning beam height in feet. This +function uses the heterogeneous unit of nautical miles per square root of feet to +ensure dimensional correctness : + +[radar_beam_height_function_snippet_3] + +With these, we can compute radar beam height in various unit systems : + +[radar_beam_height_snippet_1] + +giving + +[radar_beam_height_output] + +[endsect] + +[section:HeterogeneousUnitExample Heterogeneous Unit Example] + +([@../../libs/units/example/heterogeneous_unit.cpp heterogeneous_unit.cpp]) + +[import ../example/heterogeneous_unit.cpp] + +Mixed units and mixed unit conversions. + +This code: + +[heterogeneous_unit_snippet_1] + +gives + +[heterogeneous_unit_output_1] + +Arbitrary conversions also work: + +[heterogeneous_unit_snippet_2] + +yielding + +[heterogeneous_unit_output_2] + +[endsect] + +[section:AbsoluteRelativeTemperatureExample Absolute and Relative Temperature Example] + +([@../../libs/units/example/temperature.cpp temperature.cpp]) + +[import ../example/temperature.cpp] + +This example demonstrates using of absolute temperatures and relative temperature differences in Fahrenheit +and converting between these and the Kelvin temperature scale. This issue touches on some surprisingly deep mathematical +concepts (see [@http://en.wikipedia.org/wiki/Affine_space Wikipedia] for a basic review), but for our purposes here, we +will simply observe that it is important to be able to differentiate between an absolute temperature measurement and a +measurement of temperature difference. This is accomplished by using the [___absolute] wrapper class. + +First we define a system using the predefined fahrenheit base unit: + +[temperature_snippet_1] + +Now we can create some quantities: + +[temperature_snippet_3] + +Note the use of [___absolute] to wrap a unit. The resulting output is: + +[temperature_output_1] + +[endsect] + +[section:RuntimeConversionFactorExample Runtime Conversion Factor Example] + +([@../../libs/units/example/runtime_conversion_factor.cpp runtime_conversion_factor.cpp]) + +[import ../example/runtime_conversion_factor.cpp] + +The Boost.Units library does not require that the conversion factors be compile time constants, +as is demonstrated in this example: + +[runtime_conversion_factor_snippet_1] + +[endsect] + +[section:UnitsWithNonbaseDimensions Units with Non-base Dimensions] + +([@../../libs/units/example/non_base_dimension.cpp non_base_dimension.cpp]) + +[import ../example/non_base_dimension.cpp] + +It is also possible to define base units that have derived rather than base dimensions: + +[non_base_dimension_snippet_1] + +[endsect] + +[section:OutputForCompositeUnits Output for Composite Units] + +([@../../libs/units/example/composite_output.cpp composite_output.cpp]) + +[import ../example/composite_output.cpp] + +If a unit has a special name and/or symbol, the free functions `name_string` and +`symbol_string` can be overloaded directly. + +[composite_output_snippet_1] + +In this case, any unit that reduces +to the overloaded unit will be output with the replacement symbol. + +Special names and symbols for the SI and CGS unit systems are found in +[headerref boost/units/systems/si/io.hpp] and [headerref boost/units/systems/cgs/io.hpp], +respectively. If these headers are not included, the output will simply follow +default rules using the appropriate fundamental dimensions. +Note that neither of these functions is defined for quantities +because doing so would require making assumptions on how the corresponding value +type should be formatted. + +Three `ostream` formatters, `symbol_format`, `name_format`, and `typename_format` +are provided for convenience. These select the textual representation of units +provided by `symbol_string` or `name_string` in the first two cases, while the +latter returns a demangled typename for debugging purposes. Formatting of scaled +unit is also done correctly. + +[endsect] + +[section:autoscale Automatically Scaled Units] + +It is often desirable to scale a [___unit] automatically, depending on its value, +to keep the integral part in a limited range, usually between 1 and 999. + +For example, using [@http://en.wikipedia.org/wiki/Engineering_notation engineering notation prefixes], + + "1234.5 m" is more helpfully displayed as "1.234 km" + "0.000000001234 m" is more clearly displayed as "1.2345 nanometer". + +The iostream manipulators `engineering_prefixes` or `binary_prefixes` make this easy. + +[import ../example/autoprefixes.cpp] + +[autoprefixes_snippet_1] + +(The complete set of [@http://physics.nist.gov/cuu/Units/prefixes.html engineering and scientific multiples] +is not used (not centi or deci for example), but only powers of ten that are multiples of three, 10^3). + +Similarly, the equivalent [@http://en.wikipedia.org/wiki/Binary_prefixes binary prefixes] +used for displaying computing kilobytes, megabytes, gigabytes... + +These are the 2^10 = 1024, 2^20 = 1 048 576, 2^30 ... multiples. + +(See also [@http://physics.nist.gov/cuu/Units/binary.html Prefixes for binary multiples] + +This scale is specified in IEC 60027-2, Second edition, 2000-11, +Letter symbols to be used in electrical technology - +Part 2: Telecommunications and electronics). + +[autoprefixes_snippet_2] + +But note that scalar dimensionless values, like int, float and double, +are *not* prefixed automatically by the engineering_prefix or binary_prefix iostream manipulators. + +[autoprefixes_snippet_3] + +You can output the name or symbol of a unit (rather than the most common quantity of a unit). + +[autoprefixes_snippet_4] + +Note too that all the formatting flags are persistent, +so that if you set engineering_prefix, then it applies to all future outputs, +until you select binary_prefix, or explicitly switch autoprefix off. +You can specify no prefix (the default of course) in two ways: + +[autoprefixes_snippet_5] + +And you can get the format flags for diagnosing problems. + +[autoprefixes_snippet_6] + +[endsect] [/section:autoscale Automatically Scaled Units] + +[section:ConversionFactor Conversion Factor] + +This code demonstrates the use of the `conversion_factor` free function to determine +the scale factor between two units. + +([@../../libs/units/example/conversion_factor.cpp conversion_factor.cpp]) + +[import ../example/conversion_factor.cpp] + +[conversion_factor_snippet_1] + +Produces + +[conversion_factor_output] + +[endsect] + +[section:RuntimeUnits Runtime Units] + +([@../../libs/units/example/runtime_unit.cpp runtime_unit.cpp]) + +[import ../example/runtime_unit.cpp] + +This example shows how to implement an interface that +allow different units at runtime while still maintaining +type safety for internal calculations. + +[runtime_unit_snippet_1] + +[endsect] + +[section:lambda Interoperability with Boost.Lambda] + +([@../../libs/units/example/lambda.cpp lambda.cpp]) + +[import ../example/lambda.cpp] + +The header [headerref boost/units/lambda.hpp] provides overloads +and specializations needed to make Boost.Units usable with the +Boost.Lambda library. + +[lambda_snippet_1] + +[endsect] + +[endsect] + +[section:Utilities Utilities] + +Relatively complete SI and CGS unit systems are provided in [headerref boost/units/systems/si.hpp] and +[headerref boost/units/systems/cgs.hpp], respectively. + +[section:Metaprogramming_Classes Metaprogramming Classes] + + template struct ordinal; + + template struct get_tag< dim >; + template struct get_value< dim >; + template struct get_system_tag_of_dim; + template struct make_dimension_list; + template struct fundamental_dimension
; + template struct composite_dimension; + + template struct get_dimension< unit >; + template struct get_dimension< quantity >; + template struct get_system< unit >; + template struct get_system quantity >; + + struct dimensionless_type; + template struct dimensionless_unit; + template struct dimensionless_quantity; + + struct implicitly_convertible; + struct trivial_conversion; + template struct base_unit_converter; + + template class conversion_helper; + +[endsect] + +[section:Metaprogramming_Predicates Metaprogramming Predicates] + + template struct is_dim< dim >; + template struct is_empty_dim< dim >; + + template struct is_dimension_list; + + template struct is_system< homogeneous_system >; + template struct is_system< heterogeneous_system >; + template struct is_homogeneous_system< homogeneous_system >; + template struct is_heterogeneous_system< heterogeneous_system >; + + template struct is_unit< unit >; + template struct is_unit_of_system< unit,System >; + template struct is_unit_of_dimension< unit,Dim >; + + template struct is_quantity< quantity >; + template struct is_quantity_of_system< quantity,Y>,System >; + template struct is_quantity_of_dimension< quantity,Y>,Dim >; + + template struct is_dimensionless< unit >; + template struct is_dimensionless_unit< unit >; + template struct is_dimensionless< quantity,Y> >; + template struct is_dimensionless_quantity< quantity,Y> >; + +[endsect] + +[endsect] + +[section:Reference Reference] + +[xinclude units_reference.xml] + +[xinclude dimensions_reference.xml] +[xinclude si_reference.xml] +[xinclude cgs_reference.xml] +[xinclude trig_reference.xml] +[xinclude temperature_reference.xml] +[xinclude information_reference.xml] +[xinclude abstract_reference.xml] + +[section Base Units by Category] + +[xinclude angle_base_units_reference.xml] +[xinclude astronomical_base_units_reference.xml] +[xinclude cgs_base_units_reference.xml] +[xinclude imperial_base_units_reference.xml] +[xinclude metric_base_units_reference.xml] +[xinclude si_base_units_reference.xml] +[xinclude temperature_base_units_reference.xml] +[xinclude us_base_units_reference.xml] + +[endsect] + +[section Alphabetical Listing of Base Units] +[include base_units.qbk] +[endsect] + +[endsect] + +[section:Installation Installation] + +The core header files are located in `boost/units`. Unit system headers are +located in ``. There are no source files for the library +itself - the library is header-only. Example programs demonstrating various aspects of the library can be found in +`boost/libs/units/example`. Programs for unit testing are provided in `boost/libs/units/test`. + +[endsect] + +[section:FAQ FAQ] + +[section:Distinguishing_Quantities_With_Same_Units +How does one distinguish between quantities that are physically different but have the same units (such as +energy and torque)?] + +Because Boost.Units includes plane and solid angle units in the SI system, torque and energy +are, in fact, distinguishable (see [@http://en.wikipedia.org/wiki/SI_units torque]). +In addition, energy is a true +[@http://mathworld.wolfram.com/Scalar.html scalar] quantity, while torque, despite +having the same units as energy if plane angle is not included, is in fact a +[@http://mathworld.wolfram.com/Pseudovector.html pseudovector]. Thus, a value type representing pseudovectors +and encapsulating their algebra could also be implemented. + +There are, +however, a few SI units that are dimensionally indistinguishable within the SI system. These +include the [@http://en.wikipedia.org/wiki/Becquerel becquerel], which has units identical to +frequency (Hz), and the [@http://en.wikipedia.org/wiki/Sievert sievert], which is degenerate +with the [@http://en.wikipedia.org/wiki/Gray_%28unit%29 gray]. In cases such as this, +the proper way to treat this difference is to recognize that expanding the set of base dimensions +can provide disambiguation. For example, adding a base dimension for radioactive decays would +allow the becquerel to be written as decays/second, differentiating it from the signature of hertz, +which is simply 1/second. + +[endsect] + +[section:Angle_Are_Units Angles are treated as units] + +If you don't like this, you can just ignore the angle units and +go on your merry way (periodically screwing up when a routine wants degrees and you give it +radians instead...) + +[endsect] + +[section:Why_Homogeneous_Systems Why are there homogeneous systems? Aren't heterogeneous systems sufficient?] + +Consider the following code: + + cout << sin(asin(180.0 * degrees)); + +What should this print? If only heterogeneous +systems are available it would print 3.14159+ rad +Why? Well, `asin` would return a `quantity` +effectively losing the information that degrees +are being used. In order to propogate this extra information +we need homogeneous systems. + +[endsect] + +[section:NoConstructorFromValueType Why can't I construct a quantity directly from the value type?] + +This only breaks generic code--which ought to break anyway. The only +literal value that ought to be converted to a quantity by generic code +is zero, which should be handled by the default constructor. In addition, +consider the search and replace problem allowing this poses: + + quantity q(1.0); + +Here, the intent is clear - we want a length of one in the SI system, which is one meter. However, +imagine some well-intentioned coder attempting to reuse this code, but to have it perform the +calculations in the CGS unit system instead. After searching for `si::` and replacing it with `cgs::` , +we have: + + quantity q(1.0); + +Unfortunately, the meaning of this statement has suddenly changed from one meter to one centimeter. In +contrast, as implemented, we begin with: + + quantity q(1.0*si::meter); + +and, after search and replace: + + quantity q(1.0*cgs::meter); + +which gives us an error. Even if the code has a @using namespace boost::units::si; declaration, the latter +is still safe, with: + + using namespace boost::units::si; + quantity q(1.0*meter); + +going to + + using namespace boost::units::cgs; + quantity q(1.0*meter); + +The latter will involve an explicit conversion from meters to centimeters, but the value remains correct. + +[endsect] + +[section:ExplicitConversions Why are conversions explicit by default?] + +Safety and the potential for unintended conversions leading to precision loss and hidden performance costs. +Options are provided for forcing implicit conversions between specific units to be allowed. + +[endsect] + +[endsect] + +[section:Acknowledgements Acknowledgements] + +Matthias C. Schabel would like to acknowledge the Department of Defense for its support of this work under +the Prostate Cancer Research Program New Investigator Award W81XWH-04-1-0042 and the National Institutes of Health for their +support of this work under the NIBIB Mentored Quantitative Research Development Award K25EB005077. + +Thanks to David Walthall for his assistance in debugging and testing on a variety of platforms and Torsten Maehne for +his work on interfacing the Boost Units and Boost Lambda libraries. + +Thanks to: + +* Paul Bristow, +* Michael Fawcett, +* Ben FrantzDale, +* Ron Garcia, +* David Greene, +* Peder Holt, +* Janek Kozicki, +* Andy Little, +* Kevin Lynch, +* Torsten Maehne +* Noah Roberts, +* Andrey Semashev, +* David Walthall, +* Deane Yang, + +and all the members of the Boost mailing list who provided their input into +the design and implementation of this library. + +[endsect] [/section:Acknowledgements Acknowledgements] + +[section:HelpWanted Help Wanted] + + Any help in the following areas would be much appreciated: + +* testing on other compilers and operating systems +* performance testing on various architectures +* tutorials + +[endsect] + +[section:version_id Version Info] + +__boostroot + +Last edit to Quickbook file __FILENAME__ was at __TIME__ on __DATE__. + +[tip This should appear on the pdf version (but may be redundant on html).] +[/ Useful on pdf version. See also Last revised timestamp on first page of html version.] +[/See also Adobe Reader pdf File Properties for creation date, and PDF producer, version and page count.] + +[endsect] [/section:version_id Version Info] + +[section:ReleaseNotes Release Notes] + +1.2 (March 2010) + +* Added autoprefix ready for Boost 1.43 + +1.0.0 (August 1, 2008) : + +* Initial release with Boost 1.36 + +0.7.1 (March 14, 2007) : + +* Boost.Typeof emulation support. +* attempting to rebind a heterogeneous_system to a different set of dimensions now fails. +* cmath.hpp now works with como-win32. +* minor changes to the tests and examples to make msvc 7.1 happy. + +0.7.0 (March 13, 2007) : + +* heterogeneous and mixed system functionality added. +* added fine-grained implicit unit conversion on a per fundamental dimension basis. +* added a number of utility metafunction classes and predicates. +* [headerref boost/units/operators.hpp] now uses `BOOST_TYPEOF` when possible. +* angular units added in [headerref boost/units/systems/angle/gradians.hpp] + and [headerref boost/units/systems/angle/gradians.hpp]. + Implicit conversion of radians between trigonometric, SI, and CGS systems is allowed. +* a variety of [___unit] and [___quantity] tests added. +* examples now provide self-tests. + +0.6.2 (February 22, 2007) : + +* changed template order in `unit` so dimension precedes unit system +* added `homogeneous_system` for unit systems +* incorporated changes to [headerref boost/units/dimension.hpp] (compile-time sorting by predicate), + [headerref boost/units/conversion.hpp] (thread-safe implementation of quantity conversions), + and [headerref boost/units/io.hpp] (now works with any `std::basic_ostream`) by SW +* added abstract units in [headerref boost/units/systems/abstract.hpp] to allow abstract dimensional + analysis +* new example demonstrating implementation of code based on requirements from + Michael Fawcett ([@../../libs/units/example/radar_beam_height.cpp radar_beam_height.cpp]) + +0.6.1 (February 13, 2007) : + +* added metafunctions to test if a type is + * a valid dimension list (`is_dimension_list`) + * a unit (`is_unit` and `is_unit_of_system`) + * a quantity (`is_quantity` and `is_quantity_of_system`) +* quantity conversion factor is now computed at compile time +* static constants now avoid ODR problems +* unit_example_14.cpp now uses Boost.Timer +* numerous minor fixes suggested by SW + +0.6.0 (February 8, 2007) : + +* incorporated Steven Watanabe's optimized code for dimension.hpp, leading to *dramatic* + decreases in compilation time (nearly a factor of 10 for unit_example_4.cpp in my tests). + +0.5.8 (February 7, 2007) : + +* fixed `#include` in [headerref boost/units/systems/si/base.hpp] (thanks to Michael Fawcett and + Steven Watanabe) +* removed references to obsolete `base_type` in [___unit_info] (thanks to Michael Fawcett) +* moved functions in [headerref boost/units/cmath.hpp] into `boost::units` namespace + (thanks to Steven Watanabe) +* fixed `#include` guards to be consistently named `BOOST_UNITS_XXX` (thanks to Steven + Watanabe) + +0.5.7 (February 5, 2007) : + +* changed quantity conversion helper to increase flexibility +* minor documentation changes +* submitted for formal review as a Boost library + +0.5.6 (January 22, 2007) : + +* added IEEE 1541 standard binary prefixes along with SI prefixes to and extended algebra of + `scale` and `scaled_value` classes (thanks to Kevin Lynch) +* split SI units into separate header files to minimize the "kitchen sink" include problem + (thanks to Janek Kozicki) +* added convenience classes for declaring fundamental dimensions and composite dimensions + with integral powers (`fundamental_dimension` and `composite_dimension` respectively) + +0.5.5 (January 18, 2007) : + +* template parameter order in `quantity` switched and default `value_type` of `double` added + (thanks to Andrey Semashev and Paul Bristow) +* added implicit `value_type` conversion where allowed (thanks to Andrey Semashev) +* added `quantity_cast` for three cases (thanks to Andrey Semashev): + * constructing `quantity` from raw `value_type` + * casting from one `value_type` to another + * casting from one `unit` to another (where conversion is allowed) +* added` metre` and `metres` and related constants to the SI system for the convenience of + our Commonwealth friends... + +0.5.4 (January 12, 2007) : + +* completely reimplemented unit conversion to allow for arbitrary unit conversions + between systems +* strict quantity construction is default; quantities can be constructed from bare values + by using static member `from_value` + +0.5.3 (December 12, 2006) : + +* added Boost.Serialization support to `unit` and `quantity` classes +* added option to enforce strict construction of quantities (only constructible + by multiplication of scalar by unit or quantity by unit) by preprocessor + `MCS_STRICT_QUANTITY_CONSTRUCTION` switch + +0.5.2 (December 4, 2006) : + +* added `` wrappers in the `std` namespace for functions that can support quantities + +0.5.1 (November 3, 2006) : + +* converted to Boost Software License +* boostified directory structure and file paths + +0.5 (November 2, 2006) : + +* completely reimplemented SI and CGS unit systems and changed syntax for quantities +* significantly streamlined `pow` and `root` so for most applications it is only + necessary to define `power_typeof_helper` and `root_typeof_helper` to gain this + functionality +* added a selection of physical constants from the CODATA tables +* added a skeleton `complex` class that correctly supports both `complex >` + and `quantity,Unit>` as an example +* investigate using Boost.Typeof for compilers that do not support `typeof` + +0.4 (October 13, 2006) : + +* `pow` and `root` improved for user-defined types +* added unary + and unary - operators +* added new example of interfacing with `boost::math::quaternion` +* added optional preprocessor switch to enable implicit unit conversions + (`BOOST_UNITS_ENABLE_IMPLICIT_UNIT_CONVERSIONS`) + +0.3 (September 6, 2006) : + +* Support for `op(X x,Y y)` for g++ added. This is automatically + active when compiling with gcc and can be optionally enabled by defining the preprocessor + constant `BOOST_UNITS_HAS_TYPEOF` + +0.2 (September 4, 2006) : Second alpha release based on slightly modified code from 0.1 release + +0.1 (December 13, 2003) : written as a Boost demonstration of MPL-based dimensional analysis +in 2003. + +[endsect] + +[section:TODO TODO] + +* Document concepts +* Implementation of I/O is rudimentary; consider methods of i18n using facets +* Consider runtime variant, perhaps using overload like `quantity` + +[endsect] [/section:TODO TODO] diff --git a/tools/boost_1_65_1/libs/units/doc/units_reference.xml b/tools/boost_1_65_1/libs/units/doc/units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f6847a0005e698259151ad6eb5a3828dd53ebfa --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/units_reference.xml @@ -0,0 +1,6170 @@ + +Units Reference
+Absolute units (points rather than vectors). Operations between absolute units, and relative units like temperature differences. + +A wrapper to represent absolute units (points rather than vectors). Intended originally for temperatures, this class implements operators for absolute units so that addition of a relative unit to an absolute unit results in another absolute unit : absolute<T> +/- T -> absolute<T> and subtraction of one absolute unit from another results in a relative unit : absolute<T> - absolute<T> -> T. absolute< Y > +Y + +const value_type & +const this_type &const value_type & +const this_type &const value_type & + + +const value_type & +const this_type & +this_type &const this_type & + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +absolute< Y >const absolute< Y > &const Y &add a relative value to an absolute one +absolute< Y >const Y &const absolute< Y > &add a relative value to an absolute one +absolute< Y >const absolute< Y > &const Y &subtract a relative value from an absolute one +Yconst absolute< Y > &const absolute< Y > &subtracting two absolutes gives a difference +quantity< absolute< unit< D, S > >, T >const T &const absolute< unit< D, S > > &creates a quantity from an absolute unit and a raw value +quantity< absolute< unit< D, S > >, T >const absolute< unit< D, S > > &const T &creates a quantity from an absolute unit and a raw value +std::basic_ostream< Char, Traits > &std::basic_ostream< Char, Traits > &const absolute< Y > &Print an absolute unit. + + +Macro to define the offset between two absolute units. Requires the value to be in the destination units e.g BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0); + BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to specify the conversion factor. Like BOOST_UNITS_DEFINE_CONVERSION_FACTOR this macro defines both forward and reverse conversions so defining, e.g., the conversion from celsius to fahrenheit as above will also define the inverse conversion from fahrenheit to celsius. +
+
+base dimensions (mass, length, time...). base dimension definition registration. + +ordinal< N >Defines a base dimension. To define a dimension you need to provide the derived class (CRTP) and a unique integer. struct my_dimension : boost::units::base_dimension<my_dimension, 1> {}; + It is designed so that you will get an error message if you try to use the same value in multiple definitions. A convenience typedef. Equivalent to boost::units::derived_dimension<Derived,1>::type. unspecified +Provided for mpl compatability. Derived + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+base unit (meter, kg, sec...). base unit definition registration. + +ordinal< N >Defines a base unit. To define a unit you need to provide the derived class (CRTP), a dimension list and a unique integer. struct my_unit : boost::units::base_unit<my_unit, length_dimension, 1> {}; + It is designed so that you will get an error message if you try to use the same value in multiple definitions. The dimensions of this base unit. Dim +Provided for mpl compatability. Derived +The unit corresponding to this base unit. unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Overloads of functions in <cmath> for quantities. Only functions for which a dimensionally-correct result type can be determined are overloaded. All functions work with dimensionless quantities. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +boolconst quantity< Unit, Y > & +boolconst quantity< Unit, Y > & +boolconst quantity< Unit, Y > & +boolconst quantity< Unit, Y > & +boolconst quantity< Unit, Y > &const quantity< Unit, Y > & +boolconst quantity< Unit, Y > &const quantity< Unit, Y > & +boolconst quantity< Unit, Y > &const quantity< Unit, Y > & +boolconst quantity< Unit, Y > &const quantity< Unit, Y > & +boolconst quantity< Unit, Y > &const quantity< Unit, Y > & +boolconst quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +intconst quantity< Unit, Y > & +root_typeof_helper< typename add_typeof_helper< typename power_typeof_helper< quantity< Unit, Y >, static_rational< 2 > >::type, typename power_typeof_helper< quantity< Unit, Y >, static_rational< 2 > >::type >::type, static_rational< 2 > >::typeconst quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > & +intconst quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const quantity< Unit, Y > & +quantity< Unit, Y >const quantity< Unit, Y > &quantity< Unit, Y > * +quantity< Unit, Y >const quantity< Unit, Y > &Int * +quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y >const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y > &const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y > &For non-dimensionless quantities, integral and rational powers and roots can be computed by pow<Ex> and root<Rt> respectively. +quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y >const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y > & +quantity< Unit, Y >const quantity< Unit, Y > &const Int & +quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y >const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y > & +quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y >const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y > & +root_typeof_helper< quantity< Unit, Y >, static_rational< 2 > >::typeconst quantity< Unit, Y > & +dimensionless_quantity< si::system, Y >::typeconst quantity< si::plane_angle, Y > &cos of theta in radians +dimensionless_quantity< si::system, Y >::typeconst quantity< si::plane_angle, Y > &sin of theta in radians +dimensionless_quantity< si::system, Y >::typeconst quantity< si::plane_angle, Y > &tan of theta in radians +dimensionless_quantity< System, Y >::typeconst quantity< unit< plane_angle_dimension, System >, Y > &cos of theta in other angular units +dimensionless_quantity< System, Y >::typeconst quantity< unit< plane_angle_dimension, System >, Y > &sin of theta in other angular units +dimensionless_quantity< System, Y >::typeconst quantity< unit< plane_angle_dimension, System >, Y > &tan of theta in other angular units +quantity< unit< plane_angle_dimension, homogeneous_system< System > >, Y >const quantity< unit< dimensionless_type, homogeneous_system< System > >, Y > &acos of dimensionless quantity returning angle in same system +quantity< angle::radian_base_unit::unit_type, Y >const quantity< unit< dimensionless_type, heterogeneous_dimensionless_system >, Y > &acos of dimensionless quantity returning angle in radians +quantity< unit< plane_angle_dimension, homogeneous_system< System > >, Y >const quantity< unit< dimensionless_type, homogeneous_system< System > >, Y > &asin of dimensionless quantity returning angle in same system +quantity< angle::radian_base_unit::unit_type, Y >const quantity< unit< dimensionless_type, heterogeneous_dimensionless_system >, Y > &asin of dimensionless quantity returning angle in radians +quantity< unit< plane_angle_dimension, homogeneous_system< System > >, Y >const quantity< unit< dimensionless_type, homogeneous_system< System > >, Y > &atan of dimensionless quantity returning angle in same system +quantity< angle::radian_base_unit::unit_type, Y >const quantity< unit< dimensionless_type, heterogeneous_dimensionless_system >, Y > &atan of dimensionless quantity returning angle in radians +quantity< unit< plane_angle_dimension, homogeneous_system< System > >, Y >const quantity< unit< Dimension, homogeneous_system< System > >, Y > &const quantity< unit< Dimension, homogeneous_system< System > >, Y > &atan2 of value_type returning angle in radians +quantity< angle::radian_base_unit::unit_type, Y >const quantity< unit< Dimension, heterogeneous_system< System > >, Y > &const quantity< unit< Dimension, heterogeneous_system< System > >, Y > &atan2 of value_type returning angle in radians + + + + + + + + + +
+
+If defined will trigger a static assertion if quantity<Unit, T> is not layout compatible with T +If defined will disable a preprocessor check that the compiler is able to handle the library. +Enable checking to verify that a homogeneous system is actually capable of representing all the dimensions that it is used with. Off by default. +
+
+Template for defining conversions between quantities. + +Template for defining conversions between quantities. This template should be specialized for every quantity that allows conversions. For example, if you have a two units called pair and dozen you would write namespace boost { +namespace units { +template<class T0, class T1> +struct conversion_helper<quantity<dozen, T0>, quantity<pair, T1> > +{ + static quantity<pair, T1> convert(const quantity<dozen, T0>& source) + { + return(quantity<pair, T1>::from_value(6 * source.value())); + } +}; +} +} +In most cases, the predefined specializations for unit and absolute should be sufficient, so users should rarely need to use this. +Toconst From & + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +unspecifiedconst FromUnit &const ToUnit &Find the conversion factor between two units. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Defines the conversion factor from a base unit to any unit or to another base unit with the correct dimensions. Uses of this macro must appear at global scope. If the destination unit is a base unit or a unit that contains only one base unit which is raised to the first power (e.g. feet->meters) the reverse (meters->feet in this example) need not be defined explicitly. +Defines the conversion factor from a base unit to any other base unit with the same dimensions. Params should be a Boost.Preprocessor Seq of template parameters, such as (class T1)(class T2) All uses of must appear at global scope. The reverse conversion will be defined automatically. This macro is a little dangerous, because, unlike the non-template form, it will silently fail if either base unit is scaled. This is probably not an issue if both the source and destination types depend on the template parameters, but be aware that a generic conversion to kilograms is not going to work. +Specifies the default conversion to be applied when no direct conversion is available. Source is a base unit. Dest is any unit with the same dimensions. +Specifies the default conversion to be applied when no direct conversion is available. Params is a PP Sequence of template arguments. Source is a base unit. Dest is any unit with the same dimensions. The source must not be a scaled base unit. +
+
+ + +A utility class for defining composite dimensions with integer powers. unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Handling of fundamental dimension/exponent pairs. + +Dimension tag/exponent pair for a single fundamental dimension. The dim class represents a single dimension tag/dimension exponent pair. That is, dim<tag_type,value_type> is a pair where tag_type represents the fundamental dimension being represented and value_type represents the exponent of that fundamental dimension as a static_rational. tag_type must be a derived from a specialization of base_dimension. Specialization of the following Boost.MPL metafunctions are provided - @c mpl::plus for two @c dims +- @c mpl::minus for two @c dims +- @c mpl::negate for a @c dim +These metafunctions all operate on the exponent, and require that the dim operands have the same base dimension tag. In addition, multiplication and division by static_rational is supported. - @c mpl::times for a @c static_rational and a @c dim in either order +- @c mpl::divides for a @c static_rational and a @c dim in either order +These metafunctions likewise operate on the exponent only. dim +unspecified +T +V + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Core metaprogramming utilities for compile-time dimensional analysis. + +Reduce dimension list to cardinal form. This algorithm collapses duplicate base dimension tags and sorts the resulting list by the tag ordinal value. Dimension lists that resolve to the same dimension are guaranteed to be represented by an identical type.The argument should be an MPL forward sequence containing instances of the dim template.The result is also an MPL forward sequence. It also supports the following metafunctions to allow use as a dimension. +mpl::plus is defined only on two equal dimensions and returns the argument unchanged.mpl::minus is defined only for two equal dimensions and returns the argument unchanged.mpl::negate will return its argument unchanged.mpl::times is defined for any dimensions and adds corresponding exponents.mpl::divides is defined for any dimensions and subtracts the exponents of the right had argument from the corresponding exponents of the left had argument. Missing base dimension tags are assumed to have an exponent of zero.static_power takes a dimension and a static_rational and multiplies all the exponents of the dimension by the static_rational.static_root takes a dimension and a static_rational and divides all the exponents of the dimension by the static_rational. +unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Utility class to simplify construction of dimensionless quantities. + +Utility class to simplify construction of dimensionless quantities. quantity< typename dimensionless_unit< System >::type, Y > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Dimension lists in which all exponents resolve to zero reduce to dimensionless_type. + +Dimension lists in which all exponents resolve to zero reduce to dimensionless_type. dimensionless_type +unspecified +mpl::long_< 0 > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Utility class to simplify construction of dimensionless units in a system. + +Utility class to simplify construction of dimensionless units in a system. unit< dimensionless_type, System > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Get the dimension of a unit, absolute unit and quantity. + +unit< DimSystem >Get the dimension of a unit. Dim +absolute< Unit >Get the dimension of an absolute unit. get_dimension< Unit >::type +quantity< UnitY >Get the dimension of a quantity. get_dimension< Unit >::type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Get the system of a unit, absolute unit or quantity. + +unit< DimSystem >Get the system of a unit. System +absolute< Unit >Get the system of an absolute unit. get_system< Unit >::type +quantity< UnitY >Get the system of a quantity. get_system< Unit >::type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+A heterogeneous system is a sorted list of base unit/exponent pairs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +A system that can uniquely represent any unit which can be composed from a linearly independent set of base units. It is safe to rebind a unit with such a system to different dimensions.Do not construct this template directly. Use make_system instead. Raise a dimension list to a scalar power. Take a scalar root of a dimension list. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Stream input and output for rationals, units and quantities. Functions and manipulators for output and input of units and quantities. symbol and name format, and engineering and binary autoprefix. Serialization output is also supported. + +voidArchive &boost::units::unit< Dim, System > &const unsignedBoost Serialization library support for units. +voidArchive &boost::units::quantity< Unit, Y > &const unsignedBoost Serialization library support for quantities. + + += 0= 1default - reduces unit names to known symbols for both base and derived units. = 2output full unit names for base and derived units, for example "meter". = 3output only symbols for base units (but not derived units), for example "m". = 3output demangled typenames (useful only for diagnosis). format of output of units, for example "m" or "meter". += 0= 4No automatic prefix. = 8Scale and prefix with 10^3 multiples, 1234.5 m output as 1.2345 km. = 12Scale and prefix with 2^10 (1024) multiples, 1024 as 1 kb. automatic scaling and prefix (controlled by value of quantity) a, if any, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +std::stringconst T & +std::stringconst static_rational< N > &get string representation of integral-valued static_rational. +std::stringconst static_rational< N, D > &get string representation of static_rational. +std::basic_ostream< Char, Traits > &std::basic_ostream< Char, Traits > &const static_rational< N, D > &Write static_rational to std::basic_ostream. +longstd::ios_base &longreturns flags controlling output. +voidstd::ios_base &longlongSet new flags controlling output format. +format_modestd::ios_base &returns flags controlling output format. +voidstd::ios_base &format_modeSet new flags controlling output format. +std::ios_base &std::ios_base &Set new flags for type_name output format. +std::ios_base &std::ios_base &set new flag for raw format output, for example "m". +std::ios_base &std::ios_base &set new format flag for symbol output, for example "m". +std::ios_base &std::ios_base &set new format for name output, for example "meter". +autoprefix_modestd::ios_base &get autoprefix flags for output. +voidstd::ios_base &autoprefix_modeGet format for output. +std::ios_base &std::ios_base &Clear autoprefix flags. +std::ios_base &std::ios_base &Set flag for engineering prefix, so 1234.5 m displays as "1.2345 km". +std::ios_base &std::ios_base &Set flag for binary prefix, so 1024 byte displays as "1 Kib". +doubleconst T &ADL customization point for automatic prefixing. Returns a non-negative value. Implemented as std::abs for built-in types. +std::stringconst unit< Dimension, System > & +std::stringconst unit< Dimension, System > & +std::stringconst unit< Dimension, System > & +std::basic_ostream< Char, Traits > &std::basic_ostream< Char, Traits > &const unit< Dimension, System > &Print a unit as a list of base units and their exponents. for @c symbol_format outputs e.g. "m s^-1" or "J". +for @c name_format outputs e.g. "meter second^-1" or "joule". +for @c raw_format outputs e.g. "m s^-1" or "meter kilogram^2 second^-2". +for @c typename_format outputs the typename itself (currently demangled only on GCC). +std::basic_ostream< Char, Traits > &std::basic_ostream< Char, Traits > &const quantity< Unit, T > &Print a quantity. Prints the value followed by the unit. If the engineering_prefix, or binary_prefix is set, tries to scale the value appropriately. For example, it might print 12.345 km instead of 12345 m. (Note does not attempt to automatically scale scalars like double, float...) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a valid dim. + +false_Check that a type is a valid dim. dim< TV >true_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a valid dimension list. + +false_Check that a type is a valid dimension list. list< ItemNext >true_dimensionless_typetrue_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check if a unit or quantity is dimensionless. + +false_unit< dimensionless_typeSystem >true_Check if a unit is dimensionless. quantity< UnitY >boost::units::is_dimensionless< Unit >Check if a quantity is dimensionless. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+check that a type is a dimensionless quantity + +boost::units::is_quantity_of_dimension< T, dimensionless_type >Check that a type is a dimensionless quantity. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a dimensionless unit. + +boost::units::is_unit_of_dimension< T, dimensionless_type >Check that a type is a dimensionless unit. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a quantity. + +false_Check that a type is a quantity. quantity< UnitY >true_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a quantity of the specified dimension. + +false_Check that a type is a quantity of the specified dimension. quantity< UnitY >Dimboost::units::is_unit_of_dimension< Unit, Dim > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a quantity in a specified system. + +false_Check that a type is a quantity in a specified system. quantity< UnitY >Systemboost::units::is_unit_of_system< Unit, System > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a unit. + +false_Check that a type is a unit. unit< DimSystem >true_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a unit of the specified dimension. + +false_Check that a type is a unit of the specified dimension. unit< DimSystem >Dimtrue_absolute< unit< DimSystem > >Dimtrue_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Check that a type is a unit in a specified system. + +false_Check that a type is a unit in a specified system. unit< DimSystem >Systemtrue_absolute< unit< DimSystem > >Systemtrue_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Definitions to ease the usage of Boost.Units' quantity, unit, and absolute types in functors created with the Boost.Lambda library. Torsten Maehne +2008-06-16 +Boost.Lambda's return type deduction system is extented to make use of Boost.Units' typeof_helper trait classes for Boost.Units' quantity, absolute, and unit template classes. + +arithmetic_action< multiply_action >boost::units::unit< DimSystem >YPartial specialization of return type trait for action unit<Dim, System> * Y. boost::units::multiply_typeof_helper< boost::units::unit< Dim, System >, Y >::type +arithmetic_action< divide_action >boost::units::unit< DimSystem >YPartial specialization of return type trait for action unit<Dim, System> / Y. boost::units::divide_typeof_helper< boost::units::unit< Dim, System >, Y >::type +arithmetic_action< multiply_action >Yboost::units::unit< DimSystem >Partial specialization of return type trait for action Y * unit<Dim, System>. boost::units::multiply_typeof_helper< Y, boost::units::unit< Dim, System > >::type +arithmetic_action< divide_action >Yboost::units::unit< DimSystem >Partial specialization of return type trait for action Y / unit<Dim, System>. boost::units::divide_typeof_helper< Y, boost::units::unit< Dim, System > >::type +arithmetic_action< multiply_action >boost::units::quantity< UnitX >XPartial specialization of return type trait for action quantity<Unit, X> * X. boost::units::multiply_typeof_helper< boost::units::quantity< Unit, X >, X >::type +arithmetic_action< multiply_action >Xboost::units::quantity< UnitX >Partial specialization of return type trait for action X * quantity<Unit, X>. boost::units::multiply_typeof_helper< X, boost::units::quantity< Unit, X > >::type +arithmetic_action< divide_action >boost::units::quantity< UnitX >XPartial specialization of return type trait for action quantity<Unit, X> / X. boost::units::divide_typeof_helper< boost::units::quantity< Unit, X >, X >::type +arithmetic_action< divide_action >Xboost::units::quantity< UnitX >Partial specialization of return type trait for action X / quantity<Unit, X>. boost::units::divide_typeof_helper< X, boost::units::quantity< Unit, X > >::type +arithmetic_action< multiply_action >boost::units::unit< Dim1System1 >boost::units::quantity< Unit2Y >Partial specialization of return type trait for action unit<Dim1, System1> * quantity<Unit2, Y>. boost::units::multiply_typeof_helper< boost::units::unit< Dim1, System1 >, boost::units::quantity< Unit2, Y > >::type +arithmetic_action< divide_action >boost::units::unit< Dim1System1 >boost::units::quantity< Unit2Y >Partial specialization of return type trait for action unit<Dim1, System1> / quantity<Unit2, Y>. boost::units::divide_typeof_helper< boost::units::unit< Dim1, System1 >, boost::units::quantity< Unit2, Y > >::type +arithmetic_action< multiply_action >boost::units::quantity< Unit1Y >boost::units::unit< Dim2System2 >Partial specialization of return type trait for action quantity<Unit1, Y> * unit<Dim2, System2>. boost::units::multiply_typeof_helper< boost::units::quantity< Unit1, Y >, boost::units::unit< Dim2, System2 > >::type +arithmetic_action< divide_action >boost::units::quantity< Unit1Y >boost::units::unit< Dim2System2 >Partial specialization of return type trait for action quantity<Unit1, Y> / unit<Dim2, System2>. boost::units::divide_typeof_helper< boost::units::quantity< Unit1, Y >, boost::units::unit< Dim2, System2 > >::type +unary_arithmetic_action< plus_action >boost::units::quantity< UnitY >Partial specialization of return type trait for action +quantity<Unit, Y>. boost::units::unary_plus_typeof_helper< boost::units::quantity< Unit, Y > >::type +unary_arithmetic_action< minus_action >boost::units::quantity< UnitY >Partial specialization of return type trait for action -quantity<Unit, Y>. boost::units::unary_minus_typeof_helper< boost::units::quantity< Unit, Y > >::type +arithmetic_action< plus_action >boost::units::quantity< Unit1X >boost::units::quantity< Unit2Y >Partial specialization of return type trait for action quantity<Unit1, X> + quantity<Unit2, Y>. boost::units::add_typeof_helper< boost::units::quantity< Unit1, X >, boost::units::quantity< Unit2, Y > >::type +arithmetic_action< plus_action >boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System)X >YPartial specialization of return type trait for action quantity<dimensionless, X> + Y. boost::units::add_typeof_helper< boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), X >, Y >::type +arithmetic_action< plus_action >Xboost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System)Y >Partial specialization of return type trait for action X + quantity<dimensionless, Y>. boost::units::add_typeof_helper< X, boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y > >::type +arithmetic_action< minus_action >boost::units::quantity< Unit1X >boost::units::quantity< Unit2Y >Partial specialization of return type trait for action quantity<Unit1, X> - quantity<Unit2, Y>. boost::units::subtract_typeof_helper< boost::units::quantity< Unit1, X >, boost::units::quantity< Unit2, Y > >::type +arithmetic_action< minus_action >boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System)X >YPartial specialization of return type trait for action quantity<dimensionless, X> - Y. boost::units::subtract_typeof_helper< boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), X >, Y >::type +arithmetic_action< minus_action >Xboost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System)Y >Partial specialization of return type trait for action X - quantity<dimensionless, Y>. boost::units::subtract_typeof_helper< X, boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y > >::type +arithmetic_action< multiply_action >boost::units::quantity< Unit1X >boost::units::quantity< Unit2Y >Partial specialization of return type trait for action quantity<Unit1, X> * quantity<Unit2, Y>. boost::units::multiply_typeof_helper< boost::units::quantity< Unit1, X >, boost::units::quantity< Unit2, Y > >::type +arithmetic_action< divide_action >boost::units::quantity< Unit1X >boost::units::quantity< Unit2Y >Partial specialization of return type trait for action quantity<Unit1, X> / quantity<Unit2, Y>. boost::units::divide_typeof_helper< boost::units::quantity< Unit1, X >, boost::units::quantity< Unit2, Y > >::type +unary_arithmetic_action< plus_action >boost::units::unit< DimSystem >Partial specialization of return type trait for action +unit<Dim, System>. boost::units::unary_plus_typeof_helper< boost::units::unit< Dim, System > >::type +unary_arithmetic_action< minus_action >boost::units::unit< DimSystem >Partial specialization of return type trait for action -unit<Dim, System>. boost::units::unary_minus_typeof_helper< boost::units::unit< Dim, System > >::type +arithmetic_action< plus_action >boost::units::unit< Dim1System1 >boost::units::unit< Dim2System2 >Partial specialization of return type trait for action unit<Dim1, System1> + unit<Dim2, System2>. boost::units::add_typeof_helper< boost::units::unit< Dim1, System1 >, boost::units::unit< Dim2, System2 > >::type +arithmetic_action< minus_action >boost::units::unit< Dim1System1 >boost::units::unit< Dim2System2 >Partial specialization of return type trait for action unit<Dim1, System1> - unit<Dim2, System2>. boost::units::subtract_typeof_helper< boost::units::unit< Dim1, System1 >, boost::units::unit< Dim2, System2 > >::type +arithmetic_action< multiply_action >boost::units::unit< Dim1System1 >boost::units::unit< Dim2System2 >Partial specialization of return type trait for action unit<Dim1, System1> * unit<Dim2, System2>. boost::units::multiply_typeof_helper< boost::units::unit< Dim1, System1 >, boost::units::unit< Dim2, System2 > >::type +arithmetic_action< divide_action >boost::units::unit< Dim1System1 >boost::units::unit< Dim2System2 >Partial specialization of return type trait for action unit<Dim1, System1> / unit<Dim2, System2>. boost::units::divide_typeof_helper< boost::units::unit< Dim1, System1 >, boost::units::unit< Dim2, System2 > >::type +arithmetic_action< plus_action >boost::units::absolute< Y >YPartial specialization of return type trait for action absolute<Y> + Y. boost::units::absolute< Y > +arithmetic_action< plus_action >Yboost::units::absolute< Y >Partial specialization of return type trait for action Y + absolute<Y>. boost::units::absolute< Y > +arithmetic_action< minus_action >boost::units::absolute< Y >YPartial specialization of return type trait for action absolute<Y> - Y. boost::units::absolute< Y > +arithmetic_action< minus_action >boost::units::absolute< Y >boost::units::absolute< Y >Partial specialization of return type trait for action absolute<Y> - absolute<Y>. Y +arithmetic_action< multiply_action >Tboost::units::absolute< boost::units::unit< DS > >Partial specialization of return type trait for action T * absolute<unit<D, S> >. boost::units::quantity< boost::units::absolute< boost::units::unit< D, S > >, T > +arithmetic_action< multiply_action >boost::units::absolute< boost::units::unit< DS > >TPartial specialization of return type trait for action absolute<unit<D, S> > * T. boost::units::quantity< boost::units::absolute< boost::units::unit< D, S > >, T > + + +boost::units::unit< DimSystem >boost::lambda::lambda_functor< Arg >boost::lambda::lambda_functor< boost::lambda::lambda_functor_base< boost::lambda::arithmetic_action< boost::lambda::multiply_action >, tuple< typename boost::lambda::const_copy_argument< const boost::units::unit< Dim, System > >::type, boost::lambda::lambda_functor< Arg > > > > +boost::units::unit< DimSystem >boost::lambda::lambda_functor< Arg >boost::lambda::lambda_functor< boost::lambda::lambda_functor_base< boost::lambda::arithmetic_action< boost::lambda::divide_action >, tuple< typename boost::lambda::const_copy_argument< const boost::units::unit< Dim, System > >::type, boost::lambda::lambda_functor< Arg > > > > +boost::lambda::lambda_functor< Arg >boost::units::unit< DimSystem >boost::lambda::lambda_functor< boost::lambda::lambda_functor_base< boost::lambda::arithmetic_action< boost::lambda::multiply_action >, tuple< boost::lambda::lambda_functor< Arg >, typename boost::lambda::const_copy_argument< const boost::units::unit< Dim, System > >::type > > > +boost::lambda::lambda_functor< Arg >boost::units::unit< DimSystem >boost::lambda::lambda_functor< boost::lambda::lambda_functor_base< boost::lambda::arithmetic_action< boost::lambda::divide_action >, tuple< boost::lambda::lambda_functor< Arg >, typename boost::lambda::const_copy_argument< const boost::units::unit< Dim, System > >::type > > > +boost::lambda::lambda_functor< Arg >boost::units::absolute< boost::units::unit< DimSystem > >boost::lambda::lambda_functor< boost::lambda::lambda_functor_base< boost::lambda::arithmetic_action< boost::lambda::multiply_action >, tuple< boost::lambda::lambda_functor< Arg >, typename boost::lambda::const_copy_argument< const boost::units::absolute< boost::units::unit< Dim, System > > >::type > > > +boost::units::absolute< boost::units::unit< DimSystem > >boost::lambda::lambda_functor< Arg >boost::lambda::lambda_functor< boost::lambda::lambda_functor_base< boost::lambda::arithmetic_action< boost::lambda::multiply_action >, tuple< typename boost::lambda::const_copy_argument< const boost::units::absolute< boost::units::unit< Dim, System > > >::type, boost::lambda::lambda_functor< Arg > > > > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const multiply_typeof_helper< boost::units::unit< Dim, System >, boost::lambda::lambda_functor< Arg > >::typeconst boost::units::unit< Dim, System > &const boost::lambda::lambda_functor< Arg > &Disambiguating overload for action unit<Dim, System> * lambda_functor<Arg> based on <boost/lambda/detail/operators.hpp>. +const divide_typeof_helper< boost::units::unit< Dim, System >, boost::lambda::lambda_functor< Arg > >::typeconst boost::units::unit< Dim, System > &const boost::lambda::lambda_functor< Arg > &Disambiguating overload for action unit<Dim, System> / lambda_functor<Arg> based on <boost/lambda/detail/operators.hpp>. +const multiply_typeof_helper< boost::lambda::lambda_functor< Arg >, boost::units::unit< Dim, System > >::typeconst boost::lambda::lambda_functor< Arg > &const boost::units::unit< Dim, System > &Disambiguating overload for action lambda_functor<Arg> * unit<Dim, System> based on <boost/lambda/detail/operators.hpp>. +const divide_typeof_helper< boost::lambda::lambda_functor< Arg >, boost::units::unit< Dim, System > >::typeconst boost::lambda::lambda_functor< Arg > &const boost::units::unit< Dim, System > &Disambiguating overload for action lambda_functor<Arg> / unit<Dim, System> based on <boost/lambda/detail/operators.hpp>. +const multiply_typeof_helper< boost::lambda::lambda_functor< Arg >, boost::units::absolute< boost::units::unit< Dim, System > > >::typeconst boost::lambda::lambda_functor< Arg > &const boost::units::absolute< boost::units::unit< Dim, System > > &Disambiguating overload for action lambda_functor<Arg> * absolute<unit<Dim, System> > based on <boost/lambda/detail/operators.hpp>. +const multiply_typeof_helper< boost::units::absolute< boost::units::unit< Dim, System > >, boost::lambda::lambda_functor< Arg > >::typeconst boost::units::absolute< boost::units::unit< Dim, System > > &const boost::lambda::lambda_functor< Arg > &Disambiguating overload for action absolute<unit<Dim, System> > * lambda_functor<Arg> based on <boost/lambda/detail/operators.hpp>. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+specialize std::numeric_limits for units. +::boost::units::quantity< UnitT >::boost::units::quantity< Unit, T > +const bool +const int +const int +const int +const bool +const bool +const bool +const int +const int +const int +const int +const int +const bool +const bool +const bool +const bool +const bool +const bool +const bool +const bool +const bool +const float_denorm_style +const float_round_style + +quantity_type() +quantity_type() +quantity_type() +quantity_type +quantity_type +quantity_type +quantity_type +quantity_type +quantity_type + + +
+
+ + +make_scaled_unit< typename reduce_unit< Unit >::type, Scale >::type +unit< Dimensionheterogeneous_system< heterogeneous_system_impl< UnitListDimensionOldScale > > >Scaleunit< Dimension, heterogeneous_system< heterogeneous_system_impl< UnitList, Dimension, typename mpl::times< OldScale, list< scale_list_dim< Scale >, dimensionless_type > >::type > > > +unit< Dimensionheterogeneous_system< heterogeneous_system_impl< UnitListDimensionOldScale > > >scale< Basestatic_rational< 0 > >unit< Dimension, heterogeneous_system< heterogeneous_system_impl< UnitList, Dimension, OldScale > > > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Metafunction returning a homogeneous system that can represent any combination of the base units. Metafunction make_system returning a homogeneous system that can represent any combination of the base units. There must be no way to represent any of the base units in terms of the others. make_system<foot_base_unit, meter_base_unit>::type is not allowed, for example. + +Metafunction returning a homogeneous system that can represent any combination of the base units. There must be no way to represent any of the base units in terms of the others. make_system<foot_base_unit, meter_base_unit>::type is not allowed, for example. unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Compile time operators and typeof helper classes. These operators declare the compile-time operators needed to support dimensional analysis algebra. They require the use of Boost.Typeof, emulation or native. Typeof helper classes define result type for heterogeneous operators on value types. These must be defined through specialization for powers and roots. + + +typedef(+typeof_::make< X >()) + + +typedef(-typeof_::make< X >()) + + +typedef(typeof_::make< X >()+typeof_::make< Y >()) + + +typedef(typeof_::make< X >()-typeof_::make< Y >()) + + +typedef(typeof_::make< X >()*typeof_::make< Y >()) + + +typedef(typeof_::make< X >()/typeof_::make< Y >()) + +A helper used by pow to raise a runtime object to a compile time known exponent. This template is intended to be specialized. All specializations must conform to the interface shown here. Exponent will be either the exponent passed to pow or static_rational<N> for and integer argument, N. specifies the result type unspecified + +typeconst BaseType &Carries out the runtime calculation. + +A helper used by root to take a root of a runtime object using a compile time known index. This template is intended to be specialized. All specializations must conform to the interface shown here. Index will be either the type passed to pow or static_rational<N> for and integer argument, N. specifies the result type unspecified + +typeconst Radicand &Carries out the runtime calculation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Raise values to exponents known at compile-time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +power_typeof_helper< Y, Rat >::typeconst Y &raise a value to a static_rational power. +power_typeof_helper< Y, static_rational< N > >::typeconst Y &raise a value to an integer power. +root_typeof_helper< Y, Rat >::typeconst Y &take the static_rational root of a value. +root_typeof_helper< Y, static_rational< N > >::typeconst Y &take the integer root of a value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +class declaration quantity< Unit, Y > +Y +Unit + +unspecified + + +const value_type &constant accessor to value can add a quantity of the same type if add_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const quantity< Unit2, YY > &can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const quantity< Unit2, YY > & +this_type &const quantity< Unit2, YY > & +this_type &const quantity< Unit2, YY > &can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const value_type &can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const value_type & + + +unspecified_null_pointer_constant_type +const this_type & +this_type &const this_type & +const quantity< Unit, YY > &unspecified0implicit conversion between value types is allowed if allowed for value types themselves +const quantity< Unit, YY > &unspecified0implicit conversion between value types is not allowed if not allowed for value types themselves +this_type &const quantity< Unit, YY > &implicit assignment between value types is allowed if allowed for value types themselves +const quantity< Unit2, YY > &unspecified0explicit conversion between different unit systems is allowed if implicit conversion is disallowed +const quantity< Unit2, YY > &unspecified0implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible +this_type &const quantity< Unit2, YY > &implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible + +this_typeconst value_type &Construct quantity directly from value_type (potentially dangerous). + + + +const value_type &int +BOOST_UNITS_DIMENSIONLESS_UNIT(System)YSpecialization for dimensionless quantities. Implicit conversions between unit systems are allowed because all dimensionless quantities are equivalent. Implicit construction and assignment from and conversion to value_type is also allowed. quantity< unit< dimensionless_type, System >, Y > +Y +System +dimensionless_type +unit< dimension_type, system_type > + +value_typeimplicit conversion to value_type is allowed +const value_type &constant accessor to value can add a quantity of the same type if add_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const this_type &can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const this_type &can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const value_type &can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type +this_type &const value_type & + + +value_typeconstruction from raw value_type is allowed +const this_type & +this_type &const this_type & +const quantity< unit< dimension_type, system_type >, YY > &unspecified0implicit conversion between value types is allowed if allowed for value types themselves +const quantity< unit< dimension_type, system_type >, YY > &unspecified0implicit conversion between value types is not allowed if not allowed for value types themselves +this_type &const quantity< unit< dimension_type, system_type >, YY > &implicit assignment between value types is allowed if allowed for value types themselves +const quantity< unit< dimensionless_type, System2 >, Y2 > &unspecified0unspecified0unspecified0implicit conversion between different unit systems is allowed +const quantity< unit< dimensionless_type, System2 >, Y2 > &unspecified0unspecified0unspecified0implicit conversion between different unit systems is allowed +const quantity< unit< dimensionless_type, System2 >, Y2 > &unspecified0conversion between different unit systems is explicit when the units are not equivalent. +this_type &const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > &implicit assignment between different unit systems is allowed + +this_typeconst value_type &Construct quantity directly from value_type. + +quantity< unit< Dim1System1 >X >quantity< unit< Dim2System2 >Y >for sun CC we need to invoke SFINAE at the top level, otherwise it will silently return int. quantity< unit< DimSystem >X >quantity< unit< DimSystem >Y >add_typeof_helper< X, Y >::type +unit< Dim, System > +quantity< unit_type, value_type > +quantity< unit< Dim1System1 >X >quantity< unit< Dim2System2 >Y >quantity< unit< DimSystem >X >quantity< unit< DimSystem >Y >subtract_typeof_helper< X, Y >::type +unit< Dim, System > +quantity< unit_type, value_type > + + + + + + + + + + + +XY &quantity_cast provides mutating access to underlying quantity value_type +Xconst Y & +voidquantity< Unit, Y > &quantity< Unit, Y > &swap quantities +divide_typeof_helper< unit< Dim, System >, Y >::typeconst unit< Dim, System > &const Y &runtime unit divided by scalar +multiply_typeof_helper< Y, unit< Dim, System > >::typeconst Y &const unit< Dim, System > &runtime scalar times unit +divide_typeof_helper< Y, unit< Dim, System > >::typeconst Y &const unit< Dim, System > &runtime scalar divided by unit +multiply_typeof_helper< quantity< Unit, X >, X >::typeconst quantity< Unit, X > &const X &runtime quantity times scalar +multiply_typeof_helper< X, quantity< Unit, X > >::typeconst X &const quantity< Unit, X > &runtime scalar times quantity +divide_typeof_helper< quantity< Unit, X >, X >::typeconst quantity< Unit, X > &const X &runtime quantity divided by scalar +divide_typeof_helper< X, quantity< Unit, X > >::typeconst X &const quantity< Unit, X > &runtime scalar divided by quantity +multiply_typeof_helper< unit< Dim1, System1 >, quantity< Unit2, Y > >::typeconst unit< Dim1, System1 > &const quantity< Unit2, Y > &runtime unit times quantity +divide_typeof_helper< unit< Dim1, System1 >, quantity< Unit2, Y > >::typeconst unit< Dim1, System1 > &const quantity< Unit2, Y > &runtime unit divided by quantity +multiply_typeof_helper< quantity< Unit1, Y >, unit< Dim2, System2 > >::typeconst quantity< Unit1, Y > &const unit< Dim2, System2 > &runtime quantity times unit +divide_typeof_helper< quantity< Unit1, Y >, unit< Dim2, System2 > >::typeconst quantity< Unit1, Y > &const unit< Dim2, System2 > &runtime quantity divided by unit +unary_plus_typeof_helper< quantity< Unit, Y > >::typeconst quantity< Unit, Y > &runtime unary plus quantity +unary_minus_typeof_helper< quantity< Unit, Y > >::typeconst quantity< Unit, Y > &runtime unary minus quantity +add_typeof_helper< quantity< Unit1, X >, quantity< Unit2, Y > >::typeconst quantity< Unit1, X > &const quantity< Unit2, Y > &runtime quantity plus quantity +subtract_typeof_helper< quantity< Unit1, X >, quantity< Unit2, Y > >::typeconst quantity< Unit1, X > &const quantity< Unit2, Y > &runtime quantity minus quantity +multiply_typeof_helper< quantity< Unit1, X >, quantity< Unit2, Y > >::typeconst quantity< Unit1, X > &const quantity< Unit2, Y > &runtime quantity times quantity +divide_typeof_helper< quantity< Unit1, X >, quantity< Unit2, Y > >::typeconst quantity< Unit1, X > &const quantity< Unit2, Y > &runtime quantity divided by quantity +boolconst quantity< Unit, X > &const quantity< Unit, Y > &runtime operator== +boolconst quantity< Unit, X > &const quantity< Unit, Y > &runtime operator!= +boolconst quantity< Unit, X > &const quantity< Unit, Y > &runtime operator< +boolconst quantity< Unit, X > &const quantity< Unit, Y > &runtime operator<= +boolconst quantity< Unit, X > &const quantity< Unit, Y > &runtime operator> +boolconst quantity< Unit, X > &const quantity< Unit, Y > &runtime operator>= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Returns a unique type for every unit. + +Returns a unique type for every unit. unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+10^3 Engineering & 2^10 binary scaling factors for autoprefixing. + +class representing a scaling factor such as 10^3 The exponent must be a static rational. Exponent +double +const long + +value_type + + + + + + + + + + +std::stringconst scale< Base, Exponent > & +std::stringconst scale< Base, Exponent > & + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +TA system that can represent any possible combination of units at the expense of not preserving information about how it was created. Do not create specializations of this template directly. Instead use reduce_unit and base_unit<...>::unit_type. traits template for unit names. +std::stringThe full name of the unit (returns BaseUnit::name() by default) +std::stringThe symbol for the base unit (Returns BaseUnit::symbol() by default) +BaseUnit::symbol(), for example "m" + +scaled_base_unit +scaled_base_unit_tag +S +Scale +S::dimension_type +unspecified + +std::string +std::string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+A convenience macro that allows definition of static constants in headers in an ODR-safe way. +
+
+Compile-time rational numbers and operators. + +Compile time absolute value. +integer_type + +This is an implementation of a compile time rational number, where static_rational<N,D> represents a rational number with numerator N and denominator D. Because of the potential for ambiguity arising from multiple equivalent values of static_rational (e.g. static_rational<6,2>==static_rational<3>), static rationals should always be accessed through static_rational<N,D>::type. Template specialization prevents instantiation of zero denominators (i.e. static_rational<N,0>). The following compile-time arithmetic operators are provided for static_rational variables only (no operators are defined between long and static_rational): +mpl::negate mpl::plus mpl::minus mpl::times mpl::divides +Neither static_power nor static_root are defined for static_rational. This is because template types may not be floating point values, while powers and roots of rational numbers can produce floating point values. unspecified +static_rational<N,D> reduced by GCD static_rational< Numerator, Denominator > +const integer_type +const integer_type + +integer_type +integer_type + + + + +long + + + + + + + + +divide_typeof_helper< T, T >::typeconst static_rational< N, D > &get decimal value of static_rational + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +class representing a model-dependent unit with no associated value (e.g. meters, Kelvin, feet, etc...) unit< Dim, System > +unit< Dim, System > +Dim +System + + + +const this_type & +this_type &const this_type & +unit< DimSystem >Returns a unique type for every unit. unspecified +unit< DimSystem >static_rational< ND >raise unit to a static_rational power unit< typename static_power< Dim, static_rational< N, D > >::type, typename static_power< System, static_rational< N, D > >::type > + +typeconst unit< Dim, System > & + +unit< DimSystem >static_rational< ND >take the static_rational root of a unit unit< typename static_root< Dim, static_rational< N, D > >::type, typename static_root< System, static_rational< N, D > >::type > + +typeconst unit< Dim, System > & + +unary_plus_typeof_helper< unit< Dim, System > >::typeconst unit< Dim, System > &unit runtime unary plus +unary_minus_typeof_helper< unit< Dim, System > >::typeconst unit< Dim, System > &unit runtime unary minus +add_typeof_helper< unit< Dim1, System1 >, unit< Dim2, System2 > >::typeconst unit< Dim1, System1 > &const unit< Dim2, System2 > &runtime add two units +subtract_typeof_helper< unit< Dim1, System1 >, unit< Dim2, System2 > >::typeconst unit< Dim1, System1 > &const unit< Dim2, System2 > &runtime subtract two units +multiply_typeof_helper< unit< Dim1, System1 >, unit< Dim2, System2 > >::typeconst unit< Dim1, System1 > &const unit< Dim2, System2 > &runtime multiply two units +divide_typeof_helper< unit< Dim1, System1 >, unit< Dim2, System2 > >::typeconst unit< Dim1, System1 > &const unit< Dim2, System2 > &runtime divide two units +boolconst unit< Dim1, System1 > &const unit< Dim2, System2 > &unit runtime operator== +boolconst unit< Dim1, System1 > &const unit< Dim2, System2 > &unit runtime operator!= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+Forward declarations of library components. Forward declarations of units library - dimensions, systems, quantity and string components.
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/doc/us_base_units_reference.xml b/tools/boost_1_65_1/libs/units/doc/us_base_units_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..6d2c3636ea14bbcb11ee27d57d529bf6fb6c2ca6 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/doc/us_base_units_reference.xml @@ -0,0 +1,302 @@ + +US Base Units Reference
+ + +us::cup_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational<-1 > > > + + + +
+
+ + +us::dram_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 16, static_rational<-2 > > > + + + +
+
+ + +us::fluid_dram_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational<-7 > > > + + + +
+
+ + +us::fluid_ounce_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 16, static_rational<-1 > > > + + + +
+
+ + +us::foot_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 3, static_rational<-1 > > > + + + +
+
+ + +us::gallon_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational< 3 > > > + + + +
+
+ + +us::gill_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational<-2 > > > + + + +
+
+ + +us::grain_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 7000, static_rational<-1 > > > + + + +
+
+ + +us::hundredweight_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 100, static_rational< 1 > > > + + + +
+
+ + +us::inch_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 36, static_rational<-1 > > > + + + +
+
+ + +us::mil_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 36000, static_rational<-1 > > > + + + +
+
+ + +us::mile_base_unit +const char * +const char * + + +scaled_base_unit< yard_base_unit, scale< 1760, static_rational< 1 > > > + + + +
+
+ + +us::minim_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 7680, static_rational<-1 > > > + + + +
+
+ + +us::ounce_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 2, static_rational<-4 > > > + + + +
+
+ + + +boost::units::base_unit< pint_base_unit, si::volume::dimension_type,-503 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< pound_base_unit, cgs::gram_base_unit::dimension_type,-502 > +const char * +const char * + + + + +
+
+ + + +boost::units::base_unit< pound_force_base_unit, si::force::dimension_type,-600 > +const char * +const char * + + + + +
+
+ + +us::quart_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational< 1 > > > + + + +
+
+ + +us::tablespoon_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 2, static_rational<-5 > > > + + + +
+
+ + +us::teaspoon_base_unit +const char * +const char * + + +scaled_base_unit< pint_base_unit, scale< 96, static_rational<-1 > > > + + + +
+
+ + +us::ton_base_unit +const char * +const char * + + +scaled_base_unit< pound_base_unit, scale< 2000, static_rational< 1 > > > + + + +
+
+ + + +boost::units::base_unit< yard_base_unit, si::meter_base_unit::dimension_type,-501 > +const char * +const char * + + + + +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/units/example/Jamfile.v2 b/tools/boost_1_65_1/libs/units/example/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..b918205aceb7b3f6f9b5f49f27fd576edca6f3ac --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/Jamfile.v2 @@ -0,0 +1,25 @@ +# Jamfile.v2 +# +# Copyright (c) 2007-2008 +# Steven Watanabe +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt + +import testing ; +import path ; + +project boost/units/example : + : requirements $(BOOST_ROOT) ../../.. all +; + +files = [ path.glob . : *.cpp : performance.* runtime_unit.* ] ; + +for local file in $(files) +{ + run $(file) ; +} + +compile performance.cpp ; +run runtime_unit.cpp : + +#include +#include +#include +#include +#include + +struct byte_base_unit : boost::units::base_unit +{ + static const char* name() { return("byte"); } + static const char* symbol() { return("b"); } +}; + +struct thing_base_unit : boost::units::base_unit +{ + static const char* name() { return("thing"); } + static const char* symbol() { return(""); } +}; + +struct euro_base_unit : boost::units::base_unit +{ + static const char* name() { return("EUR"); } + static const char* symbol() { return("€"); } +}; + +int main() +{ + using std::cout; + using std::endl; + + using namespace boost::units; + using namespace boost::units::si; + + //[autoprefixes_snippet_1 + using boost::units::binary_prefix; + using boost::units::engineering_prefix; + using boost::units::no_prefix; + + quantity l = 2.345 * meters; // A quantity of length, in units of meters. + cout << engineering_prefix << l << endl; // Outputs "2.345 m". + l = 1000.0 * l; // Increase it by 1000, so expect a k prefix. + // Note that a double 1000.0 is required - an integer will fail to compile. + cout << engineering_prefix << l << endl; // Output autoprefixed with k to "2.345 km". + + quantity e = kilograms * pow<2>(l / seconds); // A quantity of energy. + cout << engineering_prefix << e << endl; // 5.49902 MJ + cout << name_format << engineering_prefix << e << endl; // 5.49902 megaJoule + //] [/autoprefixes_snippet_1] + + //[autoprefixes_snippet_2 + // Don't forget that the units name or symbol format specification is persistent. + cout << symbol_format << endl; // Resets the format to the default symbol format. + + quantity b = 2048. * byte_base_unit::unit_type(); + cout << engineering_prefix << b << endl; // 2.048 kb + cout << symbol_format << binary_prefix << b << endl; // "2 Kib" + //] [/autoprefixes_snippet_2] + + // Note that scalar dimensionless values are *not* prefixed automatically by the engineering_prefix or binary_prefix iostream manipulators. + //[autoprefixes_snippet_3 + const double s1 = 2345.6; + const long x1 = 23456; + cout << engineering_prefix << s1 << endl; // 2345.6 + cout << engineering_prefix << x1 << endl; // 23456 + + cout << binary_prefix << s1 << endl; // 2345.6 + cout << binary_prefix << x1 << endl; // 23456 + //] [/autoprefixes_snippet_3] + + //[autoprefixes_snippet_4 + const length L; // A unit of length (but not a quantity of length). + cout << L << endl; // Default length unit is meter, + // but default is symbol format so output is just "m". + cout << name_format << L << endl; // default length name is "meter". + //] [/autoprefixes_snippet_4] + + //[autoprefixes_snippet_5 + no_prefix(cout); // Clear any prefix flag. + cout << no_prefix << endl; // Clear any prefix flag using `no_prefix` manipulator. + //] [/autoprefixes_snippet_5] + + //[autoprefixes_snippet_6 + cout << boost::units::get_autoprefix(cout) << endl; // 8 is `autoprefix_binary` from `enum autoprefix_mode`. + cout << boost::units::get_format(cout) << endl; // 1 is `name_fmt` from `enum format_mode`. + //] [/autoprefixes_snippet_6] + + + quantity t = 2048. * thing_base_unit::unit_type(); + cout << name_format << engineering_prefix << t << endl; // 2.048 kilothing + cout << symbol_format << engineering_prefix << t << endl; // 2.048 k + + cout << binary_prefix << t << endl; // "2 Ki" + + quantity ce = 2048. * euro_base_unit::unit_type(); + cout << name_format << engineering_prefix << ce << endl; // 2.048 kiloEUR + cout << symbol_format << engineering_prefix << ce << endl; // 2.048 k€ + + + return 0; +} // int main() + diff --git a/tools/boost_1_65_1/libs/units/example/complex.cpp b/tools/boost_1_65_1/libs/units/example/complex.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d03eb3dfbd554889da0dbf513aacd4176be1b129 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/complex.cpp @@ -0,0 +1,416 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief complex.cpp + +\details +Demonstrate a complex number class that functions correctly with quantities. + +Output: +@verbatim + +//[complex_output_1 ++L = 2 + 1 i m +-L = -2 + -1 i m +L+L = 4 + 2 i m +L-L = 0 + 0 i m +L*L = 3 + 4 i m^2 +L/L = 1 + 0 i dimensionless +L^3 = 2 + 11 i m^3 +L^(3/2) = 2.56713 + 2.14247 i m^(3/2) +3vL = 1.29207 + 0.201294 i m^(1/3) +(3/2)vL = 1.62894 + 0.520175 i m^(2/3) +//] + +//[complex_output_2 ++L = 2 m + 1 m i +-L = -2 m + -1 m i +L+L = 4 m + 2 m i +L-L = 0 m + 0 m i +L*L = 3 m^2 + 4 m^2 i +L/L = 1 dimensionless + 0 dimensionless i +L^3 = 2 m^3 + 11 m^3 i +L^(3/2) = 2.56713 m^(3/2) + 2.14247 m^(3/2) i +3vL = 1.29207 m^(1/3) + 0.201294 m^(1/3) i +(3/2)vL = 1.62894 m^(2/3) + 0.520175 m^(2/3) i +//] + +@endverbatim +**/ + +#include +#include +#include + +#include + +#include +#include +#include + +#include "test_system.hpp" + +//[complex_class_snippet_1 +namespace boost { + +namespace units { + +/// replacement complex class +template +class complex +{ + public: + typedef complex this_type; + + complex(const T& r = 0,const T& i = 0) : r_(r),i_(i) { } + complex(const this_type& source) : r_(source.r_),i_(source.i_) { } + + this_type& operator=(const this_type& source) + { + if (this == &source) return *this; + + r_ = source.r_; + i_ = source.i_; + + return *this; + } + + T& real() { return r_; } + T& imag() { return i_; } + + const T& real() const { return r_; } + const T& imag() const { return i_; } + + this_type& operator+=(const T& val) + { + r_ += val; + return *this; + } + + this_type& operator-=(const T& val) + { + r_ -= val; + return *this; + } + + this_type& operator*=(const T& val) + { + r_ *= val; + i_ *= val; + return *this; + } + + this_type& operator/=(const T& val) + { + r_ /= val; + i_ /= val; + return *this; + } + + this_type& operator+=(const this_type& source) + { + r_ += source.r_; + i_ += source.i_; + return *this; + } + + this_type& operator-=(const this_type& source) + { + r_ -= source.r_; + i_ -= source.i_; + return *this; + } + + this_type& operator*=(const this_type& source) + { + *this = *this * source; + return *this; + } + + this_type& operator/=(const this_type& source) + { + *this = *this / source; + return *this; + } + + private: + T r_,i_; +}; + +} + +} + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::complex, 1) + +#endif + +namespace boost { + +namespace units { + +template +complex::type> +operator+(const complex& x) +{ + typedef typename unary_plus_typeof_helper::type type; + + return complex(x.real(),x.imag()); +} + +template +complex::type> +operator-(const complex& x) +{ + typedef typename unary_minus_typeof_helper::type type; + + return complex(-x.real(),-x.imag()); +} + +template +complex::type> +operator+(const complex& x,const complex& y) +{ + typedef typename boost::units::add_typeof_helper::type type; + + return complex(x.real()+y.real(),x.imag()+y.imag()); +} + +template +complex::type> +operator-(const complex& x,const complex& y) +{ + typedef typename boost::units::subtract_typeof_helper::type type; + + return complex(x.real()-y.real(),x.imag()-y.imag()); +} + +template +complex::type> +operator*(const complex& x,const complex& y) +{ + typedef typename boost::units::multiply_typeof_helper::type type; + + return complex(x.real()*y.real() - x.imag()*y.imag(), + x.real()*y.imag() + x.imag()*y.real()); + +// fully correct implementation has more complex return type +// +// typedef typename boost::units::multiply_typeof_helper::type xy_type; +// +// typedef typename boost::units::add_typeof_helper< +// xy_type,xy_type>::type xy_plus_xy_type; +// typedef typename +// boost::units::subtract_typeof_helper::type +// xy_minus_xy_type; +// +// BOOST_STATIC_ASSERT((boost::is_same::value == true)); +// +// return complex(x.real()*y.real()-x.imag()*y.imag(), +// x.real()*y.imag()+x.imag()*y.real()); +} + +template +complex::type> +operator/(const complex& x,const complex& y) +{ + // naive implementation of complex division + typedef typename boost::units::divide_typeof_helper::type type; + + return complex((x.real()*y.real()+x.imag()*y.imag())/ + (y.real()*y.real()+y.imag()*y.imag()), + (x.imag()*y.real()-x.real()*y.imag())/ + (y.real()*y.real()+y.imag()*y.imag())); + +// fully correct implementation has more complex return type +// +// typedef typename boost::units::multiply_typeof_helper::type xy_type; +// typedef typename boost::units::multiply_typeof_helper::type yy_type; +// +// typedef typename boost::units::add_typeof_helper::type +// xy_plus_xy_type; +// typedef typename boost::units::subtract_typeof_helper< +// xy_type,xy_type>::type xy_minus_xy_type; +// +// typedef typename boost::units::divide_typeof_helper< +// xy_plus_xy_type,yy_type>::type xy_plus_xy_over_yy_type; +// typedef typename boost::units::divide_typeof_helper< +// xy_minus_xy_type,yy_type>::type xy_minus_xy_over_yy_type; +// +// BOOST_STATIC_ASSERT((boost::is_same::value == true)); +// +// return complex( +// (x.real()*y.real()+x.imag()*y.imag())/ +// (y.real()*y.real()+y.imag()*y.imag()), +// (x.imag()*y.real()-x.real()*y.imag())/ +// (y.real()*y.real()+y.imag()*y.imag())); +} + +template +complex +pow(const complex& x,const Y& y) +{ + std::complex tmp(x.real(),x.imag()); + + tmp = std::pow(tmp,y); + + return complex(tmp.real(),tmp.imag()); +} + +template +std::ostream& operator<<(std::ostream& os,const complex& val) +{ + os << val.real() << " + " << val.imag() << " i"; + + return os; +} + +/// specialize power typeof helper for complex +template +struct power_typeof_helper,static_rational > +{ + typedef complex< + typename power_typeof_helper >::type + > type; + + static type value(const complex& x) + { + const static_rational rat; + + const Y m = Y(rat.numerator())/Y(rat.denominator()); + + return boost::units::pow(x,m); + } +}; + +/// specialize root typeof helper for complex +template +struct root_typeof_helper,static_rational > +{ + typedef complex< + typename root_typeof_helper >::type + > type; + + static type value(const complex& x) + { + const static_rational rat; + + const Y m = Y(rat.denominator())/Y(rat.numerator()); + + return boost::units::pow(x,m); + } +}; + +/// specialize power typeof helper for complex > +template +struct power_typeof_helper >,static_rational > +{ + typedef typename + power_typeof_helper >::type value_type; + typedef typename + power_typeof_helper >::type unit_type; + typedef quantity quantity_type; + typedef complex type; + + static type value(const complex >& x) + { + const complex tmp = + pow >(complex(x.real().value(), + x.imag().value())); + + return type(quantity_type::from_value(tmp.real()), + quantity_type::from_value(tmp.imag())); + } +}; + +/// specialize root typeof helper for complex > +template +struct root_typeof_helper >,static_rational > +{ + typedef typename + root_typeof_helper >::type value_type; + typedef typename + root_typeof_helper >::type unit_type; + typedef quantity quantity_type; + typedef complex type; + + static type value(const complex >& x) + { + const complex tmp = + root >(complex(x.real().value(), + x.imag().value())); + + return type(quantity_type::from_value(tmp.real()), + quantity_type::from_value(tmp.imag())); + } +}; + +} // namespace units + +} // namespace boost +//] + +int main(void) +{ + using namespace boost::math; + using namespace boost::units; + using namespace boost::units::test; + + { + //[complex_snippet_1 + typedef quantity > length_dimension; + + length_dimension L(complex(2.0,1.0)*meters); + //] + + std::cout << "+L = " << +L << std::endl + << "-L = " << -L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl + << "L*L = " << L*L << std::endl + << "L/L = " << L/L << std::endl + << "L^3 = " << pow<3>(L) << std::endl + << "L^(3/2) = " << pow< static_rational<3,2> >(L) << std::endl + << "3vL = " << root<3>(L) << std::endl + << "(3/2)vL = " << root< static_rational<3,2> >(L) << std::endl + << std::endl; + } + + { + //[complex_snippet_2 + typedef complex > length_dimension; + + length_dimension L(2.0*meters,1.0*meters); + //] + + std::cout << "+L = " << +L << std::endl + << "-L = " << -L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl + << "L*L = " << L*L << std::endl + << "L/L = " << L/L << std::endl + << "L^3 = " << pow<3>(L) << std::endl + << "L^(3/2) = " << pow< static_rational<3,2> >(L) << std::endl + << "3vL = " << root<3>(L) << std::endl + << "(3/2)vL = " << root< static_rational<3,2> >(L) << std::endl + << std::endl; + } + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/composite_output.cpp b/tools/boost_1_65_1/libs/units/example/composite_output.cpp new file mode 100644 index 0000000000000000000000000000000000000000..022ea4e602b24e2d858263d28d36addf01c23bae --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/composite_output.cpp @@ -0,0 +1,116 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief composite_output.cpp + +\details An example of textual representations of units. + +Output: +@verbatim + +//[conversion_output_output +2 dyn +2 dyn +2 dyne +cm g s^-1 +centimeter gram second^-1 +dyn +dyne +n +nano +n +nano +F +farad +1 F +1 farad +nF +nanofarad +1 nF +1 nanofarad +n(cm g s^-1) +nano(centimeter gram second^-1) +//] + +@endverbatim +**/ +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +namespace boost { + +namespace units { + +//[composite_output_snippet_1 + +std::string name_string(const cgs::force&) +{ + return "dyne"; +} + +std::string symbol_string(const cgs::force&) +{ + return "dyn"; +} + +//] + +} + +} + +int main() +{ + using namespace boost::units; + using boost::units::cgs::centimeter; + using boost::units::cgs::gram; + using boost::units::cgs::second; + using boost::units::cgs::dyne; + + //[composite_output_snippet_2] + std::cout << 2.0 * dyne << std::endl + << symbol_format << 2.0 * dyne << std::endl + << name_format << 2.0 * dyne << std::endl + << symbol_format << gram*centimeter/second << std::endl + << name_format << gram*centimeter/second << std::endl + << symbol_format << gram*centimeter/(second*second) << std::endl + << name_format << gram*centimeter/(second*second) << std::endl + << symbol_string(scale<10,static_rational<-9> >()) << std::endl + << name_string(scale<10,static_rational<-9> >()) << std::endl + << symbol_format << si::nano << std::endl + << name_format << si::nano << std::endl + << symbol_format << si::farad << std::endl + << name_format << si::farad << std::endl + << symbol_format << 1.0*si::farad << std::endl + << name_format << 1.0*si::farad << std::endl + << symbol_format << si::farad*si::nano << std::endl + << name_format << si::farad*si::nano << std::endl + << symbol_format << 1.0*si::farad*si::nano << std::endl + << name_format << 1.0*si::farad*si::nano << std::endl + << symbol_format << si::nano*gram*centimeter/second << std::endl + << name_format << si::nano*gram*centimeter/second << std::endl; + //] + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/conversion.cpp b/tools/boost_1_65_1/libs/units/example/conversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0299dfdcf9a9d26149bff3248b690055d957e335 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/conversion.cpp @@ -0,0 +1,124 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief conversion.cpp + +\details +Test explicit and implicit unit conversion. + +Output: +@verbatim + +//[conversion_output_1 +L1 = 2 m +L2 = 2 m +L3 = 2 m +L4 = 200 cm +L5 = 5 m +L6 = 4 m +L7 = 200 cm +//] + +//[conversion_output_2 +volume (m^3) = 1 m^3 +volume (cm^3) = 1e+06 cm^3 +volume (m^3) = 1 m^3 + +energy (joules) = 1 J +energy (ergs) = 1e+07 erg +energy (joules) = 1 J + +velocity (2 m/s) = 2 m s^-1 +velocity (2 cm/s) = 0.02 m s^-1 +//] + +@endverbatim +**/ + +#include + +#include +#include +#include +#include +#include +#include + +using namespace boost::units; + +int main() +{ + // test quantity_cast + { + // implicit value_type conversions + //[conversion_snippet_1 + quantity L1 = quantity(int(2.5)*si::meters); + quantity L2(quantity(2.5*si::meters)); + //] + + //[conversion_snippet_3 + quantity L3 = static_cast >(L1); + //] + + //[conversion_snippet_4 + quantity L4 = static_cast >(L1); + //] + + quantity L5(4*si::meters), + L6(5*si::meters); + quantity L7(L1); + + swap(L5,L6); + + std::cout << "L1 = " << L1 << std::endl + << "L2 = " << L2 << std::endl + << "L3 = " << L3 << std::endl + << "L4 = " << L4 << std::endl + << "L5 = " << L5 << std::endl + << "L6 = " << L6 << std::endl + << "L7 = " << L7 << std::endl + << std::endl; + } + + // test explicit unit system conversion + { + //[conversion_snippet_5 + quantity vs(1.0*pow<3>(si::meter)); + quantity vc(vs); + quantity vs2(vc); + + quantity es(1.0*si::joule); + quantity ec(es); + quantity es2(ec); + + quantity v1 = 2.0*si::meters/si::second, + v2(2.0*cgs::centimeters/cgs::second); + //] + + std::cout << "volume (m^3) = " << vs << std::endl + << "volume (cm^3) = " << vc << std::endl + << "volume (m^3) = " << vs2 << std::endl + << std::endl; + + std::cout << "energy (joules) = " << es << std::endl + << "energy (ergs) = " << ec << std::endl + << "energy (joules) = " << es2 << std::endl + << std::endl; + + std::cout << "velocity (2 m/s) = " << v1 << std::endl + << "velocity (2 cm/s) = " << v2 << std::endl + << std::endl; + } + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/conversion_factor.cpp b/tools/boost_1_65_1/libs/units/example/conversion_factor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4401e4774393b07755b019f4c5ae2f6e740769ee --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/conversion_factor.cpp @@ -0,0 +1,76 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief conversion_factor.cpp + +\details An example of using conversion_factor. + +Output: +@verbatim + +//[conversion_factor_output +1e-005 +100 +1e-005 +100 +0.01 +//] + +@endverbatim +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost; + using namespace boost::units; + + //[conversion_factor_snippet_1 + + double dyne_to_newton = + conversion_factor(cgs::dyne,si::newton); + std::cout << dyne_to_newton << std::endl; + + double force_over_mass_conversion = + conversion_factor(si::newton/si::kilogram,cgs::dyne/cgs::gram); + std::cout << force_over_mass_conversion << std::endl; + + double momentum_conversion = + conversion_factor(cgs::momentum(),si::momentum()); + std::cout << momentum_conversion << std::endl; + + double momentum_over_mass_conversion = + conversion_factor(si::momentum()/si::mass(),cgs::momentum()/cgs::gram); + std::cout << momentum_over_mass_conversion << std::endl; + + double acceleration_conversion = + conversion_factor(cgs::gal,si::meter_per_second_squared); + std::cout << acceleration_conversion << std::endl; + + //] + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/dimension.cpp b/tools/boost_1_65_1/libs/units/example/dimension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7f7ffb6bca29dac21e47dbc67ba564b082206b7e --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/dimension.cpp @@ -0,0 +1,117 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief dimension.cpp + +\details +Test dimension list manipulation. + +Output: +@verbatim + +//[dimension_output +length_dimension = list >, dimensionless_type> +mass_dimension = list >, dimensionless_type> +time_dimension = list >, dimensionless_type> +energy_dimension = list >, list >, list >, dimensionless_type> > > +LM_type = list >, list >, dimensionless_type> > +L_T_type = list >, list >, dimensionless_type> > +V_type = list >, list >, dimensionless_type> > +//] + +@endverbatim +**/ + +#include +#include + +#include + +#include + +#include "test_system.hpp" + +namespace mpl = boost::mpl; + +int main(void) +{ + using namespace boost::units; + + BOOST_MPL_ASSERT((boost::is_same< + length_dimension, + mpl::push_front< + dimensionless_type, + dim > + >::type + >)); + BOOST_MPL_ASSERT((boost::is_same< + mass_dimension, + mpl::push_front< + dimensionless_type, + dim > + >::type + >)); + BOOST_MPL_ASSERT((boost::is_same > >::type, + dim > >::type, + dim > >::type>)); + + std::cout << "length_dimension = " + << simplify_typename(length_dimension()) << std::endl + << "mass_dimension = " + << simplify_typename(mass_dimension()) << std::endl + << "time_dimension = " + << simplify_typename(time_dimension()) << std::endl + << "energy_dimension = " + << simplify_typename(energy_dimension()) << std::endl; + + //[dimension_snippet_1 + typedef mpl::times::type LM_type; + typedef mpl::divides::type L_T_type; + typedef static_root< + mpl::divides::type, + static_rational<2> + >::type V_type; + //] + + BOOST_MPL_ASSERT((boost::is_same > >::type, + dim > >::type>)); + + BOOST_MPL_ASSERT((boost::is_same > >::type, + dim > >::type>)); + + BOOST_MPL_ASSERT((boost::is_same > >::type, + dim > >::type>)); + + std::cout << "LM_type = " << simplify_typename(LM_type()) << std::endl + << "L_T_type = " << simplify_typename(L_T_type()) << std::endl + << "V_type = " << simplify_typename(V_type()) << std::endl; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/heterogeneous_unit.cpp b/tools/boost_1_65_1/libs/units/example/heterogeneous_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7a4f1123471a27d9fbcfa0047dad83d73167d52c --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/heterogeneous_unit.cpp @@ -0,0 +1,87 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief heterogeneous_unit.cpp + +\details +Test heterogeneous units and quantities. + +Output: +@verbatim + +//[heterogeneous_unit_output_1 +1.5 m +1 g +1.5 m g +1.5 m g^-1 + +1 N +1 kg s^-2 + +1 cm kg s^-2 +1 cm m^-1 kg s^-2 +//] + +//[heterogeneous_unit_output_2 +1.5 cm m +0.015 m^2 +//] + +@endverbatim +**/ + +#define MCS_USE_DEMANGLING +//#define MCS_USE_BOOST_REGEX_DEMANGLING + +#include + +#include +#include +#include +#include +#include +#include + +using namespace boost::units; + +int main() +{ + //[heterogeneous_unit_snippet_1 + quantity L(1.5*si::meter); + quantity M(1.0*cgs::gram); + + std::cout << L << std::endl + << M << std::endl + << L*M << std::endl + << L/M << std::endl + << std::endl; + + std::cout << 1.0*si::meter*si::kilogram/pow<2>(si::second) << std::endl + << 1.0*si::meter*si::kilogram/pow<2>(si::second)/si::meter + << std::endl << std::endl; + + std::cout << 1.0*cgs::centimeter*si::kilogram/pow<2>(si::second) << std::endl + << 1.0*cgs::centimeter*si::kilogram/pow<2>(si::second)/si::meter + << std::endl << std::endl; + //] + + //[heterogeneous_unit_snippet_2 + quantity A(1.5*si::meter*cgs::centimeter); + + std::cout << 1.5*si::meter*cgs::centimeter << std::endl + << A << std::endl + << std::endl; + //] + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/information.cpp b/tools/boost_1_65_1/libs/units/example/information.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0efc01a1747b09c4ce0461fc1f54cd59e2962a79 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/information.cpp @@ -0,0 +1,98 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2014 Erik Erlandson +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//#include + +/** +\file + +\brief information.cpp + +\details +Demonstrate information unit system. + +Output: +@verbatim +bytes= 1.25e+08 B +bits= 8e+06 b +nats= 4605.17 nat +1024 bytes in a kibi-byte +8.38861e+06 bits in a mebi-byte +0.000434294 hartleys in a milli-nat +entropy in bits= 1 b +entropy in nats= 0.693147 nat +entropy in hartleys= 0.30103 Hart +entropy in shannons= 1 Sh +entropy in bytes= 0.125 B +@endverbatim +**/ + +#include +#include +using std::cout; +using std::endl; + +#include +#include +#include +namespace bu = boost::units; +using bu::quantity; +using bu::conversion_factor; + +// SI prefixes +#include +namespace si = boost::units::si; + +// information unit system +#include +using namespace bu::information; + +// Define a function for the entropy of a bernoulli trial. +// The formula is computed using natural log, so the units are in nats. +// The user provides the desired return unit, the only restriction being that it +// must be a unit of information. Conversion to the requested return unit is +// accomplished automatically by the boost::units library. +template +quantity > +bernoulli_entropy(double p, const bu::unit&) { + typedef bu::unit requested_unit; + return quantity((-(p*log(p) + (1-p)*log(1-p)))*nats); +} + +int main(int argc, char** argv) { + // a quantity of information (default in units of bytes) + quantity nbytes(1 * si::giga * bit); + cout << "bytes= " << nbytes << endl; + + // a quantity of information, stored as bits + quantity nbits(1 * si::mega * byte); + cout << "bits= " << nbits << endl; + + // a quantity of information, stored as nats + quantity nnats(2 * si::kilo * hartleys); + cout << "nats= " << nnats << endl; + + // how many bytes are in a kibi-byte? + cout << conversion_factor(kibi * byte, byte) << " bytes in a kibi-byte" << endl; + + // how many bits are in a mebi-byte? + cout << conversion_factor(mebi * byte, bit) << " bits in a mebi-byte" << endl; + + // how many hartleys are in a milli-nat? + cout << conversion_factor(si::milli * nat, hartley) << " hartleys in a milli-nat" << endl; + + // compute the entropy of a fair coin flip, in various units of information: + cout << "entropy in bits= " << bernoulli_entropy(0.5, bits) << endl; + cout << "entropy in nats= " << bernoulli_entropy(0.5, nats) << endl; + cout << "entropy in hartleys= " << bernoulli_entropy(0.5, hartleys) << endl; + cout << "entropy in shannons= " << bernoulli_entropy(0.5, shannons) << endl; + cout << "entropy in bytes= " << bernoulli_entropy(0.5, bytes) << endl; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/kitchen_sink.cpp b/tools/boost_1_65_1/libs/units/example/kitchen_sink.cpp new file mode 100644 index 0000000000000000000000000000000000000000..211d981931367e41e4a538904242fa7e2ba27acc --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/kitchen_sink.cpp @@ -0,0 +1,540 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief kitchen_sink.cpp + +\details +More extensive quantity tests. + +Output: +@verbatim + +//[kitchen_sink_output_1 +S1 : 2 +X1 : 2 +X2 : (4/3) +U1 : N +U2 : J +Q1 : 1 N +Q2 : 2 J +//] + +//[kitchen_sink_output_2 +U1*S1 : 2 N +S1*U1 : 2 N +U1/S1 : 0.5 N +S1/U1 : 2 m^-1 kg^-1 s^2 +//] + +//[kitchen_sink_output_3 +U1+U1 : N +U1-U1 : N +U1*U1 : m^2 kg^2 s^-4 +U1/U1 : dimensionless +U1*U2 : m^3 kg^2 s^-4 +U1/U2 : m^-1 +U1^X : m^2 kg^2 s^-4 +X1vU1 : m^(1/2) kg^(1/2) s^-1 +U1^X2 : m^(4/3) kg^(4/3) s^(-8/3) +X2vU1 : m^(3/4) kg^(3/4) s^(-3/2) +//] + +//[kitchen_sink_output_4 +Q1*S1 : 2 N +S1*Q1 : 2 N +Q1/S1 : 0.5 N +S1/Q1 : 2 m^-1 kg^-1 s^2 +//] + +//[kitchen_sink_output_5 +U1*Q1 : 1 m^2 kg^2 s^-4 +Q1*U1 : 1 m^2 kg^2 s^-4 +U1/Q1 : 1 dimensionless +Q1/U1 : 1 dimensionless +//] + +//[kitchen_sink_output_6 ++Q1 : 1 N +-Q1 : -1 N +Q1+Q1 : 2 N +Q1-Q1 : 0 N +Q1*Q1 : 1 m^2 kg^2 s^-4 +Q1/Q1 : 1 dimensionless +Q1*Q2 : 2 m^3 kg^2 s^-4 +Q1/Q2 : 0.5 m^-1 +Q1^X1 : 1 m^2 kg^2 s^-4 +X1vQ1 : 1 m^(1/2) kg^(1/2) s^-1 +Q1^X2 : 1 m^(4/3) kg^(4/3) s^(-8/3) +X2vQ1 : 1 m^(3/4) kg^(3/4) s^(-3/2) +//] + +//[kitchen_sink_output_7 +l1 == l2 false +l1 != l2 true +l1 <= l2 true +l1 < l2 true +l1 >= l2 false +l1 > l2 false +//] + +dimless = 1 + +//[kitchen_sink_output_8 +v1 = 2 m s^-1 +//] + +//[kitchen_sink_output_9 +F = 1 N +dx = 1 m +E = 1 J +//] + +//[kitchen_sink_output_10 +r = 5e-07 m +P = 101325 Pa +V = 5.23599e-19 m^3 +T = 310 K +n = 2.05835e-17 mol +R = 8.314472 m^2 kg s^-2 K^-1 mol^-1 (rel. unc. = 1.8e-06) +//] + +//[kitchen_sink_output_11 +theta = 0.375 rd +sin(theta) = 0.366273 dimensionless +asin(sin(theta)) = 0.375 rd +//] + +//[kitchen_sink_output_12 +V = (12.5,0) V +I = (3,4) A +Z = (1.5,-2) Ohm +I*Z = (12.5,0) V +//] + +//[kitchen_sink_output_13 +x+y-w = 0.48(+/-0.632772) m +w*x = 9.04(+/-0.904885) m^2 +x/y = 0.666667(+/-0.149071) dimensionless +//] + +//[kitchen_sink_output_14 +w*y^2/(u*x)^2 = 10.17(+/-3.52328) m^-1 +w/(u*x)^(1/2) = 3.19612(+/-0.160431) dimensionless +//] + +//[kitchen_sink_output_15 +I*w = m^2 kg s^-1 rad^-1 +I*w/L = dimensionless +I*w^2 = J +//] + +//[kitchen_sink_output_16 +1 F +1 kat +1 S +1 C +1 V +1 J +1 N +1 Hz +1 lx +1 H +1 lm +1 Wb +1 T +1 W +1 Pa +1 Ohm +//] + +//[kitchen_sink_output_18 +1 farad +1 katal +1 siemen +1 coulomb +1 volt +1 joule +1 newton +1 hertz +1 lux +1 henry +1 lumen +1 weber +1 tesla +1 watt +1 pascal +1 ohm +//] + +@endverbatim +**/ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "measurement.hpp" + +namespace boost { + +namespace units { + +//[kitchen_sink_function_snippet_3 +/// the physical definition of work - computed for an arbitrary unit system +template +quantity,Y> +work(quantity,Y> F, + quantity,Y> dx) +{ + return F*dx; +} +//] + +//[kitchen_sink_function_snippet_4 +/// the ideal gas law in si units +template +quantity +idealGasLaw(const quantity& P, + const quantity& V, + const quantity& T) +{ + using namespace boost::units::si; + + using namespace constants::codata; + return (P*V/(R*T)); +} +//] + +} // namespace units + +} // namespace boost + +int main() +{ + using namespace boost::units; + using namespace boost::units::si; + + { + //[kitchen_sink_snippet_1 + /// scalar + const double s1 = 2; + + const long x1 = 2; + const static_rational<4,3> x2; + + /// define some units + force u1 = newton; + energy u2 = joule; + + /// define some quantities + quantity q1(1.0*u1); + quantity q2(2.0*u2); + //] + + /// check scalar, unit, and quantity io + std::cout << "S1 : " << s1 << std::endl + << "X1 : " << x1 << std::endl + << "X2 : " << x2 << std::endl + << "U1 : " << u1 << std::endl + << "U2 : " << u2 << std::endl + << "Q1 : " << q1 << std::endl + << "Q2 : " << q2 << std::endl + << std::endl; + + /// check scalar-unit algebra + std::cout //<< "U1+S1 : " << u1+s1 << std::endl // illegal + //<< "S1+U1 : " << s1+u1 << std::endl // illegal + //<< "U1-S1 : " << u1-s1 << std::endl // illegal + //<< "S1-U1 : " << s1-u1 << std::endl // illegal + << "U1*S1 : " << u1*s1 << std::endl + << "S1*U1 : " << s1*u1 << std::endl + << "U1/S1 : " << u1/s1 << std::endl + << "S1/U1 : " << s1/u1 << std::endl + << std::endl; + + /// check unit-unit algebra + std::cout << "U1+U1 : " << u1+u1 << std::endl + << "U1-U1 : " << u1-u1 << std::endl + << "U1*U1 : " << u1*u1 << std::endl + << "U1/U1 : " << u1/u1 << std::endl + //<< "U1+U2 : " << u1+u2 << std::endl // illegal + //<< "U1-U2 : " << u1-u2 << std::endl // illegal + << "U1*U2 : " << u1*u2 << std::endl + << "U1/U2 : " << u1/u2 << std::endl + << "U1^X : " << pow<2>(u1) << std::endl + << "X1vU1 : " << root<2>(u1) << std::endl + << "U1^X2 : " << pow >(u1) << std::endl + << "X2vU1 : " << root >(u1) << std::endl + << std::endl; + + /// check scalar-quantity algebra + std::cout //<< "Q1+S1 : " << q1+s1 << std::endl // illegal + //<< "S1+Q1 : " << s1+q1 << std::endl // illegal + //<< "Q1-S1 : " << q1-s1 << std::endl // illegal + //<< "S1-Q1 : " << s1-q1 << std::endl // illegal + << "Q1*S1 : " << q1*s1 << std::endl + << "S1*Q1 : " << s1*q1 << std::endl + << "Q1/S1 : " << q1/s1 << std::endl + << "S1/Q1 : " << s1/q1 << std::endl + << std::endl; + + /// check unit-quantity algebra + std::cout //<< "U1+Q1 : " << u1+q1 << std::endl // illegal + //<< "Q1+U1 : " << q1+u1 << std::endl // illegal + //<< "U1-Q1 : " << u1-q1 << std::endl // illegal + //<< "Q1-U1 : " << q1-u1 << std::endl // illegal + << "U1*Q1 : " << u1*q1 << std::endl + << "Q1*U1 : " << q1*u1 << std::endl + << "U1/Q1 : " << u1/q1 << std::endl + << "Q1/U1 : " << q1/u1 << std::endl + << std::endl; + + /// check quantity-quantity algebra + std::cout << "+Q1 : " << +q1 << std::endl + << "-Q1 : " << -q1 << std::endl + << "Q1+Q1 : " << q1+q1 << std::endl + << "Q1-Q1 : " << q1-q1 << std::endl + << "Q1*Q1 : " << q1*q1 << std::endl + << "Q1/Q1 : " << q1/q1 << std::endl + //<< "Q1+Q2 : " << q1+q2 << std::endl // illegal + //<< "Q1-Q2 : " << q1-q2 << std::endl // illegal + << "Q1*Q2 : " << q1*q2 << std::endl + << "Q1/Q2 : " << q1/q2 << std::endl + << "Q1^X1 : " << pow<2>(q1) << std::endl + << "X1vQ1 : " << root<2>(q1) << std::endl + << "Q1^X2 : " << pow >(q1) << std::endl + << "X2vQ1 : " << root >(q1) << std::endl + << std::endl; + + //[kitchen_sink_snippet_2 + /// check comparison tests + quantity l1(1.0*meter), + l2(2.0*meters); + //] + + std::cout << std::boolalpha + << "l1 == l2" << "\t" << (l1 == l2) << std::endl + << "l1 != l2" << "\t" << (l1 != l2) << std::endl + << "l1 <= l2" << "\t" << (l1 <= l2) << std::endl + << "l1 < l2 " << "\t" << (l1 < l2) << std::endl + << "l1 >= l2" << "\t" << (l1 >= l2) << std::endl + << "l1 > l2 " << "\t" << (l1 > l2) << std::endl + << std::endl; + + //[kitchen_sink_snippet_3 + /// check implicit unit conversion from dimensionless to value_type + const double dimless = (q1/q1); + //] + + std::cout << "dimless = " << dimless << std::endl + << std::endl; + + quantity v1 = 2.0*meters/second; + + std::cout << "v1 = " << v1 << std::endl + << std::endl; + + //[kitchen_sink_snippet_4 + /// test calcuation of work + quantity F(1.0*newton); + quantity dx(1.0*meter); + quantity E(work(F,dx)); + //] + + std::cout << "F = " << F << std::endl + << "dx = " << dx << std::endl + << "E = " << E << std::endl + << std::endl; + + { + //[kitchen_sink_snippet_5 + /// test ideal gas law + quantity T = (273.+37.)*kelvin; + quantity P = 1.01325e5*pascals; + quantity r = 0.5e-6*meters; + quantity V = (4.0/3.0)*3.141592*pow<3>(r); + quantity n(idealGasLaw(P,V,T)); + //] + + std::cout << "r = " << r << std::endl + << "P = " << P << std::endl + << "V = " << V << std::endl + << "T = " << T << std::endl + << "n = " << n << std::endl + #if BOOST_UNITS_HAS_TYPEOF + << "R = " << constants::codata::R << std::endl + #else + << "no typeof" << std::endl + #endif // BOOST_UNITS_HAS_TYPEOF + << std::endl; + } + + //[kitchen_sink_snippet_6 + /// test trig stuff + quantity theta = 0.375*radians; + quantity sin_theta = sin(theta); + quantity thetap = asin(sin_theta); + //] + + std::cout << "theta = " << theta << std::endl + << "sin(theta) = " << sin_theta << std::endl + << "asin(sin(theta)) = " << thetap << std::endl + << std::endl; + + /// test implicit conversion of dimensionless to value + double tmp = sin_theta; + + tmp = sin_theta; + + /// test implicit conversion from value to dimensionless + quantity tmpp = tmp; + + tmpp = tmp; + + /// check complex quantities + typedef std::complex complex_type; + + //[kitchen_sink_snippet_7 + quantity v = complex_type(12.5,0.0)*volts; + quantity i = complex_type(3.0,4.0)*amperes; + quantity z = complex_type(1.5,-2.0)*ohms; + //] + + std::cout << "V = " << v << std::endl + << "I = " << i << std::endl + << "Z = " << z << std::endl + << "I*Z = " << i*z << std::endl + << std::endl; + + /// check quantities using user-defined type encapsulating error propagation + + //[kitchen_sink_snippet_8 + quantity > + u(measurement(1.0,0.0)*meters), + w(measurement(4.52,0.02)*meters), + x(measurement(2.0,0.2)*meters), + y(measurement(3.0,0.6)*meters); + //] + + std::cout << "x+y-w = " << x+y-w << std::endl + << "w*x = " << w*x << std::endl + << "x/y = " << x/y << std::endl + << "w*y^2/(u*x)^2 = " << w*y*y/pow<2>(u*x) << std::endl + << "w/(u*x)^(1/2) = " << w/pow< static_rational<1,2> >(u*x) + << std::endl << std::endl; + } + + /// check moment of inertia/angular momentum/rotational energy + + //[kitchen_sink_snippet_9 + std::cout << symbol_format + << "I*w = " << moment_of_inertia()*angular_velocity() << std::endl + << "I*w/L = " << moment_of_inertia()*angular_velocity()/angular_momentum() << std::endl + << "I*w^2 = " << moment_of_inertia()*pow<2>(angular_velocity()) << std::endl + << std::endl; + //] + + //[kitchen_sink_snippet_10 +// std::cout << typename_format +// << quantity(1.0*farad) << std::endl +// << quantity(1.0*katal) << std::endl +// << quantity(1.0*siemen) << std::endl +// << quantity(1.0*coulomb) << std::endl +// << quantity(1.0*volt) << std::endl +// << quantity(1.0*joule) << std::endl +// << quantity(1.0*newton) << std::endl +// << quantity(1.0*hertz) << std::endl +// << quantity(1.0*lux) << std::endl +// << quantity(1.0*henry) << std::endl +// << quantity(1.0*lumen) << std::endl +// << quantity(1.0*weber) << std::endl +// << quantity(1.0*tesla) << std::endl +// << quantity(1.0*watt) << std::endl +// << quantity(1.0*pascals) << std::endl +// << quantity(1.0*ohm) << std::endl +// << std::endl; + //] + + //[kitchen_sink_snippet_11 +// std::cout << raw_format +// << quantity(1.0*farad) << std::endl +// << quantity(1.0*katal) << std::endl +// << quantity(1.0*siemen) << std::endl +// << quantity(1.0*coulomb) << std::endl +// << quantity(1.0*volt) << std::endl +// << quantity(1.0*joule) << std::endl +// << quantity(1.0*newton) << std::endl +// << quantity(1.0*hertz) << std::endl +// << quantity(1.0*lux) << std::endl +// << quantity(1.0*henry) << std::endl +// << quantity(1.0*lumen) << std::endl +// << quantity(1.0*weber) << std::endl +// << quantity(1.0*tesla) << std::endl +// << quantity(1.0*watt) << std::endl +// << quantity(1.0*pascals) << std::endl +// << quantity(1.0*ohm) << std::endl +// << std::endl; + //] + + //[kitchen_sink_snippet_12 + std::cout << symbol_format + << quantity(1.0*farad) << std::endl + << quantity(1.0*katal) << std::endl + << quantity(1.0*siemen) << std::endl + << quantity(1.0*coulomb) << std::endl + << quantity(1.0*volt) << std::endl + << quantity(1.0*joule) << std::endl + << quantity(1.0*newton) << std::endl + << quantity(1.0*hertz) << std::endl + << quantity(1.0*lux) << std::endl + << quantity(1.0*henry) << std::endl + << quantity(1.0*lumen) << std::endl + << quantity(1.0*weber) << std::endl + << quantity(1.0*tesla) << std::endl + << quantity(1.0*watt) << std::endl + << quantity(1.0*pascals) << std::endl + << quantity(1.0*ohm) << std::endl + << std::endl; + //] + + //[kitchen_sink_snippet_13 + std::cout << name_format + << quantity(1.0*farad) << std::endl + << quantity(1.0*katal) << std::endl + << quantity(1.0*siemen) << std::endl + << quantity(1.0*coulomb) << std::endl + << quantity(1.0*volt) << std::endl + << quantity(1.0*joule) << std::endl + << quantity(1.0*newton) << std::endl + << quantity(1.0*hertz) << std::endl + << quantity(1.0*lux) << std::endl + << quantity(1.0*henry) << std::endl + << quantity(1.0*lumen) << std::endl + << quantity(1.0*weber) << std::endl + << quantity(1.0*tesla) << std::endl + << quantity(1.0*watt) << std::endl + << quantity(1.0*pascals) << std::endl + << quantity(1.0*ohm) << std::endl + << std::endl; + //] + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/lambda.cpp b/tools/boost_1_65_1/libs/units/example/lambda.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0fbac916098f1739aa55f1edf58adc3d451908bb --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/lambda.cpp @@ -0,0 +1,157 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// $Id: lambda.cpp 27 2008-06-16 14:50:58Z maehne $ + +//////////////////////////////////////////////////////////////////////// +/// +/// \file lambda.cpp +/// +/// \brief Example demonstrating the usage of Boost.Units' quantity, +/// unit, and absolute types in functors created with the +/// Boost.Lambda library and stored in Boost.Function objects. +/// +/// \author Torsten Maehne +/// \date 2008-06-04 +/// +/// A mechanical, electrical, geometrical, and thermal example +/// demonstrate how to use Boost.Units' quantity, unit, and absolute +/// types in lambda expressions. The resulting functors can be stored +/// in boost::function objects. It is also shown how to work around a +/// limitation of Boost.Lambda's bind() to help it to find the correct +/// overloaded function by specifying its signature with a +/// static_cast. +/// +//////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include + +// Include boost/units/lambda.hpp instead of boost/lambda/lambda.hpp +// for a convenient usage of Boost.Units' quantity, unit, and absolute +// types in lambda expressions. The header augments Boost.Lambda's +// return type detuction system to recognize the new types so that not +// for each arithmetic operation the return type needs to be +// explicitely specified. +#include + +#include + +static const double pi = 3.14159265358979323846; + +//[lambda_snippet_1 + +int main(int argc, char **argv) { + + using namespace std; + namespace bl = boost::lambda; + namespace bu = boost::units; + namespace si = boost::units::si; + + + //////////////////////////////////////////////////////////////////////// + // Mechanical example: linear accelerated movement + //////////////////////////////////////////////////////////////////////// + + // Initial condition variables for acceleration, speed, and displacement + bu::quantity a = 2.0 * si::meters_per_second_squared; + bu::quantity v = 1.0 * si::meters_per_second; + bu::quantity s0 = 0.5 * si::meter; + + // Displacement over time + boost::function (bu::quantity) > + s = 0.5 * bl::var(a) * bl::_1 * bl::_1 + + bl::var(v) * bl::_1 + + bl::var(s0); + + cout << "Linear accelerated movement:" << endl + << "a = " << a << ", v = " << v << ", s0 = " << s0 << endl + << "s(1.0 * si::second) = " << s(1.0 * si::second) << endl + << endl; + + // Change initial conditions + a = 1.0 * si::meters_per_second_squared; + v = 2.0 * si::meters_per_second; + s0 = -1.5 * si::meter; + + cout << "a = " << a << ", v = " << v << ", s0 = " << s0 << endl + << "s(1.0 * si::second) = " << s(1.0 * si::second) << endl + << endl; + + + //////////////////////////////////////////////////////////////////////// + // Electrical example: oscillating current + //////////////////////////////////////////////////////////////////////// + + // Constants for the current amplitude, frequency, and offset current + const bu::quantity iamp = 1.5 * si::ampere; + const bu::quantity f = 1.0e3 * si::hertz; + const bu::quantity i0 = 0.5 * si::ampere; + + // The invocation of the sin function needs to be postponed using + // bind to specify the oscillation function. A lengthy static_cast + // to the function pointer referencing boost::units::sin() is needed + // to avoid an "unresolved overloaded function type" error. + boost::function (bu::quantity) > + i = iamp + * bl::bind(static_cast::type (*)(const bu::quantity&)>(bu::sin), + 2.0 * pi * si::radian * f * bl::_1) + + i0; + + cout << "Oscillating current:" << endl + << "iamp = " << iamp << ", f = " << f << ", i0 = " << i0 << endl + << "i(1.25e-3 * si::second) = " << i(1.25e-3 * si::second) << endl + << endl; + + + //////////////////////////////////////////////////////////////////////// + // Geometric example: area calculation for a square + //////////////////////////////////////////////////////////////////////// + + // Length constant + const bu::quantity l = 1.5 * si::meter; + + // Again an ugly static_cast is needed to bind pow<2> to the first + // function argument. + boost::function (bu::quantity) > + A = bl::bind(static_cast (*)(const bu::quantity&)>(bu::pow<2>), + bl::_1); + + cout << "Area of a square:" << endl + << "A(" << l <<") = " << A(l) << endl << endl; + + + //////////////////////////////////////////////////////////////////////// + // Thermal example: temperature difference of two absolute temperatures + //////////////////////////////////////////////////////////////////////// + + // Absolute temperature constants + const bu::quantity > + Tref = 273.15 * bu::absolute(); + const bu::quantity > + Tamb = 300.00 * bu::absolute(); + + boost::function (bu::quantity >, + bu::quantity >)> + dT = bl::_2 - bl::_1; + + cout << "Temperature difference of two absolute temperatures:" << endl + << "dT(" << Tref << ", " << Tamb << ") = " << dT(Tref, Tamb) << endl + << endl; + + + return 0; +} +//] diff --git a/tools/boost_1_65_1/libs/units/example/measurement.hpp b/tools/boost_1_65_1/libs/units/example/measurement.hpp new file mode 100644 index 0000000000000000000000000000000000000000..217fac1b527ea5127c7a4962857dd0cf5cdef516 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/measurement.hpp @@ -0,0 +1,327 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MEASUREMENT_HPP +#define BOOST_UNITS_MEASUREMENT_HPP + +#include +#include +#include +#include + +#include +#include + +namespace boost { + +namespace units { + +namespace sqr_namespace /**/ { + +template +Y sqr(Y val) +{ return val*val; } + +} // namespace + +using sqr_namespace::sqr; + +template +class measurement +{ + public: + typedef measurement this_type; + typedef Y value_type; + + measurement(const value_type& val = value_type(), + const value_type& err = value_type()) : + value_(val), + uncertainty_(std::abs(err)) + { } + + measurement(const this_type& source) : + value_(source.value_), + uncertainty_(source.uncertainty_) + { } + + //~measurement() { } + + this_type& operator=(const this_type& source) + { + if (this == &source) return *this; + + value_ = source.value_; + uncertainty_ = source.uncertainty_; + + return *this; + } + + operator value_type() const { return value_; } + + value_type value() const { return value_; } + value_type uncertainty() const { return uncertainty_; } + value_type lower_bound() const { return value_-uncertainty_; } + value_type upper_bound() const { return value_+uncertainty_; } + + this_type& operator+=(const value_type& val) + { + value_ += val; + return *this; + } + + this_type& operator-=(const value_type& val) + { + value_ -= val; + return *this; + } + + this_type& operator*=(const value_type& val) + { + value_ *= val; + uncertainty_ *= val; + return *this; + } + + this_type& operator/=(const value_type& val) + { + value_ /= val; + uncertainty_ /= val; + return *this; + } + + this_type& operator+=(const this_type& /*source*/); + this_type& operator-=(const this_type& /*source*/); + this_type& operator*=(const this_type& /*source*/); + this_type& operator/=(const this_type& /*source*/); + + private: + value_type value_, + uncertainty_; +}; + +} + +} + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::measurement, 1) + +#endif + +namespace boost { + +namespace units { + +template +inline +measurement& +measurement::operator+=(const this_type& source) +{ + uncertainty_ = std::sqrt(sqr(uncertainty_)+sqr(source.uncertainty_)); + value_ += source.value_; + + return *this; +} + +template +inline +measurement& +measurement::operator-=(const this_type& source) +{ + uncertainty_ = std::sqrt(sqr(uncertainty_)+sqr(source.uncertainty_)); + value_ -= source.value_; + + return *this; +} + +template +inline +measurement& +measurement::operator*=(const this_type& source) +{ + uncertainty_ = (value_*source.value_)* + std::sqrt(sqr(uncertainty_/value_)+ + sqr(source.uncertainty_/source.value_)); + value_ *= source.value_; + + return *this; +} + +template +inline +measurement& +measurement::operator/=(const this_type& source) +{ + uncertainty_ = (value_/source.value_)* + std::sqrt(sqr(uncertainty_/value_)+ + sqr(source.uncertainty_/source.value_)); + value_ /= source.value_; + + return *this; +} + +// value_type op measurement +template +inline +measurement +operator+(Y lhs,const measurement& rhs) +{ + return (measurement(lhs,Y(0))+=rhs); +} + +template +inline +measurement +operator-(Y lhs,const measurement& rhs) +{ + return (measurement(lhs,Y(0))-=rhs); +} + +template +inline +measurement +operator*(Y lhs,const measurement& rhs) +{ + return (measurement(lhs,Y(0))*=rhs); +} + +template +inline +measurement +operator/(Y lhs,const measurement& rhs) +{ + return (measurement(lhs,Y(0))/=rhs); +} + +// measurement op value_type +template +inline +measurement +operator+(const measurement& lhs,Y rhs) +{ + return (measurement(lhs)+=measurement(rhs,Y(0))); +} + +template +inline +measurement +operator-(const measurement& lhs,Y rhs) +{ + return (measurement(lhs)-=measurement(rhs,Y(0))); +} + +template +inline +measurement +operator*(const measurement& lhs,Y rhs) +{ + return (measurement(lhs)*=measurement(rhs,Y(0))); +} + +template +inline +measurement +operator/(const measurement& lhs,Y rhs) +{ + return (measurement(lhs)/=measurement(rhs,Y(0))); +} + +// measurement op measurement +template +inline +measurement +operator+(const measurement& lhs,const measurement& rhs) +{ + return (measurement(lhs)+=rhs); +} + +template +inline +measurement +operator-(const measurement& lhs,const measurement& rhs) +{ + return (measurement(lhs)-=rhs); +} + +template +inline +measurement +operator*(const measurement& lhs,const measurement& rhs) +{ + return (measurement(lhs)*=rhs); +} + +template +inline +measurement +operator/(const measurement& lhs,const measurement& rhs) +{ + return (measurement(lhs)/=rhs); +} + +/// specialize power typeof helper +template +struct power_typeof_helper,static_rational > +{ + typedef measurement< + typename power_typeof_helper >::type + > type; + + static type value(const measurement& x) + { + const static_rational rat; + + const Y m = Y(rat.numerator())/Y(rat.denominator()), + newval = std::pow(x.value(),m), + err = newval*std::sqrt(std::pow(m*x.uncertainty()/x.value(),2)); + + return type(newval,err); + } +}; + +/// specialize root typeof helper +template +struct root_typeof_helper,static_rational > +{ + typedef measurement< + typename root_typeof_helper >::type + > type; + + static type value(const measurement& x) + { + const static_rational rat; + + const Y m = Y(rat.denominator())/Y(rat.numerator()), + newval = std::pow(x.value(),m), + err = newval*std::sqrt(std::pow(m*x.uncertainty()/x.value(),2)); + + return type(newval,err); + } +}; + +// stream output +template +inline +std::ostream& operator<<(std::ostream& os,const measurement& val) +{ + boost::io::ios_precision_saver precision_saver(os); + boost::io::ios_flags_saver flags_saver(os); + + os << val.value() << "(+/-" << val.uncertainty() << ")"; + + return os; +} + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MEASUREMENT_HPP diff --git a/tools/boost_1_65_1/libs/units/example/non_base_dimension.cpp b/tools/boost_1_65_1/libs/units/example/non_base_dimension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4476a34e184a0c2c3f97c1d4d1ec6a36a4c1b6cd --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/non_base_dimension.cpp @@ -0,0 +1,78 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief non_base_dimension.cpp + +\details +Another example of user-defined units with conversions. + +Output: +@verbatim + +//[non_base_dimension_output +//] + +@endverbatim +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +//[non_base_dimension_snippet_1 + +struct imperial_gallon_tag : + base_unit { }; + +typedef make_system::type imperial; + +typedef unit imperial_gallon; + +struct us_gallon_tag : base_unit { }; + +typedef make_system::type us; + +typedef unit us_gallon; + +//] + +} // namespace units + +} // namespace boost + +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial_gallon_tag, + boost::units::us_gallon_tag, + double, 1.2009499255); + +using namespace boost::units; + +int main(void) +{ + quantity ig1(1.0*imperial_gallon()); + quantity ug1(1.0*us_gallon()); + + quantity ig2(ug1); + quantity ug2(ig1); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/performance.cpp b/tools/boost_1_65_1/libs/units/example/performance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3407c13714a77ae68fe0b41d44ae52009c56cdae --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/performance.cpp @@ -0,0 +1,394 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief performance.cpp + +\details +Test runtime performance. + +Output: +@verbatim + +multiplying ublas::matrix(1000, 1000) : 25.03 seconds +multiplying ublas::matrix(1000, 1000) : 24.49 seconds +tiled_matrix_multiply(1000, 1000) : 1.12 seconds +tiled_matrix_multiply(1000, 1000) : 1.16 seconds +solving y' = 1 - x + 4 * y with double: 1.97 seconds +solving y' = 1 - x + 4 * y with quantity: 1.84 seconds + +@endverbatim +**/ + +#define _SCL_SECURE_NO_WARNINGS + +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4267; disable:4127; disable:4244; disable:4100) +#endif + +#include + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include +#include +#include +#include + +enum { + tile_block_size = 24 +}; + +template +void tiled_multiply_carray_inner(T0* first, + T1* second, + Out* out, + int totalwidth, + int width2, + int height1, + int common) { + for(int j = 0; j < height1; ++j) { + for(int i = 0; i < width2; ++i) { + Out value = out[j * totalwidth + i]; + for(int k = 0; k < common; ++k) { + value += first[k + totalwidth * j] * second[k * totalwidth + i]; + } + out[j * totalwidth + i] = value; + } + } +} + +template +void tiled_multiply_carray_outer(T0* first, + T1* second, + Out* out, + int width2, + int height1, + int common) { + std::fill_n(out, width2 * height1, Out()); + int j = 0; + for(; j < height1 - tile_block_size; j += tile_block_size) { + int i = 0; + for(; i < width2 - tile_block_size; i += tile_block_size) { + int k = 0; + for(; k < common - tile_block_size; k += tile_block_size) { + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, + tile_block_size, + tile_block_size, + tile_block_size); + } + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, + tile_block_size, + tile_block_size, + common - k); + } + int k = 0; + for(; k < common - tile_block_size; k += tile_block_size) { + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, width2 - i, + tile_block_size, + tile_block_size); + } + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, width2 - i, + tile_block_size, + common - k); + } + int i = 0; + for(; i < width2 - tile_block_size; i += tile_block_size) { + int k = 0; + for(; k < common - tile_block_size; k += tile_block_size) { + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, + tile_block_size, + height1 - j, + tile_block_size); + } + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, + tile_block_size, + height1 - j, + common - k); + } + int k = 0; + for(; k < common - tile_block_size; k += tile_block_size) { + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, + width2 - i, + height1 - j, + tile_block_size); + } + tiled_multiply_carray_inner( + &first[k + width2 * j], + &second[k * width2 + i], + &out[j * width2 + i], + width2, + width2 - i, + height1 - j, + common - k); +} + +enum { max_value = 1000}; + +template +R solve_differential_equation(F f, T lower, T upper, N steps, R start) { + typedef typename F::template result::type f_result; + T h = (upper - lower) / (1.0*steps); + for(N i = N(); i < steps; ++i) { + R y = start; + T x = lower + h * (1.0*i); + f_result k1 = f(x, y); + f_result k2 = f(x + h / 2.0, y + h * k1 / 2.0); + f_result k3 = f(x + h / 2.0, y + h * k2 / 2.0); + f_result k4 = f(x + h, y + h * k3); + start = y + h * (k1 + 2.0 * k2 + 2.0 * k3 + k4) / 6.0; + } + return(start); +} + +using namespace boost::units; + +//y' = 1 - x + 4 * y +struct f { + template struct result; + + double operator()(const double& x, const double& y) const { + return(1.0 - x + 4.0 * y); + } + + boost::units::quantity + operator()(const quantity& x, + const quantity& y) const { + using namespace boost::units; + using namespace si; + return(1.0 * meters / second - + x * meters / pow<2>(seconds) + + 4.0 * y / seconds ); + } +}; + +template<> +struct f::result { + typedef double type; +}; + +template<> +struct f::result, quantity > { + typedef quantity type; +}; + + + +//y' = 1 - x + 4 * y +//y' - 4 * y = 1 - x +//e^(-4 * x) * (dy - 4 * y * dx) = e^(-4 * x) * (1 - x) * dx +//d/dx(y * e ^ (-4 * x)) = e ^ (-4 * x) (1 - x) * dx + +//d/dx(y * e ^ (-4 * x)) = e ^ (-4 * x) * dx - x * e ^ (-4 * x) * dx +//d/dx(y * e ^ (-4 * x)) = d/dx((-3/16 + 1/4 * x) * e ^ (-4 * x)) +//y * e ^ (-4 * x) = (-3/16 + 1/4 * x) * e ^ (-4 * x) + C +//y = (-3/16 + 1/4 * x) + C/e ^ (-4 * x) +//y = 1/4 * x - 3/16 + C * e ^ (4 * x) + +//y(0) = 1 +//1 = - 3/16 + C +//C = 19/16 +//y(x) = 1/4 * x - 3/16 + 19/16 * e ^ (4 * x) + + + +int main() { + boost::numeric::ublas::matrix ublas_result; + { + boost::numeric::ublas::matrix m1(max_value, max_value); + boost::numeric::ublas::matrix m2(max_value, max_value); + std::srand(1492); + for(int i = 0; i < max_value; ++i) { + for(int j = 0; j < max_value; ++j) { + m1(i,j) = std::rand(); + m2(i,j) = std::rand(); + } + } + std::cout << "multiplying ublas::matrix(" + << max_value << ", " << max_value << ") : "; + boost::timer timer; + ublas_result = (prod(m1, m2)); + std::cout << timer.elapsed() << " seconds" << std::endl; + } + typedef boost::numeric::ublas::matrix< + boost::units::quantity + > matrix_type; + matrix_type ublas_resultq; + { + matrix_type m1(max_value, max_value); + matrix_type m2(max_value, max_value); + std::srand(1492); + for(int i = 0; i < max_value; ++i) { + for(int j = 0; j < max_value; ++j) { + m1(i,j) = std::rand(); + m2(i,j) = std::rand(); + } + } + std::cout << "multiplying ublas::matrix(" + << max_value << ", " << max_value << ") : "; + boost::timer timer; + ublas_resultq = (prod(m1, m2)); + std::cout << timer.elapsed() << " seconds" << std::endl; + } + std::vector cresult(max_value * max_value); + { + std::vector m1(max_value * max_value); + std::vector m2(max_value * max_value); + std::srand(1492); + for(int i = 0; i < max_value * max_value; ++i) { + m1[i] = std::rand(); + m2[i] = std::rand(); + } + std::cout << "tiled_matrix_multiply(" + << max_value << ", " << max_value << ") : "; + boost::timer timer; + tiled_multiply_carray_outer( + &m1[0], + &m2[0], + &cresult[0], + max_value, + max_value, + max_value); + std::cout << timer.elapsed() << " seconds" << std::endl; + } + std::vector< + boost::units::quantity + > cresultq(max_value * max_value); + { + std::vector< + boost::units::quantity + > m1(max_value * max_value); + std::vector< + boost::units::quantity + > m2(max_value * max_value); + std::srand(1492); + for(int i = 0; i < max_value * max_value; ++i) { + m1[i] = std::rand() * boost::units::si::newtons; + m2[i] = std::rand() * boost::units::si::meters; + } + std::cout << "tiled_matrix_multiply(" + << max_value << ", " << max_value << ") : "; + boost::timer timer; + tiled_multiply_carray_outer( + &m1[0], + &m2[0], + &cresultq[0], + max_value, + max_value, + max_value); + std::cout << timer.elapsed() << " seconds" << std::endl; + } + for(int i = 0; i < max_value; ++i) { + for(int j = 0; j < max_value; ++j) { + double diff = + std::abs(ublas_result(i,j) - cresult[i * max_value + j]); + if(diff > ublas_result(i,j) /1e14) { + std::cout << std::setprecision(15) << "Uh Oh. ublas_result(" + << i << "," << j << ") = " << ublas_result(i,j) + << std::endl + << "cresult[" << i << " * " << max_value << " + " + << j << "] = " << cresult[i * max_value + j] + << std::endl; + return(EXIT_FAILURE); + } + } + } + { + std::vector values(1000); + std::cout << "solving y' = 1 - x + 4 * y with double: "; + boost::timer timer; + for(int i = 0; i < 1000; ++i) { + double x = .1 * i; + values[i] = solve_differential_equation(f(), 0.0, x, i * 100, 1.0); + } + std::cout << timer.elapsed() << " seconds" << std::endl; + for(int i = 0; i < 1000; ++i) { + double x = .1 * i; + double value = 1.0/4.0 * x - 3.0/16.0 + 19.0/16.0 * std::exp(4 * x); + if(std::abs(values[i] - value) > value / 1e9) { + std::cout << std::setprecision(15) << "i = : " << i + << ", value = " << value << " approx = " << values[i] + << std::endl; + return(EXIT_FAILURE); + } + } + } + { + using namespace boost::units; + using namespace si; + std::vector > values(1000); + std::cout << "solving y' = 1 - x + 4 * y with quantity: "; + boost::timer timer; + for(int i = 0; i < 1000; ++i) { + quantity x = .1 * i * seconds; + values[i] = solve_differential_equation( + f(), + 0.0 * seconds, + x, + i * 100, + 1.0 * meters); + } + std::cout << timer.elapsed() << " seconds" << std::endl; + for(int i = 0; i < 1000; ++i) { + double x = .1 * i; + quantity value = + (1.0/4.0 * x - 3.0/16.0 + 19.0/16.0 * std::exp(4 * x)) * meters; + if(abs(values[i] - value) > value / 1e9) { + std::cout << std::setprecision(15) << "i = : " << i + << ", value = " << value << " approx = " + << values[i] << std::endl; + return(EXIT_FAILURE); + } + } + } +} diff --git a/tools/boost_1_65_1/libs/units/example/quantity.cpp b/tools/boost_1_65_1/libs/units/example/quantity.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e3d3f18ac05076e243684ef040fa80d89ebb33a8 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/quantity.cpp @@ -0,0 +1,128 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief quantity.cpp + +\details +Test quantity algebra. + +Output: +@verbatim + +//[quantity_output_double +L = 2 m +L+L = 4 m +L-L = 0 m +L*L = 4 m^2 +L/L = 1 dimensionless +L*meter = 2 m^2 +kilograms*(L/seconds)*(L/seconds) = 4 m^2 kg s^-2 +kilograms*(L/seconds)^2 = 4 m^2 kg s^-2 +L^3 = 8 m^3 +L^(3/2) = 2.82843 m^(3/2) +2vL = 1.41421 m^(1/2) +(3/2)vL = 1.5874 m^(2/3) +//] + +//[quantity_output_complex +L = (3,4) m +L+L = (6,8) m +L-L = (0,0) m +L*L = (-7,24) m^2 +L/L = (1,0) dimensionless +L*meter = (3,4) m^2 +kilograms*(L/seconds)*(L/seconds) = (-7,24) m^2 kg s^-2 +kilograms*(L/seconds)^2 = (-7,24) m^2 kg s^-2 +L^3 = (-117,44) m^3 +L^(3/2) = (2,11) m^(3/2) +2vL = (2,1) m^(1/2) +(3/2)vL = (2.38285,1.69466) m^(2/3) +//] + +@endverbatim +**/ + +#include +#include + +#include + +#include + +#include +#include +#include + +#include "test_system.hpp" + +int main(void) +{ + using namespace boost::units; + using namespace boost::units::test; + + { + //[quantity_snippet_1 + quantity L = 2.0*meters; // quantity of length + quantity E = kilograms*pow<2>(L/seconds); // quantity of energy + //] + + std::cout << "L = " << L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl + << "L*L = " << L*L << std::endl + << "L/L = " << L/L << std::endl + << "L*meter = " << L*meter << std::endl + << "kilograms*(L/seconds)*(L/seconds) = " + << kilograms*(L/seconds)*(L/seconds) << std::endl + << "kilograms*(L/seconds)^2 = " + << kilograms*pow<2>(L/seconds) << std::endl + << "L^3 = " + << pow<3>(L) << std::endl + << "L^(3/2) = " + << pow >(L) << std::endl + << "2vL = " + << root<2>(L) << std::endl + << "(3/2)vL = " + << root >(L) << std::endl + << std::endl; + } + + { + //[quantity_snippet_2 + quantity > L(std::complex(3.0,4.0)*meters); + quantity > E(kilograms*pow<2>(L/seconds)); + //] + + std::cout << "L = " << L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl + << "L*L = " << L*L << std::endl + << "L/L = " << L/L << std::endl + << "L*meter = " << L*meter << std::endl + << "kilograms*(L/seconds)*(L/seconds) = " + << kilograms*(L/seconds)*(L/seconds) << std::endl + << "kilograms*(L/seconds)^2 = " + << kilograms*pow<2>(L/seconds) << std::endl + << "L^3 = " + << pow<3>(L) << std::endl + << "L^(3/2) = " + << pow >(L) << std::endl + << "2vL = " + << root<2>(L) << std::endl + << "(3/2)vL = " + << root >(L) << std::endl + << std::endl; + } + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/quaternion.cpp b/tools/boost_1_65_1/libs/units/example/quaternion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a2e3e91bd1be7271f407e7c430524cf40b1ef13f --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/quaternion.cpp @@ -0,0 +1,232 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief quaternion.cpp + +\details +Demonstrate interoperability with Boost.Quaternion. + +Output: +@verbatim + +//[quaternion_output_1 ++L = (4,3,2,1) m +-L = (-4,-3,-2,-1) m +L+L = (8,6,4,2) m +L-L = (0,0,0,0) m +L*L = (2,24,16,8) m^2 +L/L = (1,0,0,0) dimensionless +L^3 = (-104,102,68,34) m^3 +//] + +//[quaternion_output_2 ++L = (4 m,3 m,2 m,1 m) +-L = (-4 m,-3 m,-2 m,-1 m) +L+L = (8 m,6 m,4 m,2 m) +L-L = (0 m,0 m,0 m,0 m) +L^3 = (-104 m^3,102 m^3,68 m^3,34 m^3) +//] + +@endverbatim +**/ + +#include + +#include +#include + +#include +#include +#include + +#include "test_system.hpp" + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::math::quaternion, 1) + +#endif + +namespace boost { + +namespace units { + +//[quaternion_class_snippet_1a +/// specialize power typeof helper +template +struct power_typeof_helper,static_rational > +{ + // boost::math::quaternion only supports integer powers + BOOST_STATIC_ASSERT(D==1); + + typedef boost::math::quaternion< + typename power_typeof_helper >::type + > type; + + static type value(const boost::math::quaternion& x) + { + return boost::math::pow(x,static_cast(N)); + } +}; +//] + +//[quaternion_class_snippet_1b +/// specialize root typeof helper +template +struct root_typeof_helper,static_rational > +{ + // boost::math::quaternion only supports integer powers + BOOST_STATIC_ASSERT(N==1); + + typedef boost::math::quaternion< + typename root_typeof_helper >::type + > type; + + static type value(const boost::math::quaternion& x) + { + return boost::math::pow(x,static_cast(D)); + } +}; +//] + +//[quaternion_class_snippet_2a +/// specialize power typeof helper for quaternion > +template +struct power_typeof_helper< + boost::math::quaternion >, + static_rational > +{ + typedef typename power_typeof_helper< + Y, + static_rational + >::type value_type; + + typedef typename power_typeof_helper< + Unit, + static_rational + >::type unit_type; + + typedef quantity quantity_type; + typedef boost::math::quaternion type; + + static type value(const boost::math::quaternion >& x) + { + const boost::math::quaternion tmp = + pow >(boost::math::quaternion( + x.R_component_1().value(), + x.R_component_2().value(), + x.R_component_3().value(), + x.R_component_4().value())); + + return type(quantity_type::from_value(tmp.R_component_1()), + quantity_type::from_value(tmp.R_component_2()), + quantity_type::from_value(tmp.R_component_3()), + quantity_type::from_value(tmp.R_component_4())); + } +}; +//] + +//[quaternion_class_snippet_2b +/// specialize root typeof helper for quaternion > +template +struct root_typeof_helper< + boost::math::quaternion >, + static_rational > +{ + typedef typename root_typeof_helper< + Y, + static_rational + >::type value_type; + + typedef typename root_typeof_helper< + Unit, + static_rational + >::type unit_type; + + typedef quantity quantity_type; + typedef boost::math::quaternion type; + + static type value(const boost::math::quaternion >& x) + { + const boost::math::quaternion tmp = + root >(boost::math::quaternion( + x.R_component_1().value(), + x.R_component_2().value(), + x.R_component_3().value(), + x.R_component_4().value())); + + return type(quantity_type::from_value(tmp.R_component_1()), + quantity_type::from_value(tmp.R_component_2()), + quantity_type::from_value(tmp.R_component_3()), + quantity_type::from_value(tmp.R_component_4())); + } +}; +//] + +} // namespace units + +} // namespace boost + +int main(void) +{ + using boost::math::quaternion; + using namespace boost::units; + using namespace boost::units::test; + using boost::units::pow; + + { + //[quaternion_snippet_1 + typedef quantity > length_dimension; + + length_dimension L(quaternion(4.0,3.0,2.0,1.0)*meters); + //] + + std::cout << "+L = " << +L << std::endl + << "-L = " << -L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl + << "L*L = " << L*L << std::endl + << "L/L = " << L/L << std::endl + // unfortunately, without qualification msvc still + // finds boost::math::pow by ADL. + << "L^3 = " << boost::units::pow<3>(L) << std::endl +// << "L^(3/2) = " << pow< static_rational<3,2> >(L) << std::endl +// << "3vL = " << root<3>(L) << std::endl +// << "(3/2)vL = " << root< static_rational<3,2> >(L) << std::endl + << std::endl; + } + + { + //[quaternion_snippet_2 + typedef quaternion > length_dimension; + + length_dimension L(4.0*meters,3.0*meters,2.0*meters,1.0*meters); + //] + + std::cout << "+L = " << +L << std::endl + << "-L = " << -L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl +// << "L*L = " << L*L << std::endl +// << "L/L = " << L/L << std::endl + << "L^3 = " << boost::units::pow<3>(L) << std::endl +// << "L^(3/2) = " << pow< static_rational<3,2> >(L) << std::endl +// << "3vL = " << root<3>(L) << std::endl +// << "(3/2)vL = " << root< static_rational<3,2> >(L) << std::endl + << std::endl; + } + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/radar_beam_height.cpp b/tools/boost_1_65_1/libs/units/example/radar_beam_height.cpp new file mode 100644 index 0000000000000000000000000000000000000000..63752f7cc5ddfff05e3319c0b418ecaa4d888c5e --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/radar_beam_height.cpp @@ -0,0 +1,166 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief radar_beam_height.cpp + +\details +Demonstrate library usage for user test cases suggested by Michael Fawcett. + +Output: +@verbatim + +//[radar_beam_height_output +radar range : 300 nmi +earth radius : 6.37101e+06 m +beam height 1 : 18169.7 m +beam height 2 : 9.81085 nmi +beam height 3 : 18169.7 m +beam height 4 : 9.81085 nmi +beam height approx : 59488.4 ft +beam height approx : 18132.1 m +//] + +@endverbatim +**/ + +#include + +#include +#include +#include +#include +#include + +using boost::units::length_dimension; +using boost::units::pow; +using boost::units::root; +using boost::units::quantity; +using boost::units::unit; + +//[radar_beam_height_class_snippet_1 +namespace nautical { + +struct length_base_unit : + boost::units::base_unit +{ + static std::string name() { return "nautical mile"; } + static std::string symbol() { return "nmi"; } +}; + +typedef boost::units::make_system::type system; + +/// unit typedefs +typedef unit length; + +static const length mile,miles; + +} // namespace nautical + +// helper for conversions between nautical length and si length +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(nautical::length_base_unit, + boost::units::si::meter_base_unit, + double, 1.852e3); +//] + +//[radar_beam_height_class_snippet_2 +namespace imperial { + +struct length_base_unit : + boost::units::base_unit +{ + static std::string name() { return "foot"; } + static std::string symbol() { return "ft"; } +}; + +typedef boost::units::make_system::type system; + +/// unit typedefs +typedef unit length; + +static const length foot,feet; + +} // imperial + +// helper for conversions between imperial length and si length +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(imperial::length_base_unit, + boost::units::si::meter_base_unit, + double, 1.0/3.28083989501312); +//] + +// radar beam height functions +//[radar_beam_height_function_snippet_1 +template +quantity,T> +radar_beam_height(const quantity,T>& radar_range, + const quantity,T>& earth_radius, + T k = 4.0/3.0) +{ + return quantity,T> + (pow<2>(radar_range)/(2.0*k*earth_radius)); +} +//] + +//[radar_beam_height_function_snippet_2 +template +return_type +radar_beam_height(const quantity,T>& radar_range, + const quantity,T>& earth_radius, + T k = 4.0/3.0) +{ + // need to decide which system to use for calculation + const return_type rr(radar_range), + er(earth_radius); + + return return_type(pow<2>(rr)/(2.0*k*er)); +} +//] + +//[radar_beam_height_function_snippet_3 +quantity +radar_beam_height(const quantity& range) +{ + return quantity + (pow<2>(range/(1.23*nautical::miles/root<2>(imperial::feet)))); +} +//] + +int main(void) +{ + using namespace boost::units; + using namespace boost::units::si; + using namespace nautical; + + //[radar_beam_height_snippet_1 + const quantity radar_range(300.0*miles); + const quantity earth_radius(6371.0087714*kilo*meters); + + const quantity beam_height_1(radar_beam_height(quantity(radar_range),earth_radius)); + const quantity beam_height_2(radar_beam_height(radar_range,quantity(earth_radius))); + const quantity beam_height_3(radar_beam_height< quantity >(radar_range,earth_radius)); + const quantity beam_height_4(radar_beam_height< quantity >(radar_range,earth_radius)); + //] + + std::cout << "radar range : " << radar_range << std::endl + << "earth radius : " << earth_radius << std::endl + << "beam height 1 : " << beam_height_1 << std::endl + << "beam height 2 : " << beam_height_2 << std::endl + << "beam height 3 : " << beam_height_3 << std::endl + << "beam height 4 : " << beam_height_4 << std::endl + << "beam height approx : " << radar_beam_height(radar_range) + << std::endl + << "beam height approx : " + << quantity(radar_beam_height(radar_range)) + << std::endl << std::endl; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/runtime_conversion_factor.cpp b/tools/boost_1_65_1/libs/units/example/runtime_conversion_factor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f814c884fae7c5cf0252bb98781850f39f2129d0 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/runtime_conversion_factor.cpp @@ -0,0 +1,72 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +//[runtime_conversion_factor_snippet_1 + +using boost::units::base_dimension; +using boost::units::base_unit; + +static const long currency_base = 1; + +struct currency_base_dimension : base_dimension {}; + +typedef currency_base_dimension::dimension_type currency_type; + +template +struct currency_base_unit : + base_unit, currency_type, currency_base + N> {}; + +typedef currency_base_unit<0> us_dollar_base_unit; +typedef currency_base_unit<1> euro_base_unit; + +typedef us_dollar_base_unit::unit_type us_dollar; +typedef euro_base_unit::unit_type euro; + +// an array of all possible conversions +double conversion_factors[2][2] = { + {1.0, 1.0}, + {1.0, 1.0} +}; + +double get_conversion_factor(long from, long to) { + return(conversion_factors[from][to]); +} + +void set_conversion_factor(long from, long to, double value) { + conversion_factors[from][to] = value; + conversion_factors[to][from] = 1.0 / value; +} + +BOOST_UNITS_DEFINE_CONVERSION_FACTOR_TEMPLATE((long N1)(long N2), + currency_base_unit, + currency_base_unit, + double, get_conversion_factor(N1, N2)); + +//] + +int main() { + boost::units::quantity dollars = 2.00 * us_dollar(); + boost::units::quantity euros(dollars); + set_conversion_factor(0, 1, 2.0); + dollars = static_cast >(euros); + set_conversion_factor(0, 1, .5); + euros = static_cast >(dollars); + double value = euros.value(); // = .5 + if(value != .5) { + return(1); + } else { + return(0); + } +} diff --git a/tools/boost_1_65_1/libs/units/example/runtime_unit.cpp b/tools/boost_1_65_1/libs/units/example/runtime_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5777facd0d291e86b64861bede5c35599e323f36 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/runtime_unit.cpp @@ -0,0 +1,116 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +//[runtime_unit_snippet_1 + +namespace { + +using namespace boost::units; +using imperial::foot_base_unit; + +std::map > known_units; + +} + +quantity calculate(const quantity& t) +{ + return(boost::units::hypot(t, 2.0 * si::meters)); +} + +int main() +{ + known_units["meter"] = 1.0 * si::meters; + known_units["centimeter"] = .01 * si::meters; + known_units["foot"] = + conversion_factor(foot_base_unit::unit_type(), si::meter) * si::meter; + + std::string output_type("meter"); + std::string input; + + while((std::cout << "> ") && (std::cin >> input)) + { + if(!input.empty() && input[0] == '#') + { + std::getline(std::cin, input); + } + else if(input == "exit") + { + break; + } + else if(input == "help") + { + std::cout << "type \"exit\" to exit\n" + "type \"return 'unit'\" to set the return units\n" + "type \"'number' 'unit'\" to do a simple calculation" + << std::endl; + } + else if(input == "return") + { + if(std::cin >> input) + { + if(known_units.find(input) != known_units.end()) + { + output_type = input; + std::cout << "Done." << std::endl; + } + else + { + std::cout << "Unknown unit \"" << input << "\"" + << std::endl; + } + } + else + { + break; + } + } + else + { + try + { + double value = boost::lexical_cast(input); + + if(std::cin >> input) + { + if(known_units.find(input) != known_units.end()) + { + std::cout << static_cast( + calculate(value * known_units[input]) / + known_units[output_type]) + << ' ' << output_type << std::endl; + } + else + { + std::cout << "Unknown unit \"" << input << "\"" + << std::endl; + } + } + else + { + break; + } + } + catch(...) + { + std::cout << "Input error" << std::endl; + } + } + } +} + +//] diff --git a/tools/boost_1_65_1/libs/units/example/runtime_unit_input.txt b/tools/boost_1_65_1/libs/units/example/runtime_unit_input.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c109e6c859f9b351601aa618e199075f1fa91c8 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/runtime_unit_input.txt @@ -0,0 +1,13 @@ +# runtime_unit_input.txt +# +# Copyright (c) 2007-2008 Steven Watanabe +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +return foot +2.0 centimeter +return centimeter +3.0 meter +exit diff --git a/tools/boost_1_65_1/libs/units/example/systems.cpp b/tools/boost_1_65_1/libs/units/example/systems.cpp new file mode 100644 index 0000000000000000000000000000000000000000..877b2fa768e9b01c6a190a30b752145549856d0a --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/systems.cpp @@ -0,0 +1,1072 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief systems.cpp + +\details +Test various non-si units + +Output: +@verbatim + +@endverbatim +**/ + +#define BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(namespace_,unit_name_,dimension_) \ +namespace boost { \ +namespace units { \ +namespace namespace_ { \ +typedef make_system::type unit_name_ ## system_; \ +typedef unit unit_name_ ## _ ## dimension_; \ +static const unit_name_ ## _ ## dimension_ unit_name_ ## s; \ +} \ +} \ +} \ + +#include +#include +#include + +#include +#include +#include + +#include +#include + +// angle base units +#include +#include +#include +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,arcminute,plane_angle) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,arcsecond,plane_angle) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,degree,plane_angle) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,gradian,plane_angle) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,radian,plane_angle) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,revolution,plane_angle) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(angle,steradian,solid_angle) + +// astronomical base units +#include +#include +#include +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,astronomical_unit,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,light_second,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,light_minute,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,light_hour,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,light_day,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,light_year,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(astronomical,parsec,length) + +// imperial base units +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,thou,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,inch,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,foot,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,yard,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,furlong,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,mile,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,league,length) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,grain,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,drachm,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,ounce,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,pound,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,stone,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,quarter,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,hundredweight,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,ton,mass) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,fluid_ounce,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,gill,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,pint,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,quart,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(imperial,gallon,volume) + +// metric base units +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,angstrom,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,fermi,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,micron,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,nautical_mile,length) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,ton,mass) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,day,time) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,hour,time) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,minute,time) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,year,time) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,knot,velocity) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,are,area) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,barn,area) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,hectare,area) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,liter,volume) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,atmosphere,pressure) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,bar,pressure) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,mmHg,pressure) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(metric,torr,pressure) + +// us base units + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,mil,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,inch,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,foot,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,yard,length) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,mile,length) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,grain,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,dram,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,ounce,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,pound,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,hundredweight,mass) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,ton,mass) + +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,minim,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,fluid_dram,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,teaspoon,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,tablespoon,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,fluid_ounce,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,gill,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,cup,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,pint,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,quart,volume) +BOOST_UNITS_DEFINE_SINGLE_UNIT_SYSTEM(us,gallon,volume) + +int main(void) +{ + using namespace boost::units; + + { + using namespace boost::units::angle; + + std::cout << "Testing angle base units..." << std::endl; + + quantity as(1.0*arcseconds); + quantity am(1.0*arcminutes); + quantity d(1.0*degrees); + quantity g(1.0*gradians); + quantity r(1.0*radians); + quantity rev(1.0*revolutions); + + std::cout << as << " = " << quantity(as) << std::endl + << am << " = " << quantity(am) << std::endl + << d << " = " << quantity(d) << std::endl + << g << " = " << quantity(g) << std::endl + << r << " = " << quantity(r) << std::endl + << rev << " = " << quantity(rev) << std::endl + << std::endl; + + std::cout << rev << "/" << as << " = " << quantity(rev/as) << std::endl + << rev << "/" << am << " = " << quantity(rev/am) << std::endl + << rev << "/" << d << " = " << quantity(rev/d) << std::endl + << rev << "/" << g << " = " << quantity(rev/g) << std::endl + << rev << "/" << r << " = " << quantity(rev/r) << std::endl + << std::endl; + + // conversions only work with exponent of +/- 1 in scaled_base_unit? + std::cout << as << " = " << quantity(as) << std::endl + << am << " = " << quantity(am) << std::endl + << d << " = " << quantity(d) << std::endl + << rev << " = " << quantity(rev) << std::endl + << std::endl; + + // conversions only work with exponent of +/- 1 in scaled_base_unit? see arcsecond.hpp + std::cout << as << " = " << quantity(as) << std::endl + << am << " = " << quantity(am) << std::endl + << d << " = " << quantity(d) << std::endl + << rev << " = " << quantity(rev) << std::endl + << std::endl; + + std::cout << as << " = " << quantity(as) << std::endl + << am << " = " << quantity(am) << std::endl + << d << " = " << quantity(d) << std::endl + << rev << " = " << quantity(rev) << std::endl + << std::endl; + + std::cout << as << " = " << quantity(as) << std::endl + << am << " = " << quantity(am) << std::endl + << d << " = " << quantity(d) << std::endl + << rev << " = " << quantity(rev) << std::endl + << std::endl; + + quantity sa1(1.0*steradians); + + std::cout << sa1 << std::endl + << std::endl; + } + + { + using namespace boost::units::astronomical; + + std::cout << "Testing astronomical base units..." << std::endl; + + quantity ls(1.0*light_seconds); + quantity lm(1.0*light_minutes); + quantity au(1.0*astronomical_units); + quantity lh(1.0*light_hours); + quantity ld(1.0*light_days); + quantity ly(1.0*light_years); + quantity ps(1.0*parsecs); + + std::cout << ls << " = " << quantity(ls) << std::endl + << lm << " = " << quantity(lm) << std::endl + << au << " = " << quantity(au) << std::endl + << lh << " = " << quantity(lh) << std::endl + << ld << " = " << quantity(ld) << std::endl + << ly << " = " << quantity(ly) << std::endl + << ps << " = " << quantity(ps) << std::endl + << std::endl; + + std::cout << ly << "/" << ls << " = " << quantity(ly/ls) << std::endl + << ly << "/" << lm << " = " << quantity(ly/lm) << std::endl + << ly << "/" << au << " = " << quantity(ly/au) << std::endl + << ly << "/" << lh << " = " << quantity(ly/ld) << std::endl + << ly << "/" << ld << " = " << quantity(ly/lh) << std::endl + << ly << "/" << ps << " = " << quantity(ly/ps) << std::endl + << std::endl; + + std::cout << ls << " = " << quantity(ls) << std::endl + << lm << " = " << quantity(lm) << std::endl + << lh << " = " << quantity(lh) << std::endl + << ld << " = " << quantity(ld) << std::endl + << ly << " = " << quantity(ly) << std::endl + << std::endl; + + std::cout << ls << " = " << quantity(ls) << std::endl + << lm << " = " << quantity(lm) << std::endl + << lh << " = " << quantity(lh) << std::endl + << ld << " = " << quantity(ld) << std::endl + << ly << " = " << quantity(ly) << std::endl + << std::endl; + + std::cout << ls << " = " << quantity(ls) << std::endl + << lm << " = " << quantity(lm) << std::endl + << lh << " = " << quantity(lh) << std::endl + << ld << " = " << quantity(ld) << std::endl + << ly << " = " << quantity(ly) << std::endl + << std::endl; + + std::cout << ls << " = " << quantity(ls) << std::endl + << lm << " = " << quantity(lm) << std::endl + << lh << " = " << quantity(lh) << std::endl + << ld << " = " << quantity(ld) << std::endl + << ly << " = " << quantity(ly) << std::endl + << std::endl; + + std::cout << ls << " = " << quantity(ls) << std::endl + << lm << " = " << quantity(lm) << std::endl + << lh << " = " << quantity(ld) << std::endl + << ld << " = " << quantity(lh) << std::endl + << ly << " = " << quantity(ly) << std::endl + << std::endl; + } + + { + using namespace boost::units::imperial; + + std::cout << "Testing imperial base units..." << std::endl; + + quantity iml1(1.0*thous); + quantity iml2(1.0*inchs); + quantity iml3(1.0*foots); + quantity iml4(1.0*yards); + quantity iml5(1.0*furlongs); + quantity iml6(1.0*miles); + quantity iml7(1.0*leagues); + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml7 << "/" << iml1 << " = " << quantity(iml7/iml1) << std::endl + << iml7 << "/" << iml2 << " = " << quantity(iml7/iml2) << std::endl + << iml7 << "/" << iml3 << " = " << quantity(iml7/iml3) << std::endl + << iml7 << "/" << iml4 << " = " << quantity(iml7/iml4) << std::endl + << iml7 << "/" << iml5 << " = " << quantity(iml7/iml5) << std::endl + << iml7 << "/" << iml6 << " = " << quantity(iml7/iml6) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << iml6 << " = " << quantity(iml6) << std::endl + << iml7 << " = " << quantity(iml7) << std::endl + << std::endl; + + quantity imm1(1.0*grains); + quantity imm2(1.0*drachms); + quantity imm3(1.0*ounces); + quantity imm4(1.0*pounds); + quantity imm5(1.0*stones); + quantity imm6(1.0*quarters); + quantity imm7(1.0*hundredweights); + quantity imm8(1.0*tons); + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm8 << "/" << imm1 << " = " << quantity(imm8/imm1) << std::endl + << imm8 << "/" << imm2 << " = " << quantity(imm8/imm2) << std::endl + << imm8 << "/" << imm3 << " = " << quantity(imm8/imm3) << std::endl + << imm8 << "/" << imm4 << " = " << quantity(imm8/imm4) << std::endl + << imm8 << "/" << imm5 << " = " << quantity(imm8/imm5) << std::endl + << imm8 << "/" << imm6 << " = " << quantity(imm8/imm6) << std::endl + << imm8 << "/" << imm7 << " = " << quantity(imm8/imm7) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << imm7 << " = " << quantity(imm7) << std::endl + << imm8 << " = " << quantity(imm8) << std::endl + << std::endl; + + quantity imv1(1.0*fluid_ounces); + quantity imv2(1.0*gills); + quantity imv3(1.0*pints); + quantity imv4(1.0*quarts); + quantity imv5(1.0*gallons); + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << std::endl; + + std::cout << imv5 << "/" << imv1 << " = " << quantity(imv5/imv1) << std::endl + << imv5 << "/" << imv2 << " = " << quantity(imv5/imv2) << std::endl + << imv5 << "/" << imv3 << " = " << quantity(imv5/imv3) << std::endl + << imv5 << "/" << imv4 << " = " << quantity(imv5/imv4) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << std::endl; + } + + { + using namespace boost::units::metric; + + std::cout << "Testing metric base units..." << std::endl; + + quantity ml1(1.0*fermis); + quantity ml2(1.0*angstroms); + quantity ml3(1.0*microns); + quantity ml4(1.0*nautical_miles); + + std::cout << ml1 << " = " << quantity(ml1) << std::endl + << ml2 << " = " << quantity(ml2) << std::endl + << ml3 << " = " << quantity(ml3) << std::endl + << ml4 << " = " << quantity(ml4) << std::endl + << std::endl; + + std::cout << ml4 << "/" << ml1 << " = " << quantity(ml4/ml1) << std::endl + << ml4 << "/" << ml2 << " = " << quantity(ml4/ml2) << std::endl + << ml4 << "/" << ml3 << " = " << quantity(ml4/ml3) << std::endl + << std::endl; + + std::cout << ml1 << " = " << quantity(ml1) << std::endl + << ml2 << " = " << quantity(ml2) << std::endl + << ml3 << " = " << quantity(ml3) << std::endl + << ml4 << " = " << quantity(ml4) << std::endl + << std::endl; + + std::cout << ml1 << " = " << quantity(ml1) << std::endl + << ml2 << " = " << quantity(ml2) << std::endl + << ml3 << " = " << quantity(ml3) << std::endl + << ml4 << " = " << quantity(ml4) << std::endl + << std::endl; + + std::cout << ml1 << " = " << quantity(ml1) << std::endl + << ml2 << " = " << quantity(ml2) << std::endl + << ml3 << " = " << quantity(ml3) << std::endl + << ml4 << " = " << quantity(ml4) << std::endl + << std::endl; + + std::cout << ml1 << " = " << quantity(ml1) << std::endl + << ml2 << " = " << quantity(ml2) << std::endl + << ml3 << " = " << quantity(ml3) << std::endl + << ml4 << " = " << quantity(ml4) << std::endl + << std::endl; + + quantity mm1(1.0*tons); + + std::cout << mm1 << " = " << quantity(mm1) << std::endl + //<< quantity(mm1) << std::endl // this should work... + << std::endl; + + quantity mt1(1.0*minutes); + quantity mt2(1.0*hours); + quantity mt3(1.0*days); + quantity mt4(1.0*years); + + std::cout << mt1 << " = " << quantity(mt1) << std::endl + << mt2 << " = " << quantity(mt2) << std::endl + << mt3 << " = " << quantity(mt3) << std::endl + << mt4 << " = " << quantity(mt4) << std::endl + << std::endl; + + std::cout << mt4 << "/" << mt1 << " = " << quantity(mt4/mt1) << std::endl + << mt4 << "/" << mt2 << " = " << quantity(mt4/mt2) << std::endl + << mt4 << "/" << mt3 << " = " << quantity(mt4/mt3) << std::endl + << std::endl; + + std::cout << mt1 << " = " << quantity(mt1) << std::endl + << mt2 << " = " << quantity(mt2) << std::endl + << mt3 << " = " << quantity(mt3) << std::endl + << mt4 << " = " << quantity(mt4) << std::endl + << std::endl; + + std::cout << mt1 << " = " << quantity(mt1) << std::endl + << mt2 << " = " << quantity(mt2) << std::endl + << mt3 << " = " << quantity(mt3) << std::endl + << mt4 << " = " << quantity(mt4) << std::endl + << std::endl; + + std::cout << mt1 << " = " << quantity(mt1) << std::endl + << mt2 << " = " << quantity(mt2) << std::endl + << mt3 << " = " << quantity(mt3) << std::endl + << mt4 << " = " << quantity(mt4) << std::endl + << std::endl; + + std::cout << mt1 << " = " << quantity(mt1) << std::endl + << mt2 << " = " << quantity(mt2) << std::endl + << mt3 << " = " << quantity(mt3) << std::endl + << mt4 << " = " << quantity(mt4) << std::endl + << std::endl; + + quantity ms1(1.0*knots); + + std::cout << ms1 << " = " << quantity(ms1) << std::endl + << std::endl; + + quantity ma1(1.0*barns); + quantity ma2(1.0*ares); + quantity ma3(1.0*hectares); + + std::cout << ma1 << " = " << quantity(ma1) << std::endl + << ma2 << " = " << quantity(ma2) << std::endl + << ma3 << " = " << quantity(ma3) << std::endl + << std::endl; + + std::cout << ma3 << "/" << ma1 << " = " << quantity(ma3/ma1) << std::endl + << ma3 << "/" << ma2 << " = " << quantity(ma3/ma2) << std::endl + << std::endl; + + std::cout << ma1 << " = " << quantity(ma1) << std::endl + << ma2 << " = " << quantity(ma2) << std::endl + << ma3 << " = " << quantity(ma3) << std::endl + << std::endl; + + std::cout << ma1 << " = " << quantity(ma1) << std::endl + << ma2 << " = " << quantity(ma2) << std::endl + << ma3 << " = " << quantity(ma3) << std::endl + << std::endl; + + std::cout << ma1 << " = " << quantity(ma1) << std::endl + << ma2 << " = " << quantity(ma2) << std::endl + << ma3 << " = " << quantity(ma3) << std::endl + << std::endl; + + quantity mv1(1.0*liters); + + std::cout << mv1 << " = " << quantity(mv1) << std::endl + << std::endl; + + quantity mp1(1.0*mmHgs); + quantity mp2(1.0*torrs); + quantity mp3(1.0*bars); + quantity mp4(1.0*atmospheres); + + std::cout << mp1 << " = " << quantity(mp1) << std::endl + << mp2 << " = " << quantity(mp2) << std::endl + << mp3 << " = " << quantity(mp3) << std::endl + << mp4 << " = " << quantity(mp4) << std::endl + << std::endl; + + std::cout << mp4 << "/" << mp1 << " = " << quantity(mp4/mp1) << std::endl + << mp4 << "/" << mp2 << " = " << quantity(mp4/mp2) << std::endl + << mp4 << "/" << mp3 << " = " << quantity(mp4/mp3) << std::endl + << std::endl; + + std::cout << mp1 << " = " << quantity(mp1) << std::endl + << mp2 << " = " << quantity(mp2) << std::endl + << mp3 << " = " << quantity(mp3) << std::endl + << mp4 << " = " << quantity(mp4) << std::endl + << std::endl; + + std::cout << mp1 << " = " << quantity(mp1) << std::endl + << mp2 << " = " << quantity(mp2) << std::endl + << mp3 << " = " << quantity(mp3) << std::endl + << mp4 << " = " << quantity(mp4) << std::endl + << std::endl; + + std::cout << mp1 << " = " << quantity(mp1) << std::endl + << mp2 << " = " << quantity(mp2) << std::endl + << mp3 << " = " << quantity(mp3) << std::endl + << mp4 << " = " << quantity(mp4) << std::endl + << std::endl; + + std::cout << mp1 << " = " << quantity(mp1) << std::endl + << mp2 << " = " << quantity(mp2) << std::endl + << mp3 << " = " << quantity(mp3) << std::endl + << mp4 << " = " << quantity(mp4) << std::endl + << std::endl; + } + + { + using namespace boost::units::us; + + std::cout << "Testing U.S. customary base units..." << std::endl; + + quantity iml1(1.0*mils); + quantity iml2(1.0*inchs); + quantity iml3(1.0*foots); + quantity iml4(1.0*yards); + quantity iml5(1.0*miles); + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << std::endl; + + std::cout << iml5 << "/" << iml1 << " = " << quantity(iml5/iml1) << std::endl + << iml5 << "/" << iml2 << " = " << quantity(iml5/iml2) << std::endl + << iml5 << "/" << iml3 << " = " << quantity(iml5/iml3) << std::endl + << iml5 << "/" << iml4 << " = " << quantity(iml5/iml4) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << std::endl; + + std::cout << iml1 << " = " << quantity(iml1) << std::endl + << iml2 << " = " << quantity(iml2) << std::endl + << iml3 << " = " << quantity(iml3) << std::endl + << iml4 << " = " << quantity(iml4) << std::endl + << iml5 << " = " << quantity(iml5) << std::endl + << std::endl; + + quantity imm1(1.0*grains); + quantity imm2(1.0*drams); + quantity imm3(1.0*ounces); + quantity imm4(1.0*pounds); + quantity imm5(1.0*hundredweights); + quantity imm6(1.0*tons); + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + std::cout << imm6 << "/" << imm1 << " = " << quantity(imm6/imm1) << std::endl + << imm6 << "/" << imm2 << " = " << quantity(imm6/imm2) << std::endl + << imm6 << "/" << imm3 << " = " << quantity(imm6/imm3) << std::endl + << imm6 << "/" << imm4 << " = " << quantity(imm6/imm4) << std::endl + << imm6 << "/" << imm5 << " = " << quantity(imm6/imm5) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + std::cout << imm1 << " = " << quantity(imm1) << std::endl + << imm2 << " = " << quantity(imm2) << std::endl + << imm3 << " = " << quantity(imm3) << std::endl + << imm4 << " = " << quantity(imm4) << std::endl + << imm5 << " = " << quantity(imm5) << std::endl + << imm6 << " = " << quantity(imm6) << std::endl + << std::endl; + + quantity imv1(1.0*minims); + quantity imv2(1.0*fluid_drams); + quantity imv3(1.0*teaspoons); + quantity imv4(1.0*tablespoons); + quantity imv5(1.0*fluid_ounces); + quantity imv6(1.0*gills); + quantity imv7(1.0*cups); + quantity imv8(1.0*pints); + quantity imv9(1.0*quarts); + quantity imv10(1.0*gallons); + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv10 << "/" << imv1 << " = " << quantity(imv10/imv1) << std::endl + << imv10 << "/" << imv2 << " = " << quantity(imv10/imv2) << std::endl + << imv10 << "/" << imv3 << " = " << quantity(imv10/imv3) << std::endl + << imv10 << "/" << imv4 << " = " << quantity(imv10/imv4) << std::endl + << imv10 << "/" << imv5 << " = " << quantity(imv10/imv5) << std::endl + << imv10 << "/" << imv6 << " = " << quantity(imv10/imv6) << std::endl + << imv10 << "/" << imv7 << " = " << quantity(imv10/imv7) << std::endl + << imv10 << "/" << imv8 << " = " << quantity(imv10/imv8) << std::endl + << imv10 << "/" << imv9 << " = " << quantity(imv10/imv9) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + + std::cout << imv1 << " = " << quantity(imv1) << std::endl + << imv2 << " = " << quantity(imv2) << std::endl + << imv3 << " = " << quantity(imv3) << std::endl + << imv4 << " = " << quantity(imv4) << std::endl + << imv5 << " = " << quantity(imv5) << std::endl + << imv6 << " = " << quantity(imv6) << std::endl + << imv7 << " = " << quantity(imv7) << std::endl + << imv8 << " = " << quantity(imv8) << std::endl + << imv9 << " = " << quantity(imv9) << std::endl + << imv10 << " = " << quantity(imv10) << std::endl + << std::endl; + } + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/temperature.cpp b/tools/boost_1_65_1/libs/units/example/temperature.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f6b434214d3d891570c6cbe9e6a716383c8dfa74 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/temperature.cpp @@ -0,0 +1,98 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief temperature.cpp + +\details +Conversions between Fahrenheit and Kelvin for absolute temperatures and +temperature differences. + +Output: +@verbatim + +//[ temperature_output_1 +{ 32 } F +{ 273.15 } K +{ 273.15 } K +[ 32 ] F +[ 17.7778 ] K +[ 17.7778 ] K +//] + +@endverbatim +**/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace boost::units; + +namespace boost { + +namespace units { + +namespace fahrenheit { + +//[temperature_snippet_1 +typedef temperature::fahrenheit_base_unit::unit_type temperature; +typedef get_system::type system; + +BOOST_UNITS_STATIC_CONSTANT(degree,temperature); +BOOST_UNITS_STATIC_CONSTANT(degrees,temperature); +//] + +} // fahrenheit + +} // namespace units + +} // namespace boost + +int main() +{ + //[temperature_snippet_3 + quantity > T1p( + 32.0*absolute()); + quantity T1v( + 32.0*fahrenheit::degrees); + + quantity > T2p(T1p); + quantity T2v(T1v); + //] + + typedef conversion_helper< + quantity >, + quantity > > absolute_conv_type; + typedef conversion_helper< + quantity, + quantity > relative_conv_type; + + std::cout << T1p << std::endl + << absolute_conv_type::convert(T1p) << std::endl + << T2p << std::endl + << T1v << std::endl + << relative_conv_type::convert(T1v) << std::endl + << T2v << std::endl + << std::endl; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/example/test_system.hpp b/tools/boost_1_65_1/libs/units/example/test_system.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0eaaa97377f713e6671b22b479d858c10a969083 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/test_system.hpp @@ -0,0 +1,153 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef MCS_TEST_SYSTEM_HPP +#define MCS_TEST_SYSTEM_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +//[test_system_snippet_1 + +/// base dimension of length +struct length_base_dimension : base_dimension { }; +/// base dimension of mass +struct mass_base_dimension : base_dimension { }; +/// base dimension of time +struct time_base_dimension : base_dimension { }; + +//] + +#if 0 +//[test_system_snippet_2 + +typedef make_dimension_list< + boost::mpl::list< dim< length_base_dimension,static_rational<1> > > +>::type length_dimension; + +typedef make_dimension_list< + boost::mpl::list< dim< mass_base_dimension,static_rational<1> > > +>::type mass_dimension; + +typedef make_dimension_list< + boost::mpl::list< dim< time_base_dimension,static_rational<1> > > +>::type time_dimension; + +//] +#endif + +//[test_system_snippet_3 +typedef length_base_dimension::dimension_type length_dimension; +typedef mass_base_dimension::dimension_type mass_dimension; +typedef time_base_dimension::dimension_type time_dimension; +//] + +#if 0 +//[test_system_snippet_4 + +typedef make_dimension_list< + boost::mpl::list< dim< length_base_dimension,static_rational<2> > > +>::type area_dimension; + +typedef make_dimension_list< + boost::mpl::list< dim< mass_base_dimension,static_rational<1> >, + dim< length_base_dimension,static_rational<2> >, + dim< time_base_dimension,static_rational<-2> > > +>::type energy_dimension; + +//] +#endif + +//[test_system_snippet_5 +typedef derived_dimension::type area_dimension; +typedef derived_dimension::type energy_dimension; +//] + +namespace test { + +//[test_system_snippet_6 + +struct meter_base_unit : base_unit { }; +struct kilogram_base_unit : base_unit { }; +struct second_base_unit : base_unit { }; + +typedef make_system< + meter_base_unit, + kilogram_base_unit, + second_base_unit>::type mks_system; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit mass; +typedef unit time; + +typedef unit area; +typedef unit energy; +//] + +//[test_system_snippet_7 +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(meter,length); +BOOST_UNITS_STATIC_CONSTANT(meters,length); +BOOST_UNITS_STATIC_CONSTANT(kilogram,mass); +BOOST_UNITS_STATIC_CONSTANT(kilograms,mass); +BOOST_UNITS_STATIC_CONSTANT(second,time); +BOOST_UNITS_STATIC_CONSTANT(seconds,time); + +BOOST_UNITS_STATIC_CONSTANT(square_meter,area); +BOOST_UNITS_STATIC_CONSTANT(square_meters,area); +BOOST_UNITS_STATIC_CONSTANT(joule,energy); +BOOST_UNITS_STATIC_CONSTANT(joules,energy); +//] + +} // namespace test + +//[test_system_snippet_8 +template<> struct base_unit_info +{ + static std::string name() { return "meter"; } + static std::string symbol() { return "m"; } +}; +//] + +template<> struct base_unit_info +{ + static std::string name() { return "kilogram"; } + static std::string symbol() { return "kg"; } +}; + +template<> struct base_unit_info +{ + static std::string name() { return "second"; } + static std::string symbol() { return "s"; } +}; + +} // namespace units + +} // namespace boost + +#endif // MCS_TEST_SYSTEM_HPP diff --git a/tools/boost_1_65_1/libs/units/example/tutorial.cpp b/tools/boost_1_65_1/libs/units/example/tutorial.cpp new file mode 100644 index 0000000000000000000000000000000000000000..855cce6161e3eafcd27f07d8f257ea37dda34eca --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/tutorial.cpp @@ -0,0 +1,94 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file tutorial.cpp + +\brief Basic tutorial using SI units. + +\details +Tutorial +Defines a function that computes the work, in joules, +done by exerting a force in newtons over a specified distance +in meters and outputs the result to std::cout. + +Also code for computing the complex impedance +using std::complex as the value type. + +Output: +@verbatim +//[tutorial_output +F = 2 N +dx = 2 m +E = 4 J + +V = (12.5,0) V +I = (3,4) A +Z = (1.5,-2) Ohm +I*Z = (12.5,0) V +I*Z == V? true +//] +@endverbatim +*/ + +//[tutorial_code +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +using namespace boost::units; +using namespace boost::units::si; + +quantity +work(const quantity& F, const quantity& dx) +{ + return F * dx; // Defines the relation: work = force * distance. +} + +int main() +{ + /// Test calculation of work. + quantity F(2.0 * newton); // Define a quantity of force. + quantity dx(2.0 * meter); // and a distance, + quantity E(work(F,dx)); // and calculate the work done. + + std::cout << "F = " << F << std::endl + << "dx = " << dx << std::endl + << "E = " << E << std::endl + << std::endl; + + /// Test and check complex quantities. + typedef std::complex complex_type; // double real and imaginary parts. + + // Define some complex electrical quantities. + quantity v = complex_type(12.5, 0.0) * volts; + quantity i = complex_type(3.0, 4.0) * amperes; + quantity z = complex_type(1.5, -2.0) * ohms; + + std::cout << "V = " << v << std::endl + << "I = " << i << std::endl + << "Z = " << z << std::endl + // Calculate from Ohm's law voltage = current * resistance. + << "I * Z = " << i * z << std::endl + // Check defined V is equal to calculated. + << "I * Z == V? " << std::boolalpha << (i * z == v) << std::endl + << std::endl; + return 0; +} +//] diff --git a/tools/boost_1_65_1/libs/units/example/unit.cpp b/tools/boost_1_65_1/libs/units/example/unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..934d557330523f41e57b32e6fffd39bc5f2d122d --- /dev/null +++ b/tools/boost_1_65_1/libs/units/example/unit.cpp @@ -0,0 +1,73 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief unit.cpp + +\details +Test unit algebra. + +Output: +@verbatim + +//[unit_output +L = m +L+L = m +L-L = m +L/L = dimensionless +meter*meter = m^2 +M*(L/T)*(L/T) = m^2 kg s^-2 +M*(L/T)^2 = m^2 kg s^-2 +L^3 = m^3 +L^(3/2) = m^(3/2) +2vM = kg^(1/2) +(3/2)vM = kg^(2/3) +//] + +@endverbatim +**/ + +#include + +#include "test_system.hpp" + +#include + +int main() +{ + using namespace boost::units; + using namespace boost::units::test; + + //[unit_snippet_1 + const length L; + const mass M; + // needs to be namespace-qualified because of global time definition + const boost::units::test::time T; + const energy E; + //] + + std::cout << "L = " << L << std::endl + << "L+L = " << L+L << std::endl + << "L-L = " << L-L << std::endl + << "L/L = " << L/L << std::endl + << "meter*meter = " << meter*meter << std::endl + << "M*(L/T)*(L/T) = " << M*(L/T)*(L/T) << std::endl + << "M*(L/T)^2 = " << M*pow<2>(L/T) << std::endl + << "L^3 = " << pow<3>(L) << std::endl + << "L^(3/2) = " << pow >(L) + << std::endl + << "2vM = " << root<2>(M) << std::endl + << "(3/2)vM = " << root >(M) + << std::endl; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/images/form_0.png b/tools/boost_1_65_1/libs/units/images/form_0.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8b61e2bb693bfc345cf54f7a14b859f54caa09 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_0.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_1.png b/tools/boost_1_65_1/libs/units/images/form_1.png new file mode 100644 index 0000000000000000000000000000000000000000..aa6ec9143740fa4288bd7687ea3465c09672ec6d Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_1.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_10.png b/tools/boost_1_65_1/libs/units/images/form_10.png new file mode 100644 index 0000000000000000000000000000000000000000..debfc1d77b80ec661735ac727dd0eae10f56c251 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_10.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_11.png b/tools/boost_1_65_1/libs/units/images/form_11.png new file mode 100644 index 0000000000000000000000000000000000000000..867920440c9e8a7bffd70fa46dd4cd434406aa28 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_11.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_12.png b/tools/boost_1_65_1/libs/units/images/form_12.png new file mode 100644 index 0000000000000000000000000000000000000000..1e92526b319b05fc9e58c9b1adcb1334516f2101 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_12.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_13.png b/tools/boost_1_65_1/libs/units/images/form_13.png new file mode 100644 index 0000000000000000000000000000000000000000..d4fe57249cdf259d91e200de6b60a0a85a01eeb8 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_13.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_14.png b/tools/boost_1_65_1/libs/units/images/form_14.png new file mode 100644 index 0000000000000000000000000000000000000000..8e2e28232c065a3656406989af176e7fb6887904 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_14.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_15.png b/tools/boost_1_65_1/libs/units/images/form_15.png new file mode 100644 index 0000000000000000000000000000000000000000..ef47182bdf9083e0de40c33eb8ccd0be5059a2bc Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_15.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_2.png b/tools/boost_1_65_1/libs/units/images/form_2.png new file mode 100644 index 0000000000000000000000000000000000000000..06bb0ec08dabe6a4a90fe365fe66c0628e8bbe68 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_2.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_3.png b/tools/boost_1_65_1/libs/units/images/form_3.png new file mode 100644 index 0000000000000000000000000000000000000000..5a59744e228727f686a7c2b791e798d339bf7aa0 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_3.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_4.png b/tools/boost_1_65_1/libs/units/images/form_4.png new file mode 100644 index 0000000000000000000000000000000000000000..4b1c9b2d71ef40994df9cbb35d66de19373b2918 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_4.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_5.png b/tools/boost_1_65_1/libs/units/images/form_5.png new file mode 100644 index 0000000000000000000000000000000000000000..a641eb61c51c1008c2faaa24c00e4a62d1c03c74 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_5.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_6.png b/tools/boost_1_65_1/libs/units/images/form_6.png new file mode 100644 index 0000000000000000000000000000000000000000..0075f7afa43d4525745870a2b44cd528a765ce9b Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_6.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_7.png b/tools/boost_1_65_1/libs/units/images/form_7.png new file mode 100644 index 0000000000000000000000000000000000000000..66b89ac5e73c2d085e427ab47ef4a900462fcc4d Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_7.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_8.png b/tools/boost_1_65_1/libs/units/images/form_8.png new file mode 100644 index 0000000000000000000000000000000000000000..f272bead788fb1e46bc3a677f84c8130bad797fe Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_8.png differ diff --git a/tools/boost_1_65_1/libs/units/images/form_9.png b/tools/boost_1_65_1/libs/units/images/form_9.png new file mode 100644 index 0000000000000000000000000000000000000000..cbf21704bdbe6b61860844b64677193bfa576434 Binary files /dev/null and b/tools/boost_1_65_1/libs/units/images/form_9.png differ diff --git a/tools/boost_1_65_1/libs/units/index.html b/tools/boost_1_65_1/libs/units/index.html new file mode 100644 index 0000000000000000000000000000000000000000..d03ad5c7b5ca50cf1d9f5d0777517304a2fe62a2 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/index.html @@ -0,0 +1,22 @@ + + + + + +Automatic redirection failed, please go to +
../../doc/html/boost_units.html +
+ +Boost.Units - A C++ library for zero-overhead dimensional analysis and +unit/quantity manipulation and conversion
+
+Copyright (C) 2003-2008 Matthias Christian Schabel
+Copyright (C) 2007-2008 Steven Watanabe
+
+Distributed under the Boost Software License, Version 1.0. (See +accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt)
+
+
+ + diff --git a/tools/boost_1_65_1/libs/units/meta/libraries.json b/tools/boost_1_65_1/libs/units/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..4e8bdb9adf8b06bc46a41300d8eef90afb8bd97a --- /dev/null +++ b/tools/boost_1_65_1/libs/units/meta/libraries.json @@ -0,0 +1,16 @@ +{ + "key": "units", + "name": "Units", + "authors": [ + "Matthias Schabel", + "Steven Watanabe" + ], + "description": "Zero-overhead dimensional analysis and unit/quantity manipulation and conversion.", + "category": [ + "Domain" + ], + "maintainers": [ + "Jürgen Hunold ", + "Steven Watanabe " + ] +} diff --git a/tools/boost_1_65_1/libs/units/test/Jamfile.v2 b/tools/boost_1_65_1/libs/units/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..16b9ac64d1b33cb7ac27e61b12e6163c11e3b2aa --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/Jamfile.v2 @@ -0,0 +1,77 @@ +# Jamfile.v2 +# +# Copyright (c) 2007-2009 +# Steven Watanabe +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt + +import testing ; + +warning-options = all on ; +warning-compilers = + msvc +; + +project boost/units/test : + requirements + /boost//headers + msvc:on + $(warning-compilers):$(warning-options) + # This warning comes from the test library. + msvc:"/wd4701" + # The comes from the exception library + msvc,7.1:"/wd4800" +; + +alias test_framework : /boost//unit_test_framework/off ; + +compile test_predicates.cpp ; +compile test_negative_denominator.cpp ; +compile test_dimensionless_ice1.cpp ; +compile test_dimensionless_ice2.cpp ; +compile test_mixed_value_types.cpp ; +compile test_complicated_system.cpp ; +compile test_reduce_unit.cpp ; +compile test_unscale.cpp ; +compile test_constants.cpp ; + +run test_dimensionless_quantity.cpp ; +run test_implicit_conversion.cpp ; +run test_quantity.cpp ; +run test_unit.cpp ; +run test_conversion.cpp test_framework ; +run test_base_dimension.cpp ; +run test_absolute.cpp ; +run test_default_conversion.cpp ; +run test_cmath.cpp ; +run test_limits.cpp ; +run test_custom_unit.cpp ; +run test_scaled_conversion.cpp ; +run test_lambda.cpp ; +run test_scaled_unit.cpp test_framework ; +run test_output.cpp test_framework /boost//regex/off : : : always_show_run_output ; +run test_trig.cpp test_framework ; +run test_information_units.cpp test_framework ; + +compile-fail fail_implicit_conversion.cpp ; +compile-fail fail_quantity_construct.cpp ; +compile-fail fail_quantity_assign.cpp ; +compile-fail fail_quantity_add.cpp ; +compile-fail fail_quantity_subtract.cpp ; +compile-fail fail_quantity_add_assign.cpp ; +compile-fail fail_quantity_sub_assign.cpp ; +compile-fail fail_quantity_scalar_add.cpp ; +compile-fail fail_quantity_scalar_sub.cpp ; +compile-fail fail_quantity_unit_add.cpp ; +compile-fail fail_quantity_unit_subtract.cpp ; +compile-fail fail_scalar_quantity_add.cpp ; +compile-fail fail_scalar_quantity_sub.cpp ; +compile-fail fail_unit_quantity_add.cpp ; +compile-fail fail_unit_quantity_subtract.cpp ; +compile-fail fail_adl_detail.cpp ; +compile-fail fail_heterogeneous_unit.cpp ; +compile-fail fail_base_dimension.cpp ; +compile-fail fail_add_temperature.cpp ; +compile-fail fail_quantity_non_unit.cpp ; diff --git a/tools/boost_1_65_1/libs/units/test/check_conversion_defs.cpp b/tools/boost_1_65_1/libs/units/test/check_conversion_defs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cb7ff56baf96f6f3f06fcadb100b85b67c77d4fa --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/check_conversion_defs.cpp @@ -0,0 +1,159 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace filesystem = boost::filesystem; + +//struct stop { +// stop() { char c; std::cin >> c; } +//} stop_; + +boost::regex whitespace("\\s*"); +boost::regex blank_line("\\A(?://.*$|\\s)*"); + +boost::regex include_guard("#ifndef (\\w+)\n#define \\1\n"); +boost::regex base_unit("(\\w*_base_unit)(?:;| :)"); + +std::pair get_base_unit_and_include_guard(const filesystem::path& path) { + filesystem::ifstream in(path); + std::string contents(std::istreambuf_iterator(in.rdbuf()), std::istreambuf_iterator()); + in.close(); + boost::smatch include_guard_match; + boost::regex_search(contents, include_guard_match, include_guard); + boost::smatch base_unit_match; + boost::regex_search(contents, base_unit_match, base_unit); + std::cout << "creating map entry: " << base_unit_match[1].str() << " -> "<< include_guard_match[1].str() << std::endl; + return(std::make_pair(base_unit_match[1].str(), include_guard_match[1].str())); +} + +int main() { + std::cout << "In main" << std::endl; + std::map include_guards; + for(filesystem::directory_iterator begin(filesystem::path("../../../boost/units/systems/base_units")), end; begin != end; ++begin) { + if(begin->status().type() == filesystem::regular_file) { + std::cout << "reading file: " << begin->path() << std::endl; + include_guards.insert(get_base_unit_and_include_guard(begin->path())); + } + } + + std::cout << "reading conversions file" << std::endl; + filesystem::ifstream conversions_file(filesystem::path("../../../boost/units/systems/base_units/detail/conversions.hpp")); + + std::string line; + int line_count = 0; + + boost::smatch match; + + std::set conversion_guards; + + try { + +boost::regex include_guard_regex("#if defined\\((\\w+)\\) && defined\\((\\w+)\\) &&\\\\"); +std::cout << __LINE__ << std::endl; +boost::regex conversion_guard_regex(" !defined\\((\\w+)\\)"); +std::cout << __LINE__ << std::endl; +boost::regex set_conversion_guard(" #define (\\w+)"); +std::cout << __LINE__ << std::endl; +boost::regex include_conversion(" #include "); +std::cout << __LINE__ << std::endl; +boost::regex include_absolute(" #include "); +std::cout << __LINE__ << std::endl; +boost::regex define_conversion_factor(" BOOST_UNITS_DEFINE_CONVERSION_FACTOR\\(boost::units::(\\w+_base_unit), boost::units::(\\w+_base_unit), \\w+, (?:[\\d\\.e\\-/ ]*|one\\(\\))\\);"); +std::cout << __LINE__ << std::endl; +boost::regex define_conversion_offset(" BOOST_UNITS_DEFINE_CONVERSION_OFFSET\\(boost::units::(\\w+_base_unit), boost::units::(\\w+_base_unit), \\w+, [\\d\\.e+\\* \\-/]*\\);"); +std::cout << __LINE__ << std::endl; +boost::regex endif("#endif"); +std::cout << __LINE__ << std::endl; + + while(std::getline(conversions_file, line)) { + ++line_count; + std::cout << "on line: " << line_count << std::endl; + if(boost::regex_match(line, match, blank_line)) { + continue; + } else if(boost::regex_match(line, match, include_guard_regex)) { + std::string guard1, guard2, unit1, unit2, conversion_guard; + bool uses_absolute = false; + + guard1 = match[1].str(); + guard2 = match[2].str(); + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; + if(!boost::regex_match(line, match, conversion_guard_regex)) { std::cerr << "error on line: " << line_count << std::endl; return(1); } + + conversion_guard = match[1].str(); + if(!conversion_guards.insert(conversion_guard).second){ std::cerr << "error on line: " << line_count << std::endl; return(1); } + + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; + if(!boost::regex_match(line, match, set_conversion_guard)) { std::cerr << "error on line: " << line_count << std::endl; return(1); } +std::cout << __LINE__ << std::endl; + + if(match[1].str() != conversion_guard) { std::cerr << "error on line: " << line_count << std::endl; return(1); } + + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; + if(!boost::regex_match(line, match, include_conversion)) { std::cerr << "error on line: " << line_count << std::endl; return(1); } +std::cout << __LINE__ << std::endl; + + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; + if(boost::regex_match(line, match, include_absolute)) { + uses_absolute = true; + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; + } + +std::cout << __LINE__ << std::endl; + if(!boost::regex_match(line, match, define_conversion_factor)) { std::cerr << "error on line: " << line_count << std::endl; return(1); } + +std::cout << __LINE__ << ": " << line << std::endl; + unit1 = match[1].str(); + unit2 = match[2].str(); + if(!((include_guards[unit1] == guard1 && include_guards[unit2] == guard2) || + (include_guards[unit1] == guard2 && include_guards[unit2] == guard1))) { + std::cerr << "guard1: " << guard1 << std::endl; + std::cerr << "guard2: " << guard2 << std::endl; + std::cerr << "unit1: " << unit1 << std::endl; + std::cerr << "unit2: " << unit2 << std::endl; + std::cerr << "include_guards[unit1]: " << include_guards[unit1] << std::endl; + std::cerr << "include_guards[unit2]: " << include_guards[unit2] << std::endl; + { std::cerr << "error on line: " << line_count << std::endl; return(1); } + } +std::cout << __LINE__ << std::endl; + + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; +std::cout << __LINE__ << std::endl; + if(boost::regex_match(line, match, define_conversion_offset)) { + if(!uses_absolute) { std::cerr << "error on line: " << line_count << std::endl; return(1); } +std::cout << __LINE__ << std::endl; + if(match[1].str() != unit1 || match[2].str() != unit2) { std::cerr << "error on line: " << line_count << std::endl; return(1); } + if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count; + } else { + if(uses_absolute) { std::cerr << "error on line: " << line_count << std::endl; return(1); } + } +std::cout << __LINE__ << std::endl; + + + if(!boost::regex_match(line, match, endif)) { std::cerr << "error on line: " << line_count << std::endl; return(1); } + + } + } + + } catch(std::exception& e) { + std::cerr << e.what() << std::endl; + return(1); + } + +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_add_temperature.cpp b/tools/boost_1_65_1/libs/units/test/fail_add_temperature.cpp new file mode 100644 index 0000000000000000000000000000000000000000..979b2363385c24f20786d5234cb44defc6a66083 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_add_temperature.cpp @@ -0,0 +1,38 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_add_temperature.cpp + +\details +Verify that adding two absolute temeratures fails miserably. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include + +namespace bu = boost::units; + +int main(int,char *[]) +{ + + bu::quantity > q(2.0 * bu::absolute()); + + q += q; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_adl_detail.cpp b/tools/boost_1_65_1/libs/units/test/fail_adl_detail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b44788df9a940674c4070dd67ee65a2962ef37fe --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_adl_detail.cpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_adl_detail.cpp + +\details +make sure that namespace detail is not pulled in by ADL. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +namespace boost { +namespace units { +namespace detail { + + template + void this_function_should_not_be_found_by_adl(const T&) {}; + +} +} +} + +int main(int argc,char *argv[]) +{ + + bu::quantity q; + + this_function_should_not_be_found_by_adl(q); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_base_dimension.cpp b/tools/boost_1_65_1/libs/units/test/fail_base_dimension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1dd7a4a047440d046b27045b9238eefd49e4b03d --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_base_dimension.cpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_base_dimension.cpp + +\details +make sure that trying to use the same ordinal for multiple +base dimensions fails. + +Output: +@verbatim +@endverbatim +**/ + +#include + +struct dim1 : boost::units::base_dimension {}; +struct dim2 : boost::units::base_dimension {}; + +int main() +{ +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_heterogeneous_unit.cpp b/tools/boost_1_65_1/libs/units/test/fail_heterogeneous_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c0f7692e6427cbe9a76455bd41089989da7495cb --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_heterogeneous_unit.cpp @@ -0,0 +1,46 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_heterogeneous_unit.cpp + +\details +make sure that trying to bind a heterogeneous system to a different dimension fails. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include +#include +//#include +//#include + +namespace bu = boost::units; + +template +bu::quantity > f(bu::quantity > l) { + return(static_cast > >(f(static_cast >(l)))); +} +bu::quantity f(bu::quantity l) { + return(l * l * 2.0 * bu::si::kilograms / bu::pow<2>(bu::si::seconds)); +} + +int main() { + + f(1.0 * bu::pow<2>(bu::si::meters) / bu::cgs::centimeters); + + return(0); +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_implicit_conversion.cpp b/tools/boost_1_65_1/libs/units/test/fail_implicit_conversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bedef1b57c8a5a60a4e0b25a2b49352b8f9d79dc --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_implicit_conversion.cpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_implicit_conversion.cpp + +\details +Test implicit conversions for quantity. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include + +namespace bu = boost::units; + +int main(int,char *[]) +{ + const bu::quantity T1(2.0 * bu::si::meters); + const bu::quantity T2 = T1; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_add.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_add.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e7e37d48807b350ea6bdfb80822452a3d984de43 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_add.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_add.cpp + +\details +Test addition of quantities with different dimensions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 * bu::si::seconds + 2.0 * bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_add_assign.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_add_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f31df61508ea312d8f2282fe3895571f9edb25f4 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_add_assign.cpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_add_assign.cpp + +\details +Test += of quantity from different dimensions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int,char *[]) +{ + + bu::quantity T1; + T1 += 2.0 * bu::si::seconds; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_assign.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f48bf2111a174ae916e02fee1384ac85f5c89b1 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_assign.cpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_assign.cpp + +\details +Test assignment of quantity from different dimensions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + const bu::quantity T1; + T1 = 2.0 * bu::si::seconds; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_construct.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_construct.cpp new file mode 100644 index 0000000000000000000000000000000000000000..945065834ef660efc321dec82807687eff56efa9 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_construct.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_construct.cpp + +\details +Test construction of quantity from different dimensions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int,char *[]) +{ + + const bu::quantity T1(2.0 * bu::si::seconds); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_non_unit.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_non_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..646160d617b0c5b59d9208575b5c692c964abd84 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_non_unit.cpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_non_unit.cpp + +\details + +Make sure that trying to use a base_unit as though +it were a unit fails. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int,char *[]) +{ + + bu::quantity q; + + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_scalar_add.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_scalar_add.cpp new file mode 100644 index 0000000000000000000000000000000000000000..94cc8f273676dbbe7d6a068412f40590a855e195 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_scalar_add.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_scalar_add.cpp + +\details +Test addition of quantity and scalar. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 * bu::si::meters + 2.0; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_scalar_sub.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_scalar_sub.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a4b93f13a8653b457140a8d84216cefc1f90ec91 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_scalar_sub.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_scalar_sub.cpp + +\details +Test subtraction of quantity and scalar. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 * bu::si::meters - 2.0; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_sub_assign.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_sub_assign.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65ea62fed5978616c8e3d04374e966085ee3ef0b --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_sub_assign.cpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_sub_assign.cpp + +\details +Test -= of quantity from different dimensions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int,char *[]) +{ + + bu::quantity T1; + T1 -= 2.0 * bu::si::seconds; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_subtract.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_subtract.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65f71e9b30609cc6e116f8b8910cd8663c455b67 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_subtract.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_subtract.cpp + +\details +Test subtraction of quantities with different dimensions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 * bu::si::seconds - 2.0 * bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_unit_add.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_unit_add.cpp new file mode 100644 index 0000000000000000000000000000000000000000..537656bcf197482b285d07d2532419a6eba30649 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_unit_add.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_unit_add.cpp + +\details +Test addition of quantity and unit. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 * bu::si::meters + bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_quantity_unit_subtract.cpp b/tools/boost_1_65_1/libs/units/test/fail_quantity_unit_subtract.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bcd9260c5455091e79e162c736c6c8f39baed255 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_quantity_unit_subtract.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_quantity_unit_subtract.cpp + +\details +Test subtraction of quantity and unit. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 * bu::si::meters - bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_scalar_quantity_add.cpp b/tools/boost_1_65_1/libs/units/test/fail_scalar_quantity_add.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0722524895a9a626f615ad46061b906bcc491082 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_scalar_quantity_add.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_scalar_quantity_add.cpp + +\details +Test addition of scalar and quantity. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 + 2.0 * bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_scalar_quantity_sub.cpp b/tools/boost_1_65_1/libs/units/test/fail_scalar_quantity_sub.cpp new file mode 100644 index 0000000000000000000000000000000000000000..44e6a7d1a237e0cdc88f8f057c96d37f154590d5 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_scalar_quantity_sub.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_scalar_quantity_sub.cpp + +\details +Test subtraction of scalar and quantity. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + 2.0 - 2.0 * bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_unit_quantity_add.cpp b/tools/boost_1_65_1/libs/units/test/fail_unit_quantity_add.cpp new file mode 100644 index 0000000000000000000000000000000000000000..512d3329c57985c03a2fb8900be0f6d430b81e0b --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_unit_quantity_add.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_unit_quantity_add.cpp + +\details +Test addition of unit and quantity. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + bu::si::meters + 2.0 * bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/fail_unit_quantity_subtract.cpp b/tools/boost_1_65_1/libs/units/test/fail_unit_quantity_subtract.cpp new file mode 100644 index 0000000000000000000000000000000000000000..512d3329c57985c03a2fb8900be0f6d430b81e0b --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/fail_unit_quantity_subtract.cpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief fail_unit_quantity_add.cpp + +\details +Test addition of unit and quantity. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +namespace bu = boost::units; + +int main(int argc,char *argv[]) +{ + + bu::si::meters + 2.0 * bu::si::meters; + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_absolute.cpp b/tools/boost_1_65_1/libs/units/test/test_absolute.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b83173cd01e0653056e6f608bf7662ea7800910 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_absolute.cpp @@ -0,0 +1,68 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_absolute.cpp + +\details +Test absolute units. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#define BOOST_UNITS_CHECK_CLOSE(a, b) (BOOST_CHECK((std::abs((a) - (b)) < .0000001))) + +namespace bu = boost::units; +using bu::si::kelvin_base_unit; +using bu::temperature::celsius_base_unit; +using bu::temperature::fahrenheit_base_unit; + +typedef bu::unit::type> kelvin_type; + +typedef bu::unit::type> celsius_type; + +typedef bu::unit::type> fahrenheit_type; + +int test_main(int,char *[]) +{ + bu::quantity > q1(212.0 * bu::absolute()); + bu::quantity > q2(0.0 * bu::absolute()); + bu::quantity > q3(q2); + bu::quantity q4(q1 - q3); + + BOOST_UNITS_CHECK_CLOSE(q4.value(), 180.0); + + bu::quantity > q5(static_cast >(q4) + static_cast > >(q2)); + + BOOST_UNITS_CHECK_CLOSE(q5.value(), 373.15); + + bu::quantity > q6(q5); + + BOOST_UNITS_CHECK_CLOSE(q6.value(), 212.0); + + return(0); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_base_dimension.cpp b/tools/boost_1_65_1/libs/units/test/test_base_dimension.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27cc6dcdbdfd2d5a9fadc7c4609a4f8ee91e393d --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_base_dimension.cpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_base_dimension.cpp + +\details +Test base_dimension class. + +Output: +@verbatim +@endverbatim +**/ + +#include + +struct dimension : boost::units::base_dimension { + typedef boost::units::base_dimension base; +}; + +int main() { +} diff --git a/tools/boost_1_65_1/libs/units/test/test_cmath.cpp b/tools/boost_1_65_1/libs/units/test/test_cmath.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ac2b715a4c06696c1e85fe35d1f684d12e635d33 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_cmath.cpp @@ -0,0 +1,175 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_units_1.cpp + +\details +Test unit class. + +Output: +@verbatim +@endverbatim +**/ + +#include + +#include + +#include "test_header.hpp" + +namespace bu = boost::units; + +static volatile double zero = 0; + +int test_main(int,char *[]) +{ + double inf = std::numeric_limits::infinity(), + nan = 0.0/zero; + + // default constructor + const bu::quantity E1(0.0*bu::joules), + E2(inf*bu::joules), + E3(nan*bu::joules); + + BOOST_CHECK((bu::isfinite)(E1) == true); + BOOST_CHECK((bu::isfinite)(E2) == false); + BOOST_CHECK((bu::isfinite)(E3) == false); + + BOOST_CHECK((bu::isinf)(E1) == false); + BOOST_CHECK((bu::isinf)(E2) == true); + BOOST_CHECK((bu::isinf)(E3) == false); + + BOOST_CHECK((bu::isnan)(E1) == false); + BOOST_CHECK((bu::isnan)(E2) == false); + BOOST_CHECK((bu::isnan)(E3) == true); + + BOOST_CHECK((bu::isnormal)(E1) == false); + BOOST_CHECK((bu::isnormal)(E2) == false); + BOOST_CHECK((bu::isnormal)(E3) == false); + + const bu::quantity E4(-2.5*bu::joules), + E5(2.5*bu::joules); + + BOOST_CHECK((bu::isgreater)(E4,E5) == false); + BOOST_CHECK((bu::isgreater)(E5,E4) == true); + BOOST_CHECK((bu::isgreater)(E4,E4) == false); + BOOST_CHECK((bu::isgreater)(E3,E4) == false); + BOOST_CHECK((bu::isgreater)(E4,E3) == false); + + BOOST_CHECK((bu::isgreaterequal)(E4,E5) == false); + BOOST_CHECK((bu::isgreaterequal)(E5,E4) == true); + BOOST_CHECK((bu::isgreaterequal)(E4,E4) == true); + BOOST_CHECK((bu::isgreaterequal)(E3,E4) == false); + BOOST_CHECK((bu::isgreaterequal)(E4,E3) == false); + + BOOST_CHECK((bu::isless)(E4,E5) == true); + BOOST_CHECK((bu::isless)(E5,E4) == false); + BOOST_CHECK((bu::isless)(E4,E4) == false); + BOOST_CHECK((bu::isless)(E3,E4) == false); + BOOST_CHECK((bu::isless)(E4,E3) == false); + + BOOST_CHECK((bu::islessequal)(E4,E5) == true); + BOOST_CHECK((bu::islessequal)(E5,E4) == false); + BOOST_CHECK((bu::islessequal)(E4,E4) == true); + BOOST_CHECK((bu::islessequal)(E3,E4) == false); + BOOST_CHECK((bu::islessequal)(E4,E3) == false); + + BOOST_CHECK((bu::islessgreater)(E4,E5) == true); + BOOST_CHECK((bu::islessgreater)(E5,E4) == true); + BOOST_CHECK((bu::islessgreater)(E4,E4) == false); + BOOST_CHECK((bu::islessgreater)(E3,E4) == false); + BOOST_CHECK((bu::islessgreater)(E4,E3) == false); + + BOOST_CHECK((bu::isunordered)(E4,E5) == false); + BOOST_CHECK((bu::isunordered)(E5,E4) == false); + BOOST_CHECK((bu::isunordered)(E4,E4) == false); + BOOST_CHECK((bu::isunordered)(E3,E4) == true); + BOOST_CHECK((bu::isunordered)(E4,E3) == true); + + BOOST_CHECK((bu::abs)(E4) == E5); + BOOST_CHECK((bu::ceil)(E4) == -2.0*bu::joules); + BOOST_CHECK((bu::copysign)(E4,E5) == E5); + BOOST_CHECK((bu::fabs)(E4) == E5); + BOOST_CHECK((bu::floor)(E4) == -3.0*bu::joules); + BOOST_CHECK((bu::fdim)(E4,E5) == 0.0*bu::joules); + BOOST_CHECK((bu::fdim)(E5,E4) == E5-E4); + + const bu::quantity L1(3.0*bu::meters), + L2(4.0*bu::meters); + const bu::quantity A1(4.0*bu::square_meters), + A2(L1*L2+A1); + +#if 0 + BOOST_CHECK((bu::fma)(L1,L2,A1) == A2); +#endif + + BOOST_CHECK((bu::fmax)(E4,E5) == E5); + BOOST_CHECK((bu::fmin)(E4,E5) == E4); + + // need to test fpclassify + + BOOST_CHECK(bu::hypot(L1,L2) == 5.0*bu::meters); + +#if 0 + +// BOOST_CHECK(bu::llrint(E4).value() == bu::detail::llrint(E4.value())); +// BOOST_CHECK(bu::llround(E4).value() == bu::detail::llround(E4.value())); + BOOST_CHECK((bu::nearbyint)(E4).value() == (bu::detail::nearbyint)(E4.value())); + BOOST_CHECK((bu::rint)(E4).value() == (bu::detail::rint)(E4.value())); + +#endif + + BOOST_CHECK((bu::nextafter)(E4,E5).value() == (boost::math::nextafter)(E4.value(),E5.value())); + BOOST_CHECK((bu::nextafter)(E5,E4).value() == (boost::math::nextafter)(E5.value(),E4.value())); + + BOOST_CHECK((bu::nexttoward)(E4,E5).value() == (boost::math::nextafter)(E4.value(),E5.value())); + BOOST_CHECK((bu::nexttoward)(E5,E4).value() == (boost::math::nextafter)(E5.value(),E4.value())); + + BOOST_CHECK((bu::round)(E4 - 0.00000000001 * bu::joules) == -3.0*bu::joules); + BOOST_CHECK((bu::round)(E5 + 0.00000000001 * bu::joules) == 3.0*bu::joules); + BOOST_CHECK((bu::signbit)(E4) != 0); + BOOST_CHECK((bu::signbit)(E5) == 0); + BOOST_CHECK((bu::trunc)(E4) == -2.0*bu::joules); + BOOST_CHECK((bu::trunc)(E5) == 2.0*bu::joules); + + BOOST_CHECK((bu::fmod)(E4,E5) == -0.0*bu::joules); + + bu::quantity pint; + + BOOST_CHECK((bu::modf)(E4,&pint) == -0.5*bu::joules); + BOOST_CHECK(pint == -2.0*bu::joules); + + int ex; + const bu::quantity E6((bu::frexp)(E4,&ex)); + + BOOST_CHECK(E6 == -0.625*bu::joules); + BOOST_CHECK(ex == 2); + BOOST_CHECK((bu::ldexp)(E6,ex) == E4); + + const bu::quantity E7(1.0); + + BOOST_CHECK(bu::pow(E7,E7) == 1.0*1.0); + + const bu::quantity E8((bu::exp)(E7)); + + BOOST_CHECK(std::abs(E8 - std::exp(1.0)) < .000001); + BOOST_CHECK(bu::log(E8) == E7); + + const bu::quantity E9(100.0); + + BOOST_CHECK(bu::log10(E9) == 2.0); + + BOOST_CHECK(bu::sqrt(A1) == 2.0*bu::meters); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_complicated_system.cpp b/tools/boost_1_65_1/libs/units/test/test_complicated_system.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4ac3a82d57ca655905bc0f9db2da6414b647c2e4 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_complicated_system.cpp @@ -0,0 +1,96 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace test_system1 { + +// the base units in the system will be: +// +// volts = m^2 kg s^-2 C^-1 +// newtons = m kg s^-2 +// joules = m^2 kg s^-2 + +// we will find the representation of m^-1 C^-1 = V N J^-2 = m^-1 C^-1 + +// reducing the system should generate the matrix equation +// 2 1 2 +// 1 1 1 x = c +// -2 -2 -2 +// -1 0 0 + +struct volt : boost::units::base_unit {}; +struct newton : boost::units::base_unit {}; +struct joule : boost::units::base_unit {}; + +typedef boost::units::make_system::type complicated_system; + +typedef boost::units::derived_dimension< + boost::units::length_base_dimension, -1, + boost::units::time_base_dimension, -1, + boost::units::current_base_dimension, -1 +>::type dimension; + +typedef boost::units::reduce_unit >::type reduced; + +typedef boost::units::divide_typeof_helper< + boost::units::multiply_typeof_helper::type, + boost::units::power_typeof_helper >::type +>::type expected; + +void test() { + BOOST_MPL_ASSERT((boost::is_same)); +} + +} + +namespace test_system2 { + +// the base units in the system will be: +// +// kilograms = kg +// meters = m + +// we will find the representation of m and kg + +// reducing the system should generate the matrix equation +// 0 1 +// 1 0 x = c + +struct kilogram : boost::units::base_unit {}; +struct meter : boost::units::base_unit {}; + +typedef boost::units::make_system::type mk_system; + +typedef boost::units::reduce_unit >::type mass_unit; +typedef boost::units::reduce_unit >::type length_unit; + +void test() { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); +} + +} diff --git a/tools/boost_1_65_1/libs/units/test/test_constants.cpp b/tools/boost_1_65_1/libs/units/test/test_constants.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55b45a1c548df2dd0be62219dca9b19a29210062 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_constants.cpp @@ -0,0 +1,87 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2009 Matthias Christian Schabel +// Copyright (C) 2007-2009 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_constants.cpp + +\details +Test all combinations of operators with the constants. + +**/ + +#include +#include +#include +#include +#include + +using boost::units::quantity; +using boost::units::si::length; +using boost::units::si::meters; +using boost::units::si::seconds; +using boost::units::static_rational; +using boost::units::pow; +using boost::units::root; + +BOOST_UNITS_PHYSICAL_CONSTANT(length_constant, quantity, 2.0 * meters, 0.5 * meters); + +template +void check_same(const T&, const T&); + +template +typename T::value_type unwrap(const boost::units::constant&); + +template +T unwrap(const T&); + +#define BOOST_UNITS_CHECK_RESULT(arg1, op, arg2) check_same((arg1) op (arg2), unwrap(arg1) op unwrap(arg2)); + +void test_add() { + BOOST_UNITS_CHECK_RESULT(length_constant, +, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, +, 1.0 * meters); + BOOST_UNITS_CHECK_RESULT(1.0* meters, +, length_constant); +} + +void test_subtract() { + BOOST_UNITS_CHECK_RESULT(length_constant, -, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, -, 1.0 * meters); + BOOST_UNITS_CHECK_RESULT(1.0* meters, -, length_constant); +} + +void test_multiply() { + BOOST_UNITS_CHECK_RESULT(length_constant, *, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, *, 1.0 * seconds); + BOOST_UNITS_CHECK_RESULT(1.0 * seconds, *, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, *, 1.0); + BOOST_UNITS_CHECK_RESULT(1.0, *, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, *, seconds); + BOOST_UNITS_CHECK_RESULT(seconds, *, length_constant); +} + +void test_divide() { + BOOST_UNITS_CHECK_RESULT(length_constant, /, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, /, 1.0 * seconds); + BOOST_UNITS_CHECK_RESULT(1.0 * seconds, /, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, /, 1.0); + BOOST_UNITS_CHECK_RESULT(1.0, /, length_constant); + BOOST_UNITS_CHECK_RESULT(length_constant, /, seconds); + BOOST_UNITS_CHECK_RESULT(seconds, /, length_constant); +} + +void test_pow() { + check_same(pow<2>(length_constant), pow<2>(unwrap(length_constant))); + check_same(root<2>(length_constant), root<2>(unwrap(length_constant))); + check_same(pow<5>(length_constant), pow<5>(unwrap(length_constant))); + check_same(root<5>(length_constant), root<5>(unwrap(length_constant))); + check_same(pow >(length_constant), pow >(unwrap(length_constant))); + check_same(root >(length_constant), root >(unwrap(length_constant))); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_conversion.cpp b/tools/boost_1_65_1/libs/units/test/test_conversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..79a0f58b230aa20b250f44efb7c95ede66917e5c --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_conversion.cpp @@ -0,0 +1,110 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_conversion.cpp + +\details +Test conversion between quantities. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include + +#include + +#define BOOST_TEST_MAIN + +#include + +#define BOOST_UNITS_CHECK_CLOSE(a, b) BOOST_CHECK_CLOSE_FRACTION(a, b, .0000001) + +namespace bu = boost::units; + +typedef bu::si::length si_length; +typedef bu::si::time si_time; +typedef bu::si::mass si_mass; +typedef bu::si::area si_area; + +typedef bu::cgs::length cgs_length; +typedef bu::cgs::time cgs_time; +typedef bu::cgs::mass cgs_mass; +typedef bu::cgs::area cgs_area; + +typedef bu::multiply_typeof_helper::type mixed_length; +typedef bu::multiply_typeof_helper::type mixed_time; + +typedef bu::divide_typeof_helper::type, mixed_time>::type mixed_energy_1; +typedef bu::divide_typeof_helper::type, + bu::multiply_typeof_helper::type >::type mixed_energy_2; + +BOOST_AUTO_TEST_CASE(test_conversion) { + BOOST_CHECK_EQUAL(1, 1); + bu::quantity a1(2.0 * mixed_length()); + bu::quantity a2(a1); + + BOOST_UNITS_CHECK_CLOSE(a2.value(), .02); + + bu::quantity a3(a2); + + BOOST_UNITS_CHECK_CLOSE(a3.value(), 2.0); + + bu::quantity e1(2.0 * mixed_energy_1()); + bu::quantity e2(e1); + + BOOST_UNITS_CHECK_CLOSE(e2.value(), 20.0); + + bu::quantity e3(e1); + BOOST_UNITS_CHECK_CLOSE(e3.value(), .0002); + bu::quantity e4(e3); + BOOST_UNITS_CHECK_CLOSE(e4.value(), 20.0); + + bu::quantity F0 = 20 * bu::cgs::dyne; + BOOST_UNITS_CHECK_CLOSE(F0.value(), 20.0); + + bu::quantity F3(F0); + BOOST_UNITS_CHECK_CLOSE(F3.value(), 2.0e-4); + + bu::quantity F5(20 * bu::cgs::dyne); + BOOST_UNITS_CHECK_CLOSE(F5.value(), 2.0e-4); + + // same type + BOOST_CHECK_EQUAL(boost::units::conversion_factor(si_length(), si_length()), 1.0); +} + +BOOST_AUTO_TEST_CASE(test_dimensionless_conversions) { + typedef bu::divide_typeof_helper::type mixed_dimensionless; + + bu::quantity dimensionless_test1(1.0*bu::cgs::dyne/bu::si::newton); + BOOST_CHECK(dimensionless_test1 == 1e-5); + + typedef bu::multiply_typeof_helper::type m_cm; + typedef bu::divide_typeof_helper::type heterogeneous_dimensionless; + bu::quantity dimensionless_test2(1.0*bu::cgs::dyne/bu::si::newton); + BOOST_CHECK(dimensionless_test2.value() == 1e-5); + bu::quantity::type> dimensionless_test3(dimensionless_test2); + BOOST_UNITS_CHECK_CLOSE(dimensionless_test3.value(), 1.0); + + BOOST_UNITS_CHECK_CLOSE(boost::units::conversion_factor(mixed_dimensionless(), heterogeneous_dimensionless()), 1e-5); + BOOST_UNITS_CHECK_CLOSE(boost::units::conversion_factor(heterogeneous_dimensionless(), mixed_dimensionless()), 1e5); + + + //m/cm -> g/kg + bu::quantity::type> dimensionless_test4(2.0 * bu::si::meters / bu::cgs::centimeters); + bu::quantity::type> dimensionless_test5(dimensionless_test4); + BOOST_UNITS_CHECK_CLOSE(dimensionless_test5.value(), 2e5); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_custom_unit.cpp b/tools/boost_1_65_1/libs/units/test/test_custom_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..42e7d6e8bff7a17344e60b88f0c7f3b8e331b40a --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_custom_unit.cpp @@ -0,0 +1,84 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_custom_unit.cpp + +\details +Make sure that a minimal + - * / unit class is fully functional. + +Output: +@verbatim +@endverbatim +**/ + +#include + +#include + +namespace bu = boost::units; + +template +struct simple_unit {}; + +BOOST_TYPEOF_REGISTER_TEMPLATE(simple_unit, (int)(int)(int)) + +template +simple_unit operator+(const simple_unit&, + const simple_unit&) +{ + return simple_unit(); +} + +template +simple_unit operator-(const simple_unit&, + const simple_unit&) +{ + return simple_unit(); +} + +template +simple_unit +operator*(const simple_unit&, + const simple_unit&) +{ + return simple_unit(); +} + +template +simple_unit +operator/(const simple_unit&, + const simple_unit&) +{ + return simple_unit(); +} + +int test_main(int,char *[]) +{ + bu::quantity > mass = bu::quantity >::from_value(2); + bu::quantity > length = bu::quantity >::from_value(4); + + bu::quantity > ml = mass * length; + bu::quantity > m_per_l = mass/length; + + BOOST_CHECK(ml.value() == 8); + BOOST_CHECK(m_per_l.value() == 0.5); + + mass += mass; + + BOOST_CHECK(mass.value() == 4); + + length -= length; + BOOST_CHECK(length.value() == 0); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_default_conversion.cpp b/tools/boost_1_65_1/libs/units/test/test_default_conversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..734a9431ca102678620a6222744286087dfe2153 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_default_conversion.cpp @@ -0,0 +1,78 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include +#include +#include +#include +#include +#include + +struct dimension1_tag : boost::units::base_dimension {}; +struct dimension2_tag : boost::units::base_dimension {}; + +typedef dimension1_tag::dimension_type dimension1; +typedef dimension2_tag::dimension_type dimension2; +typedef boost::mpl::times::type dimension12; + +struct unit1_tag : boost::units::base_unit {}; +struct unit2_tag : boost::units::base_unit {}; +struct unit3_tag : boost::units::base_unit {}; +struct unit4_tag : boost::units::base_unit {}; +struct unit5_tag : boost::units::base_unit {}; +struct unit6_tag : boost::units::base_unit {}; +struct unit7_tag : boost::units::base_unit {}; + +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(unit1_tag, unit2_tag, double, 2.0); +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(unit2_tag, unit3_tag, double, 3.0); +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(unit6_tag, unit3_tag, double, 5.0); +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(unit7_tag, unit1_tag, double, 7.0); + +typedef boost::units::multiply_typeof_helper::type unit34_type; +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(unit5_tag, unit34_type , double, 5.0); + +template +struct make_unit { + typedef boost::units::unit< + typename BaseUnit::dimension_type, + typename boost::units::make_system::type> type; +}; + +BOOST_UNITS_DEFAULT_CONVERSION(unit1_tag, unit2_tag); +BOOST_UNITS_DEFAULT_CONVERSION(unit3_tag, unit2_tag); +BOOST_UNITS_DEFAULT_CONVERSION(unit5_tag, unit34_type); +BOOST_UNITS_DEFAULT_CONVERSION(unit6_tag, make_unit::type); +BOOST_UNITS_DEFAULT_CONVERSION(unit7_tag, make_unit::type); + +int test_main(int, char*[]) { + double value1 = boost::units::conversion_factor(unit3_tag::unit_type(), unit1_tag::unit_type()); + BOOST_CHECK(std::abs(value1 - 1.0/6.0) < .0000000001); + double value2 = boost::units::conversion_factor(unit5_tag::unit_type() / unit4_tag::unit_type(), unit1_tag::unit_type()); + BOOST_CHECK(std::abs(value2 - 5.0/6.0) < .0000000001); + typedef boost::units::scaled_base_unit > > scaled_unit5_tag; + double value3 = boost::units::conversion_factor(scaled_unit5_tag::unit_type() / unit4_tag::unit_type(), unit1_tag::unit_type()); + BOOST_CHECK(std::abs(value3 - 10.0/6.0) < .0000000001); + + // check homogeneous unit conversions + double value4 = boost::units::conversion_factor(make_unit::type(), make_unit::type()); + BOOST_CHECK(std::abs(value4 - 1.0/6.0) < .0000000001); + double value5 = boost::units::conversion_factor(unit3_tag::unit_type(), make_unit::type()); + BOOST_CHECK(std::abs(value5 - 1.0/6.0) < .0000000001); + double value6 = boost::units::conversion_factor(make_unit::type(), unit1_tag::unit_type()); + BOOST_CHECK(std::abs(value6 - 1.0/6.0) < .0000000001); + + // check chained homogeneous conversions + double value7 = boost::units::conversion_factor(unit6_tag::unit_type(), unit7_tag::unit_type()); + BOOST_CHECK(std::abs(value7 - 5.0/42.0) < .0000000001); + + return(0); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_dimensionless_ice1.cpp b/tools/boost_1_65_1/libs/units/test/test_dimensionless_ice1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8fb98678334f39e5a53f00f4208edc457c8eaddf --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_dimensionless_ice1.cpp @@ -0,0 +1,26 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +void foo() +{ + boost::units::quantity d = boost::units::quantity< boost::units::si::dimensionless >(); + boost::ignore_unused(d); +} + +#include + +int main() +{ + BOOST_CHECK( 1 == 2 ); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_dimensionless_ice2.cpp b/tools/boost_1_65_1/libs/units/test/test_dimensionless_ice2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..90795761aae7ce01a3fe2f6b5cec50f02c3f5068 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_dimensionless_ice2.cpp @@ -0,0 +1,25 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +void foo() +{ + boost::units::quantity d(1.0 * boost::units::si::meters / boost::units::cgs::centimeters); +} + +#include + +int main() +{ + BOOST_CHECK( 1 == 2 ); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_dimensionless_quantity.cpp b/tools/boost_1_65_1/libs/units/test/test_dimensionless_quantity.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6937d9e7059a3885a6614cd1d0de9f55442d15f4 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_dimensionless_quantity.cpp @@ -0,0 +1,216 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_dimensionless_quantity.cpp + +\details +Test unit class. + +Output: +@verbatim +@endverbatim +**/ + +#include "test_header.hpp" + +#include + +namespace bu = boost::units; + +static const double E_ = 2.718281828459045235360287471352662497757; + +int test_main(int,char *[]) +{ + // default constructor + const bu::quantity E1; + BOOST_CHECK(E1.value() == double()); + + // value_type constructor + const bu::quantity E2(E_); + BOOST_CHECK(E2.value() == E_); + + // copy constructor + const bu::quantity E3(E2); + BOOST_CHECK(E3.value() == E_); + + // operator= + const bu::quantity E4 = E2; + BOOST_CHECK(E4.value() == E_); + + // implicit copy constructor value_type conversion + const bu::quantity E5(E2); + BOOST_UNITS_CHECK_CLOSE(E5.value(), float(E_)); + + const bu::quantity E6(E2); + BOOST_CHECK(E6.value() == long(E_)); + + // implicit operator= value_type conversion + // narrowing conversion disallowed +// const bu::quantity E7 = E2; +// BOOST_UNITS_CHECK_CLOSE(E7.value(),float(E_)); + + // narrowing conversion disallowed +// const bu::quantity E8 = E2; +// BOOST_CHECK(E8.value() == long(E_)); + + // const construction + bu::quantity E9(E2); + BOOST_CHECK(E9.value() == E_); + +// // value assignment +// E9.value() = 1.5*bu::dimensionless(); +// BOOST_CHECK(E9.value() == 1.5); +// +// // value assignment with implicit conversion +// E9.value() = 1.5; +// BOOST_CHECK(E9.value() == 1.5); +// +// // value assignment with implicit value_type conversion +// E9.value() = 2*bu::dimensionless(); +// BOOST_CHECK(E9.value() == double(2)); +// +// // value assignment with implicit value_type conversion +// E9.value() = 2; +// BOOST_CHECK(E9.value() == double(2)); + + // operator+=(this_type) + E9 = 2.0; + E9 += E9; + BOOST_CHECK(E9.value() == 4.0); + + // operator-=(this_type) + E9 = 2.0; + E9 -= E9; + BOOST_CHECK(E9.value() == 0.0); + + // operator*=(value_type) + E9 = 2.0; + E9 *= 2.0; + BOOST_CHECK(E9.value() == 4.0); + + // operator/=(value_type) + E9 = 2.0; + E9 /= 2.0; + BOOST_CHECK(E9.value() == 1.0); + + // static construct quantity from value_type + const bu::quantity E(bu::quantity::from_value(2.5)); + BOOST_CHECK(E.value() == 2.5); + + // implicit conversion to value_type + const double V1(E9); + BOOST_CHECK(V1 == E9.value()); + + const double V2 = E9; + BOOST_CHECK(V2 == E9.value()); + + // unit * scalar + BOOST_CHECK(bu::dimensionless()*2.0 == bu::quantity::from_value(2.0)); + + // unit / scalar + BOOST_CHECK(bu::dimensionless()/2.0 == bu::quantity::from_value(0.5)); + + // scalar * unit + BOOST_CHECK(2.0*bu::dimensionless() == bu::quantity::from_value(2.0)); + + // scalar / unit + BOOST_CHECK(2.0/bu::dimensionless() == bu::quantity::from_value(2.0)); + + // quantity * scalar + BOOST_CHECK(E*2.0 == bu::quantity::from_value(5.0)); + + // quantity / scalar + BOOST_CHECK(E/2.0 == bu::quantity::from_value(1.25)); + + // scalar * quantity + BOOST_CHECK(2.0*E == bu::quantity::from_value(5.0)); + + // scalar / quantity + BOOST_CHECK(2.0/E == bu::quantity::from_value(0.8)); + + const bu::quantity D1(1.0), + D2(2.0); + + // unit * quantity + BOOST_CHECK(bu::dimensionless()*D1 == D1); + + // unit / quantity + BOOST_CHECK(bu::dimensionless()/D1 == D1); + + // quantity * unit + BOOST_CHECK(D1*bu::dimensionless() == D1); + + // quantity / unit + BOOST_CHECK(D1*bu::dimensionless() == D1); + + // +quantity + BOOST_CHECK(+D1 == 1.0*bu::dimensionless()); + + // -quantity + BOOST_CHECK(-D1 == -1.0*bu::dimensionless()); + + // quantity + quantity + BOOST_CHECK(D2+D1 == 3.0*bu::dimensionless()); + + // quantity - quantity + BOOST_CHECK(D2-D1 == 1.0*bu::dimensionless()); + + // quantity * quantity + BOOST_CHECK(D1*D2 == 2.0*bu::dimensionless()); + + // quantity / quantity + BOOST_CHECK(D2/D1 == 2.0*bu::dimensionless()); + + // integer power of quantity + BOOST_CHECK(2.0*bu::pow<2>(D2) == 2.0*std::pow(2.0,2.0)*bu::dimensionless()); + + // rational power of quantity + BOOST_CHECK((2.0*bu::pow< bu::static_rational<2,3> >(D2) == 2.0*std::pow(2.0,2.0/3.0)*bu::dimensionless())); + + // integer root of quantity + BOOST_CHECK(2.0*bu::root<2>(D2) == 2.0*std::pow(2.0,1.0/2.0)*bu::dimensionless()); + + // rational root of quantity + BOOST_CHECK((2.0*bu::root< bu::static_rational<3,2> >(D2) == 2.0*std::pow(2.0,2.0/3.0)*bu::dimensionless())); + + const bu::quantity A1(0.0), + A2(0.0), + A3(1.0), + A4(-1.0); + + // operator== + BOOST_CHECK((A1 == A2) == true); + BOOST_CHECK((A1 == A3) == false); + + // operator!= + BOOST_CHECK((A1 != A2) == false); + BOOST_CHECK((A1 != A3) == true); + + // operator< + BOOST_CHECK((A1 < A2) == false); + BOOST_CHECK((A1 < A3) == true); + + // operator<= + BOOST_CHECK((A1 <= A2) == true); + BOOST_CHECK((A1 <= A3) == true); + + // operator> + BOOST_CHECK((A1 > A2) == false); + BOOST_CHECK((A1 > A4) == true); + + // operator>= + BOOST_CHECK((A1 >= A2) == true); + BOOST_CHECK((A1 >= A4) == true); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_header.hpp b/tools/boost_1_65_1/libs/units/test/test_header.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bc2ec439fb47596c8d39ff48990809d91c23ed49 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_header.hpp @@ -0,0 +1,126 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_header.hpp + +\details +Unit system for test purposes. + +Output: +@verbatim +@endverbatim +**/ + +#ifndef BOOST_UNITS_TEST_HEADER_HPP +#define BOOST_UNITS_TEST_HEADER_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define BOOST_UNITS_CHECK_CLOSE(a, b) (BOOST_CHECK((std::abs((a) - (b)) < .0000001))) + +namespace boost { + +namespace units { + +//struct length_base_dimension : boost::units::base_dimension { }; ///> base dimension of length +//struct mass_base_dimension : boost::units::base_dimension { }; ///> base dimension of mass +//struct time_base_dimension : boost::units::base_dimension { }; ///> base dimension of time + +typedef length_base_dimension::dimension_type length_dimension; +typedef mass_base_dimension::dimension_type mass_dimension; +typedef time_base_dimension::dimension_type time_dimension; + +typedef derived_dimension::type area_dimension; +typedef derived_dimension::type energy_dimension; +typedef derived_dimension::type inverse_energy_dim; +typedef derived_dimension::type velocity_dimension; +typedef derived_dimension::type volume_dimension; + +/// placeholder class defining test unit system +struct length_unit : base_unit {}; +struct mass_unit : base_unit {}; +struct time_unit : base_unit {}; + +typedef make_system::type system; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit mass; +typedef unit time; + +typedef unit area; +typedef unit energy; +typedef unit inverse_energy; +typedef unit velocity; +typedef unit volume; + +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(meter,length); +BOOST_UNITS_STATIC_CONSTANT(meters,length); +BOOST_UNITS_STATIC_CONSTANT(kilogram,mass); +BOOST_UNITS_STATIC_CONSTANT(kilograms,mass); +BOOST_UNITS_STATIC_CONSTANT(second,time); +BOOST_UNITS_STATIC_CONSTANT(seconds,time); + +BOOST_UNITS_STATIC_CONSTANT(square_meter,area); +BOOST_UNITS_STATIC_CONSTANT(square_meters,area); +BOOST_UNITS_STATIC_CONSTANT(joule,energy); +BOOST_UNITS_STATIC_CONSTANT(joules,energy); +BOOST_UNITS_STATIC_CONSTANT(meter_per_second,velocity); +BOOST_UNITS_STATIC_CONSTANT(meters_per_second,velocity); +BOOST_UNITS_STATIC_CONSTANT(cubic_meter,volume); +BOOST_UNITS_STATIC_CONSTANT(cubic_meters,volume); + +template<> struct base_unit_info +{ + static std::string name() { return "meter"; } + static std::string symbol() { return "m"; } +}; +//] + +template<> struct base_unit_info +{ + static std::string name() { return "kilogram"; } + static std::string symbol() { return "kg"; } +}; + +template<> struct base_unit_info +{ + static std::string name() { return "second"; } + static std::string symbol() { return "s"; } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_TEST_HEADER_HPP diff --git a/tools/boost_1_65_1/libs/units/test/test_implicit_conversion.cpp b/tools/boost_1_65_1/libs/units/test/test_implicit_conversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..350a7c4ea5b365d1faa2b92abca1e1777fe9b884 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_implicit_conversion.cpp @@ -0,0 +1,113 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_implicit_conversion.cpp + +\details +Test implicit conversions for quantity. + +Output: +@verbatim +@endverbatim +**/ + +#include + +#include +#include +#include +#include + +namespace bu = boost::units; + +int test_main(int,char *[]) +{ + //// si->si always true + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + + //// cgs->cgs always true + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + + //// si->cgs + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == false)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == false)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == true)); + + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == true)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + + //// cgs->si + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == false)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == false)); + //BOOST_CHECK((bu::base_unit_is_implicitly_convertible::value == true)); + + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == true)); + + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == true)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + BOOST_CHECK((bu::is_implicitly_convertible::value == false)); + + const bu::quantity S1(2.0*bu::si::seconds); + const bu::quantity S2 = S1; + + BOOST_CHECK((S1.value() == S2.value())); + + const bu::quantity S3(2.0*bu::si::catalytic_activity()); + + + const bu::quantity C1(2.0*bu::cgs::seconds); + const bu::quantity C2 = C1; + + BOOST_CHECK((C1.value() == C2.value())); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_information_units.cpp b/tools/boost_1_65_1/libs/units/test/test_information_units.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6bb1ab59607d3e95066f89639e5925034f3dbcd8 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_information_units.cpp @@ -0,0 +1,242 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2014 Erik Erlandson +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +#include +#include +#include + +#include +#include + +// All information systems definitions +#include + +using std::cout; +using std::cerr; +using std::endl; +using std::stringstream; + +namespace bu = boost::units; +namespace si = boost::units::si; + +using bu::quantity; + +using bu::information::bit_base_unit; +using bu::information::byte_base_unit; +using bu::information::nat_base_unit; +using bu::information::hartley_base_unit; +using bu::information::shannon_base_unit; + + +#define BOOST_TEST_MAIN +#include + + +#include + +const double close_fraction = 0.0000001; + +// checks that cf(u2,u1) == expected +// also checks invariant property that cf(u2,u1) * cf(u1,u2) == 1 +#define CHECK_DIRECT_CF(u1, u2, expected) \ + BOOST_CHECK_CLOSE_FRACTION(bu::conversion_factor((u2), (u1)), (expected), close_fraction); \ + BOOST_CHECK_CLOSE_FRACTION(bu::conversion_factor((u2), (u1)) * bu::conversion_factor((u1), (u2)), 1.0, close_fraction); + +// check transitive conversion factors +// invariant: cf(u1,u3) = cf(u1,u2)*cf(u2,u3) +#define CHECK_TRANSITIVE_CF(u1, u2, u3) { \ + double cf12 = bu::conversion_factor((u2), (u1)) ; \ + double cf23 = bu::conversion_factor((u3), (u2)) ; \ + double cf13 = bu::conversion_factor((u3), (u1)) ; \ + BOOST_CHECK_CLOSE_FRACTION(cf13, cf12*cf23, close_fraction); \ + double cf32 = bu::conversion_factor((u2), (u3)) ; \ + double cf21 = bu::conversion_factor((u1), (u2)) ; \ + double cf31 = bu::conversion_factor((u1), (u3)) ; \ + BOOST_CHECK_CLOSE_FRACTION(cf31, cf32*cf21, close_fraction); \ +} + + +BOOST_AUTO_TEST_CASE(test_cf_bit_byte) { + CHECK_DIRECT_CF(bit_base_unit::unit_type(), byte_base_unit::unit_type(), 8.0); +} + +BOOST_AUTO_TEST_CASE(test_cf_bit_nat) { + CHECK_DIRECT_CF(bit_base_unit::unit_type(), nat_base_unit::unit_type(), 1.442695040888964); +} + +BOOST_AUTO_TEST_CASE(test_cf_bit_hartley) { + CHECK_DIRECT_CF(bit_base_unit::unit_type(), hartley_base_unit::unit_type(), 3.321928094887363); +} + +BOOST_AUTO_TEST_CASE(test_cf_bit_shannon) { + CHECK_DIRECT_CF(bit_base_unit::unit_type(), shannon_base_unit::unit_type(), 1.0); +} + +///////////////////////////////////////////////////////////////////////////////////// +// spot-check that these are automatically transitive, thru central "hub unit" bit: +// basic pattern is to test invariant property: cf(c,a) = cf(c,b)*cf(b,a) + +BOOST_AUTO_TEST_CASE(test_transitive_byte_nat) { + CHECK_TRANSITIVE_CF(byte_base_unit::unit_type(), bit_base_unit::unit_type(), nat_base_unit::unit_type()); +} +BOOST_AUTO_TEST_CASE(test_transitive_nat_hartley) { + CHECK_TRANSITIVE_CF(nat_base_unit::unit_type(), bit_base_unit::unit_type(), hartley_base_unit::unit_type()); +} +BOOST_AUTO_TEST_CASE(test_transitive_hartley_shannon) { + CHECK_TRANSITIVE_CF(hartley_base_unit::unit_type(), bit_base_unit::unit_type(), shannon_base_unit::unit_type()); +} +BOOST_AUTO_TEST_CASE(test_transitive_shannon_byte) { + CHECK_TRANSITIVE_CF(shannon_base_unit::unit_type(), bit_base_unit::unit_type(), byte_base_unit::unit_type()); +} + +// test transitive factors, none of which are bit, just for good measure +BOOST_AUTO_TEST_CASE(test_transitive_byte_nat_hartley) { + CHECK_TRANSITIVE_CF(byte_base_unit::unit_type(), nat_base_unit::unit_type(), hartley_base_unit::unit_type()); +} + +BOOST_AUTO_TEST_CASE(test_byte_quantity_is_default) { + using namespace bu::information; + quantity qd(2 * byte); + BOOST_CHECK_EQUAL(qd.value(), double(2)); + quantity ql(2 * byte); + BOOST_CHECK_EQUAL(ql.value(), long(2)); +} + +BOOST_AUTO_TEST_CASE(test_byte_quantity_explicit) { + using namespace bu::information; + quantity qd(2 * byte); + BOOST_CHECK_EQUAL(qd.value(), double(2)); + quantity ql(2 * byte); + BOOST_CHECK_EQUAL(ql.value(), long(2)); +} + +BOOST_AUTO_TEST_CASE(test_bit_quantity) { + using namespace bu::information; + quantity qd(2 * bit); + BOOST_CHECK_EQUAL(qd.value(), double(2)); + quantity ql(2 * bit); + BOOST_CHECK_EQUAL(ql.value(), long(2)); +} + +BOOST_AUTO_TEST_CASE(test_nat_quantity) { + using namespace bu::information; + quantity qd(2 * nat); + BOOST_CHECK_EQUAL(qd.value(), double(2)); + quantity ql(2 * nat); + BOOST_CHECK_EQUAL(ql.value(), long(2)); +} + +BOOST_AUTO_TEST_CASE(test_hartley_quantity) { + using namespace bu::information; + quantity qd(2 * hartley); + BOOST_CHECK_EQUAL(qd.value(), double(2)); + quantity ql(2 * hartley); + BOOST_CHECK_EQUAL(ql.value(), long(2)); +} + +BOOST_AUTO_TEST_CASE(test_shannon_quantity) { + using namespace bu::information; + quantity qd(2 * shannon); + BOOST_CHECK_EQUAL(qd.value(), double(2)); + quantity ql(2 * shannon); + BOOST_CHECK_EQUAL(ql.value(), long(2)); +} + +BOOST_AUTO_TEST_CASE(test_mixed_hu) { + using namespace bu::information; + const double cf = 0.001; + BOOST_CHECK_CLOSE_FRACTION((quantity(1.0 * bits)).value(), 1.0, cf); + BOOST_CHECK_CLOSE_FRACTION((quantity(1.0 * bits)).value(), 1.0/8.0, cf); + BOOST_CHECK_CLOSE_FRACTION((quantity(1.0 * bits)).value(), 0.69315, cf); + BOOST_CHECK_CLOSE_FRACTION((quantity(1.0 * bits)).value(), 0.30102, cf); + BOOST_CHECK_CLOSE_FRACTION((quantity(1.0 * bits)).value(), 1.0, cf); +} + +BOOST_AUTO_TEST_CASE(test_info_prefixes) { + using namespace bu::information; + quantity q10(1LL * kibi * byte); + BOOST_CHECK_EQUAL(q10.value(), 1024LL); + + quantity q20(1LL * mebi * byte); + BOOST_CHECK_EQUAL(q20.value(), 1048576LL); + + quantity q30(1LL * gibi * byte); + BOOST_CHECK_EQUAL(q30.value(), 1073741824LL); + + quantity q40(1LL * tebi * byte); + BOOST_CHECK_EQUAL(q40.value(), 1099511627776LL); + + quantity q50(1LL * pebi * byte); + BOOST_CHECK_EQUAL(q50.value(), 1125899906842624LL); + + quantity q60(1LL * exbi * byte); + BOOST_CHECK_EQUAL(q60.value(), 1152921504606846976LL); + + using boost::multiprecision::int128_t; + + quantity q70(1LL * zebi * byte); + BOOST_CHECK_EQUAL(q70.value(), int128_t("1180591620717411303424")); + + quantity q80(1LL * yobi * byte); + BOOST_CHECK_EQUAL(q80.value(), int128_t("1208925819614629174706176")); + + // sanity check: si prefixes should also operate + quantity q1e3(1LL * si::kilo * byte); + BOOST_CHECK_EQUAL(q1e3.value(), 1000LL); + + quantity q1e6(1LL * si::mega * byte); + BOOST_CHECK_EQUAL(q1e6.value(), 1000000LL); +} + +BOOST_AUTO_TEST_CASE(test_unit_constant_io) { + using namespace bu::information; + + std::stringstream ss; + ss << bu::symbol_format << bytes; + BOOST_CHECK_EQUAL(ss.str(), "B"); + + ss.str(""); + ss << bu::name_format << bytes; + BOOST_CHECK_EQUAL(ss.str(), "byte"); + + ss.str(""); + ss << bu::symbol_format << bits; + BOOST_CHECK_EQUAL(ss.str(), "b"); + + ss.str(""); + ss << bu::name_format << bits; + BOOST_CHECK_EQUAL(ss.str(), "bit"); + + ss.str(""); + ss << bu::symbol_format << nats; + BOOST_CHECK_EQUAL(ss.str(), "nat"); + + ss.str(""); + ss << bu::name_format << nats; + BOOST_CHECK_EQUAL(ss.str(), "nat"); + + ss.str(""); + ss << bu::symbol_format << hartleys; + BOOST_CHECK_EQUAL(ss.str(), "Hart"); + + ss.str(""); + ss << bu::name_format << hartleys; + BOOST_CHECK_EQUAL(ss.str(), "hartley"); + + ss.str(""); + ss << bu::symbol_format << shannons; + BOOST_CHECK_EQUAL(ss.str(), "Sh"); + + ss.str(""); + ss << bu::name_format << shannons; + BOOST_CHECK_EQUAL(ss.str(), "shannon"); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_lambda.cpp b/tools/boost_1_65_1/libs/units/test/test_lambda.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c3642c75f27643fd22eb9c807ab1fdd79609870 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_lambda.cpp @@ -0,0 +1,269 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// $Id: test_lambda.cpp 27 2008-06-16 14:50:58Z maehne $ + +//////////////////////////////////////////////////////////////////////// +/// +/// \file test_lambda.hpp +/// +/// \brief Unit test for checking the usage of Boost.Units' quantity, +/// unit, and absolute types in functors created with the +/// Boost.Lambda library. +/// +/// \author Torsten Maehne +/// \date 2008-06-16 +/// +/// This unit test contains a check for each operator action, for +/// which a specialization of Boost.Lambda's return type deduction +/// system is made in lambda.hpp, i.e., for the operators defined for +/// Boost.Units' quantity, unit, and absolute types. +/// +//////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include "test_header.hpp" + + +namespace bl = boost::lambda; +namespace bu = boost::units; +namespace si = boost::units::si; + + +int test_main(int, char *[]) +{ + + //////////////////////////////////////////////////////////////////////// + // Test for Boost.Lambda working with overloaded operators defined + // in + //////////////////////////////////////////////////////////////////////// + + bu::quantity lvar = 0.0 * bu::meter; + + bu::quantity dlvar = 3.0; + + // quantity += quantity + boost::function (bu::quantity)> + f = (bl::var(lvar) += bl::_1); + + lvar = 1.0 * bu::meter; + BOOST_CHECK((f(2.0 * bu::meter) == 3.0 * bu::meter)); + BOOST_CHECK((f(6.0 * bu::meter) == 9.0 * bu::meter)); + + // quantity += quantity + dlvar = 4.0; + BOOST_CHECK(((bl::var(dlvar) += bl::_1)(3.0) == 7.0)); + + // quantity -= quantity + lvar = 3.0 * bu::meter; + BOOST_CHECK((f(-2.0 * bu::meter) == 1.0 * bu::meter)); + BOOST_CHECK((f(6.0 * bu::meter) == 7.0 * bu::meter)); + + // quantity -= quantity + dlvar = 4.0; + BOOST_CHECK(((bl::var(dlvar) -= bl::_1)(3.0) == 1.0)); + + // quantity *= quantity + dlvar = 2.0; + BOOST_CHECK(((bl::var(dlvar) *= bl::_1)(3.0) == 6.0)); + + // quantity /= quantity + dlvar = 6.0; + BOOST_CHECK(((bl::var(dlvar) /= bl::_1)(3.0) == 2.0)); + + // quantity *= Y + lvar = 3.0 * bu::meter; + BOOST_CHECK(((bl::var(lvar) *= bl::_1)(2.0) == 6.0 * bu::meter)); + + // quantity /= Y + lvar = 6.0 * bu::meter; + BOOST_CHECK(((bl::var(lvar) /= bl::_1)(3.0) == 2.0 * bu::meter)); + + // unit * Y + BOOST_CHECK(((bl::_1 * bl::_2)(bu::meter, 2.0) == 2.0 * bu::meter)); + BOOST_CHECK(((bu::meter * bl::_1)(2.0) == 2.0 * bu::meter)); + + // unit / Y + BOOST_CHECK(((bl::_1 / bl::_2)(bu::meter, 0.5) == 2.0 * bu::meter)); + BOOST_CHECK(((bu::meter / bl::_1)(0.5 * bu::second) == 2.0 * bu::meter_per_second)); + + // Y * unit + BOOST_CHECK(((bl::_1 * bl::_2)(2.0, bu::meter) == 2.0 * bu::meter)); + BOOST_CHECK(((bl::_1 * bu::meter)(2.0 / bu::second) == 2.0 * bu::meter_per_second)); + + // Y / unit + BOOST_CHECK(((bl::_1 / bl::_2)(3.5, bu::second) == 3.5 / bu::second)); + BOOST_CHECK(((bl::_1 / bu::second)(3.5 * bu::meter) == 3.5 * bu::meter_per_second)); + + // quantity * X + BOOST_CHECK(((bl::_1 * bl::_2)(2.0, 3.0 * bu::meter) == 6.0 * bu::meter)); + + // X * quantity + BOOST_CHECK(((bl::_1 * bl::_2)(4.0 * bu::joule, 2.0) == 8.0 * bu::joule)); + + // quantity / X + BOOST_CHECK(((bl::_1 / bl::_2)(4.0 * bu::joule, 2.0) == 2.0 * bu::joule)); + + // X / quantity + BOOST_CHECK(((3.0 / bl::_1)(2.0 * bu::second) == 1.5 / bu::second)); + + // unit * quantity + BOOST_CHECK(((bl::_1 * bl::_2)(bu::meter, 12.0 / bu::second) == 12.0 * bu::meter_per_second)); + BOOST_CHECK(((bu::meter * bl::_1)(12.0 / bu::second) == 12.0 * bu::meter_per_second)); + + // unit / quantity + BOOST_CHECK(((bl::_1 / bl::_2)(bu::meter, 0.5 * bu::second) == 2.0 * bu::meter_per_second)); + BOOST_CHECK(((bu::meter / bl::_1)(0.25 * bu::second) == 4.0 * bu::meter_per_second)); + + // quantity * unit + BOOST_CHECK(((bl::_1 * bl::_2)(2.0 / bu::second, bu::meter) == 2.0 * bu::meter_per_second)); + BOOST_CHECK(((bl::_1 * bu::meter)(12.0 / bu::second) == 12.0 * bu::meter_per_second)); + + // quantity / unit + BOOST_CHECK(((bl::_1 / bl::_2)(3.5 * bu::meter, bu::second) == 3.5 * bu::meter_per_second)); + BOOST_CHECK(((bl::_1 / bu::second)(5.0 * bu::second) == 5.0)); + + // +quantity + BOOST_CHECK(((+bl::_1)(5.0 * bu::second) == 5.0 * bu::second)); + + // -quantity + BOOST_CHECK(((-bl::_1)(5.0 * bu::second) == -5.0 * bu::second)); + + // quantity + quantity + BOOST_CHECK(((bl::_1 + bl::_2)(2.0 * bu::meter, 4.0 * bu::meter) == 6.0 * bu::meter)); + + // quantity + Y + BOOST_CHECK(((bl::_1 + 1.0f)(bu::quantity(2.0)) == 3.0)); + + // X + quantity + BOOST_CHECK(((1.0f + bl::_1)(bu::quantity(1.0)) == 2.0)); + + // quantity - quantity + BOOST_CHECK(((bl::_1 - bl::_2)(2.0 * bu::meter, 4.0 * bu::meter) == -2.0 * bu::meter)); + + // quantity - Y + BOOST_CHECK(((bl::_1 - 2.0f)(bu::quantity(1.0)) == -1.0)); + + // X - quantity + BOOST_CHECK(((2.0f - bl::_1)(bu::quantity(1.0)) == 1.0)); + + // quantity * quantity + BOOST_CHECK(((bl::_1 * bl::_2)(2.0 * bu::kilogram, 4.0 * bu::meter_per_second) == 8.0 * bu::kilogram * bu::meter_per_second)); + + // quantity / quantity + BOOST_CHECK(((bl::_1 / bl::_2)(2.0 * bu::meter_per_second, 4.0 * bu::meter_per_second) == 0.5)); + + // quantity == quantity + BOOST_CHECK(((bl::_1 == bl::_2)(2.0 * bu::meter, 2.0 * bu::meter) == true)); + BOOST_CHECK(((bl::_1 == bl::_2)(2.0 * bu::meter, 3.0 * bu::meter) == false)); + + // quantity != quantity + BOOST_CHECK(((bl::_1 != bl::_2)(2.0 * bu::meter, 2.0 * bu::meter) == false)); + BOOST_CHECK(((bl::_1 != bl::_2)(2.0 * bu::meter, 3.0 * bu::meter) == true)); + + // quantity < quantity + BOOST_CHECK(((bl::_1 < bl::_2)(2.0 * bu::meter, 2.0 * bu::meter) == false)); + BOOST_CHECK(((bl::_1 < bl::_2)(2.0 * bu::meter, 3.0 * bu::meter) == true)); + + // quantity <= quantity + BOOST_CHECK(((bl::_1 <= bl::_2)(2.0 * bu::meter, 2.0 * bu::meter) == true)); + BOOST_CHECK(((bl::_1 <= bl::_2)(2.0 * bu::meter, 3.0 * bu::meter) == true)); + BOOST_CHECK(((bl::_1 <= bl::_2)(4.0 * bu::meter, 3.0 * bu::meter) == false)); + + // quantity > quantity + BOOST_CHECK(((bl::_1 > bl::_2)(2.0 * bu::meter, 2.0 * bu::meter) == false)); + BOOST_CHECK(((bl::_1 > bl::_2)(2.0 * bu::meter, 3.0 * bu::meter) == false)); + BOOST_CHECK(((bl::_1 > bl::_2)(4.0 * bu::meter, 3.0 * bu::meter) == true)); + + // quantity >= quantity + BOOST_CHECK(((bl::_1 >= bl::_2)(2.0 * bu::meter, 2.0 * bu::meter) == true)); + BOOST_CHECK(((bl::_1 >= bl::_2)(2.0 * bu::meter, 3.0 * bu::meter) == false)); + BOOST_CHECK(((bl::_1 >= bl::_2)(4.0 * bu::meter, 3.0 * bu::meter) == true)); + + + //////////////////////////////////////////////////////////////////////// + // Test for Boost.Lambda working with overloaded operators defined + // in + //////////////////////////////////////////////////////////////////////// + + // +unit + BOOST_CHECK(((+bl::_1)(bu::meter) == bu::meter)); + + // -unit + BOOST_CHECK(((-bl::_1)(bu::meter) == bu::meter)); + + // unit + unit + BOOST_CHECK(((bl::_1 + bu::meter)(bu::meter) == bu::meter)); + BOOST_CHECK(((bu::meter + bl::_1)(bu::meter) == bu::meter)); + BOOST_CHECK(((bl::_1 + bl::_2)(bu::meter, bu::meter) == bu::meter)); + + // unit - unit + BOOST_CHECK(((bl::_1 - bl::_2)(bu::meter, bu::meter) == bu::meter)); + BOOST_CHECK(((bl::_1 - bu::meter)(bu::meter) == bu::meter)); + BOOST_CHECK(((bu::meter - bl::_1)(bu::meter) == bu::meter)); + + // unit * unit + BOOST_CHECK(((bl::_1 * bl::_2)(bu::meter, bu::meter) == bu::meter * bu::meter)); + BOOST_CHECK(((bl::_1 * bu::meter)(bu::meter) == bu::meter * bu::meter)); + + // unit / unit + BOOST_CHECK(((bl::_1 / bl::_2)(bu::meter, bu::second) == bu::meter_per_second)); + BOOST_CHECK(((bl::_1 / bu::second)(bu::meter) == bu::meter_per_second)); + + // unit == unit + BOOST_CHECK(((bl::_1 == bu::meter)(bu::meter) == true)); + BOOST_CHECK(((bl::_1 == bu::meter)(bu::second) == false)); + + // unit != unit + BOOST_CHECK(((bl::_1 != bu::meter)(bu::meter) == false)); + BOOST_CHECK(((bl::_1 != bu::meter)(bu::second) == true)); + + + //////////////////////////////////////////////////////////////////////// + // Test for Boost.Lambda working with overloaded operators defined + // in + //////////////////////////////////////////////////////////////////////// + + // absolute += Y + bu::quantity > Ta = 270.0 * bu::absolute(); + (Ta += bl::_1)(30.0 * si::kelvin); + BOOST_CHECK(( Ta == 300.0 * bu::absolute())); + + // absolute -= Y + Ta = 270 * bu::absolute(); + (Ta -= bl::_1)(-30.0 * si::kelvin); + BOOST_CHECK(( Ta == 300.0 * bu::absolute())); + + // absolute + Y + BOOST_CHECK(((270.0 * bu::absolute() + bl::_1)(30.0 * si::kelvin) == 300.0 * bu::absolute())); + + // Y + absolute + BOOST_CHECK(((bl::_1 + 270.0 * bu::absolute())(30.0 * si::kelvin) == 300.0 * bu::absolute())); + + // absolute - Y + BOOST_CHECK(((270.0 * bu::absolute() - bl::_1)(30.0 * si::kelvin) == 240.0 * bu::absolute())); + + // absolute - absolute + BOOST_CHECK(((bl::_1 - 270.0 * bu::absolute())(300.0 * bu::absolute()) == 30.0 * si::kelvin)); + + // T * absolute > + BOOST_CHECK(((bl::_1 * bu::absolute())(300.0) == 300.0 * bu::absolute())); + BOOST_CHECK(((bl::_1 * bl::_2)(300.0, bu::absolute()) == 300.0 * bu::absolute())); + + // absolute > * T + BOOST_CHECK(((bu::absolute() * bl::_1)(300.0) == 300.0 * bu::absolute())); + BOOST_CHECK(((bl::_1 * bl::_2)(bu::absolute(), 300.0) == 300.0 * bu::absolute())); + + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_limits.cpp b/tools/boost_1_65_1/libs/units/test/test_limits.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6057cf94d3f2f0225dbafb3aa4d68c6ab280d2a2 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_limits.cpp @@ -0,0 +1,127 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_limits.cpp + +\details +Test numeric_limits specialization. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +#include +#include + +#include "test_header.hpp" + +typedef boost::units::length unit_type; +using boost::units::quantity; + +template +struct check_quiet_NaN; + +template<> +struct check_quiet_NaN { + template + static void apply() { + quantity q((std::numeric_limits >::quiet_NaN)()); + bool test = isnan BOOST_PREVENT_MACRO_SUBSTITUTION (q); + BOOST_CHECK(test); + } +}; + +template<> +struct check_quiet_NaN { + template + static void apply() {} +}; + +template +struct check_signaling_NaN; + +template<> +struct check_signaling_NaN { + template + static void apply() { + quantity q((std::numeric_limits >::signaling_NaN)()); + bool test = isnan BOOST_PREVENT_MACRO_SUBSTITUTION (q); + BOOST_CHECK(test); + } +}; + +template<> +struct check_signaling_NaN { + template + static void apply() {} +}; + +template +void do_check() { + #define CHECK_FUNCTION(name) BOOST_CHECK(((std::numeric_limits::name)() == (std::numeric_limits >::name)().value())) + #define CHECK_CONSTANT(name) BOOST_CHECK((std::numeric_limits::name == std::numeric_limits >::name)) + CHECK_FUNCTION(min); + CHECK_FUNCTION(max); + CHECK_FUNCTION(epsilon); + CHECK_FUNCTION(round_error); + CHECK_FUNCTION(infinity); + CHECK_FUNCTION(denorm_min); + #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS + CHECK_FUNCTION(lowest); + #endif + + CHECK_CONSTANT(is_specialized); + CHECK_CONSTANT(digits); + CHECK_CONSTANT(digits10); + #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS + CHECK_CONSTANT(max_digits10); + #endif + CHECK_CONSTANT(is_signed); + CHECK_CONSTANT(is_integer); + CHECK_CONSTANT(is_exact); + CHECK_CONSTANT(radix); + CHECK_CONSTANT(min_exponent); + CHECK_CONSTANT(min_exponent10); + CHECK_CONSTANT(max_exponent); + CHECK_CONSTANT(max_exponent10); + CHECK_CONSTANT(has_infinity); + CHECK_CONSTANT(has_quiet_NaN); + CHECK_CONSTANT(has_signaling_NaN); + CHECK_CONSTANT(has_denorm); + CHECK_CONSTANT(has_denorm_loss); + CHECK_CONSTANT(is_iec559); + CHECK_CONSTANT(is_bounded); + CHECK_CONSTANT(is_modulo); + CHECK_CONSTANT(traps); + CHECK_CONSTANT(tinyness_before); + CHECK_CONSTANT(round_style); + + check_quiet_NaN >::has_quiet_NaN>::template apply(); + check_signaling_NaN >::has_signaling_NaN>::template apply(); +} + +int test_main(int,char *[]) +{ + do_check(); + do_check(); + do_check(); + do_check(); + do_check(); + do_check >(); + + return(0); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_mixed_value_types.cpp b/tools/boost_1_65_1/libs/units/test/test_mixed_value_types.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dbc169676318b53443fd4f62bcd87e0b65cd7011 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_mixed_value_types.cpp @@ -0,0 +1,22 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +namespace bu = boost::units; + +int main() { + bu::quantity q1; + bu::quantity q2; + q1 + q2; + q1 -= q2; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_negative_denominator.cpp b/tools/boost_1_65_1/libs/units/test/test_negative_denominator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e9b638abc48cf0f4935dcb6d5c5113f138534d23 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_negative_denominator.cpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_negative_denominator.cpp + +\details +Test negative denominator for static_rational class. + +Output: +@verbatim +@endverbatim +**/ + +#include + +#include +#include + +BOOST_MPL_ASSERT((boost::is_same::type, boost::units::static_rational<2, -1>::type>)); + +int main() { +} diff --git a/tools/boost_1_65_1/libs/units/test/test_output.cpp b/tools/boost_1_65_1/libs/units/test/test_output.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d9a37fe574838473a4ea645d7aa21e67de42d95 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_output.cpp @@ -0,0 +1,499 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2009 Steven Watanabe +// Copyright Paul A. Bristow 2010 +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file test_output.cpp + +\brief +Test unit and quantity printing +\details +Tests for output from various units, name, symbol and raw formats, and automatic prefixing in engineering and binary units. +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +struct meter_base_unit : boost::units::base_unit { + static const char* name() { return("meter"); } + static const char* symbol() { return("m"); } +}; + +struct second_base_unit : boost::units::base_unit { + static const char* name() { return("second"); } + static const char* symbol() { return("s"); } +}; + +struct byte_base_unit : boost::units::base_unit { + static const char* name() { return("byte"); } + static const char* symbol() { return("b"); } +}; + +typedef boost::units::make_system::type my_system; + +typedef boost::units::unit length; +typedef boost::units::unit velocity; + +typedef boost::units::make_scaled_unit > >::type scaled_length; +typedef boost::units::make_scaled_unit > >::type scaled_velocity1; + +typedef boost::units::scaled_base_unit > > millisecond_base_unit; + +typedef boost::units::make_system::type scaled_system; + +typedef boost::units::unit scaled_time; +typedef boost::units::unit scaled_velocity2; + +typedef boost::units::unit area; +typedef boost::units::make_scaled_unit > >::type scaled_area; + +typedef boost::units::make_scaled_unit > >::type double_scaled_length; + +typedef boost::units::scaled_base_unit > > scaled_length_base_unit; +namespace boost { +namespace units { +template<> +struct base_unit_info { + static const char* symbol() { return("scm"); } + static const char* name() { return("scaled_meter"); } +}; +} +} +typedef boost::units::scaled_base_unit > > double_scaled_length_base_unit; +typedef double_scaled_length_base_unit::unit_type double_scaled_length2; + +typedef boost::units::reduce_unit >::type custom1; + +std::string name_string(const custom1&) { return("custom1"); } +std::string symbol_string(const custom1&) { return("c1"); } + +typedef boost::units::reduce_unit >::type custom2; + +const char* name_string(const custom2&) { return("custom2"); } +const char* symbol_string(const custom2&) { return("c2"); } + +typedef boost::units::make_scaled_unit > >::type scaled_custom1; +typedef boost::units::make_scaled_unit > >::type scaled_custom2; + +#ifndef BOOST_NO_CWCHAR + +#define BOOST_UNITS_TEST_OUTPUT(v, expected) \ +{ \ + std::ostringstream ss; \ + ss FORMATTERS << v; \ + BOOST_CHECK_EQUAL(ss.str(), expected); \ +} \ +{ \ + std::wostringstream ss; \ + ss FORMATTERS << v; \ + BOOST_CHECK(ss.str() == BOOST_PP_CAT(L, expected)); \ +} + +#define BOOST_UNITS_TEST_OUTPUT_REGEX(v, expected) \ +{ \ + std::ostringstream ss; \ + ss FORMATTERS << v; \ + boost::regex r(expected); \ + BOOST_CHECK_MESSAGE(boost::regex_match(ss.str(), r), \ + ss.str() + " does not match " + expected); \ +} \ +{ \ + std::wostringstream ss; \ + ss FORMATTERS << v; \ + boost::wregex r(BOOST_PP_CAT(L, expected)); \ + BOOST_CHECK(boost::regex_match(ss.str(), r)); \ +} + +#define BOOST_UNITS_TEST_OUTPUT_DISPLAY(v) \ +{ \ + std::ostringstream ss; \ + ss FORMATTERS << v; \ + std::cout << #v << ": " << ss.str() << std::endl; \ +} \ +{ \ + std::wostringstream ss; \ + ss FORMATTERS << v; \ + std::wcout << #v << ": " << ss.str() << std::endl; \ +} + +#else + +#define BOOST_UNITS_TEST_OUTPUT(v, expected) \ +{ \ + std::ostringstream ss; \ + ss FORMATTERS << v; \ + BOOST_CHECK_EQUAL(ss.str(), expected); \ +} + +#define BOOST_UNITS_TEST_OUTPUT_REGEX(v, expected) \ +{ \ + std::ostringstream ss; \ + ss FORMATTERS << v; \ + boost::regex r(expected); \ + BOOST_CHECK_MESSAGE(boost::regex_match(ss.str(), r), \ + ss.str() + " does not match " + expected); \ +} + +#define BOOST_UNITS_TEST_OUTPUT_DISPLAY(v) \ +{ \ + std::ostringstream ss; \ + ss FORMATTERS << v; \ + std::cout << #v << ": " << ss.str() << std::endl; \ +} + +#endif + +BOOST_AUTO_TEST_CASE(test_output_unit_symbol) +{ // base units using default symbol_format (no format specified) and no auto prefixing. +#define FORMATTERS + BOOST_UNITS_TEST_OUTPUT(meter_base_unit::unit_type(), "m"); + BOOST_UNITS_TEST_OUTPUT(velocity(), "m s^-1"); + BOOST_UNITS_TEST_OUTPUT(scaled_length(), "km"); + BOOST_UNITS_TEST_OUTPUT(scaled_velocity1(), "k(m s^-1)"); + BOOST_UNITS_TEST_OUTPUT(millisecond_base_unit::unit_type(), "ms"); + BOOST_UNITS_TEST_OUTPUT(scaled_time(), "ms"); + BOOST_UNITS_TEST_OUTPUT(scaled_velocity2(), "m ms^-1"); + BOOST_UNITS_TEST_OUTPUT(area(), "m^2"); + BOOST_UNITS_TEST_OUTPUT(scaled_area(), "k(m^2)"); + BOOST_UNITS_TEST_OUTPUT(double_scaled_length(), "Kikm"); + BOOST_UNITS_TEST_OUTPUT(double_scaled_length2(), "kscm"); + BOOST_UNITS_TEST_OUTPUT(custom1(), "c1"); + BOOST_UNITS_TEST_OUTPUT(custom2(), "c2"); + BOOST_UNITS_TEST_OUTPUT(scaled_custom1(), "kc1"); + BOOST_UNITS_TEST_OUTPUT(scaled_custom2(), "kc2"); + BOOST_UNITS_TEST_OUTPUT(boost::units::absolute(), "absolute m"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_unit_raw) +{ // raw format specified +#define FORMATTERS << boost::units::raw_format + BOOST_UNITS_TEST_OUTPUT(meter_base_unit::unit_type(), "m"); + BOOST_UNITS_TEST_OUTPUT(velocity(), "m s^-1"); + BOOST_UNITS_TEST_OUTPUT(scaled_length(), "km"); + BOOST_UNITS_TEST_OUTPUT(scaled_velocity1(), "k(m s^-1)"); + BOOST_UNITS_TEST_OUTPUT(millisecond_base_unit::unit_type(), "ms"); + BOOST_UNITS_TEST_OUTPUT(scaled_time(), "ms"); + BOOST_UNITS_TEST_OUTPUT(scaled_velocity2(), "m ms^-1"); + BOOST_UNITS_TEST_OUTPUT(area(), "m^2"); + BOOST_UNITS_TEST_OUTPUT(scaled_area(), "k(m^2)"); + BOOST_UNITS_TEST_OUTPUT(double_scaled_length(), "Kikm"); + BOOST_UNITS_TEST_OUTPUT(double_scaled_length2(), "kscm"); + // when using raw format, we ignore the user defined overloads + BOOST_UNITS_TEST_OUTPUT(custom1(), "m^3"); + BOOST_UNITS_TEST_OUTPUT(custom2(), "m s^-2"); + BOOST_UNITS_TEST_OUTPUT(scaled_custom1(), "k(m^3)"); + BOOST_UNITS_TEST_OUTPUT(scaled_custom2(), "k(m s^-2)"); + BOOST_UNITS_TEST_OUTPUT(boost::units::absolute(), "absolute m"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_unit_name) +{ // name format specified. +#define FORMATTERS << boost::units::name_format + BOOST_UNITS_TEST_OUTPUT(meter_base_unit::unit_type(), "meter"); + BOOST_UNITS_TEST_OUTPUT(velocity(), "meter second^-1"); + BOOST_UNITS_TEST_OUTPUT(scaled_length(), "kilometer"); + BOOST_UNITS_TEST_OUTPUT(scaled_velocity1(), "kilo(meter second^-1)"); + BOOST_UNITS_TEST_OUTPUT(millisecond_base_unit::unit_type(), "millisecond"); + BOOST_UNITS_TEST_OUTPUT(scaled_time(), "millisecond"); + BOOST_UNITS_TEST_OUTPUT(scaled_velocity2(), "meter millisecond^-1"); + BOOST_UNITS_TEST_OUTPUT(area(), "meter^2"); + BOOST_UNITS_TEST_OUTPUT(scaled_area(), "kilo(meter^2)"); + BOOST_UNITS_TEST_OUTPUT(double_scaled_length(), "kibikilometer"); + BOOST_UNITS_TEST_OUTPUT(double_scaled_length2(), "kiloscaled_meter"); + BOOST_UNITS_TEST_OUTPUT(custom1(), "custom1"); + BOOST_UNITS_TEST_OUTPUT(custom2(), "custom2"); + BOOST_UNITS_TEST_OUTPUT(scaled_custom1(), "kilocustom1"); + BOOST_UNITS_TEST_OUTPUT(scaled_custom2(), "kilocustom2"); + BOOST_UNITS_TEST_OUTPUT(boost::units::absolute(), "absolute meter"); +#undef FORMATTERS +} + + +BOOST_AUTO_TEST_CASE(test_output_quantity_symbol) +{ // quantity symbols using default format. +#define FORMATTERS + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 m"); + BOOST_UNITS_TEST_OUTPUT(1.5*velocity(), "1.5 m s^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_length(), "1.5 km"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity1(), "1.5 k(m s^-1)"); + BOOST_UNITS_TEST_OUTPUT(1.5*millisecond_base_unit::unit_type(), "1.5 ms"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_time(), "1.5 ms"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity2(), "1.5 m ms^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 m^2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 k(m^2)"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.5 Kikm"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kscm"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 c1"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 c2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kc1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom2(), "1.5 kc2"); + BOOST_UNITS_TEST_OUTPUT(1.5*boost::units::absolute(), "1.5 absolute m"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 10) * byte_base_unit::unit_type(), "1024 b"); + +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_quantity_raw) +{ // quantity symbols using raw format. +#define FORMATTERS << boost::units::raw_format + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 m"); + BOOST_UNITS_TEST_OUTPUT(1.5*velocity(), "1.5 m s^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_length(), "1.5 km"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity1(), "1.5 k(m s^-1)"); + BOOST_UNITS_TEST_OUTPUT(1.5*millisecond_base_unit::unit_type(), "1.5 ms"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_time(), "1.5 ms"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity2(), "1.5 m ms^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 m^2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 k(m^2)"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.5 Kikm"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kscm"); + // when using raw format, we ignore the user defined overloads + BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 m^3"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 m s^-2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 k(m^3)"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom2(), "1.5 k(m s^-2)"); + BOOST_UNITS_TEST_OUTPUT(1.5*boost::units::absolute(), "1.5 absolute m"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_quantity_name) +{ // // quantity symbols using name format. +#define FORMATTERS << boost::units::name_format + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 meter"); + BOOST_UNITS_TEST_OUTPUT(1.5*velocity(), "1.5 meter second^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_length(), "1.5 kilometer"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity1(), "1.5 kilo(meter second^-1)"); + BOOST_UNITS_TEST_OUTPUT(1.5*millisecond_base_unit::unit_type(), "1.5 millisecond"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_time(), "1.5 millisecond"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity2(), "1.5 meter millisecond^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 meter^2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 kilo(meter^2)"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.5 kibikilometer"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kiloscaled_meter"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 custom1"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 custom2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kilocustom1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom2(), "1.5 kilocustom2"); + BOOST_UNITS_TEST_OUTPUT(1.5*boost::units::absolute(), "1.5 absolute meter"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_autoprefixed_quantity_name) +{ // Engineering autoprefix, with name format. +#define FORMATTERS << boost::units::name_format << boost::units::engineering_prefix + // Single base unit like meter. + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 meter"); + BOOST_UNITS_TEST_OUTPUT(1500.0*meter_base_unit::unit_type(), "1.5 kilometer"); + BOOST_UNITS_TEST_OUTPUT(1.5e7*meter_base_unit::unit_type(), "15 megameter"); + BOOST_UNITS_TEST_OUTPUT(1.5e-3*meter_base_unit::unit_type(), "1.5 millimeter"); + BOOST_UNITS_TEST_OUTPUT(1.5e-9*meter_base_unit::unit_type(), "1.5 nanometer"); + BOOST_UNITS_TEST_OUTPUT(1.5e-8*meter_base_unit::unit_type(), "15 nanometer"); + BOOST_UNITS_TEST_OUTPUT(1.5e-10*meter_base_unit::unit_type(), "150 picometer"); + BOOST_UNITS_TEST_OUTPUT(0.0000000012345 * meter_base_unit::unit_type(), "1.2345 nanometer"); + + // Too small or large for a multiple name. + BOOST_UNITS_TEST_OUTPUT_REGEX(9.99999e-25 * meter_base_unit::unit_type(), "9\\.99999e-0?25 meter"); // Just too small for multiple. + BOOST_UNITS_TEST_OUTPUT_REGEX(1e+28 * meter_base_unit::unit_type(), "1e\\+0?28 meter"); // Just too large for multiple. + BOOST_UNITS_TEST_OUTPUT_REGEX(1.5e-25 * meter_base_unit::unit_type(), "1\\.5e-0?25 meter"); // Too small for multiple. + BOOST_UNITS_TEST_OUTPUT_REGEX(1.5e+28 * meter_base_unit::unit_type(), "1\\.5e\\+0?28 meter"); // Too large for multiple. + // Too 'biggest or too smallest'. + BOOST_UNITS_TEST_OUTPUT_REGEX((std::numeric_limits::max)()*meter_base_unit::unit_type(), "3\\.40282e\\+0?38 meter"); + BOOST_UNITS_TEST_OUTPUT_REGEX((std::numeric_limits::min)()*meter_base_unit::unit_type(), "1\\.17549e-0?38 meter"); + BOOST_UNITS_TEST_OUTPUT((std::numeric_limits::max)()*meter_base_unit::unit_type(), "1.79769e+308 meter"); + BOOST_UNITS_TEST_OUTPUT((std::numeric_limits::min)()*meter_base_unit::unit_type(), "2.22507e-308 meter"); + // Infinity and NaN + BOOST_UNITS_TEST_OUTPUT_REGEX(std::numeric_limits::infinity()*meter_base_unit::unit_type(), "(1\\.#INF|inf|INF|Inf) meter"); + BOOST_UNITS_TEST_OUTPUT_REGEX(-std::numeric_limits::infinity()*meter_base_unit::unit_type(), "-(1\\.#INF|inf|INF|Inf) meter"); + BOOST_UNITS_TEST_OUTPUT_REGEX(std::numeric_limits::quiet_NaN()*meter_base_unit::unit_type(), "(1\\.#QNAN|nan|NaNQ|NaN) meter"); + BOOST_UNITS_TEST_OUTPUT_REGEX(-std::numeric_limits::quiet_NaN()*meter_base_unit::unit_type(), "-?(1\\.#IND|nan|nan\\(ind\\)|NaNQ|NaN) meter"); + + BOOST_UNITS_TEST_OUTPUT(1.5*velocity(), "1.5 meter second^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_length(), "1.5 kilometer"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity1(), "1.5 kilo(meter second^-1)"); + BOOST_UNITS_TEST_OUTPUT(1.5*millisecond_base_unit::unit_type(), "1.5 millisecond"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_time(), "1.5 millisecond"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity2(), "1.5 meter millisecond^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 meter^2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 kilo(meter^2)"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.536 megameter"); // 1.5 * 2^10 = 1.5 * 1024 = 1.536 + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kiloscaled_meter"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 custom1"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 custom2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kilocustom1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom2(), "1.5 kilocustom2"); + BOOST_UNITS_TEST_OUTPUT(1.5*boost::units::absolute(), "1.5 absolute meter"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 10) * byte_base_unit::unit_type(), "1.024 kilobyte"); + + BOOST_UNITS_TEST_OUTPUT(1.5, "1.5"); // scalar. + BOOST_UNITS_TEST_OUTPUT(1567., "1567"); // scalars are *not* autoprefixed. + BOOST_UNITS_TEST_OUTPUT(0.00015, "0.00015"); // scalars are *not* autoprefixed. + BOOST_UNITS_TEST_OUTPUT(-1.5, "-1.5"); // scalar. + BOOST_UNITS_TEST_OUTPUT(-1567., "-1567"); // scalars are *not* autoprefixed. + BOOST_UNITS_TEST_OUTPUT(-0.00015, "-0.00015"); // scalars are *not* autoprefixed. +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_autoprefixed_quantity_symbol) +{ // Engineering autoprefix, with symbol format. +#define FORMATTERS << boost::units::symbol_format << boost::units::engineering_prefix + // Single base unit like m. + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 m"); + BOOST_UNITS_TEST_OUTPUT(1500.0*meter_base_unit::unit_type(), "1.5 km"); + BOOST_UNITS_TEST_OUTPUT(1.5e7*meter_base_unit::unit_type(), "15 Mm"); + BOOST_UNITS_TEST_OUTPUT(1.5e-3*meter_base_unit::unit_type(), "1.5 mm"); + BOOST_UNITS_TEST_OUTPUT(1.5e-9*meter_base_unit::unit_type(), "1.5 nm"); + BOOST_UNITS_TEST_OUTPUT(1.5e-8*meter_base_unit::unit_type(), "15 nm"); + BOOST_UNITS_TEST_OUTPUT(1.5e-10*meter_base_unit::unit_type(), "150 pm"); + // Too small or large for a multiple name. + BOOST_UNITS_TEST_OUTPUT_REGEX(9.99999e-25 * meter_base_unit::unit_type(), "9\\.99999e-0?25 m"); // Just too small for multiple. + BOOST_UNITS_TEST_OUTPUT_REGEX(1e+28 * meter_base_unit::unit_type(), "1e\\+0?28 m"); // Just too large for multiple. + BOOST_UNITS_TEST_OUTPUT_REGEX(1.5e-25 * meter_base_unit::unit_type(), "1\\.5e-0?25 m"); // Too small for multiple. + BOOST_UNITS_TEST_OUTPUT_REGEX(1.5e+28 * meter_base_unit::unit_type(), "1\\.5e\\+0?28 m"); // Too large for multiple. + // + BOOST_UNITS_TEST_OUTPUT_REGEX((std::numeric_limits::max)()*meter_base_unit::unit_type(), "3\\.40282e\\+0?38 m"); + BOOST_UNITS_TEST_OUTPUT_REGEX((std::numeric_limits::min)()*meter_base_unit::unit_type(), "1\\.17549e-0?38 m"); + BOOST_UNITS_TEST_OUTPUT((std::numeric_limits::max)()*meter_base_unit::unit_type(), "1.79769e+308 m"); + BOOST_UNITS_TEST_OUTPUT((std::numeric_limits::min)()*meter_base_unit::unit_type(), "2.22507e-308 m"); + + BOOST_UNITS_TEST_OUTPUT(1.5*velocity(), "1.5 m s^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_length(), "1.5 km"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity1(), "1.5 k(m s^-1)"); + BOOST_UNITS_TEST_OUTPUT(1.5*millisecond_base_unit::unit_type(), "1.5 ms"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_time(), "1.5 ms"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_velocity2(), "1.5 m ms^-1"); + BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 m^2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 k(m^2)"); + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.536 Mm"); // 1.5 * 2^10 = 1.5 * 1024 = 1.536 + BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kscm"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 c1"); + BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 c2"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kc1"); + BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom2(), "1.5 kc2"); + BOOST_UNITS_TEST_OUTPUT(1.5*boost::units::absolute(), "1.5 absolute m"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 10) * byte_base_unit::unit_type(), "1.024 kb"); + +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_auto_binary_prefixed_quantity_symbol) +{ // Binary prefix with symbol format. +#define FORMATTERS << boost::units::symbol_format << boost::units::binary_prefix + BOOST_UNITS_TEST_OUTPUT(1024 * byte_base_unit::unit_type(), "1 Kib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 20) * byte_base_unit::unit_type(), "1 Mib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 30) * byte_base_unit::unit_type(), "1 Gib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 40) * byte_base_unit::unit_type(), "1 Tib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 50) * byte_base_unit::unit_type(), "1 Pib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 60) * byte_base_unit::unit_type(), "1 Eib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 70) * byte_base_unit::unit_type(), "1 Zib"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 80) * byte_base_unit::unit_type(), "1 Yib"); + BOOST_UNITS_TEST_OUTPUT(42, "42"); // integer scalar. + BOOST_UNITS_TEST_OUTPUT(-42, "-42"); // integer scalar. + BOOST_UNITS_TEST_OUTPUT(1567, "1567"); // scalars are *not* autoprefixed. + BOOST_UNITS_TEST_OUTPUT(-1567, "-1567"); // scalars are *not* autoprefixed. +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_auto_binary_prefixed_quantity_name) +{ // Binary prefix with name format. + // http://physics.nist.gov/cuu/Units/binary.html + // 1998 the International Electrotechnical Commission (IEC) approved + // IEC 60027-2, Second edition, 2000-11, Letter symbols to be used in electrical technology + // - Part 2: Telecommunications and electronics. + // IEC 80000-13:2008, Quantities and units + // - Part 13: Information science and technology +#define FORMATTERS << boost::units::name_format << boost::units::binary_prefix + BOOST_UNITS_TEST_OUTPUT(2048 * byte_base_unit::unit_type(), "2 kibibyte"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 32) *byte_base_unit::unit_type(), "4 gibibyte"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 41) *byte_base_unit::unit_type(), "2 tebibyte"); // http://en.wikipedia.org/wiki/Tebibyte + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 50) *byte_base_unit::unit_type(), "1 pebibyte"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 60) *byte_base_unit::unit_type(), "1 exbibyte"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 70) *byte_base_unit::unit_type(), "1 zebibyte"); + BOOST_UNITS_TEST_OUTPUT(std::pow(2., 80) *byte_base_unit::unit_type(), "1 yobibyte"); + BOOST_UNITS_TEST_OUTPUT(2048, "2048"); // scalars are *not* autoprefixed. + BOOST_UNITS_TEST_OUTPUT(-4096, "-4096"); // scalars are *not* autoprefixed. +#undef FORMATTERS +} + +// Tests on using more than one format or prefix - only the last specified should be used. +// (This may indicate a programming mistake, but it is ignored). +BOOST_AUTO_TEST_CASE(test_output_quantity_name_duplicate) +{ // Ensure that if more than one format specified, only the last is used. +#define FORMATTERS << boost::units::symbol_format << boost::units::name_format + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 meter"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_quantity_symbol_duplicate) +{ // Ensure that if more than one format specified, only the last is used. +#define FORMATTERS << boost::units::name_format << boost::units::symbol_format + BOOST_UNITS_TEST_OUTPUT(1.5*meter_base_unit::unit_type(), "1.5 m"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_auto_binary_prefixed_quantity_name_duplicate) +{ // Ensure that if more than one auto prefix specified, only the last is used. +#define FORMATTERS << boost::units::name_format << boost::units::binary_prefix << boost::units::engineering_prefix + BOOST_UNITS_TEST_OUTPUT(2048 * byte_base_unit::unit_type(), "2.048 kilobyte"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_auto_binary_prefixed_quantity_symbol_duplicate) +{ // Ensure that if more than one auto prefix specified, only the last is used. +#define FORMATTERS << boost::units::symbol_format << boost::units::engineering_prefix << boost::units::binary_prefix + BOOST_UNITS_TEST_OUTPUT(2048 * byte_base_unit::unit_type(), "2 Kib"); +#undef FORMATTERS +} + +BOOST_AUTO_TEST_CASE(test_output_typename_format) +{ // Displays typename formatting result. The test doesn't check the formatting result + // and thus doesn't fail because the formatting result is platform-dependent. +#define FORMATTERS << boost::units::typename_format + BOOST_UNITS_TEST_OUTPUT_DISPLAY(meter_base_unit::unit_type()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(velocity()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_length()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_velocity1()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(millisecond_base_unit::unit_type()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_time()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_velocity2()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(area()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_area()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(double_scaled_length()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(double_scaled_length2()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(custom1()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(custom2()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_custom1()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(scaled_custom2()); + BOOST_UNITS_TEST_OUTPUT_DISPLAY(boost::units::absolute()); +#undef FORMATTERS +} diff --git a/tools/boost_1_65_1/libs/units/test/test_predicates.cpp b/tools/boost_1_65_1/libs/units/test/test_predicates.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d05c4eafb41fdcd75be5f93fd286f2820f1dc294 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_predicates.cpp @@ -0,0 +1,100 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_predicates.cpp + +\details +Test metafunctions is_unit, is_quantity, is_dimension_list .... + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace bu = boost::units; + +struct dimension_tag : boost::units::base_dimension { }; + +typedef dimension_tag::dimension_type dimension; + +struct base_unit1 : bu::base_unit {}; +struct base_unit2 : bu::base_unit {}; + +typedef bu::make_system::type system1; +typedef bu::make_system::type system2; + +int main(int,char *[]) +{ + BOOST_MPL_ASSERT((bu::is_dimension_list)); + BOOST_MPL_ASSERT((bu::is_dimension_list)); + BOOST_MPL_ASSERT_NOT((bu::is_dimension_list >)); + BOOST_MPL_ASSERT_NOT((bu::is_dimension_list)); + + BOOST_MPL_ASSERT((bu::is_unit >)); + BOOST_MPL_ASSERT((bu::is_unit >)); + BOOST_MPL_ASSERT_NOT((bu::is_unit)); + + BOOST_MPL_ASSERT((bu::is_unit_of_system, system1>)); + BOOST_MPL_ASSERT((bu::is_unit_of_system, system1>)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_system, system2>)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_system, system2>)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_system)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_system)); + + BOOST_MPL_ASSERT((bu::is_unit_of_dimension, bu::dimensionless_type>)); + BOOST_MPL_ASSERT((bu::is_unit_of_dimension, dimension>)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_dimension, dimension>)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_dimension, bu::dimensionless_type>)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_dimension)); + BOOST_MPL_ASSERT_NOT((bu::is_unit_of_dimension)); + + BOOST_MPL_ASSERT((bu::is_quantity > >)); + BOOST_MPL_ASSERT((bu::is_quantity > >)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity)); + + BOOST_MPL_ASSERT((bu::is_quantity, int> >)); + BOOST_MPL_ASSERT((bu::is_quantity, int> >)); + + BOOST_MPL_ASSERT((bu::is_quantity_of_system >, system1>)); + BOOST_MPL_ASSERT((bu::is_quantity_of_system >, system1>)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_system >, system2>)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_system >, system2>)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_system)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_system)); + + BOOST_MPL_ASSERT((bu::is_quantity_of_dimension >, bu::dimensionless_type>)); + BOOST_MPL_ASSERT((bu::is_quantity_of_dimension >, dimension>)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_dimension >, dimension>)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_dimension >, bu::dimensionless_type>)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_dimension)); + BOOST_MPL_ASSERT_NOT((bu::is_quantity_of_dimension)); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_quantity.cpp b/tools/boost_1_65_1/libs/units/test/test_quantity.cpp new file mode 100644 index 0000000000000000000000000000000000000000..28eee7cd34898c757ed5a5705dd24f88fb1eac74 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_quantity.cpp @@ -0,0 +1,203 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_units_1.cpp + +\details +Test unit class. + +Output: +@verbatim +@endverbatim +**/ + +#include "test_header.hpp" + +#include + +namespace bu = boost::units; + +static const double E_ = 2.718281828459045235360287471352662497757; + +int test_main(int,char *[]) +{ + // default constructor + const bu::quantity E1; + BOOST_CHECK(E1.value() == double()); + + // value_type constructor + const bu::quantity E2(E_*bu::joules); + BOOST_CHECK(E2.value() == E_); + + // copy constructor + const bu::quantity E3(E2); + BOOST_CHECK(E3.value() == E_); + + // operator= + const bu::quantity E4 = E2; + BOOST_CHECK(E4.value() == E_); + + // implicit copy constructor value_type conversion + const bu::quantity E5(E2); + BOOST_UNITS_CHECK_CLOSE(E5.value(),float(E_)); + + // implicit operator= value_type conversion + //const bu::quantity E7 = E2; + //BOOST_UNITS_CHECK_CLOSE(E7.value(),float(E_)); + + //const bu::quantity E8 = E2; + //BOOST_CHECK(E8.value() == long(E_)); + + // const construction + bu::quantity E9(E2); + BOOST_CHECK(E9.value() == E_); + + // value assignment + bu::quantity_cast(E9) = 1.5; + BOOST_CHECK(E9.value() == 1.5); + + // value assignment with implicit value_type conversion + bu::quantity_cast(E9) = 2; + BOOST_CHECK(E9.value() == double(2)); + + // operator+=(this_type) + E9 = 2.0*bu::joules; + E9 += E9; + BOOST_CHECK(E9.value() == 4.0); + + // operator-=(this_type) + E9 = 2.0*bu::joules; + E9 -= E9; + BOOST_CHECK(E9.value() == 0.0); + + // operator*=(value_type) + E9 = 2.0*bu::joules; + E9 *= 2.0; + BOOST_CHECK(E9.value() == 4.0); + + // operator/=(value_type) + E9 = 2.0*bu::joules; + E9 /= 2.0; + BOOST_CHECK(E9.value() == 1.0); + + // static construct quantity from value_type + const bu::quantity E(bu::quantity::from_value(2.5)); + BOOST_CHECK(E.value() == 2.5); + + // quantity_cast + + // unit * scalar + BOOST_CHECK(bu::joules*2.0 == bu::quantity::from_value(2.0)); + + // unit / scalar + BOOST_CHECK(bu::joules/2.0 == bu::quantity::from_value(0.5)); + + // scalar * unit + BOOST_CHECK(2.0*bu::joules == bu::quantity::from_value(2.0)); + + // scalar / unit + BOOST_CHECK(2.0/bu::joules == bu::quantity::from_value(2.0)); + + // quantity * scalar + BOOST_CHECK(E*2.0 == bu::quantity::from_value(5.0)); + + // quantity / scalar + BOOST_CHECK(E/2.0 == bu::quantity::from_value(1.25)); + + // scalar * quantity + BOOST_CHECK(2.0*E == bu::quantity::from_value(5.0)); + + // scalar / quantity + BOOST_CHECK(2.0/E == bu::quantity::from_value(0.8)); + + const bu::quantity L(1.0*bu::meters); + const bu::quantity M(2.0*bu::kilograms); + const bu::quantity T(3.0*bu::seconds); + const bu::quantity V(bu::quantity::from_value(4.0)); + + // unit * quantity + BOOST_CHECK(bu::seconds*V == 4.0*bu::meters); + + // unit / quantity + BOOST_CHECK(bu::meters/V == 0.25*bu::seconds); + + // quantity * unit + BOOST_CHECK(V*bu::seconds == 4.0*bu::meters); + + // quantity / unit + BOOST_CHECK(V/bu::meters == 4.0/bu::seconds); + + // +quantity + BOOST_CHECK(+V == 4.0*bu::meters_per_second); + + // -quantity + BOOST_CHECK(-V == -4.0*bu::meters_per_second); + + // quantity + quantity + BOOST_CHECK(V+V == 8.0*bu::meters_per_second); + + // quantity - quantity + BOOST_CHECK(V-V == 0.0*bu::meters_per_second); + + // quantity * quantity + BOOST_CHECK(V*T == 12.0*bu::meters); + + // quantity / quantity + BOOST_CHECK(L/V == 0.25*bu::seconds); + + const bu::quantity A(2.0*bu::square_meters); + const bu::quantity VL(1.0*bu::cubic_meters); + + // integer power of quantity + BOOST_CHECK(2.0*bu::pow<2>(L) == A); + + // rational power of quantity + BOOST_CHECK((bu::pow< bu::static_rational<2,3> >(VL) == 0.5*A)); + + // integer root of quantity + BOOST_CHECK(bu::root<2>(A) == std::sqrt(2.0)*L); + + // rational root of quantity + BOOST_CHECK((bu::root< bu::static_rational<3,2> >(VL) == 0.5*A)); + + const bu::quantity A1(0.0*bu::square_meters), + A2(0.0*bu::square_meters), + A3(1.0*bu::square_meters), + A4(-1.0*bu::square_meters); + + // operator== + BOOST_CHECK((A1 == A2) == true); + BOOST_CHECK((A1 == A3) == false); + + // operator!= + BOOST_CHECK((A1 != A2) == false); + BOOST_CHECK((A1 != A3) == true); + + // operator< + BOOST_CHECK((A1 < A2) == false); + BOOST_CHECK((A1 < A3) == true); + + // operator<= + BOOST_CHECK((A1 <= A2) == true); + BOOST_CHECK((A1 <= A3) == true); + + // operator> + BOOST_CHECK((A1 > A2) == false); + BOOST_CHECK((A1 > A4) == true); + + // operator>= + BOOST_CHECK((A1 >= A2) == true); + BOOST_CHECK((A1 >= A4) == true); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_reduce_unit.cpp b/tools/boost_1_65_1/libs/units/test/test_reduce_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c9daed0913e5d734fc5e3336571e792a39a16bdf --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_reduce_unit.cpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_reduce_unit.cpp + +\details +Test that reduce_unit works correctly by itself to try to isolate problems. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include + +#include +#include + +BOOST_MPL_ASSERT((boost::is_same::type, boost::units::si::kelvin_base_unit::unit_type>)); diff --git a/tools/boost_1_65_1/libs/units/test/test_scaled_conversion.cpp b/tools/boost_1_65_1/libs/units/test/test_scaled_conversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c9da8fcf316bf18b38d3d3ff77221700559d6569 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_scaled_conversion.cpp @@ -0,0 +1,66 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_scaled_conversion.cpp + +\details +Test unit scaling + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define BOOST_UNITS_CHECK_CLOSE(a, b) (BOOST_CHECK((std::abs((a) - (b)) < .0000001))) + +namespace bu = boost::units; + +struct base_dimension1 : bu::base_dimension {}; +struct base_dimension2 : bu::base_dimension {}; +struct base_dimension3 : bu::base_dimension {}; + +typedef bu::derived_dimension::type dimension4; + +struct base_unit1 : bu::base_unit {}; +struct base_unit2 : bu::base_unit {}; +struct base_unit3 : bu::base_unit {}; +struct base_unit4 : bu::base_unit {}; +struct base_unit5 : bu::base_unit {}; + +typedef bu::scaled_base_unit > > scaled_base_unit2; +typedef bu::scaled_base_unit > > scaled_base_unit4; + +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(base_unit1, scaled_base_unit2, double, 5); +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(scaled_base_unit2, base_unit3, double, 3); + +int test_main(int,char *[]) +{ + BOOST_UNITS_CHECK_CLOSE(bu::conversion_factor(base_unit1::unit_type(), base_unit2::unit_type()), 5000); + BOOST_UNITS_CHECK_CLOSE(bu::conversion_factor(base_unit2::unit_type(), base_unit3::unit_type()), 0.003); + BOOST_UNITS_CHECK_CLOSE(bu::conversion_factor(scaled_base_unit2::unit_type(), base_unit2::unit_type()), 1000); + + BOOST_UNITS_CHECK_CLOSE(bu::conversion_factor(base_unit4::unit_type()/base_unit5::unit_type(), scaled_base_unit4::unit_type()/base_unit5::unit_type()), 1e-3); + + return(0); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_scaled_unit.cpp b/tools/boost_1_65_1/libs/units/test/test_scaled_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..89cd8185ed53a4d290e4baca60ba8ee7db502062 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_scaled_unit.cpp @@ -0,0 +1,76 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_scaled_conversion.cpp + +\details +Test unit scaling + +Output: +@verbatim +@endverbatim +**/ + +#define BOOST_TEST_MAIN + +#include +#include +#include +#include + +#include + +#include +#include + +namespace bu = boost::units; +namespace si = boost::units::si; + +BOOST_AUTO_TEST_CASE(test_scaled_to_plain) { + bu::quantity s1 = 12.5 * si::seconds; + bu::quantity s2(si::nano * s1); + BOOST_CHECK_CLOSE_FRACTION(1e-9 * s1.value(), s2.value(), 0.000000001); +} + +BOOST_AUTO_TEST_CASE(test_plain_to_scaled) { + bu::quantity s1 = 12.5 * si::seconds; + typedef bu::multiply_typeof_helper::type time_unit; + bu::quantity s2(s1); + BOOST_CHECK_CLOSE_FRACTION(1e9 * s1.value(), s2.value(), 0.000000001); +} + +BOOST_AUTO_TEST_CASE(test_scaled_to_scaled) { + typedef bu::multiply_typeof_helper::type mega_time_unit; + typedef bu::multiply_typeof_helper::type micro_time_unit; + bu::quantity s1(12.5 * si::seconds); + bu::quantity s2(s1); + BOOST_CHECK_CLOSE_FRACTION(1e12 * s1.value(), s2.value(), 0.000000001); +} + +BOOST_AUTO_TEST_CASE(test_conversion_factor) { + BOOST_CHECK_CLOSE_FRACTION(conversion_factor(si::nano*si::seconds, si::seconds), 1e-9, 0.000000001); + BOOST_CHECK_CLOSE_FRACTION(conversion_factor(si::seconds, si::nano*si::seconds), 1e9, 0.000000001); + BOOST_CHECK_CLOSE_FRACTION(conversion_factor(si::mega*si::seconds, si::micro*si::seconds), 1e12, 0.000000001); +} + +BOOST_AUTO_TEST_CASE(test_output) { + std::stringstream stream; + stream << si::nano * 12.5 * si::seconds; + BOOST_CHECK_EQUAL(stream.str(), "12.5 ns"); +} + +BOOST_AUTO_TEST_CASE(test_output_name) { + std::stringstream stream; + stream << bu::name_format << si::nano * 12.5 * si::seconds; + BOOST_CHECK_EQUAL(stream.str(), "12.5 nanosecond"); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_trig.cpp b/tools/boost_1_65_1/libs/units/test/test_trig.cpp new file mode 100644 index 0000000000000000000000000000000000000000..574c460a545fd4756653c7ecb5712d8c540a11c5 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_trig.cpp @@ -0,0 +1,79 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2009 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_trig.cpp + +\details +Test trigonometric functions. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_TEST_MAIN +#include + +using boost::units::si::radians; +using boost::units::si::si_dimensionless; +using boost::units::degree::degrees; +BOOST_UNITS_STATIC_CONSTANT(degree_dimensionless, boost::units::degree::dimensionless); +using boost::units::si::meters; +BOOST_UNITS_STATIC_CONSTANT(heterogeneous_dimensionless, boost::units::reduce_unit::type); + +BOOST_AUTO_TEST_CASE(test_sin) { + BOOST_CHECK_EQUAL(boost::units::sin(2.0 * radians), std::sin(2.0) * si_dimensionless); + BOOST_CHECK_CLOSE_FRACTION(static_cast(boost::units::sin(15.0 * degrees)), 0.2588, 0.0004); +} + +BOOST_AUTO_TEST_CASE(test_cos) { + BOOST_CHECK_EQUAL(boost::units::cos(2.0 * radians), std::cos(2.0) * si_dimensionless); + BOOST_CHECK_CLOSE_FRACTION(static_cast(boost::units::cos(75.0 * degrees)), 0.2588, 0.0004); +} + +BOOST_AUTO_TEST_CASE(test_tan) { + BOOST_CHECK_EQUAL(boost::units::tan(2.0 * radians), std::tan(2.0) * si_dimensionless); + BOOST_CHECK_CLOSE_FRACTION(static_cast(boost::units::tan(45.0 * degrees)), 1.0, 0.0001); +} + +BOOST_AUTO_TEST_CASE(test_asin) { + BOOST_CHECK_EQUAL(boost::units::asin(0.2 * si_dimensionless), std::asin(0.2) * radians); + BOOST_CHECK_CLOSE_FRACTION(boost::units::asin(0.5 * degree_dimensionless).value(), 30.0, 0.0001); + BOOST_CHECK_EQUAL(boost::units::asin(0.2 * heterogeneous_dimensionless).value(), std::asin(0.2)); +} + +BOOST_AUTO_TEST_CASE(test_acos) { + BOOST_CHECK_EQUAL(boost::units::acos(0.2 * si_dimensionless), std::acos(0.2) * radians); + BOOST_CHECK_CLOSE_FRACTION(boost::units::acos(0.5 * degree_dimensionless).value(), 60.0, 0.0001); + BOOST_CHECK_EQUAL(boost::units::acos(0.2 * heterogeneous_dimensionless).value(), std::acos(0.2)); +} + +BOOST_AUTO_TEST_CASE(test_atan) { + BOOST_CHECK_EQUAL(boost::units::atan(0.2 * si_dimensionless), std::atan(0.2) * radians); + BOOST_CHECK_CLOSE_FRACTION(boost::units::atan(1.0 * degree_dimensionless).value(), 45.0, 0.0001); + BOOST_CHECK_EQUAL(boost::units::atan(0.2 * heterogeneous_dimensionless).value(), std::atan(0.2)); +} + +BOOST_AUTO_TEST_CASE(test_atan2) { + BOOST_CHECK_EQUAL(boost::units::atan2(0.2 * si_dimensionless, 0.3 * si_dimensionless), std::atan2(0.2, 0.3) * radians); + BOOST_CHECK_EQUAL(boost::units::atan2(0.2 * meters, 0.3 * meters), std::atan2(0.2, 0.3) * radians); + BOOST_CHECK_CLOSE_FRACTION(boost::units::atan2(0.8660*degree_dimensionless,0.5*degree_dimensionless).value(), 60., 0.0002); + BOOST_CHECK_EQUAL(boost::units::atan2(0.2 * heterogeneous_dimensionless, 0.3 * heterogeneous_dimensionless).value(), std::atan2(0.2, 0.3)); +} diff --git a/tools/boost_1_65_1/libs/units/test/test_unit.cpp b/tools/boost_1_65_1/libs/units/test/test_unit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49748c50a7ddd0758acc0be260245a5379ef5207 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_unit.cpp @@ -0,0 +1,67 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_units_1.cpp + +\details +Test unit class. + +Output: +@verbatim +@endverbatim +**/ + +#include "test_header.hpp" + +#include + +namespace bu = boost::units; + +int test_main(int,char *[]) +{ + const bu::dimensionless D; + + const bu::length L; + const bu::mass M; + const bu::time T; + + BOOST_CHECK(+L == L); + BOOST_CHECK(-L == L); + BOOST_CHECK(L+L == L); + BOOST_CHECK(L-L == L); + + BOOST_CHECK(+M == M); + BOOST_CHECK(-M == M); + BOOST_CHECK(M+M == M); + BOOST_CHECK(M-M == M); + + const bu::area A; + const bu::energy E; + const bu::velocity V; + + BOOST_CHECK(L*L == A); + BOOST_CHECK(A == L*L); + + BOOST_CHECK(L/L == D); + BOOST_CHECK(D == L/L); + + BOOST_CHECK(L/T == V); + BOOST_CHECK(V == L/T); + + BOOST_CHECK(M*L*L/T/T == E); + BOOST_CHECK(M*(L/T)*(L/T) == E); + BOOST_CHECK(M*bu::pow<2>(L/T) == E); + BOOST_CHECK(bu::root<2>(E/M) == V); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/units/test/test_unscale.cpp b/tools/boost_1_65_1/libs/units/test/test_unscale.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d81a144d511d8c6ebfff7d62490b170d67ed0a5a --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test/test_unscale.cpp @@ -0,0 +1,58 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/** +\file + +\brief test_unscale.cpp + +\details +Test that unscale works in an attempt to isolate the sun problems. + +Output: +@verbatim +@endverbatim +**/ + +#include +#include +#include + +#include +#include + +BOOST_MPL_ASSERT((boost::is_same::type, + boost::units::temperature::fahrenheit_base_unit::unit_type::system_type>)); + +BOOST_MPL_ASSERT((boost::is_same::type, + boost::units::temperature::fahrenheit_base_unit::unit_type>)); + +BOOST_MPL_ASSERT((boost::is_same::type>::type, + boost::units::temperature::fahrenheit_base_unit::unit_type>)); + +BOOST_MPL_ASSERT((boost::is_same< + boost::units::temperature::fahrenheit_base_unit::unit_type, + boost::units::unit< + boost::units::temperature_dimension, + boost::units::heterogeneous_system< + boost::units::heterogeneous_system_impl< + boost::units::list< + boost::units::heterogeneous_system_dim< + boost::units::temperature::fahrenheit_base_unit, + boost::units::static_rational<1> + >, + boost::units::dimensionless_type + >, + boost::units::temperature_dimension, + boost::units::dimensionless_type + > + > + > +>)); diff --git a/tools/boost_1_65_1/libs/units/test_headers/Jamfile.v2 b/tools/boost_1_65_1/libs/units/test_headers/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..8bcd8322ae6c876dd0f4eb2e131b6ab6251f08ce --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test_headers/Jamfile.v2 @@ -0,0 +1,56 @@ +# Jamfile.v2 +# +# Copyright (c) 2007-2008 +# Steven Watanabe +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt + +import testing ; +import path ; +import regex ; +import print ; +import sequence ; +import feature ; + +project boost/units/test_headers : + requirements $(BOOST_ROOT) ../../.. +; + +headers = [ path.glob-tree ../../../boost/units : *.hpp : detail ] ; + +for local file in $(headers) +{ + compile test.cpp + : # requirements + BOOST_UNITS_HEADER_NAME=$(file) + $(file) + : # test name + [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ; +} + +feature.feature : forward reverse : incidental ; + +rule generate-include-all ( target : sources * : properties * ) +{ + print.output $(target) ; + + if reverse in $(properties) + { + sources = [ sequence.reverse $(sources) ] ; + } + + for local file in $(sources) + { + print.text "#include <$(file:G=)> +" : overwrite ; + } + +} + +make include_all1.cpp : $(headers) : @generate-include-all ; +make include_all2.cpp : $(headers) : @generate-include-all : reverse ; + +# this ought to catch non-inlined functions and other duplicate definitions +link include_all1.cpp include_all2.cpp main.cpp : . : include_all_headers ; diff --git a/tools/boost_1_65_1/libs/units/test_headers/main.cpp b/tools/boost_1_65_1/libs/units/test_headers/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a7746ff487137c7ed427acd237f647236329d78d --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test_headers/main.cpp @@ -0,0 +1,12 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +int main() { +} diff --git a/tools/boost_1_65_1/libs/units/test_headers/test.cpp b/tools/boost_1_65_1/libs/units/test_headers/test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..589e974c055e01ac4a09a86cc4c09963b5f84a48 --- /dev/null +++ b/tools/boost_1_65_1/libs/units/test_headers/test.cpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_UNITS_STRINGIZE_IMPL(x) #x +#define BOOST_UNITS_STRINGIZE(x) BOOST_UNITS_STRINGIZE_IMPL(x) + +#define BOOST_UNITS_HEADER BOOST_UNITS_STRINGIZE(BOOST_UNITS_HEADER_NAME) + +#include BOOST_UNITS_HEADER +#include BOOST_UNITS_HEADER + +int main() {} diff --git a/tools/boost_1_65_1/libs/units/tutorial/tutorial_1.cpp b/tools/boost_1_65_1/libs/units/tutorial/tutorial_1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f7508a6c17ba4ee18c962401b6bbf70659618a1b --- /dev/null +++ b/tools/boost_1_65_1/libs/units/tutorial/tutorial_1.cpp @@ -0,0 +1,314 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +struct length_base_dimension : boost::units::base_dimension { }; ///> base dimension of length +struct time_base_dimension : boost::units::base_dimension { }; ///> base dimension of time + +typedef length_base_dimension::dimension_type length_dimension; +typedef time_base_dimension::dimension_type time_dimension; + +struct length1_base_unit : base_unit +{ + static std::string name() { return "length 1"; } + static std::string symbol() { return "l1"; } +}; + +struct length2_base_unit : base_unit +{ + static std::string name() { return "length2"; } + static std::string symbol() { return "l2"; } +}; + +struct time1_base_unit : base_unit +{ + static std::string name() { return "time1"; } + static std::string symbol() { return "t1"; } +}; + +struct time2_base_unit : base_unit +{ + static std::string name() { return "time2"; } + static std::string symbol() { return "t2"; } +}; + +namespace s1 { + +typedef make_system::type system; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit time; + +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(length1,length); +BOOST_UNITS_STATIC_CONSTANT(time1,time); + +} // namespace s1 + +namespace s2 { + +typedef make_system::type system; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit time; + +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(length2,length); +BOOST_UNITS_STATIC_CONSTANT(time2,time); + +} // namespace s2 + +template +struct conversion_helper< quantity,quantity > +{ + static quantity convert(const quantity& source) + { + return quantity::from_value(2.5*source.value()); + } +}; + +template +struct conversion_helper< quantity,quantity > +{ + static quantity convert(const quantity& source) + { + return quantity::from_value((1.0/2.5)*source.value()); + } +}; + +template +struct conversion_helper< quantity,quantity > +{ + static quantity convert(const quantity& source) + { + return quantity::from_value(0.5*source.value()); + } +}; + +} // namespace units + +} // namespace boost + +int main(void) +{ + using namespace boost::units; + + quantity l1(1.0*s1::length1); + quantity l2(1.5*l1); + quantity l3(2.0*l2/3.0); + + quantity t1(1.0*s1::time1); + quantity t2(1.5*t1); +// quantity t3(2.0*t2/3.0); + + return 0; +} + +/* +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +struct length_base_dimension : boost::units::base_dimension { }; ///> base dimension of length +struct mass_base_dimension : boost::units::base_dimension { }; ///> base dimension of mass +struct time_base_dimension : boost::units::base_dimension { }; ///> base dimension of time + +typedef length_base_dimension::dimension_type length_dimension; +typedef mass_base_dimension::dimension_type mass_dimension; +typedef time_base_dimension::dimension_type time_dimension; + +struct centimeter_base_unit : base_unit +{ + static std::string name() { return "centimeter"; } + static std::string symbol() { return "cm"; } +}; + +struct gram_base_unit : base_unit +{ + static std::string name() { return "gram"; } + static std::string symbol() { return "g"; } +}; + +struct second_base_unit : base_unit +{ + static std::string name() { return "second"; } + static std::string symbol() { return "s"; } +}; + +namespace CG { + +typedef make_system::type system; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit mass; + +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(centimeter,length); +BOOST_UNITS_STATIC_CONSTANT(gram,mass); + +} // namespace CG + +namespace cgs { + +typedef make_system::type system; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit mass; +typedef unit time; + +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(centimeter,length); +BOOST_UNITS_STATIC_CONSTANT(gram,mass); +BOOST_UNITS_STATIC_CONSTANT(second,time); + +} // namespace cgs + +namespace esu { + +typedef make_system::type system; + +/// derived dimension for force in electrostatic units : L M T^-2 +typedef derived_dimension::type force_dimension; + +/// derived dimension for charge in electrostatic units : L^3/2 M^1/2 T^-1 +typedef make_dimension_list< mpl::list< dim >, + dim >, + dim > > >::type charge_dimension; + +/// derived dimension for current in electrostatic units : L^3/2 M^1/2 T^-2 +typedef make_dimension_list< mpl::list< dim >, + dim >, + dim > > >::type current_dimension; + +/// derived dimension for electric potential in electrostatic units : L^1/2 M^1/2 T^-1 +typedef make_dimension_list< mpl::list< dim >, + dim >, + dim > > >::type electric_potential_dimension; + +/// derived dimension for electric field in electrostatic units : L^-1/2 M^1/2 T^-1 +typedef make_dimension_list< mpl::list< dim >, + dim >, + dim > > >::type electric_field_dimension; + +/// unit typedefs +typedef unit dimensionless; + +typedef unit length; +typedef unit mass; +typedef unit time; + +typedef unit force; + +typedef unit charge; +typedef unit current; +typedef unit electric_potential; +typedef unit electric_field; + +/// unit constants +BOOST_UNITS_STATIC_CONSTANT(centimeter,length); +BOOST_UNITS_STATIC_CONSTANT(gram,mass); +BOOST_UNITS_STATIC_CONSTANT(second,time); + +BOOST_UNITS_STATIC_CONSTANT(dyne,force); + +BOOST_UNITS_STATIC_CONSTANT(esu,charge); +BOOST_UNITS_STATIC_CONSTANT(statvolt,electric_potential); + +} // namespace esu + +template +quantity coulombLaw(const quantity& q1, + const quantity& q2, + const quantity& r) +{ + return q1*q2/(r*r); +} + +} // namespace units + +} // namespace boost + +int main(void) +{ + using namespace boost::units; + + quantity cg_length(1.0*CG::centimeter); + quantity cgs_length(1.0*cgs::centimeter); + + std::cout << cg_length/cgs_length << std::endl; + + std::cout << esu::gram*pow<2>(esu::centimeter/esu::second)/esu::esu << std::endl; + std::cout << esu::statvolt/esu::centimeter << std::endl; + + quantity q1 = 1.0*esu::esu, + q2 = 2.0*esu::esu; + quantity r = 1.0*esu::centimeter; + + std::cout << coulombLaw(q1,q2,r) << std::endl; + std::cout << coulombLaw(q1,q2,cgs_length) << std::endl; + + return 0; +} +*/ diff --git a/tools/boost_1_65_1/libs/unordered/_clang-format b/tools/boost_1_65_1/libs/unordered/_clang-format new file mode 100644 index 0000000000000000000000000000000000000000..5ca4ced9d59b327e1c0528aa3672b971a1cb977b --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/_clang-format @@ -0,0 +1,37 @@ + +# Copyright 2017 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# Using clang format 3.8 +# http://llvm.org/releases/3.8.0/tools/clang/docs/ClangFormatStyleOptions.html + +# Becuase you have to start somewhere. +BasedOnStyle: LLVM + +# Basic settings +ColumnLimit: 80 +ContinuationIndentWidth: 4 +IndentWidth: 4 +UseTab: Never +Language: Cpp +Standard: Cpp03 + +# Code layout +AlignAfterOpenBracket: DontAlign +AlignTrailingComments: true +BreakBeforeBraces: Custom +BraceWrapping: + AfterNamespace: false + AfterClass: true + AfterStruct: true + AfterUnion: true + AfterEnum: true + AfterFunction: true + AfterControlStatement: false + BeforeCatch: false + BeforeElse: false +PointerAlignment: Left + +# Boost specific stuff +ForEachMacros: [ BOOST_FOREACH ] diff --git a/tools/boost_1_65_1/libs/unordered/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/unordered/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..6a5b701295891f9044c73ebd5d845fcd296bb7da --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/Jamfile.v2 @@ -0,0 +1,68 @@ + +# Copyright 2005 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using boostbook ; +using quickbook ; + +path-constant images_location : ../ ; +path-constant admonishment_location : ../../../../doc/src/images ; + +xml unordered : unordered.qbk ; +boostbook standalone : unordered : + chunk.first.sections=1 + chunk.section.depth=2 + generate.section.toc.level=2 + toc.section.depth=1 + toc.max.depth=1 + + boost.compact.typedef=0 + boost.compact.function=0 + boost.compact.enum=0 + + # HTML Options: + + html:boost.root=../../../.. + html:img.src.path=../../../../doc/html/ + xhtml:boost.root=../../../.. + xhtml:img.src.path=../../../../doc/html/ + + # PDF Options: + + # TOC Generation: this is needed for FOP-0.9 and later: + fop1.extensions=0 + pdf:xep.extensions=1 + # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9! + pdf:fop.extensions=0 + # No indent on body text: + pdf:body.start.indent=0pt + # Margin size: + pdf:page.margin.inner=0.5in + # Margin size: + pdf:page.margin.outer=0.5in + # Paper type = A4 + pdf:paper.type=A4 + # Yes, we want graphics for admonishments: + admon.graphics=1 + # Set this one for PDF generation *only*: + # default png graphics are awful in PDF form, + # better use SVG's instead: + pdf:admon.graphics.extension=".svg" + pdf:use.role.for.mediaobject=1 + pdf:preferred.mediaobject.role=print + pdf:img.src.path=$(images_location)/ + #pdf:admon.graphics.path=$(admonishment_location) + pdf:draft.mode="no" + pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/libs/unordered/doc/html + ; + +############################################################################### +alias boostdoc + : unordered + : + : + : ; +explicit boostdoc ; +alias boostrelease ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/unordered/doc/bibliography.xml b/tools/boost_1_65_1/libs/unordered/doc/bibliography.xml new file mode 100644 index 0000000000000000000000000000000000000000..68e8f2bf1665d410148f127f68236ededde7e6cf --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/bibliography.xml @@ -0,0 +1,26 @@ + +
+Bibliography + + + + C/C++ Users Journal + February, 2006 + + + + + Pete + Becker + + + <ulink url="http://www.ddj.com/cpp/184402066">STL and TR1: Part III - Unordered containers</ulink> + + An introducation to the standard unordered containers. + + +
diff --git a/tools/boost_1_65_1/libs/unordered/doc/buckets.qbk b/tools/boost_1_65_1/libs/unordered/doc/buckets.qbk new file mode 100644 index 0000000000000000000000000000000000000000..ab68aebcb0958d99f533f630e281e03e69dfc7cb --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/buckets.qbk @@ -0,0 +1,171 @@ +[/ Copyright 2006-2008 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[section:buckets The Data Structure] + +The containers are made up of a number of 'buckets', each of which can contain +any number of elements. For example, the following diagram shows an [classref +boost::unordered_set unordered_set] with 7 buckets containing 5 elements, `A`, +`B`, `C`, `D` and `E` (this is just for illustration, containers will typically +have more buckets). + +[diagram buckets] + +In order to decide which bucket to place an element in, the container applies +the hash function, `Hash`, to the element's key (for `unordered_set` and +`unordered_multiset` the key is the whole element, but is referred to as the key +so that the same terminology can be used for sets and maps). This returns a +value of type `std::size_t`. `std::size_t` has a much greater range of values +then the number of buckets, so that container applies another transformation to +that value to choose a bucket to place the element in. + +Retrieving the elements for a given key is simple. The same process is applied +to the key to find the correct bucket. Then the key is compared with the +elements in the bucket to find any elements that match (using the equality +predicate `Pred`). If the hash function has worked well the elements will be +evenly distributed amongst the buckets so only a small number of elements will +need to be examined. + +There is [link unordered.hash_equality more information on hash functions and +equality predicates in the next section]. + +You can see in the diagram that `A` & `D` have been placed in the same bucket. +When looking for elements in this bucket up to 2 comparisons are made, making +the search slower. This is known as a collision. To keep things fast we try to +keep collisions to a minimum. + +''' +Methods for Accessing Buckets + + + Method + Description + + + + '''`size_type bucket_count() const`''' + '''The number of buckets.''' + + + '''`size_type max_bucket_count() const`''' + '''An upper bound on the number of buckets.''' + + + '''`size_type bucket_size(size_type n) const`''' + '''The number of elements in bucket `n`.''' + + + '''`size_type bucket(key_type const& k) const`''' + '''Returns the index of the bucket which would contain k''' + + + '''`local_iterator begin(size_type n);`''' + '''Return begin and end iterators for bucket `n`.''' + + + '''`local_iterator end(size_type n);`''' + + + '''`const_local_iterator begin(size_type n) const;`''' + + + '''`const_local_iterator end(size_type n) const;`''' + + + '''`const_local_iterator cbegin(size_type n) const;`''' + + + '''`const_local_iterator cend(size_type n) const;`''' + + + +
+''' + +[h2 Controlling the number of buckets] + +As more elements are added to an unordered associative container, the number +of elements in the buckets will increase causing performance to degrade. +To combat this the containers increase the bucket count as elements are inserted. +You can also tell the container to change the bucket count (if required) by +calling `rehash`. + +The standard leaves a lot of freedom to the implementer to decide how the +number of buckets are chosen, but it does make some requirements based on the +container's 'load factor', the average number of elements per bucket. +Containers also have a 'maximum load factor' which they should try to keep the +load factor below. + +You can't control the bucket count directly but there are two ways to +influence it: + +* Specify the minimum number of buckets when constructing a container or + when calling `rehash`. +* Suggest a maximum load factor by calling `max_load_factor`. + +`max_load_factor` doesn't let you set the maximum load factor yourself, it just +lets you give a /hint/. And even then, the draft standard doesn't actually +require the container to pay much attention to this value. The only time the +load factor is /required/ to be less than the maximum is following a call to +`rehash`. But most implementations will try to keep the number of elements +below the max load factor, and set the maximum load factor to be the same as +or close to the hint - unless your hint is unreasonably small or large. + +[table:bucket_size Methods for Controlling Bucket Size + [[Method] [Description]] + + [ + [`X(size_type n)`] + [Construct an empty container with at least `n` buckets (`X` is the container type).] + ] + [ + [`X(InputIterator i, InputIterator j, size_type n)`] + [Construct an empty container with at least `n` buckets and insert elements + from the range \[`i`, `j`) (`X` is the container type).] + ] + [ + [`float load_factor() const`] + [The average number of elements per bucket.] + ] + [ + [`float max_load_factor() const`] + [Returns the current maximum load factor.] + ] + [ + [`float max_load_factor(float z)`] + [Changes the container's maximum load factor, using `z` as a hint.] + ] + [ + [`void rehash(size_type n)`] + [Changes the number of buckets so that there at least n buckets, and + so that the load factor is less than the maximum load factor.] + ] + +] + +[h2 Iterator Invalidation] + +It is not specified how member functions other than `rehash` affect +the bucket count, although `insert` is only allowed to invalidate iterators +when the insertion causes the load factor to be greater than or equal to the +maximum load factor. For most implementations this means that insert will only +change the number of buckets when this happens. While iterators can be +invalidated by calls to `insert` and `rehash`, pointers and references to the +container's elements are never invalidated. + +In a similar manner to using `reserve` for `vector`s, it can be a good idea +to call `rehash` before inserting a large number of elements. This will get +the expensive rehashing out of the way and let you store iterators, safe in +the knowledge that they won't be invalidated. If you are inserting `n` +elements into container `x`, you could first call: + + x.rehash((x.size() + n) / x.max_load_factor() + 1); + +[blurb Note: `rehash`'s argument is the minimum number of buckets, not the +number of elements, which is why the new size is divided by the maximum load factor. The +`+ 1` guarantees there is no invalidation; without it, reallocation could occur +if the number of bucket exactly divides the target size, since the container is +allowed to rehash when the load factor is equal to the maximum load factor.] + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/changes.qbk b/tools/boost_1_65_1/libs/unordered/doc/changes.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9fa3f753d72ee4996e5fab69e10c54b464c5b367 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/changes.qbk @@ -0,0 +1,323 @@ + +[/ Copyright 2008 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[template ticket[number]''''''#[number]''''''] + +[section:changes Change Log] + +[h2 Review Version] + +Initial review version, for the review conducted from 7th December 2007 to +16th December 2007. + +[h2 1.35.0 Add-on - 31st March 2008] + +Unofficial release uploaded to vault, to be used with Boost 1.35.0. Incorporated +many of the suggestions from the review. + +* Improved portability thanks to Boost regression testing. +* Fix lots of typos, and clearer text in the documentation. +* Fix floating point to `std::size_t` conversion when calculating sizes from + the max load factor, and use `double` in the calculation for greater accuracy. +* Fix some errors in the examples. + +[h2 Boost 1.36.0] + +First official release. + +* Rearrange the internals. +* Move semantics - full support when rvalue references are available, emulated + using a cut down version of the Adobe move library when they are not. +* Emplace support when rvalue references and variadic template are available. +* More efficient node allocation when rvalue references and variadic template + are available. +* Added equality operators. + +[h2 Boost 1.37.0] + +* Rename overload of `emplace` with hint, to `emplace_hint` as specified in + [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2691.pdf n2691]. +* Provide forwarding headers at `` and + ``. +* Move all the implementation inside `boost/unordered`, to assist + modularization and hopefully make it easier to track changes in subversion. + +[h2 Boost 1.38.0] + +* Use [@boost:/libs/core/swap.html `boost::swap`]. +* [@https://svn.boost.org/trac/boost/ticket/2237 Ticket 2237]: + Document that the equality and inequality operators are undefined for two + objects if their equality predicates aren't equivalent. Thanks to Daniel + Krügler. +* [@https://svn.boost.org/trac/boost/ticket/1710 Ticket 1710]: + Use a larger prime number list. Thanks to Thorsten Ottosen and Hervé + Brönnimann. +* Use + [@boost:/libs/type_traits/doc/html/boost_typetraits/category/alignment.html + aligned storage] to store the types. This changes the way the allocator is + used to construct nodes. It used to construct the node with two calls to + the allocator's `construct` method - once for the pointers and once for the + value. It now constructs the node with a single call to construct and + then constructs the value using in place construction. +* Add support for C++0x initializer lists where they're available (currently + only g++ 4.4 in C++0x mode). + +[h2 Boost 1.39.0] + +* [@https://svn.boost.org/trac/boost/ticket/2756 Ticket 2756]: Avoid a warning + on Visual C++ 2009. +* Some other minor internal changes to the implementation, tests and + documentation. +* Avoid an unnecessary copy in `operator[]`. +* [@https://svn.boost.org/trac/boost/ticket/2975 Ticket 2975]: Fix length of + prime number list. + +[h2 Boost 1.40.0] + +* [@https://svn.boost.org/trac/boost/ticket/2975 Ticket 2975]: + Store the prime list as a preprocessor sequence - so that it will always get + the length right if it changes again in the future. +* [@https://svn.boost.org/trac/boost/ticket/1978 Ticket 1978]: + Implement `emplace` for all compilers. +* [@https://svn.boost.org/trac/boost/ticket/2908 Ticket 2908], + [@https://svn.boost.org/trac/boost/ticket/3096 Ticket 3096]: + Some workarounds for old versions of borland, including adding explicit + destructors to all containers. +* [@https://svn.boost.org/trac/boost/ticket/3082 Ticket 3082]: + Disable incorrect Visual C++ warnings. +* Better configuration for C++0x features when the headers aren't available. +* Create less buckets by default. + +[h2 Boost 1.41.0 - Major update] + +* The original version made heavy use of macros to sidestep some of the older + compilers' poor template support. But since I no longer support those + compilers and the macro use was starting to become a maintenance burden it + has been rewritten to use templates instead of macros for the implementation + classes. + +* The container object is now smaller thanks to using `boost::compressed_pair` + for EBO and a slightly different function buffer - now using a bool instead + of a member pointer. + +* Buckets are allocated lazily which means that constructing an empty container + will not allocate any memory. + +[h2 Boost 1.42.0] + +* Support instantiating the containers with incomplete value types. +* Reduced the number of warnings (mostly in tests). +* Improved codegear compatibility. +* [@http://svn.boost.org/trac/boost/ticket/3693 Ticket 3693]: + Add `erase_return_void` as a temporary workaround for the current + `erase` which can be inefficient because it has to find the next + element to return an iterator. +* Add templated find overload for compatible keys. +* [@http://svn.boost.org/trac/boost/ticket/3773 Ticket 3773]: + Add missing `std` qualifier to `ptrdiff_t`. +* Some code formatting changes to fit almost all lines into 80 characters. + +[h2 Boost 1.43.0] + +* [@http://svn.boost.org/trac/boost/ticket/3966 Ticket 3966]: + `erase_return_void` is now `quick_erase`, which is the + [@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#579 + current forerunner for resolving the slow erase by iterator], although + there's a strong possibility that this may change in the future. The old + method name remains for backwards compatibility but is considered deprecated + and will be removed in a future release. +* Use Boost.Exception. +* Stop using deprecated `BOOST_HAS_*` macros. + +[h2 Boost 1.45.0] + +* Fix a bug when inserting into an `unordered_map` or `unordered_set` using + iterators which returns `value_type` by copy. + +[h2 Boost 1.48.0 - Major update] + +This is major change which has been converted to use Boost.Move's move +emulation, and be more compliant with the C++11 standard. See the +[link unordered.compliance compliance section] for details. + +The container now meets C++11's complexity requirements, but to do so +uses a little more memory. This means that `quick_erase` and +`erase_return_void` are no longer required, they'll be removed in a +future version. + +C++11 support has resulted in some breaking changes: + +* Equality comparison has been changed to the C++11 specification. + In a container with equivalent keys, elements in a group with equal + keys used to have to be in the same order to be considered equal, + now they can be a permutation of each other. To use the old + behavior define the macro `BOOST_UNORDERED_DEPRECATED_EQUALITY`. + +* The behaviour of swap is different when the two containers to be + swapped has unequal allocators. It used to allocate new nodes using + the appropriate allocators, it now swaps the allocators if + the allocator has a member structure `propagate_on_container_swap`, + such that `propagate_on_container_swap::value` is true. + +* Allocator's `construct` and `destroy` functions are called with raw + pointers, rather than the allocator's `pointer` type. + +* `emplace` used to emulate the variadic pair constructors that + appeared in early C++0x drafts. Since they were removed it no + longer does so. It does emulate the new `piecewise_construct` + pair constructors - only you need to use + `boost::piecewise_construct`. To use the old emulation of + the variadic constructors define + `BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT`. + +[h2 Boost 1.49.0] + +* Fix warning due to accidental odd assignment. +* Slightly better error messages. + +[h2 Boost 1.50.0] + +* Fix equality for `unordered_multiset` and `unordered_multimap`. +* [@https://svn.boost.org/trac/boost/ticket/6857 Ticket 6857]: + Implement `reserve`. +* [@https://svn.boost.org/trac/boost/ticket/6771 Ticket 6771]: + Avoid gcc's `-Wfloat-equal` warning. +* [@https://svn.boost.org/trac/boost/ticket/6784 Ticket 6784]: + Fix some Sun specific code. +* [@https://svn.boost.org/trac/boost/ticket/6190 Ticket 6190]: + Avoid gcc's `-Wshadow` warning. +* [@https://svn.boost.org/trac/boost/ticket/6905 Ticket 6905]: + Make namespaces in macros compatible with `bcp` custom namespaces. + Fixed by Luke Elliott. +* Remove some of the smaller prime number of buckets, as they may make + collisions quite probable (e.g. multiples of 5 are very common because + we used base 10). +* On old versions of Visual C++, use the container library's implementation + of `allocator_traits`, as it's more likely to work. +* On machines with 64 bit std::size_t, use power of 2 buckets, with Thomas + Wang's hash function to pick which one to use. As modulus is very slow + for 64 bit values. +* Some internal changes. + +[h2 Boost 1.51.0] + +* Fix construction/destruction issue when using a C++11 compiler with a + C++03 allocator ([ticket 7100]). +* Remove a `try..catch` to support compiling without exceptions. +* Adjust SFINAE use to try to support g++ 3.4 ([ticket 7175]). +* Updated to use the new config macros. + +[h2 Boost 1.52.0] + +* Faster assign, which assigns to existing nodes where possible, rather than + creating entirely new nodes and copy constructing. +* Fixed bug in `erase_range` ([ticket 7471]). +* Reverted some of the internal changes to how nodes are created, especially + for C++11 compilers. 'construct' and 'destroy' should work a little better + for C++11 allocators. +* Simplified the implementation a bit. Hopefully more robust. + +[h2 Boost 1.53.0] + +* Remove support for the old pre-standard variadic pair constructors, and + equality implementation. Both have been deprecated since Boost 1.48. +* Remove use of deprecated config macros. +* More internal implementation changes, including a much simpler + implementation of `erase`. + +[h2 Boost 1.54.0] + +* Mark methods specified in standard as `noexpect`. More to come in the next + release. +* If the hash function and equality predicate are known to both have nothrow + move assignment or construction then use them. + +[h2 Boost 1.55.0] + +* Avoid some warnings ([ticket 8851], [ticket 8874]). +* Avoid exposing some detail functions via. ADL on the iterators. +* Follow the standard by only using the allocators' construct and destroy + methods to construct and destroy stored elements. Don't use them for internal + data like pointers. + +[h2 Boost 1.56.0] + +* Fix some shadowed variable warnings ([ticket 9377]). +* Fix allocator use in documentation ([ticket 9719]). +* Always use prime number of buckets for integers. Fixes performance + regression when inserting consecutive integers, although makes other + uses slower ([ticket 9282]). +* Only construct elements using allocators, as specified in C++11 standard. + +[h2 Boost 1.57.0] + +* Fix the `pointer` typedef in iterators ([ticket 10672]). +* Fix Coverity warning + ([@https://github.com/boostorg/unordered/pull/2 GitHub #2]). + +[h2 Boost 1.58.0] + +* Remove unnecessary template parameter from const iterators. +* Rename private `iterator` typedef in some iterator classes, as it + confuses some traits classes. +* Fix move assignment with stateful, propagate_on_container_move_assign + allocators ([ticket 10777]). +* Fix rare exception safety issue in move assignment. +* Fix potential overflow when calculating number of buckets to allocate + ([@https://github.com/boostorg/unordered/pull/4 GitHub #4]). + +[h2 Boost 1.62.0] + +* Remove use of deprecated `boost::iterator`. +* Remove `BOOST_NO_STD_DISTANCE` workaround. +* Remove `BOOST_UNORDERED_DEPRECATED_EQUALITY` warning. +* Simpler implementation of assignment, fixes an exception safety issue + for `unordered_multiset` and `unordered_multimap`. Might be a little slower. +* Stop using return value SFINAE which some older compilers have issues + with. + +[h2 Boost 1.63.0] + +* Check hint iterator in `insert`/`emplace_hint`. +* Fix some warnings, mostly in the tests. +* Manually write out `emplace_args` for small numbers of arguments - + should make template error messages a little more bearable. +* Remove superfluous use of `boost::forward` in emplace arguments, + which fixes emplacing string literals in old versions of Visual C++. +* Fix an exception safety issue in assignment. If bucket allocation + throws an exception, it can overwrite the hash and equality functions while + leaving the existing elements in place. This would mean that the function + objects wouldn't match the container elements, so elements might be in the + wrong bucket and equivalent elements would be incorrectly handled. +* Various reference documentation improvements. +* Better allocator support ([ticket 12459]). +* Make the no argument constructors implicit. +* Implement missing allocator aware constructors. +* Fix assigning the hash/key equality functions for empty containers. +* Remove unary/binary_function from the examples in the documentation. + They are removed in C++17. +* Support 10 constructor arguments in emplace. It was meant to support up to 10 + arguments, but an off by one error in the preprocessor code meant it only + supported up to 9. + +[h2 Boost 1.64.0] +* Initial support for new C++17 member functions: + `insert_or_assign` and `try_emplace` in `unordered_map`, +* Initial support for `merge` and `extract`. + Does not include transferring nodes between + `unordered_map` and `unordered_multimap` or between `unordered_set` and + `unordered_multiset` yet. That will hopefully be in the next version of + Boost. + +[h2 Boost 1.65.0] + +* Add deprecated attributes to `quick_erase` and `erase_return_void`. + I really will remove them in a future version this time. +* Small standards compliance fixes: + * `noexpect` specs for `swap` free functions. + * Add missing `insert(P&&)` methods. + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/comparison.qbk b/tools/boost_1_65_1/libs/unordered/doc/comparison.qbk new file mode 100644 index 0000000000000000000000000000000000000000..30deac110a33f44967fcb4a0a339a15fbbfaa781 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/comparison.qbk @@ -0,0 +1,161 @@ +[/ Copyright 2006-2011 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[section:comparison Comparison with Associative Containers] + +[table:interface_differences Interface differences. + [[Associative Containers] [Unordered Associative Containers]] + + [ + [Parameterized by an ordering relation `Compare`] + [Parameterized by a function object `Hash` and an equivalence relation + `Pred`] + ] + [ + [Keys can be compared using `key_compare` which is accessed by member function `key_comp()`, + values can be compared using `value_compare` which is accessed by member function `value_comp()`.] + [Keys can be hashed using `hasher` which is accessed by member function `hash_function()`, + and checked for equality using `key_equal` which is accessed by member function `key_eq()`. + There is no function object for compared or hashing values.] + ] + [ + [Constructors have optional extra parameters for the comparison object.] + [Constructors have optional extra parameters for the initial minimum + number of buckets, a hash function and an equality object.] + ] + + [ + [Keys `k1`, `k2` are considered equivalent if + `!Compare(k1, k2) && !Compare(k2, k1)`] + [Keys `k1`, `k2` are considered equivalent if `Pred(k1, k2)`] + ] + [ + [Member function `lower_bound(k)` and `upper_bound(k)`] + [No equivalent. Since the elements aren't ordered `lower_bound` and + `upper_bound` would be meaningless.] + ] + [ + [`equal_range(k)` returns an empty range at the position that k + would be inserted if k isn't present in the container.] + [`equal_range(k)` returns a range at the end of the container if + k isn't present in the container. It can't return a positioned + range as k could be inserted into multiple place. To find out the + bucket that k would be inserted into use `bucket(k)`. But remember + that an insert can cause the container to rehash - meaning that the + element can be inserted into a different bucket.] + ] + [ + [`iterator`, `const_iterator` are of the bidirectional category.] + [`iterator`, `const_iterator` are of at least the forward category.] + ] + [ + [Iterators, pointers and references to the container's elements are + never invalidated.] + [[link unordered.buckets.iterator_invalidation Iterators can + be invalidated by calls to insert or rehash]. Pointers and + references to the container's elements are never invalidated.] + ] + [ + [Iterators iterate through the container in the order defined by + the comparison object.] + [Iterators iterate through the container in an arbitrary order, that + can change as elements are inserted. Although, equivalent elements + are always adjacent.] + ] + [ + [No equivalent] + [Local iterators can be used to iterate through individual buckets. + (The order of local iterators and iterators aren't + required to have any correspondence.)] + ] + [ + [Can be compared using the `==`, `!=`, `<`, `<=`, `>`, `>=` operators.] + [Can be compared using the `==` and `!=` operators.] + ] + [ + [] + [When inserting with a hint, implementations are permitted to ignore + the hint.] + ] + [ + [`erase` never throws an exception] + [The containers' hash or predicate function can throw exceptions + from `erase`] + ] +] + +[table:complexity_guarantees Complexity Guarantees + [[Operation] [Associative Containers] [Unordered Associative Containers]] + [ + [Construction of empty container] + [constant] + [O(/n/) where /n/ is the minimum number of buckets.] + ] + [ + [Construction of container from a range of /N/ elements] + [O(/N/ log /N/), O(/N/) if the range is sorted with `value_comp()`] + [Average case O(/N/), worst case + O(/N/'''2''')] + ] + [ + [Insert a single element] + [logarithmic] + [Average case constant, worst case linear] + ] + [ + [Insert a single element with a hint] + [Amortized constant if t elements inserted right after hint, + logarithmic otherwise] + [Average case constant, worst case linear (ie. the same as + a normal insert).] + ] + [ + [Inserting a range of /N/ elements] + [ /N/ log(`size()`+/N/) ] + [Average case O(/N/), worst case O(/N/ * `size()`)] + ] + [ + [Erase by key, `k`] + [O(log(`size()`) + `count(k)`)] + [Average case: O(`count(k)`), Worst case: O(`size()`)] + ] + [ + [Erase a single element by iterator] + [Amortized constant] + [Average case: O(1), Worst case: O(`size()`)] + ] + [ + [Erase a range of /N/ elements] + [O(log(`size()`) + /N/)] + [Average case: O(/N/), Worst case: O(`size()`)] + ] + [ + [Clearing the container] + [O(`size()`)] + [O(`size()`)] + ] + [ + [Find] + [logarithmic] + [Average case: O(1), Worst case: O(`size()`)] + ] + [/ TODO: Average case is probably wrong. ] + [ + [Count] + [O(log(`size()`) + `count(k)`)] + [Average case: O(1), Worst case: O(`size()`)] + ] + [ + [`equal_range(k)`] + [logarithmic] + [Average case: O(`count(k)`), Worst case: O(`size()`)] + ] + [ + [`lower_bound`,`upper_bound`] + [logarithmic] + [n/a] + ] +] + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/compliance.qbk b/tools/boost_1_65_1/libs/unordered/doc/compliance.qbk new file mode 100644 index 0000000000000000000000000000000000000000..711ab3f8e655aa7400f78e6650c0b593d3f0b7e4 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/compliance.qbk @@ -0,0 +1,128 @@ +[/ Copyright 2011 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[section:compliance Standard Compliance] + +The intent of Boost.Unordered is to implement a close (but inperfect) +implementation of the C++17 standard, that will work with C++98 upwards. +The wide compatibility does mean some comprimises have to be made. +With a compiler and library that fully support C++11, the differences should +be minor. + +[section:move Move emulation] + +Support for move semantics is implemented using Boost.Move. If rvalue +references are available it will use them, but if not it uses a close, +but imperfect emulation. On such compilers: + +* Non-copyable objects can be stored in the containers. + They can be constructed in place using `emplace`, or if they support + Boost.Move, moved into place. +* The containers themselves are not movable. +* Argument forwarding is not perfect. + +[endsect] + +[section:allocator_compliance Use of allocators] + +C++11 introduced a new allocator system. It's backwards compatible due to +the lax requirements for allocators in the old standard, but might need +some changes for allocators which worked with the old versions of the +unordered containers. +It uses a traits class, `allocator_traits` to handle the allocator +adding extra functionality, and making some methods and types optional. +During development a stable release of +`allocator_traits` wasn't available so an internal partial implementation +is always used in this version. Hopefully a future version will use the +standard implementation where available. + +The member functions `construct`, `destroy` and `max_size` are now +optional, if they're not available a fallback is used. +A full implementation of `allocator_traits` requires sophisticated +member function detection so that the fallback is used whenever the +member function call is not well formed. +This requires support for SFINAE expressions, which are available on +GCC from version 4.4 and Clang. + +On other compilers, there's just a test to see if the allocator has +a member, but no check that it can be called. So rather than using a +fallback there will just be a compile error. + +`propagate_on_container_copy_assignment`, +`propagate_on_container_move_assignment`, +`propagate_on_container_swap` and +`select_on_container_copy_construction` are also supported. +Due to imperfect move emulation, some assignments might check +`propagate_on_container_copy_assignment` on some compilers and +`propagate_on_container_move_assignment` on others. + +[endsect] + +[section:construction Construction/Destruction using allocators] + +The following support is required for full use of C++11 style +construction/destruction: + +* Variadic templates. +* Piecewise construction of `std::pair`. +* Either `std::allocator_traits` or expression SFINAE. + +This is detected using Boost.Config. The macro +`BOOST_UNORDERED_CXX11_CONSTRUCTION` will be set to 1 if it is found, or 0 +otherwise. + +When this is the case `allocator_traits::construct` and +`allocator_traits::destroy` will always be used, apart from when piecewise +constructing a `std::pair` using `boost::tuple` (see [link +unordered.compliance.pairs below]), but that should be easily avoided. + +When support is not available `allocator_traits::construct` and +`allocator_traits::destroy` are never called. + +[endsect] + +[section:pointer_traits Pointer Traits] + +`pointer_traits` aren't used. Instead, pointer types are obtained from +rebound allocators, this can cause problems if the allocator can't be +used with incomplete types. If `const_pointer` is not defined in the +allocator, `boost::pointer_to_other::type` +is used to obtain a const pointer. + +[endsect] + +[#unordered.compliance.pairs] +[section:pairs Pairs] + +Since the containers use `std::pair` they're limited to the version +from the current standard library. But since C++11 `std::pair`'s +`piecewise_construct` based constructor is very useful, `emplace` +emulates it with a `piecewise_construct` in the `boost::unordered` +namespace. So for example, the following will work: + + boost::unordered_multimap x; + + x.emplace( + boost::unordered::piecewise_construct, + boost::make_tuple("key"), boost::make_tuple(1, 2)); + +Older drafts of the standard also supported variadic constructors +for `std::pair`, where the first argument would be used for the +first part of the pair, and the remaining for the second part. + +[endsect] + +[section:misc Miscellaneous] + +When swapping, `Pred` and `Hash` are not currently swapped by calling +`swap`, their copy constructors are used. As a consequence when swapping +an exception may be throw from their copy constructor. + +Variadic constructor arguments for `emplace` are only used when both +rvalue references and variadic template parameters are available. +Otherwise `emplace` can only take up to 10 constructors arguments. + +[endsect] + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/diagrams/buckets.png b/tools/boost_1_65_1/libs/unordered/doc/diagrams/buckets.png new file mode 100644 index 0000000000000000000000000000000000000000..ba14df79b629e2892747638f823d6abe19dddd06 Binary files /dev/null and b/tools/boost_1_65_1/libs/unordered/doc/diagrams/buckets.png differ diff --git a/tools/boost_1_65_1/libs/unordered/doc/diagrams/buckets.svg b/tools/boost_1_65_1/libs/unordered/doc/diagrams/buckets.svg new file mode 100644 index 0000000000000000000000000000000000000000..d16b432c3b3cdcc10e267ecaca90a09ed8b40ba7 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/diagrams/buckets.svg @@ -0,0 +1,313 @@ + + + + + + + + Bucket 1 + + + + Bucket 2 + + + + Bucket 3 + + + + Bucket 4 + + + + Bucket 5 + + + + Bucket 6 + + + + Bucket 7 + + + + A + + + B + + + C + + + D + + + E + diff --git a/tools/boost_1_65_1/libs/unordered/doc/hash_equality.qbk b/tools/boost_1_65_1/libs/unordered/doc/hash_equality.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c13fcc485181d4c435e5ebc6c755fdd16d82f546 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/hash_equality.qbk @@ -0,0 +1,86 @@ +[/ Copyright 2006-2008 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[section:hash_equality Equality Predicates and Hash Functions] + +While the associative containers use an ordering relation to specify how the +elements are stored, the unordered associative containers use an equality +predicate and a hash function. For example, [classref boost::unordered_map] +is declared as: + + template < + class Key, class Mapped, + class Hash = ``[classref boost::hash]``, + class Pred = std::equal_to, + class Alloc = std::allocator > > + class ``[classref boost::unordered_map unordered_map]``; + +The hash function comes first as you might want to change the hash function +but not the equality predicate. For example, if you wanted to use the +[@http://www.isthe.com/chongo/tech/comp/fnv/ FNV-1 hash] you could write: + +[import src_code/dictionary.cpp] +[case_sensitive_dictionary_fnv] + +There is an [@boost:/libs/unordered/examples/fnv1.hpp implementation +of FNV-1] in the examples directory. + +If you wish to use a different equality function, +you will also need to use a matching hash function. For +example, to implement a case insensitive dictionary you need to define a +case insensitive equality predicate and hash function: + +[case_insensitive_functions] + +Which you can then use in a case insensitive dictionary: + +[case_insensitive_dictionary] + +This is a simplified version of the example at +[@boost:/libs/unordered/examples/case_insensitive.hpp /libs/unordered/examples/case_insensitive.hpp] +which supports other locales and string types. + +[caution +Be careful when using the equality (`==`) operator with custom equality +predicates, especially if you're using a function pointer. If you compare two +containers with different equality predicates then the result is undefined. +For most stateless function objects this is impossible - since you can only +compare objects with the same equality predicate you know the equality +predicates must be equal. But if you're using function pointers or a stateful +equality predicate (e.g. boost::function) then you can get into trouble. +] + +[h2 Custom Types] + +Similarly, a custom hash function can be used for custom types: + +[import src_code/point1.cpp] +[point_example1] + +Since the default hash function is [link hash Boost.Hash], +we can [link hash.custom extend it to support the type] +so that the hash function doesn't need to be explicitly given: + +[import src_code/point2.cpp] +[point_example2] + +See the [link hash.custom Boost.Hash documentation] for more detail on how to +do this. Remember that it relies on extensions to the draft standard - so it +won't work for other implementations of the unordered associative containers, +you'll need to explicitly use Boost.Hash. + +[table:access_methods Methods for accessing the hash and equality functions. + [[Method] [Description]] + + [ + [`hasher hash_function() const`] + [Returns the container's hash function.] + ] + [ + [`key_equal key_eq() const`] + [Returns the container's key equality function.] + ] +] + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/intro.qbk b/tools/boost_1_65_1/libs/unordered/doc/intro.qbk new file mode 100644 index 0000000000000000000000000000000000000000..72c93b66b34f2f8bc62ca9efe698bdd25cd34ab6 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/intro.qbk @@ -0,0 +1,101 @@ +[/ Copyright 2006-2008 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[def __hash-table__ [@http://en.wikipedia.org/wiki/Hash_table + hash table]] +[def __hash-function__ [@http://en.wikipedia.org/wiki/Hash_function + hash function]] + +[section:intro Introduction] + +For accessing data based on key lookup, the C++ standard library offers `std::set`, +`std::map`, `std::multiset` and `std::multimap`. These are generally +implemented using balanced binary trees so that lookup time has +logarithmic complexity. That is generally okay, but in many cases a +__hash-table__ can perform better, as accessing data has constant complexity, +on average. The worst case complexity is linear, but that occurs rarely and +with some care, can be avoided. + +Also, the existing containers require a 'less than' comparison object +to order their elements. For some data types this is impossible to implement +or isn't practical. In contrast, a hash table only needs an equality function +and a hash function for the key. + +With this in mind, unordered associative containers were added to the C++ +standard. This is an implementation of the containers described in C++11, +with some [link unordered.compliance deviations from the standard] in +order to work with non-C++11 compilers and libraries. + +`unordered_set` and `unordered_multiset` are defined in the header +<[headerref boost/unordered_set.hpp]> + + namespace boost { + template < + class Key, + class Hash = ``[classref boost::hash]``, + class Pred = std::equal_to, + class Alloc = std::allocator > + class ``[classref boost::unordered_set unordered_set]``; + + template< + class Key, + class Hash = ``[classref boost::hash]``, + class Pred = std::equal_to, + class Alloc = std::allocator > + class ``[classref boost::unordered_multiset unordered_multiset]``; + } + +`unordered_map` and `unordered_multimap` are defined in the header +<[headerref boost/unordered_map.hpp]> + + namespace boost { + template < + class Key, class Mapped, + class Hash = ``[classref boost::hash]``, + class Pred = std::equal_to, + class Alloc = std::allocator > > + class ``[classref boost::unordered_map unordered_map]``; + + template< + class Key, class Mapped, + class Hash = ``[classref boost::hash]``, + class Pred = std::equal_to, + class Alloc = std::allocator > > + class ``[classref boost::unordered_multimap unordered_multimap]``; + } + +When using Boost.TR1, these classes are included from `` and +``, with the classes added to the `std::tr1` namespace. + +The containers are used in a similar manner to the normal associative +containers: + +[import src_code/intro.cpp] +[intro_example1_2] + +But since the elements aren't ordered, the output of: + +[intro_example1_3] + +can be in any order. For example, it might be: + + two,2 + one,1 + three,3 + +To store an object in an unordered associative container requires both an +key equality function and a hash function. The default function objects in +the standard containers support a few basic types including integer types, +floating point types, pointer types, and the standard strings. Since +Boost.Unordered uses [classref boost::hash] it also supports some other types, +including standard containers. To use any types not supported by these methods +you have to [link hash.custom extend Boost.Hash to support the type] or use +your own custom equality predicates and hash functions. See the +[link unordered.hash_equality Equality Predicates and Hash Functions] section +for more details. + +There are other differences, which are listed in the +[link unordered.comparison Comparison with Associative Containers] section. + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/rationale.qbk b/tools/boost_1_65_1/libs/unordered/doc/rationale.qbk new file mode 100644 index 0000000000000000000000000000000000000000..60f0849bbc806c436a3c7ba16c70aa729c20b5e0 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/rationale.qbk @@ -0,0 +1,111 @@ +[/ Copyright 2006-2008 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[def __wang__ + [@http://web.archive.org/web/20121102023700/http://www.concentric.net/~Ttwang/tech/inthash.htm + Thomas Wang's article on integer hash functions]] + +[section:rationale Implementation Rationale] + +The intent of this library is to implement the unordered +containers in the draft standard, so the interface was fixed. But there are +still some implementation decisions to make. The priorities are +conformance to the standard and portability. + +The [@http://en.wikipedia.org/wiki/Hash_table Wikipedia article on hash tables] +has a good summary of the implementation issues for hash tables in general. + +[h2 Data Structure] + +By specifying an interface for accessing the buckets of the container the +standard pretty much requires that the hash table uses chained addressing. + +It would be conceivable to write a hash table that uses another method. For +example, it could use open addressing, and use the lookup chain to act as a +bucket but there are a some serious problems with this: + +* The draft standard requires that pointers to elements aren't invalidated, so + the elements can't be stored in one array, but will need a layer of + indirection instead - losing the efficiency and most of the memory gain, + the main advantages of open addressing. + +* Local iterators would be very inefficient and may not be able to + meet the complexity requirements. + +* There are also the restrictions on when iterators can be invalidated. Since + open addressing degrades badly when there are a high number of collisions the + restrictions could prevent a rehash when it's really needed. The maximum load + factor could be set to a fairly low value to work around this - but the + standard requires that it is initially set to 1.0. + +* And since the standard is written with a eye towards chained + addressing, users will be surprised if the performance doesn't reflect that. + +So chained addressing is used. + +[/ (Removing for now as this is out of date) + +For containers with unique keys I store the buckets in a single-linked list. +There are other possible data structures (such as a double-linked list) +that allow for some operations to be faster (such as erasing and iteration) +but the possible gain seems small compared to the extra memory needed. +The most commonly used operations (insertion and lookup) would not be improved +at all. + +But for containers with equivalent keys a single-linked list can degrade badly +when a large number of elements with equivalent keys are inserted. I think it's +reasonable to assume that users who choose to use `unordered_multiset` or +`unordered_multimap` do so because they are likely to insert elements with +equivalent keys. So I have used an alternative data structure that doesn't +degrade, at the expense of an extra pointer per node. + +This works by adding storing a circular linked list for each group of equivalent +nodes in reverse order. This allows quick navigation to the end of a group (since +the first element points to the last) and can be quickly updated when elements +are inserted or erased. The main disadvantage of this approach is some hairy code +for erasing elements. +] + +[/ (Starting to write up new structure, might not be ready in time) +The node used to be stored in a linked list for each bucket but that +didn't meet the complexity requirements for C++11, so now the nodes +are stored in one long single linked list. But there needs a way to get +the bucket from the node, to do that a copy of the key's hash value is +stored in the node. Another possibility would be to store a pointer to +the bucket, or the bucket's index, but storing the hash value allows +some operations to be faster. +] + +[h2 Number of Buckets] + +There are two popular methods for choosing the number of buckets in a hash +table. One is to have a prime number of buckets, another is to use a power +of 2. + +Using a prime number of buckets, and choosing a bucket by using the modulus +of the hash function's result will usually give a good result. The downside +is that the required modulus operation is fairly expensive. This is what the +containers do in most cases. + +Using a power of 2 allows for much quicker selection of the bucket +to use, but at the expense of loosing the upper bits of the hash value. +For some specially designed hash functions it is possible to do this and +still get a good result but as the containers can take arbitrary hash +functions this can't be relied on. + +To avoid this a transformation could be applied to the hash function, for an +example see __wang__. Unfortunately, a transformation like Wang's requires +knowledge of the number of bits in the hash value, so it isn't portable enough +to use as a default. It can applicable in certain cases so the containers +have a policy based implementation that can use this alternative technique. + +Currently this is only done on 64 bit architectures, where prime number +modulus can be expensive. Although this varies depending on the architecture, +so I probably should revisit it. + +I'm also thinking of introducing a mechanism whereby a hash function can +indicate that it's safe to be used directly with power of 2 buckets, in +which case a faster plain power of 2 implementation can be used. + +[endsect] diff --git a/tools/boost_1_65_1/libs/unordered/doc/ref.php b/tools/boost_1_65_1/libs/unordered/doc/ref.php new file mode 100644 index 0000000000000000000000000000000000000000..efbca8952419c0cb9a4ecad23f670287164a3e99 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/ref.php @@ -0,0 +1,1797 @@ + + + + + +EOL; + + $key_type = 'Key'; + $key_name = 'key'; + $value_type = 'std::pair<Key const, Mapped>'; + $full_type = $name.'<Key, Mapped, Hash, Pred, Alloc>'; + } + else + { + $template_value = << + + +EOL; + + $key_type = 'Value'; + $key_name = 'value'; + $value_type = 'Value'; + $full_type = $name.'<Value, Hash, Pred, Alloc>'; + } +?> + + + + An unordered associative container that + + + + Template Parameters + + + + + + Key + Key must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Mapped + Mapped must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + + Value + Value must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + + Hash + A unary function object type that acts a hash function for a . It takes a single argument of type and returns a value of type std::size_t. + + Pred + A binary function object that implements an equivalence relation on values of type . + A binary function object that induces an equivalence relation on values of type . + It takes two arguments of type and returns a value of type bool. + + Alloc + An allocator whose value type is the same as the container's value type. + The elements are organized into buckets. + The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash. + + + + + + + + + + Mapped + + + + Hash + + + Pred + + + Alloc + + + typename allocator_type::pointer + + + value_type* if + allocator_type::pointer is not defined. + + + + + typename allocator_type::const_pointer + + + boost::pointer_to_other<pointer, value_type>::type + if allocator_type::const_pointer is not defined. + + + + + value_type& + lvalue of value_type. + + + value_type const& + const lvalue of value_type. + + + implementation-defined + + An unsigned integral type. + size_type can represent any non-negative value of difference_type. + + + + implementation-defined + + A signed integral type. + Is identical to the difference type of iterator and const_iterator. + + + + implementation-defined + + iterator whose value type is value_type. + The iterator category is at least a forward iterator. + Convertible to const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + + + + implementation-defined + + An iterator with the same value type, difference type and pointer and reference type as iterator. + A local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + A constant iterator with the same value type, difference type and pointer and reference type as const_iterator. + A const_local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + See node_handle_ for details. + + + + + implementation-defined + + Structure returned by inserting node_type. + + + + + + size() == 0 + + + Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + size() == 0 + + + Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + const& + + + The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator. + If Allocator::select_on_container_copy_construction + exists and has the right signature, the allocator will be + constructed from its result. + + + value_type is copy constructible + + + + + && + + + The move constructor. + + + This is implemented using Boost.Move. + + + + value_type is move constructible. + + + On compilers without rvalue reference support the + emulation does not support moving without calling + boost::move if value_type is + not copyable. So, for example, you can't return the + container from a function. + + + + + + Allocator const& + + + Constructs an empty container, using allocator a. + + + + + const& + + + Allocator const& + + + Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a. + + + + + && + + + Allocator const& + + + Construct a container moving x's contained elements, and having the hash function, predicate and maximum load factor, but using allocate a. + + + This is implemented using Boost.Move. + + + + value_type is move insertable. + + + + + + initializer_list<value_type> + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from il into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default hash function and key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + hasher and key_equal need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + key_equal needs to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using a as the allocator, with the + default hash function and key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + hasher, key_equal need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + hasher const& + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + a as the allocator, with the + default key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + key_equal needs to be DefaultConstructible. + + + + + + The destructor is applied to every element, and all memory is deallocated + + + + + const& + + & + + The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator. + If Alloc::propagate_on_container_copy_assignment + exists and Alloc::propagate_on_container_copy_assignment::value + is true, the allocator is overwritten, if not the + copied elements are created using the existing + allocator. + + + value_type is copy constructible + + + + + && + + & + + The move assignment operator. + If Alloc::propagate_on_container_move_assignment + exists and Alloc::propagate_on_container_move_assignment::value + is true, the allocator is overwritten, if not the + moved elements are created using the existing + allocator. + + + + On compilers without rvalue references, this is emulated using + Boost.Move. Note that on some compilers the copy assignment + operator may be used in some circumstances. + + + + + value_type is move constructible. + + + + + + initializer_list<value_type> + + & + + Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed. + + + + value_type is CopyInsertable into the container and + CopyAssignable. + + + + + allocator_type + + + + bool + + size() == 0 + + + + size_type + + std::distance(begin(), end()) + + + + size_type + size() of the largest possible container. + + + + + + iterator + const_iterator + An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + + iterator + + + const_iterator + + An iterator which refers to the past-the-end value for the container. + + + + const_iterator + A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + const_iterator + A constant iterator which refers to the past-the-end value for the container. + + + + + + + + Args&& + + + + Inserts an object, constructed with the arguments args, in the container + + + value_type is EmplaceConstructible into + X from args. + + + + + An iterator pointing to the inserted element. + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent . + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + + const_iterator + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container + hint is a suggestion to where the element should be inserted. + + + value_type is EmplaceConstructible into + X from args. + + + + + An iterator pointing to the inserted element. + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent . + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same . + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + value_type const& + + + + Inserts obj in the container + + + value_type is CopyInsertable. + + + + An iterator pointing to the inserted element. + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent . + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + value_type&& + + + + Inserts obj in the container + + + value_type is MoveInsertable. + + + + An iterator pointing to the inserted element. + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent . + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type const& + + iterator + + + Inserts obj in the container. + + Inserts obj in the container if and only if there is no element in the container with an equivalent . + + hint is a suggestion to where the element should be inserted. + + + value_type is CopyInsertable. + + + + An iterator pointing to the inserted element. + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent . + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same . + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type&& + + iterator + + + Inserts obj in the container. + + Inserts obj in the container if and only if there is no element in the container with an equivalent . + + hint is a suggestion to where the element should be inserted. + + + value_type is MoveInsertable. + + + + An iterator pointing to the inserted element. + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent . + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same . + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + + InputIterator + + + InputIterator + + void + + Inserts a range of elements into the container. + + Elements are inserted if and only if there is no element in the container with an equivalent . + + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. + + Elements are inserted if and only if there is no element in the container with an equivalent . + + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent . + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + node_type + + Removes the element pointed to by position. + + + A node_type owning the element. + + + + In C++17 a node extracted using this method can be inserted into a compatible , + but that is not supported yet. + + + + + + key_type const& + + node_type + + Removes an element with key equivalent to k. + + + A node_type owning the element if found, otherwise an empty node_type. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In C++17 a node extracted using this method can be inserted into a compatible , + but that is not supported yet. + + + + + + node_type&& + + + + If nh is empty, has no affect. + + Otherwise inserts the element owned by nh + + Otherwise inserts the element owned by nh + if and only if there is no element in the container with an equivalent . + + + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + + If nh was empty, returns end(). + Otherwise returns an iterator pointing to the newly inserted element. + + If nh was empty, returns an insert_return_type with: + inserted equal to false, + position equal to end() and + node empty. + Otherwise if there was already an element with an equivalent key, returns an insert_return_type with: + inserted equal to false, + position pointing to a matching element and + node contains the node from nh. + Otherwise if the insertion succeeded, returns an insert_return_type with: + inserted equal to true, + position pointing to the newly inserted element and + node empty. + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible , + but that is not supported yet. + + + + + const_iterator + + + node_type&& + + iterator + + If nh is empty, has no affect. + + Otherwise inserts the element owned by nh + + Otherwise inserts the element owned by nh + if and only if there is no element in the container with an equivalent . + + If there is already an element in the container with an equivalent + has no effect on nh (i.e. nh still contains the node.) + + hint is a suggestion to where the element should be inserted. + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + + If nh was empty, returns end(). + Otherwise returns an iterator pointing to the newly inserted element. + + If nh was empty returns end(). + If there was already an element in the container with an equivalent + returns an iterator pointing to that. + Otherwise returns an iterator pointing to the newly inserted element. + + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same . + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible , + but that is not supported yet. + + + + + const_iterator + + iterator + + Erase the element pointed to by position. + + + The iterator following position before the erasure. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In older versions this could be inefficient because it had to search + through several buckets to find the position of the returned iterator. + The data structure has been changed so that this is no longer the case, + and the alternative erase methods have been deprecated. + + + + + + key_type const& + + size_type + + Erase all elements with key equivalent to k. + + + The number of elements erased. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + + const_iterator + + + const_iterator + + iterator + + Erases the elements in the range from first to last. + + + The iterator following the erased elements - i.e. last. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + void + + Erases all elements in the container. + + + size() == 0 + + + Never throws an exception. + + + + + & + + void + + Swaps the contents of the container with the parameter. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + + <Key, Mapped, H2, P2, Alloc>& + + <Value, H2, P2, Alloc>& + + + + Does not support merging with a compatible yet. + + + + + + + <Key, Mapped, H2, P2, Alloc>&& + + <Value, H2, P2, Alloc>&& + + + + Does not support merging with a compatible yet. + + + + + + + <Key, Mapped, H2, P2, Alloc>& + + <Value, H2, P2, Alloc>& + + + + + + + + <Key, Mapped, H2, P2, Alloc>&& + + <Value, H2, P2, Alloc>&& + + + +*/ ?> + + + + hasher + The container's hash function. + + + + key_equal + The container's key equality predicate. + + + + + + + + key_type const& + + iterator + + + + key_type const& + + const_iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + const_iterator + + + An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists. + + + The templated overloads are a non-standard extensions which + allows you to use a compatible hash function and equality + predicate for a key of a different type in order to avoid + an expensive type cast. In general, its use is not encouraged. + + + + + key_type const& + + size_type + + The number of elements with key equivalent to k. + + + + + + key_type const& + + std::pair<iterator, iterator> + + + + key_type const& + + std::pair<const_iterator, const_iterator> + + + A range containing all elements with key equivalent to k. + If the container doesn't container any such elements, returns + std::make_pair(b.end(),b.end()). + + + + + + + key_type const& + + mapped_type& + + If the container does not already contain an elements with a key equivalent to k, inserts the value std::pair<key_type const, mapped_type>(k, mapped_type()) + + + A reference to x.second where x is the element already in the container, or the newly inserted element with a key equivalent to k + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + Mapped& + key_type const& + Mapped const& + key_type const& + + A reference to x.second where x is the (unique) element whose key is equivalent to k. + + + An exception object of type std::out_of_range if no such element is present. + + + + + + + size_type + + The number of buckets. + + + + size_type + + An upper bound on the number of buckets. + + + + + size_type + + size_type + + n < bucket_count() + + + The number of elements in bucket n. + + + + + key_type const& + + size_type + + The index of the bucket which would contain an element with key k. + + + The return value is less than bucket_count() + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the first element in the bucket with index n. + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the first element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + + float + + The average number of elements per bucket. + + + + float + + Returns the current maximum load factor. + + + + + float + + void + + Changes the container's maximum load factor, using z as a hint. + + + + + size_type + + void + + Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor. + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + size_type + + void + + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + + + + const& + + + const& + + bool + + + Return true if x.size() == + y.size and for every equivalent key group in + x, there is a group in y + for the same key, which is a permutation (using + operator== to compare the value types). + + + Return true if x.size() == + y.size and for every element in x, + there is an element in y with the same + for the same key, with an equal value (using + operator== to compare the value types). + + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + const& + + + const& + + bool + + + Return false if x.size() == + y.size and for every equivalent key group in + x, there is a group in y + for the same key, which is a permutation (using + operator== to compare the value types). + + + Return false if x.size() == + y.size and for every element in x, + there is an element in y with the same + for the same key, with an equal value (using + operator== to compare the value types). + + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + + + & + + + & + + void + + x.swap(y) + + + Swaps the contents of x and y. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + + + + + + An object that owns a single element extracted from an + unordered_ or an + unordered_multi, that + can then be inserted into a compatible container type. + + + + The name and template parameters of this type is implementation + defined, and should be obtained using the node_type + member typedef from the appropriate container. + + + In this version of Boost, node_type is different + for unordered_map and unordered_multimap,' : + 'unordered_set and unordered_multiset,'; + ?> this will be fixed in a future version of Boost. + + + + + + typename Container::key_type + + + typename Container::mapped_type + + + + typename Container::value_type> + + + + typename Container::allocator_type> + + + + + + + && + + + + + && + + & + + + + key_type& + + + mapped_type& + + + + value_type& + + + + allocator_type + + + + + bool + + + + & + + void + + + In C++17 is also noexcept if ator_traits::is_always_equal::value is true. + But we don't support that trait yet. + + + + + + + + & + + + & + + void + + x.swap(y) + + + + + + + +
+ + + +
+
+ + + +
+
diff --git a/tools/boost_1_65_1/libs/unordered/doc/ref.xml b/tools/boost_1_65_1/libs/unordered/doc/ref.xml new file mode 100644 index 0000000000000000000000000000000000000000..68bfa02c0f014a187f0c3b0aa9fa3f69d11c9059 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/ref.xml @@ -0,0 +1,5901 @@ + +
+ + + + + An unordered associative container that stores unique values. + + + Template Parameters + + + + + Value + Value must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Hash + A unary function object type that acts a hash function for a Value. It takes a single argument of type Value and returns a value of type std::size_t. + + Pred + A binary function object that implements an equivalence relation on values of type Value. + A binary function object that induces an equivalence relation on values of type Value. + It takes two arguments of type Value and returns a value of type bool. + + Alloc + An allocator whose value type is the same as the container's value type. + The elements are organized into buckets. Keys with the same hash code are stored in the same bucket. + The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash. + + + Value + + + Value + + + Hash + + + Pred + + + Alloc + + + typename allocator_type::pointer + + + value_type* if + allocator_type::pointer is not defined. + + + + + typename allocator_type::const_pointer + + + boost::pointer_to_other<pointer, value_type>::type + if allocator_type::const_pointer is not defined. + + + + + value_type& + lvalue of value_type. + + + value_type const& + const lvalue of value_type. + + + implementation-defined + + An unsigned integral type. + size_type can represent any non-negative value of difference_type. + + + + implementation-defined + + A signed integral type. + Is identical to the difference type of iterator and const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + Convertible to const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + + + + implementation-defined + + An iterator with the same value type, difference type and pointer and reference type as iterator. + A local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + A constant iterator with the same value type, difference type and pointer and reference type as const_iterator. + A const_local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + See node_handle_set for details. + + + + implementation-defined + + Structure returned by inserting node_type. + + + + + size() == 0 + + + Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + size() == 0 + + + Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + unordered_set const& + + + The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator. + If Allocator::select_on_container_copy_construction + exists and has the right signature, the allocator will be + constructed from its result. + + + value_type is copy constructible + + + + + unordered_set && + + + The move constructor. + + + This is implemented using Boost.Move. + + + + value_type is move constructible. + + + On compilers without rvalue reference support the + emulation does not support moving without calling + boost::move if value_type is + not copyable. So, for example, you can't return the + container from a function. + + + + + + Allocator const& + + + Constructs an empty container, using allocator a. + + + + + unordered_set const& + + + Allocator const& + + + Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a. + + + + + unordered_set && + + + Allocator const& + + + Construct a container moving x's contained elements, and having the hash function, predicate and maximum load factor, but using allocate a. + + + This is implemented using Boost.Move. + + + + value_type is move insertable. + + + + + + initializer_list<value_type> + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from il into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default hash function and key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + hasher and key_equal need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + key_equal needs to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using a as the allocator, with the + default hash function and key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + hasher, key_equal need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + hasher const& + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + a as the allocator, with the + default key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + key_equal needs to be DefaultConstructible. + + + + + + The destructor is applied to every element, and all memory is deallocated + + + + + unordered_set const& + + unordered_set& + + The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator. + If Alloc::propagate_on_container_copy_assignment + exists and Alloc::propagate_on_container_copy_assignment::value + is true, the allocator is overwritten, if not the + copied elements are created using the existing + allocator. + + + value_type is copy constructible + + + + + unordered_set && + + unordered_set& + + The move assignment operator. + If Alloc::propagate_on_container_move_assignment + exists and Alloc::propagate_on_container_move_assignment::value + is true, the allocator is overwritten, if not the + moved elements are created using the existing + allocator. + + + + On compilers without rvalue references, this is emulated using + Boost.Move. Note that on some compilers the copy assignment + operator may be used in some circumstances. + + + + + value_type is move constructible. + + + + + + initializer_list<value_type> + + unordered_set& + + Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed. + + + + value_type is CopyInsertable into the container and + CopyAssignable. + + + + + allocator_type + + + + bool + + size() == 0 + + + + size_type + + std::distance(begin(), end()) + + + + size_type + size() of the largest possible container. + + + + + + iterator + const_iterator + An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + + iterator + + + const_iterator + + An iterator which refers to the past-the-end value for the container. + + + + const_iterator + A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + const_iterator + A constant iterator which refers to the past-the-end value for the container. + + + + + + + + Args&& + + std::pair<iterator, bool> + + Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent value. + + + value_type is EmplaceConstructible into + X from args. + + + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + + const_iterator + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent value. + hint is a suggestion to where the element should be inserted. + + + value_type is EmplaceConstructible into + X from args. + + + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + value_type const& + + std::pair<iterator, bool> + + Inserts obj in the container if and only if there is no element in the container with an equivalent value. + + + value_type is CopyInsertable. + + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + value_type&& + + std::pair<iterator, bool> + + Inserts obj in the container if and only if there is no element in the container with an equivalent value. + + + value_type is MoveInsertable. + + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type const& + + iterator + + Inserts obj in the container if and only if there is no element in the container with an equivalent value. + hint is a suggestion to where the element should be inserted. + + + value_type is CopyInsertable. + + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type&& + + iterator + + Inserts obj in the container if and only if there is no element in the container with an equivalent value. + hint is a suggestion to where the element should be inserted. + + + value_type is MoveInsertable. + + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + + InputIterator + + + InputIterator + + void + + Inserts a range of elements into the container. + Elements are inserted if and only if there is no element in the container with an equivalent value. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. + Elements are inserted if and only if there is no element in the container with an equivalent value. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent value. + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + node_type + + Removes the element pointed to by position. + + + A node_type owning the element. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_multiset, + but that is not supported yet. + + + + + + key_type const& + + node_type + + Removes an element with key equivalent to k. + + + A node_type owning the element if found, otherwise an empty node_type. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_multiset, + but that is not supported yet. + + + + + + node_type&& + + insert_return_type + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + if and only if there is no element in the container with an equivalent value. + + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty, returns an insert_return_type with: + inserted equal to false, + position equal to end() and + node empty. + Otherwise if there was already an element with an equivalent key, returns an insert_return_type with: + inserted equal to false, + position pointing to a matching element and + node contains the node from nh. + Otherwise if the insertion succeeded, returns an insert_return_type with: + inserted equal to true, + position pointing to the newly inserted element and + node empty. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_multiset, + but that is not supported yet. + + + + + const_iterator + + + node_type&& + + iterator + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + if and only if there is no element in the container with an equivalent value. + + If there is already an element in the container with an equivalent value has no effect on nh (i.e. nh still contains the node.) + hint is a suggestion to where the element should be inserted. + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty returns end(). + If there was already an element in the container with an equivalent value returns an iterator pointing to that. + Otherwise returns an iterator pointing to the newly inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_multiset, + but that is not supported yet. + + + + + const_iterator + + iterator + + Erase the element pointed to by position. + + + The iterator following position before the erasure. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In older versions this could be inefficient because it had to search + through several buckets to find the position of the returned iterator. + The data structure has been changed so that this is no longer the case, + and the alternative erase methods have been deprecated. + + + + + + key_type const& + + size_type + + Erase all elements with key equivalent to k. + + + The number of elements erased. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + + const_iterator + + + const_iterator + + iterator + + Erases the elements in the range from first to last. + + + The iterator following the erased elements - i.e. last. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + void + + Erases all elements in the container. + + + size() == 0 + + + Never throws an exception. + + + + + unordered_set& + + void + + Swaps the contents of the container with the parameter. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + unordered_set<Value, H2, P2, Alloc>& + + + Does not support merging with a compatible unordered_multiset yet. + + + + + + unordered_set<Value, H2, P2, Alloc>&& + + + Does not support merging with a compatible unordered_multiset yet. + + + + + + hasher + The container's hash function. + + + + key_equal + The container's key equality predicate. + + + + + + + + key_type const& + + iterator + + + + key_type const& + + const_iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + const_iterator + + + An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists. + + + The templated overloads are a non-standard extensions which + allows you to use a compatible hash function and equality + predicate for a key of a different type in order to avoid + an expensive type cast. In general, its use is not encouraged. + + + + + key_type const& + + size_type + + The number of elements with key equivalent to k. + + + + + + key_type const& + + std::pair<iterator, iterator> + + + + key_type const& + + std::pair<const_iterator, const_iterator> + + + A range containing all elements with key equivalent to k. + If the container doesn't container any such elements, returns + std::make_pair(b.end(),b.end()). + + + + + + + size_type + + The number of buckets. + + + + size_type + + An upper bound on the number of buckets. + + + + + size_type + + size_type + + n < bucket_count() + + + The number of elements in bucket n. + + + + + key_type const& + + size_type + + The index of the bucket which would contain an element with key k. + + + The return value is less than bucket_count() + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the first element in the bucket with index n. + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the first element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + + float + + The average number of elements per bucket. + + + + float + + Returns the current maximum load factor. + + + + + float + + void + + Changes the container's maximum load factor, using z as a hint. + + + + + size_type + + void + + Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor. + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + size_type + + void + + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + + + + unordered_set<Value, Hash, Pred, Alloc> const& + + + unordered_set<Value, Hash, Pred, Alloc> const& + + bool + + Return true if x.size() == + y.size and for every element in x, + there is an element in y with the same + for the same key, with an equal value (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + unordered_set<Value, Hash, Pred, Alloc> const& + + + unordered_set<Value, Hash, Pred, Alloc> const& + + bool + + Return false if x.size() == + y.size and for every element in x, + there is an element in y with the same + for the same key, with an equal value (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + + + unordered_set<Value, Hash, Pred, Alloc>& + + + unordered_set<Value, Hash, Pred, Alloc>& + + void + + x.swap(y) + + + Swaps the contents of x and y. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + + + An unordered associative container that stores values. The same key can be stored multiple times. + + + Template Parameters + + + + + Value + Value must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Hash + A unary function object type that acts a hash function for a Value. It takes a single argument of type Value and returns a value of type std::size_t. + + Pred + A binary function object that implements an equivalence relation on values of type Value. + A binary function object that induces an equivalence relation on values of type Value. + It takes two arguments of type Value and returns a value of type bool. + + Alloc + An allocator whose value type is the same as the container's value type. + The elements are organized into buckets. Keys with the same hash code are stored in the same bucket and elements with equivalent keys are stored next to each other. + The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash. + + + Value + + + Value + + + Hash + + + Pred + + + Alloc + + + typename allocator_type::pointer + + + value_type* if + allocator_type::pointer is not defined. + + + + + typename allocator_type::const_pointer + + + boost::pointer_to_other<pointer, value_type>::type + if allocator_type::const_pointer is not defined. + + + + + value_type& + lvalue of value_type. + + + value_type const& + const lvalue of value_type. + + + implementation-defined + + An unsigned integral type. + size_type can represent any non-negative value of difference_type. + + + + implementation-defined + + A signed integral type. + Is identical to the difference type of iterator and const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + Convertible to const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + + + + implementation-defined + + An iterator with the same value type, difference type and pointer and reference type as iterator. + A local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + A constant iterator with the same value type, difference type and pointer and reference type as const_iterator. + A const_local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + See node_handle_set for details. + + + + + size() == 0 + + + Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + size() == 0 + + + Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + unordered_multiset const& + + + The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator. + If Allocator::select_on_container_copy_construction + exists and has the right signature, the allocator will be + constructed from its result. + + + value_type is copy constructible + + + + + unordered_multiset && + + + The move constructor. + + + This is implemented using Boost.Move. + + + + value_type is move constructible. + + + On compilers without rvalue reference support the + emulation does not support moving without calling + boost::move if value_type is + not copyable. So, for example, you can't return the + container from a function. + + + + + + Allocator const& + + + Constructs an empty container, using allocator a. + + + + + unordered_multiset const& + + + Allocator const& + + + Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a. + + + + + unordered_multiset && + + + Allocator const& + + + Construct a container moving x's contained elements, and having the hash function, predicate and maximum load factor, but using allocate a. + + + This is implemented using Boost.Move. + + + + value_type is move insertable. + + + + + + initializer_list<value_type> + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from il into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default hash function and key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + hasher and key_equal need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + key_equal needs to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using a as the allocator, with the + default hash function and key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + hasher, key_equal need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + hasher const& + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + a as the allocator, with the + default key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + key_equal needs to be DefaultConstructible. + + + + + + The destructor is applied to every element, and all memory is deallocated + + + + + unordered_multiset const& + + unordered_multiset& + + The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator. + If Alloc::propagate_on_container_copy_assignment + exists and Alloc::propagate_on_container_copy_assignment::value + is true, the allocator is overwritten, if not the + copied elements are created using the existing + allocator. + + + value_type is copy constructible + + + + + unordered_multiset && + + unordered_multiset& + + The move assignment operator. + If Alloc::propagate_on_container_move_assignment + exists and Alloc::propagate_on_container_move_assignment::value + is true, the allocator is overwritten, if not the + moved elements are created using the existing + allocator. + + + + On compilers without rvalue references, this is emulated using + Boost.Move. Note that on some compilers the copy assignment + operator may be used in some circumstances. + + + + + value_type is move constructible. + + + + + + initializer_list<value_type> + + unordered_multiset& + + Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed. + + + + value_type is CopyInsertable into the container and + CopyAssignable. + + + + + allocator_type + + + + bool + + size() == 0 + + + + size_type + + std::distance(begin(), end()) + + + + size_type + size() of the largest possible container. + + + + + + iterator + const_iterator + An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + + iterator + + + const_iterator + + An iterator which refers to the past-the-end value for the container. + + + + const_iterator + A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + const_iterator + A constant iterator which refers to the past-the-end value for the container. + + + + + + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container. + + + value_type is EmplaceConstructible into + X from args. + + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + + const_iterator + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container. + hint is a suggestion to where the element should be inserted. + + + value_type is EmplaceConstructible into + X from args. + + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + value_type const& + + iterator + + Inserts obj in the container. + + + value_type is CopyInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + value_type&& + + iterator + + Inserts obj in the container. + + + value_type is MoveInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type const& + + iterator + + Inserts obj in the container. + hint is a suggestion to where the element should be inserted. + + + value_type is CopyInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type&& + + iterator + + Inserts obj in the container. + hint is a suggestion to where the element should be inserted. + + + value_type is MoveInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + + InputIterator + + + InputIterator + + void + + Inserts a range of elements into the container. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent value. + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + node_type + + Removes the element pointed to by position. + + + A node_type owning the element. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_set, + but that is not supported yet. + + + + + + key_type const& + + node_type + + Removes an element with key equivalent to k. + + + A node_type owning the element if found, otherwise an empty node_type. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_set, + but that is not supported yet. + + + + + + node_type&& + + iterator + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty, returns end(). + Otherwise returns an iterator pointing to the newly inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_set, + but that is not supported yet. + + + + + const_iterator + + + node_type&& + + iterator + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + hint is a suggestion to where the element should be inserted. + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty, returns end(). + Otherwise returns an iterator pointing to the newly inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_set, + but that is not supported yet. + + + + + const_iterator + + iterator + + Erase the element pointed to by position. + + + The iterator following position before the erasure. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In older versions this could be inefficient because it had to search + through several buckets to find the position of the returned iterator. + The data structure has been changed so that this is no longer the case, + and the alternative erase methods have been deprecated. + + + + + + key_type const& + + size_type + + Erase all elements with key equivalent to k. + + + The number of elements erased. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + + const_iterator + + + const_iterator + + iterator + + Erases the elements in the range from first to last. + + + The iterator following the erased elements - i.e. last. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + void + + Erases all elements in the container. + + + size() == 0 + + + Never throws an exception. + + + + + unordered_multiset& + + void + + Swaps the contents of the container with the parameter. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + unordered_multiset<Value, H2, P2, Alloc>& + + + Does not support merging with a compatible unordered_set yet. + + + + + + unordered_multiset<Value, H2, P2, Alloc>&& + + + Does not support merging with a compatible unordered_set yet. + + + + + + hasher + The container's hash function. + + + + key_equal + The container's key equality predicate. + + + + + + + + key_type const& + + iterator + + + + key_type const& + + const_iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + const_iterator + + + An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists. + + + The templated overloads are a non-standard extensions which + allows you to use a compatible hash function and equality + predicate for a key of a different type in order to avoid + an expensive type cast. In general, its use is not encouraged. + + + + + key_type const& + + size_type + + The number of elements with key equivalent to k. + + + + + + key_type const& + + std::pair<iterator, iterator> + + + + key_type const& + + std::pair<const_iterator, const_iterator> + + + A range containing all elements with key equivalent to k. + If the container doesn't container any such elements, returns + std::make_pair(b.end(),b.end()). + + + + + + + size_type + + The number of buckets. + + + + size_type + + An upper bound on the number of buckets. + + + + + size_type + + size_type + + n < bucket_count() + + + The number of elements in bucket n. + + + + + key_type const& + + size_type + + The index of the bucket which would contain an element with key k. + + + The return value is less than bucket_count() + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the first element in the bucket with index n. + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the first element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + + float + + The average number of elements per bucket. + + + + float + + Returns the current maximum load factor. + + + + + float + + void + + Changes the container's maximum load factor, using z as a hint. + + + + + size_type + + void + + Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor. + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + size_type + + void + + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + + + + unordered_multiset<Value, Hash, Pred, Alloc> const& + + + unordered_multiset<Value, Hash, Pred, Alloc> const& + + bool + + Return true if x.size() == + y.size and for every equivalent key group in + x, there is a group in y + for the same key, which is a permutation (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + unordered_multiset<Value, Hash, Pred, Alloc> const& + + + unordered_multiset<Value, Hash, Pred, Alloc> const& + + bool + + Return false if x.size() == + y.size and for every equivalent key group in + x, there is a group in y + for the same key, which is a permutation (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + + + unordered_multiset<Value, Hash, Pred, Alloc>& + + + unordered_multiset<Value, Hash, Pred, Alloc>& + + void + + x.swap(y) + + + Swaps the contents of x and y. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + + + + + An object that owns a single element extracted from an + unordered_set or an + unordered_multiset, that + can then be inserted into a compatible container type. + + + + The name and template parameters of this type is implementation + defined, and should be obtained using the node_type + member typedef from the appropriate container. + + + In this version of Boost, node_type is different + for unordered_set and unordered_multiset, this will be fixed in a future version of Boost. + + + + + typename Container::value_type> + + + typename Container::allocator_type> + + + + + + + node_handle_set && + + + + + node_handle_set&& + + node_handle_set& + + + value_type& + + + allocator_type + + + + + bool + + + + node_handle_set& + + void + + + In C++17 is also noexcept if ator_traits::is_always_equal::value is true. + But we don't support that trait yet. + + + + + + + + node_handle_set<ImplementationDefined>& + + + node_handle_set<ImplementationDefined>& + + void + + x.swap(y) + + + + + + +
+
+ + + + + An unordered associative container that associates unique keys with another value. + + + Template Parameters + + + + + Key + Key must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Mapped + Mapped must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Hash + A unary function object type that acts a hash function for a Key. It takes a single argument of type Key and returns a value of type std::size_t. + + Pred + A binary function object that implements an equivalence relation on values of type Key. + A binary function object that induces an equivalence relation on values of type Key. + It takes two arguments of type Key and returns a value of type bool. + + Alloc + An allocator whose value type is the same as the container's value type. + The elements are organized into buckets. Keys with the same hash code are stored in the same bucket. + The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash. + + + Key + + + std::pair<Key const, Mapped> + + + Mapped + + + Hash + + + Pred + + + Alloc + + + typename allocator_type::pointer + + + value_type* if + allocator_type::pointer is not defined. + + + + + typename allocator_type::const_pointer + + + boost::pointer_to_other<pointer, value_type>::type + if allocator_type::const_pointer is not defined. + + + + + value_type& + lvalue of value_type. + + + value_type const& + const lvalue of value_type. + + + implementation-defined + + An unsigned integral type. + size_type can represent any non-negative value of difference_type. + + + + implementation-defined + + A signed integral type. + Is identical to the difference type of iterator and const_iterator. + + + + implementation-defined + + An iterator whose value type is value_type. + The iterator category is at least a forward iterator. + Convertible to const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + + + + implementation-defined + + An iterator with the same value type, difference type and pointer and reference type as iterator. + A local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + A constant iterator with the same value type, difference type and pointer and reference type as const_iterator. + A const_local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + See node_handle_map for details. + + + + implementation-defined + + Structure returned by inserting node_type. + + + + + size() == 0 + + + Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + size() == 0 + + + Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + unordered_map const& + + + The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator. + If Allocator::select_on_container_copy_construction + exists and has the right signature, the allocator will be + constructed from its result. + + + value_type is copy constructible + + + + + unordered_map && + + + The move constructor. + + + This is implemented using Boost.Move. + + + + value_type is move constructible. + + + On compilers without rvalue reference support the + emulation does not support moving without calling + boost::move if value_type is + not copyable. So, for example, you can't return the + container from a function. + + + + + + Allocator const& + + + Constructs an empty container, using allocator a. + + + + + unordered_map const& + + + Allocator const& + + + Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a. + + + + + unordered_map && + + + Allocator const& + + + Construct a container moving x's contained elements, and having the hash function, predicate and maximum load factor, but using allocate a. + + + This is implemented using Boost.Move. + + + + value_type is move insertable. + + + + + + initializer_list<value_type> + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from il into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default hash function and key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + hasher and key_equal need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + key_equal needs to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using a as the allocator, with the + default hash function and key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + hasher, key_equal need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + hasher const& + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + a as the allocator, with the + default key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + key_equal needs to be DefaultConstructible. + + + + + + The destructor is applied to every element, and all memory is deallocated + + + + + unordered_map const& + + unordered_map& + + The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator. + If Alloc::propagate_on_container_copy_assignment + exists and Alloc::propagate_on_container_copy_assignment::value + is true, the allocator is overwritten, if not the + copied elements are created using the existing + allocator. + + + value_type is copy constructible + + + + + unordered_map && + + unordered_map& + + The move assignment operator. + If Alloc::propagate_on_container_move_assignment + exists and Alloc::propagate_on_container_move_assignment::value + is true, the allocator is overwritten, if not the + moved elements are created using the existing + allocator. + + + + On compilers without rvalue references, this is emulated using + Boost.Move. Note that on some compilers the copy assignment + operator may be used in some circumstances. + + + + + value_type is move constructible. + + + + + + initializer_list<value_type> + + unordered_map& + + Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed. + + + + value_type is CopyInsertable into the container and + CopyAssignable. + + + + + allocator_type + + + + bool + + size() == 0 + + + + size_type + + std::distance(begin(), end()) + + + + size_type + size() of the largest possible container. + + + + + + iterator + const_iterator + An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + + iterator + + + const_iterator + + An iterator which refers to the past-the-end value for the container. + + + + const_iterator + A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + const_iterator + A constant iterator which refers to the past-the-end value for the container. + + + + + + + + Args&& + + std::pair<iterator, bool> + + Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent key. + + + value_type is EmplaceConstructible into + X from args. + + + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + + const_iterator + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent key. + hint is a suggestion to where the element should be inserted. + + + value_type is EmplaceConstructible into + X from args. + + + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + value_type const& + + std::pair<iterator, bool> + + Inserts obj in the container if and only if there is no element in the container with an equivalent key. + + + value_type is CopyInsertable. + + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + value_type&& + + std::pair<iterator, bool> + + Inserts obj in the container if and only if there is no element in the container with an equivalent key. + + + value_type is MoveInsertable. + + + The bool component of the return type is true if an insert took place. + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type const& + + iterator + + Inserts obj in the container if and only if there is no element in the container with an equivalent key. + hint is a suggestion to where the element should be inserted. + + + value_type is CopyInsertable. + + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type&& + + iterator + + Inserts obj in the container if and only if there is no element in the container with an equivalent key. + hint is a suggestion to where the element should be inserted. + + + value_type is MoveInsertable. + + + If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + + InputIterator + + + InputIterator + + void + + Inserts a range of elements into the container. + Elements are inserted if and only if there is no element in the container with an equivalent key. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. + Elements are inserted if and only if there is no element in the container with an equivalent key. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent key. + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + node_type + + Removes the element pointed to by position. + + + A node_type owning the element. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_multimap, + but that is not supported yet. + + + + + + key_type const& + + node_type + + Removes an element with key equivalent to k. + + + A node_type owning the element if found, otherwise an empty node_type. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_multimap, + but that is not supported yet. + + + + + + node_type&& + + insert_return_type + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + if and only if there is no element in the container with an equivalent key. + + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty, returns an insert_return_type with: + inserted equal to false, + position equal to end() and + node empty. + Otherwise if there was already an element with an equivalent key, returns an insert_return_type with: + inserted equal to false, + position pointing to a matching element and + node contains the node from nh. + Otherwise if the insertion succeeded, returns an insert_return_type with: + inserted equal to true, + position pointing to the newly inserted element and + node empty. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_multimap, + but that is not supported yet. + + + + + const_iterator + + + node_type&& + + iterator + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + if and only if there is no element in the container with an equivalent key. + + If there is already an element in the container with an equivalent key has no effect on nh (i.e. nh still contains the node.) + hint is a suggestion to where the element should be inserted. + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty returns end(). + If there was already an element in the container with an equivalent key returns an iterator pointing to that. + Otherwise returns an iterator pointing to the newly inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_multimap, + but that is not supported yet. + + + + + const_iterator + + iterator + + Erase the element pointed to by position. + + + The iterator following position before the erasure. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In older versions this could be inefficient because it had to search + through several buckets to find the position of the returned iterator. + The data structure has been changed so that this is no longer the case, + and the alternative erase methods have been deprecated. + + + + + + key_type const& + + size_type + + Erase all elements with key equivalent to k. + + + The number of elements erased. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + + const_iterator + + + const_iterator + + iterator + + Erases the elements in the range from first to last. + + + The iterator following the erased elements - i.e. last. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + void + + Erases all elements in the container. + + + size() == 0 + + + Never throws an exception. + + + + + unordered_map& + + void + + Swaps the contents of the container with the parameter. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + unordered_map<Key, Mapped, H2, P2, Alloc>& + + + Does not support merging with a compatible unordered_multimap yet. + + + + + + unordered_map<Key, Mapped, H2, P2, Alloc>&& + + + Does not support merging with a compatible unordered_multimap yet. + + + + + + hasher + The container's hash function. + + + + key_equal + The container's key equality predicate. + + + + + + + + key_type const& + + iterator + + + + key_type const& + + const_iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + const_iterator + + + An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists. + + + The templated overloads are a non-standard extensions which + allows you to use a compatible hash function and equality + predicate for a key of a different type in order to avoid + an expensive type cast. In general, its use is not encouraged. + + + + + key_type const& + + size_type + + The number of elements with key equivalent to k. + + + + + + key_type const& + + std::pair<iterator, iterator> + + + + key_type const& + + std::pair<const_iterator, const_iterator> + + + A range containing all elements with key equivalent to k. + If the container doesn't container any such elements, returns + std::make_pair(b.end(),b.end()). + + + + + + key_type const& + + mapped_type& + + If the container does not already contain an elements with a key equivalent to k, inserts the value std::pair<key_type const, mapped_type>(k, mapped_type()) + + + A reference to x.second where x is the element already in the container, or the newly inserted element with a key equivalent to k + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + Mapped& + key_type const& + Mapped const& + key_type const& + + A reference to x.second where x is the (unique) element whose key is equivalent to k. + + + An exception object of type std::out_of_range if no such element is present. + + + + + + size_type + + The number of buckets. + + + + size_type + + An upper bound on the number of buckets. + + + + + size_type + + size_type + + n < bucket_count() + + + The number of elements in bucket n. + + + + + key_type const& + + size_type + + The index of the bucket which would contain an element with key k. + + + The return value is less than bucket_count() + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the first element in the bucket with index n. + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the first element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + + float + + The average number of elements per bucket. + + + + float + + Returns the current maximum load factor. + + + + + float + + void + + Changes the container's maximum load factor, using z as a hint. + + + + + size_type + + void + + Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor. + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + size_type + + void + + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + + + + unordered_map<Key, Mapped, Hash, Pred, Alloc> const& + + + unordered_map<Key, Mapped, Hash, Pred, Alloc> const& + + bool + + Return true if x.size() == + y.size and for every element in x, + there is an element in y with the same + for the same key, with an equal value (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + unordered_map<Key, Mapped, Hash, Pred, Alloc> const& + + + unordered_map<Key, Mapped, Hash, Pred, Alloc> const& + + bool + + Return false if x.size() == + y.size and for every element in x, + there is an element in y with the same + for the same key, with an equal value (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + + + unordered_map<Key, Mapped, Hash, Pred, Alloc>& + + + unordered_map<Key, Mapped, Hash, Pred, Alloc>& + + void + + x.swap(y) + + + Swaps the contents of x and y. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + + + An unordered associative container that associates keys with another value. The same key can be stored multiple times. + + + Template Parameters + + + + + Key + Key must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Mapped + Mapped must be Erasable from the container + (i.e. allocator_traits can destroy it). + + + Hash + A unary function object type that acts a hash function for a Key. It takes a single argument of type Key and returns a value of type std::size_t. + + Pred + A binary function object that implements an equivalence relation on values of type Key. + A binary function object that induces an equivalence relation on values of type Key. + It takes two arguments of type Key and returns a value of type bool. + + Alloc + An allocator whose value type is the same as the container's value type. + The elements are organized into buckets. Keys with the same hash code are stored in the same bucket and elements with equivalent keys are stored next to each other. + The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash. + + + Key + + + std::pair<Key const, Mapped> + + + Mapped + + + Hash + + + Pred + + + Alloc + + + typename allocator_type::pointer + + + value_type* if + allocator_type::pointer is not defined. + + + + + typename allocator_type::const_pointer + + + boost::pointer_to_other<pointer, value_type>::type + if allocator_type::const_pointer is not defined. + + + + + value_type& + lvalue of value_type. + + + value_type const& + const lvalue of value_type. + + + implementation-defined + + An unsigned integral type. + size_type can represent any non-negative value of difference_type. + + + + implementation-defined + + A signed integral type. + Is identical to the difference type of iterator and const_iterator. + + + + implementation-defined + + An iterator whose value type is value_type. + The iterator category is at least a forward iterator. + Convertible to const_iterator. + + + + implementation-defined + + A constant iterator whose value type is value_type. + The iterator category is at least a forward iterator. + + + + implementation-defined + + An iterator with the same value type, difference type and pointer and reference type as iterator. + A local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + A constant iterator with the same value type, difference type and pointer and reference type as const_iterator. + A const_local_iterator object can be used to iterate through a single bucket. + + + + implementation-defined + + See node_handle_map for details. + + + + + size() == 0 + + + Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + size() == 0 + + + Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0. + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + unordered_multimap const& + + + The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator. + If Allocator::select_on_container_copy_construction + exists and has the right signature, the allocator will be + constructed from its result. + + + value_type is copy constructible + + + + + unordered_multimap && + + + The move constructor. + + + This is implemented using Boost.Move. + + + + value_type is move constructible. + + + On compilers without rvalue reference support the + emulation does not support moving without calling + boost::move if value_type is + not copyable. So, for example, you can't return the + container from a function. + + + + + + Allocator const& + + + Constructs an empty container, using allocator a. + + + + + unordered_multimap const& + + + Allocator const& + + + Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a. + + + + + unordered_multimap && + + + Allocator const& + + + Construct a container moving x's contained elements, and having the hash function, predicate and maximum load factor, but using allocate a. + + + This is implemented using Boost.Move. + + + + value_type is move insertable. + + + + + + initializer_list<value_type> + + + size_type + implementation-defined + + + hasher const& + hasher() + + + key_equal const& + key_equal() + + + allocator_type const& + allocator_type() + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + eq as the key equality predicate, + a as the allocator and a maximum load factor of 1.0 + and inserts the elements from il into it. + + + + If the defaults are used, hasher, key_equal and + allocator_type need to be DefaultConstructible. + + + + + + size_type + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default hash function and key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + hasher and key_equal need to be DefaultConstructible. + + + + + + size_type + + + hasher const& + + + allocator_type const& + + + size() == 0 + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + the default key equality predicate, + a as the allocator and a maximum load factor of 1.0. + + + key_equal needs to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using a as the allocator, with the + default hash function and key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + hasher, key_equal need to be DefaultConstructible. + + + + + + + InputIterator + + + InputIterator + + + size_type + + + hasher const& + + + allocator_type const& + + + Constructs an empty container with at least n buckets, + using hf as the hash function, + a as the allocator, with the + default key equality predicate + and a maximum load factor of 1.0 + and inserts the elements from [f, l) into it. + + + + key_equal needs to be DefaultConstructible. + + + + + + The destructor is applied to every element, and all memory is deallocated + + + + + unordered_multimap const& + + unordered_multimap& + + The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator. + If Alloc::propagate_on_container_copy_assignment + exists and Alloc::propagate_on_container_copy_assignment::value + is true, the allocator is overwritten, if not the + copied elements are created using the existing + allocator. + + + value_type is copy constructible + + + + + unordered_multimap && + + unordered_multimap& + + The move assignment operator. + If Alloc::propagate_on_container_move_assignment + exists and Alloc::propagate_on_container_move_assignment::value + is true, the allocator is overwritten, if not the + moved elements are created using the existing + allocator. + + + + On compilers without rvalue references, this is emulated using + Boost.Move. Note that on some compilers the copy assignment + operator may be used in some circumstances. + + + + + value_type is move constructible. + + + + + + initializer_list<value_type> + + unordered_multimap& + + Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed. + + + + value_type is CopyInsertable into the container and + CopyAssignable. + + + + + allocator_type + + + + bool + + size() == 0 + + + + size_type + + std::distance(begin(), end()) + + + + size_type + size() of the largest possible container. + + + + + + iterator + const_iterator + An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + + iterator + + + const_iterator + + An iterator which refers to the past-the-end value for the container. + + + + const_iterator + A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + + + + const_iterator + A constant iterator which refers to the past-the-end value for the container. + + + + + + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container. + + + value_type is EmplaceConstructible into + X from args. + + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + + const_iterator + + + Args&& + + iterator + + Inserts an object, constructed with the arguments args, in the container. + hint is a suggestion to where the element should be inserted. + + + value_type is EmplaceConstructible into + X from args. + + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + If the compiler doesn't support variadic template arguments or rvalue + references, this is emulated for up to 10 arguments, with no support + for rvalue references or move semantics. + Since existing std::pair implementations don't support + std::piecewise_construct this emulates it, + but using boost::unordered::piecewise_construct. + + + + + value_type const& + + iterator + + Inserts obj in the container. + + + value_type is CopyInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + value_type&& + + iterator + + Inserts obj in the container. + + + value_type is MoveInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type const& + + iterator + + Inserts obj in the container. + hint is a suggestion to where the element should be inserted. + + + value_type is CopyInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + + value_type&& + + iterator + + Inserts obj in the container. + hint is a suggestion to where the element should be inserted. + + + value_type is MoveInsertable. + + + An iterator pointing to the inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + + InputIterator + + + InputIterator + + void + + Inserts a range of elements into the container. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. + + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + initializer_list<value_type> + + void + + Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent key. + + + value_type is EmplaceConstructible into + X from *first. + + + When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + + + + + const_iterator + + node_type + + Removes the element pointed to by position. + + + A node_type owning the element. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_map, + but that is not supported yet. + + + + + + key_type const& + + node_type + + Removes an element with key equivalent to k. + + + A node_type owning the element if found, otherwise an empty node_type. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In C++17 a node extracted using this method can be inserted into a compatible unordered_map, + but that is not supported yet. + + + + + + node_type&& + + iterator + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty, returns end(). + Otherwise returns an iterator pointing to the newly inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_map, + but that is not supported yet. + + + + + const_iterator + + + node_type&& + + iterator + + If nh is empty, has no affect. + Otherwise inserts the element owned by nh + hint is a suggestion to where the element should be inserted. + + + nh is empty or nh.get_allocator() is equal to the container's allocator. + + + If nh was empty, returns end(). + Otherwise returns an iterator pointing to the newly inserted element. + + + If an exception is thrown by an operation other than a call to hasher the function has no effect. + + + The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. + Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor. + Pointers and references to elements are never invalidated. + In C++17 this can be used to insert a node extracted from a compatible unordered_map, + but that is not supported yet. + + + + + const_iterator + + iterator + + Erase the element pointed to by position. + + + The iterator following position before the erasure. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + In older versions this could be inefficient because it had to search + through several buckets to find the position of the returned iterator. + The data structure has been changed so that this is no longer the case, + and the alternative erase methods have been deprecated. + + + + + + key_type const& + + size_type + + Erase all elements with key equivalent to k. + + + The number of elements erased. + + + Only throws an exception if it is thrown by hasher or key_equal. + + + + + const_iterator + + + const_iterator + + iterator + + Erases the elements in the range from first to last. + + + The iterator following the erased elements - i.e. last. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + + const_iterator + + void + + Erase the element pointed to by position. + + + Only throws an exception if it is thrown by hasher or key_equal. + In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations. + + + + This method was implemented because returning an iterator to + the next element from erase was expensive, but + the container has been redesigned so that is no longer the + case. So this method is now deprecated. + + + + + void + + Erases all elements in the container. + + + size() == 0 + + + Never throws an exception. + + + + + unordered_multimap& + + void + + Swaps the contents of the container with the parameter. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + unordered_multimap<Key, Mapped, H2, P2, Alloc>& + + + Does not support merging with a compatible unordered_map yet. + + + + + + unordered_multimap<Key, Mapped, H2, P2, Alloc>&& + + + Does not support merging with a compatible unordered_map yet. + + + + + + hasher + The container's hash function. + + + + key_equal + The container's key equality predicate. + + + + + + + + key_type const& + + iterator + + + + key_type const& + + const_iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + iterator + + + + + CompatibleKey const& + + + CompatibleHash const& + + + CompatiblePredicate const& + + const_iterator + + + An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists. + + + The templated overloads are a non-standard extensions which + allows you to use a compatible hash function and equality + predicate for a key of a different type in order to avoid + an expensive type cast. In general, its use is not encouraged. + + + + + key_type const& + + size_type + + The number of elements with key equivalent to k. + + + + + + key_type const& + + std::pair<iterator, iterator> + + + + key_type const& + + std::pair<const_iterator, const_iterator> + + + A range containing all elements with key equivalent to k. + If the container doesn't container any such elements, returns + std::make_pair(b.end(),b.end()). + + + + + + + size_type + + The number of buckets. + + + + size_type + + An upper bound on the number of buckets. + + + + + size_type + + size_type + + n < bucket_count() + + + The number of elements in bucket n. + + + + + key_type const& + + size_type + + The index of the bucket which would contain an element with key k. + + + The return value is less than bucket_count() + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the first element in the bucket with index n. + + + + + + size_type + + local_iterator + + + + size_type + + const_local_iterator + + + n shall be in the range [0, bucket_count()). + + + A local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the first element in the bucket with index n. + + + + + size_type + + const_local_iterator + + n shall be in the range [0, bucket_count()). + + + A constant local iterator pointing the 'one past the end' element in the bucket with index n. + + + + + + float + + The average number of elements per bucket. + + + + float + + Returns the current maximum load factor. + + + + + float + + void + + Changes the container's maximum load factor, using z as a hint. + + + + + size_type + + void + + Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor. + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + size_type + + void + + Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated. + + + The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function. + + + + + + + + unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& + + + unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& + + bool + + Return true if x.size() == + y.size and for every equivalent key group in + x, there is a group in y + for the same key, which is a permutation (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& + + + unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& + + bool + + Return false if x.size() == + y.size and for every equivalent key group in + x, there is a group in y + for the same key, which is a permutation (using + operator== to compare the value types). + + + + The behavior of this function was changed to match + the C++11 standard in Boost 1.48. + Behavior is undefined if the two containers don't have + equivalent equality predicates. + + + + + + + + unordered_multimap<Key, Mapped, Hash, Pred, Alloc>& + + + unordered_multimap<Key, Mapped, Hash, Pred, Alloc>& + + void + + x.swap(y) + + + Swaps the contents of x and y. + If Allocator::propagate_on_container_swap is declared and + Allocator::propagate_on_container_swap::value is true then the + containers' allocators are swapped. Otherwise, swapping with unequal allocators + results in undefined behavior. + + + Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher. + + + The exception specifications aren't quite the same as the C++11 standard, as + the equality predieate and hash function are swapped using their copy constructors. + + + + + + + + + + An object that owns a single element extracted from an + unordered_map or an + unordered_multimap, that + can then be inserted into a compatible container type. + + + + The name and template parameters of this type is implementation + defined, and should be obtained using the node_type + member typedef from the appropriate container. + + + In this version of Boost, node_type is different + for unordered_map and unordered_multimap, this will be fixed in a future version of Boost. + + + + + typename Container::key_type + + + typename Container::mapped_type + + + typename Container::allocator_type> + + + + + + + node_handle_map && + + + + + node_handle_map&& + + node_handle_map& + + + key_type& + + + mapped_type& + + + allocator_type + + + + + bool + + + + node_handle_map& + + void + + + In C++17 is also noexcept if ator_traits::is_always_equal::value is true. + But we don't support that trait yet. + + + + + + + + node_handle_map<ImplementationDefined>& + + + node_handle_map<ImplementationDefined>& + + void + + x.swap(y) + + + + + + +
+
diff --git a/tools/boost_1_65_1/libs/unordered/doc/src_code/dictionary.cpp b/tools/boost_1_65_1/libs/unordered/doc/src_code/dictionary.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dece308980f1ac7422edce906b6124cd4ee427b5 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/src_code/dictionary.cpp @@ -0,0 +1,101 @@ + +// Copyright 2006-2007 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include "../../examples/fnv1.hpp" + +//[case_insensitive_functions + struct iequal_to + { + bool operator()(std::string const& x, + std::string const& y) const + { + return boost::algorithm::iequals(x, y, std::locale()); + } + }; + + struct ihash + { + std::size_t operator()(std::string const& x) const + { + std::size_t seed = 0; + std::locale locale; + + for(std::string::const_iterator it = x.begin(); + it != x.end(); ++it) + { + boost::hash_combine(seed, std::toupper(*it, locale)); + } + + return seed; + } + }; +//] + +int main() { +//[case_sensitive_dictionary_fnv + boost::unordered_map + dictionary; +//] + + BOOST_TEST(dictionary.empty()); + + dictionary["one"] = 1; + BOOST_TEST(dictionary.size() == 1); + BOOST_TEST(dictionary.find("ONE") == dictionary.end()); + + dictionary.insert(std::make_pair("ONE", 2)); + BOOST_TEST(dictionary.size() == 2); + BOOST_TEST(dictionary.find("ONE") != dictionary.end() && + dictionary.find("ONE")->first == "ONE" && + dictionary.find("ONE")->second == 2); + + dictionary["One"] = 3; + BOOST_TEST(dictionary.size() == 3); + BOOST_TEST(dictionary.find("One") != dictionary.end() && + dictionary.find("One")->first == "One" && + dictionary.find("One")->second == 3); + + dictionary["two"] = 4; + BOOST_TEST(dictionary.size() == 4); + BOOST_TEST(dictionary.find("Two") == dictionary.end() && + dictionary.find("two") != dictionary.end() && + dictionary.find("two")->second == 4); + + +//[case_insensitive_dictionary + boost::unordered_map + idictionary; +//] + + BOOST_TEST(idictionary.empty()); + + idictionary["one"] = 1; + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find("ONE") != idictionary.end() && + idictionary.find("ONE") == idictionary.find("one")); + + idictionary.insert(std::make_pair("ONE", 2)); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find("ONE") != idictionary.end() && + idictionary.find("ONE")->first == "one" && + idictionary.find("ONE")->second == 1); + + idictionary["One"] = 3; + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find("ONE") != idictionary.end() && + idictionary.find("ONE")->first == "one" && + idictionary.find("ONE")->second == 3); + + idictionary["two"] = 4; + BOOST_TEST(idictionary.size() == 2); + BOOST_TEST(idictionary.find("two") != idictionary.end() && + idictionary.find("TWO")->first == "two" && + idictionary.find("Two")->second == 4); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/unordered/doc/src_code/intro.cpp b/tools/boost_1_65_1/libs/unordered/doc/src_code/intro.cpp new file mode 100644 index 0000000000000000000000000000000000000000..883d3662f200ac290948fd09c4c2307f31171a40 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/src_code/intro.cpp @@ -0,0 +1,30 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +//[intro_example1_1 +#include +#include +#include +#include +//] + +int main() { +//[intro_example1_2 + typedef boost::unordered_map map; + map x; + x["one"] = 1; + x["two"] = 2; + x["three"] = 3; + + assert(x.at("one") == 1); + assert(x.find("missing") == x.end()); +//] + +//[intro_example1_3 + BOOST_FOREACH(map::value_type i, x) { + std::cout< +#include + +//[point_example1 + struct point { + int x; + int y; + }; + + bool operator==(point const& p1, point const& p2) + { + return p1.x == p2.x && p1.y == p2.y; + } + + struct point_hash + { + std::size_t operator()(point const& p) const + { + std::size_t seed = 0; + boost::hash_combine(seed, p.x); + boost::hash_combine(seed, p.y); + return seed; + } + }; + + boost::unordered_multiset points; +//] + +int main() { + point x[] = {{1,2}, {3,4}, {1,5}, {1,2}}; + for(int i = 0; i < sizeof(x) / sizeof(point); ++i) + points.insert(x[i]); + BOOST_TEST(points.count(x[0]) == 2); + BOOST_TEST(points.count(x[1]) == 1); + point y = {10, 2}; + BOOST_TEST(points.count(y) == 0); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/unordered/doc/src_code/point2.cpp b/tools/boost_1_65_1/libs/unordered/doc/src_code/point2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..359984cb19b2487b1ed2d385708cbb5cda97f25b --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/src_code/point2.cpp @@ -0,0 +1,43 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +//[point_example2 + struct point { + int x; + int y; + }; + + bool operator==(point const& p1, point const& p2) + { + return p1.x == p2.x && p1.y == p2.y; + } + + std::size_t hash_value(point const& p) { + std::size_t seed = 0; + boost::hash_combine(seed, p.x); + boost::hash_combine(seed, p.y); + return seed; + } + + // Now the default function objects work. + boost::unordered_multiset points; +//] + +int main() { + point x[] = {{1,2}, {3,4}, {1,5}, {1,2}}; + for(int i = 0; i < sizeof(x) / sizeof(point); ++i) + points.insert(x[i]); + BOOST_TEST(points.count(x[0]) == 2); + BOOST_TEST(points.count(x[1]) == 1); + point y = {10, 2}; + BOOST_TEST(points.count(y) == 0); + + return boost::report_errors(); +} + diff --git a/tools/boost_1_65_1/libs/unordered/doc/unordered.qbk b/tools/boost_1_65_1/libs/unordered/doc/unordered.qbk new file mode 100644 index 0000000000000000000000000000000000000000..a12aaa62f29544a4652d69bf54fb8d2bce1fa5f8 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/doc/unordered.qbk @@ -0,0 +1,38 @@ +[/ Copyright 2006-2008 Daniel James. + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] + +[library Boost.Unordered + [quickbook 1.5] + [authors [James, Daniel]] + [copyright 2003 2004 Jeremy B. Maitin-Shepard] + [copyright 2005 2006 2007 2008 Daniel James] + [purpose std::tr1 compliant hash containers] + [id unordered] + [dirname unordered] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[template diagram[name] ''' + + + + + + +'''] + + +[include:unordered intro.qbk] +[include:unordered buckets.qbk] +[include:unordered hash_equality.qbk] +[include:unordered comparison.qbk] +[include:unordered compliance.qbk] +[include:unordered rationale.qbk] +[include:unordered changes.qbk] +[xinclude ref.xml] +[xinclude bibliography.xml] diff --git a/tools/boost_1_65_1/libs/unordered/examples/case_insensitive.hpp b/tools/boost_1_65_1/libs/unordered/examples/case_insensitive.hpp new file mode 100644 index 0000000000000000000000000000000000000000..83a388d87397deacfe16aee3d934c73eccf1c73a --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/examples/case_insensitive.hpp @@ -0,0 +1,58 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This file implements a locale aware case insenstive equality predicate and +// hash function. Unfortunately it still falls short of full +// internationalization as it only deals with a single character at a time +// (some languages have tricky cases where the characters in an upper case +// string don't have a one-to-one correspondence with the lower case version of +// the text, eg. ) + +#if !defined(BOOST_HASH_EXAMPLES_CASE_INSENSITIVE_HEADER) +#define BOOST_HASH_EXAMPLES_CASE_INSENSITIVE_HEADER + +#include +#include + +namespace hash_examples +{ + struct iequal_to + { + iequal_to() {} + explicit iequal_to(std::locale const& l) : locale_(l) {} + + template + bool operator()(String1 const& x1, String2 const& x2) const + { + return boost::algorithm::iequals(x1, x2, locale_); + } + private: + std::locale locale_; + }; + + struct ihash + { + ihash() {} + explicit ihash(std::locale const& l) : locale_(l) {} + + template + std::size_t operator()(String const& x) const + { + std::size_t seed = 0; + + for(typename String::const_iterator it = x.begin(); + it != x.end(); ++it) + { + boost::hash_combine(seed, std::toupper(*it, locale_)); + } + + return seed; + } + private: + std::locale locale_; + }; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/examples/case_insensitive_test.cpp b/tools/boost_1_65_1/libs/unordered/examples/case_insensitive_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee1ed8da8a90eb06c362a81feb856a446071bb0f --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/examples/case_insensitive_test.cpp @@ -0,0 +1,82 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./case_insensitive.hpp" +#include +#include + +struct word_info { + int tag; + explicit word_info(int t = 0) : tag(t) {} +}; + +void test1() { + boost::unordered_map idictionary; + + BOOST_TEST(idictionary.empty()); + + idictionary["one"] = word_info(1); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find("ONE") != idictionary.end() && + idictionary.find("ONE") == idictionary.find("one")); + + idictionary.insert(std::make_pair("ONE", word_info(2))); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find("ONE") != idictionary.end() && + idictionary.find("ONE")->first == "one" && + idictionary.find("ONE")->second.tag == 1); + + idictionary["One"] = word_info(3); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find("ONE") != idictionary.end() && + idictionary.find("ONE")->first == "one" && + idictionary.find("ONE")->second.tag == 3); + + idictionary["two"] = word_info(4); + BOOST_TEST(idictionary.size() == 2); + BOOST_TEST(idictionary.find("two") != idictionary.end() && + idictionary.find("TWO")->first == "two" && + idictionary.find("Two")->second.tag == 4); + + +} + +void test2() { + boost::unordered_map idictionary; + + BOOST_TEST(idictionary.empty()); + + idictionary[L"one"] = word_info(1); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find(L"ONE") != idictionary.end() && + idictionary.find(L"ONE") == idictionary.find(L"one")); + + idictionary.insert(std::make_pair(L"ONE", word_info(2))); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find(L"ONE") != idictionary.end() && + idictionary.find(L"ONE")->first == L"one" && + idictionary.find(L"ONE")->second.tag == 1); + + idictionary[L"One"] = word_info(3); + BOOST_TEST(idictionary.size() == 1); + BOOST_TEST(idictionary.find(L"ONE") != idictionary.end() && + idictionary.find(L"ONE")->first == L"one" && + idictionary.find(L"ONE")->second.tag == 3); + + idictionary[L"two"] = word_info(4); + BOOST_TEST(idictionary.size() == 2); + BOOST_TEST(idictionary.find(L"two") != idictionary.end() && + idictionary.find(L"TWO")->first == L"two" && + idictionary.find(L"Two")->second.tag == 4); +} + +int main() { + test1(); + test2(); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/unordered/examples/fnv1.hpp b/tools/boost_1_65_1/libs/unordered/examples/fnv1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3337d1365c6808fc90b2e82502c23cb6e685ea11 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/examples/fnv1.hpp @@ -0,0 +1,69 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This code is also released into the public domain. + +// Algorithm from: http://www.isthe.com/chongo/tech/comp/fnv/ + +#include + +namespace hash +{ + template + struct basic_fnv_1 + { + std::size_t operator()(std::string const& text) const + { + std::size_t hash = OffsetBasis; + for(std::string::const_iterator it = text.begin(), end = text.end(); + it != end; ++it) + { + hash *= FnvPrime; + hash ^= *it; + } + + return hash; + } + }; + + template + struct basic_fnv_1a + { + std::size_t operator()(std::string const& text) const + { + std::size_t hash = OffsetBasis; + for(std::string::const_iterator it = text.begin(), end = text.end(); + it != end; ++it) + { + hash ^= *it; + hash *= FnvPrime; + } + + return hash; + } + }; + + // For 32 bit machines: + const std::size_t fnv_prime = 16777619u; + const std::size_t fnv_offset_basis = 2166136261u; + + // For 64 bit machines: + // const std::size_t fnv_prime = 1099511628211u; + // const std::size_t fnv_offset_basis = 14695981039346656037u; + + // For 128 bit machines: + // const std::size_t fnv_prime = 309485009821345068724781401u; + // const std::size_t fnv_offset_basis = + // 275519064689413815358837431229664493455u; + + // For 256 bit machines: + // const std::size_t fnv_prime = + // 374144419156711147060143317175368453031918731002211u; + // const std::size_t fnv_offset_basis = + // 100029257958052580907070968620625704837092796014241193945225284501741471925557u; + + typedef basic_fnv_1 fnv_1; + typedef basic_fnv_1a fnv_1a; +} diff --git a/tools/boost_1_65_1/libs/unordered/index.html b/tools/boost_1_65_1/libs/unordered/index.html new file mode 100644 index 0000000000000000000000000000000000000000..a752386cf42035fbca2b4676f505d630e6f6e9f2 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/index.html @@ -0,0 +1,16 @@ + + + + + + + + +Automatic redirection failed, please go to +../../doc/html/unordered.html + + diff --git a/tools/boost_1_65_1/libs/unordered/meta/libraries.json b/tools/boost_1_65_1/libs/unordered/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..1cd5b6ce8866910eb11b75318b52e6182de216f8 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/meta/libraries.json @@ -0,0 +1,17 @@ +{ + "key": "unordered", + "name": "Unordered", + "authors": [ + "Daniel James" + ], + "maintainers": [ + "Daniel James " + ], + "description": "Unordered associative containers.", + "std": [ + "tr1" + ], + "category": [ + "Containers" + ] +} \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/unordered/test/Jamfile.v2 b/tools/boost_1_65_1/libs/unordered/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..e06b569f584967a4114382c7b8a6469c4e1e1b83 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/Jamfile.v2 @@ -0,0 +1,96 @@ + +# Copyright 2006-2008 Daniel James. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +import testing ; + +project unordered-test/unordered + : requirements + all + intel:on + # Would be nice to define -Wundef, but I'm getting warnings from + # Boost.Preprocessor on trunk. + gcc:"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow" + darwin:"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow" + clang:"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wsign-conversion -Wconversion -Wfloat-equal -Wshadow" + msvc:"/wd4494" + gcc:500 + ; + +#alias framework : /boost/test//boost_unit_test_framework ; +alias framework : ; + +test-suite unordered + : + [ run unordered/fwd_set_test.cpp ] + [ run unordered/fwd_map_test.cpp ] + [ run unordered/allocator_traits.cpp ] + [ run unordered/minimal_allocator.cpp ] + [ run unordered/compile_set.cpp ] + [ run unordered/compile_map.cpp ] + [ run unordered/compile_map.cpp : : + : BOOST_UNORDERED_USE_ALLOCATOR_TRAITS=0 + : compile_map_unordered_allocator ] + [ run unordered/noexcept_tests.cpp ] + [ run unordered/link_test_1.cpp unordered/link_test_2.cpp ] + [ run unordered/incomplete_test.cpp ] + [ run unordered/simple_tests.cpp ] + [ run unordered/equivalent_keys_tests.cpp ] + [ run unordered/constructor_tests.cpp ] + [ run unordered/copy_tests.cpp ] + [ run unordered/move_tests.cpp ] + [ run unordered/assign_tests.cpp ] + [ run unordered/insert_tests.cpp ] + [ run unordered/insert_stable_tests.cpp ] + [ run unordered/insert_hint_tests.cpp ] + [ run unordered/emplace_tests.cpp ] + [ run unordered/unnecessary_copy_tests.cpp ] + [ run unordered/erase_tests.cpp : : : BOOST_UNORDERED_SUPPRESS_DEPRECATED ] + [ run unordered/erase_equiv_tests.cpp ] + [ run unordered/extract_tests.cpp ] + [ run unordered/node_handle_tests.cpp ] + [ run unordered/merge_tests.cpp ] + [ compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_MAP : insert_node_type_fail_map ] + [ compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_MULTIMAP : insert_node_type_fail_multimap ] + [ compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_SET : insert_node_type_fail_set ] + [ compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_MULTISET : insert_node_type_fail_multiset ] + [ run unordered/find_tests.cpp ] + [ run unordered/at_tests.cpp ] + [ run unordered/bucket_tests.cpp ] + [ run unordered/load_factor_tests.cpp ] + [ run unordered/rehash_tests.cpp ] + [ run unordered/equality_tests.cpp ] + [ run unordered/swap_tests.cpp ] + [ run unordered/detail_tests.cpp ] + + [ run unordered/compile_set.cpp : : + : BOOST_UNORDERED_USE_MOVE + : bmove_compile_set ] + [ run unordered/compile_map.cpp : : + : BOOST_UNORDERED_USE_MOVE + : bmove_compile_map ] + [ run unordered/copy_tests.cpp : : + : BOOST_UNORDERED_USE_MOVE + : bmove_copy ] + [ run unordered/move_tests.cpp : : + : BOOST_UNORDERED_USE_MOVE + : bmove_move ] + [ run unordered/assign_tests.cpp : : + : BOOST_UNORDERED_USE_MOVE + : bmove_assign ] + ; + +test-suite unordered-exception + : + [ run exception/constructor_exception_tests.cpp framework ] + [ run exception/copy_exception_tests.cpp framework ] + [ run exception/assign_exception_tests.cpp framework ] + [ run exception/move_assign_exception_tests.cpp framework ] + [ run exception/insert_exception_tests.cpp framework ] + [ run exception/erase_exception_tests.cpp framework ] + [ run exception/rehash_exception_tests.cpp framework ] + [ run exception/swap_exception_tests.cpp framework : : : + BOOST_UNORDERED_SWAP_METHOD=2 ] + [ run exception/merge_exception_tests.cpp framework ] + ; diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/assign_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/assign_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cad7fb35bbfdab11976ea1053927e3819c8cd3a8 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/assign_exception_tests.cpp @@ -0,0 +1,185 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" + +#if defined(BOOST_MSVC) +#pragma warning(disable : 4512) // assignment operator could not be generated +#endif + +test::seed_t initialize_seed(12847); + +template struct self_assign_base : public test::exception_base +{ + test::random_values values; + self_assign_base(std::size_t count = 0) : values(count, test::limited_range) + { + } + + typedef T data_type; + T init() const { return T(values.begin(), values.end()); } + + void run(T& x) const + { + x = x; + + DISABLE_EXCEPTIONS; + test::check_container(x, values); + test::check_equivalent_keys(x); + } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const + { + test::check_equivalent_keys(x); + } +}; + +template struct self_assign_test1 : self_assign_base +{ +}; + +template struct self_assign_test2 : self_assign_base +{ + self_assign_test2() : self_assign_base(100) {} +}; + +template struct assign_base : public test::exception_base +{ + test::random_values x_values, y_values; + T x, y; + + typedef BOOST_DEDUCED_TYPENAME T::hasher hasher; + typedef BOOST_DEDUCED_TYPENAME T::key_equal key_equal; + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + assign_base(int tag1, int tag2, float mlf1 = 1.0, float mlf2 = 1.0) + : x_values(), y_values(), + x(0, hasher(tag1), key_equal(tag1), allocator_type(tag1)), + y(0, hasher(tag2), key_equal(tag2), allocator_type(tag2)) + { + x.max_load_factor(mlf1); + y.max_load_factor(mlf2); + } + + typedef T data_type; + T init() const { return T(x); } + + void run(T& x1) const + { + x1 = y; + + DISABLE_EXCEPTIONS; + test::check_container(x1, y_values); + test::check_equivalent_keys(x1); + } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x1) const + { + test::check_equivalent_keys(x1); + + // If the container is empty at the point of the exception, the + // internal structure is hidden, this exposes it, at the cost of + // messing up the data. + if (x_values.size()) { + T& x2 = const_cast(x1); + x2.emplace(*x_values.begin()); + test::check_equivalent_keys(x2); + } + } +}; + +template struct assign_values : assign_base +{ + assign_values(unsigned int count1, unsigned int count2, int tag1, int tag2, + test::random_generator gen = test::default_generator, float mlf1 = 1.0, + float mlf2 = 1.0) + : assign_base(tag1, tag2, mlf1, mlf2) + { + this->x_values.fill(count1, gen); + this->y_values.fill(count2, gen); + this->x.insert(this->x_values.begin(), this->x_values.end()); + this->y.insert(this->y_values.begin(), this->y_values.end()); + } +}; + +template struct assign_test1 : assign_values +{ + assign_test1() : assign_values(0, 0, 0, 0) {} +}; + +template struct assign_test2 : assign_values +{ + assign_test2() : assign_values(60, 0, 0, 0) {} +}; + +template struct assign_test2a : assign_values +{ + assign_test2a() : assign_values(60, 0, 0, 0, test::limited_range) {} +}; + +template struct assign_test3 : assign_values +{ + assign_test3() : assign_values(0, 60, 0, 0) {} +}; + +template struct assign_test3a : assign_values +{ + assign_test3a() : assign_values(0, 60, 0, 0, test::limited_range) {} +}; + +template struct assign_test4 : assign_values +{ + assign_test4() : assign_values(10, 10, 1, 2) {} +}; + +template struct assign_test4a : assign_values +{ + assign_test4a() : assign_values(10, 100, 1, 2) {} +}; + +template struct assign_test4b : assign_values +{ + assign_test4b() : assign_values(10, 100, 1, 2, test::limited_range) {} +}; + +template struct assign_test5 : assign_values +{ + assign_test5() + : assign_values(5, 60, 0, 0, test::default_generator, 1.0f, 0.1f) + { + } +}; + +template struct equivalent_test1 : assign_base +{ + equivalent_test1() : assign_base(0, 0) + { + test::random_values x_values2(10); + this->x_values.insert(x_values2.begin(), x_values2.end()); + this->x_values.insert(x_values2.begin(), x_values2.end()); + test::random_values y_values2(10); + this->y_values.insert(y_values2.begin(), y_values2.end()); + this->y_values.insert(y_values2.begin(), y_values2.end()); + this->x.insert(this->x_values.begin(), this->x_values.end()); + this->y.insert(this->y_values.begin(), this->y_values.end()); + } +}; + +// clang-format off +EXCEPTION_TESTS_REPEAT(5, + (self_assign_test1)(self_assign_test2) + (assign_test1)(assign_test2)(assign_test2a) + (assign_test3)(assign_test3a) + (assign_test4)(assign_test4a)(assign_test4b) + (assign_test5) + (equivalent_test1), + CONTAINER_SEQ) +// clang-format on + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/constructor_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/constructor_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39468054b370a76fb92292d6b7d47ae553f6b4c9 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/constructor_exception_tests.cpp @@ -0,0 +1,211 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/input_iterator.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" + +template inline void avoid_unused_warning(T const&) {} + +test::seed_t initialize_seed(91274); + +struct objects +{ + test::exception::object obj; + test::exception::hash hash; + test::exception::equal_to equal_to; + test::exception::allocator allocator; +}; + +template struct construct_test1 : public objects, test::exception_base +{ + void run() const + { + T x; + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +template struct construct_test2 : public objects, test::exception_base +{ + void run() const + { + T x(300); + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +template struct construct_test3 : public objects, test::exception_base +{ + void run() const + { + T x(0, hash); + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +template struct construct_test4 : public objects, test::exception_base +{ + void run() const + { + T x(0, hash, equal_to); + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +template struct construct_test5 : public objects, test::exception_base +{ + void run() const + { + T x(50, hash, equal_to, allocator); + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +template struct construct_test6 : public objects, test::exception_base +{ + void run() const + { + T x(allocator); + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +template struct range : public test::exception_base +{ + test::random_values values; + + range() : values(5, test::limited_range) {} + range(unsigned int count) : values(count, test::limited_range) {} +}; + +template struct range_construct_test1 : public range, objects +{ + void run() const + { + T x(this->values.begin(), this->values.end()); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct range_construct_test2 : public range, objects +{ + void run() const + { + T x(this->values.begin(), this->values.end(), 0); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct range_construct_test3 : public range, objects +{ + void run() const + { + T x(this->values.begin(), this->values.end(), 0, hash); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct range_construct_test4 : public range, objects +{ + void run() const + { + T x(this->values.begin(), this->values.end(), 100, hash, equal_to); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +// Need to run at least one test with a fairly large number +// of objects in case it triggers a rehash. +template struct range_construct_test5 : public range, objects +{ + range_construct_test5() : range(60) {} + + void run() const + { + T x(this->values.begin(), this->values.end(), 0, hash, equal_to, + allocator); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct input_range_construct_test : public range, objects +{ + input_range_construct_test() : range(60) {} + + void run() const + { + BOOST_DEDUCED_TYPENAME test::random_values::const_iterator + begin = this->values.begin(), + end = this->values.end(); + T x(test::input_iterator(begin), test::input_iterator(end), 0, hash, + equal_to, allocator); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct copy_range_construct_test : public range, objects +{ + copy_range_construct_test() : range(60) {} + + void run() const + { + T x(test::copy_iterator(this->values.begin()), + test::copy_iterator(this->values.end()), 0, hash, equal_to, + allocator); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +EXCEPTION_TESTS( + (construct_test1)(construct_test2)(construct_test3)(construct_test4)( + construct_test5)(construct_test6)(range_construct_test1)( + range_construct_test2)(range_construct_test3)(range_construct_test4)( + range_construct_test5)(input_range_construct_test)( + copy_range_construct_test), + CONTAINER_SEQ) +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/containers.hpp b/tools/boost_1_65_1/libs/unordered/test/exception/containers.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c8ca5a2fe685b6e58d5ceacbb7ff778a6213692c --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/containers.hpp @@ -0,0 +1,44 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../objects/exception.hpp" + +typedef boost::unordered_set > + test_set; +typedef boost::unordered_multiset > + test_multiset; +typedef boost::unordered_map > + test_map; +typedef boost::unordered_multimap > + test_multimap; +typedef boost::unordered_set< + std::pair, + test::exception::hash, test::exception::equal_to, + test::exception::allocator > + test_pair_set; +typedef boost::unordered_multiset< + std::pair, + test::exception::hash, test::exception::equal_to, + test::exception::allocator2 > + test_pair_multiset; + +#define CONTAINER_SEQ (test_set)(test_multiset)(test_map)(test_multimap) +#define CONTAINER_PAIR_SEQ \ + (test_pair_set)(test_pair_multiset)(test_map)(test_multimap) diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/copy_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/copy_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ba6b2bcf753b5c9217751078790e0df3d059944d --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/copy_exception_tests.cpp @@ -0,0 +1,111 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" + +template inline void avoid_unused_warning(T const&) {} + +test::seed_t initialize_seed(73041); + +template struct copy_test1 : public test::exception_base +{ + T x; + + void run() const + { + T y(x); + + DISABLE_EXCEPTIONS; + BOOST_TEST(y.empty()); + test::check_equivalent_keys(y); + } +}; + +template struct copy_test2 : public test::exception_base +{ + test::random_values values; + T x; + + copy_test2() + : values(5, test::limited_range), x(values.begin(), values.end()) + { + } + + void run() const + { + T y(x); + + DISABLE_EXCEPTIONS; + test::check_container(y, this->values); + test::check_equivalent_keys(y); + } +}; + +template struct copy_test3 : public test::exception_base +{ + test::random_values values; + T x; + + copy_test3() : values(100), x(values.begin(), values.end()) {} + + void run() const + { + T y(x); + + DISABLE_EXCEPTIONS; + test::check_container(y, this->values); + test::check_equivalent_keys(y); + } +}; + +template struct copy_test3a : public test::exception_base +{ + test::random_values values; + T x; + + copy_test3a() + : values(100, test::limited_range), x(values.begin(), values.end()) + { + } + + void run() const + { + T y(x); + + DISABLE_EXCEPTIONS; + test::check_container(y, this->values); + test::check_equivalent_keys(y); + } +}; + +template struct copy_with_allocator_test : public test::exception_base +{ + test::random_values values; + T x; + test::exception::allocator allocator; + + copy_with_allocator_test() : values(100), x(values.begin(), values.end()) {} + + void run() const + { + T y(x, allocator); + + DISABLE_EXCEPTIONS; + test::check_container(y, this->values); + test::check_equivalent_keys(y); + } +}; + +// clang-format off +EXCEPTION_TESTS( + (copy_test1)(copy_test2)(copy_test3)(copy_test3a)(copy_with_allocator_test), + CONTAINER_SEQ) +// clang-format on + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/erase_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/erase_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..93e094394e43b08f33eccbdb606adaedb0425df9 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/erase_exception_tests.cpp @@ -0,0 +1,56 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/helpers.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" + +test::seed_t initialize_seed(835193); + +template struct erase_test_base : public test::exception_base +{ + test::random_values values; + erase_test_base(unsigned int count = 5) : values(count, test::limited_range) + { + } + + typedef T data_type; + + data_type init() const { return T(values.begin(), values.end()); } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const + { + std::string scope(test::scope); + + BOOST_TEST(scope.find("hash::") != std::string::npos || + scope.find("equal_to::") != std::string::npos || + scope == "operator==(object, object)"); + + test::check_equivalent_keys(x); + } +}; + +template struct erase_by_key_test1 : public erase_test_base +{ + void run(T& x) const + { + typedef BOOST_DEDUCED_TYPENAME test::random_values::const_iterator + iterator; + + for (iterator it = this->values.begin(), end = this->values.end(); + it != end; ++it) { + x.erase(test::get_key(*it)); + } + + DISABLE_EXCEPTIONS; + BOOST_TEST(x.empty()); + test::check_equivalent_keys(x); + } +}; + +EXCEPTION_TESTS((erase_by_key_test1), CONTAINER_SEQ) +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/insert_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/insert_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d5fc3f109b13e87c597c6028511ea78fcdf2d75f --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/insert_exception_tests.cpp @@ -0,0 +1,415 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include "./containers.hpp" + +#include "../helpers/helpers.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/strong.hpp" +#include "../helpers/tracker.hpp" +#include +#include + +test::seed_t initialize_seed(747373); + +// Fill in a container so that it's about to rehash +template void rehash_prep(T& x) +{ + using namespace std; + typedef BOOST_DEDUCED_TYPENAME T::size_type size_type; + + x.max_load_factor(0.25); + size_type bucket_count = x.bucket_count(); + size_type initial_elements = static_cast( + ceil((double)bucket_count * (double)x.max_load_factor()) - 1); + test::random_values v(initial_elements); + x.insert(v.begin(), v.end()); + BOOST_TEST(bucket_count == x.bucket_count()); +} + +// Overload to generate inserters that need type information. + +template +Inserter generate(Inserter inserter, T&) +{ + return inserter; +} + +// Get the iterator returned from an insert/emplace. + +template T get_iterator(T const& x) { return x; } + +template T get_iterator(std::pair const& x) +{ + return x.first; +} + +// Generic insert exception test for typical single element inserts.. + +template +void insert_exception_test_impl(T x, Inserter insert, Values const& v) +{ + test::strong strong; + + test::ordered tracker; + tracker.insert(x.begin(), x.end()); + + try { + ENABLE_EXCEPTIONS; + + for (typename Values::const_iterator it = v.begin(); it != v.end(); + ++it) { + strong.store(x, test::detail::tracker.count_allocations); + insert(x, it); + } + } catch (...) { + test::check_equivalent_keys(x); + insert.exception_check(x, strong); + throw; + } + + test::check_equivalent_keys(x); + insert.track(tracker, v.begin(), v.end()); + tracker.compare(x); +} + +// Simple insert exception test + +template +void insert_exception_test(T*, Inserter insert, test::random_generator gen) +{ + for (int i = 0; i < 5; ++i) { + test::random_values v(10, gen); + T x; + + EXCEPTION_LOOP(insert_exception_test_impl(x, generate(insert, x), v)); + } +} + +// Insert into a container which is about to hit its max load, so that it +// rehashes. + +template +void insert_rehash_exception_test( + T*, Inserter insert, test::random_generator gen) +{ + for (int i = 0; i < 5; ++i) { + T x; + rehash_prep(x); + + test::random_values v2(5, gen); + EXCEPTION_LOOP(insert_exception_test_impl(x, generate(insert, x), v2)); + } +} + +// Various methods for inserting a single element + +struct inserter_base +{ + template void exception_check(T& x, test::strong& strong) + { + std::string scope(test::scope); + + if (scope.find("hash::operator()") == std::string::npos) + strong.test(x, test::detail::tracker.count_allocations); + } + + template + void track(T& tracker, Iterator begin, Iterator end) + { + tracker.insert(begin, end); + } +}; + +struct insert_lvalue_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.insert(*it); + } +} insert_lvalue; + +struct insert_lvalue_begin_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.insert(x.begin(), *it); + } +} insert_lvalue_begin; + +struct insert_lvalue_end_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.insert(x.end(), *it); + } +} insert_lvalue_end; + +struct insert_lvalue_pos_type +{ + template struct impl : inserter_base + { + typename T::iterator pos; + + impl(T& x) : pos(x.begin()) {} + + template void operator()(T& x, Iterator it) + { + pos = get_iterator(x.insert(pos, *it)); + } + }; + + template friend impl generate(insert_lvalue_pos_type, T& x) + { + return impl(x); + } +} insert_lvalue_pos; + +struct insert_single_item_range_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.insert(it, test::next(it)); + } +} insert_single_item_range; + +struct emplace_lvalue_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.emplace(*it); + } +} emplace_lvalue; + +struct emplace_lvalue_begin_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.emplace_hint(x.begin(), *it); + } +} emplace_lvalue_begin; + +struct emplace_lvalue_end_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.emplace_hint(x.end(), *it); + } +} emplace_lvalue_end; + +struct emplace_lvalue_pos_type +{ + template struct impl : inserter_base + { + typename T::iterator pos; + + impl(T& x) : pos(x.begin()) {} + + template void operator()(T& x, Iterator it) + { + pos = get_iterator(x.emplace_hint(pos, *it)); + } + }; + + template friend impl generate(emplace_lvalue_pos_type, T& x) + { + return impl(x); + } +} emplace_lvalue_pos; + +// Run the exception tests in various combinations. + +test_set* test_set_; +test_multiset* test_multiset_; +test_map* test_map_; +test_multimap* test_multimap_; + +using test::default_generator; +using test::limited_range; +using test::generate_collisions; + +// clang-format off +UNORDERED_TEST(insert_exception_test, + ((test_set_)(test_multiset_)(test_map_)(test_multimap_)) + ((insert_lvalue)(insert_lvalue_begin)(insert_lvalue_end) + (insert_lvalue_pos)(insert_single_item_range) + (emplace_lvalue)(emplace_lvalue_begin)(emplace_lvalue_end) + (emplace_lvalue_pos) + ) + ((default_generator)(limited_range)(generate_collisions)) +) + +UNORDERED_TEST(insert_rehash_exception_test, + ((test_set_)(test_multiset_)(test_map_)(test_multimap_)) + ((insert_lvalue)(insert_lvalue_begin)(insert_lvalue_end) + (insert_lvalue_pos)(insert_single_item_range) + (emplace_lvalue)(emplace_lvalue_begin)(emplace_lvalue_end) + (emplace_lvalue_pos) + ) + ((default_generator)(limited_range)(generate_collisions)) +) +// clang-format on + +// Repeat insert tests with pairs + +struct pair_emplace_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(it->first), boost::make_tuple(it->second)); + } +} pair_emplace; + +struct pair_emplace2_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.emplace_hint(x.begin(), boost::unordered::piecewise_construct, + boost::make_tuple(it->first), + boost::make_tuple(it->second.tag1_, it->second.tag2_)); + } +} pair_emplace2; + +test_pair_set* test_pair_set_; +test_pair_multiset* test_pair_multiset_; + +// clang-format off +UNORDERED_TEST(insert_exception_test, + ((test_pair_set_)(test_pair_multiset_)(test_map_)(test_multimap_)) + ((pair_emplace)(pair_emplace2)) + ((default_generator)(limited_range)(generate_collisions)) +) +UNORDERED_TEST(insert_rehash_exception_test, + ((test_pair_set_)(test_pair_multiset_)(test_map_)(test_multimap_)) + ((pair_emplace)(pair_emplace2)) + ((default_generator)(limited_range)(generate_collisions)) +) +// clang-format on + +// Test inserting using operator[] + +struct try_emplace_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.try_emplace(it->first, it->second); + } +} try_emplace; + +struct try_emplace2_type : inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.try_emplace(it->first, it->second.tag1_, it->second.tag2_); + } +} try_emplace2; + +struct map_inserter_base +{ + template void exception_check(T& x, test::strong& strong) + { + std::string scope(test::scope); + + if (scope.find("hash::operator()") == std::string::npos && + scope.find("::operator=") == std::string::npos) + strong.test(x, test::detail::tracker.count_allocations); + } + + template + void track(T& tracker, Iterator begin, Iterator end) + { + for (; begin != end; ++begin) { + tracker[begin->first] = begin->second; + } + } +}; + +struct map_insert_operator_type : map_inserter_base +{ + template void operator()(T& x, Iterator it) + { + x[it->first] = it->second; + } +} map_insert_operator; + +struct map_insert_or_assign_type : map_inserter_base +{ + template void operator()(T& x, Iterator it) + { + x.insert_or_assign(it->first, it->second); + } +} map_insert_or_assign; + +// clang-format off +UNORDERED_TEST(insert_exception_test, + ((test_map_)) + ((try_emplace)(try_emplace2)(map_insert_operator)(map_insert_or_assign)) + ((default_generator)(limited_range)(generate_collisions)) +) +UNORDERED_TEST(insert_rehash_exception_test, + ((test_map_)) + ((try_emplace)(try_emplace2)(map_insert_operator)(map_insert_or_assign)) + ((default_generator)(limited_range)(generate_collisions)) +) +// clang-format on + +// Range insert tests + +template +void insert_range_exception_test_impl(T x, Values const& v) +{ + test::ordered tracker; + tracker.insert(x.begin(), x.end()); + + try { + ENABLE_EXCEPTIONS; + x.insert(v.begin(), v.end()); + } catch (...) { + test::check_equivalent_keys(x); + throw; + } + + test::check_equivalent_keys(x); + tracker.insert(v.begin(), v.end()); + tracker.compare(x); +} + +template +void insert_range_exception_test(T*, test::random_generator gen) +{ + for (int i = 0; i < 5; ++i) { + test::random_values v(10, gen); + T x; + + EXCEPTION_LOOP(insert_range_exception_test_impl(x, v)); + } +} + +template +void insert_range_rehash_exception_test(T*, test::random_generator gen) +{ + for (int i = 0; i < 5; ++i) { + T x; + rehash_prep(x); + + test::random_values v2(5, gen); + EXCEPTION_LOOP(insert_range_exception_test_impl(x, v2)); + } +} + +// clang-format off +UNORDERED_TEST(insert_range_exception_test, + ((test_set_)(test_multiset_)(test_map_)(test_multimap_)) + ((default_generator)(limited_range)(generate_collisions)) +) + +UNORDERED_TEST(insert_range_rehash_exception_test, + ((test_set_)(test_multiset_)(test_map_)(test_multimap_)) + ((default_generator)(limited_range)(generate_collisions)) +) +// clang-format on + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/merge_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/merge_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48f6b69773187286457f307d78ece2c863c68a23 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/merge_exception_tests.cpp @@ -0,0 +1,103 @@ +#include "../helpers/exception_test.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/metafunctions.hpp" +#include "../helpers/random_values.hpp" +#include "./containers.hpp" + +template void merge_exception_test(T1 x, T2 y) +{ + std::size_t size = x.size() + y.size(); + + try { + ENABLE_EXCEPTIONS; + x.merge(y); + } catch (...) { + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); + throw; + } + + // Not a full check, just want to make sure the merge completed. + BOOST_TEST(size == x.size() + y.size()); + if (y.size()) { + BOOST_TEST(test::has_unique_keys::value); + for (typename T2::iterator it = y.begin(); it != y.end(); ++it) { + BOOST_TEST(x.find(test::get_key(*it)) != x.end()); + } + } + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); +} + +template +void merge_exception_test(T1 const*, T2 const*, std::size_t count12, int tag12, + test::random_generator gen1, test::random_generator gen2) +{ + std::size_t count1 = count12 / 256; + std::size_t count2 = count12 % 256; + int tag1 = tag12 / 256; + int tag2 = tag12 % 256; + test::random_values v1(count1, gen1); + test::random_values v2(count2, gen2); + T1 x(v1.begin(), v1.end(), 0, test::exception::hash(tag1), + test::exception::equal_to(tag1)); + T2 y(v2.begin(), v2.end(), 0, test::exception::hash(tag2), + test::exception::equal_to(tag2)); + + EXCEPTION_LOOP(merge_exception_test(x, y)) +} + +boost::unordered_set >* test_set_; +boost::unordered_multiset >* test_multiset_; +boost::unordered_map >* test_map_; +boost::unordered_multimap >* test_multimap_; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +// clang-format off +UNORDERED_MULTI_TEST(set_merge, merge_exception_test, + ((test_set_)(test_multiset_)) + ((test_set_)(test_multiset_)) + ((0x0000)(0x6400)(0x0064)(0x0a64)(0x3232)) + ((0x0000)(0x0001)(0x0102)) + ((default_generator)(limited_range)) + ((default_generator)(limited_range)) +) +UNORDERED_MULTI_TEST(map_merge, merge_exception_test, + ((test_map_)(test_multimap_)) + ((test_map_)(test_multimap_)) + ((0x0000)(0x6400)(0x0064)(0x0a64)(0x3232)) + ((0x0101)(0x0200)(0x0201)) + ((default_generator)(limited_range)) + ((default_generator)(limited_range)) +) +// Run fewer generate_collisions tests, as they're slow. +UNORDERED_MULTI_TEST(set_merge_collisions, merge_exception_test, + ((test_set_)(test_multiset_)) + ((test_set_)(test_multiset_)) + ((0x0a0a)) + ((0x0202)(0x0100)(0x0201)) + ((generate_collisions)) + ((generate_collisions)) +) +UNORDERED_MULTI_TEST(map_merge_collisions, merge_exception_test, + ((test_map_)(test_multimap_)) + ((test_map_)(test_multimap_)) + ((0x0a0a)) + ((0x0000)(0x0002)(0x0102)) + ((generate_collisions)) + ((generate_collisions)) +) +// clang-format on + +RUN_TESTS_QUIET() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/move_assign_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/move_assign_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5fe909a2d601d9483b2dd03d978742e452e90c26 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/move_assign_exception_tests.cpp @@ -0,0 +1,128 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" + +#if defined(BOOST_MSVC) +#pragma warning( \ + disable : 4512) // move_assignment operator could not be generated +#endif + +test::seed_t initialize_seed(12847); + +template struct move_assign_base : public test::exception_base +{ + test::random_values x_values, y_values; + T x, y; + + typedef BOOST_DEDUCED_TYPENAME T::hasher hasher; + typedef BOOST_DEDUCED_TYPENAME T::key_equal key_equal; + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + move_assign_base(int tag1, int tag2, float mlf1 = 1.0, float mlf2 = 1.0) + : x_values(), y_values(), + x(0, hasher(tag1), key_equal(tag1), allocator_type(tag1)), + y(0, hasher(tag2), key_equal(tag2), allocator_type(tag2)) + { + x.max_load_factor(mlf1); + y.max_load_factor(mlf2); + } + + typedef T data_type; + T init() const { return T(x); } + void run(T& x1) const + { + test::exceptions_enable disable_exceptions(false); + T y1 = y; + disable_exceptions.release(); + x1 = boost::move(y1); + + DISABLE_EXCEPTIONS; + test::check_container(x1, y_values); + test::check_equivalent_keys(x1); + } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x1) const + { + test::check_equivalent_keys(x1); + + // If the container is empty at the point of the exception, the + // internal structure is hidden, this exposes it, at the cost of + // messing up the data. + if (x_values.size()) { + T& x2 = const_cast(x1); + x2.emplace(*x_values.begin()); + test::check_equivalent_keys(x2); + } + } +}; + +template struct move_assign_values : move_assign_base +{ + move_assign_values(unsigned int count1, unsigned int count2, int tag1, + int tag2, float mlf1 = 1.0, float mlf2 = 1.0) + : move_assign_base(tag1, tag2, mlf1, mlf2) + { + this->x_values.fill(count1, test::limited_range); + this->y_values.fill(count2, test::limited_range); + this->x.insert(this->x_values.begin(), this->x_values.end()); + this->y.insert(this->y_values.begin(), this->y_values.end()); + } +}; + +template struct move_assign_test1 : move_assign_values +{ + move_assign_test1() : move_assign_values(0, 0, 0, 0) {} +}; + +template struct move_assign_test2 : move_assign_values +{ + move_assign_test2() : move_assign_values(60, 0, 0, 0) {} +}; + +template struct move_assign_test3 : move_assign_values +{ + move_assign_test3() : move_assign_values(0, 60, 0, 0) {} +}; + +template struct move_assign_test4 : move_assign_values +{ + move_assign_test4() : move_assign_values(10, 10, 1, 2) {} +}; + +template struct move_assign_test4a : move_assign_values +{ + move_assign_test4a() : move_assign_values(10, 100, 1, 2) {} +}; + +template struct move_assign_test5 : move_assign_values +{ + move_assign_test5() : move_assign_values(5, 60, 0, 0, 1.0f, 0.1f) {} +}; + +template struct equivalent_test1 : move_assign_base +{ + equivalent_test1() : move_assign_base(0, 0) + { + test::random_values x_values2(10, test::limited_range); + this->x_values.insert(x_values2.begin(), x_values2.end()); + this->x_values.insert(x_values2.begin(), x_values2.end()); + test::random_values y_values2(10, test::limited_range); + this->y_values.insert(y_values2.begin(), y_values2.end()); + this->y_values.insert(y_values2.begin(), y_values2.end()); + this->x.insert(this->x_values.begin(), this->x_values.end()); + this->y.insert(this->y_values.begin(), this->y_values.end()); + } +}; + +EXCEPTION_TESTS((move_assign_test1)(move_assign_test2)(move_assign_test3)( + move_assign_test4)(move_assign_test4a)(move_assign_test5)( + equivalent_test1), + CONTAINER_SEQ) +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/rehash_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/rehash_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f1386532c2a816803d26fafe6278ca945652611d --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/rehash_exception_tests.cpp @@ -0,0 +1,129 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/strong.hpp" +#include "../helpers/tracker.hpp" +#include + +test::seed_t initialize_seed(3298597); + +template struct rehash_test_base : public test::exception_base +{ + test::random_values values; + unsigned int n; + rehash_test_base(unsigned int count = 100, unsigned int n_ = 0) + : values(count, test::limited_range), n(n_) + { + } + + typedef T data_type; + typedef test::strong strong_type; + + data_type init() const + { + T x(values.begin(), values.end(), n); + return x; + } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION( + T const& x, strong_type const& strong) const + { + std::string scope(test::scope); + + if (scope.find("hash::operator()") == std::string::npos && + scope.find("equal_to::operator()") == std::string::npos && + scope != "operator==(object, object)") + strong.test(x); + + test::check_equivalent_keys(x); + } +}; + +template struct rehash_test0 : rehash_test_base +{ + rehash_test0() : rehash_test_base(0) {} + void run(T& x) const + { + x.rehash(0); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct rehash_test1 : rehash_test_base +{ + rehash_test1() : rehash_test_base(0) {} + void run(T& x) const + { + x.rehash(200); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct rehash_test2 : rehash_test_base +{ + rehash_test2() : rehash_test_base(0, 200) {} + void run(T& x) const + { + x.rehash(0); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct rehash_test3 : rehash_test_base +{ + rehash_test3() : rehash_test_base(10, 0) {} + void run(T& x) const + { + x.rehash(200); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct rehash_test4 : rehash_test_base +{ + rehash_test4() : rehash_test_base(10, 200) {} + void run(T& x) const + { + x.rehash(0); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +template struct rehash_test5 : rehash_test_base +{ + rehash_test5() : rehash_test_base(200, 10) {} + void run(T& x) const + { + x.rehash(0); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } +}; + +EXCEPTION_TESTS((rehash_test0)(rehash_test1)(rehash_test2)(rehash_test3)( + rehash_test4)(rehash_test5), + CONTAINER_SEQ) +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/exception/swap_exception_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/exception/swap_exception_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d8b8112894eabcf5e0c1c0764411f2f959d44494 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/exception/swap_exception_tests.cpp @@ -0,0 +1,144 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "./containers.hpp" + +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" + +#if defined(BOOST_MSVC) +#pragma warning(disable : 4512) // assignment operator could not be generated +#endif + +test::seed_t initialize_seed(9387); + +template struct self_swap_base : public test::exception_base +{ + test::random_values values; + self_swap_base(std::size_t count = 0) : values(count, test::limited_range) + { + } + + typedef T data_type; + T init() const { return T(values.begin(), values.end()); } + + void run(T& x) const + { + x.swap(x); + + DISABLE_EXCEPTIONS; + test::check_container(x, this->values); + test::check_equivalent_keys(x); + } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x) const + { + std::string scope(test::scope); + + // TODO: In C++11 exceptions are only allowed in the swap function. + BOOST_TEST(scope == "hash::hash(hash)" || + scope == "hash::operator=(hash)" || + scope == "equal_to::equal_to(equal_to)" || + scope == "equal_to::operator=(equal_to)"); + + test::check_equivalent_keys(x); + } +}; + +template struct self_swap_test1 : self_swap_base +{ +}; + +template struct self_swap_test2 : self_swap_base +{ + self_swap_test2() : self_swap_base(100) {} +}; + +template struct swap_base : public test::exception_base +{ + const test::random_values x_values, y_values; + const T initial_x, initial_y; + + typedef BOOST_DEDUCED_TYPENAME T::hasher hasher; + typedef BOOST_DEDUCED_TYPENAME T::key_equal key_equal; + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + swap_base(unsigned int count1, unsigned int count2, int tag1, int tag2) + : x_values(count1, test::limited_range), + y_values(count2, test::limited_range), + initial_x(x_values.begin(), x_values.end(), 0, hasher(tag1), + key_equal(tag1), allocator_type(tag1)), + initial_y( + y_values.begin(), y_values.end(), 0, hasher(tag2), + key_equal(tag2), + allocator_type( + T::allocator_type::propagate_on_container_swap::value ? tag2 + : tag1)) + { + } + + struct data_type + { + data_type(T const& x_, T const& y_) : x(x_), y(y_) {} + + T x, y; + }; + + data_type init() const { return data_type(initial_x, initial_y); } + + void run(data_type& d) const + { + try { + d.x.swap(d.y); + } catch (std::runtime_error) { + } + + DISABLE_EXCEPTIONS; + test::check_container(d.x, this->y_values); + test::check_equivalent_keys(d.x); + test::check_container(d.y, this->x_values); + test::check_equivalent_keys(d.y); + } + + void check BOOST_PREVENT_MACRO_SUBSTITUTION(data_type const& d) const + { + std::string scope(test::scope); + + // TODO: In C++11 exceptions are only allowed in the swap function. + BOOST_TEST(scope == "hash::hash(hash)" || + scope == "hash::operator=(hash)" || + scope == "equal_to::equal_to(equal_to)" || + scope == "equal_to::operator=(equal_to)"); + + test::check_equivalent_keys(d.x); + test::check_equivalent_keys(d.y); + } +}; + +template struct swap_test1 : swap_base +{ + swap_test1() : swap_base(0, 0, 0, 0) {} +}; + +template struct swap_test2 : swap_base +{ + swap_test2() : swap_base(60, 0, 0, 0) {} +}; + +template struct swap_test3 : swap_base +{ + swap_test3() : swap_base(0, 60, 0, 0) {} +}; + +template struct swap_test4 : swap_base +{ + swap_test4() : swap_base(10, 10, 1, 2) {} +}; + +EXCEPTION_TESTS((self_swap_test1)(self_swap_test2)(swap_test1)(swap_test2)( + swap_test3)(swap_test4), + CONTAINER_SEQ) +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/check_return_type.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/check_return_type.hpp new file mode 100644 index 0000000000000000000000000000000000000000..83a2d7f8832b7161df4977278d6da613617b6183 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/check_return_type.hpp @@ -0,0 +1,33 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_CHECK_RETURN_TYPE_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_CHECK_RETURN_TYPE_HEADER + +#include +#include +#include + +namespace test { +template struct check_return_type +{ + template static void equals(T2) + { + BOOST_STATIC_ASSERT((boost::is_same::value)); + } + + template static void equals_ref(T2&) + { + BOOST_STATIC_ASSERT((boost::is_same::value)); + } + + template static void convertible(T2) + { + BOOST_STATIC_ASSERT((boost::is_convertible::value)); + } +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/count.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/count.hpp new file mode 100644 index 0000000000000000000000000000000000000000..76248617f43ca5f0e15ae6e627e93e9576fd8068 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/count.hpp @@ -0,0 +1,89 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or move at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_COUNT_HEAD) +#define BOOST_UNORDERED_TEST_HELPERS_COUNT_HEAD + +#include + +namespace test { +struct object_count +{ + int instances; + int constructions; + + object_count() : instances(0), constructions(0) {} + void reset() { *this = object_count(); } + + void construct() + { + ++instances; + ++constructions; + } + + void destruct() + { + if (instances == 0) { + BOOST_ERROR("Unbalanced constructions."); + } else { + --instances; + } + } + + bool operator==(object_count const& x) const + { + return instances == x.instances && constructions == x.constructions; + } + + bool operator!=(object_count const& x) const { return !(*this == x); } + + friend std::ostream& operator<<(std::ostream& out, object_count const& c) + { + out << "[instances: " << c.instances + << ", constructions: " << c.constructions << "]"; + return out; + } +}; + +// This won't be a problem as I'm only using a single compile unit +// in each test (this is actually require by the minimal test +// framework). +// +// boostinspect:nounnamed +namespace { +object_count global_object_count; +} + +struct counted_object +{ + counted_object() { global_object_count.construct(); } + counted_object(counted_object const&) { global_object_count.construct(); } + ~counted_object() { global_object_count.destruct(); } +}; + +struct check_instances +{ + int instances_; + int constructions_; + + check_instances() + : instances_(global_object_count.instances), + constructions_(global_object_count.constructions) + { + } + ~check_instances() + { + BOOST_TEST(global_object_count.instances == instances_); + } + + int instances() const { return global_object_count.instances - instances_; } + int constructions() const + { + return global_object_count.constructions - constructions_; + } +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/equivalent.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/equivalent.hpp new file mode 100644 index 0000000000000000000000000000000000000000..44050a5e31040492d82b307024da15520177c509 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/equivalent.hpp @@ -0,0 +1,95 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TESTS_EQUIVALENT_HEADER) +#define BOOST_UNORDERED_TESTS_EQUIVALENT_HEADER + +#include "./fwd.hpp" +#include "./list.hpp" +#include "./metafunctions.hpp" +#include +#include +#include +#include + +namespace test { +template +bool equivalent_impl(T1 const& x, T2 const& y, base_type) +{ + return x == y; +} + +template +bool equivalent_impl(boost::hash const&, boost::hash const&, derived_type) +{ + return true; +} + +template +bool equivalent_impl( + std::equal_to const&, std::equal_to const&, derived_type) +{ + return true; +} + +template +bool equivalent_impl( + std::pair const& x1, std::pair const& x2, derived_type) +{ + return equivalent_impl(x1.first, x2.first, derived) && + equivalent_impl(x1.second, x2.second, derived); +} + +struct equivalent_type +{ + equivalent_type() {} + + template + bool operator()(T1 const& x, T2 const& y) const + { + return equivalent_impl(x, y, derived); + } +}; + +const equivalent_type equivalent; + +template class unordered_equivalence_tester +{ + BOOST_DEDUCED_TYPENAME Container::size_type size_; + BOOST_DEDUCED_TYPENAME Container::hasher hasher_; + BOOST_DEDUCED_TYPENAME Container::key_equal key_equal_; + float max_load_factor_; + + typedef test::list value_list; + value_list values_; + + public: + unordered_equivalence_tester(Container const& x) + : size_(x.size()), hasher_(x.hash_function()), key_equal_(x.key_eq()), + max_load_factor_(x.max_load_factor()), values_(x.begin(), x.end()) + { + values_.sort(); + } + + bool operator()(Container const& x) const + { + if (!((size_ == x.size()) && + (test::equivalent(hasher_, x.hash_function())) && + (test::equivalent(key_equal_, x.key_eq())) && + (max_load_factor_ == x.max_load_factor()) && + (values_.size() == x.size()))) + return false; + + value_list copy(x.begin(), x.end()); + copy.sort(); + return values_ == copy; + } + + private: + unordered_equivalence_tester(); +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/exception_test.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/exception_test.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7edf8848be8bf7bb373a406d45f1db0a2123fca6 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/exception_test.hpp @@ -0,0 +1,352 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_EXCEPTION_TEST_HEADER) +#define BOOST_UNORDERED_EXCEPTION_TEST_HEADER + +#include "./count.hpp" +#include "./test.hpp" + +#include +#include +#include + +#define UNORDERED_EXCEPTION_TEST_CASE(name, test_func, type) \ + UNORDERED_AUTO_TEST(name) \ + { \ + test_func fixture; \ + ::test::lightweight::exception_safety( \ + fixture, BOOST_STRINGIZE(test_func)); \ + } + +#define UNORDERED_EXCEPTION_TEST_CASE_REPEAT(name, test_func, n, type) \ + UNORDERED_AUTO_TEST(name) \ + { \ + for (unsigned i = 0; i < n; ++i) { \ + test_func fixture; \ + ::test::lightweight::exception_safety( \ + fixture, BOOST_STRINGIZE(test_func)); \ + } \ + } + +#define UNORDERED_EPOINT_IMPL ::test::lightweight::epoint + +#define UNORDERED_EXCEPTION_TEST_POSTFIX RUN_TESTS() + +#define EXCEPTION_TESTS(test_seq, param_seq) \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT( \ + EXCEPTION_TESTS_OP, (test_seq)((1))(param_seq)) + +#define EXCEPTION_TESTS_REPEAT(n, test_seq, param_seq) \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT( \ + EXCEPTION_TESTS_OP, (test_seq)((n))(param_seq)) + +#define EXCEPTION_TESTS_OP(r, product) \ + UNORDERED_EXCEPTION_TEST_CASE_REPEAT( \ + BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, product), \ + BOOST_PP_CAT(_, BOOST_PP_SEQ_ELEM(2, product))), \ + BOOST_PP_SEQ_ELEM(0, product), BOOST_PP_SEQ_ELEM(1, product), \ + BOOST_PP_SEQ_ELEM(2, product)) + +#define UNORDERED_SCOPE(scope_name) \ + for (::test::scope_guard unordered_test_guard( \ + BOOST_STRINGIZE(scope_name)); \ + !unordered_test_guard.dismissed(); unordered_test_guard.dismiss()) + +#define UNORDERED_EPOINT(name) \ + if (::test::exceptions_enabled) { \ + UNORDERED_EPOINT_IMPL(name); \ + } + +#define ENABLE_EXCEPTIONS \ + ::test::exceptions_enable BOOST_PP_CAT(ENABLE_EXCEPTIONS_, __LINE__)(true) + +#define DISABLE_EXCEPTIONS \ + ::test::exceptions_enable BOOST_PP_CAT(ENABLE_EXCEPTIONS_, __LINE__)(false) + +namespace test { +static char const* scope = ""; +bool exceptions_enabled = false; + +class scope_guard +{ + scope_guard& operator=(scope_guard const&); + scope_guard(scope_guard const&); + + char const* old_scope_; + char const* scope_; + bool dismissed_; + + public: + scope_guard(char const* name) + : old_scope_(scope), scope_(name), dismissed_(false) + { + scope = scope_; + } + + ~scope_guard() + { + if (dismissed_) + scope = old_scope_; + } + + void dismiss() { dismissed_ = true; } + + bool dismissed() const { return dismissed_; } +}; + +class exceptions_enable +{ + exceptions_enable& operator=(exceptions_enable const&); + exceptions_enable(exceptions_enable const&); + + bool old_value_; + bool released_; + + public: + exceptions_enable(bool enable) + : old_value_(exceptions_enabled), released_(false) + { + exceptions_enabled = enable; + } + + ~exceptions_enable() + { + if (!released_) { + exceptions_enabled = old_value_; + released_ = true; + } + } + + void release() + { + if (!released_) { + exceptions_enabled = old_value_; + released_ = true; + } + } +}; + +struct exception_base +{ + struct data_type + { + }; + struct strong_type + { + template void store(T const&) {} + template void test(T const&) const {} + }; + data_type init() const { return data_type(); } + void check BOOST_PREVENT_MACRO_SUBSTITUTION() const {} +}; + +template +inline void call_ignore_extra_parameters( + void (T::*fn)() const, T2 const& obj, P1&, P2&) +{ + (obj.*fn)(); +} + +template +inline void call_ignore_extra_parameters( + void (T::*fn)(P1&) const, T2 const& obj, P1& p1, P2&) +{ + (obj.*fn)(p1); +} + +template +inline void call_ignore_extra_parameters( + void (T::*fn)(P1&, P2&) const, T2 const& obj, P1& p1, P2& p2) +{ + (obj.*fn)(p1, p2); +} + +template T const& constant(T const& x) { return x; } + +template class test_runner +{ + Test const& test_; + bool exception_in_check_; + + test_runner(test_runner const&); + test_runner& operator=(test_runner const&); + + public: + test_runner(Test const& t) : test_(t), exception_in_check_(false) {} + void run() + { + DISABLE_EXCEPTIONS; + test::check_instances check; + test::scope = ""; + BOOST_DEDUCED_TYPENAME Test::data_type x(test_.init()); + BOOST_DEDUCED_TYPENAME Test::strong_type strong; + strong.store(x); + try { + ENABLE_EXCEPTIONS; + call_ignore_extra_parameters( + &Test::run, test_, x, strong); + } catch (...) { + try { + DISABLE_EXCEPTIONS; + call_ignore_extra_parameters( + &Test::check, test_, constant(x), constant(strong)); + } catch (...) { + exception_in_check_ = true; + } + throw; + } + } + void end() + { + if (exception_in_check_) { + BOOST_ERROR("Unexcpected exception in test_runner check call."); + } + } +}; + +// Quick exception testing based on lightweight test + +namespace lightweight { +static int iteration; +static int count; + +struct test_exception +{ + char const* name; + test_exception(char const* n) : name(n) {} +}; + +struct test_failure +{ +}; + +void epoint(char const* name) +{ + ++count; + if (count == iteration) { + throw test_exception(name); + } +} + +template void exception_safety(Test const& f, char const* /*name*/) +{ + test_runner runner(f); + + iteration = 0; + bool success = false; + unsigned int failure_count = 0; + char const* error_msg = 0; + do { + int error_count = boost::detail::test_errors(); + ++iteration; + count = 0; + + try { + runner.run(); + success = true; + } catch (test_failure) { + error_msg = "test_failure caught."; + break; + } catch (test_exception e) { + if (error_count != boost::detail::test_errors()) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << "Iteration: " << iteration + << " Error found for epoint: " << e.name << std::endl; + } + } catch (...) { + error_msg = "Unexpected exception."; + break; + } + + if (error_count != boost::detail::test_errors()) { + ++failure_count; + } + } while (!success && failure_count < 5); + + if (error_msg) { + BOOST_ERROR(error_msg); + } + runner.end(); +} + +// +// An alternative way to run exception tests. +// See merge_exception_tests.cpp for an example. + +struct exception_looper +{ + bool success; + unsigned int failure_count; + char const* error_msg; + int error_count; + + exception_looper() : success(false), failure_count(0), error_msg(0) {} + + void start() { iteration = 0; } + + bool loop_condition() const + { + return !error_msg && !success && failure_count < 5; + } + + void start_iteration() + { + error_count = boost::detail::test_errors(); + ++iteration; + count = 0; + } + + void successful_run() { success = true; } + + void test_failure_caught(test_failure const&) + { + error_msg = "test_failure caught."; + } + + void test_exception_caught(test_exception const& e) + { + if (error_count != boost::detail::test_errors()) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << "Iteration: " << iteration + << " Error found for epoint: " << e.name << std::endl; + } + } + + void unexpected_exception_caught() { error_msg = "Unexpected exception."; } + + void end() + { + if (error_msg) { + BOOST_ERROR(error_msg); + } + } +}; + +#define EXCEPTION_LOOP(op) \ + test::lightweight::exception_looper looper; \ + looper.start(); \ + while (looper.loop_condition()) { \ + looper.start_iteration(); \ + try { \ + op; \ + looper.successful_run(); \ + } catch (test::lightweight::test_failure e) { \ + looper.test_failure_caught(e); \ + } catch (test::lightweight::test_exception e) { \ + looper.test_exception_caught(e); \ + } catch (...) { \ + looper.unexpected_exception_caught(); \ + } \ + } \ + looper.end(); +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/fwd.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/fwd.hpp new file mode 100644 index 0000000000000000000000000000000000000000..29b2e8ccede02ee4959472a390bb979fa36d186e --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/fwd.hpp @@ -0,0 +1,32 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_FWD_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_FWD_HEADER + +#include + +namespace test { +typedef enum { + default_generator, + generate_collisions, + limited_range +} random_generator; + +int generate(int const*, random_generator); +char generate(char const*, random_generator); +signed char generate(signed char const*, random_generator); +std::string generate(std::string const*, random_generator); +float generate(float const*, random_generator); + +struct base_type +{ +} base; +struct derived_type : base_type +{ +} derived; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/generators.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/generators.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8d5abaa57046d9e931279f76268b139fb2efe234 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/generators.hpp @@ -0,0 +1,94 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This uses std::rand to generate random values for tests. +// Which is not good as different platforms will be running different tests. +// It would be much better to use Boost.Random, but it doesn't +// support all the compilers that I want to test on. + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_GENERATORS_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_GENERATORS_HEADER + +#include "./fwd.hpp" +#include +#include +#include +#include +#include + +namespace test { +struct seed_t +{ + seed_t(unsigned int x) + { + using namespace std; + srand(x); + } +}; + +std::size_t random_value(std::size_t max) +{ + using namespace std; + return static_cast(rand()) % max; +} + +inline int generate(int const*, random_generator g) +{ + using namespace std; + int value = rand(); + if (g == limited_range) { + value = value % 100; + } + return value; +} + +inline char generate(char const*, random_generator) +{ + using namespace std; + return static_cast((rand() >> 1) % (128 - 32) + 32); +} + +inline signed char generate(signed char const*, random_generator) +{ + using namespace std; + return static_cast(rand()); +} + +inline std::string generate(std::string const*, random_generator g) +{ + using namespace std; + + char* char_ptr = 0; + + std::string result; + + if (g == limited_range) { + std::size_t length = test::random_value(2) + 2; + + char const* strings[] = {"'vZh(3~ms", "%m", "_Y%U", "N'Y", "4,J_J"}; + for (std::size_t i = 0; i < length; ++i) { + result += + strings[random_value(sizeof(strings) / sizeof(strings[0]))]; + } + } else { + std::size_t length = test::random_value(10) + 1; + for (std::size_t i = 0; i < length; ++i) { + result += generate(char_ptr, g); + } + } + + return result; +} + +float generate(float const*, random_generator g) +{ + using namespace std; + int x = 0; + int value = generate(&x, g); + return (float)value / (float)RAND_MAX; +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/helpers.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/helpers.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a1453fe52ac8cf8ded601f5f9200bf53cdb52aa7 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/helpers.hpp @@ -0,0 +1,53 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_HEADER + +namespace test { +template struct get_key_impl +{ + typedef BOOST_DEDUCED_TYPENAME Container::key_type key_type; + + static key_type const& get_key(key_type const& x) { return x; } + + template + static key_type const& get_key(std::pair const& x, char = 0) + { + return x.first; + } + + template + static key_type const& get_key( + std::pair const& x, unsigned char = 0) + { + return x.first; + } +}; + +template +inline BOOST_DEDUCED_TYPENAME Container::key_type const& get_key(T const& x) +{ + return get_key_impl::get_key(x); +} + +// test::next +// +// Increments an iterator by 1 or a given value. +// Like boost::next, but simpler and slower. + +template Iterator next(Iterator it) { return ++it; } + +template +Iterator next(Iterator it, IntType x) +{ + for (; x > 0; --x) { + ++it; + } + return it; +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/input_iterator.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/input_iterator.hpp new file mode 100644 index 0000000000000000000000000000000000000000..146ec7a45de35184acccec47fc519b695055c0f4 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/input_iterator.hpp @@ -0,0 +1,173 @@ + +// Copyright 2005-2010 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_INPUT_ITERATOR_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_INPUT_ITERATOR_HEADER + +#include +#include +#include + +namespace test { +template struct proxy +{ + typedef BOOST_DEDUCED_TYPENAME Iterator::value_type value_type; + + explicit proxy(value_type const& v) : v_(v) {} + proxy(proxy const& x) : v_(x.v_) {} + operator value_type const&() const { return v_; } + + value_type v_; + + private: + proxy& operator=(proxy const&); +}; + +template +struct input_iterator_adaptor + : public std::iterator::type, + std::ptrdiff_t, + BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type, + proxy > +{ + typedef BOOST_DEDUCED_TYPENAME boost::iterator_value::type + value_type; + + input_iterator_adaptor() : base_() {} + explicit input_iterator_adaptor(Iterator& it) : base_(&it) {} + proxy operator*() const { return proxy(**base_); } + value_type* operator->() const { return &**base_; } + input_iterator_adaptor& operator++() + { + ++*base_; + return *this; + } + // input_iterator_adaptor operator++(int) { + //} + bool operator==(input_iterator_adaptor const& x) const + { + return *base_ == *x.base_; + } + bool operator!=(input_iterator_adaptor const& x) const + { + return *base_ != *x.base_; + } + + private: + Iterator* base_; +}; + +template +input_iterator_adaptor input_iterator(Iterator& it) +{ + return input_iterator_adaptor(it); +} + +template +struct copy_iterator_adaptor + : public std::iterator< + BOOST_DEDUCED_TYPENAME boost::iterator_category::type, + BOOST_DEDUCED_TYPENAME boost::iterator_value::type, + BOOST_DEDUCED_TYPENAME boost::iterator_difference::type, + BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type, + proxy > +{ + typedef BOOST_DEDUCED_TYPENAME boost::iterator_value::type + value_type; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference::type + difference_type; + + copy_iterator_adaptor() : base_() {} + explicit copy_iterator_adaptor(Iterator const& it) : base_(it) {} + value_type operator*() const { return *base_; } + value_type* operator->() const { return &*base_; } + value_type operator[](difference_type d) { return base_[d]; } + copy_iterator_adaptor& operator++() + { + ++base_; + return *this; + } + copy_iterator_adaptor operator++(int) + { + copy_iterator_adaptor tmp(*this); + ++base_; + return tmp; + } + copy_iterator_adaptor& operator--() + { + --base_; + return *this; + } + copy_iterator_adaptor operator--(int) + { + copy_iterator_adaptor tmp(*this); + --base_; + return tmp; + } + copy_iterator_adaptor operator+=(difference_type x) + { + base_ += x; + return *this; + } + copy_iterator_adaptor operator-=(difference_type x) + { + base_ -= x; + return *this; + } + copy_iterator_adaptor operator+(difference_type n) + { + return copy_iterator_adaptor(base_ + n); + } + copy_iterator_adaptor operator-(difference_type n) + { + return copy_iterator_adaptor(base_ - n); + } + friend copy_iterator_adaptor operator+( + difference_type n, copy_iterator_adaptor x) + { + return x + n; + } + difference_type operator-(copy_iterator_adaptor const& other) + { + return base_ - other.base_; + } + bool operator==(copy_iterator_adaptor const& x) const + { + return base_ == x.base_; + } + bool operator!=(copy_iterator_adaptor const& x) const + { + return base_ != x.base_; + } + bool operator<(copy_iterator_adaptor const& x) const + { + return base_ < x.base_; + } + bool operator>(copy_iterator_adaptor const& x) const + { + return base_ > x.base_; + } + bool operator<=(copy_iterator_adaptor const& x) const + { + return base_ <= x.base_; + } + bool operator>=(copy_iterator_adaptor const& x) const + { + return base_ >= x.base_; + } + + private: + Iterator base_; +}; + +template +copy_iterator_adaptor copy_iterator(Iterator const& it) +{ + return copy_iterator_adaptor(it); +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/invariants.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/invariants.hpp new file mode 100644 index 0000000000000000000000000000000000000000..06091b9404c1bb77894bf7972acb9f93a9182698 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/invariants.hpp @@ -0,0 +1,133 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This header contains metafunctions/functions to get the equivalent +// associative container for an unordered container, and compare the contents. + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_INVARIANT_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_INVARIANT_HEADER + +#include "./helpers.hpp" +#include "./metafunctions.hpp" +#include +#include + +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable : 4127) // conditional expression is constant +#pragma warning(disable : 4267) // conversion from 'size_t' to 'unsigned int', + // possible loss of data +#endif + +namespace test { +template void check_equivalent_keys(X const& x1) +{ + BOOST_DEDUCED_TYPENAME X::key_equal eq = x1.key_eq(); + typedef BOOST_DEDUCED_TYPENAME X::key_type key_type; + std::set > found_; + + BOOST_DEDUCED_TYPENAME X::const_iterator it = x1.begin(), end = x1.end(); + BOOST_DEDUCED_TYPENAME X::size_type size = 0; + while (it != end) { + // First test that the current key has not occurred before, required + // to test either that keys are unique or that equivalent keys are + // adjacent. (6.3.1/6) + key_type key = get_key(*it); + if (!found_.insert(key).second) + BOOST_ERROR("Elements with equivalent keys aren't adjacent."); + + // Iterate over equivalent keys, counting them. + unsigned int count = 0; + do { + ++it; + ++count; + ++size; + } while (it != end && eq(get_key(*it), key)); + + // If the container has unique keys, test that there's only one. + // Since the previous test makes sure that all equivalent keys are + // adjacent, this is all the equivalent keys - so the test is + // sufficient. (6.3.1/6 again). + if (test::has_unique_keys::value && count != 1) + BOOST_ERROR("Non-unique key."); + + if (x1.count(key) != count) { + BOOST_ERROR("Incorrect output of count."); + std::cerr << x1.count(key) << "," << count << "\n"; + } + + // Check that the keys are in the correct bucket and are + // adjacent in the bucket. + BOOST_DEDUCED_TYPENAME X::size_type bucket = x1.bucket(key); + BOOST_DEDUCED_TYPENAME X::const_local_iterator lit = x1.begin(bucket), + lend = x1.end(bucket); + + unsigned int count_checked = 0; + for (; lit != lend && !eq(get_key(*lit), key); ++lit) { + ++count_checked; + } + + if (lit == lend) { + BOOST_ERROR("Unable to find element with a local_iterator"); + std::cerr << "Checked: " << count_checked << " elements" + << std::endl; + } else { + unsigned int count2 = 0; + for (; lit != lend && eq(get_key(*lit), key); ++lit) + ++count2; + if (count != count2) + BOOST_ERROR("Element count doesn't match local_iterator."); + for (; lit != lend; ++lit) { + if (eq(get_key(*lit), key)) { + BOOST_ERROR("Non-adjacent element with equivalent key " + "in bucket."); + break; + } + } + } + }; + + // Check that size matches up. + + if (x1.size() != size) { + BOOST_ERROR("x1.size() doesn't match actual size."); + std::cout << x1.size() << "/" << size << std::endl; + } + + // Check the load factor. + + float load_factor = + size == 0 ? 0 : static_cast(size) / + static_cast(x1.bucket_count()); + using namespace std; + if (fabs(x1.load_factor() - load_factor) > x1.load_factor() / 64) + BOOST_ERROR("x1.load_factor() doesn't match actual load_factor."); + + // Check that size in the buckets matches up. + + BOOST_DEDUCED_TYPENAME X::size_type bucket_size = 0; + + for (BOOST_DEDUCED_TYPENAME X::size_type i = 0; i < x1.bucket_count(); + ++i) { + for (BOOST_DEDUCED_TYPENAME X::const_local_iterator + begin2 = x1.begin(i), + end2 = x1.end(i); + begin2 != end2; ++begin2) { + ++bucket_size; + } + } + + if (x1.size() != bucket_size) { + BOOST_ERROR("x1.size() doesn't match bucket size."); + std::cout << x1.size() << "/" << bucket_size << std::endl; + } +} +} + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/list.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/list.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3453706cdddb6b92cc682c38cae603073174879a --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/list.hpp @@ -0,0 +1,320 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Gratuitous single linked list. +// +// Sadly some STL implementations aren't up to scratch and I need a simple +// cross-platform container. So here it is. + +#if !defined(UNORDERED_TEST_LIST_HEADER) +#define UNORDERED_TEST_LIST_HEADER + +#include +#include +#include + +namespace test { +template +bool equal(It1 begin, It1 end, It2 compare) +{ + for (; begin != end; ++begin, ++compare) + if (*begin != *compare) + return false; + return true; +} + +template +bool equal(It1 begin, It1 end, It2 compare, Pred predicate) +{ + for (; begin != end; ++begin, ++compare) + if (!predicate(*begin, *compare)) + return false; + return true; +} + +template class list; + +namespace test_detail { +template class list_node; +template class list_data; +template class list_iterator; +template class list_const_iterator; + +template class list_node +{ + list_node(list_node const&); + list_node& operator=(list_node const&); + + public: + T value_; + list_node* next_; + + list_node(T const& v) : value_(v), next_(0) {} + list_node(T const& v, list_node* n) : value_(v), next_(n) {} +}; + +template class list_data +{ + public: + typedef list_node node; + typedef unsigned int size_type; + + node* first_; + node** last_ptr_; + size_type size_; + + list_data() : first_(0), last_ptr_(&first_), size_(0) {} + + ~list_data() + { + while (first_) { + node* tmp = first_; + first_ = first_->next_; + delete tmp; + } + } + + private: + list_data(list_data const&); + list_data& operator=(list_data const&); +}; + +template +class list_iterator + : public std::iterator +{ + friend class list_const_iterator; + friend class test::list; + typedef list_node node; + typedef list_const_iterator const_iterator; + + node* ptr_; + + public: + list_iterator() : ptr_(0) {} + explicit list_iterator(node* x) : ptr_(x) {} + + T& operator*() const { return ptr_->value_; } + T* operator->() const { return &ptr_->value_; } + list_iterator& operator++() + { + ptr_ = ptr_->next_; + return *this; + } + list_iterator operator++(int) + { + list_iterator tmp = *this; + ptr_ = ptr_->next_; + return tmp; + } + bool operator==(const_iterator y) const { return ptr_ == y.ptr_; } + bool operator!=(const_iterator y) const { return ptr_ != y.ptr_; } +}; + +template +class list_const_iterator : public std::iterator +{ + friend class list_iterator; + friend class test::list; + typedef list_node node; + typedef list_iterator iterator; + typedef list_const_iterator const_iterator; + + node* ptr_; + + public: + list_const_iterator() : ptr_(0) {} + list_const_iterator(list_iterator const& x) : ptr_(x.ptr_) {} + + T const& operator*() const { return ptr_->value_; } + T const* operator->() const { return &ptr_->value_; } + + list_const_iterator& operator++() + { + ptr_ = ptr_->next_; + return *this; + } + + list_const_iterator operator++(int) + { + list_const_iterator tmp = *this; + ptr_ = ptr_->next_; + return tmp; + } + + bool operator==(const_iterator y) const { return ptr_ == y.ptr_; } + + bool operator!=(const_iterator y) const { return ptr_ != y.ptr_; } +}; +} + +template class list +{ + typedef test::test_detail::list_data data; + typedef test::test_detail::list_node node; + data data_; + + public: + typedef T value_type; + typedef value_type& reference; + typedef value_type const& const_reference; + typedef unsigned int size_type; + + typedef test::test_detail::list_iterator iterator; + typedef test::test_detail::list_const_iterator const_iterator; + + list() : data_() {} + + list(list const& other) : data_() { insert(other.begin(), other.end()); } + + template + list(InputIterator i, InputIterator j) : data_() + { + insert(i, j); + } + + list& operator=(list const& other) + { + clear(); + insert(other.begin(), other.end()); + return *this; + } + + iterator begin() { return iterator(data_.first_); } + iterator end() { return iterator(); } + const_iterator begin() const { return iterator(data_.first_); } + const_iterator end() const { return iterator(); } + const_iterator cbegin() const { return iterator(data_.first_); } + const_iterator cend() const { return iterator(); } + + template void insert(InputIterator i, InputIterator j) + { + for (; i != j; ++i) + push_back(*i); + } + + void push_front(value_type const& v) + { + data_.first_ = new node(v, data_.first_); + if (!data_.size_) + data_.last_ptr_ = &(*data_.last_ptr_)->next_; + ++data_.size_; + } + + void push_back(value_type const& v) + { + *data_.last_ptr_ = new node(v); + data_.last_ptr_ = &(*data_.last_ptr_)->next_; + ++data_.size_; + } + + void clear() + { + while (data_.first_) { + node* tmp = data_.first_; + data_.first_ = data_.first_->next_; + --data_.size_; + delete tmp; + } + data_.last_ptr_ = &data_.first_; + } + + void erase(const_iterator i, const_iterator j) + { + node** ptr = &data_.first_; + + while (*ptr != i.ptr_) { + ptr = &(*ptr)->next_; + } + + while (*ptr != j.ptr_) { + node* to_delete = *ptr; + *ptr = (*ptr)->next_; + --data_.size_; + delete to_delete; + } + + if (!*ptr) + data_.last_ptr_ = ptr; + } + + bool empty() const { return !data_.size_; } + + size_type size() const { return data_.size_; } + + void sort() { sort(std::less()); } + + template void sort(Less less = Less()) + { + if (!empty()) + merge_sort( + &data_.first_, (std::numeric_limits::max)(), less); + } + + bool operator==(list const& y) const + { + return size() == y.size() && test::equal(begin(), end(), y.begin()); + } + + bool operator!=(list const& y) const { return !(*this == y); } + + private: + template + node** merge_sort(node** l, size_type recurse_limit, Less less) + { + node** ptr = &(*l)->next_; + for (size_type count = 0; count < recurse_limit && *ptr; ++count) { + ptr = merge_adjacent_ranges( + l, ptr, merge_sort(ptr, count, less), less); + } + return ptr; + } + + template + node** merge_adjacent_ranges( + node** first, node** second, node** third, Less less) + { + for (;;) { + for (;;) { + if (first == second) + return third; + if (less((*second)->value_, (*first)->value_)) + break; + first = &(*first)->next_; + } + + swap_adjacent_ranges(first, second, third); + first = &(*first)->next_; + + // Since the two ranges we just swapped, the order is now: + // first...third...second + + for (;;) { + if (first == third) + return second; + if (!less((*first)->value_, (*third)->value_)) + break; + first = &(*first)->next_; + } + + swap_adjacent_ranges(first, third, second); + first = &(*first)->next_; + } + } + + void swap_adjacent_ranges(node** first, node** second, node** third) + { + node* tmp = *first; + *first = *second; + *second = *third; + *third = tmp; + if (!*second) + data_.last_ptr_ = second; + } +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/memory.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/memory.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2f91067637466cfd2463b6ed687f22a5467df9bf --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/memory.hpp @@ -0,0 +1,189 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_MEMORY_HEADER) +#define BOOST_UNORDERED_TEST_MEMORY_HEADER + +#include "../helpers/test.hpp" +#include +#include +#include +#include + +namespace test { +namespace detail { +struct memory_area +{ + void const* start; + void const* end; + + memory_area(void const* s, void const* e) : start(s), end(e) + { + BOOST_ASSERT(start != end); + } +}; + +struct memory_track +{ + explicit memory_track(int tag = -1) : constructed_(0), tag_(tag) {} + + int constructed_; + int tag_; +}; + +// This is a bit dodgy as it defines overlapping +// areas as 'equal', so this isn't a total ordering. +// But it is for non-overlapping memory regions - which +// is what'll be stored. +// +// All searches will be for areas entirely contained by +// a member of the set - so it should find the area that contains +// the region that is searched for. + +struct memory_area_compare +{ + bool operator()(memory_area const& x, memory_area const& y) const + { + return x.end <= y.start; + } +}; + +struct memory_tracker +{ + typedef std::map > > + allocated_memory_type; + + allocated_memory_type allocated_memory; + unsigned int count_allocators; + unsigned int count_allocations; + unsigned int count_constructions; + bool tracking_constructions; + + memory_tracker() + : count_allocators(0), count_allocations(0), count_constructions(0), + tracking_constructions(true) + { + } + + ~memory_tracker() { BOOST_TEST(count_allocators == 0); } + + void allocator_ref() + { + if (count_allocators == 0) { + count_allocations = 0; + count_constructions = 0; + allocated_memory.clear(); + } + ++count_allocators; + } + + void allocator_unref() + { + BOOST_TEST(count_allocators > 0); + if (count_allocators > 0) { + --count_allocators; + if (count_allocators == 0) { + bool no_allocations_left = (count_allocations == 0); + bool no_constructions_left = (count_constructions == 0); + bool allocated_memory_empty = allocated_memory.empty(); + + // Clearing the data before the checks terminate the + // tests. + count_allocations = 0; + count_constructions = 0; + allocated_memory.clear(); + + BOOST_TEST(no_allocations_left); + BOOST_TEST(no_constructions_left); + BOOST_TEST(allocated_memory_empty); + } + } + } + + void track_allocate(void* ptr, std::size_t n, std::size_t size, int tag) + { + if (n == 0) { + BOOST_ERROR("Allocating 0 length array."); + } else { + ++count_allocations; + allocated_memory.insert(std::pair( + memory_area(ptr, (char*)ptr + n * size), memory_track(tag))); + } + } + + void track_deallocate(void* ptr, std::size_t n, std::size_t size, int tag, + bool check_tag_ = true) + { + allocated_memory_type::iterator pos = + allocated_memory.find(memory_area(ptr, (char*)ptr + n * size)); + if (pos == allocated_memory.end()) { + BOOST_ERROR("Deallocating unknown pointer."); + } else { + BOOST_TEST(pos->first.start == ptr); + BOOST_TEST(pos->first.end == (char*)ptr + n * size); + if (check_tag_) + BOOST_TEST(pos->second.tag_ == tag); + allocated_memory.erase(pos); + } + BOOST_TEST(count_allocations > 0); + if (count_allocations > 0) + --count_allocations; + } + + void track_construct(void* /*ptr*/, std::size_t /*size*/, int /*tag*/) + { + if (tracking_constructions) { + ++count_constructions; + } + } + + void track_destroy(void* /*ptr*/, std::size_t /*size*/, int /*tag*/) + { + if (tracking_constructions) { + BOOST_TEST(count_constructions > 0); + if (count_constructions > 0) + --count_constructions; + } + } +}; +} + +namespace detail { +// This won't be a problem as I'm only using a single compile unit +// in each test (this is actually required by the minimal test +// framework). +// +// boostinspect:nounnamed +namespace { +test::detail::memory_tracker tracker; +} +} + +namespace detail { +struct disable_construction_tracking +{ + bool old_value; + + disable_construction_tracking() + : old_value(detail::tracker.tracking_constructions) + { + test::detail::tracker.tracking_constructions = false; + } + + ~disable_construction_tracking() + { + test::detail::tracker.tracking_constructions = old_value; + } + + private: + disable_construction_tracking(disable_construction_tracking const&); + disable_construction_tracking& operator=( + disable_construction_tracking const&); +}; +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/metafunctions.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/metafunctions.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c7e2a26ac8f95a6c2647aacd70d2b2cbb275d605 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/metafunctions.hpp @@ -0,0 +1,34 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_METAFUNCTIONS_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_METAFUNCTIONS_HEADER + +#include +#include + +namespace test { +template +struct is_set + : public boost::is_same +{ +}; + +template struct has_unique_keys +{ + static char flip(BOOST_DEDUCED_TYPENAME Container::iterator const&); + static long flip( + std::pair const&); + BOOST_STATIC_CONSTANT(bool, + value = sizeof(long) == + sizeof(flip( + ((Container*)0) + ->insert(*( + BOOST_DEDUCED_TYPENAME Container::value_type*)0)))); +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/postfix.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/postfix.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ca14ae71be5fd3488bbcc12e4e1ecbe2f2d24867 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/postfix.hpp @@ -0,0 +1,10 @@ + +// Copyright 2012 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Include this after the boost headers, but before other test headers. + +#if defined(__GNUC__) +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/prefix.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/prefix.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fe75702509aa9fd27591aaf4d71ab9a8eef58ca9 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/prefix.hpp @@ -0,0 +1,11 @@ + +// Copyright 2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if defined(_WIN32_WCE) +// The standard windows mobile headers trigger this warning so I disable it +// before doing anything else. +#pragma warning(disable : 4201) // nonstandard extension used : + // nameless struct/union +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/random_values.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/random_values.hpp new file mode 100644 index 0000000000000000000000000000000000000000..65772dbaf3b37f3b23b7c7ee456d3163bfe4c0f9 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/random_values.hpp @@ -0,0 +1,109 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_RANDOM_VALUES_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_RANDOM_VALUES_HEADER + +#include "./generators.hpp" +#include "./list.hpp" +#include "./metafunctions.hpp" +#include +#include + +namespace test { +template struct unordered_generator_set +{ + typedef BOOST_DEDUCED_TYPENAME X::value_type value_type; + + random_generator type_; + + unordered_generator_set(random_generator type) : type_(type) {} + + template void fill(T& x, std::size_t len) + { + value_type* value_ptr = 0; + len += x.size(); + + for (std::size_t i = 0; i < len; ++i) { + value_type value = generate(value_ptr, type_); + + std::size_t count = + type_ == generate_collisions ? random_value(5) + 1 : 1; + + for (std::size_t j = 0; j < count; ++j) { + x.push_back(value); + } + } + } +}; + +template struct unordered_generator_map +{ + typedef BOOST_DEDUCED_TYPENAME X::key_type key_type; + typedef BOOST_DEDUCED_TYPENAME X::mapped_type mapped_type; + + random_generator type_; + + unordered_generator_map(random_generator type) : type_(type) {} + + template void fill(T& x, std::size_t len) + { + key_type* key_ptr = 0; + mapped_type* mapped_ptr = 0; + + for (std::size_t i = 0; i < len; ++i) { + key_type key = generate(key_ptr, type_); + + std::size_t count = + type_ == generate_collisions ? random_value(5) + 1 : 1; + + for (std::size_t j = 0; j < count; ++j) { + x.push_back(std::pair( + key, generate(mapped_ptr, type_))); + } + } + } +}; + +template +struct unordered_generator_base + : public boost::detail::if_true::value>:: + BOOST_NESTED_TEMPLATE then, + test::unordered_generator_map > +{ +}; + +template +struct unordered_generator : public unordered_generator_base::type +{ + typedef BOOST_DEDUCED_TYPENAME unordered_generator_base::type base; + + unordered_generator(random_generator const& type = default_generator) + : base(type) + { + } +}; + +template +struct random_values : public test::list +{ + random_values() {} + + explicit random_values(std::size_t count, + test::random_generator const& generator = test::default_generator) + { + fill(count, generator); + } + + void fill(std::size_t count, + test::random_generator const& generator = test::default_generator) + { + test::unordered_generator gen(generator); + gen.fill(*this, count); + } +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/strong.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/strong.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0fc3d58cf7aaccca14603a4735d390ceb52fddb4 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/strong.hpp @@ -0,0 +1,43 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_STRONG_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_STRONG_HEADER + +#include "./equivalent.hpp" +#include "./exception_test.hpp" +#include "./list.hpp" +#include +#include + +namespace test { +template class strong +{ + typedef test::list values_type; + values_type values_; + unsigned int allocations_; + + public: + void store(X const& x, unsigned int allocations = 0) + { + DISABLE_EXCEPTIONS; + values_.clear(); + values_.insert(x.cbegin(), x.cend()); + allocations_ = allocations; + } + + void test(X const& x, unsigned int allocations = 0) const + { + if (!(x.size() == values_.size() && + test::equal( + x.cbegin(), x.cend(), values_.begin(), test::equivalent))) + BOOST_ERROR("Strong exception safety failure."); + if (allocations != allocations_) + BOOST_ERROR("Strong exception failure: extra allocations."); + } +}; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/test.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/test.hpp new file mode 100644 index 0000000000000000000000000000000000000000..eaaa83f154f4ecc3918cf8a5a3774185a8392459 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/test.hpp @@ -0,0 +1,205 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_TEST_HEADER) +#define BOOST_UNORDERED_TEST_TEST_HEADER + +#include +#include +#include + +#define UNORDERED_AUTO_TEST(x) \ + struct BOOST_PP_CAT(x, _type) : public ::test::registered_test_base \ + { \ + BOOST_PP_CAT(x, _type) \ + () : ::test::registered_test_base(BOOST_PP_STRINGIZE(x)) \ + { \ + ::test::get_state().add_test(this); \ + } \ + void run(); \ + }; \ + BOOST_PP_CAT(x, _type) x; \ + void BOOST_PP_CAT(x, _type)::run() + +#define RUN_TESTS() \ + int main(int, char**) \ + { \ + BOOST_UNORDERED_TEST_COMPILER_INFO() \ + ::test::get_state().run_tests(); \ + return boost::report_errors(); \ + } + +#define RUN_TESTS_QUIET() \ + int main(int, char**) \ + { \ + BOOST_UNORDERED_TEST_COMPILER_INFO() \ + ::test::get_state().run_tests(true); \ + return boost::report_errors(); \ + } + +#define UNORDERED_SUB_TEST(x) \ + for (int UNORDERED_SUB_TEST_VALUE = ::test::get_state().start_sub_test(x); \ + UNORDERED_SUB_TEST_VALUE; \ + UNORDERED_SUB_TEST_VALUE = \ + ::test::get_state().end_sub_test(x, UNORDERED_SUB_TEST_VALUE)) + +namespace test { + +struct registered_test_base +{ + registered_test_base* next; + char const* name; + explicit registered_test_base(char const* n) : name(n) {} + virtual void run() = 0; + virtual ~registered_test_base() {} +}; + +struct state +{ + bool is_quiet; + registered_test_base* first_test; + registered_test_base* last_test; + + state() : is_quiet(false), first_test(0), last_test(0) {} + + void add_test(registered_test_base* test) + { + if (last_test) { + last_test->next = test; + } else { + first_test = test; + } + last_test = test; + } + + void run_tests(bool quiet = false) + { + is_quiet = quiet; + + for (registered_test_base* i = first_test; i; i = i->next) { + int error_count = boost::detail::test_errors(); + if (!quiet) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Running " << i->name << "\n" + << std::flush; + } + i->run(); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << std::flush; + if (quiet && error_count != boost::detail::test_errors()) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Error in: " << i->name + << "\n" + << std::flush; + } + } + } + + int start_sub_test(char const* name) + { + if (!is_quiet) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Sub-test: " << name << "\n" + << std::flush; + } + // Add one because it's used as a loop condition. + return boost::detail::test_errors() + 1; + } + + int end_sub_test(char const* name, int value) + { + if (is_quiet && value != boost::detail::test_errors() + 1) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Error in sub-test: " << name + << "\n" + << std::flush; + } + return 0; + } +}; + +// Get the currnet translation unit's test state. +static inline state& get_state() +{ + static state instance; + return instance; +} +} + +#if defined(__cplusplus) +#define BOOST_UNORDERED_CPLUSPLUS __cplusplus +#else +#define BOOST_UNORDERED_CPLUSPLUS "(not defined)" +#endif + +#define BOOST_UNORDERED_TEST_COMPILER_INFO() \ + { \ + BOOST_LIGHTWEIGHT_TEST_OSTREAM \ + << "Compiler: " << BOOST_COMPILER << "\n" \ + << "Library: " << BOOST_STDLIB << "\n" \ + << "__cplusplus: " << BOOST_UNORDERED_CPLUSPLUS << "\n\n" \ + << "BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT: " \ + << BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT << "\n" \ + << "BOOST_UNORDERED_EMPLACE_LIMIT: " \ + << BOOST_UNORDERED_EMPLACE_LIMIT << "\n" \ + << "BOOST_UNORDERED_USE_ALLOCATOR_TRAITS: " \ + << BOOST_UNORDERED_USE_ALLOCATOR_TRAITS << "\n" \ + << "BOOST_UNORDERED_CXX11_CONSTRUCTION: " \ + << BOOST_UNORDERED_CXX11_CONSTRUCTION << "\n\n" \ + << std::flush; \ + } + +#include +#include +#include +#include +#include + +// Run test with every combination of the parameters (a sequence of sequences) +#define UNORDERED_TEST(name, parameters) \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT(UNORDERED_TEST_OP, ((name))((1))parameters) + +#define UNORDERED_TEST_REPEAT(name, n, parameters) \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT(UNORDERED_TEST_OP, ((name))((n))parameters) + +#define UNORDERED_TEST_OP(r, product) \ + UNORDERED_TEST_OP2(BOOST_PP_SEQ_ELEM(0, product), \ + BOOST_PP_SEQ_ELEM(1, product), \ + BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(product))) + +#define UNORDERED_TEST_OP2(name, n, params) \ + UNORDERED_AUTO_TEST( \ + BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params)) \ + { \ + for (int i = 0; i < n; ++i) \ + name BOOST_PP_SEQ_TO_TUPLE(params); \ + } + +#define UNORDERED_TEST_OP_JOIN(s, state, elem) \ + BOOST_PP_CAT(state, BOOST_PP_CAT(_, elem)) + +#define UNORDERED_MULTI_TEST(name, impl, parameters) \ + UNORDERED_MULTI_TEST_REPEAT(name, impl, 1, parameters) + +#define UNORDERED_MULTI_TEST_REPEAT(name, impl, n, parameters) \ + UNORDERED_AUTO_TEST(name) \ + { \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT( \ + UNORDERED_MULTI_TEST_OP, ((impl))((n))parameters) \ + } + +#define UNORDERED_MULTI_TEST_OP(r, product) \ + UNORDERED_MULTI_TEST_OP2(BOOST_PP_SEQ_ELEM(0, product), \ + BOOST_PP_SEQ_ELEM(1, product), \ + BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(product))) + +// Need to wrap UNORDERED_SUB_TEST in a block to avoid an msvc bug. +// https://support.microsoft.com/en-gb/help/315481/bug-too-many-unnested-loops-incorrectly-causes-a-c1061-compiler-error-in-visual-c +#define UNORDERED_MULTI_TEST_OP2(name, n, params) \ + { \ + UNORDERED_SUB_TEST(BOOST_PP_STRINGIZE( \ + BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params))) \ + { \ + for (int i = 0; i < n; ++i) \ + name BOOST_PP_SEQ_TO_TUPLE(params); \ + } \ + } + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/helpers/tracker.hpp b/tools/boost_1_65_1/libs/unordered/test/helpers/tracker.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0ea17a256de11cfea30e8dba7f0951dcafd6aab0 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/helpers/tracker.hpp @@ -0,0 +1,147 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This header contains metafunctions/functions to get the equivalent +// associative container for an unordered container, and compare the contents. + +#if !defined(BOOST_UNORDERED_TEST_HELPERS_TRACKER_HEADER) +#define BOOST_UNORDERED_TEST_HELPERS_TRACKER_HEADER + +#include "../objects/fwd.hpp" +#include "./equivalent.hpp" +#include "./helpers.hpp" +#include "./list.hpp" +#include "./metafunctions.hpp" +#include +#include +#include +#include + +namespace test { +template struct equals_to_compare +{ + typedef std::less type; +}; + +template <> struct equals_to_compare +{ + typedef test::less type; +}; + +template void compare_range(X1 const& x1, X2 const& x2) +{ + typedef test::list value_list; + value_list values1(x1.begin(), x1.end()); + value_list values2(x2.begin(), x2.end()); + values1.sort(); + values2.sort(); + BOOST_TEST(values1.size() == values2.size() && + test::equal(values1.begin(), values1.end(), values2.begin(), + test::equivalent)); +} + +template +void compare_pairs(X1 const& x1, X2 const& x2, T*) +{ + test::list values1(x1.first, x1.second); + test::list values2(x2.first, x2.second); + values1.sort(); + values2.sort(); + BOOST_TEST(values1.size() == values2.size() && + test::equal(values1.begin(), values1.end(), values2.begin(), + test::equivalent)); +} + +template ::value, + bool has_unique_keys = test::has_unique_keys::value> +struct ordered_base; + +template struct ordered_base +{ + typedef std::set::type> + type; +}; + +template struct ordered_base +{ + typedef std::multiset::type> + type; +}; + +template struct ordered_base +{ + typedef std::map::type> + type; +}; + +template struct ordered_base +{ + typedef std::multimap::type> + type; +}; + +template class ordered : public ordered_base::type +{ + typedef BOOST_DEDUCED_TYPENAME ordered_base::type base; + + public: + typedef BOOST_DEDUCED_TYPENAME base::key_compare key_compare; + + ordered() : base() {} + + explicit ordered(key_compare const& kc) : base(kc) {} + + void compare(X const& x) { compare_range(x, *this); } + + void compare_key( + X const& x, BOOST_DEDUCED_TYPENAME X::value_type const& val) + { + compare_pairs(x.equal_range(get_key(val)), + this->equal_range(get_key(val)), + (BOOST_DEDUCED_TYPENAME X::value_type*)0); + } + + template void insert_range(It b, It e) + { + while (b != e) { + this->insert(*b); + ++b; + } + } +}; + +template +BOOST_DEDUCED_TYPENAME equals_to_compare::type create_compare( + Equals const&) +{ + BOOST_DEDUCED_TYPENAME equals_to_compare::type x; + return x; +} + +template ordered create_ordered(X const& container) +{ + return ordered(create_compare(container.key_eq())); +} + +template +void check_container(X1 const& container, X2 const& values) +{ + ordered tracker = create_ordered(container); + tracker.insert_range(values.begin(), values.end()); + tracker.compare(container); +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/objects/cxx11_allocator.hpp b/tools/boost_1_65_1/libs/unordered/test/objects/cxx11_allocator.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4694438c1816b800530cf4fd90e02544c27aac65 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/objects/cxx11_allocator.hpp @@ -0,0 +1,344 @@ + +// Copyright 2006-2011 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_CXX11_ALLOCATOR_HEADER) +#define BOOST_UNORDERED_TEST_CXX11_ALLOCATOR_HEADER + +#include +#include +#include + +#include "../helpers/fwd.hpp" +#include "../helpers/memory.hpp" + +namespace test { +struct allocator_false +{ + enum + { + is_select_on_copy = 0, + is_propagate_on_swap = 0, + is_propagate_on_assign = 0, + is_propagate_on_move = 0, + cxx11_construct = 0 + }; +}; + +struct allocator_flags_all +{ + enum + { + is_select_on_copy = 1, + is_propagate_on_swap = 1, + is_propagate_on_assign = 1, + is_propagate_on_move = 1, + cxx11_construct = 1 + }; +}; + +struct select_copy : allocator_false +{ + enum + { + is_select_on_copy = 1 + }; +}; +struct propagate_swap : allocator_false +{ + enum + { + is_propagate_on_swap = 1 + }; +}; +struct propagate_assign : allocator_false +{ + enum + { + is_propagate_on_assign = 1 + }; +}; +struct propagate_move : allocator_false +{ + enum + { + is_propagate_on_move = 1 + }; +}; + +struct no_select_copy : allocator_flags_all +{ + enum + { + is_select_on_copy = 0 + }; +}; +struct no_propagate_swap : allocator_flags_all +{ + enum + { + is_propagate_on_swap = 0 + }; +}; +struct no_propagate_assign : allocator_flags_all +{ + enum + { + is_propagate_on_assign = 0 + }; +}; +struct no_propagate_move : allocator_flags_all +{ + enum + { + is_propagate_on_move = 0 + }; +}; + +template struct swap_allocator_base +{ + struct propagate_on_container_swap + { + enum + { + value = Flag::is_propagate_on_swap + }; + }; +}; + +template struct assign_allocator_base +{ + struct propagate_on_container_copy_assignment + { + enum + { + value = Flag::is_propagate_on_assign + }; + }; +}; + +template struct move_allocator_base +{ + struct propagate_on_container_move_assignment + { + enum + { + value = Flag::is_propagate_on_move + }; + }; +}; + +namespace { +// boostinspect:nounnamed +bool force_equal_allocator_value = false; +} + +struct force_equal_allocator +{ + bool old_value_; + + explicit force_equal_allocator(bool value) + : old_value_(force_equal_allocator_value) + { + force_equal_allocator_value = value; + } + + ~force_equal_allocator() { force_equal_allocator_value = old_value_; } +}; + +template struct cxx11_allocator_base +{ + int tag_; + int selected_; + + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef T* pointer; + typedef T const* const_pointer; + typedef T& reference; + typedef T const& const_reference; + typedef T value_type; + + explicit cxx11_allocator_base(int t) : tag_(t), selected_(0) + { + detail::tracker.allocator_ref(); + } + + template + cxx11_allocator_base(cxx11_allocator_base const& x) + : tag_(x.tag_), selected_(x.selected_) + { + detail::tracker.allocator_ref(); + } + + cxx11_allocator_base(cxx11_allocator_base const& x) + : tag_(x.tag_), selected_(x.selected_) + { + detail::tracker.allocator_ref(); + } + + ~cxx11_allocator_base() { detail::tracker.allocator_unref(); } + + pointer address(reference r) { return pointer(&r); } + + const_pointer address(const_reference r) { return const_pointer(&r); } + + pointer allocate(size_type n) + { + pointer ptr(static_cast(::operator new(n * sizeof(T)))); + detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return ptr; + } + + pointer allocate(size_type n, void const*) + { + pointer ptr(static_cast(::operator new(n * sizeof(T)))); + detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return ptr; + } + + void deallocate(pointer p, size_type n) + { + // Only checking tags when propagating swap. + // Note that tags will be tested + // properly in the normal allocator. + detail::tracker.track_deallocate( + (void*)p, n, sizeof(T), tag_, !force_equal_allocator_value); + ::operator delete((void*)p); + } + + void construct(T* p, T const& t) + { + detail::tracker.track_construct((void*)p, sizeof(T), tag_); + new (p) T(t); + } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template + void construct(T* p, BOOST_FWD_REF(Args)... args) + { + detail::tracker.track_construct((void*)p, sizeof(T), tag_); + new (p) T(boost::forward(args)...); + } +#endif + + void destroy(T* p) + { + detail::tracker.track_destroy((void*)p, sizeof(T), tag_); + p->~T(); + } + + size_type max_size() const + { + return (std::numeric_limits::max)(); + } +}; + +template +struct cxx11_allocator; + +template +struct cxx11_allocator::type> + : public cxx11_allocator_base, + public swap_allocator_base, + public assign_allocator_base, + public move_allocator_base, + Flags +{ +#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 402000) + template struct rebind + { + typedef cxx11_allocator other; + }; +#endif + + explicit cxx11_allocator(int t = 0) : cxx11_allocator_base(t) {} + + template + cxx11_allocator(cxx11_allocator const& x) + : cxx11_allocator_base(x) + { + } + + cxx11_allocator(cxx11_allocator const& x) : cxx11_allocator_base(x) {} + + // When not propagating swap, allocators are always equal + // to avoid undefined behaviour. + bool operator==(cxx11_allocator const& x) const + { + return force_equal_allocator_value || (this->tag_ == x.tag_); + } + + bool operator!=(cxx11_allocator const& x) const { return !(*this == x); } +}; + +template +struct cxx11_allocator::type> + : public cxx11_allocator_base, + public swap_allocator_base, + public assign_allocator_base, + public move_allocator_base, + Flags +{ + cxx11_allocator select_on_container_copy_construction() const + { + cxx11_allocator tmp(*this); + ++tmp.selected_; + return tmp; + } + +#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 402000) + template struct rebind + { + typedef cxx11_allocator other; + }; +#endif + + explicit cxx11_allocator(int t = 0) : cxx11_allocator_base(t) {} + + template + cxx11_allocator(cxx11_allocator const& x) + : cxx11_allocator_base(x) + { + } + + cxx11_allocator(cxx11_allocator const& x) : cxx11_allocator_base(x) {} + + // When not propagating swap, allocators are always equal + // to avoid undefined behaviour. + bool operator==(cxx11_allocator const& x) const + { + return force_equal_allocator_value || (this->tag_ == x.tag_); + } + + bool operator!=(cxx11_allocator const& x) const { return !(*this == x); } +}; + +template +bool equivalent_impl(cxx11_allocator const& x, + cxx11_allocator const& y, test::derived_type) +{ + return x.tag_ == y.tag_; +} + +// Function to check how many times an allocator has been selected, +// return 0 for other allocators. + +struct convert_from_anything +{ + template convert_from_anything(T const&) {} +}; + +inline int selected_count(convert_from_anything) { return 0; } + +template +int selected_count(cxx11_allocator const& x) +{ + return x.selected_; +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/objects/exception.hpp b/tools/boost_1_65_1/libs/unordered/test/objects/exception.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d0286797f78c9082628217552e8aac750704163c --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/objects/exception.hpp @@ -0,0 +1,753 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_EXCEPTION_TEST_OBJECTS_HEADER) +#define BOOST_UNORDERED_EXCEPTION_TEST_OBJECTS_HEADER + +#include "../helpers/exception_test.hpp" + +#include "../helpers/count.hpp" +#include "../helpers/fwd.hpp" +#include "../helpers/generators.hpp" +#include "../helpers/memory.hpp" +#include "./fwd.hpp" +#include +#include +#include + +namespace test { +namespace exception { +class object; +class hash; +class equal_to; +template class allocator; +object generate(object const*, random_generator); +std::pair generate( + std::pair const*, random_generator); + +struct true_type +{ + enum + { + value = true + }; +}; + +struct false_type +{ + enum + { + value = false + }; +}; + +class object : private counted_object +{ + public: + int tag1_, tag2_; + + explicit object() : tag1_(0), tag2_(0) + { + UNORDERED_SCOPE(object::object()) + { + UNORDERED_EPOINT("Mock object default constructor."); + } + } + + explicit object(int t1, int t2 = 0) : tag1_(t1), tag2_(t2) + { + UNORDERED_SCOPE(object::object(int)) + { + UNORDERED_EPOINT("Mock object constructor by value."); + } + } + + object(object const& x) : counted_object(x), tag1_(x.tag1_), tag2_(x.tag2_) + { + UNORDERED_SCOPE(object::object(object)) + { + UNORDERED_EPOINT("Mock object copy constructor."); + } + } + + ~object() + { + tag1_ = -1; + tag2_ = -1; + } + + object& operator=(object const& x) + { + UNORDERED_SCOPE(object::operator=(object)) + { + tag1_ = x.tag1_; + UNORDERED_EPOINT("Mock object assign operator 1."); + tag2_ = x.tag2_; + // UNORDERED_EPOINT("Mock object assign operator 2."); + } + return *this; + } + + friend bool operator==(object const& x1, object const& x2) + { + UNORDERED_SCOPE(operator==(object, object)) + { + UNORDERED_EPOINT("Mock object equality operator."); + } + + return x1.tag1_ == x2.tag1_ && x1.tag2_ == x2.tag2_; + } + + friend bool operator!=(object const& x1, object const& x2) + { + UNORDERED_SCOPE(operator!=(object, object)) + { + UNORDERED_EPOINT("Mock object inequality operator."); + } + + return !(x1.tag1_ == x2.tag1_ && x1.tag2_ == x2.tag2_); + } + + // None of the last few functions are used by the unordered associative + // containers - so there aren't any exception points. + friend bool operator<(object const& x1, object const& x2) + { + return x1.tag1_ < x2.tag1_ || + (x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_); + } + + friend object generate(object const*, random_generator g) + { + int* x = 0; + return object(::test::generate(x, g), ::test::generate(x, g)); + } + + friend std::ostream& operator<<(std::ostream& out, object const& o) + { + return out << "(" << o.tag1_ << "," << o.tag2_ << ")"; + } +}; + +std::pair generate( + std::pair const*, random_generator g) +{ + int* x = 0; + return std::make_pair( + object(::test::generate(x, g), ::test::generate(x, g)), + object(::test::generate(x, g), ::test::generate(x, g))); +} + +class hash +{ + int tag_; + + public: + hash(int t = 0) : tag_(t) + { + UNORDERED_SCOPE(hash::object()) + { + UNORDERED_EPOINT("Mock hash default constructor."); + } + } + + hash(hash const& x) : tag_(x.tag_) + { + UNORDERED_SCOPE(hash::hash(hash)) + { + UNORDERED_EPOINT("Mock hash copy constructor."); + } + } + + hash& operator=(hash const& x) + { + UNORDERED_SCOPE(hash::operator=(hash)) + { + UNORDERED_EPOINT("Mock hash assign operator 1."); + tag_ = x.tag_; + UNORDERED_EPOINT("Mock hash assign operator 2."); + } + return *this; + } + + std::size_t operator()(object const& x) const + { + UNORDERED_SCOPE(hash::operator()(object)) + { + UNORDERED_EPOINT("Mock hash function."); + } + + return hash_impl(x); + } + + std::size_t operator()(std::pair const& x) const + { + UNORDERED_SCOPE(hash::operator()(std::pair)) + { + UNORDERED_EPOINT("Mock hash pair function."); + } + + return hash_impl(x.first) * 193ul + hash_impl(x.second) * 97ul + 29ul; + } + + std::size_t hash_impl(object const& x) const + { + int result; + switch (tag_) { + case 1: + result = x.tag1_; + break; + case 2: + result = x.tag2_; + break; + default: + result = x.tag1_ + x.tag2_; + } + return static_cast(result); + } + + friend bool operator==(hash const& x1, hash const& x2) + { + UNORDERED_SCOPE(operator==(hash, hash)) + { + UNORDERED_EPOINT("Mock hash equality function."); + } + return x1.tag_ == x2.tag_; + } + + friend bool operator!=(hash const& x1, hash const& x2) + { + UNORDERED_SCOPE(hash::operator!=(hash, hash)) + { + UNORDERED_EPOINT("Mock hash inequality function."); + } + return x1.tag_ != x2.tag_; + } +}; + +class less +{ + int tag_; + + public: + less(int t = 0) : tag_(t) {} + + less(less const& x) : tag_(x.tag_) {} + + bool operator()(object const& x1, object const& x2) const + { + return less_impl(x1, x2); + } + + bool operator()(std::pair const& x1, + std::pair const& x2) const + { + if (less_impl(x1.first, x2.first)) { + return true; + } + if (!less_impl(x1.first, x2.first)) { + return false; + } + return less_impl(x1.second, x2.second); + } + + bool less_impl(object const& x1, object const& x2) const + { + switch (tag_) { + case 1: + return x1.tag1_ < x2.tag1_; + case 2: + return x1.tag2_ < x2.tag2_; + default: + return x1 < x2; + } + } + + friend bool operator==(less const& x1, less const& x2) + { + return x1.tag_ == x2.tag_; + } + + friend bool operator!=(less const& x1, less const& x2) + { + return x1.tag_ != x2.tag_; + } +}; + +class equal_to +{ + int tag_; + + public: + equal_to(int t = 0) : tag_(t) + { + UNORDERED_SCOPE(equal_to::equal_to()) + { + UNORDERED_EPOINT("Mock equal_to default constructor."); + } + } + + equal_to(equal_to const& x) : tag_(x.tag_) + { + UNORDERED_SCOPE(equal_to::equal_to(equal_to)) + { + UNORDERED_EPOINT("Mock equal_to copy constructor."); + } + } + + equal_to& operator=(equal_to const& x) + { + UNORDERED_SCOPE(equal_to::operator=(equal_to)) + { + UNORDERED_EPOINT("Mock equal_to assign operator 1."); + tag_ = x.tag_; + UNORDERED_EPOINT("Mock equal_to assign operator 2."); + } + return *this; + } + + bool operator()(object const& x1, object const& x2) const + { + UNORDERED_SCOPE(equal_to::operator()(object, object)) + { + UNORDERED_EPOINT("Mock equal_to function."); + } + + return equal_impl(x1, x2); + } + + bool operator()(std::pair const& x1, + std::pair const& x2) const + { + UNORDERED_SCOPE(equal_to::operator()( + std::pair, std::pair)) + { + UNORDERED_EPOINT("Mock equal_to function."); + } + + return equal_impl(x1.first, x2.first) && + equal_impl(x1.second, x2.second); + } + + bool equal_impl(object const& x1, object const& x2) const + { + switch (tag_) { + case 1: + return x1.tag1_ == x2.tag1_; + case 2: + return x1.tag2_ == x2.tag2_; + default: + return x1 == x2; + } + } + + friend bool operator==(equal_to const& x1, equal_to const& x2) + { + UNORDERED_SCOPE(operator==(equal_to, equal_to)) + { + UNORDERED_EPOINT("Mock equal_to equality function."); + } + return x1.tag_ == x2.tag_; + } + + friend bool operator!=(equal_to const& x1, equal_to const& x2) + { + UNORDERED_SCOPE(operator!=(equal_to, equal_to)) + { + UNORDERED_EPOINT("Mock equal_to inequality function."); + } + return x1.tag_ != x2.tag_; + } + + friend less create_compare(equal_to x) { return less(x.tag_); } +}; + +template class allocator +{ + public: + int tag_; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef T* pointer; + typedef T const* const_pointer; + typedef T& reference; + typedef T const& const_reference; + typedef T value_type; + + template struct rebind + { + typedef allocator other; + }; + + explicit allocator(int t = 0) : tag_(t) + { + UNORDERED_SCOPE(allocator::allocator()) + { + UNORDERED_EPOINT("Mock allocator default constructor."); + } + test::detail::tracker.allocator_ref(); + } + + template allocator(allocator const& x) : tag_(x.tag_) + { + test::detail::tracker.allocator_ref(); + } + + allocator(allocator const& x) : tag_(x.tag_) + { + test::detail::tracker.allocator_ref(); + } + + ~allocator() { test::detail::tracker.allocator_unref(); } + + allocator& operator=(allocator const& x) + { + tag_ = x.tag_; + return *this; + } + + // If address throws, then it can't be used in erase or the + // destructor, which is very limiting. I need to check up on + // this. + + pointer address(reference r) + { + // UNORDERED_SCOPE(allocator::address(reference)) { + // UNORDERED_EPOINT("Mock allocator address function."); + //} + return pointer(&r); + } + + const_pointer address(const_reference r) + { + // UNORDERED_SCOPE(allocator::address(const_reference)) { + // UNORDERED_EPOINT("Mock allocator const address function."); + //} + return const_pointer(&r); + } + + pointer allocate(size_type n) + { + T* ptr = 0; + UNORDERED_SCOPE(allocator::allocate(size_type)) + { + UNORDERED_EPOINT("Mock allocator allocate function."); + + using namespace std; + ptr = (T*)malloc(n * sizeof(T)); + if (!ptr) + throw std::bad_alloc(); + } + test::detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return pointer(ptr); + + // return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + pointer allocate(size_type n, void const*) + { + T* ptr = 0; + UNORDERED_SCOPE(allocator::allocate(size_type, const_pointer)) + { + UNORDERED_EPOINT("Mock allocator allocate function."); + + using namespace std; + ptr = (T*)malloc(n * sizeof(T)); + if (!ptr) + throw std::bad_alloc(); + } + test::detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return pointer(ptr); + + // return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + void deallocate(pointer p, size_type n) + { + //::operator delete((void*) p); + if (p) { + test::detail::tracker.track_deallocate( + (void*)p, n, sizeof(T), tag_); + using namespace std; + free(p); + } + } + + void construct(pointer p, T const& t) + { + UNORDERED_SCOPE(allocator::construct(T*, T)) + { + UNORDERED_EPOINT("Mock allocator construct function."); + new (p) T(t); + } + test::detail::tracker.track_construct((void*)p, sizeof(T), tag_); + } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template void construct(T* p, BOOST_FWD_REF(Args)... args) + { + UNORDERED_SCOPE(allocator::construct(pointer, BOOST_FWD_REF(Args)...)) + { + UNORDERED_EPOINT("Mock allocator construct function."); + new (p) T(boost::forward(args)...); + } + test::detail::tracker.track_construct((void*)p, sizeof(T), tag_); + } +#endif + + void destroy(T* p) + { + test::detail::tracker.track_destroy((void*)p, sizeof(T), tag_); + p->~T(); + } + + size_type max_size() const + { + UNORDERED_SCOPE(allocator::construct(pointer, T)) + { + UNORDERED_EPOINT("Mock allocator max_size function."); + } + return (std::numeric_limits::max)(); + } + + typedef true_type propagate_on_container_copy_assignment; + typedef true_type propagate_on_container_move_assignment; + typedef true_type propagate_on_container_swap; +}; + +template void swap(allocator& x, allocator& y) +{ + std::swap(x.tag_, y.tag_); +} + +// It's pretty much impossible to write a compliant swap when these +// two can throw. So they don't. + +template +inline bool operator==(allocator const& x, allocator const& y) +{ + // UNORDERED_SCOPE(operator==(allocator, allocator)) { + // UNORDERED_EPOINT("Mock allocator equality operator."); + //} + return x.tag_ == y.tag_; +} + +template +inline bool operator!=(allocator const& x, allocator const& y) +{ + // UNORDERED_SCOPE(operator!=(allocator, allocator)) { + // UNORDERED_EPOINT("Mock allocator inequality operator."); + //} + return x.tag_ != y.tag_; +} + +template class allocator2 +{ + public: + int tag_; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef T* pointer; + typedef T const* const_pointer; + typedef T& reference; + typedef T const& const_reference; + typedef T value_type; + + template struct rebind + { + typedef allocator2 other; + }; + + explicit allocator2(int t = 0) : tag_(t) + { + UNORDERED_SCOPE(allocator2::allocator2()) + { + UNORDERED_EPOINT("Mock allocator2 default constructor."); + } + test::detail::tracker.allocator_ref(); + } + + allocator2(allocator const& x) : tag_(x.tag_) + { + test::detail::tracker.allocator_ref(); + } + + template allocator2(allocator2 const& x) : tag_(x.tag_) + { + test::detail::tracker.allocator_ref(); + } + + allocator2(allocator2 const& x) : tag_(x.tag_) + { + test::detail::tracker.allocator_ref(); + } + + ~allocator2() { test::detail::tracker.allocator_unref(); } + + allocator2& operator=(allocator2 const&) { return *this; } + + // If address throws, then it can't be used in erase or the + // destructor, which is very limiting. I need to check up on + // this. + + pointer address(reference r) + { + // UNORDERED_SCOPE(allocator2::address(reference)) { + // UNORDERED_EPOINT("Mock allocator2 address function."); + //} + return pointer(&r); + } + + const_pointer address(const_reference r) + { + // UNORDERED_SCOPE(allocator2::address(const_reference)) { + // UNORDERED_EPOINT("Mock allocator2 const address function."); + //} + return const_pointer(&r); + } + + pointer allocate(size_type n) + { + T* ptr = 0; + UNORDERED_SCOPE(allocator2::allocate(size_type)) + { + UNORDERED_EPOINT("Mock allocator2 allocate function."); + + using namespace std; + ptr = (T*)malloc(n * sizeof(T)); + if (!ptr) + throw std::bad_alloc(); + } + test::detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return pointer(ptr); + + // return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + pointer allocate(size_type n, void const*) + { + T* ptr = 0; + UNORDERED_SCOPE(allocator2::allocate(size_type, const_pointer)) + { + UNORDERED_EPOINT("Mock allocator2 allocate function."); + + using namespace std; + ptr = (T*)malloc(n * sizeof(T)); + if (!ptr) + throw std::bad_alloc(); + } + test::detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return pointer(ptr); + + // return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + void deallocate(pointer p, size_type n) + { + //::operator delete((void*) p); + if (p) { + test::detail::tracker.track_deallocate( + (void*)p, n, sizeof(T), tag_); + using namespace std; + free(p); + } + } + + void construct(pointer p, T const& t) + { + UNORDERED_SCOPE(allocator2::construct(T*, T)) + { + UNORDERED_EPOINT("Mock allocator2 construct function."); + new (p) T(t); + } + test::detail::tracker.track_construct((void*)p, sizeof(T), tag_); + } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template void construct(T* p, BOOST_FWD_REF(Args)... args) + { + UNORDERED_SCOPE(allocator2::construct(pointer, BOOST_FWD_REF(Args)...)) + { + UNORDERED_EPOINT("Mock allocator2 construct function."); + new (p) T(boost::forward(args)...); + } + test::detail::tracker.track_construct((void*)p, sizeof(T), tag_); + } +#endif + + void destroy(T* p) + { + test::detail::tracker.track_destroy((void*)p, sizeof(T), tag_); + p->~T(); + } + + size_type max_size() const + { + UNORDERED_SCOPE(allocator2::construct(pointer, T)) + { + UNORDERED_EPOINT("Mock allocator2 max_size function."); + } + return (std::numeric_limits::max)(); + } + + typedef false_type propagate_on_container_copy_assignment; + typedef false_type propagate_on_container_move_assignment; + typedef false_type propagate_on_container_swap; +}; + +template void swap(allocator2& x, allocator2& y) +{ + std::swap(x.tag_, y.tag_); +} + +// It's pretty much impossible to write a compliant swap when these +// two can throw. So they don't. + +template +inline bool operator==(allocator2 const& x, allocator2 const& y) +{ + // UNORDERED_SCOPE(operator==(allocator2, allocator2)) { + // UNORDERED_EPOINT("Mock allocator2 equality operator."); + //} + return x.tag_ == y.tag_; +} + +template +inline bool operator!=(allocator2 const& x, allocator2 const& y) +{ + // UNORDERED_SCOPE(operator!=(allocator2, allocator2)) { + // UNORDERED_EPOINT("Mock allocator2 inequality operator."); + //} + return x.tag_ != y.tag_; +} +} +} + +namespace test { +template struct equals_to_compare; +template <> struct equals_to_compare +{ + typedef test::exception::less type; +}; +} + +// Workaround for ADL deficient compilers +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) +namespace test { +test::exception::object generate( + test::exception::object const* x, random_generator g) +{ + return test::exception::generate(x, g); +} + +std::pair generate( + std::pair const* x, + random_generator g) +{ + return test::exception::generate(x, g); +} +} +#endif + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/objects/fwd.hpp b/tools/boost_1_65_1/libs/unordered/test/objects/fwd.hpp new file mode 100644 index 0000000000000000000000000000000000000000..dda08892bce05a0c70dc901f3bc610efa0161253 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/objects/fwd.hpp @@ -0,0 +1,17 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_OBJECTS_FWD_HEADER) +#define BOOST_UNORDERED_TEST_OBJECTS_FWD_HEADER + +namespace test { +class object; +class hash; +class less; +class equal_to; +template class allocator; +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/objects/minimal.hpp b/tools/boost_1_65_1/libs/unordered/test/objects/minimal.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c1fa5b4f60bd0f040bd362f1f4fb0d31b51d1b81 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/objects/minimal.hpp @@ -0,0 +1,608 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Define some minimal classes which provide the bare minimum concepts to +// test that the containers don't rely on something that they shouldn't. +// They are not intended to be good examples of how to implement the concepts. + +#if !defined(BOOST_UNORDERED_OBJECTS_MINIMAL_HEADER) +#define BOOST_UNORDERED_OBJECTS_MINIMAL_HEADER + +#include +#include +#include + +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable : 4100) // unreferenced formal parameter +#endif + +#if !BOOST_WORKAROUND(BOOST_MSVC, == 1500) +#define BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED 1 +#else +#define BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED 0 +#endif + +namespace test { +namespace minimal { +class destructible; +class copy_constructible; +class copy_constructible_equality_comparable; +class default_assignable; +class assignable; + +struct ampersand_operator_used +{ + ampersand_operator_used() { BOOST_TEST(false); } +}; + +template class hash; +template class equal_to; +template class ptr; +template class const_ptr; +template class allocator; +template class cxx11_allocator; + +struct constructor_param +{ + operator int() const { return 0; } +}; + +class destructible +{ + public: + destructible(constructor_param const&) {} + ~destructible() {} + void dummy_member() const {} + private: + destructible(destructible const&); + destructible& operator=(destructible const&); +}; + +class copy_constructible +{ + public: + copy_constructible(constructor_param const&) {} + copy_constructible(copy_constructible const&) {} + ~copy_constructible() {} + void dummy_member() const {} + private: + copy_constructible& operator=(copy_constructible const&); + copy_constructible() {} +}; + +class copy_constructible_equality_comparable +{ + public: + copy_constructible_equality_comparable(constructor_param const&) {} + + copy_constructible_equality_comparable( + copy_constructible_equality_comparable const&) + { + } + + ~copy_constructible_equality_comparable() {} + + void dummy_member() const {} + private: + copy_constructible_equality_comparable& operator=( + copy_constructible_equality_comparable const&); + copy_constructible_equality_comparable() {} +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +bool operator==(copy_constructible_equality_comparable, + copy_constructible_equality_comparable) +{ + return true; +} + +bool operator!=(copy_constructible_equality_comparable, + copy_constructible_equality_comparable) +{ + return false; +} + +class default_assignable +{ + public: + default_assignable(constructor_param const&) {} + + default_assignable() {} + + default_assignable(default_assignable const&) {} + + default_assignable& operator=(default_assignable const&) { return *this; } + + ~default_assignable() {} + + void dummy_member() const {} + +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +class assignable +{ + public: + assignable(constructor_param const&) {} + assignable(assignable const&) {} + assignable& operator=(assignable const&) { return *this; } + ~assignable() {} + void dummy_member() const {} + private: + assignable() {} +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +struct movable_init +{ +}; + +class movable1 +{ + BOOST_MOVABLE_BUT_NOT_COPYABLE(movable1) + + public: + movable1(constructor_param const&) {} + movable1() {} + explicit movable1(movable_init) {} + movable1(BOOST_RV_REF(movable1)) {} + movable1& operator=(BOOST_RV_REF(movable1)) { return *this; } + ~movable1() {} + void dummy_member() const {} +}; + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +class movable2 +{ + public: + movable2(constructor_param const&) {} + explicit movable2(movable_init) {} + movable2(movable2&&) {} + ~movable2() {} + movable2& operator=(movable2&&) { return *this; } + void dummy_member() const {} + private: + movable2() {} + movable2(movable2 const&); + movable2& operator=(movable2 const&); +}; +#else +typedef movable1 movable2; +#endif + +template class hash +{ + public: + hash(constructor_param const&) {} + hash() {} + hash(hash const&) {} + hash& operator=(hash const&) { return *this; } + ~hash() {} + + std::size_t operator()(T const&) const { return 0; } +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +template class equal_to +{ + public: + equal_to(constructor_param const&) {} + equal_to() {} + equal_to(equal_to const&) {} + equal_to& operator=(equal_to const&) { return *this; } + ~equal_to() {} + + bool operator()(T const&, T const&) const { return true; } +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +template class ptr; +template class const_ptr; + +struct void_ptr +{ +#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) + template friend class ptr; + + private: +#endif + + void* ptr_; + + public: + void_ptr() : ptr_(0) {} + + template explicit void_ptr(ptr const& x) : ptr_(x.ptr_) {} + + // I'm not using the safe bool idiom because the containers should be + // able to cope with bool conversions. + operator bool() const { return !!ptr_; } + + bool operator==(void_ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(void_ptr const& x) const { return ptr_ != x.ptr_; } +}; + +class void_const_ptr +{ +#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) + template friend class const_ptr; + + private: +#endif + + void* ptr_; + + public: + void_const_ptr() : ptr_(0) {} + + template + explicit void_const_ptr(const_ptr const& x) : ptr_(x.ptr_) + { + } + + // I'm not using the safe bool idiom because the containers should be + // able to cope with bool conversions. + operator bool() const { return !!ptr_; } + + bool operator==(void_const_ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(void_const_ptr const& x) const { return ptr_ != x.ptr_; } +}; + +template class ptr +{ + friend class allocator; + friend class const_ptr; + friend struct void_ptr; + + T* ptr_; + + ptr(T* x) : ptr_(x) {} + public: + ptr() : ptr_(0) {} + explicit ptr(void_ptr const& x) : ptr_((T*)x.ptr_) {} + + T& operator*() const { return *ptr_; } + T* operator->() const { return ptr_; } + ptr& operator++() + { + ++ptr_; + return *this; + } + ptr operator++(int) + { + ptr tmp(*this); + ++ptr_; + return tmp; + } + ptr operator+(std::ptrdiff_t s) const { return ptr(ptr_ + s); } + friend ptr operator+(std::ptrdiff_t s, ptr p) { return ptr(s + p.ptr_); } + T& operator[](std::ptrdiff_t s) const { return ptr_[s]; } + bool operator!() const { return !ptr_; } + + // I'm not using the safe bool idiom because the containers should be + // able to cope with bool conversions. + operator bool() const { return !!ptr_; } + + bool operator==(ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(ptr const& x) const { return ptr_ != x.ptr_; } + bool operator<(ptr const& x) const { return ptr_ < x.ptr_; } + bool operator>(ptr const& x) const { return ptr_ > x.ptr_; } + bool operator<=(ptr const& x) const { return ptr_ <= x.ptr_; } + bool operator>=(ptr const& x) const { return ptr_ >= x.ptr_; } +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +template class const_ptr +{ + friend class allocator; + friend struct const_void_ptr; + + T const* ptr_; + + const_ptr(T const* ptr) : ptr_(ptr) {} + public: + const_ptr() : ptr_(0) {} + const_ptr(ptr const& x) : ptr_(x.ptr_) {} + explicit const_ptr(void_const_ptr const& x) : ptr_((T const*)x.ptr_) {} + + T const& operator*() const { return *ptr_; } + T const* operator->() const { return ptr_; } + const_ptr& operator++() + { + ++ptr_; + return *this; + } + const_ptr operator++(int) + { + const_ptr tmp(*this); + ++ptr_; + return tmp; + } + const_ptr operator+(std::ptrdiff_t s) const { return const_ptr(ptr_ + s); } + friend const_ptr operator+(std::ptrdiff_t s, const_ptr p) + { + return ptr(s + p.ptr_); + } + T const& operator[](int s) const { return ptr_[s]; } + bool operator!() const { return !ptr_; } + operator bool() const { return !!ptr_; } + + bool operator==(const_ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(const_ptr const& x) const { return ptr_ != x.ptr_; } + bool operator<(const_ptr const& x) const { return ptr_ < x.ptr_; } + bool operator>(const_ptr const& x) const { return ptr_ > x.ptr_; } + bool operator<=(const_ptr const& x) const { return ptr_ <= x.ptr_; } + bool operator>=(const_ptr const& x) const { return ptr_ >= x.ptr_; } +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +template class allocator +{ + public: + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef void_ptr void_pointer; + typedef void_const_ptr const_void_pointer; + typedef ptr pointer; + typedef const_ptr const_pointer; + typedef T& reference; + typedef T const& const_reference; + typedef T value_type; + + template struct rebind + { + typedef allocator other; + }; + + allocator() {} + template allocator(allocator const&) {} + allocator(allocator const&) {} + ~allocator() {} + + pointer address(reference r) { return pointer(&r); } + const_pointer address(const_reference r) { return const_pointer(&r); } + + pointer allocate(size_type n) + { + return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + template pointer allocate(size_type n, const_ptr) + { + return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + void deallocate(pointer p, size_type) { ::operator delete((void*)p.ptr_); } + + void construct(T* p, T const& t) { new ((void*)p) T(t); } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template void construct(T* p, BOOST_FWD_REF(Args)... args) + { + new ((void*)p) T(boost::forward(args)...); + } +#endif + + void destroy(T* p) { p->~T(); } + + size_type max_size() const { return 1000; } + +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) || \ + BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + public: + allocator& operator=(allocator const&) { return *this; } +#else + private: + allocator& operator=(allocator const&); +#endif +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +template class allocator +{ + public: + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef void_ptr void_pointer; + typedef void_const_ptr const_void_pointer; + // Maybe these two should be const_ptr + typedef ptr pointer; + typedef const_ptr const_pointer; + typedef T const& reference; + typedef T const& const_reference; + typedef T const value_type; + + template struct rebind + { + typedef allocator other; + }; + + allocator() {} + template allocator(allocator const&) {} + allocator(allocator const&) {} + ~allocator() {} + + const_pointer address(const_reference r) { return const_pointer(&r); } + + pointer allocate(size_type n) + { + return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + template pointer allocate(size_type n, const_ptr) + { + return pointer(static_cast(::operator new(n * sizeof(T)))); + } + + void deallocate(pointer p, size_type) { ::operator delete((void*)p.ptr_); } + + void construct(T const* p, T const& t) { new ((void*)p) T(t); } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template + void construct(T const* p, BOOST_FWD_REF(Args)... args) + { + new ((void*)p) T(boost::forward(args)...); + } +#endif + + void destroy(T const* p) { p->~T(); } + + size_type max_size() const { return 1000; } + +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) || \ + BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + public: + allocator& operator=(allocator const&) { return *this; } +#else + private: + allocator& operator=(allocator const&); +#endif +#if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED + ampersand_operator_used operator&() const + { + return ampersand_operator_used(); + } +#endif +}; + +template +inline bool operator==(allocator const&, allocator const&) +{ + return true; +} + +template +inline bool operator!=(allocator const&, allocator const&) +{ + return false; +} + +template void swap(allocator&, allocator&) {} + +// C++11 allocator +// +// Not a fully minimal C++11 allocator, just what I support. Hopefully will +// cut down further in the future. + +template class cxx11_allocator +{ + public: + typedef T value_type; + // template struct rebind { typedef cxx11_allocator other; }; + + cxx11_allocator() {} + template cxx11_allocator(cxx11_allocator const&) {} + cxx11_allocator(cxx11_allocator const&) {} + ~cxx11_allocator() {} + + T* address(T& r) { return &r; } + T const* address(T const& r) { return &r; } + + T* allocate(std::size_t n) + { + return static_cast(::operator new(n * sizeof(T))); + } + + template T* allocate(std::size_t n, const_ptr) + { + return static_cast(::operator new(n * sizeof(T))); + } + + void deallocate(T* p, std::size_t) { ::operator delete((void*)p); } + + void construct(T* p, T const& t) { new ((void*)p) T(t); } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template void construct(T* p, BOOST_FWD_REF(Args)... args) + { + new ((void*)p) T(boost::forward(args)...); + } +#endif + + void destroy(T* p) { p->~T(); } + + std::size_t max_size() const { return 1000u; } +}; + +template +inline bool operator==(cxx11_allocator const&, cxx11_allocator const&) +{ + return true; +} + +template +inline bool operator!=(cxx11_allocator const&, cxx11_allocator const&) +{ + return false; +} + +template void swap(cxx11_allocator&, cxx11_allocator&) {} +} +} + +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) +namespace boost { +#else +namespace test { +namespace minimal { +#endif +std::size_t hash_value(test::minimal::copy_constructible_equality_comparable) +{ + return 1; +} +#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) +} +} +#else +} +#endif + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/objects/test.hpp b/tools/boost_1_65_1/libs/unordered/test/objects/test.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e0e155f9004c11a5556797dc018560c92cf4d47a --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/objects/test.hpp @@ -0,0 +1,696 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_UNORDERED_TEST_OBJECTS_HEADER) +#define BOOST_UNORDERED_TEST_OBJECTS_HEADER + +#include "../helpers/count.hpp" +#include "../helpers/fwd.hpp" +#include "../helpers/memory.hpp" +#include +#include +#include + +namespace test { +// Note that the default hash function will work for any equal_to (but not +// very well). +class object; +class movable; +class implicitly_convertible; +class hash; +class less; +class equal_to; +template class allocator1; +template class allocator2; +object generate(object const*, random_generator); +movable generate(movable const*, random_generator); +implicitly_convertible generate( + implicitly_convertible const*, random_generator); + +inline void ignore_variable(void const*) {} + +class object : private counted_object +{ + friend class hash; + friend class equal_to; + friend class less; + int tag1_, tag2_; + + public: + explicit object(int t1 = 0, int t2 = 0) : tag1_(t1), tag2_(t2) {} + + ~object() + { + tag1_ = -1; + tag2_ = -1; + } + + friend bool operator==(object const& x1, object const& x2) + { + return x1.tag1_ == x2.tag1_ && x1.tag2_ == x2.tag2_; + } + + friend bool operator!=(object const& x1, object const& x2) + { + return x1.tag1_ != x2.tag1_ || x1.tag2_ != x2.tag2_; + } + + friend bool operator<(object const& x1, object const& x2) + { + return x1.tag1_ < x2.tag1_ || + (x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_); + } + + friend object generate(object const*, random_generator g) + { + int* x = 0; + return object(generate(x, g), generate(x, g)); + } + + friend std::ostream& operator<<(std::ostream& out, object const& o) + { + return out << "(" << o.tag1_ << "," << o.tag2_ << ")"; + } +}; + +class movable : private counted_object +{ + friend class hash; + friend class equal_to; + friend class less; + int tag1_, tag2_; + + BOOST_COPYABLE_AND_MOVABLE(movable) + public: + explicit movable(int t1 = 0, int t2 = 0) : tag1_(t1), tag2_(t2) {} + + movable(movable const& x) + : counted_object(x), tag1_(x.tag1_), tag2_(x.tag2_) + { + BOOST_TEST(x.tag1_ != -1); + } + + movable(BOOST_RV_REF(movable) x) + : counted_object(x), tag1_(x.tag1_), tag2_(x.tag2_) + { + BOOST_TEST(x.tag1_ != -1); + x.tag1_ = -1; + x.tag2_ = -1; + } + + movable& operator=(BOOST_COPY_ASSIGN_REF(movable) x) // Copy assignment + { + BOOST_TEST(x.tag1_ != -1); + tag1_ = x.tag1_; + tag2_ = x.tag2_; + return *this; + } + + movable& operator=(BOOST_RV_REF(movable) x) // Move assignment + { + BOOST_TEST(x.tag1_ != -1); + tag1_ = x.tag1_; + tag2_ = x.tag2_; + x.tag1_ = -1; + x.tag2_ = -1; + return *this; + } + + ~movable() + { + tag1_ = -1; + tag2_ = -1; + } + + friend bool operator==(movable const& x1, movable const& x2) + { + BOOST_TEST(x1.tag1_ != -1 && x2.tag1_ != -1); + return x1.tag1_ == x2.tag1_ && x1.tag2_ == x2.tag2_; + } + + friend bool operator!=(movable const& x1, movable const& x2) + { + BOOST_TEST(x1.tag1_ != -1 && x2.tag1_ != -1); + return x1.tag1_ != x2.tag1_ || x1.tag2_ != x2.tag2_; + } + + friend bool operator<(movable const& x1, movable const& x2) + { + BOOST_TEST(x1.tag1_ != -1 && x2.tag1_ != -1); + return x1.tag1_ < x2.tag1_ || + (x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_); + } + + friend movable generate(movable const*, random_generator g) + { + int* x = 0; + return movable(generate(x, g), generate(x, g)); + } + + friend std::ostream& operator<<(std::ostream& out, movable const& o) + { + return out << "(" << o.tag1_ << "," << o.tag2_ << ")"; + } +}; + +class implicitly_convertible : private counted_object +{ + int tag1_, tag2_; + + public: + explicit implicitly_convertible(int t1 = 0, int t2 = 0) + : tag1_(t1), tag2_(t2) + { + } + + operator object() const { return object(tag1_, tag2_); } + + operator movable() const { return movable(tag1_, tag2_); } + + friend implicitly_convertible generate( + implicitly_convertible const*, random_generator g) + { + int* x = 0; + return implicitly_convertible(generate(x, g), generate(x, g)); + } + + friend std::ostream& operator<<( + std::ostream& out, implicitly_convertible const& o) + { + return out << "(" << o.tag1_ << "," << o.tag2_ << ")"; + } +}; + +// Note: This is a deliberately bad hash function. +class hash +{ + int type_; + + public: + explicit hash(int t = 0) : type_(t) {} + + std::size_t operator()(object const& x) const + { + int result; + switch (type_) { + case 1: + result = x.tag1_; + break; + case 2: + result = x.tag2_; + break; + default: + result = x.tag1_ + x.tag2_; + } + return static_cast(result); + } + + std::size_t operator()(movable const& x) const + { + int result; + switch (type_) { + case 1: + result = x.tag1_; + break; + case 2: + result = x.tag2_; + break; + default: + result = x.tag1_ + x.tag2_; + } + return static_cast(result); + } + + std::size_t operator()(int x) const + { + int result; + switch (type_) { + case 1: + result = x; + break; + case 2: + result = x * 7; + break; + default: + result = x * 256; + } + return static_cast(result); + } + + friend bool operator==(hash const& x1, hash const& x2) + { + return x1.type_ == x2.type_; + } + + friend bool operator!=(hash const& x1, hash const& x2) + { + return x1.type_ != x2.type_; + } +}; + +std::size_t hash_value(test::object const& x) { return hash()(x); } + +std::size_t hash_value(test::movable const& x) { return hash()(x); } + +class less +{ + int type_; + + public: + explicit less(int t = 0) : type_(t) {} + + bool operator()(object const& x1, object const& x2) const + { + switch (type_) { + case 1: + return x1.tag1_ < x2.tag1_; + case 2: + return x1.tag2_ < x2.tag2_; + default: + return x1 < x2; + } + } + + bool operator()(movable const& x1, movable const& x2) const + { + switch (type_) { + case 1: + return x1.tag1_ < x2.tag1_; + case 2: + return x1.tag2_ < x2.tag2_; + default: + return x1 < x2; + } + } + + std::size_t operator()(int x1, int x2) const { return x1 < x2; } + + friend bool operator==(less const& x1, less const& x2) + { + return x1.type_ == x2.type_; + } +}; + +class equal_to +{ + int type_; + + public: + explicit equal_to(int t = 0) : type_(t) {} + + bool operator()(object const& x1, object const& x2) const + { + switch (type_) { + case 1: + return x1.tag1_ == x2.tag1_; + case 2: + return x1.tag2_ == x2.tag2_; + default: + return x1 == x2; + } + } + + bool operator()(movable const& x1, movable const& x2) const + { + switch (type_) { + case 1: + return x1.tag1_ == x2.tag1_; + case 2: + return x1.tag2_ == x2.tag2_; + default: + return x1 == x2; + } + } + + std::size_t operator()(int x1, int x2) const { return x1 == x2; } + + friend bool operator==(equal_to const& x1, equal_to const& x2) + { + return x1.type_ == x2.type_; + } + + friend bool operator!=(equal_to const& x1, equal_to const& x2) + { + return x1.type_ != x2.type_; + } + + friend less create_compare(equal_to x) { return less(x.type_); } +}; + +// allocator1 only has the old fashioned 'construct' method and has +// a few less typedefs. allocator2 uses a custom pointer class. + +template class allocator1 +{ + public: + int tag_; + + typedef T value_type; + + template struct rebind + { + typedef allocator1 other; + }; + + explicit allocator1(int t = 0) : tag_(t) + { + detail::tracker.allocator_ref(); + } + + template allocator1(allocator1 const& x) : tag_(x.tag_) + { + detail::tracker.allocator_ref(); + } + + allocator1(allocator1 const& x) : tag_(x.tag_) + { + detail::tracker.allocator_ref(); + } + + ~allocator1() { detail::tracker.allocator_unref(); } + + T* allocate(std::size_t n) + { + T* ptr(static_cast(::operator new(n * sizeof(T)))); + detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return ptr; + } + + T* allocate(std::size_t n, void const*) + { + T* ptr(static_cast(::operator new(n * sizeof(T)))); + detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return ptr; + } + + void deallocate(T* p, std::size_t n) + { + detail::tracker.track_deallocate((void*)p, n, sizeof(T), tag_); + ::operator delete((void*)p); + } + +#if BOOST_UNORDERED_CXX11_CONSTRUCTION + template void construct(U* p, Args&&... args) + { + detail::tracker.track_construct((void*)p, sizeof(U), tag_); + new (p) U(boost::forward(args)...); + } + + template void destroy(U* p) + { + detail::tracker.track_destroy((void*)p, sizeof(U), tag_); + p->~U(); + + // Work around MSVC buggy unused parameter warning. + ignore_variable(&p); + } +#else + private: + // I'm going to claim in the documentation that construct/destroy + // is never used when C++11 support isn't available, so might as + // well check that in the text. + // TODO: Or maybe just disallow them for values? + template void construct(U* p); + template void construct(U* p, A0 const&); + template + void construct(U* p, A0 const&, A1 const&); + template + void construct(U* p, A0 const&, A1 const&, A2 const&); + template void destroy(U* p); + + public: +#endif + + bool operator==(allocator1 const& x) const { return tag_ == x.tag_; } + + bool operator!=(allocator1 const& x) const { return tag_ != x.tag_; } + + enum + { + is_select_on_copy = false, + is_propagate_on_swap = false, + is_propagate_on_assign = false, + is_propagate_on_move = false + }; +}; + +template class ptr; +template class const_ptr; + +struct void_ptr +{ +#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) + template friend class ptr; + + private: +#endif + + void* ptr_; + + public: + void_ptr() : ptr_(0) {} + + template explicit void_ptr(ptr const& x) : ptr_(x.ptr_) {} + + // I'm not using the safe bool idiom because the containers should be + // able to cope with bool conversions. + operator bool() const { return !!ptr_; } + + bool operator==(void_ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(void_ptr const& x) const { return ptr_ != x.ptr_; } +}; + +class void_const_ptr +{ +#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) + template friend class const_ptr; + + private: +#endif + + void* ptr_; + + public: + void_const_ptr() : ptr_(0) {} + + template + explicit void_const_ptr(const_ptr const& x) : ptr_(x.ptr_) + { + } + + // I'm not using the safe bool idiom because the containers should be + // able to cope with bool conversions. + operator bool() const { return !!ptr_; } + + bool operator==(void_const_ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(void_const_ptr const& x) const { return ptr_ != x.ptr_; } +}; + +template class ptr +{ + friend class allocator2; + friend class const_ptr; + friend struct void_ptr; + + T* ptr_; + + ptr(T* x) : ptr_(x) {} + public: + ptr() : ptr_(0) {} + explicit ptr(void_ptr const& x) : ptr_((T*)x.ptr_) {} + + T& operator*() const { return *ptr_; } + T* operator->() const { return ptr_; } + ptr& operator++() + { + ++ptr_; + return *this; + } + ptr operator++(int) + { + ptr tmp(*this); + ++ptr_; + return tmp; + } + ptr operator+(std::ptrdiff_t s) const { return ptr(ptr_ + s); } + friend ptr operator+(std::ptrdiff_t s, ptr p) { return ptr(s + p.ptr_); } + T& operator[](std::ptrdiff_t s) const { return ptr_[s]; } + bool operator!() const { return !ptr_; } + + // I'm not using the safe bool idiom because the containers should be + // able to cope with bool conversions. + operator bool() const { return !!ptr_; } + + bool operator==(ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(ptr const& x) const { return ptr_ != x.ptr_; } + bool operator<(ptr const& x) const { return ptr_ < x.ptr_; } + bool operator>(ptr const& x) const { return ptr_ > x.ptr_; } + bool operator<=(ptr const& x) const { return ptr_ <= x.ptr_; } + bool operator>=(ptr const& x) const { return ptr_ >= x.ptr_; } +}; + +template class const_ptr +{ + friend class allocator2; + friend struct const_void_ptr; + + T const* ptr_; + + const_ptr(T const* ptr) : ptr_(ptr) {} + public: + const_ptr() : ptr_(0) {} + const_ptr(ptr const& x) : ptr_(x.ptr_) {} + explicit const_ptr(void_const_ptr const& x) : ptr_((T const*)x.ptr_) {} + + T const& operator*() const { return *ptr_; } + T const* operator->() const { return ptr_; } + const_ptr& operator++() + { + ++ptr_; + return *this; + } + const_ptr operator++(int) + { + const_ptr tmp(*this); + ++ptr_; + return tmp; + } + const_ptr operator+(std::ptrdiff_t s) const { return const_ptr(ptr_ + s); } + friend const_ptr operator+(std::ptrdiff_t s, const_ptr p) + { + return ptr(s + p.ptr_); + } + T const& operator[](int s) const { return ptr_[s]; } + bool operator!() const { return !ptr_; } + operator bool() const { return !!ptr_; } + + bool operator==(const_ptr const& x) const { return ptr_ == x.ptr_; } + bool operator!=(const_ptr const& x) const { return ptr_ != x.ptr_; } + bool operator<(const_ptr const& x) const { return ptr_ < x.ptr_; } + bool operator>(const_ptr const& x) const { return ptr_ > x.ptr_; } + bool operator<=(const_ptr const& x) const { return ptr_ <= x.ptr_; } + bool operator>=(const_ptr const& x) const { return ptr_ >= x.ptr_; } +}; + +template class allocator2 +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS + public: +#else + template friend class allocator2; +#endif + int tag_; + + public: + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef void_ptr void_pointer; + typedef void_const_ptr const_void_pointer; + typedef ptr pointer; + typedef const_ptr const_pointer; + typedef T& reference; + typedef T const& const_reference; + typedef T value_type; + + template struct rebind + { + typedef allocator2 other; + }; + + explicit allocator2(int t = 0) : tag_(t) + { + detail::tracker.allocator_ref(); + } + + template allocator2(allocator2 const& x) : tag_(x.tag_) + { + detail::tracker.allocator_ref(); + } + + allocator2(allocator2 const& x) : tag_(x.tag_) + { + detail::tracker.allocator_ref(); + } + + ~allocator2() { detail::tracker.allocator_unref(); } + + pointer address(reference r) { return pointer(&r); } + + const_pointer address(const_reference r) { return const_pointer(&r); } + + pointer allocate(size_type n) + { + pointer p(static_cast(::operator new(n * sizeof(T)))); + detail::tracker.track_allocate((void*)p.ptr_, n, sizeof(T), tag_); + return p; + } + + pointer allocate(size_type n, void const*) + { + pointer ptr(static_cast(::operator new(n * sizeof(T)))); + detail::tracker.track_allocate((void*)ptr, n, sizeof(T), tag_); + return ptr; + } + + void deallocate(pointer p, size_type n) + { + detail::tracker.track_deallocate((void*)p.ptr_, n, sizeof(T), tag_); + ::operator delete((void*)p.ptr_); + } + + void construct(T* p, T const& t) + { + detail::tracker.track_construct((void*)p, sizeof(T), tag_); + new (p) T(t); + } + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template void construct(T* p, BOOST_FWD_REF(Args)... args) + { + detail::tracker.track_construct((void*)p, sizeof(T), tag_); + new (p) T(boost::forward(args)...); + } +#endif + + void destroy(T* p) + { + detail::tracker.track_destroy((void*)p, sizeof(T), tag_); + p->~T(); + } + + size_type max_size() const + { + return (std::numeric_limits::max)(); + } + + bool operator==(allocator2 const& x) const { return tag_ == x.tag_; } + + bool operator!=(allocator2 const& x) const { return tag_ != x.tag_; } + + enum + { + is_select_on_copy = false, + is_propagate_on_swap = false, + is_propagate_on_assign = false, + is_propagate_on_move = false + }; +}; + +template +bool equivalent_impl( + allocator1 const& x, allocator1 const& y, test::derived_type) +{ + return x == y; +} + +template +bool equivalent_impl( + allocator2 const& x, allocator2 const& y, test::derived_type) +{ + return x == y; +} +} + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/allocator_traits.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/allocator_traits.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dac415c4bb735119f464fa9cd1b8a8172bc5687f --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/allocator_traits.cpp @@ -0,0 +1,283 @@ + +// Copyright 2011 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +// Boilerplate + +#define ALLOCATOR_METHODS(name) \ + template struct rebind \ + { \ + typedef name other; \ + }; \ + \ + name() {} \ + template name(name const&) {} \ + T* address(T& r) { return &r; } \ + T const* address(T const& r) { return &r; } \ + T* allocate(std::size_t n) \ + { \ + return static_cast(::operator new(n * sizeof(T))); \ + } \ + T* allocate(std::size_t n, void const*) \ + { \ + return static_cast(::operator new(n * sizeof(T))); \ + } \ + void deallocate(T* p, std::size_t) { ::operator delete((void*)p); } \ + void construct(T* p, T const& t) { new (p) T(t); } \ + void destroy(T* p) { p->~T(); } \ + std::size_t max_size() const \ + { \ + return (std::numeric_limits::max)(); \ + } \ + bool operator==(name const&) { return true; } \ + bool operator!=(name const&) { return false; } \ +/**/ + +#define ALLOCATOR_METHODS_TYPEDEFS(name) \ + template struct rebind \ + { \ + typedef name other; \ + }; \ + \ + name() {} \ + template name(name const&) {} \ + pointer address(T& r) { return &r; } \ + const_pointer address(T const& r) { return &r; } \ + pointer allocate(std::size_t n) \ + { \ + return pointer(::operator new(n * sizeof(T))); \ + } \ + pointer allocate(std::size_t n, void const*) \ + { \ + return pointer(::operator new(n * sizeof(T))); \ + } \ + void deallocate(pointer p, std::size_t) { ::operator delete((void*)p); } \ + void construct(T* p, T const& t) { new (p) T(t); } \ + void destroy(T* p) { p->~T(); } \ + size_type max_size() const \ + { \ + return (std::numeric_limits::max)(); \ + } \ + bool operator==(name const&) { return true; } \ + bool operator!=(name const&) { return false; } \ +/**/ + +struct yes_type +{ + enum + { + value = true + }; +}; +struct no_type +{ + enum + { + value = false + }; +}; + +// For tracking calls... + +static int selected; +void reset() { selected = 0; } + +template int call_select() +{ + typedef boost::unordered::detail::allocator_traits traits; + Allocator a; + + reset(); + BOOST_TEST(traits::select_on_container_copy_construction(a) == a); + return selected; +} + +// Empty allocator test + +template struct empty_allocator +{ + typedef T value_type; + ALLOCATOR_METHODS(empty_allocator) +}; + +void test_empty_allocator() +{ + typedef empty_allocator allocator; + typedef boost::unordered::detail::allocator_traits traits; +#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1 + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); +#else + BOOST_STATIC_ASSERT( + (boost::is_same::value)); +#endif + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_TEST(!traits::propagate_on_container_copy_assignment::value); + BOOST_TEST(!traits::propagate_on_container_move_assignment::value); + BOOST_TEST(!traits::propagate_on_container_swap::value); + BOOST_TEST(call_select() == 0); +} + +// allocator 1 + +template struct allocator1 +{ + typedef T value_type; + ALLOCATOR_METHODS(allocator1) + + typedef yes_type propagate_on_container_copy_assignment; + typedef yes_type propagate_on_container_move_assignment; + typedef yes_type propagate_on_container_swap; + + allocator1 select_on_container_copy_construction() const + { + ++selected; + return allocator1(); + } +}; + +void test_allocator1() +{ + typedef allocator1 allocator; + typedef boost::unordered::detail::allocator_traits traits; +#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1 + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); +#else + BOOST_STATIC_ASSERT( + (boost::is_same::value)); +#endif + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_TEST(traits::propagate_on_container_copy_assignment::value); + BOOST_TEST(traits::propagate_on_container_move_assignment::value); + BOOST_TEST(traits::propagate_on_container_swap::value); + BOOST_TEST(call_select() == 1); +} + +// allocator 2 + +template struct allocator2_base +{ + Alloc select_on_container_copy_construction() const + { + ++selected; + return Alloc(); + } +}; + +template struct allocator2 : allocator2_base > +{ + typedef T value_type; + typedef T* pointer; + typedef T const* const_pointer; + typedef std::size_t size_type; + + ALLOCATOR_METHODS(allocator2) + + typedef no_type propagate_on_container_copy_assignment; + typedef no_type propagate_on_container_move_assignment; + typedef no_type propagate_on_container_swap; +}; + +void test_allocator2() +{ + typedef allocator2 allocator; + typedef boost::unordered::detail::allocator_traits traits; + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_TEST(!traits::propagate_on_container_copy_assignment::value); + BOOST_TEST(!traits::propagate_on_container_move_assignment::value); + BOOST_TEST(!traits::propagate_on_container_swap::value); + BOOST_TEST(call_select() == 1); +} + +// allocator 3 + +template struct ptr +{ + T* value_; + + ptr(void* v) : value_((T*)v) {} + T& operator*() const { return *value_; } +}; + +template <> struct ptr +{ + void* value_; + ptr(void* v) : value_(v) {} +}; + +template <> struct ptr +{ + void const* value_; + ptr(void const* v) : value_(v) {} +}; + +template struct allocator3 +{ + typedef T value_type; + typedef ptr pointer; + typedef ptr const_pointer; + typedef unsigned short size_type; + + ALLOCATOR_METHODS_TYPEDEFS(allocator3) + + typedef yes_type propagate_on_container_copy_assignment; + typedef no_type propagate_on_container_move_assignment; + + allocator3 select_on_container_copy_construction() const + { + ++selected; + return allocator3(); + } +}; + +void test_allocator3() +{ + typedef allocator3 allocator; + typedef boost::unordered::detail::allocator_traits traits; + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same >::value)); + BOOST_STATIC_ASSERT( + (boost::is_same >::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_TEST(traits::propagate_on_container_copy_assignment::value); + BOOST_TEST(!traits::propagate_on_container_move_assignment::value); + BOOST_TEST(!traits::propagate_on_container_swap::value); + BOOST_TEST(call_select() == 1); +} + +int main() +{ + test_empty_allocator(); + test_allocator1(); + test_allocator2(); + test_allocator3(); + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/assign_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/assign_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3aee219881f04e394694ee1efadbf0e7bc458479 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/assign_tests.cpp @@ -0,0 +1,300 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../objects/cxx11_allocator.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/equivalent.hpp" + +#if defined(BOOST_MSVC) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +namespace assign_tests { + +test::seed_t initialize_seed(96785); + +template void assign_tests1(T*, test::random_generator generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf; + BOOST_DEDUCED_TYPENAME T::key_equal eq; + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests1.1\n"; + { + test::check_instances check_; + + T x; + x = x; + BOOST_TEST(x.empty()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests1.2\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + T x(v.begin(), v.end()); + + test::ordered tracker = test::create_ordered(x); + tracker.insert_range(v.begin(), v.end()); + + x = x; + tracker.compare(x); + + T y; + y.max_load_factor(x.max_load_factor() / 20); + float mlf = x.max_load_factor(); + y = x; + tracker.compare(x); + tracker.compare(y); + BOOST_TEST(x.max_load_factor() == mlf); + BOOST_TEST(y.max_load_factor() == mlf); + BOOST_TEST(y.load_factor() <= y.max_load_factor()); + } +} + +template void assign_tests2(T*, test::random_generator generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf1(1); + BOOST_DEDUCED_TYPENAME T::hasher hf2(2); + BOOST_DEDUCED_TYPENAME T::key_equal eq1(1); + BOOST_DEDUCED_TYPENAME T::key_equal eq2(2); + BOOST_DEDUCED_TYPENAME T::allocator_type al1(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al2(2); + + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.0 - empty container\n"; + { + test::check_instances check_; + + T x1(0, hf1, eq1); + T x2(0, hf2, eq2); + x2 = x1; + BOOST_TEST(test::equivalent(x1.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x1.key_eq(), eq1)); + BOOST_TEST(test::equivalent(x2.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x2.key_eq(), eq1)); + test::check_container(x1, x2); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.1\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + T x1(v.begin(), v.end(), 0, hf1, eq1); + T x2(0, hf2, eq2); + x2 = x1; + BOOST_TEST(test::equivalent(x1.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x1.key_eq(), eq1)); + BOOST_TEST(test::equivalent(x2.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x2.key_eq(), eq1)); + test::check_container(x1, v); + test::check_container(x2, v); + BOOST_TEST(x2.load_factor() <= x2.max_load_factor()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.1a\n"; + { + test::check_instances check_; + + test::random_values v1(0, generator); + test::random_values v2(1000, generator); + T x1(0, hf2, eq2); + T x2(v2.begin(), v2.end(), 0, hf1, eq1); + x2 = x1; + BOOST_TEST(test::equivalent(x1.hash_function(), hf2)); + BOOST_TEST(test::equivalent(x1.key_eq(), eq2)); + BOOST_TEST(test::equivalent(x2.hash_function(), hf2)); + BOOST_TEST(test::equivalent(x2.key_eq(), eq2)); + test::check_container(x1, v1); + test::check_container(x2, v1); + BOOST_TEST(x2.load_factor() <= x2.max_load_factor()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.2\n"; + { + test::check_instances check_; + + test::random_values v1(100, generator), v2(100, generator); + T x1(v1.begin(), v1.end(), 0, hf1, eq1, al1); + T x2(v2.begin(), v2.end(), 0, hf2, eq2, al2); + x2 = x1; + BOOST_TEST(test::equivalent(x2.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x2.key_eq(), eq1)); + if (allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(x2.get_allocator(), al1)); + BOOST_TEST(!test::equivalent(x2.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(x2.get_allocator(), al2)); + BOOST_TEST(!test::equivalent(x2.get_allocator(), al1)); + } + test::check_container(x1, v1); + test::check_container(x2, v1); + BOOST_TEST(x2.load_factor() <= x2.max_load_factor()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.3\n"; + { + test::check_instances check_; + + test::random_values v1(100, generator), v2(1000, generator); + T x1(v1.begin(), v1.end(), 0, hf1, eq1, al1); + T x2(v2.begin(), v2.end(), 0, hf2, eq2, al2); + x2 = x1; + BOOST_TEST(test::equivalent(x2.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x2.key_eq(), eq1)); + if (allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(x2.get_allocator(), al1)); + BOOST_TEST(!test::equivalent(x2.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(x2.get_allocator(), al2)); + BOOST_TEST(!test::equivalent(x2.get_allocator(), al1)); + } + test::check_container(x1, v1); + test::check_container(x2, v1); + BOOST_TEST(x2.load_factor() <= x2.max_load_factor()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "assign_tests2.4\n"; + { + test::check_instances check_; + + test::random_values v1(1000, generator), v2(100, generator); + T x1(v1.begin(), v1.end(), 0, hf1, eq1, al1); + T x2(v2.begin(), v2.end(), 0, hf2, eq2, al2); + x2 = x1; + BOOST_TEST(test::equivalent(x2.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x2.key_eq(), eq1)); + if (allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(x2.get_allocator(), al1)); + BOOST_TEST(!test::equivalent(x2.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(x2.get_allocator(), al2)); + BOOST_TEST(!test::equivalent(x2.get_allocator(), al1)); + } + test::check_container(x1, v1); + test::check_container(x2, v1); + BOOST_TEST(x2.load_factor() <= x2.max_load_factor()); + } +} + +boost::unordered_map >* test_map_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +boost::unordered_set >* + test_set_prop_assign; +boost::unordered_multiset >* + test_multiset_prop_assign; +boost::unordered_map >* + test_map_prop_assign; +boost::unordered_multimap >* + test_multimap_prop_assign; + +boost::unordered_set >* + test_set_no_prop_assign; +boost::unordered_multiset >* + test_multiset_no_prop_assign; +boost::unordered_map >* + test_map_no_prop_assign; +boost::unordered_multimap >* + test_multimap_no_prop_assign; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +template bool is_propagate(T*) +{ + return T::allocator_type::is_propagate_on_assign; +} + +UNORDERED_AUTO_TEST(check_traits) +{ + BOOST_TEST(!is_propagate(test_set)); + BOOST_TEST(is_propagate(test_set_prop_assign)); + BOOST_TEST(!is_propagate(test_set_no_prop_assign)); +} + +UNORDERED_TEST(assign_tests1, + ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)( + test_set_prop_assign)(test_multiset_prop_assign)(test_map_prop_assign)( + test_multimap_prop_assign)(test_set_no_prop_assign)( + test_multiset_no_prop_assign)(test_map_no_prop_assign)( + test_multimap_no_prop_assign))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST( + assign_tests2, ((test_set)(test_multiset)(test_map)(test_multimap)( + test_set_prop_assign)(test_multiset_prop_assign)( + test_map_prop_assign)(test_multimap_prop_assign)( + test_set_no_prop_assign)(test_multiset_no_prop_assign)( + test_map_no_prop_assign)(test_multimap_no_prop_assign))( + (default_generator)(generate_collisions)(limited_range))) + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + +UNORDERED_AUTO_TEST(assign_default_initializer_list) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Initializer List Tests\n"; + std::initializer_list > init; + boost::unordered_map x1; + x1[25] = 3; + x1[16] = 10; + BOOST_TEST(!x1.empty()); + x1 = init; + BOOST_TEST(x1.empty()); +} + +#endif + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) +UNORDERED_AUTO_TEST(assign_initializer_list) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Initializer List Tests\n"; + + boost::unordered_set x; + x.insert(10); + x.insert(20); + x = {1, 2, -10}; + BOOST_TEST(x.find(10) == x.end()); + BOOST_TEST(x.find(-10) != x.end()); +} + +#endif +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/at_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/at_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a948aeff04a7e0f5cadce494016886b2fa061e95 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/at_tests.cpp @@ -0,0 +1,68 @@ + +// Copyright 2007-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include + +namespace at_tests { + +UNORDERED_AUTO_TEST(at_tests) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Create Map" << std::endl; + + boost::unordered_map x; + boost::unordered_map const& x_const(x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Check empty container" << std::endl; + + try { + x.at("one"); + BOOST_ERROR("Should have thrown."); + } catch (std::out_of_range) { + } + + try { + x_const.at("one"); + BOOST_ERROR("Should have thrown."); + } catch (std::out_of_range) { + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Add elements" << std::endl; + + x["one"] = 1; + x["two"] = 2; + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Check existing elements" << std::endl; + + BOOST_TEST(x.at("one") == 1); + BOOST_TEST(x.at("two") == 2); + BOOST_TEST(x_const.at("one") == 1); + BOOST_TEST(x_const.at("two") == 2); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Check missing element" << std::endl; + + try { + x.at("three"); + BOOST_ERROR("Should have thrown."); + } catch (std::out_of_range) { + } + + try { + x_const.at("three"); + BOOST_ERROR("Should have thrown."); + } catch (std::out_of_range) { + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Finished" << std::endl; +} +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/bucket_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/bucket_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9cb5bdd427b8a022e296c3cf93a6c2fd9eb5fe59 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/bucket_tests.cpp @@ -0,0 +1,96 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include +#include "../objects/test.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/helpers.hpp" + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) +#pragma warning(disable : 4267) // conversion from 'size_t' to 'unsigned int', + // possible loss of data. +#endif + +namespace bucket_tests { + +test::seed_t initialize_seed(54635); + +template void tests(X*, test::random_generator generator) +{ + test::check_instances check_; + + typedef BOOST_DEDUCED_TYPENAME X::size_type size_type; + typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator; + test::random_values v(1000, generator); + + X x(v.begin(), v.end()); + + BOOST_TEST(x.bucket_count() <= x.max_bucket_count()); + if (!(x.bucket_count() <= x.max_bucket_count())) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << x.bucket_count() + << "<=" << x.max_bucket_count() << "\n"; + } + + for (BOOST_DEDUCED_TYPENAME test::random_values::const_iterator + it = v.begin(), + end = v.end(); + it != end; ++it) { + size_type bucket = x.bucket(test::get_key(*it)); + + BOOST_TEST(bucket < x.bucket_count()); + if (bucket < x.bucket_count()) { + // lit? lend?? I need a new naming scheme. + const_local_iterator lit = x.begin(bucket), lend = x.end(bucket); + while (lit != lend && + test::get_key(*it) != test::get_key(*lit)) { + ++lit; + } + BOOST_TEST(lit != lend); + } + } + + for (size_type i = 0; i < x.bucket_count(); ++i) { + BOOST_TEST(x.bucket_size(i) == + static_cast(std::distance(x.begin(i), x.end(i)))); + BOOST_TEST(x.bucket_size(i) == static_cast(std::distance( + x.cbegin(i), x.cend(i)))); + X const& x_ref = x; + BOOST_TEST(x.bucket_size(i) == static_cast(std::distance( + x_ref.begin(i), x_ref.end(i)))); + BOOST_TEST(x.bucket_size(i) == static_cast(std::distance( + x_ref.cbegin(i), x_ref.cend(i)))); + } +} + +boost::unordered_multimap >* test_multimap_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(tests, ((test_multimap_std_alloc)(test_set)(test_multiset)( + test_map)(test_multimap))((default_generator)( + generate_collisions)(limited_range))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/compile_map.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/compile_map.cpp new file mode 100644 index 0000000000000000000000000000000000000000..863b56c1169bf68e2b9fd0436e162e2839f75c31 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/compile_map.cpp @@ -0,0 +1,261 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This test creates the containers with members that meet their minimum +// requirements. Makes sure everything compiles and is defined correctly. + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/minimal.hpp" +#include "./compile_tests.hpp" + +// Explicit instantiation to catch compile-time errors + +#define INSTANTIATE(type) \ + template class boost::unordered::detail::instantiate_##type + +INSTANTIATE(map), std::equal_to, + test::minimal::allocator >; +INSTANTIATE(multimap), + std::equal_to, test::minimal::allocator >; + +INSTANTIATE(map), + test::minimal::equal_to, + test::minimal::allocator >; +INSTANTIATE(multimap), + test::minimal::equal_to, + test::minimal::allocator >; + +UNORDERED_AUTO_TEST(test0) +{ + test::minimal::constructor_param x; + + typedef std::pair + value_type; + value_type value(x, x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_map.\n"; + + boost::unordered_map int_map; + + boost::unordered_map, std::equal_to, + test::minimal::cxx11_allocator > > + int_map2; + + boost::unordered_map, + test::minimal::equal_to, + test::minimal::allocator > + map; + + container_test(int_map, std::pair(0, 0)); + container_test(int_map2, std::pair(0, 0)); + container_test(map, value); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multimap.\n"; + + boost::unordered_multimap int_multimap; + + boost::unordered_multimap, std::equal_to, + test::minimal::cxx11_allocator > > + int_multimap2; + + boost::unordered_multimap, + test::minimal::equal_to, + test::minimal::allocator > + multimap; + + container_test(int_multimap, std::pair(0, 0)); + container_test(int_multimap2, std::pair(0, 0)); + container_test(multimap, value); +} + +UNORDERED_AUTO_TEST(equality_tests) +{ + typedef std::pair< + test::minimal::copy_constructible_equality_comparable const, + test::minimal::copy_constructible_equality_comparable> + value_type; + + boost::unordered_map int_map; + + boost::unordered_map, std::equal_to, + test::minimal::cxx11_allocator > > + int_map2; + + boost::unordered_map< + test::minimal::copy_constructible_equality_comparable, + test::minimal::copy_constructible_equality_comparable, + test::minimal::hash< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::equal_to< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::allocator > + map; + + equality_test(int_map); + equality_test(int_map2); + equality_test(map); + + boost::unordered_multimap int_multimap; + + boost::unordered_multimap, std::equal_to, + test::minimal::cxx11_allocator > > + int_multimap2; + + boost::unordered_multimap< + test::minimal::copy_constructible_equality_comparable, + test::minimal::copy_constructible_equality_comparable, + test::minimal::hash< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::equal_to< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::allocator > + multimap; + + equality_test(int_multimap); + equality_test(int_multimap2); + equality_test(multimap); +} + +UNORDERED_AUTO_TEST(test1) +{ + boost::hash hash; + std::equal_to equal_to; + int value = 0; + std::pair map_value(0, 0); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_map.\n"; + + boost::unordered_map map; + + boost::unordered_map, std::equal_to, + test::minimal::cxx11_allocator > > + map2; + + unordered_unique_test(map, map_value); + unordered_map_test(map, value, value); + unordered_copyable_test(map, value, map_value, hash, equal_to); + unordered_map_functions(map, value, value); + + unordered_unique_test(map2, map_value); + unordered_map_test(map2, value, value); + unordered_copyable_test(map2, value, map_value, hash, equal_to); + unordered_map_functions(map2, value, value); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multimap.\n"; + + boost::unordered_multimap multimap; + + boost::unordered_multimap, std::equal_to, + test::minimal::cxx11_allocator > > + multimap2; + + unordered_equivalent_test(multimap, map_value); + unordered_map_test(multimap, value, value); + unordered_copyable_test(multimap, value, map_value, hash, equal_to); + + unordered_equivalent_test(multimap2, map_value); + unordered_map_test(multimap2, value, value); + unordered_copyable_test(multimap2, value, map_value, hash, equal_to); +} + +UNORDERED_AUTO_TEST(test2) +{ + test::minimal::constructor_param x; + + test::minimal::assignable assignable(x); + test::minimal::copy_constructible copy_constructible(x); + test::minimal::hash hash(x); + test::minimal::equal_to equal_to(x); + + typedef std::pair + map_value_type; + map_value_type map_value(assignable, assignable); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_map.\n"; + + boost::unordered_map, + test::minimal::equal_to, + test::minimal::allocator > + map; + + unordered_unique_test(map, map_value); + unordered_map_test(map, assignable, assignable); + unordered_copyable_test(map, assignable, map_value, hash, equal_to); + unordered_map_member_test(map, map_value); + + boost::unordered_map, + test::minimal::equal_to, + test::minimal::allocator > + map2; + + test::minimal::default_assignable default_assignable; + + unordered_map_functions(map2, assignable, default_assignable); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multimap.\n"; + + boost::unordered_multimap, + test::minimal::equal_to, + test::minimal::allocator > + multimap; + + unordered_equivalent_test(multimap, map_value); + unordered_map_test(multimap, assignable, assignable); + unordered_copyable_test(multimap, assignable, map_value, hash, equal_to); + unordered_map_member_test(multimap, map_value); +} + +// Test for ambiguity when using key convertible from iterator +// See LWG2059 + +struct lwg2059_key +{ + int value; + + template lwg2059_key(T v) : value(v) {} +}; + +std::size_t hash_value(lwg2059_key x) +{ + return static_cast(x.value); +} + +bool operator==(lwg2059_key x, lwg2059_key y) { return x.value == y.value; } + +UNORDERED_AUTO_TEST(lwg2059) +{ + { + boost::unordered_map x; + x.emplace(lwg2059_key(10), 5); + x.erase(x.begin()); + } + + { + boost::unordered_multimap x; + x.emplace(lwg2059_key(10), 5); + x.erase(x.begin()); + } +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/compile_set.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/compile_set.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ea71f737752ac9ce3bad8102ede828c4db5ee14 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/compile_set.cpp @@ -0,0 +1,324 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This test creates the containers with members that meet their minimum +// requirements. Makes sure everything compiles and is defined correctly. + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/minimal.hpp" +#include "./compile_tests.hpp" + +// Explicit instantiation to catch compile-time errors + +#define INSTANTIATE(type) \ + template class boost::unordered::detail::instantiate_##type + +INSTANTIATE(set), std::equal_to, + test::minimal::allocator >; +INSTANTIATE(multiset), std::equal_to, + test::minimal::allocator >; + +INSTANTIATE(set), + test::minimal::equal_to, + test::minimal::allocator >; +INSTANTIATE(multiset), + test::minimal::equal_to, + test::minimal::allocator >; + +UNORDERED_AUTO_TEST(test0) +{ + test::minimal::constructor_param x; + + test::minimal::assignable assignable(x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set.\n"; + + boost::unordered_set int_set; + + boost::unordered_set, std::equal_to, + test::minimal::cxx11_allocator > + int_set2; + + boost::unordered_set, + test::minimal::equal_to, + test::minimal::allocator > + set; + + container_test(int_set, 0); + container_test(int_set2, 0); + container_test(set, assignable); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset.\n"; + + boost::unordered_multiset int_multiset; + + boost::unordered_multiset, std::equal_to, + test::minimal::cxx11_allocator > + int_multiset2; + + boost::unordered_multiset, + test::minimal::equal_to, + test::minimal::allocator > + multiset; + + container_test(int_multiset, 0); + container_test(int_multiset2, 0); + container_test(multiset, assignable); +} + +UNORDERED_AUTO_TEST(equality_tests) +{ + typedef test::minimal::copy_constructible_equality_comparable value_type; + + boost::unordered_set int_set; + + boost::unordered_set, std::equal_to, + test::minimal::cxx11_allocator > + int_set2; + + boost::unordered_set< + test::minimal::copy_constructible_equality_comparable, + test::minimal::hash< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::equal_to< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::allocator > + set; + + equality_test(int_set); + equality_test(int_set2); + equality_test(set); + + boost::unordered_multiset int_multiset; + + boost::unordered_multiset, std::equal_to, + test::minimal::cxx11_allocator > + int_multiset2; + + boost::unordered_multiset< + test::minimal::copy_constructible_equality_comparable, + test::minimal::hash< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::equal_to< + test::minimal::copy_constructible_equality_comparable>, + test::minimal::allocator > + multiset; + + equality_test(int_multiset); + equality_test(int_multiset2); + equality_test(multiset); +} + +UNORDERED_AUTO_TEST(test1) +{ + boost::hash hash; + std::equal_to equal_to; + int value = 0; + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set." << std::endl; + + boost::unordered_set set; + + boost::unordered_set, std::equal_to, + test::minimal::cxx11_allocator > + set2; + + unordered_unique_test(set, value); + unordered_set_test(set, value); + unordered_copyable_test(set, value, value, hash, equal_to); + + unordered_unique_test(set2, value); + unordered_set_test(set2, value); + unordered_copyable_test(set2, value, value, hash, equal_to); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset." << std::endl; + + boost::unordered_multiset multiset; + + boost::unordered_multiset, std::equal_to, + test::minimal::cxx11_allocator > + multiset2; + + unordered_equivalent_test(multiset, value); + unordered_set_test(multiset, value); + unordered_copyable_test(multiset, value, value, hash, equal_to); + + unordered_equivalent_test(multiset2, value); + unordered_set_test(multiset2, value); + unordered_copyable_test(multiset2, value, value, hash, equal_to); +} + +UNORDERED_AUTO_TEST(test2) +{ + test::minimal::constructor_param x; + + test::minimal::assignable assignable(x); + test::minimal::copy_constructible copy_constructible(x); + test::minimal::hash hash(x); + test::minimal::equal_to equal_to(x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set.\n"; + + boost::unordered_set, + test::minimal::equal_to, + test::minimal::allocator > + set; + + unordered_unique_test(set, assignable); + unordered_set_test(set, assignable); + unordered_copyable_test(set, assignable, assignable, hash, equal_to); + unordered_set_member_test(set, assignable); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset.\n"; + + boost::unordered_multiset, + test::minimal::equal_to, + test::minimal::allocator > + multiset; + + unordered_equivalent_test(multiset, assignable); + unordered_set_test(multiset, assignable); + unordered_copyable_test(multiset, assignable, assignable, hash, equal_to); + unordered_set_member_test(multiset, assignable); +} + +UNORDERED_AUTO_TEST(movable1_tests) +{ + test::minimal::constructor_param x; + + test::minimal::movable1 movable1(x); + test::minimal::hash hash(x); + test::minimal::equal_to equal_to(x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set.\n"; + + boost::unordered_set, + test::minimal::equal_to, + test::minimal::allocator > + set; + + // unordered_unique_test(set, movable1); + unordered_set_test(set, movable1); + unordered_movable_test(set, movable1, movable1, hash, equal_to); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset.\n"; + + boost::unordered_multiset, + test::minimal::equal_to, + test::minimal::allocator > + multiset; + + // unordered_equivalent_test(multiset, movable1); + unordered_set_test(multiset, movable1); + unordered_movable_test(multiset, movable1, movable1, hash, equal_to); +} + +UNORDERED_AUTO_TEST(movable2_tests) +{ + test::minimal::constructor_param x; + + test::minimal::movable2 movable2(x); + test::minimal::hash hash(x); + test::minimal::equal_to equal_to(x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set.\n"; + + boost::unordered_set, + test::minimal::equal_to, + test::minimal::allocator > + set; + + // unordered_unique_test(set, movable2); + unordered_set_test(set, movable2); + unordered_movable_test(set, movable2, movable2, hash, equal_to); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset.\n"; + + boost::unordered_multiset, + test::minimal::equal_to, + test::minimal::allocator > + multiset; + + // unordered_equivalent_test(multiset, movable2); + unordered_set_test(multiset, movable2); + unordered_movable_test(multiset, movable2, movable2, hash, equal_to); +} + +UNORDERED_AUTO_TEST(destructible_tests) +{ + test::minimal::constructor_param x; + + test::minimal::destructible destructible(x); + test::minimal::hash hash(x); + test::minimal::equal_to equal_to(x); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set.\n"; + + boost::unordered_set, + test::minimal::equal_to > + set; + + unordered_destructible_test(set); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset.\n"; + + boost::unordered_multiset, + test::minimal::equal_to > + multiset; + + unordered_destructible_test(multiset); +} + +// Test for ambiguity when using key convertible from iterator +// See LWG2059 + +struct lwg2059_key +{ + int value; + + template lwg2059_key(T v) : value(v) {} +}; + +std::size_t hash_value(lwg2059_key x) +{ + return static_cast(x.value); +} + +bool operator==(lwg2059_key x, lwg2059_key y) { return x.value == y.value; } + +UNORDERED_AUTO_TEST(lwg2059) +{ + { + boost::unordered_set x; + x.emplace(lwg2059_key(10)); + x.erase(x.begin()); + } + + { + boost::unordered_multiset x; + x.emplace(lwg2059_key(10)); + x.erase(x.begin()); + } +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/compile_tests.hpp b/tools/boost_1_65_1/libs/unordered/test/unordered/compile_tests.hpp new file mode 100644 index 0000000000000000000000000000000000000000..af9136148f1ae26c4cd65765e98c990ea833b9fa --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/compile_tests.hpp @@ -0,0 +1,839 @@ + +// Copyright 2005-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable : 4100) // unreferenced formal parameter +#pragma warning(disable : 4610) // class can never be instantiated +#pragma warning(disable : 4510) // default constructor could not be generated +#endif + +#include + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + +#include "../helpers/check_return_type.hpp" +#include +#include +#include +#include +#include +#include +#include +#include + +typedef long double comparison_type; + +template void sink(T const&) {} +template T rvalue(T const& v) { return v; } +template T rvalue_default() { return T(); } + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) +template T implicit_construct() { return {}; } +#else +template int implicit_construct() +{ + T x; + sink(x); + return 0; +} +#endif + +#if !defined(BOOST_NO_CXX11_NOEXCEPT) +#define TEST_NOEXCEPT_EXPR(x) BOOST_STATIC_ASSERT((BOOST_NOEXCEPT_EXPR(x))); +#else +#define TEST_NOEXCEPT_EXPR(x) +#endif + +template void container_test(X& r, T const&) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::difference_type difference_type; + typedef BOOST_DEDUCED_TYPENAME X::size_type size_type; + + typedef BOOST_DEDUCED_TYPENAME boost::iterator_value::type + iterator_value_type; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_value::type + const_iterator_value_type; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference::type + iterator_difference_type; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference< + const_iterator>::type const_iterator_difference_type; + + typedef BOOST_DEDUCED_TYPENAME X::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME X::reference reference; + typedef BOOST_DEDUCED_TYPENAME X::const_reference const_reference; + + typedef BOOST_DEDUCED_TYPENAME X::node_type node_type; + + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + + // value_type + + BOOST_STATIC_ASSERT((boost::is_same::value)); + boost::function_requires >(); + + // reference_type / const_reference_type + + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + + // iterator + + boost::function_requires >(); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_convertible::value)); + + // const_iterator + + boost::function_requires >(); + BOOST_STATIC_ASSERT((boost::is_same::value)); + + // node_type + + BOOST_STATIC_ASSERT((boost::is_same::value)); + + // difference_type + + BOOST_STATIC_ASSERT(std::numeric_limits::is_signed); + BOOST_STATIC_ASSERT(std::numeric_limits::is_integer); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + + // size_type + + BOOST_STATIC_ASSERT(!std::numeric_limits::is_signed); + BOOST_STATIC_ASSERT(std::numeric_limits::is_integer); + + // size_type can represent any non-negative value type of difference_type + // I'm not sure about either of these tests... + size_type max_diff = + static_cast((std::numeric_limits::max)()); + difference_type converted_diff(static_cast(max_diff)); + BOOST_TEST((std::numeric_limits::max)() == converted_diff); + + BOOST_TEST( + static_cast((std::numeric_limits::max)()) > + static_cast( + (std::numeric_limits::max)())); + +// Constructors + +// I don't test the runtime post-conditions here. + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + // It isn't specified in the container requirements that the no argument + // constructor is implicit, but it is defined that way in the concrete + // container specification. + X u_implicit = {}; + sink(u_implicit); +#endif + + X u; + BOOST_TEST(u.size() == 0); + BOOST_TEST(X().size() == 0); + + X a, b; + X a_const; + + sink(X(a)); + X u2(a); + X u3 = a; + X u4(rvalue(a_const)); + X u5 = rvalue(a_const); + + a.swap(b); + boost::swap(a, b); + test::check_return_type::equals_ref(r = a); + + // Allocator + + test::check_return_type::equals(a_const.get_allocator()); + + allocator_type m = a.get_allocator(); + sink(X(m)); + X c(m); + sink(X(a_const, m)); + X c2(a_const, m); + sink(X(rvalue(a_const), m)); + X c3(rvalue(a_const), m); + + // node_type + + implicit_construct(); +#if !BOOST_COMP_GNUC || BOOST_COMP_GNUC >= BOOST_VERSION_NUMBER(4, 8, 0) + TEST_NOEXCEPT_EXPR(node_type()); +#endif + + node_type n1; + node_type n2(rvalue_default()); +#if !BOOST_COMP_GNUC || BOOST_COMP_GNUC >= BOOST_VERSION_NUMBER(4, 8, 0) + TEST_NOEXCEPT_EXPR(node_type(boost::move(n1))); +#endif + node_type n3; + n3 = boost::move(n2); + n1.swap(n3); + swap(n1, n3); + // TODO: noexcept for swap? + // value, key, mapped tests in map and set specific testing. + + node_type const n_const; + BOOST_TEST(n_const ? 0 : 1); + TEST_NOEXCEPT_EXPR(n_const ? 0 : 1); + test::check_return_type::equals(!n_const); + test::check_return_type::equals(n_const.empty()); + TEST_NOEXCEPT_EXPR(!n_const); + TEST_NOEXCEPT_EXPR(n_const.empty()); + + // Avoid unused variable warnings: + + sink(u); + sink(u2); + sink(u3); + sink(u4); + sink(u5); + sink(c); + sink(c2); + sink(c3); +} + +template void unordered_destructible_test(X&) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::size_type size_type; + + X x1; + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + X x2(rvalue_default()); + X x3 = rvalue_default(); +// This can only be done if propagate_on_container_move_assignment::value +// is true. +// x2 = rvalue_default(); +#endif + + X* ptr = new X(); + X& a1 = *ptr; + (&a1)->~X(); + ::operator delete((void*)(&a1)); + + X a, b; + X const a_const; + test::check_return_type::equals(a.begin()); + test::check_return_type::equals(a_const.begin()); + test::check_return_type::equals(a.cbegin()); + test::check_return_type::equals(a_const.cbegin()); + test::check_return_type::equals(a.end()); + test::check_return_type::equals(a_const.end()); + test::check_return_type::equals(a.cend()); + test::check_return_type::equals(a_const.cend()); + + a.swap(b); + boost::swap(a, b); + + test::check_return_type::equals(a.size()); + test::check_return_type::equals(a.max_size()); + test::check_return_type::convertible(a.empty()); + + // Allocator + + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + test::check_return_type::equals(a_const.get_allocator()); +} + +template void unordered_set_test(X& r, Key const&) +{ + typedef BOOST_DEDUCED_TYPENAME X::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME X::key_type key_type; + + BOOST_STATIC_ASSERT((boost::is_same::value)); + + // iterator pointer / const_pointer_type + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + const_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + local_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer< + const_local_iterator>::type const_local_iterator_pointer; + + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + + typedef BOOST_DEDUCED_TYPENAME X::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME node_type::value_type node_value_type; + BOOST_STATIC_ASSERT((boost::is_same::value)); + + // Call node_type functions. + + test::minimal::constructor_param v; + Key k_lvalue(v); + r.emplace(boost::move(k_lvalue)); + node_type n1 = r.extract(r.begin()); + test::check_return_type::equals_ref(n1.value()); +} + +template +void unordered_map_test(X& r, Key const& k, T const& v) +{ + typedef BOOST_DEDUCED_TYPENAME X::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME X::key_type key_type; + + BOOST_STATIC_ASSERT( + (boost::is_same >::value)); + + // iterator pointer / const_pointer_type + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + const_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + local_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer< + const_local_iterator>::type const_local_iterator_pointer; + + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + + typedef BOOST_DEDUCED_TYPENAME X::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME node_type::key_type node_key_type; + typedef BOOST_DEDUCED_TYPENAME node_type::mapped_type node_mapped_type; + + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + // Superfluous,but just to make sure. + BOOST_STATIC_ASSERT((!boost::is_const::value)); + + // Calling functions + + r.insert(std::pair(k, v)); + r.insert(r.begin(), std::pair(k, v)); + std::pair const value(k, v); + r.insert(value); + r.insert(r.end(), value); + + Key k_lvalue(k); + T v_lvalue(v); + + // Emplace + + r.emplace(k, v); + r.emplace(k_lvalue, v_lvalue); + r.emplace(rvalue(k), rvalue(v)); + + r.emplace(boost::unordered::piecewise_construct, boost::make_tuple(k), + boost::make_tuple(v)); + + // Emplace with hint + + r.emplace_hint(r.begin(), k, v); + r.emplace_hint(r.begin(), k_lvalue, v_lvalue); + r.emplace_hint(r.begin(), rvalue(k), rvalue(v)); + + r.emplace_hint(r.begin(), boost::unordered::piecewise_construct, + boost::make_tuple(k), boost::make_tuple(v)); + + // Extract + + test::check_return_type::equals(r.extract(r.begin())); + + r.emplace(k, v); + test::check_return_type::equals(r.extract(k)); + + r.emplace(k, v); + node_type n1 = r.extract(r.begin()); + test::check_return_type::equals_ref(n1.key()); + test::check_return_type::equals_ref(n1.mapped()); + + node_type n2 = boost::move(n1); + r.insert(boost::move(n2)); + r.insert(r.extract(r.begin())); + n2 = r.extract(r.begin()); + r.insert(r.begin(), boost::move(n2)); + r.insert(r.end(), r.extract(r.begin())); + + node_type n = r.extract(r.begin()); + test::check_return_type::equals_ref(n.key()); + test::check_return_type::equals_ref(n.mapped()); +} + +template void equality_test(X& r) +{ + X const a = r, b = r; + + test::check_return_type::equals(a == b); + test::check_return_type::equals(a != b); + test::check_return_type::equals(boost::operator==(a, b)); + test::check_return_type::equals(boost::operator!=(a, b)); +} + +template void unordered_unique_test(X& r, T const& t) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + test::check_return_type >::equals(r.insert(t)); + test::check_return_type >::equals(r.emplace(t)); + + typedef BOOST_DEDUCED_TYPENAME X::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME X::insert_return_type insert_return_type; + + // insert_return_type + + // TODO; + // boost::function_requires + // >(); + // TODO; + // boost::function_requires + // >(); + boost::function_requires< + boost::DefaultConstructibleConcept >(); + // TODO: + // boost::function_requires + // >(); + insert_return_type insert_return, insert_return2; + test::check_return_type::equals(insert_return.inserted); + test::check_return_type::equals(insert_return.position); + test::check_return_type::equals_ref(insert_return.node); + boost::swap(insert_return, insert_return2); +} + +template void unordered_equivalent_test(X& r, T const& t) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + test::check_return_type::equals(r.insert(t)); + test::check_return_type::equals(r.emplace(t)); +} + +template +void unordered_map_functions(X&, Key const& k, T const& v) +{ + typedef BOOST_DEDUCED_TYPENAME X::mapped_type mapped_type; + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + X a; + test::check_return_type::equals_ref(a[k]); + test::check_return_type::equals_ref(a[rvalue(k)]); + test::check_return_type::equals_ref(a.at(k)); + test::check_return_type >::equals( + a.try_emplace(k, v)); + test::check_return_type >::equals( + a.try_emplace(rvalue(k), v)); + test::check_return_type::equals(a.try_emplace(a.begin(), k, v)); + test::check_return_type::equals( + a.try_emplace(a.begin(), rvalue(k), v)); + test::check_return_type >::equals( + a.insert_or_assign(k, v)); + test::check_return_type >::equals( + a.insert_or_assign(rvalue(k), v)); + test::check_return_type::equals( + a.insert_or_assign(a.begin(), k, v)); + test::check_return_type::equals( + a.insert_or_assign(a.begin(), rvalue(k), v)); + + X const b = a; + test::check_return_type::equals_ref(b.at(k)); +} + +template +void unordered_test(X& x, Key& k, Hash& hf, Pred& eq) +{ + unordered_destructible_test(x); + + typedef BOOST_DEDUCED_TYPENAME X::key_type key_type; + typedef BOOST_DEDUCED_TYPENAME X::hasher hasher; + typedef BOOST_DEDUCED_TYPENAME X::key_equal key_equal; + typedef BOOST_DEDUCED_TYPENAME X::size_type size_type; + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator; + + typedef BOOST_DEDUCED_TYPENAME + boost::BOOST_ITERATOR_CATEGORY::type iterator_category; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference::type + iterator_difference; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference::type + iterator_reference; + + typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY< + local_iterator>::type local_iterator_category; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference< + local_iterator>::type local_iterator_difference; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + local_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference< + local_iterator>::type local_iterator_reference; + + typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY< + const_iterator>::type const_iterator_category; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference< + const_iterator>::type const_iterator_difference; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer::type + const_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference< + const_iterator>::type const_iterator_reference; + + typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY< + const_local_iterator>::type const_local_iterator_category; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference< + const_local_iterator>::type const_local_iterator_difference; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer< + const_local_iterator>::type const_local_iterator_pointer; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference< + const_local_iterator>::type const_local_iterator_reference; + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + + BOOST_STATIC_ASSERT((boost::is_same::value)); + // boost::function_requires >(); + // boost::function_requires >(); + + BOOST_STATIC_ASSERT((boost::is_same::value)); + test::check_return_type::equals(hf(k)); + + BOOST_STATIC_ASSERT((boost::is_same::value)); + test::check_return_type::convertible(eq(k, k)); + + boost::function_requires >(); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT(( + boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + + boost::function_requires< + boost::InputIteratorConcept >(); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + + X a; + allocator_type m = a.get_allocator(); + + // Constructors + + X(10, hf, eq); + X a1(10, hf, eq); + X(10, hf); + X a2(10, hf); + X(10); + X a3(10); + X(); + X a4; + + X(10, hf, eq, m); + X a1a(10, hf, eq, m); + X(10, hf, m); + X a2a(10, hf, m); + X(10, m); + X a3a(10, m); + (X(m)); + X a4a(m); + + test::check_return_type::equals(a.erase(k)); + + const_iterator q1 = a.cbegin(), q2 = a.cend(); + test::check_return_type::equals(a.erase(q1, q2)); + + TEST_NOEXCEPT_EXPR(a.clear()); + a.clear(); + + X const b; + + test::check_return_type::equals(b.hash_function()); + test::check_return_type::equals(b.key_eq()); + + test::check_return_type::equals(a.find(k)); + test::check_return_type::equals(b.find(k)); + test::check_return_type::equals(b.count(k)); + test::check_return_type >::equals( + a.equal_range(k)); + test::check_return_type >::equals( + b.equal_range(k)); + test::check_return_type::equals(b.bucket_count()); + test::check_return_type::equals(b.max_bucket_count()); + test::check_return_type::equals(b.bucket(k)); + test::check_return_type::equals(b.bucket_size(0)); + + test::check_return_type::equals(a.begin(0)); + test::check_return_type::equals(b.begin(0)); + test::check_return_type::equals(a.end(0)); + test::check_return_type::equals(b.end(0)); + + test::check_return_type::equals(a.cbegin(0)); + test::check_return_type::equals(b.cbegin(0)); + test::check_return_type::equals(a.cend(0)); + test::check_return_type::equals(b.cend(0)); + + test::check_return_type::equals(b.load_factor()); + test::check_return_type::equals(b.max_load_factor()); + a.max_load_factor((float)2.0); + a.rehash(100); + + a.merge(a2); +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + a.merge(rvalue_default()); +#endif + + // Avoid unused variable warnings: + + sink(a); + sink(a1); + sink(a2); + sink(a3); + sink(a4); + sink(a1a); + sink(a2a); + sink(a3a); + sink(a4a); +} + +template +void unordered_copyable_test(X& x, Key& k, T& t, Hash& hf, Pred& eq) +{ + unordered_test(x, k, hf, eq); + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + + X a; + allocator_type m = a.get_allocator(); + + BOOST_DEDUCED_TYPENAME X::value_type* i = 0; + BOOST_DEDUCED_TYPENAME X::value_type* j = 0; + + // Constructors + + X(i, j, 10, hf, eq); + X a5(i, j, 10, hf, eq); + X(i, j, 10, hf); + X a6(i, j, 10, hf); + X(i, j, 10); + X a7(i, j, 10); + X(i, j); + X a8(i, j); + + X(i, j, 10, hf, eq, m); + X a5a(i, j, 10, hf, eq, m); + X(i, j, 10, hf, m); + X a6a(i, j, 10, hf, m); + X(i, j, 10, m); + X a7a(i, j, 10, m); + +// Not specified for some reason (maybe ambiguity with another constructor?) +// X(i, j, m); +// X a8a(i, j, m); +// sink(a8a); + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + std::size_t min_buckets = 10; + X({t}); + X({t}, min_buckets); + X({t}, min_buckets, hf); + X({t}, min_buckets, hf, eq); + // X({t}, m); + X({t}, min_buckets, m); + X({t}, min_buckets, hf, m); + X({t}, min_buckets, hf, eq, m); +#endif + + X const b; + sink(X(b)); + X a9(b); + a = b; + + sink(X(b, m)); + X a9a(b, m); + + X b1; + b1.insert(t); + X a9b(b1); + sink(a9b); + X a9c(b1, m); + sink(a9c); + + const_iterator q = a.cbegin(); + + test::check_return_type::equals(a.insert(q, t)); + test::check_return_type::equals(a.emplace_hint(q, t)); + + a.insert(i, j); +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + std::initializer_list list = {t}; + a.insert(list); + a.insert({t, t, t}); + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && \ + (!defined(__clang__) || __clang_major__ >= 4 || \ + (__clang_major__ == 3 && __clang_minor__ >= 4)) + a.insert({}); + a.insert({t}); + a.insert({t, t}); +#endif +#endif + + X a10; + a10.insert(t); + q = a10.cbegin(); + test::check_return_type::equals(a10.erase(q)); + + // Avoid unused variable warnings: + + sink(a); + sink(a5); + sink(a6); + sink(a7); + sink(a8); + sink(a9); + sink(a5a); + sink(a6a); + sink(a7a); + sink(a9a); + + typedef BOOST_DEDUCED_TYPENAME X::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + node_type const n_const = a.extract(a.begin()); + test::check_return_type::equals(n_const.get_allocator()); +} + +template +void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq) +{ + unordered_test(x, k, hf, eq); + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + X x1(rvalue_default()); + X x2(boost::move(x1)); + x1 = rvalue_default(); + x2 = boost::move(x1); +#endif + + X a; + allocator_type m = a.get_allocator(); + + test::minimal::constructor_param* i = 0; + test::minimal::constructor_param* j = 0; + + // Constructors + + X(i, j, 10, hf, eq); + X a5(i, j, 10, hf, eq); + X(i, j, 10, hf); + X a6(i, j, 10, hf); + X(i, j, 10); + X a7(i, j, 10); + X(i, j); + X a8(i, j); + + X(i, j, 10, hf, eq, m); + X a5a(i, j, 10, hf, eq, m); + X(i, j, 10, hf, m); + X a6a(i, j, 10, hf, m); + X(i, j, 10, m); + X a7a(i, j, 10, m); + + // Not specified for some reason (maybe ambiguity with another constructor?) + // X(i, j, m); + // X a8a(i, j, m); + // sink(a8a); + + const_iterator q = a.cbegin(); + + test::minimal::constructor_param v; + a.emplace(v); + test::check_return_type::equals(a.emplace_hint(q, v)); + + T v1(v); + a.emplace(boost::move(v1)); + T v2(v); + a.insert(boost::move(v2)); + T v3(v); + test::check_return_type::equals( + a.emplace_hint(q, boost::move(v3))); + T v4(v); + test::check_return_type::equals(a.insert(q, boost::move(v4))); + + a.insert(i, j); + + X a10; + T v5(v); + a10.insert(boost::move(v5)); + q = a10.cbegin(); + test::check_return_type::equals(a10.erase(q)); + + // Avoid unused variable warnings: + + sink(a); + sink(a5); + sink(a6); + sink(a7); + sink(a8); + sink(a5a); + sink(a6a); + sink(a7a); + sink(a10); +} + +template void unordered_set_member_test(X& x, T& t) +{ + X x1(x); + x1.insert(t); + x1.begin()->dummy_member(); + x1.cbegin()->dummy_member(); +} + +template void unordered_map_member_test(X& x, T& t) +{ + X x1(x); + x1.insert(t); + x1.begin()->first.dummy_member(); + x1.cbegin()->first.dummy_member(); + x1.begin()->second.dummy_member(); + x1.cbegin()->second.dummy_member(); +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/constructor_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/constructor_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4c967ded7aece5f2717688f982a7e7e47f980fe6 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/constructor_tests.cpp @@ -0,0 +1,449 @@ + +// Copyright 2006-2010 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/equivalent.hpp" +#include "../helpers/input_iterator.hpp" +#include "../helpers/invariants.hpp" + +namespace constructor_tests { + +test::seed_t initialize_seed(356730); + +template void constructor_tests1(T*, test::random_generator generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf; + BOOST_DEDUCED_TYPENAME T::key_equal eq; + BOOST_DEDUCED_TYPENAME T::allocator_type al; + + UNORDERED_SUB_TEST("Construct 1") + { + test::check_instances check_; + + T x(0, hf, eq); + BOOST_TEST(x.empty()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 2") + { + test::check_instances check_; + + T x(100, hf); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 100); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 3") + { + test::check_instances check_; + + T x(2000); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 2000); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 4") + { + test::check_instances check_; + + T x; + BOOST_TEST(x.empty()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 5") + { + test::check_instances check_; + + test::random_values v(1000, generator); + T x(v.begin(), v.end(), 10000, hf, eq); + BOOST_TEST(x.bucket_count() >= 10000); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 6") + { + test::check_instances check_; + + test::random_values v(10, generator); + T x(v.begin(), v.end(), 10000, hf); + BOOST_TEST(x.bucket_count() >= 10000); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 7") + { + test::check_instances check_; + + test::random_values v(100, generator); + T x(v.begin(), v.end(), 100); + BOOST_TEST(x.bucket_count() >= 100); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 8") + { + test::check_instances check_; + + test::random_values v(1, generator); + T x(v.begin(), v.end()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 9") + { + test::check_instances check_; + + T x(0, hf, eq, al); + BOOST_TEST(x.empty()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 10") + { + test::check_instances check_; + + test::random_values v(1000, generator); + T x(v.begin(), v.end(), 10000, hf, eq, al); + BOOST_TEST(x.bucket_count() >= 10000); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 11") + { + test::check_instances check_; + + T x(al); + BOOST_TEST(x.empty()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } +} + +template +void constructor_tests2(T*, test::random_generator const& generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf; + BOOST_DEDUCED_TYPENAME T::hasher hf1(1); + BOOST_DEDUCED_TYPENAME T::hasher hf2(2); + BOOST_DEDUCED_TYPENAME T::key_equal eq; + BOOST_DEDUCED_TYPENAME T::key_equal eq1(1); + BOOST_DEDUCED_TYPENAME T::key_equal eq2(2); + BOOST_DEDUCED_TYPENAME T::allocator_type al; + BOOST_DEDUCED_TYPENAME T::allocator_type al1(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al2(2); + + UNORDERED_SUB_TEST("Construct 1") + { + test::check_instances check_; + T x(10000, hf1, eq1); + BOOST_TEST(x.bucket_count() >= 10000); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq1)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 2") + { + test::check_instances check_; + T x(100, hf1); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 100); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 3") + { + test::check_instances check_; + test::random_values v(100, generator); + T x(v.begin(), v.end(), 0, hf1, eq1); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq1)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 4") + { + test::check_instances check_; + test::random_values v(5, generator); + T x(v.begin(), v.end(), 1000, hf1); + BOOST_TEST(x.bucket_count() >= 1000); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("Construct 5") + { + test::check_instances check_; + test::random_values v(100, generator); + T x(v.begin(), v.end(), 0, hf, eq, al1); + T y(x.begin(), x.end(), 0, hf1, eq1, al2); + test::check_container(x, v); + test::check_container(y, x); + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); + } + + UNORDERED_SUB_TEST("Construct 6") + { + test::check_instances check_; + test::random_values v(100, generator); + T x(v.begin(), v.end(), 0, hf1, eq1); + T y(x.begin(), x.end(), 0, hf, eq); + test::check_container(x, v); + test::check_container(y, x); + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); + } + + UNORDERED_SUB_TEST("Construct 7") + { + test::check_instances check_; + test::random_values v(100, generator); + T x(v.begin(), v.end(), 0, hf1, eq1); + T y(x.begin(), x.end(), 0, hf2, eq2); + test::check_container(x, v); + test::check_container(y, x); + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); + } + + UNORDERED_SUB_TEST("Construct 8 - from input iterator") + { + test::check_instances check_; + test::random_values v(100, generator); + BOOST_DEDUCED_TYPENAME test::random_values::const_iterator + v_begin = v.begin(), + v_end = v.end(); + T x(test::input_iterator(v_begin), test::input_iterator(v_end), 0, hf1, + eq1); + BOOST_DEDUCED_TYPENAME T::const_iterator x_begin = x.begin(), + x_end = x.end(); + T y(test::input_iterator(x_begin), test::input_iterator(x_end), 0, hf2, + eq2); + test::check_container(x, v); + test::check_container(y, x); + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); + } + + UNORDERED_SUB_TEST("Construct 8.5 - from copy iterator") + { + test::check_instances check_; + test::random_values v(100, generator); + T x(test::copy_iterator(v.begin()), test::copy_iterator(v.end()), 0, + hf1, eq1); + T y(test::copy_iterator(x.begin()), test::copy_iterator(x.end()), 0, + hf2, eq2); + test::check_container(x, v); + test::check_container(y, x); + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); + } + + UNORDERED_SUB_TEST("Construct 9") + { + test::check_instances check_; + + test::random_values v(100, generator); + T x(50); + BOOST_TEST(x.bucket_count() >= 50); + x.max_load_factor(10); + BOOST_TEST(x.bucket_count() >= 50); + x.insert(v.begin(), v.end()); + BOOST_TEST(x.bucket_count() >= 50); + test::check_container(x, v); + test::check_equivalent_keys(x); + } + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + std::initializer_list list; + + UNORDERED_SUB_TEST("Initializer list construct 1") + { + test::check_instances check_; + + T x(list); + BOOST_TEST(x.empty()); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + } + + UNORDERED_SUB_TEST("Initializer list construct 2") + { + test::check_instances check_; + + T x(list, 1000); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 1000); + BOOST_TEST(test::equivalent(x.hash_function(), hf)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + } + + UNORDERED_SUB_TEST("Initializer list construct 3") + { + test::check_instances check_; + + T x(list, 10, hf1); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 10); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + } + + UNORDERED_SUB_TEST("Initializer list construct 4") + { + test::check_instances check_; + + T x(list, 10, hf1, eq1); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 10); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq1)); + BOOST_TEST(test::equivalent(x.get_allocator(), al)); + } + + UNORDERED_SUB_TEST("Initializer list construct 5") + { + test::check_instances check_; + + T x(list, 10, hf1, eq1, al1); + BOOST_TEST(x.empty()); + BOOST_TEST(x.bucket_count() >= 10); + BOOST_TEST(test::equivalent(x.hash_function(), hf1)); + BOOST_TEST(test::equivalent(x.key_eq(), eq1)); + BOOST_TEST(test::equivalent(x.get_allocator(), al1)); + } +#endif +} + +template +void map_constructor_test(T*, test::random_generator const& generator) +{ + typedef test::list > + list; + test::random_values v(1000, generator); + list l(v.begin(), v.end()); + T x(l.begin(), l.end()); + + test::check_container(x, v); + test::check_equivalent_keys(x); +} + +boost::unordered_map >* test_map_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(constructor_tests1, + ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(constructor_tests2, + ((test_set)(test_multiset)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(map_constructor_test, + ((test_map_std_alloc)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + +UNORDERED_AUTO_TEST(test_default_initializer_list) +{ + std::initializer_list init; + boost::unordered_set x1 = init; + BOOST_TEST(x1.empty()); +} + +#endif + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + +UNORDERED_AUTO_TEST(test_initializer_list) +{ + boost::unordered_set x1 = {2, 10, 45, -5}; + BOOST_TEST(x1.find(10) != x1.end()); + BOOST_TEST(x1.find(46) == x1.end()); +} + +#endif +} + +RUN_TESTS_QUIET() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/copy_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/copy_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5cd5187a4a1457c49bfd76118dc715630a6bb075 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/copy_tests.cpp @@ -0,0 +1,209 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../objects/cxx11_allocator.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/equivalent.hpp" +#include "../helpers/invariants.hpp" + +test::seed_t initialize_seed(9063); + +namespace copy_tests { + +template +void copy_construct_tests1(T*, test::random_generator const& generator) +{ + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + BOOST_DEDUCED_TYPENAME T::hasher hf; + BOOST_DEDUCED_TYPENAME T::key_equal eq; + BOOST_DEDUCED_TYPENAME T::allocator_type al; + + { + test::check_instances check_; + + T x; + T y(x); + BOOST_TEST(y.empty()); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al)); + BOOST_TEST(x.max_load_factor() == y.max_load_factor()); + BOOST_TEST(test::selected_count(y.get_allocator()) == + (allocator_type::is_select_on_copy)); + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + test::random_values v(1000, generator); + + T x(v.begin(), v.end()); + T y(x); + test::unordered_equivalence_tester equivalent(x); + BOOST_TEST(equivalent(y)); + BOOST_TEST(test::selected_count(y.get_allocator()) == + (allocator_type::is_select_on_copy)); + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + // In this test I drop the original containers max load factor, so it + // is much lower than the load factor. The hash table is not allowed + // to rehash, but the destination container should probably allocate + // enough buckets to decrease the load factor appropriately. + test::random_values v(1000, generator); + T x(v.begin(), v.end()); + x.max_load_factor(x.load_factor() / 4); + T y(x); + test::unordered_equivalence_tester equivalent(x); + BOOST_TEST(equivalent(y)); + // This isn't guaranteed: + BOOST_TEST(y.load_factor() < y.max_load_factor()); + BOOST_TEST(test::selected_count(y.get_allocator()) == + (allocator_type::is_select_on_copy)); + test::check_equivalent_keys(y); + } +} + +template +void copy_construct_tests2(T*, test::random_generator const& generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf(1); + BOOST_DEDUCED_TYPENAME T::key_equal eq(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al2(2); + + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + { + test::check_instances check_; + + T x(10000, hf, eq, al); + T y(x); + BOOST_TEST(y.empty()); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al)); + BOOST_TEST(x.max_load_factor() == y.max_load_factor()); + BOOST_TEST(test::selected_count(y.get_allocator()) == + (allocator_type::is_select_on_copy)); + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + T x(1000, hf, eq, al); + T y(x, al2); + BOOST_TEST(y.empty()); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + BOOST_TEST(x.max_load_factor() == y.max_load_factor()); + BOOST_TEST(test::selected_count(y.get_allocator()) == 0); + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + test::random_values v(1000, generator); + + T x(v.begin(), v.end(), 0, hf, eq, al); + T y(x); + test::unordered_equivalence_tester equivalent(x); + BOOST_TEST(equivalent(y)); + test::check_equivalent_keys(y); + BOOST_TEST(test::selected_count(y.get_allocator()) == + (allocator_type::is_select_on_copy)); + BOOST_TEST(test::equivalent(y.get_allocator(), al)); + } + + { + test::check_instances check_; + + test::random_values v(500, generator); + + T x(v.begin(), v.end(), 0, hf, eq, al); + T y(x, al2); + test::unordered_equivalence_tester equivalent(x); + BOOST_TEST(equivalent(y)); + test::check_equivalent_keys(y); + BOOST_TEST(test::selected_count(y.get_allocator()) == 0); + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + } +} + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +boost::unordered_set >* + test_set_select_copy; +boost::unordered_multiset >* + test_multiset_select_copy; +boost::unordered_map >* + test_map_select_copy; +boost::unordered_multimap >* + test_multimap_select_copy; + +boost::unordered_set >* + test_set_no_select_copy; +boost::unordered_multiset >* + test_multiset_no_select_copy; +boost::unordered_map >* + test_map_no_select_copy; +boost::unordered_multimap >* + test_multimap_no_select_copy; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(copy_construct_tests1, + ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_select_copy)( + test_multiset_select_copy)(test_map_select_copy)( + test_multimap_select_copy)(test_set_no_select_copy)( + test_multiset_no_select_copy)(test_map_no_select_copy)( + test_multimap_no_select_copy))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(copy_construct_tests2, + ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_select_copy)( + test_multiset_select_copy)(test_map_select_copy)( + test_multimap_select_copy)(test_set_no_select_copy)( + test_multiset_no_select_copy)(test_map_no_select_copy)( + test_multimap_no_select_copy))( + (default_generator)(generate_collisions)(limited_range))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/detail_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/detail_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2af4c4fbc7d3ed33429050c92f422b62575dbaa4 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/detail_tests.cpp @@ -0,0 +1,102 @@ + +// Copyright 2017 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include + +// Pretty inefficient, but the test is fast enough. +// Might be too slow if we had larger primes? +bool is_prime(std::size_t x) +{ + if (x == 2) { + return true; + } else if (x == 1 || x % 2 == 0) { + return false; + } else { + // y*y <= x had rounding errors, so instead use y <= (x/y). + for (std::size_t y = 3; y <= (x / y); y += 2) { + if (x % y == 0) { + return false; + break; + } + } + + return true; + } +} + +void test_next_prime(std::size_t value) +{ + std::size_t x = boost::unordered::detail::next_prime(value); + BOOST_TEST(is_prime(x)); + BOOST_TEST(x >= value); +} + +void test_prev_prime(std::size_t value) +{ + std::size_t x = boost::unordered::detail::prev_prime(value); + BOOST_TEST(is_prime(x)); + BOOST_TEST(x <= value); + if (x > value) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << x << "," << value << std::endl; + } +} + +UNORDERED_AUTO_TEST(next_prime_test) +{ + BOOST_TEST(!is_prime(0)); + BOOST_TEST(!is_prime(1)); + BOOST_TEST(is_prime(2)); + BOOST_TEST(is_prime(3)); + BOOST_TEST(is_prime(13)); + BOOST_TEST(!is_prime(4)); + BOOST_TEST(!is_prime(100)); + + BOOST_TEST(boost::unordered::detail::next_prime(0) > 0); + + // test_prev_prime doesn't work for values less than 17. + // Which should be okay, unless an allocator has a really tiny + // max_size? + const std::size_t min_prime = 17; + + // test_next_prime doesn't work for values greater than this, + // which might be a problem if you've got terrabytes of memory? + // I seriously doubt the container would work well at such sizes + // regardless. + const std::size_t max_prime = 4294967291ul; + + std::size_t i; + + BOOST_TEST(is_prime(min_prime)); + BOOST_TEST(is_prime(max_prime)); + + for (i = 0; i < 10000; ++i) { + if (i < min_prime) { + BOOST_TEST(boost::unordered::detail::prev_prime(i) == min_prime); + } else { + test_prev_prime(i); + } + test_next_prime(i); + } + + std::size_t last = i - 1; + for (; i > last; last = i, i += i / 5) { + if (i > max_prime) { + BOOST_TEST(boost::unordered::detail::next_prime(i) == max_prime); + } else { + test_next_prime(i); + } + test_prev_prime(i); + } +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/emplace_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/emplace_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e86a066fc9ecc46f91f9f4b07319b59e5c657dba --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/emplace_tests.cpp @@ -0,0 +1,519 @@ +// +// Copyright 2016 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include +#include "../helpers/test.hpp" +#include "../helpers/count.hpp" +#include + +// Test that various emplace methods work with different numbers of +// arguments. + +namespace emplace_tests { +// Constructible with 2 to 10 arguments +struct emplace_value : private test::counted_object +{ + typedef int A0; + typedef std::string A1; + typedef char A2; + typedef int A3; + typedef int A4; + typedef int A5; + typedef int A6; + typedef int A7; + typedef int A8; + typedef int A9; + + int arg_count; + + A0 a0; + A1 a1; + A2 a2; + A3 a3; + A4 a4; + A5 a5; + A6 a6; + A7 a7; + A8 a8; + A9 a9; + + emplace_value(A0 const& b0, A1 const& b1) : arg_count(2), a0(b0), a1(b1) {} + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2) + : arg_count(3), a0(b0), a1(b1), a2(b2) + { + } + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3) + : arg_count(4), a0(b0), a1(b1), a2(b2), a3(b3) + { + } + + emplace_value( + A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3, A4 const& b4) + : arg_count(5), a0(b0), a1(b1), a2(b2), a3(b3), a4(b4) + { + } + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3, + A4 const& b4, A5 const& b5) + : arg_count(6), a0(b0), a1(b1), a2(b2), a3(b3), a4(b4), a5(b5) + { + } + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3, + A4 const& b4, A5 const& b5, A6 const& b6) + : arg_count(7), a0(b0), a1(b1), a2(b2), a3(b3), a4(b4), a5(b5), a6(b6) + { + } + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3, + A4 const& b4, A5 const& b5, A6 const& b6, A7 const& b7) + : arg_count(8), a0(b0), a1(b1), a2(b2), a3(b3), a4(b4), a5(b5), a6(b6), + a7(b7) + { + } + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3, + A4 const& b4, A5 const& b5, A6 const& b6, A7 const& b7, A8 const& b8) + : arg_count(9), a0(b0), a1(b1), a2(b2), a3(b3), a4(b4), a5(b5), a6(b6), + a7(b7), a8(b8) + { + } + + emplace_value(A0 const& b0, A1 const& b1, A2 const& b2, A3 const& b3, + A4 const& b4, A5 const& b5, A6 const& b6, A7 const& b7, A8 const& b8, + A9 const& b9) + : arg_count(10), a0(b0), a1(b1), a2(b2), a3(b3), a4(b4), a5(b5), a6(b6), + a7(b7), a8(b8), a9(b9) + { + } + + friend std::size_t hash_value(emplace_value const& x) + { + std::size_t r1 = 23894278u; + if (x.arg_count >= 1) + boost::hash_combine(r1, x.a0); + if (x.arg_count >= 2) + boost::hash_combine(r1, x.a1); + if (x.arg_count >= 3) + boost::hash_combine(r1, x.a2); + if (x.arg_count >= 4) + boost::hash_combine(r1, x.a3); + if (x.arg_count >= 5) + boost::hash_combine(r1, x.a4); + if (x.arg_count >= 6) + boost::hash_combine(r1, x.a5); + if (x.arg_count >= 7) + boost::hash_combine(r1, x.a6); + if (x.arg_count >= 8) + boost::hash_combine(r1, x.a7); + if (x.arg_count >= 9) + boost::hash_combine(r1, x.a8); + if (x.arg_count >= 10) + boost::hash_combine(r1, x.a9); + return r1; + } + + friend bool operator==(emplace_value const& x, emplace_value const& y) + { + if (x.arg_count != y.arg_count) { + return false; + } + if (x.arg_count >= 1 && x.a0 != y.a0) { + return false; + } + if (x.arg_count >= 2 && x.a1 != y.a1) { + return false; + } + if (x.arg_count >= 3 && x.a2 != y.a2) { + return false; + } + if (x.arg_count >= 4 && x.a3 != y.a3) { + return false; + } + if (x.arg_count >= 5 && x.a4 != y.a4) { + return false; + } + if (x.arg_count >= 6 && x.a5 != y.a5) { + return false; + } + if (x.arg_count >= 7 && x.a6 != y.a6) { + return false; + } + if (x.arg_count >= 8 && x.a7 != y.a7) { + return false; + } + if (x.arg_count >= 9 && x.a8 != y.a8) { + return false; + } + if (x.arg_count >= 10 && x.a9 != y.a9) { + return false; + } + return true; + } + + private: + emplace_value(); + emplace_value(emplace_value const&); +}; + +UNORDERED_AUTO_TEST(emplace_set) +{ + test::check_instances check_; + + typedef boost::unordered_set > + container; + typedef container::iterator iterator; + typedef std::pair return_type; + container x(10); + iterator i1; + return_type r1, r2; + + // 2 args + + emplace_value v1(10, "x"); + r1 = x.emplace(10, std::string("x")); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST(r1.second); + BOOST_TEST(*r1.first == v1); + BOOST_TEST(r1.first == x.find(v1)); + BOOST_TEST_EQ(check_.instances(), 2); + BOOST_TEST_EQ(check_.constructions(), 2); + + // 3 args + + emplace_value v2(3, "foo", 'a'); + r1 = x.emplace(3, "foo", 'a'); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST(r1.second); + BOOST_TEST(*r1.first == v2); + BOOST_TEST(r1.first == x.find(v2)); + BOOST_TEST_EQ(check_.instances(), 4); + BOOST_TEST_EQ(check_.constructions(), 4); + + // 7 args with hint + duplicate + + emplace_value v3(25, "something", 'z', 4, 5, 6, 7); + i1 = x.emplace_hint(r1.first, 25, "something", 'z', 4, 5, 6, 7); + BOOST_TEST_EQ(x.size(), 3u); + BOOST_TEST(*i1 == v3); + BOOST_TEST(i1 == x.find(v3)); + BOOST_TEST_EQ(check_.instances(), 6); + BOOST_TEST_EQ(check_.constructions(), 6); + + r2 = x.emplace(25, "something", 'z', 4, 5, 6, 7); + BOOST_TEST_EQ(x.size(), 3u); + BOOST_TEST(!r2.second); + BOOST_TEST(i1 == r2.first); + // The container has to construct an object in order to check + // whether it can emplace, so there's an extra cosntruction + // here. + BOOST_TEST_EQ(check_.instances(), 6); + BOOST_TEST_EQ(check_.constructions(), 7); + + // 10 args + hint duplicate + + std::string s1; + emplace_value v4(10, s1, 'a', 4, 5, 6, 7, 8, 9, 10); + r1 = x.emplace(10, s1, 'a', 4, 5, 6, 7, 8, 9, 10); + BOOST_TEST_EQ(x.size(), 4u); + BOOST_TEST(r1.second); + BOOST_TEST(*r1.first == v4); + BOOST_TEST(r1.first == x.find(v4)); + BOOST_TEST_EQ(check_.instances(), 8); + BOOST_TEST_EQ(check_.constructions(), 9); + + BOOST_TEST(r1.first == + x.emplace_hint(r1.first, 10, "", 'a', 4, 5, 6, 7, 8, 9, 10)); + BOOST_TEST(r1.first == + x.emplace_hint(r2.first, 10, "", 'a', 4, 5, 6, 7, 8, 9, 10)); + BOOST_TEST( + r1.first == x.emplace_hint(x.end(), 10, "", 'a', 4, 5, 6, 7, 8, 9, 10)); + BOOST_TEST_EQ(check_.instances(), 8); + BOOST_TEST_EQ(check_.constructions(), 12); + + BOOST_TEST_EQ(x.size(), 4u); + BOOST_TEST(x.count(v1) == 1); + BOOST_TEST(x.count(v2) == 1); + BOOST_TEST(x.count(v3) == 1); + BOOST_TEST(x.count(v4) == 1); +} + +UNORDERED_AUTO_TEST(emplace_multiset) +{ + test::check_instances check_; + + typedef boost::unordered_multiset > + container; + typedef container::iterator iterator; + container x(10); + iterator i1, i2; + + // 2 args. + + emplace_value v1(10, "x"); + i1 = x.emplace(10, std::string("x")); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST(i1 == x.find(v1)); + BOOST_TEST_EQ(check_.instances(), 2); + BOOST_TEST_EQ(check_.constructions(), 2); + + // 4 args + duplicate + + emplace_value v2(4, "foo", 'a', 15); + i1 = x.emplace(4, "foo", 'a', 15); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST(i1 == x.find(v2)); + BOOST_TEST_EQ(check_.instances(), 4); + BOOST_TEST_EQ(check_.constructions(), 4); + + i2 = x.emplace(4, "foo", 'a', 15); + BOOST_TEST_EQ(x.size(), 3u); + BOOST_TEST(i1 != i2); + BOOST_TEST(*i1 == *i2); + BOOST_TEST(x.count(*i1) == 2); + BOOST_TEST_EQ(check_.instances(), 5); + BOOST_TEST_EQ(check_.constructions(), 5); + + // 7 args + duplicate using hint. + + emplace_value v3(7, "", 'z', 4, 5, 6, 7); + i1 = x.emplace(7, "", 'z', 4, 5, 6, 7); + BOOST_TEST_EQ(x.size(), 4u); + BOOST_TEST_EQ(i1->a2, 'z'); + BOOST_TEST(x.count(*i1) == 1); + BOOST_TEST(i1 == x.find(v3)); + BOOST_TEST_EQ(check_.instances(), 7); + BOOST_TEST_EQ(check_.constructions(), 7); + + i2 = x.emplace_hint(i1, 7, "", 'z', 4, 5, 6, 7); + BOOST_TEST_EQ(x.size(), 5u); + BOOST_TEST(*i1 == *i2); + BOOST_TEST(i1 != i2); + BOOST_TEST(x.count(*i1) == 2); + BOOST_TEST_EQ(check_.instances(), 8); + BOOST_TEST_EQ(check_.constructions(), 8); + + // 10 args with bad hint + duplicate + + emplace_value v4(10, "", 'a', 4, 5, 6, 7, 8, 9, 10); + i1 = x.emplace_hint(i2, 10, "", 'a', 4, 5, 6, 7, 8, 9, 10); + BOOST_TEST_EQ(x.size(), 6u); + BOOST_TEST_EQ(i1->arg_count, 10); + BOOST_TEST(i1 == x.find(v4)); + BOOST_TEST_EQ(check_.instances(), 10); + BOOST_TEST_EQ(check_.constructions(), 10); + + i2 = x.emplace_hint(x.end(), 10, "", 'a', 4, 5, 6, 7, 8, 9, 10); + BOOST_TEST_EQ(x.size(), 7u); + BOOST_TEST(*i1 == *i2); + BOOST_TEST(i1 != i2); + BOOST_TEST(x.count(*i1) == 2); + BOOST_TEST_EQ(check_.instances(), 11); + BOOST_TEST_EQ(check_.constructions(), 11); + + BOOST_TEST_EQ(x.count(v1), 1u); + BOOST_TEST_EQ(x.count(v2), 2u); + BOOST_TEST_EQ(x.count(v3), 2u); +} + +UNORDERED_AUTO_TEST(emplace_map) +{ + test::check_instances check_; + + typedef boost::unordered_map > + container; + typedef container::iterator iterator; + typedef std::pair return_type; + container x(10); + return_type r1, r2; + + // 5/8 args + duplicate + + emplace_value k1(5, "", 'b', 4, 5); + emplace_value m1(8, "xxx", 'z', 4, 5, 6, 7, 8); + r1 = x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(5, "", 'b', 4, 5), + boost::make_tuple(8, "xxx", 'z', 4, 5, 6, 7, 8)); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST(r1.second); + BOOST_TEST(x.find(k1) == r1.first); + BOOST_TEST(x.find(k1)->second == m1); + BOOST_TEST_EQ(check_.instances(), 4); + BOOST_TEST_EQ(check_.constructions(), 4); + + r2 = x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(5, "", 'b', 4, 5), + boost::make_tuple(8, "xxx", 'z', 4, 5, 6, 7, 8)); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST(!r2.second); + BOOST_TEST(r1.first == r2.first); + BOOST_TEST(x.find(k1)->second == m1); + BOOST_TEST_EQ(check_.instances(), 4); + // constructions could possibly be 5 if the implementation only + // constructed the key. + BOOST_TEST_EQ(check_.constructions(), 6); + + // 9/3 args + duplicates with hints, different mapped value. + + emplace_value k2(9, "", 'b', 4, 5, 6, 7, 8, 9); + emplace_value m2(3, "aaa", 'm'); + r1 = x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(3, "aaa", 'm')); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST(r1.second); + BOOST_TEST(r1.first->first.arg_count == 9); + BOOST_TEST(r1.first->second.arg_count == 3); + BOOST_TEST(x.find(k2) == r1.first); + BOOST_TEST(x.find(k2)->second == m2); + BOOST_TEST_EQ(check_.instances(), 8); + BOOST_TEST_EQ(check_.constructions(), 10); + + BOOST_TEST(r1.first == + x.emplace_hint(r1.first, boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(15, "jkjk"))); + BOOST_TEST(r1.first == + x.emplace_hint(r2.first, boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(275, "xxx", 'm', 6))); + BOOST_TEST(r1.first == + x.emplace_hint(x.end(), boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(-10, "blah blah", '\0'))); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST(x.find(k2)->second == m2); + BOOST_TEST_EQ(check_.instances(), 8); + BOOST_TEST_EQ(check_.constructions(), 16); +} + +UNORDERED_AUTO_TEST(emplace_multimap) +{ + test::check_instances check_; + + typedef boost::unordered_multimap > + container; + typedef container::iterator iterator; + container x(10); + iterator i1, i2, i3, i4; + + // 5/8 args + duplicate + + emplace_value k1(5, "", 'b', 4, 5); + emplace_value m1(8, "xxx", 'z', 4, 5, 6, 7, 8); + i1 = x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(5, "", 'b', 4, 5), + boost::make_tuple(8, "xxx", 'z', 4, 5, 6, 7, 8)); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST(x.find(k1) == i1); + BOOST_TEST(x.find(k1)->second == m1); + BOOST_TEST_EQ(check_.instances(), 4); + BOOST_TEST_EQ(check_.constructions(), 4); + + emplace_value m1a(8, "xxx", 'z', 4, 5, 6, 7, 8); + i2 = x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(5, "", 'b', 4, 5), + boost::make_tuple(8, "xxx", 'z', 4, 5, 6, 7, 8)); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST(i1 != i2); + BOOST_TEST(i1->second == m1); + BOOST_TEST(i2->second == m1a); + BOOST_TEST_EQ(check_.instances(), 7); + BOOST_TEST_EQ(check_.constructions(), 7); + + // 9/3 args + duplicates with hints, different mapped value. + + emplace_value k2(9, "", 'b', 4, 5, 6, 7, 8, 9); + emplace_value m2(3, "aaa", 'm'); + i1 = x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(3, "aaa", 'm')); + BOOST_TEST_EQ(x.size(), 3u); + BOOST_TEST(i1->first.arg_count == 9); + BOOST_TEST(i1->second.arg_count == 3); + BOOST_TEST_EQ(check_.instances(), 11); + BOOST_TEST_EQ(check_.constructions(), 11); + + emplace_value m2a(15, "jkjk"); + i2 = x.emplace_hint(i2, boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(15, "jkjk")); + emplace_value m2b(275, "xxx", 'm', 6); + i3 = x.emplace_hint(i1, boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(275, "xxx", 'm', 6)); + emplace_value m2c(-10, "blah blah", '\0'); + i4 = x.emplace_hint(x.end(), boost::unordered::piecewise_construct, + boost::make_tuple(9, "", 'b', 4, 5, 6, 7, 8, 9), + boost::make_tuple(-10, "blah blah", '\0')); + BOOST_TEST_EQ(x.size(), 6u); + BOOST_TEST(x.find(k2)->second == m2); + BOOST_TEST_EQ(check_.instances(), 20); + BOOST_TEST_EQ(check_.constructions(), 20); +} + +UNORDERED_AUTO_TEST(try_emplace) +{ + test::check_instances check_; + + typedef boost::unordered_map container; + typedef container::iterator iterator; + typedef std::pair return_type; + container x(10); + return_type r1, r2, r3; + + int k1 = 3; + emplace_value m1(414, "grr"); + r1 = x.try_emplace(3, 414, "grr"); + BOOST_TEST(r1.second); + BOOST_TEST(r1.first->first == k1); + BOOST_TEST(r1.first->second == m1); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST_EQ(check_.instances(), 2); + BOOST_TEST_EQ(check_.constructions(), 2); + + int k2 = 10; + emplace_value m2(25, "", 'z'); + r2 = x.try_emplace(10, 25, std::string(""), 'z'); + BOOST_TEST(r2.second); + BOOST_TEST(r2.first->first == k2); + BOOST_TEST(r2.first->second == m2); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST_EQ(check_.instances(), 4); + BOOST_TEST_EQ(check_.constructions(), 4); + + BOOST_TEST(x.find(k1)->second == m1); + BOOST_TEST(x.find(k2)->second == m2); + + r3 = x.try_emplace(k2, 68, "jfeoj", 'p', 49309, 2323); + BOOST_TEST(!r3.second); + BOOST_TEST(r3.first == r2.first); + BOOST_TEST(r3.first->second == m2); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST_EQ(check_.instances(), 4); + BOOST_TEST_EQ(check_.constructions(), 4); + + BOOST_TEST(r2.first == x.try_emplace(r2.first, k2, 808709, "what")); + BOOST_TEST( + r2.first == + x.try_emplace(r2.first, k2, 10, "xxx", 'a', 4, 5, 6, 7, 8, 9, 10)); + BOOST_TEST(r2.first->second == m2); + BOOST_TEST_EQ(x.size(), 2u); +} +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/equality_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/equality_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7daea70c74bd7372125e0a2da2cd2dbb98691e4b --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/equality_tests.cpp @@ -0,0 +1,165 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include +#include +#include "../helpers/test.hpp" + +namespace equality_tests { +struct mod_compare +{ + bool alt_hash_; + + explicit mod_compare(bool alt_hash = false) : alt_hash_(alt_hash) {} + + bool operator()(int x, int y) const { return x % 1000 == y % 1000; } + + std::size_t operator()(int x) const + { + return alt_hash_ ? static_cast(x % 250) + : static_cast((x + 5) % 250); + } +}; + +#define UNORDERED_EQUALITY_SET_TEST(seq1, op, seq2) \ + { \ + boost::unordered_set set1, set2; \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \ + BOOST_TEST(set1 op set2); \ + } + +#define UNORDERED_EQUALITY_MULTISET_TEST(seq1, op, seq2) \ + { \ + boost::unordered_multiset set1, set2; \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \ + BOOST_TEST(set1 op set2); \ + } + +#define UNORDERED_EQUALITY_MAP_TEST(seq1, op, seq2) \ + { \ + boost::unordered_map map1, map2; \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \ + BOOST_TEST(map1 op map2); \ + } + +#define UNORDERED_EQUALITY_MULTIMAP_TEST(seq1, op, seq2) \ + { \ + boost::unordered_multimap map1, \ + map2; \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \ + BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \ + BOOST_TEST(map1 op map2); \ + } + +#define UNORDERED_SET_INSERT(r, set, item) set.insert(item); +#define UNORDERED_MAP_INSERT(r, map, item) \ + map.insert(std::pair BOOST_PP_SEQ_TO_TUPLE(item)); + +UNORDERED_AUTO_TEST(equality_size_tests) +{ + boost::unordered_set x1, x2; + BOOST_TEST(x1 == x2); + BOOST_TEST(!(x1 != x2)); + + x1.insert(1); + BOOST_TEST(x1 != x2); + BOOST_TEST(!(x1 == x2)); + BOOST_TEST(x2 != x1); + BOOST_TEST(!(x2 == x1)); + + x2.insert(1); + BOOST_TEST(x1 == x2); + BOOST_TEST(!(x1 != x2)); + + x2.insert(2); + BOOST_TEST(x1 != x2); + BOOST_TEST(!(x1 == x2)); + BOOST_TEST(x2 != x1); + BOOST_TEST(!(x2 == x1)); +} + +UNORDERED_AUTO_TEST(equality_key_value_tests) +{ + UNORDERED_EQUALITY_MULTISET_TEST((1), !=, (2)) + UNORDERED_EQUALITY_SET_TEST((2), ==, (2)) + UNORDERED_EQUALITY_MAP_TEST(((1)(1))((2)(1)), !=, ((1)(1))((3)(1))) +} + +UNORDERED_AUTO_TEST(equality_collision_test) +{ + UNORDERED_EQUALITY_MULTISET_TEST((1), !=, (501)) + UNORDERED_EQUALITY_MULTISET_TEST((1)(251), !=, (1)(501)) + UNORDERED_EQUALITY_MULTIMAP_TEST(((251)(1))((1)(1)), !=, ((501)(1))((1)(1))) + UNORDERED_EQUALITY_MULTISET_TEST((1)(501), ==, (1)(501)) + UNORDERED_EQUALITY_SET_TEST((1)(501), ==, (501)(1)) +} + +UNORDERED_AUTO_TEST(equality_group_size_test) +{ + UNORDERED_EQUALITY_MULTISET_TEST((10)(20)(20), !=, (10)(10)(20)) + UNORDERED_EQUALITY_MULTIMAP_TEST( + ((10)(1))((20)(1))((20)(1)), !=, ((10)(1))((20)(1))((10)(1))) + UNORDERED_EQUALITY_MULTIMAP_TEST( + ((20)(1))((10)(1))((10)(1)), ==, ((10)(1))((20)(1))((10)(1))) +} + +UNORDERED_AUTO_TEST(equality_map_value_test) +{ + UNORDERED_EQUALITY_MAP_TEST(((1)(1)), !=, ((1)(2))) + UNORDERED_EQUALITY_MAP_TEST(((1)(1)), ==, ((1)(1))) + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(1)), !=, ((1)(2))) + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(1))((1)(1)), !=, ((1)(1))((1)(2))) + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(2))((1)(1)), ==, ((1)(1))((1)(2))) + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(2))((1)(1)), !=, ((1)(1))((1)(3))) +} + +UNORDERED_AUTO_TEST(equality_predicate_test) +{ + UNORDERED_EQUALITY_SET_TEST((1), !=, (1001)) + UNORDERED_EQUALITY_MAP_TEST(((1)(2))((1001)(1)), !=, ((1001)(2))((1)(1))) +} + +UNORDERED_AUTO_TEST(equality_multiple_group_test) +{ + UNORDERED_EQUALITY_MULTISET_TEST( + (1)(1)(1)(1001)(2001)(2001)(2)(1002)(3)(1003)(2003), ==, + (3)(1003)(2003)(1002)(2)(2001)(2001)(1)(1001)(1)(1)); +} + +// Test that equality still works when the two containers have +// different hash functions but the same equality predicate. + +UNORDERED_AUTO_TEST(equality_different_hash_test) +{ + typedef boost::unordered_set set; + set set1(0, mod_compare(false), mod_compare(false)); + set set2(0, mod_compare(true), mod_compare(true)); + BOOST_TEST(set1 == set2); + set1.insert(1); + set2.insert(2); + BOOST_TEST(set1 != set2); + set1.insert(2); + set2.insert(1); + BOOST_TEST(set1 == set2); + set1.insert(10); + set2.insert(20); + BOOST_TEST(set1 != set2); + set1.insert(20); + set2.insert(10); + BOOST_TEST(set1 == set2); +} +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/equivalent_keys_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/equivalent_keys_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8e48d68c8067a428692856ce476c1a6979e0d8b5 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/equivalent_keys_tests.cpp @@ -0,0 +1,79 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include +#include +#include "../helpers/list.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/invariants.hpp" + +template +void test_equal_insertion(Iterator begin, Iterator end) +{ + typedef test::ordered tracker; + + Container x1; + tracker x2 = test::create_ordered(x1); + + for (Iterator it = begin; it != end; ++it) { + x1.insert(*it); + x2.insert(*it); + x2.compare_key(x1, *it); + } + + x2.compare(x1); + test::check_equivalent_keys(x1); +} + +UNORDERED_AUTO_TEST(set_tests) +{ + int values[][5] = {{1}, {54, 23}, {-13, 65}, {77, 77}, {986, 25, 986}}; + + typedef boost::unordered_set set; + typedef boost::unordered_multiset multiset; + + test_equal_insertion(values[0], values[0] + 1); + test_equal_insertion(values[1], values[1] + 2); + test_equal_insertion(values[2], values[2] + 2); + test_equal_insertion(values[3], values[3] + 2); + test_equal_insertion(values[4], values[4] + 3); + + test_equal_insertion(values[0], values[0] + 1); + test_equal_insertion(values[1], values[1] + 2); + test_equal_insertion(values[2], values[2] + 2); + test_equal_insertion(values[3], values[3] + 2); + test_equal_insertion(values[4], values[4] + 3); +} + +UNORDERED_AUTO_TEST(map_tests) +{ + typedef test::list > values_type; + values_type v[5]; + v[0].push_back(std::pair(1, 1)); + v[1].push_back(std::pair(28, 34)); + v[1].push_back(std::pair(16, 58)); + v[1].push_back(std::pair(-124, 62)); + v[2].push_back(std::pair(432, 12)); + v[2].push_back(std::pair(9, 13)); + v[2].push_back(std::pair(432, 24)); + + for (int i = 0; i < 5; ++i) + test_equal_insertion >( + v[i].begin(), v[i].end()); + + for (int i2 = 0; i2 < 5; ++i2) + test_equal_insertion >( + v[i2].begin(), v[i2].end()); +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/erase_equiv_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/erase_equiv_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..645103947a484ec74d654d06b9d4cc52fa67d3fd --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/erase_equiv_tests.cpp @@ -0,0 +1,225 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// The code for erasing elements from containers with equivalent keys is very +// hairy with several tricky edge cases - so explicitly test each one. + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../helpers/list.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/helpers.hpp" +#include +#include +#include "../objects/test.hpp" + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) +#pragma warning(disable : 4267) // conversion from 'size_t' to 'unsigned int', + // possible loss of data. +#endif + +struct write_pair_type +{ + template + void operator()(std::pair const& x) const + { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "(" << x.first << "," << x.second + << ")"; + } +} write_pair; + +template void write_container(Container const& x) +{ + std::for_each(x.begin(), x.end(), write_pair); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; +} + +// Make everything collide - for testing erase in a single bucket. +struct collision_hash +{ + std::size_t operator()(int) const { return 0; } +}; + +// For testing erase in 2 buckets. +struct collision2_hash +{ + std::size_t operator()(int x) const + { + return static_cast(x & 1); + } +}; + +// For testing erase in lots of buckets. +struct collision3_hash +{ + std::size_t operator()(int x) const { return static_cast(x); } +}; + +typedef boost::unordered_multimap, + test::allocator1 > > + collide_map; +typedef boost::unordered_multimap, + test::allocator2 > > + collide_map2; +typedef boost::unordered_multimap, + test::allocator2 > > + collide_map3; +typedef collide_map::value_type collide_value; +typedef test::list collide_list; + +UNORDERED_AUTO_TEST(empty_range_tests) +{ + collide_map x; + x.erase(x.begin(), x.end()); + x.erase(x.begin(), x.begin()); + x.erase(x.end(), x.end()); + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(single_item_tests) +{ + collide_list init; + init.push_back(collide_value(1, 1)); + + collide_map x(init.begin(), init.end()); + x.erase(x.begin(), x.begin()); + BOOST_TEST(x.count(1) == 1 && x.size() == 1); + test::check_equivalent_keys(x); + x.erase(x.end(), x.end()); + BOOST_TEST(x.count(1) == 1 && x.size() == 1); + test::check_equivalent_keys(x); + x.erase(x.begin(), x.end()); + BOOST_TEST(x.count(1) == 0 && x.size() == 0); + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(two_equivalent_item_tests) +{ + collide_list init; + init.push_back(collide_value(1, 1)); + init.push_back(collide_value(1, 2)); + + { + collide_map x(init.begin(), init.end()); + x.erase(x.begin(), x.end()); + BOOST_TEST(x.count(1) == 0 && x.size() == 0); + test::check_equivalent_keys(x); + } + + { + collide_map x(init.begin(), init.end()); + int value = test::next(x.begin())->second; + x.erase(x.begin(), test::next(x.begin())); + BOOST_TEST(x.count(1) == 1 && x.size() == 1 && x.begin()->first == 1 && + x.begin()->second == value); + test::check_equivalent_keys(x); + } + + { + collide_map x(init.begin(), init.end()); + int value = x.begin()->second; + x.erase(test::next(x.begin()), x.end()); + BOOST_TEST(x.count(1) == 1 && x.size() == 1 && x.begin()->first == 1 && + x.begin()->second == value); + test::check_equivalent_keys(x); + } +} + +// More automated tests... + +template +bool compare(Range1 const& x, Range2 const& y) +{ + collide_list a(x.begin(), x.end()); + collide_list b(y.begin(), y.end()); + a.sort(); + b.sort(); + return a == b; +} + +template +bool general_erase_range_test(Container& x, std::size_t start, std::size_t end) +{ + collide_list l(x.begin(), x.end()); + + l.erase(test::next(l.begin(), start), test::next(l.begin(), end)); + x.erase(test::next(x.begin(), start), test::next(x.begin(), end)); + + test::check_equivalent_keys(x); + return compare(l, x); +} + +template void erase_subrange_tests(Container const& x) +{ + for (std::size_t length = 0; length < x.size(); ++length) { + for (std::size_t position = 0; position < x.size() - length; + ++position) { + Container y(x); + collide_list init(y.begin(), y.end()); + if (!general_erase_range_test(y, position, position + length)) { + BOOST_ERROR("general_erase_range_test failed."); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Erase: [" << position << "," + << position + length << ")\n"; + write_container(init); + write_container(y); + } + } + } +} + +template +void x_by_y_erase_range_tests(Container*, int values, int duplicates) +{ + Container y; + + for (int i = 0; i < values; ++i) { + for (int j = 0; j < duplicates; ++j) { + y.insert(collide_value(i, j)); + } + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Values: " << values + << ", Duplicates: " << duplicates << "\n"; + erase_subrange_tests(y); +} + +template +void exhaustive_erase_tests(Container* x, int num_values, int num_duplicated) +{ + for (int i = 0; i < num_values; ++i) { + for (int j = 0; j < num_duplicated; ++j) { + x_by_y_erase_range_tests(x, i, j); + } + } +} + +UNORDERED_AUTO_TEST(exhaustive_collide_tests) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "exhaustive_collide_tests:\n"; + collide_map m; + exhaustive_erase_tests((collide_map*)0, 4, 4); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; +} + +UNORDERED_AUTO_TEST(exhaustive_collide2_tests) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "exhaustive_collide2_tests:\n"; + exhaustive_erase_tests((collide_map2*)0, 8, 4); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; +} + +UNORDERED_AUTO_TEST(exhaustive_collide3_tests) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "exhaustive_collide3_tests:\n"; + exhaustive_erase_tests((collide_map3*)0, 8, 4); + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/erase_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/erase_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..843e64f2c5c6d748ffcaaf394280e51a41ef543e --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/erase_tests.cpp @@ -0,0 +1,275 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/equivalent.hpp" +#include "../helpers/helpers.hpp" +#include "../helpers/invariants.hpp" +#include +#include + +namespace erase_tests { + +test::seed_t initialize_seed(85638); + +template +void erase_tests1(Container*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME Container::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME Container::const_iterator c_iterator; + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Erase by key.\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + int iterations = 0; + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator + it = v.begin(); + it != v.end(); ++it) { + std::size_t count = x.count(test::get_key(*it)); + std::size_t old_size = x.size(); + BOOST_TEST(count == x.erase(test::get_key(*it))); + BOOST_TEST(x.size() == old_size - count); + BOOST_TEST(x.count(test::get_key(*it)) == 0); + BOOST_TEST(x.find(test::get_key(*it)) == x.end()); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "erase(begin()).\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + std::size_t size = x.size(); + int iterations = 0; + while (size > 0 && !x.empty()) { + BOOST_DEDUCED_TYPENAME Container::key_type key = + test::get_key(*x.begin()); + std::size_t count = x.count(key); + iterator pos = x.erase(x.begin()); + --size; + BOOST_TEST(pos == x.begin()); + BOOST_TEST(x.count(key) == count - 1); + BOOST_TEST(x.size() == size); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "erase(random position).\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + std::size_t size = x.size(); + int iterations = 0; + while (size > 0 && !x.empty()) { + std::size_t index = test::random_value(x.size()); + c_iterator prev, pos, next; + if (index == 0) { + prev = pos = x.begin(); + } else { + prev = test::next(x.begin(), index - 1); + pos = test::next(prev); + } + next = test::next(pos); + BOOST_DEDUCED_TYPENAME Container::key_type key = + test::get_key(*pos); + std::size_t count = x.count(key); + BOOST_TEST(count > 0); + BOOST_TEST(next == x.erase(pos)); + --size; + if (size > 0) + BOOST_TEST( + index == 0 ? next == x.begin() : next == test::next(prev)); + BOOST_TEST(x.count(key) == count - 1); + if (x.count(key) != count - 1) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << count << " => " + << x.count(key) << std::endl; + } + BOOST_TEST(x.size() == size); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "erase(ranges).\n"; + { + test::check_instances check_; + + test::random_values v(500, generator); + Container x(v.begin(), v.end()); + + std::size_t size = x.size(); + + // I'm actually stretching it a little here, as the standard says it + // returns 'the iterator immediately following the erase elements' + // and if nothing is erased, then there's nothing to follow. But I + // think this is the only sensible option... + BOOST_TEST(x.erase(x.end(), x.end()) == x.end()); + BOOST_TEST(x.erase(x.begin(), x.begin()) == x.begin()); + BOOST_TEST(x.size() == size); + test::check_equivalent_keys(x); + + BOOST_TEST(x.erase(x.begin(), x.end()) == x.end()); + BOOST_TEST(x.empty()); + BOOST_TEST(x.begin() == x.end()); + test::check_equivalent_keys(x); + + BOOST_TEST(x.erase(x.begin(), x.end()) == x.begin()); + test::check_equivalent_keys(x); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "erase(random ranges).\n"; + { + test::check_instances check_; + Container x; + + for (int i = 0; i < 100; ++i) { + test::random_values v(1000, generator); + x.insert(v.begin(), v.end()); + + // Note that erase only invalidates the erased iterators. + std::vector iterators; + for (c_iterator it = x.cbegin(); it != x.cend(); ++it) { + iterators.push_back(it); + } + iterators.push_back(x.cend()); + + while (iterators.size() > 1) { + std::size_t start = test::random_value(iterators.size()); + std::size_t length = + test::random_value(iterators.size() - start); + x.erase(iterators[start], iterators[start + length]); + iterators.erase(test::next(iterators.begin(), start), + test::next(iterators.begin(), start + length)); + + BOOST_TEST(x.size() == iterators.size() - 1); + BOOST_DEDUCED_TYPENAME std::vector::const_iterator + i2 = iterators.begin(); + for (c_iterator i1 = x.cbegin(); i1 != x.cend(); ++i1) { + BOOST_TEST(i1 == *i2); + ++i2; + } + BOOST_TEST(x.cend() == *i2); + + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "quick_erase(begin()).\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + std::size_t size = x.size(); + int iterations = 0; + while (size > 0 && !x.empty()) { + BOOST_DEDUCED_TYPENAME Container::key_type key = + test::get_key(*x.begin()); + std::size_t count = x.count(key); + x.quick_erase(x.begin()); + --size; + BOOST_TEST(x.count(key) == count - 1); + BOOST_TEST(x.size() == size); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "quick_erase(random position).\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + std::size_t size = x.size(); + int iterations = 0; + while (size > 0 && !x.empty()) { + std::size_t index = test::random_value(x.size()); + BOOST_DEDUCED_TYPENAME Container::const_iterator prev, pos, next; + if (index == 0) { + prev = pos = x.begin(); + } else { + prev = test::next(x.begin(), index - 1); + pos = test::next(prev); + } + next = test::next(pos); + BOOST_DEDUCED_TYPENAME Container::key_type key = + test::get_key(*pos); + std::size_t count = x.count(key); + BOOST_TEST(count > 0); + x.quick_erase(pos); + --size; + if (size > 0) + BOOST_TEST( + index == 0 ? next == x.begin() : next == test::next(prev)); + BOOST_TEST(x.count(key) == count - 1); + if (x.count(key) != count - 1) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << count << " => " + << x.count(key) << std::endl; + } + BOOST_TEST(x.size() == size); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "clear().\n"; + { + test::check_instances check_; + + test::random_values v(500, generator); + Container x(v.begin(), v.end()); + x.clear(); + BOOST_TEST(x.empty()); + BOOST_TEST(x.begin() == x.end()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; +} + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST( + erase_tests1, ((test_set)(test_multiset)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/extract_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/extract_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b4f1e801575d7536294d4ef61740925aca4ef33f --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/extract_tests.cpp @@ -0,0 +1,138 @@ + +// Copyright 2016 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/equivalent.hpp" +#include "../helpers/helpers.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/test.hpp" +#include "../helpers/tracker.hpp" +#include "../objects/test.hpp" +#include + +namespace extract_tests { + +test::seed_t initialize_seed(85638); + +template +void extract_tests1(Container*, test::random_generator generator) +{ + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Extract by key.\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + int iterations = 0; + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator + it = v.begin(); + it != v.end(); ++it) { + std::size_t count = x.count(test::get_key(*it)); + std::size_t old_size = x.size(); + std::size_t new_count = count ? count - 1 : count; + std::size_t new_size = count ? old_size - 1 : old_size; + typename Container::node_type n = + x.extract(test::get_key(*it)); + BOOST_TEST((n ? true : false) == (count ? true : false)); + BOOST_TEST(x.size() == new_size); + BOOST_TEST(x.count(test::get_key(*it)) == new_count); + if (!new_count) { + BOOST_TEST(x.find(test::get_key(*it)) == x.end()); + } else { + BOOST_TEST(x.find(test::get_key(*it)) != x.end()); + } + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "extract(begin()).\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + std::size_t size = x.size(); + int iterations = 0; + while (size > 0 && !x.empty()) { + BOOST_DEDUCED_TYPENAME Container::key_type key = + test::get_key(*x.begin()); + std::size_t count = x.count(key); + typename Container::node_type n = x.extract(x.begin()); + BOOST_TEST(n); + --size; + BOOST_TEST(x.count(key) == count - 1); + BOOST_TEST(x.size() == size); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "extract(random position).\n"; + { + test::check_instances check_; + + test::random_values v(1000, generator); + Container x(v.begin(), v.end()); + std::size_t size = x.size(); + int iterations = 0; + while (size > 0 && !x.empty()) { + using namespace std; + int index = rand() % (int)x.size(); + BOOST_DEDUCED_TYPENAME Container::const_iterator prev, pos, next; + if (index == 0) { + prev = pos = x.begin(); + } else { + prev = boost::next(x.begin(), index - 1); + pos = boost::next(prev); + } + next = boost::next(pos); + BOOST_DEDUCED_TYPENAME Container::key_type key = + test::get_key(*pos); + std::size_t count = x.count(key); + typename Container::node_type n = x.extract(pos); + BOOST_TEST(n); + --size; + if (size > 0) + BOOST_TEST( + index == 0 ? next == x.begin() : next == boost::next(prev)); + BOOST_TEST(x.count(key) == count - 1); + BOOST_TEST(x.size() == size); + if (++iterations % 20 == 0) + test::check_equivalent_keys(x); + } + BOOST_TEST(x.empty()); + } + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; +} + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; + +UNORDERED_TEST( + extract_tests1, ((test_set)(test_multiset)(test_map)(test_multimap))( + (default_generator)(generate_collisions))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/find_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/find_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c6ac6742221bfaafd60f1aa39fc0ef76045bcb34 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/find_tests.cpp @@ -0,0 +1,164 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/helpers.hpp" + +namespace find_tests { + +test::seed_t initialize_seed(78937); + +template void find_tests1(X*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + { + test::check_instances check_; + + test::random_values v(500, generator); + X x(v.begin(), v.end()); + X const& x_const = x; + test::ordered tracker = test::create_ordered(x); + tracker.insert_range(v.begin(), v.end()); + + for (BOOST_DEDUCED_TYPENAME test::ordered::const_iterator it1 = + tracker.begin(); + it1 != tracker.end(); ++it1) { + BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key(*it1); + BOOST_DEDUCED_TYPENAME X::const_iterator const_pos = + x_const.find(key); + iterator pos = x.find(key); + BOOST_TEST(const_pos != x_const.end()); + BOOST_TEST(const_pos != x_const.end() && + x_const.key_eq()(key, test::get_key(*const_pos))); + BOOST_TEST(pos != x.end()); + BOOST_TEST( + pos != x.end() && x.key_eq()(key, test::get_key(*pos))); + + BOOST_TEST(x.count(key) == tracker.count(key)); + + test::compare_pairs(x.equal_range(key), tracker.equal_range(key), + (BOOST_DEDUCED_TYPENAME X::value_type*)0); + test::compare_pairs(x_const.equal_range(key), + tracker.equal_range(key), + (BOOST_DEDUCED_TYPENAME X::value_type*)0); + } + + test::random_values v2(500, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::const_iterator it2 = + v2.begin(); + it2 != v2.end(); ++it2) { + BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key(*it2); + if (tracker.find(test::get_key(key)) == tracker.end()) { + BOOST_TEST(x.find(key) == x.end()); + BOOST_TEST(x_const.find(key) == x_const.end()); + BOOST_TEST(x.count(key) == 0); + std::pair range = x.equal_range(key); + BOOST_TEST(range.first == range.second); + } + } + } + + { + test::check_instances check_; + + X x; + + test::random_values v2(5, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::const_iterator it3 = + v2.begin(); + it3 != v2.end(); ++it3) { + BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key(*it3); + BOOST_TEST(x.find(key) == x.end()); + BOOST_TEST(x.count(key) == 0); + std::pair range = x.equal_range(key); + BOOST_TEST(range.first == range.second); + } + } +} + +struct compatible_key +{ + test::object o_; + + compatible_key(test::object const& o) : o_(o) {} +}; + +struct compatible_hash +{ + test::hash hash_; + + std::size_t operator()(compatible_key const& k) const + { + return hash_(k.o_); + } +}; + +struct compatible_predicate +{ + test::equal_to equal_; + + bool operator()(compatible_key const& k1, compatible_key const& k2) const + { + return equal_(k1.o_, k2.o_); + } +}; + +template +void find_compatible_keys_test(X*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME test::random_values::iterator + value_iterator; + test::random_values v(500, generator); + X x(v.begin(), v.end()); + + compatible_hash h; + compatible_predicate eq; + + for (value_iterator it = v.begin(), end = v.end(); it != end; ++it) { + BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key(*it); + BOOST_TEST(x.find(key) == x.find(compatible_key(key), h, eq)); + } + + test::random_values v2(20, generator); + + for (value_iterator it = v2.begin(), end = v2.end(); it != end; ++it) { + BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key(*it); + BOOST_TEST(x.find(key) == x.find(compatible_key(key), h, eq)); + } +} + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST( + find_tests1, ((test_set)(test_multiset)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(find_compatible_keys_test, + ((test_set)(test_multiset)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/fwd_map_test.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/fwd_map_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6f4179d9b544511acdda0d51af4154d5f90675b8 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/fwd_map_test.cpp @@ -0,0 +1,83 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include "../helpers/postfix.hpp" +// clang-format on + +template +void call_swap(boost::unordered_map& x, boost::unordered_map& y) +{ + swap(x, y); +} + +template +bool call_equals(boost::unordered_map& x, boost::unordered_map& y) +{ + return x == y; +} + +template +bool call_not_equals( + boost::unordered_map& x, boost::unordered_map& y) +{ + return x != y; +} + +template +void call_swap( + boost::unordered_multimap& x, boost::unordered_multimap& y) +{ + swap(x, y); +} + +template +bool call_equals( + boost::unordered_multimap& x, boost::unordered_multimap& y) +{ + return x == y; +} + +template +bool call_not_equals( + boost::unordered_multimap& x, boost::unordered_multimap& y) +{ + return x != y; +} + +#include +#include "../helpers/test.hpp" + +typedef boost::unordered_map int_map; +typedef boost::unordered_multimap int_multimap; + +UNORDERED_AUTO_TEST(use_map_fwd_declared_function) +{ + int_map x, y; + x[1] = 2; + y[2] = 1; + call_swap(x, y); + + BOOST_TEST(y.find(1) != y.end() && y.find(1)->second == 2); + BOOST_TEST(y.find(2) == y.end()); + + BOOST_TEST(x.find(1) == x.end()); + BOOST_TEST(x.find(2) != x.end() && x.find(2)->second == 1); + + BOOST_TEST(!call_equals(x, y)); + BOOST_TEST(call_not_equals(x, y)); +} + +UNORDERED_AUTO_TEST(use_multimap_fwd_declared_function) +{ + int_multimap x, y; + call_swap(x, y); + BOOST_TEST(call_equals(x, y)); + BOOST_TEST(!call_not_equals(x, y)); +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/fwd_set_test.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/fwd_set_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c5b3bbf7c5e3093ffaa60359a8c7e4cfec40fbe --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/fwd_set_test.cpp @@ -0,0 +1,110 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include "../helpers/postfix.hpp" +// clang-format on + +struct true_type +{ + char x[100]; +}; +struct false_type +{ + char x; +}; + +false_type is_unordered_set_impl(void*); + +template +true_type is_unordered_set_impl( + boost::unordered_set*); + +template +void call_swap(boost::unordered_set& x, boost::unordered_set& y) +{ + swap(x, y); +} + +template +bool call_equals(boost::unordered_set& x, boost::unordered_set& y) +{ + return x == y; +} + +template +bool call_not_equals(boost::unordered_set& x, boost::unordered_set& y) +{ + return x != y; +} + +template +void call_swap(boost::unordered_multiset& x, boost::unordered_multiset& y) +{ + swap(x, y); +} + +template +bool call_equals( + boost::unordered_multiset& x, boost::unordered_multiset& y) +{ + return x == y; +} + +template +bool call_not_equals( + boost::unordered_multiset& x, boost::unordered_multiset& y) +{ + return x != y; +} + +#include "../helpers/test.hpp" + +typedef boost::unordered_set int_set; +typedef boost::unordered_multiset int_multiset; + +UNORDERED_AUTO_TEST(use_fwd_declared_trait_without_definition) +{ + BOOST_TEST(sizeof(is_unordered_set_impl((int_set*)0)) == sizeof(true_type)); +} + +#include + +UNORDERED_AUTO_TEST(use_fwd_declared_trait) +{ + boost::unordered_set x; + BOOST_TEST(sizeof(is_unordered_set_impl(&x)) == sizeof(true_type)); + + BOOST_TEST(sizeof(is_unordered_set_impl((int*)0)) == sizeof(false_type)); +} + +UNORDERED_AUTO_TEST(use_set_fwd_declared_function) +{ + int_set x, y; + x.insert(1); + y.insert(2); + call_swap(x, y); + + BOOST_TEST(y.find(1) != y.end()); + BOOST_TEST(y.find(2) == y.end()); + + BOOST_TEST(x.find(1) == x.end()); + BOOST_TEST(x.find(2) != x.end()); + + BOOST_TEST(!call_equals(x, y)); + BOOST_TEST(call_not_equals(x, y)); +} + +UNORDERED_AUTO_TEST(use_multiset_fwd_declared_function) +{ + int_multiset x, y; + call_swap(x, y); + BOOST_TEST(call_equals(x, y)); + BOOST_TEST(!call_not_equals(x, y)); +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/incomplete_test.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/incomplete_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..860606b34f65221ba4ba7a7a9d15cfaaac296eeb --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/incomplete_test.cpp @@ -0,0 +1,173 @@ + +// Copyright 2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include + +namespace x { +struct D +{ + boost::unordered_map x; +}; +} + +namespace incomplete_test { +// Declare, but don't define some types. + +struct value; +struct hash; +struct equals; +template struct allocator; + +// Declare some instances + +typedef boost::unordered_map > > + map; +typedef boost::unordered_multimap > > + multimap; +typedef boost::unordered_set > set; +typedef boost::unordered_multiset > + multiset; + +// Now define the types which are stored as members, as they are needed for +// declaring struct members. + +struct hash +{ + template std::size_t operator()(T const&) const { return 0; } +}; + +struct equals +{ + template bool operator()(T const&, T const&) const + { + return true; + } +}; + +// This is a dubious way to implement an allocator, but good enough +// for this test. +template struct allocator : std::allocator +{ + allocator() {} + + template + allocator(const allocator& other) : std::allocator(other) + { + } + + template + allocator(const std::allocator& other) : std::allocator(other) + { + } +}; + +// Declare some members of a structs. +// +// Incomplete hash, equals and allocator aren't here supported at the +// moment. + +struct struct1 +{ + boost::unordered_map > > + x; +}; +struct struct2 +{ + boost::unordered_multimap > > + x; +}; +struct struct3 +{ + boost::unordered_set > x; +}; +struct struct4 +{ + boost::unordered_multiset > x; +}; + +// Now define the value type. + +struct value +{ +}; + +// Create some instances. + +incomplete_test::map m1; +incomplete_test::multimap m2; +incomplete_test::set s1; +incomplete_test::multiset s2; + +incomplete_test::struct1 c1; +incomplete_test::struct2 c2; +incomplete_test::struct3 c3; +incomplete_test::struct4 c4; + +// Now declare, but don't define, the operators required for comparing +// elements. + +std::size_t hash_value(value const&); +bool operator==(value const&, value const&); + +std::size_t hash_value(struct1 const&); +std::size_t hash_value(struct2 const&); +std::size_t hash_value(struct3 const&); +std::size_t hash_value(struct4 const&); + +bool operator==(struct1 const&, struct1 const&); +bool operator==(struct2 const&, struct2 const&); +bool operator==(struct3 const&, struct3 const&); +bool operator==(struct4 const&, struct4 const&); + +// And finally use these + +void use_types() +{ + incomplete_test::value x; + m1[x] = x; + m2.insert(std::make_pair(x, x)); + s1.insert(x); + s2.insert(x); + + c1.x.insert(std::make_pair(c1, c1)); + c2.x.insert(std::make_pair(c2, c2)); + c3.x.insert(c3); + c4.x.insert(c4); +} + +// And finally define the operators required for comparing elements. + +std::size_t hash_value(value const&) { return 0; } +bool operator==(value const&, value const&) { return true; } + +std::size_t hash_value(struct1 const&) { return 0; } +std::size_t hash_value(struct2 const&) { return 0; } +std::size_t hash_value(struct3 const&) { return 0; } +std::size_t hash_value(struct4 const&) { return 0; } + +bool operator==(struct1 const&, struct1 const&) { return true; } +bool operator==(struct2 const&, struct2 const&) { return true; } +bool operator==(struct3 const&, struct3 const&) { return true; } +bool operator==(struct4 const&, struct4 const&) { return true; } +} + +int main() +{ + // This could just be a compile test, but I like to be able to run these + // things. It's probably irrational, but I find it reassuring. + + incomplete_test::use_types(); +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/insert_hint_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_hint_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5b4268bbbeef31f152474d42607c5bfee964260e --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_hint_tests.cpp @@ -0,0 +1,128 @@ + +// Copyright 2016 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../helpers/invariants.hpp" + +#include +#include + +namespace insert_hint { +UNORDERED_AUTO_TEST(insert_hint_empty) +{ + typedef boost::unordered_multiset container; + container x; + x.insert(x.cbegin(), 10); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST_EQ(x.count(10), 1u); + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(insert_hint_empty2) +{ + typedef boost::unordered_multimap container; + container x; + x.emplace_hint(x.cbegin(), "hello", 50); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST_EQ(x.count("hello"), 1u); + BOOST_TEST_EQ(x.find("hello")->second, 50); + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(insert_hint_single) +{ + typedef boost::unordered_multiset container; + container x; + x.insert("equal"); + x.insert(x.cbegin(), "equal"); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST_EQ(x.count("equal"), 2u); + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(insert_hint_single2) +{ + typedef boost::unordered_multimap container; + container x; + x.emplace(10, "one"); + x.emplace_hint(x.cbegin(), 10, "two"); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST_EQ(x.count(10), 2u); + + container::iterator it = x.find(10); + std::string v0 = (it++)->second; + std::string v1 = (it++)->second; + + BOOST_TEST(v0 == "one" || v0 == "two"); + BOOST_TEST(v1 == "one" || v1 == "two"); + BOOST_TEST(v0 != v1); + + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(insert_hint_multiple) +{ + for (unsigned int size = 0; size < 10; ++size) { + for (unsigned int offset = 0; offset <= size; ++offset) { + typedef boost::unordered_multiset container; + container x; + + for (unsigned int i = 0; i < size; ++i) { + x.insert("multiple"); + } + + BOOST_TEST_EQ(x.size(), size); + + container::const_iterator position = x.cbegin(); + for (unsigned int i = 0; i < offset; ++i) { + ++position; + } + + x.insert(position, "multiple"); + + BOOST_TEST_EQ(x.size(), size + 1u); + BOOST_TEST_EQ(x.count("multiple"), size + 1u); + test::check_equivalent_keys(x); + } + } +} + +UNORDERED_AUTO_TEST(insert_hint_unique) +{ + typedef boost::unordered_set container; + container x; + x.insert(x.cbegin(), 10); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST_EQ(x.count(10), 1u); + test::check_equivalent_keys(x); +} + +UNORDERED_AUTO_TEST(insert_hint_unique_single) +{ + typedef boost::unordered_set container; + container x; + x.insert(10); + + x.insert(x.cbegin(), 10); + BOOST_TEST_EQ(x.size(), 1u); + BOOST_TEST_EQ(x.count(10), 1u); + test::check_equivalent_keys(x); + + x.insert(x.cbegin(), 20); + BOOST_TEST_EQ(x.size(), 2u); + BOOST_TEST_EQ(x.count(10), 1u); + BOOST_TEST_EQ(x.count(20), 1u); + test::check_equivalent_keys(x); +} +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/insert_node_type_fail.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_node_type_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27bab78b11a7874324f62b8fa9a090c84689cd8c --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_node_type_fail.cpp @@ -0,0 +1,34 @@ + +// Copyright 2017 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +int main() +{ +#if defined(UNORDERED_TEST_MAP) + typedef boost::unordered_map container; + container x; + x.emplace(1, 1); +#elif defined(UNORDERED_TEST_MULTIMAP) + typedef boost::unordered_multimap container; + container x; +#elif defined(UNORDERED_TEST_SET) + typedef boost::unordered_set container; + container x; + x.emplace(1); +#elif defined(UNORDERED_TEST_MULTISET) + typedef boost::unordered_multiset container; + container x; + x.emplace(1); +#else +#define UNORDERED_ERROR +#endif + +#if !defined(UNORDERED_ERROR) + container::node_type n = x.extract(x.begin()); + x.insert(n); +#endif +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/insert_stable_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_stable_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9915c10b52ed48bc0c8548b952f773b6371506d8 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_stable_tests.cpp @@ -0,0 +1,117 @@ + +// Copyright 2007-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" + +namespace insert_stable { +struct member +{ + int tag1_; + int tag2_; + + member() : tag1_(0), tag2_(0) {} + member(int t1, int t2) : tag1_(t1), tag2_(t2) {} + + friend bool operator==(member const& x, member const& y) + { + return x.tag1_ == y.tag1_; + } + + friend bool operator!=(member const& x, member const& y) + { + return x.tag1_ != y.tag1_; + } +}; +} + +#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP +namespace boost +#else +namespace insert_stable +#endif +{ +std::size_t hash_value(insert_stable::member const& x) +{ + return static_cast(x.tag1_); +} +} + +// This is no longer supported, as there's no longer an efficient way to get to +// the end of a group of equivalent nodes. +#if 0 + +UNORDERED_AUTO_TEST(stable_insert_test1) +{ + boost::unordered_multiset x; + + x.insert(insert_stable::member(1, 1)); + x.insert(insert_stable::member(1, 2)); + x.insert(insert_stable::member(1, 3)); + + BOOST_TEST(x.count(insert_stable::member(1, 4)) == 3); + + boost::unordered_multiset::const_iterator + it = x.begin(), + end = x.end(); + BOOST_TEST(it != end); + if (it != end) { + BOOST_TEST(it->tag2_ == 1); + ++it; + } + BOOST_TEST(it != end); + if (it != end) { + BOOST_TEST(it->tag2_ == 2); + ++it; + } + BOOST_TEST(it != end); + if (it != end) { + BOOST_TEST(it->tag2_ == 3); + ++it; + } + BOOST_TEST(it == end); +} + +UNORDERED_AUTO_TEST(stable_insert_test2) +{ + boost::unordered_multimap x; + typedef boost::unordered_multimap::const_iterator iterator; + + iterator it = x.emplace(insert_stable::member(1, 1), 1); + it = x.emplace(insert_stable::member(1, 2), 2); + it = x.emplace(insert_stable::member(1, 3), 3); + + BOOST_TEST(x.count(insert_stable::member(1, 4)) == 3); + + it = x.begin(); + iterator end = x.end(); + BOOST_TEST(it != end); + if (it != end) { + BOOST_TEST(it->first.tag2_ == 1 && it->second == 1); + ++it; + } + BOOST_TEST(it != end); + if (it != end) { + BOOST_TEST(it->first.tag2_ == 2 && it->second == 2); + ++it; + } + BOOST_TEST(it != end); + if (it != end) { + BOOST_TEST(it->first.tag2_ == 3 && it->second == 3); + ++it; + } + BOOST_TEST(it == end); +} + +#endif + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/insert_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f68d316c7092d6132e6e2317763ca1184538029 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/insert_tests.cpp @@ -0,0 +1,1483 @@ + +// Copyright 2006-2010 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(PIECEWISE_TEST_NAME) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/equivalent.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/input_iterator.hpp" +#include "../helpers/helpers.hpp" + +namespace insert_tests { + +test::seed_t initialize_seed(243432); + +template +void unique_insert_tests1(X*, test::random_generator generator) +{ + test::check_instances check_; + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef test::ordered ordered; + + UNORDERED_SUB_TEST("insert(value) tests for containers with unique keys") + { + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + std::pair r1 = x.insert(*it); + std::pair r2 = + tracker.insert(*it); + + BOOST_TEST(r1.second == r2.second); + BOOST_TEST(*r1.first == *r2.first); + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert(rvalue) tests for containers with unique keys") + { + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + typename X::value_type value = *it; + std::pair r1 = x.insert(boost::move(value)); + std::pair r2 = + tracker.insert(*it); + + BOOST_TEST(r1.second == r2.second); + BOOST_TEST(*r1.first == *r2.first); + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } +} + +template +void equivalent_insert_tests1(X*, test::random_generator generator) +{ + test::check_instances check_; + + UNORDERED_SUB_TEST( + "insert(value) tests for containers with equivalent keys") + { + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + BOOST_DEDUCED_TYPENAME X::iterator r1 = x.insert(*it); + BOOST_DEDUCED_TYPENAME test::ordered::iterator r2 = + tracker.insert(*it); + + BOOST_TEST(*r1 == *r2); + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST( + "insert(rvalue) tests for containers with equivalent keys") + { + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + typename X::value_type value = *it; + BOOST_DEDUCED_TYPENAME X::iterator r1 = + x.insert(boost::move(value)); + BOOST_DEDUCED_TYPENAME test::ordered::iterator r2 = + tracker.insert(*it); + + BOOST_TEST(*r1 == *r2); + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } +} + +template void insert_tests2(X*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME test::ordered tracker_type; + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator; + typedef BOOST_DEDUCED_TYPENAME tracker_type::iterator tracker_iterator; + + UNORDERED_SUB_TEST("insert(begin(), value) tests") + { + test::check_instances check_; + + X x; + tracker_type tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator r1 = x.insert(x.begin(), *it); + tracker_iterator r2 = tracker.insert(tracker.begin(), *it); + BOOST_TEST(*r1 == *r2); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert(end(), value) tests") + { + test::check_instances check_; + + X x; + X const& x_const = x; + tracker_type tracker = test::create_ordered(x); + + test::random_values v(100, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + const_iterator r1 = x.insert(x_const.end(), *it); + tracker_iterator r2 = tracker.insert(tracker.end(), *it); + BOOST_TEST(*r1 == *r2); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert(pos, value) tests") + { + test::check_instances check_; + + X x; + const_iterator pos = x.begin(); + tracker_type tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + pos = x.insert(pos, *it); + tracker_iterator r2 = tracker.insert(tracker.begin(), *it); + BOOST_TEST(*pos == *r2); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert(pos, rvalue) tests") + { + test::check_instances check_; + + X x; + const_iterator pos = x.begin(); + tracker_type tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + typename X::value_type value = *it; + pos = x.insert(pos, boost::move(value)); + tracker_iterator r2 = tracker.insert(tracker.begin(), *it); + BOOST_TEST(*pos == *r2); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert single item range tests") + { + test::check_instances check_; + + X x; + tracker_type tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + x.insert(it, test::next(it)); + tracker.insert(*it); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert range tests") + { + test::check_instances check_; + + X x; + + test::random_values v(1000, generator); + x.insert(v.begin(), v.end()); + + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert range with rehash tests") + { + test::check_instances check_; + + X x; + + test::random_values v(1000, generator); + + x.insert(*v.begin()); + x.clear(); + + x.insert(v.begin(), v.end()); + + test::check_container(x, v); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert input iterator range tests") + { + test::check_instances check_; + + X x; + + test::random_values v(1000, generator); + BOOST_DEDUCED_TYPENAME test::random_values::const_iterator + begin = v.begin(), + end = v.end(); + x.insert(test::input_iterator(begin), test::input_iterator(end)); + test::check_container(x, v); + + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert copy iterator range tests") + { + test::check_instances check_; + + X x; + + test::random_values v(1000, generator); + x.insert(test::copy_iterator(v.begin()), test::copy_iterator(v.end())); + test::check_container(x, v); + + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert copy iterator range test 2") + { + test::check_instances check_; + + X x; + + test::random_values v1(500, generator); + test::random_values v2(500, generator); + x.insert( + test::copy_iterator(v1.begin()), test::copy_iterator(v1.end())); + x.insert( + test::copy_iterator(v2.begin()), test::copy_iterator(v2.end())); + + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert various ranges") + { + for (int i = 0; i < 100; ++i) { + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end();) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + BOOST_DEDUCED_TYPENAME test::random_values::iterator next = + it; + for (std::size_t j = test::random_value(20); j > 0; ++j) { + ++next; + if (next == v.end()) { + break; + } + } + + x.insert(it, next); + tracker.insert(it, next); + it = next; + + tracker.compare(x); // Slow, but I can't see any other way. + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } + } +} + +template +void unique_emplace_tests1(X*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + typedef test::ordered ordered; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = v.begin(); + it != v.end(); ++it) { + + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); + float b = x.max_load_factor(); + + std::pair r1 = x.emplace(*it); + std::pair r2 = + tracker.insert(*it); + + BOOST_TEST(r1.second == r2.second); + BOOST_TEST(*r1.first == *r2.first); + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); +} + +template +void equivalent_emplace_tests1(X*, test::random_generator generator) +{ + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); + float b = x.max_load_factor(); + + BOOST_DEDUCED_TYPENAME X::iterator r1 = x.emplace(*it); + BOOST_DEDUCED_TYPENAME test::ordered::iterator r2 = + tracker.insert(*it); + + BOOST_TEST(*r1 == *r2); + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); +} + +template void move_emplace_tests(X*, test::random_generator generator) +{ + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = v.begin(); + it != v.end(); ++it) { + + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); + float b = x.max_load_factor(); + + typename X::value_type value = *it; + x.emplace(boost::move(value)); + tracker.insert(*it); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); +} + +template void default_emplace_tests(X*, test::random_generator) +{ +#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 + bool is_unique = test::has_unique_keys::value; + + X x; + + x.emplace(); + BOOST_TEST(x.size() == 1); + x.emplace(); + BOOST_TEST(x.size() == (is_unique ? 1u : 2u)); + x.emplace(); + BOOST_TEST(x.size() == (is_unique ? 1u : 3u)); + + typename X::value_type y; + BOOST_TEST(x.count(test::get_key(y)) == (is_unique ? 1u : 3u)); + BOOST_TEST(*x.equal_range(test::get_key(y)).first == y); + + x.emplace(y); + BOOST_TEST(x.size() == (is_unique ? 1u : 4u)); + BOOST_TEST(x.count(test::get_key(y)) == (is_unique ? 1u : 4u)); + BOOST_TEST(*x.equal_range(test::get_key(y)).first == y); + + x.clear(); + BOOST_TEST(x.empty()); + x.emplace(y); + BOOST_TEST(x.size() == 1); + x.emplace(y); + BOOST_TEST(x.size() == (is_unique ? 1u : 2u)); + + BOOST_TEST(x.count(test::get_key(y)) == (is_unique ? 1u : 2u)); + BOOST_TEST(*x.equal_range(test::get_key(y)).first == y); +#endif +} + +template void map_tests(X*, test::random_generator generator) +{ + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count(); + float b = x.max_load_factor(); + + x[it->first] = it->second; + tracker[it->first] = it->second; + + tracker.compare_key(x, *it); + + if (static_cast(x.size()) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); +} + +template void map_tests2(X*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + UNORDERED_SUB_TEST("insert_or_assign") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + std::pair r = + x.insert_or_assign(it->first, it->second); + BOOST_TEST(*r.first == *it); + + tracker[it->first] = it->second; + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert_or_assign(begin)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator r = x.insert_or_assign(x.begin(), it->first, it->second); + BOOST_TEST(*r == *it); + + tracker[it->first] = it->second; + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert_or_assign(end)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator r = x.insert_or_assign(x.end(), it->first, it->second); + BOOST_TEST(*r == *it); + + tracker[it->first] = it->second; + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } + + UNORDERED_SUB_TEST("insert_or_assign(last)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + iterator last = x.begin(); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator r = x.insert_or_assign(last, it->first, it->second); + BOOST_TEST(*r == *it); + + tracker[it->first] = it->second; + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + + last = r; + } + + tracker.compare(x); + test::check_equivalent_keys(x); + } +} + +template void try_emplace_tests(X*, test::random_generator generator) +{ + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + UNORDERED_SUB_TEST("try_emplace(key, value)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator pos = x.find(it->first); + bool found = pos != x.end(); + + std::pair r = + x.try_emplace(it->first, it->second); + if (found) { + BOOST_TEST(pos == r.first); + BOOST_TEST(!r.second); + } else { + BOOST_TEST(r.second); + } + BOOST_TEST_EQ(r.first->first, it->first); + BOOST_TEST_EQ(r.first->second, it->second); + + tracker.insert(*it); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + UNORDERED_SUB_TEST("try_emplace(begin(), key, value)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator pos = x.find(it->first); + bool found = pos != x.end(); + + typename X::iterator r = + x.try_emplace(r.begin(), it->first, it->second); + if (found) { + BOOST_TEST(pos == r); + } + BOOST_TEST_EQ(r->first, it->first); + BOOST_TEST_EQ(r->second, it->second); + + tracker.insert(*it); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + UNORDERED_SUB_TEST("try_emplace(end(), key, value)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator pos = x.find(it->first); + bool found = pos != x.end(); + + typename X::iterator r = + x.try_emplace(r.end(), it->first, it->second); + if (found) { + BOOST_TEST(pos == r); + } + BOOST_TEST_EQ(r->first, it->first); + BOOST_TEST_EQ(r->second, it->second); + + tracker.insert(*it); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } + + typedef BOOST_DEDUCED_TYPENAME X::iterator iterator; + + UNORDERED_SUB_TEST("try_emplace(pos, key, value)") + { + test::check_instances check_; + + X x; + test::ordered tracker = test::create_ordered(x); + + test::random_values v(1000, generator); + for (BOOST_DEDUCED_TYPENAME test::random_values::iterator it = + v.begin(); + it != v.end(); ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = + x.bucket_count(); + float b = x.max_load_factor(); + + iterator pos = x.find(it->first); + bool found = pos != x.end(); + + typename X::iterator r = x.try_emplace(pos, it->first, it->second); + if (found) { + BOOST_TEST(pos == r); + } + BOOST_TEST_EQ(r->first, it->first); + BOOST_TEST_EQ(r->second, it->second); + + tracker.insert(*it); + tracker.compare_key(x, *it); + + if (static_cast(x.size()) < + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } + + test::check_equivalent_keys(x); + } +} + +// Some tests for when the range's value type doesn't match the container's +// value type. + +template +void map_insert_range_test1(X*, test::random_generator generator) +{ + test::check_instances check_; + + typedef test::list > + list; + test::random_values v(1000, generator); + list l(v.begin(), v.end()); + + X x; + x.insert(l.begin(), l.end()); + + test::check_equivalent_keys(x); +} + +template +void map_insert_range_test2(X*, test::random_generator generator) +{ + test::check_instances check_; + + typedef test::list > + list; + test::random_values > + v(1000, generator); + list l(v.begin(), v.end()); + + X x; + x.insert(l.begin(), l.end()); + + test::check_equivalent_keys(x); +} + +boost::unordered_set >* test_set_std_alloc; +boost::unordered_multimap >* test_multimap_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(unique_insert_tests1, + ((test_set_std_alloc)(test_set)(test_map))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(equivalent_insert_tests1, + ((test_multimap_std_alloc)(test_multiset)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST( + insert_tests2, ((test_multimap_std_alloc)(test_set)(test_multiset)( + test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(unique_emplace_tests1, + ((test_set_std_alloc)(test_set)(test_map))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(equivalent_emplace_tests1, + ((test_multimap_std_alloc)(test_multiset)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(move_emplace_tests, + ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)( + test_multiset)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(default_emplace_tests, + ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)( + test_multiset)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(map_tests, + ((test_map))((default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST( + map_tests2, ((test_map))((default_generator)(generate_collisions))) + +UNORDERED_TEST(map_insert_range_test1, + ((test_multimap_std_alloc)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(map_insert_range_test2, + ((test_multimap_std_alloc)(test_map)(test_multimap))( + (default_generator)(generate_collisions)(limited_range))) + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + +struct initialize_from_two_ints +{ + int a, b; + + friend std::size_t hash_value(initialize_from_two_ints const& x) + { + return static_cast(x.a + x.b); + } + + bool operator==(initialize_from_two_ints const& x) const + { + return a == x.a && b == x.b; + } +}; + +UNORDERED_AUTO_TEST(insert_initializer_list_set) +{ + boost::unordered_set set; + set.insert({1, 2, 3, 1}); + BOOST_TEST_EQ(set.size(), 3u); + BOOST_TEST(set.find(1) != set.end()); + BOOST_TEST(set.find(4) == set.end()); + + boost::unordered_set set2; + +#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)) + set2.insert({{1, 2}}); +#else + set2.insert({1, 2}); +#endif + BOOST_TEST(set2.size() == 1); + BOOST_TEST(set2.find({1, 2}) != set2.end()); + BOOST_TEST(set2.find({2, 1}) == set2.end()); + + set2.insert({{3, 4}, {5, 6}, {7, 8}}); + BOOST_TEST(set2.size() == 4); + BOOST_TEST(set2.find({1, 2}) != set2.end()); + BOOST_TEST(set2.find({3, 4}) != set2.end()); + BOOST_TEST(set2.find({5, 6}) != set2.end()); + BOOST_TEST(set2.find({7, 8}) != set2.end()); + BOOST_TEST(set2.find({8, 7}) == set2.end()); + + set2.insert({{2, 1}, {3, 4}}); + BOOST_TEST(set2.size() == 5); + BOOST_TEST(set2.find({1, 2}) != set2.end()); + BOOST_TEST(set2.find({2, 1}) != set2.end()); + BOOST_TEST(set2.find({3, 4}) != set2.end()); + BOOST_TEST(set2.find({5, 6}) != set2.end()); + BOOST_TEST(set2.find({7, 8}) != set2.end()); + BOOST_TEST(set2.find({8, 7}) == set2.end()); +} + +#if !BOOST_WORKAROUND(BOOST_MSVC, == 1800) + +UNORDERED_AUTO_TEST(insert_initializer_list_multiset) +{ + boost::unordered_multiset multiset; + // multiset.insert({}); + BOOST_TEST(multiset.empty()); + multiset.insert({"a"}); + BOOST_TEST_EQ(multiset.size(), 1u); + BOOST_TEST(multiset.find("a") != multiset.end()); + BOOST_TEST(multiset.find("b") == multiset.end()); + multiset.insert({"a", "b"}); + BOOST_TEST(multiset.size() == 3); + BOOST_TEST_EQ(multiset.count("a"), 2u); + BOOST_TEST_EQ(multiset.count("b"), 1u); + BOOST_TEST_EQ(multiset.count("c"), 0u); +} + +#endif + +UNORDERED_AUTO_TEST(insert_initializer_list_map) +{ + boost::unordered_map map; + // map.insert({}); + BOOST_TEST(map.empty()); + map.insert({{"a", "b"}, {"a", "b"}, {"d", ""}}); + BOOST_TEST_EQ(map.size(), 2u); +} + +UNORDERED_AUTO_TEST(insert_initializer_list_multimap) +{ + boost::unordered_multimap multimap; + // multimap.insert({}); + BOOST_TEST(multimap.empty()); + multimap.insert({{"a", "b"}, {"a", "b"}, {"d", ""}}); + BOOST_TEST_EQ(multimap.size(), 3u); + BOOST_TEST_EQ(multimap.count("a"), 2u); +} + +#endif + +struct overloaded_constructor +{ + overloaded_constructor(int x1_ = 1, int x2_ = 2, int x3_ = 3, int x4_ = 4) + : x1(x1_), x2(x2_), x3(x3_), x4(x4_) + { + } + + int x1, x2, x3, x4; + + bool operator==(overloaded_constructor const& rhs) const + { + return x1 == rhs.x1 && x2 == rhs.x2 && x3 == rhs.x3 && x4 == rhs.x4; + } + + friend std::size_t hash_value(overloaded_constructor const& x) + { + std::size_t hash = 0; + boost::hash_combine(hash, x.x1); + boost::hash_combine(hash, x.x2); + boost::hash_combine(hash, x.x3); + boost::hash_combine(hash, x.x4); + return hash; + } +}; + +UNORDERED_AUTO_TEST(map_emplace_test) +{ + { + boost::unordered_map > > + x; + +#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 + x.emplace(); + BOOST_TEST(x.find(0) != x.end() && + x.find(0)->second == overloaded_constructor()); +#endif + + x.emplace(2, 3); + BOOST_TEST(x.find(2) != x.end() && + x.find(2)->second == overloaded_constructor(3)); + + x.try_emplace(5); + BOOST_TEST(x.find(5) != x.end() && + x.find(5)->second == overloaded_constructor()); + } + + { + boost::unordered_multimap > > + x; + +#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 + x.emplace(); + BOOST_TEST(x.find(0) != x.end() && + x.find(0)->second == overloaded_constructor()); +#endif + + x.emplace(2, 3); + BOOST_TEST(x.find(2) != x.end() && + x.find(2)->second == overloaded_constructor(3)); + } +} + +UNORDERED_AUTO_TEST(set_emplace_test) +{ + boost::unordered_set x; + overloaded_constructor check; + +#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 + x.emplace(); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); +#endif + + x.clear(); + x.emplace(1); + check = overloaded_constructor(1); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); + + x.clear(); + x.emplace(2, 3); + check = overloaded_constructor(2, 3); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); + + x.clear(); + x.emplace(4, 5, 6); + check = overloaded_constructor(4, 5, 6); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); + + x.clear(); + x.emplace(7, 8, 9, 10); + check = overloaded_constructor(7, 8, 9, 10); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); +} + +struct derived_from_piecewise_construct_t + : boost::unordered::piecewise_construct_t +{ +}; + +derived_from_piecewise_construct_t piecewise_rvalue() +{ + return derived_from_piecewise_construct_t(); +} + +struct convertible_to_piecewise +{ + operator boost::unordered::piecewise_construct_t() const + { + return boost::unordered::piecewise_construct; + } +}; + +UNORDERED_AUTO_TEST(map_emplace_test2) +{ + // Emulating piecewise construction with boost::tuple bypasses the + // allocator's construct method, but still uses test destroy method. + test::detail::disable_construction_tracking _scoped; + + { + boost::unordered_map, + std::equal_to, + test::allocator1 > > + x; + + x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), + boost::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.emplace(convertible_to_piecewise(), boost::make_tuple(1), + boost::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.emplace(piecewise_rvalue(), boost::make_tuple(2, 3), + boost::make_tuple(4, 5, 6)); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + + derived_from_piecewise_construct_t d; + x.emplace(d, boost::make_tuple(9, 3, 1), boost::make_tuple(10)); + BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && + x.find(overloaded_constructor(9, 3, 1))->second == + overloaded_constructor(10)); + + x.clear(); + + x.try_emplace(overloaded_constructor()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.try_emplace(1); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.try_emplace(overloaded_constructor(2, 3), 4, 5, 6); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + + x.clear(); + + x.try_emplace(x.begin(), overloaded_constructor()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.try_emplace(x.end(), 1); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.try_emplace(x.begin(), overloaded_constructor(2, 3), 4, 5, 6); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + } + + { + boost::unordered_multimap, + std::equal_to, + test::allocator1 > > + x; + + x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), + boost::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.emplace(convertible_to_piecewise(), boost::make_tuple(1), + boost::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.emplace(piecewise_rvalue(), boost::make_tuple(2, 3), + boost::make_tuple(4, 5, 6)); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + + derived_from_piecewise_construct_t d; + x.emplace(d, boost::make_tuple(9, 3, 1), boost::make_tuple(10)); + BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && + x.find(overloaded_constructor(9, 3, 1))->second == + overloaded_constructor(10)); + } +} + +UNORDERED_AUTO_TEST(set_emplace_test2) +{ + boost::unordered_set< + std::pair > + x; + std::pair check; + + x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), + boost::make_tuple()); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); + + x.clear(); + x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(1), + boost::make_tuple(2, 3)); + check = + std::make_pair(overloaded_constructor(1), overloaded_constructor(2, 3)); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); +} + +// Use the preprocessor to generate tests using different combinations of +// boost/std piecewise_construct_t/tuple. + +#define PIECEWISE_TEST_NAME boost_tuple_piecewise_tests +#define PIECEWISE_NAMESPACE boost::unordered +#define TUPLE_NAMESPACE boost +#define EMULATING_PIECEWISE_CONSTRUCTION 1 +#include "./insert_tests.cpp" + +#if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT + +#define PIECEWISE_TEST_NAME boost_tuple_std_piecewise_tests +#define PIECEWISE_NAMESPACE std +#define TUPLE_NAMESPACE boost +#define EMULATING_PIECEWISE_CONSTRUCTION 1 +#include "./insert_tests.cpp" + +#endif + +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) + +#define PIECEWISE_TEST_NAME std_tuple_boost_piecewise_tests +#define PIECEWISE_NAMESPACE boost::unordered +#define TUPLE_NAMESPACE std +#define EMULATING_PIECEWISE_CONSTRUCTION 0 +#include "./insert_tests.cpp" + +#endif + +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \ + BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT + +#define PIECEWISE_TEST_NAME std_piecewise_tests +#define PIECEWISE_NAMESPACE std +#define TUPLE_NAMESPACE std +#define EMULATING_PIECEWISE_CONSTRUCTION 0 +#include "./insert_tests.cpp" + +#endif +} + +RUN_TESTS_QUIET() + +#else // PIECEWISE_TEST_NAME + +UNORDERED_AUTO_TEST(PIECEWISE_TEST_NAME) +{ +#if EMULATING_PIECEWISE_CONSTRUCTION + test::detail::disable_construction_tracking _scoped; +#endif + + { + boost::unordered_map, + std::equal_to, + test::allocator1 > > + x; + + x.emplace(PIECEWISE_NAMESPACE::piecewise_construct, + TUPLE_NAMESPACE::make_tuple(), TUPLE_NAMESPACE::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.emplace(convertible_to_piecewise(), TUPLE_NAMESPACE::make_tuple(1), + TUPLE_NAMESPACE::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.emplace(piecewise_rvalue(), TUPLE_NAMESPACE::make_tuple(2, 3), + TUPLE_NAMESPACE::make_tuple(4, 5, 6)); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + + derived_from_piecewise_construct_t d; + x.emplace(d, TUPLE_NAMESPACE::make_tuple(9, 3, 1), + TUPLE_NAMESPACE::make_tuple(10)); + BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && + x.find(overloaded_constructor(9, 3, 1))->second == + overloaded_constructor(10)); + + x.clear(); + + x.try_emplace(overloaded_constructor()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.try_emplace(1); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.try_emplace(overloaded_constructor(2, 3), 4, 5, 6); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + } + { + boost::unordered_multimap, + std::equal_to, + test::allocator1 > > + x; + + x.emplace(PIECEWISE_NAMESPACE::piecewise_construct, + TUPLE_NAMESPACE::make_tuple(), TUPLE_NAMESPACE::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor()) != x.end() && + x.find(overloaded_constructor())->second == + overloaded_constructor()); + + x.emplace(convertible_to_piecewise(), TUPLE_NAMESPACE::make_tuple(1), + TUPLE_NAMESPACE::make_tuple()); + BOOST_TEST(x.find(overloaded_constructor(1)) != x.end() && + x.find(overloaded_constructor(1))->second == + overloaded_constructor()); + + x.emplace(piecewise_rvalue(), TUPLE_NAMESPACE::make_tuple(2, 3), + TUPLE_NAMESPACE::make_tuple(4, 5, 6)); + BOOST_TEST(x.find(overloaded_constructor(2, 3)) != x.end() && + x.find(overloaded_constructor(2, 3))->second == + overloaded_constructor(4, 5, 6)); + + derived_from_piecewise_construct_t d; + x.emplace(d, TUPLE_NAMESPACE::make_tuple(9, 3, 1), + TUPLE_NAMESPACE::make_tuple(10)); + BOOST_TEST(x.find(overloaded_constructor(9, 3, 1)) != x.end() && + x.find(overloaded_constructor(9, 3, 1))->second == + overloaded_constructor(10)); + } +} + +UNORDERED_AUTO_TEST(BOOST_PP_CAT(PIECEWISE_TEST_NAME, 2)) +{ +#if EMULATING_PIECEWISE_CONSTRUCTION + test::detail::disable_construction_tracking _scoped; +#endif + + boost::unordered_set< + std::pair > + x; + std::pair check; + + x.emplace(PIECEWISE_NAMESPACE::piecewise_construct, + TUPLE_NAMESPACE::make_tuple(), TUPLE_NAMESPACE::make_tuple()); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); + + x.clear(); + x.emplace(PIECEWISE_NAMESPACE::piecewise_construct, + TUPLE_NAMESPACE::make_tuple(1), TUPLE_NAMESPACE::make_tuple(2, 3)); + check = + std::make_pair(overloaded_constructor(1), overloaded_constructor(2, 3)); + BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check); +} + +#undef PIECEWISE_TEST_NAME +#undef PIECEWISE_NAMESPACE +#undef TUPLE_NAMESPACE +#undef EMULATING_PIECEWISE_CONSTRUCTION + +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/link_test_1.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/link_test_1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..120bde594ad4d36c6378f17e46ce6cd4e5502da6 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/link_test_1.cpp @@ -0,0 +1,26 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +void foo(boost::unordered_set&, boost::unordered_map&, + boost::unordered_multiset&, boost::unordered_multimap&); + +int main() +{ + boost::unordered_set x1; + boost::unordered_map x2; + boost::unordered_multiset x3; + boost::unordered_multimap x4; + + foo(x1, x2, x3, x4); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/link_test_2.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/link_test_2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b76da7b06e53cc2e96a39f6214a3f4274256d119 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/link_test_2.cpp @@ -0,0 +1,30 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +void foo(boost::unordered_set& x1, boost::unordered_map& x2, + boost::unordered_multiset& x3, boost::unordered_multimap& x4) +{ +#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613)) + struct dummy + { + boost::unordered_set x1; + boost::unordered_map x2; + boost::unordered_multiset x3; + boost::unordered_multimap x4; + }; +#endif + + x1.insert(1); + x2[2] = 2; + x3.insert(3); + x4.insert(std::make_pair(4, 5)); +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/load_factor_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/load_factor_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6280d97767bce2ca8e96f6b5182c4ddaefd546ae --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/load_factor_tests.cpp @@ -0,0 +1,98 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include +#include "../helpers/random_values.hpp" + +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +namespace load_factor_tests { + +test::seed_t initialize_seed(783656); + +template void set_load_factor_tests(X*) +{ + X x; + + BOOST_TEST(x.max_load_factor() == 1.0); + BOOST_TEST(x.load_factor() == 0); + + // A valid implementation could fail these tests, but I think they're + // reasonable. + x.max_load_factor(2.0); + BOOST_TEST(x.max_load_factor() == 2.0); + x.max_load_factor(0.5); + BOOST_TEST(x.max_load_factor() == 0.5); +} + +template +void insert_test(X*, float mlf, test::random_generator generator) +{ + X x; + x.max_load_factor(mlf); + float b = x.max_load_factor(); + + test::random_values values(1000, generator); + + for (BOOST_DEDUCED_TYPENAME test::random_values::const_iterator + it = values.begin(), + end = values.end(); + it != end; ++it) { + BOOST_DEDUCED_TYPENAME X::size_type old_size = x.size(), + old_bucket_count = x.bucket_count(); + x.insert(*it); + if (static_cast(old_size + 1) <= + b * static_cast(old_bucket_count)) + BOOST_TEST(x.bucket_count() == old_bucket_count); + } +} + +template +void load_factor_insert_tests(X* ptr, test::random_generator generator) +{ + insert_test(ptr, 1.0f, generator); + insert_test(ptr, 0.1f, generator); + insert_test(ptr, 100.0f, generator); + + insert_test(ptr, (std::numeric_limits::min)(), generator); + + if (std::numeric_limits::has_infinity) + insert_test(ptr, std::numeric_limits::infinity(), generator); +} + +boost::unordered_set* int_set_ptr; +boost::unordered_multiset* int_multiset_ptr; +boost::unordered_map* int_map_ptr; +boost::unordered_multimap* int_multimap_ptr; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(set_load_factor_tests, + ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))) + +UNORDERED_TEST(load_factor_insert_tests, + ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))( + (default_generator)(generate_collisions)(limited_range))) +} + +RUN_TESTS() + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#pragma warning(disable : 4127) // conditional expression is constant +#endif diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/merge_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/merge_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8d0d4915f11fa946b0d37f085496137b05abdcb1 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/merge_tests.cpp @@ -0,0 +1,341 @@ + +// Copyright 2016 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "../helpers/postfix.hpp" +#include "../helpers/prefix.hpp" +#include +#include + +#include "../helpers/count.hpp" +#include "../helpers/helpers.hpp" +#include "../helpers/invariants.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/test.hpp" +#include "../helpers/tracker.hpp" +#include "../objects/test.hpp" +#include + +namespace merge_tests { + +UNORDERED_AUTO_TEST(merge_set) +{ + boost::unordered_set x; + boost::unordered_set y; + + x.merge(y); + BOOST_TEST(x.empty()); + BOOST_TEST(y.empty()); + + x.insert(10); + x.merge(y); + BOOST_TEST(x.size() == 1); + BOOST_TEST(x.count(10) == 1); + BOOST_TEST(y.empty()); + + y.merge(x); + BOOST_TEST(x.empty()); + BOOST_TEST(y.size() == 1); + BOOST_TEST(y.count(10) == 1); + + x.insert(10); + x.insert(50); + y.insert(70); + y.insert(80); + x.merge(y); + BOOST_TEST_EQ(x.size(), 4u); + BOOST_TEST_EQ(y.size(), 1u); + BOOST_TEST_EQ(x.count(10), 1u); + BOOST_TEST_EQ(x.count(50), 1u); + BOOST_TEST_EQ(x.count(70), 1u); + BOOST_TEST_EQ(x.count(80), 1u); + BOOST_TEST_EQ(y.count(10), 1u); + BOOST_TEST_EQ(y.count(50), 0u); + BOOST_TEST_EQ(y.count(70), 0u); + BOOST_TEST_EQ(y.count(80), 0u); + + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); +} + +UNORDERED_AUTO_TEST(merge_multiset) +{ + boost::unordered_multiset x; + boost::unordered_multiset y; + + x.merge(y); + BOOST_TEST(x.empty()); + BOOST_TEST(y.empty()); + + x.insert(10); + x.merge(y); + BOOST_TEST(x.size() == 1); + BOOST_TEST(x.count(10) == 1); + BOOST_TEST(y.empty()); + + y.merge(x); + BOOST_TEST(x.empty()); + BOOST_TEST(y.size() == 1); + BOOST_TEST(y.count(10) == 1); + + x.insert(10); + x.insert(50); + y.insert(70); + y.insert(80); + x.merge(y); + BOOST_TEST_EQ(x.size(), 5u); + BOOST_TEST_EQ(y.size(), 0u); + BOOST_TEST_EQ(x.count(10), 2u); + BOOST_TEST_EQ(x.count(50), 1u); + BOOST_TEST_EQ(x.count(70), 1u); + BOOST_TEST_EQ(x.count(80), 1u); + BOOST_TEST_EQ(y.count(10), 0u); + BOOST_TEST_EQ(y.count(50), 0u); + BOOST_TEST_EQ(y.count(70), 0u); + BOOST_TEST_EQ(y.count(80), 0u); + + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); +} + +UNORDERED_AUTO_TEST(merge_set_and_multiset) +{ + boost::unordered_set x; + boost::unordered_multiset y; + + x.merge(y); + BOOST_TEST(x.empty()); + BOOST_TEST(y.empty()); + + x.insert(10); + x.merge(y); + BOOST_TEST(x.size() == 1); + BOOST_TEST(x.count(10) == 1); + BOOST_TEST(y.empty()); + + y.merge(x); + BOOST_TEST(x.empty()); + BOOST_TEST(y.size() == 1); + BOOST_TEST(y.count(10) == 1); + + x.insert(10); + x.insert(50); + y.insert(70); + y.insert(80); + x.merge(y); + BOOST_TEST_EQ(x.size(), 4u); + BOOST_TEST_EQ(y.size(), 1u); + BOOST_TEST_EQ(x.count(10), 1u); + BOOST_TEST_EQ(x.count(50), 1u); + BOOST_TEST_EQ(x.count(70), 1u); + BOOST_TEST_EQ(x.count(80), 1u); + BOOST_TEST_EQ(y.count(10), 1u); + BOOST_TEST_EQ(y.count(50), 0u); + BOOST_TEST_EQ(y.count(70), 0u); + BOOST_TEST_EQ(y.count(80), 0u); + + test::check_equivalent_keys(x); + test::check_equivalent_keys(y); +} + +template +void merge_empty_test(X1*, X2*, test::random_generator generator) +{ + test::check_instances check_; + + test::random_values v(1000, generator); + X1 x1(v.begin(), v.end()); + X2 x2; + x1.merge(x2); + test::check_container(x1, v); + BOOST_TEST(x2.empty()); + test::check_equivalent_keys(x1); + test::check_equivalent_keys(x2); +} + +template +void merge_into_empty_test(X*, test::random_generator generator) +{ + test::check_instances check_; + + test::random_values v(1000, generator); + X x1; + X x2(v.begin(), v.end()); + x1.merge(x2); + test::check_container(x1, v); + BOOST_TEST(x2.empty()); + test::check_equivalent_keys(x1); + test::check_equivalent_keys(x2); +} + +template +void merge_into_unique_keys_test(X1*, X2*, int hash_equal1, int hash_equal2, + test::random_generator generator) +{ + test::check_instances check_; + + test::random_values v1(1000, generator); + test::random_values v2(1000, generator); + v1.insert(v2.begin(), boost::next(v2.begin(), 100)); + v2.insert(v1.begin(), boost::next(v1.begin(), 100)); + + X1 x1(v1.begin(), v1.end(), 0, test::hash(hash_equal1), + test::equal_to(hash_equal1)); + X2 x2(v2.begin(), v2.end(), 0, test::hash(hash_equal2), + test::equal_to(hash_equal2)); + + test::ordered tracker1 = test::create_ordered(x1); + test::ordered tracker2 = test::create_ordered(x2); + tracker1.insert(v1.begin(), v1.end()); + for (typename X2::iterator it = x2.begin(); it != x2.end(); ++it) { + if (!tracker1.insert(*it).second) { + tracker2.insert(*it); + } + } + + x1.merge(x2); + + tracker1.compare(x1); + tracker2.compare(x2); + test::check_equivalent_keys(x1); + test::check_equivalent_keys(x2); +} + +template +void merge_into_equiv_keys_test(X1*, X2*, int hash_equal1, int hash_equal2, + test::random_generator generator) +{ + test::check_instances check_; + + test::random_values v1(1000, generator); + test::random_values v2(1000, generator); + v1.insert(v2.begin(), boost::next(v2.begin(), 100)); + v2.insert(v1.begin(), boost::next(v1.begin(), 100)); + + X1 x1(v1.begin(), v1.end(), 0, test::hash(hash_equal1), + test::equal_to(hash_equal1)); + X2 x2(v2.begin(), v2.end(), 0, test::hash(hash_equal2), + test::equal_to(hash_equal2)); + x1.merge(x2); + + test::ordered tracker1 = test::create_ordered(x1); + test::ordered tracker2 = test::create_ordered(x2); + tracker1.insert(v1.begin(), v1.end()); + tracker2.insert(v2.begin(), v2.end()); + tracker1.insert(tracker2.begin(), tracker2.end()); + tracker2.clear(); + + tracker1.compare(x1); + tracker2.compare(x2); + test::check_equivalent_keys(x1); + test::check_equivalent_keys(x2); +} + +boost::unordered_set >* test_set_std_alloc; +boost::unordered_multiset >* test_multiset_std_alloc; + +boost::unordered_map >* test_map_std_alloc; +boost::unordered_multimap >* test_multimap_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; + +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +using test::default_generator; +using test::generate_collisions; + +// clang-format off +UNORDERED_TEST(merge_empty_test, + ((test_set_std_alloc)(test_multiset_std_alloc)) + ((test_set_std_alloc)(test_multiset_std_alloc)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_empty_test, + ((test_map_std_alloc)(test_multimap_std_alloc)) + ((test_map_std_alloc)(test_multimap_std_alloc)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_empty_test, + ((test_set)(test_multiset)) + ((test_set)(test_multiset)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_empty_test, + ((test_map)(test_multimap)) + ((test_map)(test_multimap)) + ((default_generator)(generate_collisions))) + +UNORDERED_TEST(merge_into_empty_test, + ((test_set_std_alloc)(test_multiset_std_alloc)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_empty_test, + ((test_map_std_alloc)(test_multimap_std_alloc)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_empty_test, + ((test_set)(test_multiset)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_empty_test, + ((test_map)(test_multimap)) + ((default_generator)(generate_collisions))) + +UNORDERED_TEST(merge_into_unique_keys_test, + ((test_set_std_alloc)) + ((test_set_std_alloc)(test_multiset_std_alloc)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_unique_keys_test, + ((test_map_std_alloc)) + ((test_map_std_alloc)(test_multimap_std_alloc)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_unique_keys_test, + ((test_set)) + ((test_set)(test_multiset)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_unique_keys_test, + ((test_map)) + ((test_map)(test_multimap)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) + +UNORDERED_TEST(merge_into_equiv_keys_test, + ((test_multiset_std_alloc)) + ((test_set_std_alloc)(test_multiset_std_alloc)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_equiv_keys_test, + ((test_multimap_std_alloc)) + ((test_map_std_alloc)(test_multimap_std_alloc)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_equiv_keys_test, + ((test_multiset)) + ((test_set)(test_multiset)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +UNORDERED_TEST(merge_into_equiv_keys_test, + ((test_multimap)) + ((test_map)(test_multimap)) + ((0)(1)(2)) + ((0)(1)(2)) + ((default_generator)(generate_collisions))) +// clang-format on +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/minimal_allocator.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/minimal_allocator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..968f11fb60c0c726555b651f7f0c1934ae601487 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/minimal_allocator.cpp @@ -0,0 +1,93 @@ + +// Copyright 2011 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "../objects/test.hpp" +#include +#include +#include +#include + +template struct SimpleAllocator +{ + typedef Tp value_type; + + SimpleAllocator() {} + + template SimpleAllocator(const SimpleAllocator&) {} + + Tp* allocate(std::size_t n) + { + return static_cast(::operator new(n * sizeof(Tp))); + } + + void deallocate(Tp* p, std::size_t) { ::operator delete((void*)p); } +}; + +template void test_simple_allocator() +{ + test::check_instances check_; + + typedef boost::unordered::detail::allocator_traits > + traits; + + BOOST_STATIC_ASSERT((boost::is_same >::value)); + + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT( + (boost::is_same::value)); + // BOOST_STATIC_ASSERT((boost::is_same::value)); + // BOOST_STATIC_ASSERT((boost::is_same::value)); + + BOOST_STATIC_ASSERT((boost::is_same::value)); + +#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1 + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); +#else + BOOST_STATIC_ASSERT( + (boost::is_same::value)); +#endif + + BOOST_TEST(!traits::propagate_on_container_copy_assignment::value); + BOOST_TEST(!traits::propagate_on_container_move_assignment::value); + BOOST_TEST(!traits::propagate_on_container_swap::value); + + // rebind_alloc + // rebind_traits + + SimpleAllocator a; + + T* ptr1 = traits::allocate(a, 1); + // T* ptr2 = traits::allocate(a, 1, static_cast(ptr1)); + + traits::construct(a, ptr1, T(10)); + // traits::construct(a, ptr2, T(30), ptr1); + + BOOST_TEST(*ptr1 == T(10)); + // BOOST_TEST(*ptr2 == T(30)); + + traits::destroy(a, ptr1); + // traits::destroy(a, ptr2); + + // traits::deallocate(a, ptr2, 1); + traits::deallocate(a, ptr1, 1); + + traits::max_size(a); +} + +int main() +{ + test_simple_allocator(); + test_simple_allocator(); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/move_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/move_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aa2420e9d8eb5c048f29ab849dc74374adbf0799 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/move_tests.cpp @@ -0,0 +1,375 @@ + +// Copyright 2008-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or move at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../objects/cxx11_allocator.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/equivalent.hpp" +#include "../helpers/invariants.hpp" + +#if defined(BOOST_MSVC) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +namespace move_tests { +test::seed_t initialize_seed(98624); +#if defined(BOOST_UNORDERED_USE_MOVE) || \ + !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#define BOOST_UNORDERED_TEST_MOVING 1 +#else +#define BOOST_UNORDERED_TEST_MOVING 0 +#endif + +template T empty(T*) { return T(); } + +template +T create(test::random_values const& v, test::object_count& count) +{ + T x(v.begin(), v.end()); + count = test::global_object_count; + return x; +} + +template +T create(test::random_values const& v, test::object_count& count, + BOOST_DEDUCED_TYPENAME T::hasher hf, BOOST_DEDUCED_TYPENAME T::key_equal eq, + BOOST_DEDUCED_TYPENAME T::allocator_type al, float mlf) +{ + T x(0, hf, eq, al); + x.max_load_factor(mlf); + x.insert(v.begin(), v.end()); + count = test::global_object_count; + return x; +} + +template +void move_construct_tests1(T* ptr, test::random_generator const& generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf; + BOOST_DEDUCED_TYPENAME T::key_equal eq; + BOOST_DEDUCED_TYPENAME T::allocator_type al; + + { + test::check_instances check_; + + T y(empty(ptr)); + BOOST_TEST(y.empty()); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al)); + BOOST_TEST(y.max_load_factor() == 1.0); + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + test::random_values v(1000, generator); + test::object_count count; + T y(create(v, count)); +#if defined(BOOST_HAS_NRVO) + BOOST_TEST(count == test::global_object_count); +#endif + test::check_container(y, v); + test::check_equivalent_keys(y); + } +} + +template +void move_assign_tests1(T*, test::random_generator const& generator) +{ + { + test::check_instances check_; + + test::random_values v(500, generator); + test::object_count count; + T y; + y = create(v, count); +#if BOOST_UNORDERED_TEST_MOVING && defined(BOOST_HAS_NRVO) + BOOST_TEST(count == test::global_object_count); +#endif + test::check_container(y, v); + test::check_equivalent_keys(y); + } +} + +template +void move_construct_tests2(T*, test::random_generator const& generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf(1); + BOOST_DEDUCED_TYPENAME T::key_equal eq(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al2(2); + + test::object_count count; + + { + test::check_instances check_; + + test::random_values v(500, generator); + T y(create(v, count, hf, eq, al, 0.5)); +#if defined(BOOST_HAS_NRVO) + BOOST_TEST(count == test::global_object_count); +#endif + test::check_container(y, v); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al)); + BOOST_TEST(y.max_load_factor() == 0.5); // Not necessarily required. + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + // TODO: To do this correctly requires the fancy new allocator + // stuff. + test::random_values v(500, generator); + T y(create(v, count, hf, eq, al, 2.0), al2); + BOOST_TEST(count != test::global_object_count); + test::check_container(y, v); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + BOOST_TEST(y.max_load_factor() == 2.0); // Not necessarily required. + test::check_equivalent_keys(y); + } + + { + test::check_instances check_; + + test::random_values v(25, generator); + T y(create(v, count, hf, eq, al, 1.0), al); +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + BOOST_TEST(count == test::global_object_count); +#elif defined(BOOST_HAS_NRVO) + BOOST_TEST( + static_cast(test::global_object_count.constructions - + count.constructions) <= + (test::is_set::value ? 1 : 2) * + (test::has_unique_keys::value ? 25 : v.size())); + BOOST_TEST(count.instances == test::global_object_count.instances); +#else + BOOST_TEST( + static_cast(test::global_object_count.constructions - + count.constructions) <= + (test::is_set::value ? 2 : 4) * + (test::has_unique_keys::value ? 25 : v.size())); + BOOST_TEST(count.instances == test::global_object_count.instances); +#endif + test::check_container(y, v); + BOOST_TEST(test::equivalent(y.hash_function(), hf)); + BOOST_TEST(test::equivalent(y.key_eq(), eq)); + BOOST_TEST(test::equivalent(y.get_allocator(), al)); + BOOST_TEST(y.max_load_factor() == 1.0); // Not necessarily required. + test::check_equivalent_keys(y); + } +} + +template +void move_assign_tests2(T*, test::random_generator const& generator) +{ + BOOST_DEDUCED_TYPENAME T::hasher hf(1); + BOOST_DEDUCED_TYPENAME T::key_equal eq(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al1(1); + BOOST_DEDUCED_TYPENAME T::allocator_type al2(2); + typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type; + + { + test::random_values v(500, generator); + test::random_values v2(0, generator); + T y(v.begin(), v.end(), 0, hf, eq, al1); + test::object_count count; + y = create(v2, count, hf, eq, al2, 2.0); + BOOST_TEST(y.empty()); + test::check_container(y, v2); + test::check_equivalent_keys(y); + BOOST_TEST(y.max_load_factor() == 2.0); + +#if defined(BOOST_HAS_NRVO) + if (BOOST_UNORDERED_TEST_MOVING + ? (bool)allocator_type::is_propagate_on_move + : (bool)allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(y.get_allocator(), al1)); + } +#endif + } + + { + test::random_values v(500, generator); + test::object_count count; + T y(0, hf, eq, al1); + y = create(v, count, hf, eq, al2, 0.5); +#if defined(BOOST_HAS_NRVO) + if (BOOST_UNORDERED_TEST_MOVING && + allocator_type::is_propagate_on_move) { + BOOST_TEST(count == test::global_object_count); + } +#endif + test::check_container(y, v); + test::check_equivalent_keys(y); + BOOST_TEST(y.max_load_factor() == 0.5); + +#if defined(BOOST_HAS_NRVO) + if (BOOST_UNORDERED_TEST_MOVING + ? (bool)allocator_type::is_propagate_on_move + : (bool)allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(y.get_allocator(), al1)); + } +#endif + } + + { + test::check_instances check_; + + test::random_values v(500, generator); + T y(0, hf, eq, al1); + + T x(0, hf, eq, al2); + x.max_load_factor(0.25); + x.insert(v.begin(), v.end()); + + test::object_count count = test::global_object_count; + y = boost::move(x); + if (BOOST_UNORDERED_TEST_MOVING && + allocator_type::is_propagate_on_move) { + BOOST_TEST(count == test::global_object_count); + } + test::check_container(y, v); + test::check_equivalent_keys(y); + BOOST_TEST(y.max_load_factor() == 0.25); + + if (BOOST_UNORDERED_TEST_MOVING + ? (bool)allocator_type::is_propagate_on_move + : (bool)allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(y.get_allocator(), al1)); + } + } + + { + test::check_instances check_; + + test::random_values v1(1000, generator); + test::random_values v2(200, generator); + + T x(0, hf, eq, al2); + x.max_load_factor(0.5); + x.insert(v2.begin(), v2.end()); + + test::object_count count1 = test::global_object_count; + + T y(v1.begin(), v1.end(), 0, hf, eq, al1); + y = boost::move(x); + + test::object_count count2 = test::global_object_count; + + if (BOOST_UNORDERED_TEST_MOVING && + allocator_type::is_propagate_on_move) { + BOOST_TEST(count1.instances == test::global_object_count.instances); + BOOST_TEST(count2.constructions == + test::global_object_count.constructions); + } + + test::check_container(y, v2); + test::check_equivalent_keys(y); + BOOST_TEST(y.max_load_factor() == 0.5); + + if (BOOST_UNORDERED_TEST_MOVING + ? (bool)allocator_type::is_propagate_on_move + : (bool)allocator_type::is_propagate_on_assign) { + BOOST_TEST(test::equivalent(y.get_allocator(), al2)); + } else { + BOOST_TEST(test::equivalent(y.get_allocator(), al1)); + } + } +} + +boost::unordered_map >* test_map_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +boost::unordered_set >* + test_set_prop_move; +boost::unordered_multiset >* + test_multiset_prop_move; +boost::unordered_map >* + test_map_prop_move; +boost::unordered_multimap >* + test_multimap_prop_move; + +boost::unordered_set >* + test_set_no_prop_move; +boost::unordered_multiset >* + test_multiset_no_prop_move; +boost::unordered_map >* + test_map_no_prop_move; +boost::unordered_multimap >* + test_multimap_no_prop_move; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(move_construct_tests1, + ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)( + test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)( + test_multimap_prop_move)(test_set_no_prop_move)( + test_multiset_no_prop_move)(test_map_no_prop_move)( + test_multimap_no_prop_move))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(move_assign_tests1, + ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)( + test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)( + test_multimap_prop_move)(test_set_no_prop_move)( + test_multiset_no_prop_move)(test_map_no_prop_move)( + test_multimap_no_prop_move))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(move_construct_tests2, + ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_prop_move)( + test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)( + test_set_no_prop_move)(test_multiset_no_prop_move)( + test_map_no_prop_move)(test_multimap_no_prop_move))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(move_assign_tests2, + ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_prop_move)( + test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)( + test_set_no_prop_move)(test_multiset_no_prop_move)( + test_map_no_prop_move)(test_multimap_no_prop_move))( + (default_generator)(generate_collisions)(limited_range))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/node_handle_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/node_handle_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8ac1878eb1f2703aa4ecd3b891220a53acf28da0 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/node_handle_tests.cpp @@ -0,0 +1,436 @@ + +// Copyright 2016 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "../helpers/postfix.hpp" +#include "../helpers/prefix.hpp" +#include +#include + +#include "../helpers/helpers.hpp" +#include "../helpers/metafunctions.hpp" +#include "../helpers/test.hpp" +#include +#include +#include +#include + +UNORDERED_AUTO_TEST(example1) +{ + typedef boost::unordered_map::insert_return_type + insert_return_type; + + boost::unordered_map src; + src.emplace(1, "one"); + src.emplace(2, "two"); + src.emplace(3, "buckle my shoe"); + boost::unordered_map dst; + dst.emplace(3, "three"); + + dst.insert(src.extract(src.find(1))); + dst.insert(src.extract(2)); + insert_return_type r = dst.insert(src.extract(3)); + + BOOST_TEST(src.empty()); + BOOST_TEST(dst.size() == 3); + BOOST_TEST(dst[1] == "one"); + BOOST_TEST(dst[2] == "two"); + BOOST_TEST(dst[3] == "three"); + BOOST_TEST(!r.inserted); + BOOST_TEST(r.position == dst.find(3)); + BOOST_TEST(r.node.mapped() == "buckle my shoe"); +} + +UNORDERED_AUTO_TEST(example2) +{ + boost::unordered_set src; + src.insert(1); + src.insert(3); + src.insert(5); + boost::unordered_set dst; + dst.insert(2); + dst.insert(4); + dst.insert(5); + // dst.merge(src); + // Merge src into dst. + // src == {5} + // dst == {1, 2, 3, 4, 5} +} + +UNORDERED_AUTO_TEST(example3) +{ + typedef boost::unordered_set::iterator iterator; + + boost::unordered_set src; + src.insert(1); + src.insert(3); + src.insert(5); + boost::unordered_set dst; + dst.insert(2); + dst.insert(4); + dst.insert(5); + for (iterator i = src.begin(); i != src.end();) { + std::pair p = dst.equal_range(*i); + if (p.first == p.second) + dst.insert(p.first, src.extract(i++)); + else + ++i; + } + BOOST_TEST(src.size() == 1); + BOOST_TEST(*src.begin() == 5); + + std::set dst2(dst.begin(), dst.end()); + std::set::iterator it = dst2.begin(); + BOOST_TEST(*it++ == 1); + BOOST_TEST(*it++ == 2); + BOOST_TEST(*it++ == 3); + BOOST_TEST(*it++ == 4); + BOOST_TEST(*it++ == 5); + BOOST_TEST(it == dst2.end()); +} + +UNORDERED_AUTO_TEST(failed_insertion_with_hint) +{ + { + boost::unordered_set src; + boost::unordered_set dst; + src.emplace(10); + src.emplace(20); + dst.emplace(10); + dst.emplace(20); + + boost::unordered_set::node_type nh = src.extract(10); + + BOOST_TEST(dst.insert(dst.find(10), boost::move(nh)) == dst.find(10)); + BOOST_TEST(nh); + BOOST_TEST(!nh.empty()); + BOOST_TEST(nh.value() == 10); + + BOOST_TEST(dst.insert(dst.find(20), boost::move(nh)) == dst.find(10)); + BOOST_TEST(nh); + BOOST_TEST(!nh.empty()); + BOOST_TEST(nh.value() == 10); + + BOOST_TEST(src.count(10) == 0); + BOOST_TEST(src.count(20) == 1); + BOOST_TEST(dst.count(10) == 1); + BOOST_TEST(dst.count(20) == 1); + } + + { + boost::unordered_map src; + boost::unordered_map dst; + src.emplace(10, 30); + src.emplace(20, 5); + dst.emplace(10, 20); + dst.emplace(20, 2); + + boost::unordered_map::node_type nh = src.extract(10); + BOOST_TEST(dst.insert(dst.find(10), boost::move(nh)) == dst.find(10)); + BOOST_TEST(nh); + BOOST_TEST(!nh.empty()); + BOOST_TEST(nh.key() == 10); + BOOST_TEST(nh.mapped() == 30); + BOOST_TEST(dst[10] == 20); + + BOOST_TEST(dst.insert(dst.find(20), boost::move(nh)) == dst.find(10)); + BOOST_TEST(nh); + BOOST_TEST(!nh.empty()); + BOOST_TEST(nh.key() == 10); + BOOST_TEST(nh.mapped() == 30); + BOOST_TEST(dst[10] == 20); + + BOOST_TEST(src.count(10) == 0); + BOOST_TEST(src.count(20) == 1); + BOOST_TEST(dst.count(10) == 1); + BOOST_TEST(dst.count(20) == 1); + } +} + +template +bool node_handle_compare(NodeHandle const& nh, + BOOST_DEDUCED_TYPENAME NodeHandle::value_type const& x) +{ + return x == nh.value(); +} + +template +bool node_handle_compare( + NodeHandle const& nh, + std::pair const& x) +{ + return x.first == nh.key() && x.second == nh.mapped(); +} + +template void node_handle_tests_impl(Container& c) +{ + typedef BOOST_DEDUCED_TYPENAME Container::node_type node_type; + + BOOST_DEDUCED_TYPENAME Container::value_type value = *c.begin(); + + node_type n1; + BOOST_TEST(!n1); + BOOST_TEST(n1.empty()); + + node_type n2 = c.extract(c.begin()); + BOOST_TEST(n2); + BOOST_TEST(!n2.empty()); + node_handle_compare(n2, value); + + node_type n3 = boost::move(n2); + BOOST_TEST(n3); + BOOST_TEST(!n2); + node_handle_compare(n3, value); + // TODO: Check that n2 doesn't have an allocator? + // Maybe by swapping and observing that the allocator is + // swapped rather than moved? + + n1 = boost::move(n3); + BOOST_TEST(n1); + BOOST_TEST(!n3); + node_handle_compare(n1, value); + + // Self move-assignment empties the node_handle. + n1 = boost::move(n1); + BOOST_TEST(!n1); + + n3 = boost::move(n3); + BOOST_TEST(!n3); + + BOOST_DEDUCED_TYPENAME Container::value_type value1 = *c.begin(); + n1 = c.extract(c.begin()); + BOOST_DEDUCED_TYPENAME Container::value_type value2 = *c.begin(); + n2 = c.extract(c.begin()); + n3 = node_type(); + + node_handle_compare(n1, value1); + node_handle_compare(n2, value2); + n1.swap(n2); + BOOST_TEST(n1); + BOOST_TEST(n2); + node_handle_compare(n1, value2); + node_handle_compare(n2, value1); + + BOOST_TEST(n1); + BOOST_TEST(!n3); + n1.swap(n3); + BOOST_TEST(!n1); + BOOST_TEST(n3); + node_handle_compare(n3, value2); + + BOOST_TEST(!n1); + BOOST_TEST(n2); + n1.swap(n2); + BOOST_TEST(n1); + BOOST_TEST(!n2); + node_handle_compare(n1, value1); + + node_type n4; + BOOST_TEST(!n2); + BOOST_TEST(!n4); + n2.swap(n4); + BOOST_TEST(!n2); + BOOST_TEST(!n4); +} + +UNORDERED_AUTO_TEST(node_handle_tests) +{ + boost::unordered_set x1; + x1.emplace(100); + x1.emplace(140); + x1.emplace(-55); + node_handle_tests_impl(x1); + + boost::unordered_map x2; + x2.emplace(10, "ten"); + x2.emplace(-23, "twenty"); + x2.emplace(-76, "thirty"); + node_handle_tests_impl(x2); +} + +template +void insert_node_handle_unique(Container1& c1, Container2& c2) +{ + typedef BOOST_DEDUCED_TYPENAME Container1::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_type; + BOOST_STATIC_ASSERT(boost::is_same::value); + + typedef BOOST_DEDUCED_TYPENAME Container1::insert_return_type + insert_return_type1; + typedef BOOST_DEDUCED_TYPENAME Container2::insert_return_type + insert_return_type2; + + insert_return_type1 r1 = c1.insert(node_type()); + insert_return_type2 r2 = c2.insert(node_type()); + BOOST_TEST(!r1.inserted); + BOOST_TEST(!r1.node); + BOOST_TEST(r1.position == c1.end()); + BOOST_TEST(!r2.inserted); + BOOST_TEST(!r2.node); + BOOST_TEST(r2.position == c2.end()); + + while (!c1.empty()) { + value_type v = *c1.begin(); + value_type const* v_ptr = boost::addressof(*c1.begin()); + std::size_t count = c2.count(test::get_key(v)); + insert_return_type2 r = c2.insert(c1.extract(c1.begin())); + if (!count) { + BOOST_TEST(r.inserted); + BOOST_TEST_EQ(c2.count(test::get_key(v)), count + 1); + BOOST_TEST(r.position != c2.end()); + BOOST_TEST(boost::addressof(*r.position) == v_ptr); + BOOST_TEST(!r.node); + } else { + BOOST_TEST(!r.inserted); + BOOST_TEST_EQ(c2.count(test::get_key(v)), count); + BOOST_TEST(r.position != c2.end()); + BOOST_TEST(test::get_key(*r.position) == + test::get_key(v)); + BOOST_TEST(r.node); + node_handle_compare(r.node, v); + } + } +} + +template +void insert_node_handle_unique2(Container1& c1, Container2& c2) +{ + typedef BOOST_DEDUCED_TYPENAME Container1::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_type; + BOOST_STATIC_ASSERT(boost::is_same::value); + + // typedef BOOST_DEDUCED_TYPENAME Container1::insert_return_type + // insert_return_type1; + typedef BOOST_DEDUCED_TYPENAME Container2::insert_return_type + insert_return_type2; + + while (!c1.empty()) { + value_type v = *c1.begin(); + value_type const* v_ptr = boost::addressof(*c1.begin()); + std::size_t count = c2.count(test::get_key(v)); + insert_return_type2 r = + c2.insert(c1.extract(test::get_key(v))); + if (r.inserted) { + BOOST_TEST_EQ(c2.count(test::get_key(v)), count + 1); + BOOST_TEST(r.position != c2.end()); + BOOST_TEST(boost::addressof(*r.position) == v_ptr); + BOOST_TEST(!r.node); + } else { + BOOST_TEST_EQ(c2.count(test::get_key(v)), count); + BOOST_TEST(r.position != c2.end()); + BOOST_TEST(test::get_key(*r.position) == + test::get_key(v)); + BOOST_TEST(r.node); + node_handle_compare(r.node, v); + } + } +} + +template +void insert_node_handle_equiv(Container1& c1, Container2& c2) +{ + typedef BOOST_DEDUCED_TYPENAME Container1::node_type node_type; + typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_type; + BOOST_STATIC_ASSERT(boost::is_same::value); + + typedef BOOST_DEDUCED_TYPENAME Container1::iterator iterator1; + typedef BOOST_DEDUCED_TYPENAME Container2::iterator iterator2; + + iterator1 r1 = c1.insert(node_type()); + iterator2 r2 = c2.insert(node_type()); + BOOST_TEST(r1 == c1.end()); + BOOST_TEST(r2 == c2.end()); + + while (!c1.empty()) { + value_type v = *c1.begin(); + value_type const* v_ptr = boost::addressof(*c1.begin()); + std::size_t count = c2.count(test::get_key(v)); + iterator2 r = c2.insert(c1.extract(c1.begin())); + BOOST_TEST_EQ(c2.count(test::get_key(v)), count + 1); + BOOST_TEST(r != c2.end()); + BOOST_TEST(boost::addressof(*r) == v_ptr); + } +} + +struct hash_thing +{ + std::size_t operator()(int x) const + { + return static_cast(x * 13 + 5); + } +}; + +UNORDERED_AUTO_TEST(insert_node_handle_unique_tests) +{ + { + boost::unordered_set x1; + boost::unordered_set x2; + x1.emplace(100); + x1.emplace(140); + x1.emplace(-55); + x2.emplace(140); + insert_node_handle_unique(x1, x2); + BOOST_TEST(x2.size() == 3); + } + + { + boost::unordered_map x1; + boost::unordered_map x2; + x1.emplace(67, 50); + x1.emplace(23, 45); + x1.emplace(18, 19); + x2.emplace(23, 50); + x2.emplace(12, 49); + insert_node_handle_unique(x1, x2); + BOOST_TEST(x2.size() == 4); + } +} + +UNORDERED_AUTO_TEST(insert_node_handle_equiv_tests) +{ + { + boost::unordered_multimap x1; + boost::unordered_multimap x2; + x1.emplace(67, 50); + x1.emplace(67, 100); + x1.emplace(23, 45); + x1.emplace(18, 19); + x2.emplace(23, 50); + x2.emplace(12, 49); + insert_node_handle_equiv(x1, x2); + BOOST_TEST(x2.size() == 6); + } +} + +UNORDERED_AUTO_TEST(insert_node_handle_unique_tests2) +{ + { + boost::unordered_set x1; + boost::unordered_set x2; + x1.emplace(100); + x1.emplace(140); + x1.emplace(-55); + x2.emplace(140); + insert_node_handle_unique2(x1, x2); + BOOST_TEST(x2.size() == 3); + } + + { + boost::unordered_map x1; + boost::unordered_map x2; + x1.emplace(67, 50); + x1.emplace(23, 45); + x1.emplace(18, 19); + x2.emplace(23, 50); + x2.emplace(12, 49); + insert_node_handle_unique2(x1, x2); + BOOST_TEST(x2.size() == 4); + } +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/noexcept_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/noexcept_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d801ae1c4d16bc50fd127b15a0b0c1317786d7fe --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/noexcept_tests.cpp @@ -0,0 +1,171 @@ + +// Copyright 2013 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" + +namespace noexcept_tests { +// Test the noexcept is set correctly for the move constructor. + +struct hash_possible_exception : boost::hash +{ + hash_possible_exception(hash_possible_exception const&) {} +}; + +struct equal_to_possible_exception : std::equal_to +{ + equal_to_possible_exception(equal_to_possible_exception const&) {} +}; + +// Test that the move constructor does actually move without throwing +// an exception when it claims to. + +struct test_exception +{ +}; + +bool throwing_test_exception = false; +void test_throw(char const* name) +{ + if (throwing_test_exception) { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Throw exception in: " << name + << std::endl; + throw test_exception(); + } +} + +class hash_nothrow_move : boost::hash +{ + BOOST_COPYABLE_AND_MOVABLE(hash_nothrow_move) + + typedef boost::hash base; + + public: + hash_nothrow_move(BOOST_RV_REF(hash_nothrow_move)) BOOST_NOEXCEPT {} + + hash_nothrow_move() { test_throw("Constructor"); } + hash_nothrow_move(hash_nothrow_move const&) { test_throw("Copy"); } + hash_nothrow_move& operator=(BOOST_COPY_ASSIGN_REF(hash_nothrow_move)) + { + test_throw("Assign"); + return *this; + } + hash_nothrow_move& operator=(BOOST_RV_REF(hash_nothrow_move)) + { + test_throw("Move Assign"); + return *this; + } + std::size_t operator()(int x) const + { + test_throw("Operator"); + return static_cast(*this)(x); + } +}; + +class equal_to_nothrow_move : std::equal_to +{ + BOOST_COPYABLE_AND_MOVABLE(equal_to_nothrow_move) + + typedef std::equal_to base; + + public: + equal_to_nothrow_move(BOOST_RV_REF(equal_to_nothrow_move)) BOOST_NOEXCEPT {} + equal_to_nothrow_move() { test_throw("Constructor"); } + equal_to_nothrow_move(equal_to_nothrow_move const&) { test_throw("Copy"); } + equal_to_nothrow_move& operator=( + BOOST_COPY_ASSIGN_REF(equal_to_nothrow_move)) + { + test_throw("Assign"); + return *this; + } + equal_to_nothrow_move& operator=(BOOST_RV_REF(equal_to_nothrow_move)) + { + test_throw("Move Assign"); + return *this; + } + std::size_t operator()(int x, int y) const + { + test_throw("Operator"); + return static_cast(*this)(x, y); + } +}; + +bool have_is_nothrow_move = false; + +UNORDERED_AUTO_TEST(check_is_nothrow_move) +{ + BOOST_TEST( + !boost::is_nothrow_move_constructible::value); + have_is_nothrow_move = + boost::is_nothrow_move_constructible::value; + +// Copied from boost::is_nothrow_move_constructible implementation +// to make sure this does actually detect it when expected. +// +// The type trait is also available when BOOST_IS_NOTHROW_MOVE_CONSTRUCT +// is defined (for some versions of Visual C++?) but detects 'throw()', +// not noexcept. +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && \ + !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40800) + BOOST_TEST(have_is_nothrow_move); +#endif +} + +UNORDERED_AUTO_TEST(test_noexcept) +{ + if (have_is_nothrow_move) { + BOOST_TEST((boost::is_nothrow_move_constructible< + boost::unordered_set >::value)); + BOOST_TEST((boost::is_nothrow_move_constructible< + boost::unordered_multiset >::value)); + BOOST_TEST((boost::is_nothrow_move_constructible< + boost::unordered_map >::value)); + BOOST_TEST((boost::is_nothrow_move_constructible< + boost::unordered_multimap >::value)); + } + + BOOST_TEST((!boost::is_nothrow_move_constructible< + boost::unordered_set >::value)); + BOOST_TEST( + (!boost::is_nothrow_move_constructible, equal_to_possible_exception> >::value)); +} + +UNORDERED_AUTO_TEST(test_no_throw_when_noexcept) +{ + typedef boost::unordered_set + throwing_set; + + if (have_is_nothrow_move) { + BOOST_TEST(boost::is_nothrow_move_constructible::value); + + throwing_test_exception = false; + + throwing_set x1; + x1.insert(10); + x1.insert(50); + + try { + throwing_test_exception = true; + + throwing_set x2 = boost::move(x1); + BOOST_TEST(x2.size() == 2); + BOOST_TEST(*x2.begin() == 10 || *x2.begin() == 50); + } catch (test_exception) { + BOOST_TEST(false); + } + + throwing_test_exception = false; + } +} +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/rehash_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/rehash_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee670ace8adf5e3bfdf4dbc9e076cfae776b106c --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/rehash_tests.cpp @@ -0,0 +1,230 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/metafunctions.hpp" +#include "../objects/test.hpp" + +namespace rehash_tests { + +test::seed_t initialize_seed(2974); + +template +bool postcondition(X const& x, BOOST_DEDUCED_TYPENAME X::size_type n) +{ + return static_cast(x.bucket_count()) >= + static_cast(x.size()) / x.max_load_factor() && + x.bucket_count() >= n; +} + +template void rehash_empty_test1(X*) +{ + X x; + + x.rehash(10000); + BOOST_TEST(postcondition(x, 10000)); + + x.rehash(0); + BOOST_TEST(postcondition(x, 0)); + + x.rehash(10000000); + BOOST_TEST(postcondition(x, 10000000)); +} + +template void rehash_empty_test2(X*, test::random_generator generator) +{ + test::random_values v(1000, generator); + test::ordered tracker; + + X x; + + x.rehash(10000); + BOOST_TEST(postcondition(x, 10000)); + + tracker.insert_range(v.begin(), v.end()); + x.insert(v.begin(), v.end()); + tracker.compare(x); + + BOOST_TEST(postcondition(x, 10000)); + + x.rehash(10000000); + tracker.compare(x); + BOOST_TEST(postcondition(x, 10000000)); +} + +template void rehash_empty_test3(X*, test::random_generator generator) +{ + test::random_values v(1000, generator); + test::ordered tracker; + + X x; + + x.rehash(0); + BOOST_TEST(postcondition(x, 0)); + + tracker.insert_range(v.begin(), v.end()); + x.insert(v.begin(), v.end()); + tracker.compare(x); + + BOOST_TEST(postcondition(x, 0)); +} + +template void rehash_test1(X*, test::random_generator generator) +{ + test::random_values v(1000, generator); + test::ordered tracker; + tracker.insert_range(v.begin(), v.end()); + X x(v.begin(), v.end()); + + x.rehash(0); + BOOST_TEST(postcondition(x, 0)); + tracker.compare(x); + + x.max_load_factor(0.25); + x.rehash(0); + BOOST_TEST(postcondition(x, 0)); + tracker.compare(x); + + x.max_load_factor(50.0); + x.rehash(0); + BOOST_TEST(postcondition(x, 0)); + tracker.compare(x); + + x.rehash(1000); + BOOST_TEST(postcondition(x, 1000)); + tracker.compare(x); +} + +template void reserve_empty_test1(X*) +{ + X x; + + x.reserve(10000); + BOOST_TEST(x.bucket_count() >= 10000); + + x.reserve(0); + + x.reserve(10000000); + BOOST_TEST(x.bucket_count() >= 10000000); +} + +template void reserve_empty_test2(X*) +{ + X x; + x.max_load_factor(0.25); + + x.reserve(10000); + BOOST_TEST(x.bucket_count() >= 40000); + + x.reserve(0); + + x.reserve(10000000); + BOOST_TEST(x.bucket_count() >= 40000000); +} + +template void reserve_test1(X*, test::random_generator generator) +{ + for (int random_mlf = 0; random_mlf < 2; ++random_mlf) { + for (std::size_t i = 1; i < 2000; i += i < 50 ? 1 : 13) { + test::random_values v(i, generator); + + test::ordered tracker; + tracker.insert_range(v.begin(), v.end()); + + X x; + x.max_load_factor( + random_mlf + ? static_cast(std::rand() % 1000) / 500.0f + 0.5f + : 1.0f); + x.reserve(test::has_unique_keys::value ? i : v.size()); + + // Insert an element before the range insert, otherwise there are + // no iterators to invalidate in the range insert, and it can + // rehash. + typename test::random_values::iterator it = v.begin(); + x.insert(*it); + ++it; + + std::size_t bucket_count = x.bucket_count(); + x.insert(it, v.end()); + BOOST_TEST(bucket_count == x.bucket_count()); + tracker.compare(x); + } + } +} + +template void reserve_test2(X*, test::random_generator generator) +{ + for (int random_mlf = 0; random_mlf < 2; ++random_mlf) { + for (std::size_t i = 0; i < 2000; i += i < 50 ? 1 : 13) { + test::random_values v(i, generator); + + test::ordered tracker; + tracker.insert_range(v.begin(), v.end()); + + X x; + x.max_load_factor( + random_mlf + ? static_cast(std::rand() % 1000) / 500.0f + 0.5f + : 1.0f); + + x.reserve(test::has_unique_keys::value ? i : v.size()); + + std::size_t bucket_count = x.bucket_count(); + for (typename test::random_values::iterator it = v.begin(); + it != v.end(); ++it) { + x.insert(*it); + } + + BOOST_TEST(bucket_count == x.bucket_count()); + tracker.compare(x); + } + } +} + +boost::unordered_set* int_set_ptr; +boost::unordered_multiset >* test_multiset_ptr; +boost::unordered_map >* test_map_ptr; +boost::unordered_multimap* int_multimap_ptr; + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_TEST(rehash_empty_test1, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))) +UNORDERED_TEST(rehash_empty_test2, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(rehash_empty_test3, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(rehash_test1, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(reserve_empty_test1, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))) +UNORDERED_TEST(reserve_empty_test2, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))) +UNORDERED_TEST(reserve_test1, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( + (default_generator)(generate_collisions)(limited_range))) +UNORDERED_TEST(reserve_test2, + ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( + (default_generator)(generate_collisions)(limited_range))) +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/simple_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/simple_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..40ba5fc3a55afcdf30fcb6c2b3a6bc4b13f13d24 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/simple_tests.cpp @@ -0,0 +1,135 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This test checks the runtime requirements of containers. + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" +#include +#include +#include "../helpers/equivalent.hpp" + +template void simple_test(X const& a) +{ + test::unordered_equivalence_tester equivalent(a); + + { + X u; + BOOST_TEST(u.size() == 0); + BOOST_TEST(X().size() == 0); + } + + { + BOOST_TEST(equivalent(X(a))); + } + + { + X u(a); + BOOST_TEST(equivalent(u)); + } + + { + X u = a; + BOOST_TEST(equivalent(u)); + } + + { + X b(a); + BOOST_TEST(b.begin() == const_cast(b).cbegin()); + BOOST_TEST(b.end() == const_cast(b).cend()); + } + + { + X b(a); + X c; + BOOST_TEST(equivalent(b)); + BOOST_TEST(c.empty()); + b.swap(c); + BOOST_TEST(b.empty()); + BOOST_TEST(equivalent(c)); + b.swap(c); + BOOST_TEST(c.empty()); + BOOST_TEST(equivalent(b)); + } + + { + X u; + X& r = u; + BOOST_TEST(&(r = r) == &r); + + BOOST_TEST(r.empty()); + BOOST_TEST(&(r = a) == &r); + BOOST_TEST(equivalent(r)); + BOOST_TEST(&(r = r) == &r); + BOOST_TEST(equivalent(r)); + } + + { + BOOST_TEST(a.size() == static_cast( + std::distance(a.begin(), a.end()))); + } + + { + BOOST_TEST(a.empty() == (a.size() == 0)); + } + + { + BOOST_TEST(a.empty() == (a.begin() == a.end())); + X u; + BOOST_TEST(u.begin() == u.end()); + } +} + +UNORDERED_AUTO_TEST(simple_tests) +{ + using namespace std; + srand(14878); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_set.\n"; + boost::unordered_set set; + simple_test(set); + + set.insert(1); + set.insert(2); + set.insert(1456); + simple_test(set); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multiset.\n"; + boost::unordered_multiset multiset; + simple_test(multiset); + + for (int i1 = 0; i1 < 1000; ++i1) { + int count = rand() % 10, index = rand(); + for (int j = 0; j < count; ++j) + multiset.insert(index); + } + simple_test(multiset); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_map.\n"; + boost::unordered_map map; + + for (int i2 = 0; i2 < 1000; ++i2) { + map.insert(std::pair(rand(), rand())); + } + simple_test(map); + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Test unordered_multimap.\n"; + boost::unordered_multimap multimap; + + for (int i3 = 0; i3 < 1000; ++i3) { + int count = rand() % 10, index = rand(); + for (int j = 0; j < count; ++j) + multimap.insert(std::pair(index, rand())); + } + simple_test(multimap); +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/swap_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/swap_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c6e465685abd7050de6a80e515e37b37fe10a54 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/swap_tests.cpp @@ -0,0 +1,216 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include +#include +#include +#include "../helpers/test.hpp" +#include "../objects/test.hpp" +#include "../objects/cxx11_allocator.hpp" +#include "../helpers/random_values.hpp" +#include "../helpers/tracker.hpp" +#include "../helpers/invariants.hpp" + +#if defined(BOOST_MSVC) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +namespace swap_tests { + +test::seed_t initialize_seed(783472); + +template void swap_test_impl(X& x1, X& x2) +{ + test::ordered tracker1 = test::create_ordered(x1); + test::ordered tracker2 = test::create_ordered(x2); + tracker1.insert_range(x1.begin(), x1.end()); + tracker2.insert_range(x2.begin(), x2.end()); + x1.swap(x2); + tracker1.compare(x2); + tracker2.compare(x1); +} + +template void swap_tests1(X*, test::random_generator generator) +{ + { + test::check_instances check_; + + X x; + swap_test_impl(x, x); + } + + { + test::check_instances check_; + + X x, y; + swap_test_impl(x, y); + } + + { + test::check_instances check_; + + test::random_values v(1000, generator); + X x, y(v.begin(), v.end()); + swap_test_impl(x, y); + swap_test_impl(x, y); + } + + { + test::check_instances check_; + + test::random_values vx(1000, generator), vy(1000, generator); + X x(vx.begin(), vx.end()), y(vy.begin(), vy.end()); + swap_test_impl(x, y); + swap_test_impl(x, y); + } +} + +template void swap_tests2(X* ptr, test::random_generator generator) +{ + swap_tests1(ptr, generator); + + typedef BOOST_DEDUCED_TYPENAME X::hasher hasher; + typedef BOOST_DEDUCED_TYPENAME X::key_equal key_equal; + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + + { + test::check_instances check_; + + X x(0, hasher(1), key_equal(1)); + X y(0, hasher(2), key_equal(2)); + swap_test_impl(x, y); + } + + { + test::check_instances check_; + + test::random_values v(1000, generator); + X x(v.begin(), v.end(), 0, hasher(1), key_equal(1)); + X y(0, hasher(2), key_equal(2)); + swap_test_impl(x, y); + } + + { + test::check_instances check_; + + test::random_values vx(100, generator), vy(50, generator); + X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1)); + X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2)); + swap_test_impl(x, y); + swap_test_impl(x, y); + } + + { + test::force_equal_allocator force_( + !allocator_type::is_propagate_on_swap); + test::check_instances check_; + + test::random_values vx(50, generator), vy(100, generator); + X x(vx.begin(), vx.end(), 0, hasher(), key_equal(), allocator_type(1)); + X y(vy.begin(), vy.end(), 0, hasher(), key_equal(), allocator_type(2)); + + if (allocator_type::is_propagate_on_swap || + x.get_allocator() == y.get_allocator()) { + swap_test_impl(x, y); + } + } + + { + test::force_equal_allocator force_( + !allocator_type::is_propagate_on_swap); + test::check_instances check_; + + test::random_values vx(100, generator), vy(100, generator); + X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1), + allocator_type(1)); + X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2), + allocator_type(2)); + + if (allocator_type::is_propagate_on_swap || + x.get_allocator() == y.get_allocator()) { + swap_test_impl(x, y); + swap_test_impl(x, y); + } + } +} + +boost::unordered_map >* test_map_std_alloc; + +boost::unordered_set >* test_set; +boost::unordered_multiset >* test_multiset; +boost::unordered_map >* test_map; +boost::unordered_multimap >* test_multimap; + +boost::unordered_set >* + test_set_prop_swap; +boost::unordered_multiset >* + test_multiset_prop_swap; +boost::unordered_map >* + test_map_prop_swap; +boost::unordered_multimap >* + test_multimap_prop_swap; + +boost::unordered_set >* + test_set_no_prop_swap; +boost::unordered_multiset >* + test_multiset_no_prop_swap; +boost::unordered_map >* + test_map_no_prop_swap; +boost::unordered_multimap >* + test_multimap_no_prop_swap; + +template bool is_propagate(T*) +{ + return T::allocator_type::is_propagate_on_swap; +} + +using test::default_generator; +using test::generate_collisions; +using test::limited_range; + +UNORDERED_AUTO_TEST(check_traits) +{ + BOOST_TEST(!is_propagate(test_set)); + BOOST_TEST(is_propagate(test_set_prop_swap)); + BOOST_TEST(!is_propagate(test_set_no_prop_swap)); +} + +UNORDERED_TEST(swap_tests1, + ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)( + test_set_prop_swap)(test_multiset_prop_swap)(test_map_prop_swap)( + test_multimap_prop_swap)(test_set_no_prop_swap)( + test_multiset_no_prop_swap)(test_map_no_prop_swap)( + test_multimap_no_prop_swap))( + (default_generator)(generate_collisions)(limited_range))) + +UNORDERED_TEST(swap_tests2, + ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_prop_swap)( + test_multiset_prop_swap)(test_map_prop_swap)(test_multimap_prop_swap)( + test_set_no_prop_swap)(test_multiset_no_prop_swap)( + test_map_no_prop_swap)(test_multimap_no_prop_swap))( + (default_generator)(generate_collisions)(limited_range))) +} +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/unordered/test/unordered/unnecessary_copy_tests.cpp b/tools/boost_1_65_1/libs/unordered/test/unordered/unnecessary_copy_tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1e22dd668bf638833fd4eb57318f3e0e65e9d358 --- /dev/null +++ b/tools/boost_1_65_1/libs/unordered/test/unordered/unnecessary_copy_tests.cpp @@ -0,0 +1,584 @@ + +// Copyright 2006-2009 Daniel James. +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// clang-format off +#include "../helpers/prefix.hpp" +#include +#include +#include "../helpers/postfix.hpp" +// clang-format on + +#include "../helpers/test.hpp" + +namespace unnecessary_copy_tests { +struct count_copies +{ + private: + BOOST_COPYABLE_AND_MOVABLE(count_copies) + public: + static int copies; + static int moves; + static int id_count; + + count_copies() : tag_(0), id_(++id_count) + { + ++copies; + trace_op("Default construct"); + } + + explicit count_copies(int tag) : tag_(tag), id_(++id_count) + { + ++copies; + trace_op("Tag construct"); + } + + // This bizarre constructor is an attempt to confuse emplace. + // + // unordered_map x: + // x.emplace(count_copies(1), count_copies(2)); + // x.emplace(count_copies(1), count_copies(2), count_copies(3)); + // + // The first emplace should use the single argument constructor twice. + // The second emplace should use the single argument contructor for + // the key, and this constructor for the value. + count_copies(count_copies const&, count_copies const& x) + : tag_(x.tag_), id_(++id_count) + { + ++copies; + trace_op("Pair construct"); + } + + count_copies(count_copies const& x) : tag_(x.tag_), id_(++id_count) + { + ++copies; + trace_op("Copy construct"); + } + + count_copies(BOOST_RV_REF(count_copies) x) : tag_(x.tag_), id_(++id_count) + { + x.tag_ = -1; + ++moves; + trace_op("Move construct"); + } + + count_copies& operator=( + BOOST_COPY_ASSIGN_REF(count_copies) p) // Copy assignment + { + tag_ = p.tag_; + ++copies; + trace_op("Copy assign"); + return *this; + } + + count_copies& operator=(BOOST_RV_REF(count_copies) p) // Move assignment + { + tag_ = p.tag_; + ++moves; + trace_op("Move assign"); + return *this; + } + + ~count_copies() { trace_op("Destruct"); } + + void trace_op(char const* str) + { + BOOST_LIGHTWEIGHT_TEST_OSTREAM << str << ": " << tag_ << " (#" << id_ + << ")" << std::endl; + } + + int tag_; + int id_; +}; + +bool operator==(count_copies const& x, count_copies const& y) +{ + return x.tag_ == y.tag_; +} + +template T source() { return T(); } + +void reset() +{ + count_copies::copies = 0; + count_copies::moves = 0; + + BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\nReset\n" << std::endl; +} +} + +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) +namespace boost +#else +namespace unnecessary_copy_tests +#endif +{ +std::size_t hash_value(unnecessary_copy_tests::count_copies const& x) +{ + return static_cast(x.tag_); +} +} + +// Boost.Move doesn't seem to work very well on this compiler. +// For example for: +// +// T x; +// +// It will default construct T, and then move it in. +// For 'T const' it seems to copy. + +#if defined(__IBMCPP__) && __IBMCPP__ <= 1210 +#define EXTRA_CONSTRUCT_COST 1 +#else +#define EXTRA_CONSTRUCT_COST 0 +#endif + +#define COPY_COUNT(n) \ + if (::unnecessary_copy_tests::count_copies::copies != n) { \ + BOOST_ERROR("Wrong number of copies."); \ + BOOST_LIGHTWEIGHT_TEST_OSTREAM \ + << "Number of copies: " \ + << ::unnecessary_copy_tests::count_copies::copies \ + << " expecting: " << n << std::endl; \ + } +#define MOVE_COUNT(n) \ + if (::unnecessary_copy_tests::count_copies::moves != n) { \ + BOOST_ERROR("Wrong number of moves."); \ + BOOST_LIGHTWEIGHT_TEST_OSTREAM \ + << "Number of moves: " \ + << ::unnecessary_copy_tests::count_copies::moves \ + << " expecting: " << n << std::endl; \ + } +#define COPY_COUNT_RANGE(a, b) \ + if (::unnecessary_copy_tests::count_copies::copies < a || \ + ::unnecessary_copy_tests::count_copies::copies > b) { \ + BOOST_ERROR("Wrong number of copies."); \ + BOOST_LIGHTWEIGHT_TEST_OSTREAM \ + << "Number of copies: " \ + << ::unnecessary_copy_tests::count_copies::copies \ + << " expecting: [" << a << ", " << b << "]" << std::endl; \ + } +#define MOVE_COUNT_RANGE(a, b) \ + if (::unnecessary_copy_tests::count_copies::moves < a || \ + ::unnecessary_copy_tests::count_copies::moves > b) { \ + BOOST_ERROR("Wrong number of moves."); \ + BOOST_LIGHTWEIGHT_TEST_OSTREAM \ + << "Number of moves: " \ + << ::unnecessary_copy_tests::count_copies::moves \ + << " expecting: [" << a << ", " << b << "]" << std::endl; \ + } +#define COPY_COUNT_EXTRA(a, b) COPY_COUNT_RANGE(a, a + b * EXTRA_CONSTRUCT_COST) +#define MOVE_COUNT_EXTRA(a, b) MOVE_COUNT_RANGE(a, a + b * EXTRA_CONSTRUCT_COST) + +namespace unnecessary_copy_tests { +int count_copies::copies; +int count_copies::moves; +int count_copies::id_count; + +template void unnecessary_copy_insert_test(T*) +{ + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + reset(); + x.insert(a); + COPY_COUNT(1); + MOVE_COUNT(0); +} + +template void unnecessary_copy_insert_rvalue_set_test(T*) +{ + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + reset(); + x.insert(boost::move(a)); + COPY_COUNT(0); + MOVE_COUNT(1); + + BOOST_DEDUCED_TYPENAME T::value_type a2; + reset(); + x.insert(boost::move(a)); + COPY_COUNT(0); + MOVE_COUNT((x.size() == 2 ? 1 : 0)); +} + +template void unnecessary_copy_insert_rvalue_map_test(T*) +{ + // Doesn't currently try to emulate std::pair move construction, + // so std::pair's require a copy. Could try emulating it in + // construct_from_args. + + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + reset(); + x.insert(boost::move(a)); +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + COPY_COUNT(1); + MOVE_COUNT(0); +#else + COPY_COUNT(0); + MOVE_COUNT(1); +#endif + + BOOST_DEDUCED_TYPENAME T::value_type a2; + reset(); + x.insert(boost::move(a)); +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + COPY_COUNT((x.size() == 2 ? 1 : 0)); + MOVE_COUNT(0); +#else + COPY_COUNT(0); + MOVE_COUNT((x.size() == 2 ? 1 : 0)); +#endif +} + +boost::unordered_set* set; +boost::unordered_multiset* multiset; +boost::unordered_map* map; +boost::unordered_multimap* multimap; + +UNORDERED_TEST(unnecessary_copy_insert_test, ((set)(multiset)(map)(multimap))) +UNORDERED_TEST(unnecessary_copy_insert_rvalue_set_test, ((set)(multiset))) +UNORDERED_TEST(unnecessary_copy_insert_rvalue_map_test, ((map)(multimap))) + +template void unnecessary_copy_emplace_test(T*) +{ + reset(); + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + COPY_COUNT(1); + x.emplace(a); + COPY_COUNT(2); +} + +template void unnecessary_copy_emplace_rvalue_test(T*) +{ + reset(); + T x; + x.emplace(source()); +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + COPY_COUNT(1); +#else + COPY_COUNT(2); +#endif +} + +UNORDERED_TEST(unnecessary_copy_emplace_test, ((set)(multiset)(map)(multimap))) +UNORDERED_TEST( + unnecessary_copy_emplace_rvalue_test, ((set)(multiset)(map)(multimap))) + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template void unnecessary_copy_emplace_std_move_test(T*) +{ + reset(); + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + COPY_COUNT(1); + MOVE_COUNT(0); + x.emplace(std::move(a)); + COPY_COUNT(1); + MOVE_COUNT(1); +} + +UNORDERED_TEST( + unnecessary_copy_emplace_std_move_test, ((set)(multiset)(map)(multimap))) +#endif + +template void unnecessary_copy_emplace_boost_move_test(T*) +{ + reset(); + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + COPY_COUNT(1); + MOVE_COUNT_EXTRA(0, 1); + x.emplace(boost::move(a)); +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + COPY_COUNT(1); + MOVE_COUNT(1); +#else + // Since std::pair isn't movable, move only works for sets. + COPY_COUNT_RANGE(1, 2); + MOVE_COUNT_RANGE(0, 1); +#endif +} + +UNORDERED_TEST( + unnecessary_copy_emplace_boost_move_test, ((set)(multiset)(map)(multimap))) + +template void unnecessary_copy_emplace_boost_move_set_test(T*) +{ + reset(); + T x; + BOOST_DEDUCED_TYPENAME T::value_type a; + COPY_COUNT(1); + MOVE_COUNT(0); + x.emplace(boost::move(a)); + COPY_COUNT(1); + MOVE_COUNT(1); +} + +UNORDERED_TEST(unnecessary_copy_emplace_boost_move_set_test, ((set)(multiset))) + +template void unnecessary_copy_emplace_boost_move_map_test(T*) +{ + reset(); + T x; + COPY_COUNT(0); + MOVE_COUNT(0); + BOOST_DEDUCED_TYPENAME T::value_type a; + COPY_COUNT(1); + MOVE_COUNT_EXTRA(0, 1); + x.emplace(boost::move(a)); +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + COPY_COUNT(2); + MOVE_COUNT_EXTRA(0, 1); +#else + COPY_COUNT(1); + MOVE_COUNT(1); +#endif +} + +UNORDERED_TEST(unnecessary_copy_emplace_boost_move_map_test, ((map)(multimap))) + +UNORDERED_AUTO_TEST(unnecessary_copy_emplace_set_test) +{ + // When calling 'source' the object is moved on some compilers, but not + // others. So count that here to adjust later. + + reset(); + source(); + int source_cost = ::unnecessary_copy_tests::count_copies::moves; + + // + + reset(); + boost::unordered_set x; + count_copies a; + x.insert(a); + COPY_COUNT(2); + MOVE_COUNT(0); + +// +// 0 arguments +// + +#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 + // The container will have to create a copy in order to compare with + // the existing element. + reset(); + x.emplace(); + + // source_cost doesn't make much sense here, but it seems to fit. + COPY_COUNT(1); + MOVE_COUNT(source_cost); +#endif + + // + // 1 argument + // + + // Emplace should be able to tell that there already is an element + // without creating a new one. + reset(); + x.emplace(a); + COPY_COUNT(0); + MOVE_COUNT(0); + + // A new object is created by source, but it shouldn't be moved or + // copied. + reset(); + x.emplace(source()); + COPY_COUNT(1); + MOVE_COUNT(source_cost); + + // No move should take place. + reset(); + x.emplace(boost::move(a)); + COPY_COUNT(0); + MOVE_COUNT(0); + + // Use a new value for cases where a did get moved... + count_copies b; + + // The container will have to create a copy in order to compare with + // the existing element. + reset(); + x.emplace(b.tag_); + COPY_COUNT(1); + MOVE_COUNT(0); + + // + // 2 arguments + // + + // The container will have to create b copy in order to compare with + // the existing element. + // + // Note to self: If copy_count == 0 it's an error not an optimization. + // TODO: Devise a better test. + + reset(); + + x.emplace(b, b); + COPY_COUNT(1); + MOVE_COUNT(0); +} + +UNORDERED_AUTO_TEST(unnecessary_copy_emplace_map_test) +{ + // When calling 'source' the object is moved on some compilers, but not + // others. So count that here to adjust later. + + reset(); + source(); + int source_cost = ::unnecessary_copy_tests::count_copies::moves; + + reset(); + source >(); + int source_pair_cost = ::unnecessary_copy_tests::count_copies::moves; + + // + + reset(); + boost::unordered_map x; + // TODO: Run tests for pairs without const etc. + std::pair a; + x.emplace(a); + COPY_COUNT_EXTRA(4, 1); + MOVE_COUNT_EXTRA(0, 1); + +// +// 0 arguments +// + +#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 + // COPY_COUNT(1) would be okay here. + reset(); + x.emplace(); +#if BOOST_WORKAROUND(BOOST_MSVC, == 1700) + // This is a little odd, Visual C++ 11 seems to move the pair, which + // results in one copy (for the const key) and one move (for the + // non-const mapped value). Since 'emplace(boost::move(a))' (see below) + // has the normal result, it must be some odd consequence of how + // Visual C++ 11 handles calling move for default arguments. + COPY_COUNT(3); + MOVE_COUNT(1); +#else + COPY_COUNT_EXTRA(2, 1); + MOVE_COUNT_EXTRA(0, 1); +#endif +#endif + + reset(); + x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), + boost::make_tuple()); + COPY_COUNT(2); + MOVE_COUNT(0); + + // + // 1 argument + // + + reset(); + x.emplace(a); + COPY_COUNT(0); + MOVE_COUNT(0); + + // A new object is created by source, but it shouldn't be moved or + // copied. + reset(); + x.emplace(source >()); + COPY_COUNT(2); + MOVE_COUNT(source_pair_cost); + +#if !(defined(__GNUC__) && __cplusplus < 199900L) && \ + !(defined(_MSC_VER) && _MSC_VER < 1600) + count_copies part; + reset(); + std::pair a_ref(part, part); + x.emplace(a_ref); + COPY_COUNT(2); + MOVE_COUNT(0); + +#endif + + // No move should take place. + // (since a is already in the container) + reset(); + x.emplace(boost::move(a)); + COPY_COUNT(0); + MOVE_COUNT(0); + + // + // 2 arguments + // + + std::pair b; + + reset(); + x.emplace(b.first, b.second); + COPY_COUNT(0); + MOVE_COUNT(0); + + reset(); + x.emplace(source(), source()); + COPY_COUNT(2); + MOVE_COUNT(source_cost * 2); + + // source creates a single copy. + reset(); + x.emplace(b.first, source()); + COPY_COUNT(1); + MOVE_COUNT(source_cost); + + reset(); + x.emplace(count_copies(b.first.tag_), count_copies(b.second.tag_)); + COPY_COUNT(2); + MOVE_COUNT(0); + + reset(); + x.emplace(boost::unordered::piecewise_construct, + boost::make_tuple(boost::ref(b.first)), + boost::make_tuple(boost::ref(b.second))); + COPY_COUNT(0); + MOVE_COUNT(0); + +#if BOOST_UNORDERED_TUPLE_ARGS + + reset(); + x.emplace(boost::unordered::piecewise_construct, + std::make_tuple(std::ref(b.first)), + std::make_tuple(std::ref(b.second))); + COPY_COUNT(0); + MOVE_COUNT(0); + + std::pair move_source_trial; + reset(); + std::make_tuple(std::move(move_source_trial.first)); + std::make_tuple(std::move(move_source_trial.second)); + int tuple_move_cost = ::unnecessary_copy_tests::count_copies::moves; + int tuple_copy_cost = ::unnecessary_copy_tests::count_copies::copies; + + std::pair move_source; + reset(); + x.emplace(boost::unordered::piecewise_construct, + std::make_tuple(std::move(move_source.first)), + std::make_tuple(std::move(move_source.second))); + COPY_COUNT(tuple_copy_cost); + MOVE_COUNT(tuple_move_cost); + +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \ + !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6) && \ + !(defined(BOOST_MSVC) && BOOST_MSVC < 1700) + reset(); + x.emplace(boost::unordered::piecewise_construct, + std::forward_as_tuple(b.first), std::forward_as_tuple(b.second)); + COPY_COUNT(0); + MOVE_COUNT(0); +#endif + +#endif +} +} + +RUN_TESTS() diff --git a/tools/boost_1_65_1/libs/utility/Assignable.html b/tools/boost_1_65_1/libs/utility/Assignable.html new file mode 100644 index 0000000000000000000000000000000000000000..d3b3157653a64fdbafe0ab672439b957ef4f0db0 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/Assignable.html @@ -0,0 +1,109 @@ + + + + + + + + Assignable + + + + C++ Boost
+ +

Assignable

+ +

Description

+ +

A type is Assignable if it is possible to assign one object of the type + to another object of that type.

+ +

Notation

+ + + + + + + + + + + + + + + + + + + +
Tis type that is a model of Assignable
tis an object of type T
uis an object of type T or possibly const + T
+ +

Definitions

+ +

Valid expressions

+ + + + + + + + + + + + + + + + + + + + + +
NameExpressionReturn typeSemantics
Assignmentt = uT&t is equivalent to u
+ +

Models

+ +
    +
  • int
  • + +
  • std::pair
  • +
+ +

See also

+ +

DefaultConstructible + and CopyConstructible

+
+ +

Valid HTML 4.01 Transitional

+ +

Revised + 05 December, 2006

+ + + + + + + +
Copyright © 2000Jeremy Siek, Univ.of + Notre Dame (jsiek@lsc.nd.edu)
+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at http://www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/Collection.html b/tools/boost_1_65_1/libs/utility/Collection.html new file mode 100644 index 0000000000000000000000000000000000000000..b92ddd6eeb0388a088311eaeb5dc964d1e72a5f1 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/Collection.html @@ -0,0 +1,534 @@ + + + + + + + + Collection + + + +

boost logo
+ Collection

+ +

Description

+ +

A Collection is a concept similar to the STL Container concept. A + Collection provides iterators for accessing a range of elements and + provides information about the number of elements in the Collection. + However, a Collection has fewer requirements than a Container. The + motivation for the Collection concept is that there are many useful + Container-like types that do not meet the full requirements of Container, + and many algorithms that can be written with this reduced set of + requirements. To summarize the reduction in requirements:

+ +
    +
  • It is not required to "own" its elements: the lifetime of an element + in a Collection does not have to match the lifetime of the Collection + object, though the lifetime of the element should cover the lifetime of + the Collection object.
  • + +
  • The semantics of copying a Collection object is not defined (it could + be a deep or shallow copy or not even support copying).
  • + +
  • The associated reference type of a Collection does not have to be a + real C++ reference.
  • +
Because of the reduced requirements, some care must be taken when + writing code that is meant to be generic for all Collection types. In + particular, a Collection object should be passed by-reference since + assumptions can not be made about the behaviour of the copy constructor. + +

Associated types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value typeX::value_typeThe type of the object stored in a Collection. If the + Collection is mutable then the value type must be Assignable. Otherwise + the value type must be CopyConstructible.
Iterator typeX::iteratorThe type of iterator used to iterate through a + Collection's elements. The iterator's value type is expected to be the + Collection's value type. A conversion from the iterator type to the + const iterator type must exist. The iterator type must be an InputIterator.
Const iterator typeX::const_iteratorA type of iterator that may be used to examine, but + not to modify, a Collection's elements.
Reference typeX::referenceA type that behaves like a reference to the + Collection's value type. [1]
Const reference typeX::const_referenceA type that behaves like a const reference to the + Collection's value type.
Pointer typeX::pointerA type that behaves as a pointer to the Collection's + value type.
Distance typeX::difference_typeA signed integral type used to represent the distance + between two of the Collection's iterators. This type must be the same + as the iterator's distance type.
Size typeX::size_typeAn unsigned integral type that can represent any + nonnegative value of the Collection's distance type.
+ +

Notation

+ + + + + + + + + + + + + + + + + + + +
XA type that is a model of Collection.
a, bObject of type X.
TThe value type of X.
+ +

Valid expressions

+ +

The following expressions must be valid.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameExpressionReturn type
Beginning of rangea.begin()iterator if a is mutable, + const_iterator otherwise
End of rangea.end()iterator if a is mutable, + const_iterator otherwise
Sizea.size()size_type
Empty Collectiona.empty()Convertible to bool
Swapa.swap(b)void
+ +

Expression semantics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameExpressionSemanticsPostcondition
Beginning of rangea.begin()Returns an iterator pointing to the first element in + the Collection.a.begin() is either dereferenceable or + past-the-end. It is past-the-end if and only if a.size() == + 0.
End of rangea.end()Returns an iterator pointing one past the last element + in the Collection.a.end() is past-the-end.
Sizea.size()Returns the size of the Collection, that is, its + number of elements.a.size() >= 0
Empty Collectiona.empty()Equivalent to a.size() == 0. (But possibly + faster.) 
Swapa.swap(b)Equivalent to swap(a,b) 
+ +

Complexity guarantees

+ +

begin() and end() are amortized constant time.

+ +

size() is at most linear in the Collection's size. + empty() is amortized constant time.

+ +

swap() is at most linear in the size of the two + collections.

+ +

Invariants

+ + + + + + + + + + + + + + + + + + + +
Valid rangeFor any Collection a, [a.begin(), + a.end()) is a valid range.
Range sizea.size() is equal to the distance from + a.begin() to a.end().
CompletenessAn algorithm that iterates through the range + [a.begin(), a.end()) will pass through every element of + a.
+ +

Models

+ +
    +
  • array
  • + +
  • array_ptr
  • + +
  • vector<bool>
  • +
+ +

Collection Refinements

+ +

There are quite a few concepts that refine the Collection concept, + similar to the concepts that refine the Container concept. Here is a brief + overview of the refining concepts.

+ +

ForwardCollection

+ +

The elements are arranged in some order that does not change + spontaneously from one iteration to the next. As a result, a + ForwardCollection is EqualityComparable + and LessThanComparable. + In addition, the iterator type of a ForwardCollection is a + MultiPassInputIterator which is just an InputIterator with the added + requirements that the iterator can be used to make multiple passes through + a range, and that if it1 == it2 and it1 is + dereferenceable then ++it1 == ++it2. The ForwardCollection also + has a front() method.

+ + + + + + + + + + + + + + + + + + + + + +
NameExpressionReturn typeSemantics
Fronta.front()reference if a is mutable,
+ const_reference otherwise.
Equivalent to *(a.begin()).
+ +

ReversibleCollection

+ +

The container provides access to iterators that traverse in both + directions (forward and reverse). The iterator type must meet all of the + requirements of BidirectionalIterator + except that the reference type does not have to be a real C++ reference. + The ReversibleCollection adds the following requirements to those of + ForwardCollection.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameExpressionReturn typeSemantics
Beginning of rangea.rbegin()reverse_iterator if a is mutable, + const_reverse_iterator otherwise.Equivalent to + X::reverse_iterator(a.end()).
End of rangea.rend()reverse_iterator if a is mutable, + const_reverse_iterator otherwise.Equivalent to + X::reverse_iterator(a.begin()).
Backa.back()reference if a is mutable,
+ const_reference otherwise.
Equivalent to *(--a.end()).
+ +

SequentialCollection

+ +

The elements are arranged in a strict linear order. No extra methods are + required.

+ +

RandomAccessCollection

+ +

The iterators of a RandomAccessCollection satisfy all of the + requirements of RandomAccessIterator + except that the reference type does not have to be a real C++ reference. In + addition, a RandomAccessCollection provides an element access operator.

+ + + + + + + + + + + + + + + + + + + + + +
NameExpressionReturn typeSemantics
Element Accessa[n]reference if a is mutable, + const_reference otherwise.Returns the nth element of the Collection. n + must be convertible to size_type. Precondition: 0 <= n + < a.size().
+ +

Notes

+ +

[1] The reference type does not have to be a + real C++ reference. The requirements of the reference type depend on the + context within which the Collection is being used. Specifically it depends + on the requirements the context places on the value type of the Collection. + The reference type of the Collection must meet the same requirements as the + value type. In addition, the reference objects must be equivalent to the + value type objects in the collection (which is trivially true if they are + the same object). Also, in a mutable Collection, an assignment to the + reference object must result in an assignment to the object in the + Collection (again, which is trivially true if they are the same object, but + non-trivial if the reference type is a proxy class).

+ +

See also

+ +

Container

+
+ +

Valid HTML 4.01 Transitional

+ +

Revised + 05 + December, 2006

+ + + + + + + +
Copyright © 2000Jeremy + Siek, Univ.of Notre Dame and C++ Library & Compiler Group/SGI + (jsiek@engr.sgi.com)
+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at http://www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/CopyConstructible.html b/tools/boost_1_65_1/libs/utility/CopyConstructible.html new file mode 100644 index 0000000000000000000000000000000000000000..6a7ce6557fce34d9e476f99745495ba32fb890c9 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/CopyConstructible.html @@ -0,0 +1,185 @@ + + + + + + + + Copy Constructible + + + + C++ Boost
+ +

Copy Constructible

+ +

Description

+ +

A type is Copy Constructible if it is possible to copy objects of that + type.

+ +

Notation

+ + + + + + + + + + + + + + + + + + + +
Tis type that is a model of Copy Constructible
tis an object of type T
uis an object of type const T
+ +

Definitions

+ +

Valid expressions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameExpressionReturn typeSemantics
Copy constructorT(t)Tt is equivalent to T(t)
Copy constructor +
+T(u)
+
+
Tu is equivalent to T(u)
Destructor +
+t.~T()
+
+
T 
Address Operator +
+&t
+
+
T*denotes the address of t
Address Operator +
+&u
+
+
T*denotes the address of u
+ +

Models

+ +
    +
  • int
  • + +
  • std::pair
  • +
+ +

Concept Checking Class

+
+  template <class T>
+  struct CopyConstructibleConcept
+  {
+    void constraints() {
+      T a(b);            // require copy constructor
+      T* ptr = &a;       // require address of operator
+      const_constraints(a);
+      ignore_unused_variable_warning(ptr);
+    }
+    void const_constraints(const T& a) {
+      T c(a);            // require const copy constructor
+      const T* ptr = &a; // require const address of operator
+      ignore_unused_variable_warning(c);
+      ignore_unused_variable_warning(ptr);
+    }
+    T b;
+  };
+
+ +

See also

+ +

Default + Constructible and Assignable

+
+ +

Valid HTML 4.01 Transitional

+ +

Revised + 05 + December, 2006

+ + + + + + + +
Copyright © 2000Jeremy Siek, Univ.of + Notre Dame (jsiek@lsc.nd.edu)
+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at http://www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/LessThanComparable.html b/tools/boost_1_65_1/libs/utility/LessThanComparable.html new file mode 100644 index 0000000000000000000000000000000000000000..15b938fc5d285cb1a1366726394f586ed96b3383 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/LessThanComparable.html @@ -0,0 +1,210 @@ + + + + + + + + + + LessThanComparable + + + + C++ Boost
+ +

LessThanComparable

+ +

Description

+ +

A type is LessThanComparable if it is ordered: it must be possible to + compare two objects of that type using operator<, and + operator< must be a strict weak ordering relation.

+ +

Refinement of

+ +

Associated types

+ +

Notation

+ + + + + + + + + + + + + +
XA type that is a model of LessThanComparable
x, y, zObject of type X
+ +

Definitions

+ +

Consider the relation !(x < y) && !(y < x). If + this relation is transitive (that is, if !(x < y) && !(y + < x) && !(y < z) && !(z < y) implies !(x + < z) && !(z < x)), then it satisfies the mathematical + definition of an equivalence relation. In this case, operator< + is a strict weak ordering.

+ +

If operator< is a strict weak ordering, and if each + equivalence class has only a single element, then operator< is + a total ordering.

+ +

Valid expressions

+ + + + + + + + + + + + + + + + + + + + + +
NameExpressionType requirementsReturn type
Lessx < y Convertible to bool
+ +

Expression semantics

+ + + + + + + + + + + + + + + + + + + + + + + +
NameExpressionPreconditionSemanticsPostcondition
Lessx < yx and y are in the domain of + < 
+ +

Complexity guarantees

+ +

Invariants

+ + + + + + + + + + + + + + + + + + + +
Irreflexivityx < x must be false.
Antisymmetryx < y implies !(y < x) [2]
Transitivityx < y and y < z implies x + < z [3]
+ +

Models

+ +
    +
  • int
  • +
+ +

Notes

+ +

[1] Only operator< is fundamental; + the other inequality operators are essentially syntactic sugar.

+ +

[2] Antisymmetry is a theorem, not an axiom: it + follows from irreflexivity and transitivity.

+ +

[3] Because of irreflexivity and transitivity, + operator< always satisfies the definition of a partial + ordering. The definition of a strict weak ordering is stricter, + and the definition of a total ordering is stricter still.

+ +

See also

+ +

EqualityComparable, + StrictWeakOrdering
+

+
+ +

Valid HTML 4.01 Transitional

+ +

Revised + 05 + December, 2006

+ + + + + + + +
Copyright © 2000Jeremy Siek, Univ.of + Notre Dame (jsiek@lsc.nd.edu)
+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at http://www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/MultiPassInputIterator.html b/tools/boost_1_65_1/libs/utility/MultiPassInputIterator.html new file mode 100644 index 0000000000000000000000000000000000000000..e331ca3aa2540159baa721dbae3405dba5a78e7a --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/MultiPassInputIterator.html @@ -0,0 +1,95 @@ + + + + + + + + MultiPassInputIterator + + + + C++ Boost
+ +

Multi-Pass Input Iterator

+ +

This concept is a refinement of Input Iterator, adding + the requirements that the iterator can be used to make multiple passes + through a range, and that if it1 == it2 and it1 is + dereferenceable then ++it1 == ++it2. The Multi-Pass Input Iterator + is very similar to the Forward Iterator. + The only difference is that a Forward Iterator + requires the reference type to be value_type&, + whereas MultiPassInputIterator is like Input Iterator in that + the reference type merely has to be convertible to + value_type.

+ +

Design Notes

+ +

comments by Valentin Bonnard:

+ +

I think that introducing Multi-Pass Input Iterator isn't the right + solution. Do you also want to define Multi-Pass Bidirectionnal Iterator and + Multi-Pass Random Access Iterator ? I don't, definitly. It only confuses + the issue. The problem lies into the existing hierarchy of iterators, which + mixes movabillity, modifiabillity and lvalue-ness, and these are clearly + independant.

+ +

The terms Forward, Bidirectionnal and Random Access are about + movabillity and shouldn't be used to mean anything else. In a completly + orthogonal way, iterators can be immutable, mutable, or neither. Lvalueness + of iterators is also orthogonal with immutabillity. With these clean + concepts, your Multi-Pass Input Iterator is just called a Forward + Iterator.

+ +

Other translations are:
+ std::Forward Iterator -> ForwardIterator & Lvalue Iterator
+ std::Bidirectionnal Iterator -> Bidirectionnal Iterator & Lvalue + Iterator
+ std::Random Access Iterator -> Random Access Iterator & Lvalue + Iterator

+ +

Note that in practice the only operation not allowed on my Forward + Iterator which is allowed on std::Forward Iterator is &*it. I + think that &* is rarely needed in generic code.

+ +

reply by Jeremy Siek:

+ +

The above analysis by Valentin is right on. Of course, there is the + problem with backward compatibility. The current STL implementations are + based on the old definition of Forward Iterator. The right course of action + is to get Forward Iterator, etc. changed in the C++ standard. Once that is + done we can drop Multi-Pass Input Iterator.

+
+ +

Valid HTML 4.01 Transitional

+ +

Revised + 05 + December, 2006

+ + + + + + + +
Copyright © 2000Jeremy Siek, Univ.of + Notre Dame (jsiek@lsc.nd.edu)
+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at http://www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/OptionalPointee.html b/tools/boost_1_65_1/libs/utility/OptionalPointee.html new file mode 100644 index 0000000000000000000000000000000000000000..c3c7e44eb6a5a5a43cd160f7a639413bde60de27 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/OptionalPointee.html @@ -0,0 +1,159 @@ + + +OptionalPointee Concept + + +C++ Boost + +
+

Concept: OptionalPointee

+ +

Description

+A type is a model of OptionalPointee if it points to (or refers to) a value +that may not exist. That is, if it has a pointee which might be valid +(existent) or invalid (inexistent); and it is possible to test whether the +pointee is valid or not. +This model does not imply pointer semantics: i.e., it does not imply shallow copy nor +aliasing. +

Notation

+ + + + + + + + + +
T is a type that is a model of OptionalPointee
t is an object of type T or possibly const T
+

Definitions

+

Valid expressions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name Expression Return type Semantics
Value Access *t T&If the pointee is valid returns a reference to + the pointee.
+ If the pointee is invalid the result is undefined.
Value Access t->xyz T*If the pointee is valid returns a builtin pointer to the pointee.
+ If the pointee is invalid the result is undefined (It might not even return NULL).
+
Validity Test bool(t) bool If the pointee is valid returns true.
+ If the pointee is invalid returns false.
Invalidity Test !t bool If the pointee is valid returns false.
+ If the pointee is invalid returns true.
+ + +

Models

+ +
    +
  • pointers, both builtin and smart. +
  • boost::optional<> +
+ +
+

OptionalPointee and relational operations

+

This concept does not define any particular semantic for relational operations, therefore, +a type which models this concept might have either shallow or deep relational semantics.
+For instance, pointers, which are models of OptionalPointee, have shallow relational operators: +comparisons of pointers do not involve comparisons of pointees. +This makes sense for pointers because they have shallow copy semantics.
+But boost::optional<T>, on the other hand, which is also a model of OptionalPointee, has +deep-copy and deep-relational semantics.
+If generic code is written for this concept, it is important not to use relational +operators directly because the semantics might be different depending on the actual type.
+Still, the concept itsef can be used to define deep relational tests that can +be used in generic code with any type which models OptionalPointee:

+ +

Equivalence relation:

+
template<class OptionalPointee>
+inline
+bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+{
+  return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
+}
+template<class OptionalPointee>
+struct equal_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
+{
+  bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
+    { return equal_pointees(x,y) ; }
+} ;
+
+

The preceding generic function and function object have the following semantics:
+If both x and y have valid pointees, it compares values via (*x == *y).
+If only one has a valid pointee, returns false.
+If both have invalid pointees, returns true.

+ +

Less-than relation:

+
template<class OptionalPointee>
+inline
+bool less_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+{
+  return !y ? false : ( !x ? true : (*x) < (*y) ) ;
+}
+template<class OptionalPointee>
+struct less_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
+{
+  bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
+    { return less_pointees(x,y) ; }
+} ;
+
+

The preceding generic function and function object have the following semantics:
+If y has an invalid pointee, returns false.
+Else, if x has an invalid pointee, returns true.
+Else, ( x and y have valid pointees), compares values via (*x < +*y).

+


+All these functions and function +objects are is implemented in compare_pointees.hpp

+

Notice that OptionalPointee does not imply aliasing (and optional<> for instance does not alias); +so direct usage of relational operators with the implied aliasing of shallow semantics +-as with pointers- should not be used with generic code written for this concept.

+ +

Acknowledgements

+

Based on the original concept developed by Augustus Saunders. + +
+

+
+ + +
Copyright © 2003 +Fernando Cacciola +
+ +

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

+ + + diff --git a/tools/boost_1_65_1/libs/utility/call_traits.htm b/tools/boost_1_65_1/libs/utility/call_traits.htm new file mode 100644 index 0000000000000000000000000000000000000000..a69c1de2e880c4f3c5e26dcda02a8c9949c0b843 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/call_traits.htm @@ -0,0 +1,755 @@ + + + + + + +Call Traits + + + + +

Header +<boost/call_traits.hpp>

+ +

All of the contents of <boost/call_traits.hpp> are +defined inside namespace boost.

+ +

The template class call_traits<T> encapsulates the +"best" method to pass a parameter of some type T to or +from a function, and consists of a collection of typedefs defined +as in the table below. The purpose of call_traits is to ensure +that problems like "references to references" +never occur, and that parameters are passed in the most efficient +manner possible (see examples). In each +case if your existing practice is to use the type defined on the +left, then replace it with the call_traits defined type on the +right.

+ +

Note that for compilers that do not support either partial +specialization or member templates, no benefit will occur from +using call_traits: the call_traits defined types will always be +the same as the existing practice in this case. In addition if +only member templates and not partial template specialisation is +support by the compiler (for example Visual C++ 6) then +call_traits can not be used with array types (although it can be +used to solve the reference to reference problem).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Existing practice

+

call_traits equivalent

+

Description

+

Notes

+

T
+ (return by value)

+

call_traits<T>::value_type

+
Defines a type that + represents the "value" of type T. Use this for + functions that return by value, or possibly for stored + values of type T.

2

+

T&
+ (return value)

+

call_traits<T>::reference

+
Defines a type that + represents a reference to type T. Use for functions that + would normally return a T&.

1

+

const + T&
+ (return value)

+

call_traits<T>::const_reference

+
Defines a type that + represents a constant reference to type T. Use for + functions that would normally return a const T&.

1

+

const + T&
+ (function parameter)

+

call_traits<T>::param_type

+
Defines a type that + represents the "best" way to pass a parameter + of type T to a function.

1,3

+
+ +

Notes:

+ +
    +
  1. If T is already reference type, then call_traits is + defined such that references to + references do not occur (requires partial + specialization).
  2. +
  3. If T is an array type, then call_traits defines value_type + as a "constant pointer to type" rather than an + "array of type" (requires partial + specialization). Note that if you are using value_type as + a stored value then this will result in storing a "constant + pointer to an array" rather than the array itself. + This may or may not be a good thing depending upon what + you actually need (in other words take care!).
  4. +
  5. If T is a small built in type or a pointer, then param_type + is defined as T const, instead of T + const&. This can improve the ability of the + compiler to optimize loops in the body of the function if + they depend upon the passed parameter, the semantics of + the passed parameter is otherwise unchanged (requires + partial specialization).
  6. +
+ +

 

+ +

Copy constructibility

+ +

The following table defines which call_traits types can always +be copy-constructed from which other types, those entries marked +with a '?' are true only if and only if T is copy constructible:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 

To:

+
From:

T

+

value_type

+

reference

+

const_reference

+

param_type

+
T

?

+

?

+

Y

+

Y

+

Y

+
value_type

?

+

?

+

N

+

N

+

Y

+
reference

?

+

?

+

Y

+

Y

+

Y

+
const_reference

?

+

N

+

N

+

Y

+

Y

+
param_type

?

+

?

+

N

+

N

+

Y

+
+ +

 

+ +

If T is an assignable type the following assignments are +possible:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 

To:

+
From:

T

+

value_type

+

reference

+

const_reference

+

param_type

+
T

Y

+

Y

+

-

+

-

+

-

+
value_type

Y

+

Y

+

-

+

-

+

-

+
reference

Y

+

Y

+

-

+

-

+

-

+
const_reference

Y

+

Y

+

-

+

-

+

-

+
param_type

Y

+

Y

+

-

+

-

+

-

+
+ +

 

+ +

Examples

+ +

The following table shows the effect that call_traits has on +various types, the table assumes that the compiler supports +partial specialization: if it doesn't then all types behave in +the same way as the entry for "myclass", and +call_traits can not be used with reference or array types.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 

Call_traits type:

+

Original type T

+

value_type

+

reference

+

const_reference

+

param_type

+

Applies to:

+

myclass

+

myclass

+

myclass&

+

const + myclass&

+

myclass + const&

+

All user + defined types.

+

int

+

int

+

int&

+

const + int&

+

int const

+

All small + built-in types.

+

int*

+

int*

+

int*&

+

int*const&

+

int* const

+

All + pointer types.

+

int&

+

int&

+

int&

+

const + int&

+

int&

+

All + reference types.

+

const int&

+

const + int&

+

const + int&

+

const + int&

+

const + int&

+

All + constant-references.

+

int[3]

+

const int*

+

int(&)[3]

+

const int(&)[3]

+

const int* + const

+

All array + types.

+

const int[3]

+

const int*

+

const int(&)[3]

+

const int(&)[3]

+

const int* + const

+

All + constant-array types.

+
+ +

 

+ +

Example 1:

+ +

The following class is a trivial class that stores some type T +by value (see the call_traits_test.cpp +file), the aim is to illustrate how each of the available +call_traits typedefs may be used:

+ +
template <class T>
+struct contained
+{
+   // define our typedefs first, arrays are stored by value
+   // so value_type is not the same as result_type:
+   typedef typename boost::call_traits<T>::param_type       param_type;
+   typedef typename boost::call_traits<T>::reference        reference;
+   typedef typename boost::call_traits<T>::const_reference  const_reference;
+   typedef T                                                value_type;
+   typedef typename boost::call_traits<T>::value_type       result_type;
+
+   // stored value:
+   value_type v_;
+   
+   // constructors:
+   contained() {}
+   contained(param_type p) : v_(p){}
+   // return byval:
+   result_type value() { return v_; }
+   // return by_ref:
+   reference get() { return v_; }
+   const_reference const_get()const { return v_; }
+   // pass value:
+   void call(param_type p){}
+
+};
+ +

Example 2 (the reference to reference +problem):

+ +

Consider the definition of std::binder1st:

+ +
template <class Operation> 
+class binder1st : 
+   public unary_function<typename Operation::second_argument_type, typename Operation::result_type> 
+{ 
+protected: 
+   Operation op; 
+   typename Operation::first_argument_type value; 
+public: 
+   binder1st(const Operation& x, const typename Operation::first_argument_type& y); 
+   typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const; 
+}; 
+ +

Now consider what happens in the relatively common case that +the functor takes its second argument as a reference, that +implies that Operation::second_argument_type is a +reference type, operator() will now end up taking a +reference to a reference as an argument, and that is not +currently legal. The solution here is to modify operator() +to use call_traits:

+ +
typename Operation::result_type operator()(typename call_traits<typename Operation::second_argument_type>::param_type x) const;
+ +

Now in the case that Operation::second_argument_type +is a reference type, the argument is passed as a reference, and +the no "reference to reference" occurs.

+ +

Example 3 (the make_pair problem):

+ +

If we pass the name of an array as one (or both) arguments to std::make_pair, +then template argument deduction deduces the passed parameter as +"const reference to array of T", this also applies to +string literals (which are really array literals). Consequently +instead of returning a pair of pointers, it tries to return a +pair of arrays, and since an array type is not copy-constructible +the code fails to compile. One solution is to explicitly cast the +arguments to make_pair to pointers, but call_traits provides a +better (i.e. automatic) solution (and one that works safely even +in generic code where the cast might do the wrong thing):

+ +
template <class T1, class T2>
+std::pair<
+   typename boost::call_traits<T1>::value_type, 
+   typename boost::call_traits<T2>::value_type> 
+      make_pair(const T1& t1, const T2& t2)
+{
+   return std::pair<
+      typename boost::call_traits<T1>::value_type, 
+      typename boost::call_traits<T2>::value_type>(t1, t2);
+}
+ +

Here, the deduced argument types will be automatically +degraded to pointers if the deduced types are arrays, similar +situations occur in the standard binders and adapters: in +principle in any function that "wraps" a temporary +whose type is deduced. Note that the function arguments to +make_pair are not expressed in terms of call_traits: doing so +would prevent template argument deduction from functioning.

+ +

Example 4 (optimising fill):

+ +

The call_traits template will "optimize" the passing +of a small built-in type as a function parameter, this mainly has +an effect when the parameter is used within a loop body. In the +following example (see fill_example.cpp), +a version of std::fill is optimized in two ways: if the type +passed is a single byte built-in type then std::memset is used to +effect the fill, otherwise a conventional C++ implemention is +used, but with the passed parameter "optimized" using +call_traits:

+ +
namespace detail{
+
+template <bool opt>
+struct filler
+{
+   template <typename I, typename T>
+   static void do_fill(I first, I last, typename boost::call_traits<T>::param_type val)
+   {
+      while(first != last)
+      {
+         *first = val;
+         ++first;
+      }
+   }
+};
+
+template <>
+struct filler<true>
+{
+   template <typename I, typename T>
+   static void do_fill(I first, I last, T val)
+   {
+      memset(first, val, last-first);
+   }
+};
+
+}
+
+template <class I, class T>
+inline void fill(I first, I last, const T& val)
+{
+   enum{ can_opt = boost::is_pointer<I>::value
+                   && boost::is_arithmetic<T>::value
+                   && (sizeof(T) == 1) };
+   typedef detail::filler<can_opt> filler_t;
+   filler_t::template do_fill<I,T>(first, last, val);
+}
+ +

Footnote: the reason that this is "optimal" for +small built-in types is that with the value passed as "T +const" instead of "const T&" the compiler is +able to tell both that the value is constant and that it is free +of aliases. With this information the compiler is able to cache +the passed value in a register, unroll the loop, or use +explicitly parallel instructions: if any of these are supported. +Exactly how much mileage you will get from this depends upon your +compiler - we could really use some accurate benchmarking +software as part of boost for cases like this.

+ +

Note that the function arguments to fill are not expressed in +terms of call_traits: doing so would prevent template argument +deduction from functioning. Instead fill acts as a "thin +wrapper" that is there to perform template argument +deduction, the compiler will optimise away the call to fill all +together, replacing it with the call to filler<>::do_fill, +which does use call_traits.

+ +

Rationale

+ +

The following notes are intended to briefly describe the +rational behind choices made in call_traits.

+ +

All user-defined types follow "existing practice" +and need no comment.

+ +

Small built-in types (what the standard calls fundamental +types [3.9.1]) differ from existing practice only in the param_type +typedef. In this case passing "T const" is compatible +with existing practice, but may improve performance in some cases +(see Example 4), in any case this should never +be any worse than existing practice.

+ +

Pointers follow the same rational as small built-in types.

+ +

For reference types the rational follows Example +2 - references to references are not allowed, so the +call_traits members must be defined such that these problems do +not occur. There is a proposal to modify the language such that +"a reference to a reference is a reference" (issue #106, +submitted by Bjarne Stroustrup), call_traits<T>::value_type +and call_traits<T>::param_type both provide the same effect +as that proposal, without the need for a language change (in +other words it's a workaround).

+ +

For array types, a function that takes an array as an argument +will degrade the array type to a pointer type: this means that +the type of the actual parameter is different from its declared +type, something that can cause endless problems in template code +that relies on the declared type of a parameter. For example:

+ +
template <class T>
+struct A
+{
+   void foo(T t);
+};
+ +

In this case if we instantiate +A<int[2]> then the declared type of the parameter passed to +member function foo is int[2], but it's actual type is const int*, +if we try to use the type T within the function body, then there +is a strong likelyhood that our code will not compile:

+ +
template <class T>
+void A<T>::foo(T t)
+{
+   T dup(t); // doesn't compile for case that T is an array.
+}
+ +

By using call_traits the degradation from array to pointer is +explicit, and the type of the parameter is the same as it's +declared type:

+ +
template <class T>
+struct A
+{
+   void foo(typename call_traits<T>::value_type t);
+};
+
+template <class T>
+void A<T>::foo(typename call_traits<T>::value_type t)
+{
+   typename call_traits<T>::value_type dup(t); // OK even if T is an array type.
+}
+ +

For value_type (return by value), again only a pointer may be +returned, not a copy of the whole array, and again call_traits +makes the degradation explicit. The value_type member is useful +whenever an array must be explicitly degraded to a pointer - Example 3 provides the test case (Footnote: the +array specialisation for call_traits is the least well understood +of all the call_traits specialisations, if the given semantics +cause specific problems for you, or don't solve a particular +array-related problem, then I would be interested to hear about +it. Most people though will probably never need to use this +specialisation).

+ +
+ +

Revised 01 September 2000

+ +

+ Copyright 2000 Steve Cleary, Beman Dawes, Howard + Hinnant and John Maddock.
+ Use, modification and distribution are subject to the + Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt + or copy at + http://www.boost.org/LICENSE_1_0.txt + ). +

+ + + diff --git a/tools/boost_1_65_1/libs/utility/checked_delete.html b/tools/boost_1_65_1/libs/utility/checked_delete.html new file mode 100644 index 0000000000000000000000000000000000000000..1b932561556c2d6b245552b8f9b8879bec620074 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/checked_delete.html @@ -0,0 +1,15 @@ + + + + +Automatic redirection + + +Automatic redirection failed, please go to +checked_delete.html
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/compressed_pair.htm b/tools/boost_1_65_1/libs/utility/compressed_pair.htm new file mode 100644 index 0000000000000000000000000000000000000000..0b99bf7ac578dc0647fe58031c4775b3c15396c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/compressed_pair.htm @@ -0,0 +1,16 @@ + + + + + + + + +Automatic redirection failed, please go to +doc/html/compressed_pair.html + + diff --git a/tools/boost_1_65_1/libs/utility/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/utility/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..dda8f39e3e301529b054bb54cf150561f03f80ba --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/Jamfile.v2 @@ -0,0 +1,127 @@ + +# Copyright John Maddock 2005. Use, modification, and distribution are +# subject to the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +project : requirements + # Path for links to Boost: + boost.root=../../../.. + + # Some general style settings: + table.footnote.number.format=1 + footnote.number.format=1 + + # HTML options first: + # Use graphics not text for navigation: + navig.graphics=1 + # PDF Options: + # TOC Generation: this is needed for FOP-0.9 and later: + fop1.extensions=0 + xep.extensions=1 + # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9! + fop.extensions=0 + # No indent on body text: + body.start.indent=0pt + # Margin size: + page.margin.inner=0.5in + # Margin size: + page.margin.outer=0.5in + # Paper type = A4 + paper.type=A4 + # Yes, we want graphics for admonishments: + admon.graphics=1 + # Set this one for PDF generation *only*: + # default pnd graphics are awful in PDF form, + # better use SVG's instead: + pdf:admon.graphics.extension=".svg" + pdf:admon.graphics.path=$(boost-images)/ + pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/libs/utility/doc/html +; + +using quickbook ; + +path-constant boost-images : ../../../doc/src/images ; + +xml base_from_member : base_from_member.qbk ; +boostbook standalone_base_from_member + : + base_from_member + : + # File name of HTML output: + root.filename=base_from_member + # How far down we chunk nested sections, basically all of them: + chunk.section.depth=0 + # Don't put the first section on the same page as the TOC: + chunk.first.sections=0 + # How far down sections get TOC's + toc.section.depth=1 + # Max depth in each TOC: + toc.max.depth=1 + # How far down we go with TOC's + generate.section.toc.level=1 + ; + +xml compressed_pair : compressed_pair.qbk ; +boostbook standalone_compressed_pair + : + compressed_pair + : + # File name of HTML output: + root.filename=compressed_pair + # How far down we chunk nested sections, basically all of them: + chunk.section.depth=0 + # Don't put the first section on the same page as the TOC: + chunk.first.sections=0 + # How far down sections get TOC's + toc.section.depth=1 + # Max depth in each TOC: + toc.max.depth=1 + # How far down we go with TOC's + generate.section.toc.level=1 + ; + +xml declval : declval.qbk ; +boostbook standalone_declval + : + declval + : + # File name of HTML output: + root.filename=declval + # How far down we chunk nested sections, basically all of them: + chunk.section.depth=0 + # Don't put the first section on the same page as the TOC: + chunk.first.sections=0 + # How far down sections get TOC's + toc.section.depth=1 + # Max depth in each TOC: + toc.max.depth=1 + # How far down we go with TOC's + generate.section.toc.level=1 + ; + +xml string_ref : string_ref.qbk ; +boostbook standalone_string_ref + : + string_ref + : + # File name of HTML output: + root.filename=string_ref + # How far down we chunk nested sections, basically all of them: + chunk.section.depth=0 + # Don't put the first section on the same page as the TOC: + chunk.first.sections=0 + # How far down sections get TOC's + toc.section.depth=1 + # Max depth in each TOC: + toc.max.depth=1 + # How far down we go with TOC's + generate.section.toc.level=1 + ; + +############################################################################### +alias boostdoc ; +explicit boostdoc ; +alias boostrelease : + standalone_base_from_member standalone_compressed_pair + standalone_declval standalone_string_ref ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/utility/doc/base_from_member.qbk b/tools/boost_1_65_1/libs/utility/doc/base_from_member.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9afd94925396b611a3ebd58f793b62504b5bb466 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/base_from_member.qbk @@ -0,0 +1,363 @@ +[/ + Copyright 2001, 2003, 2004, 2012 Daryle Walker. + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + +[article Base_From_Member + [quickbook 1.5] + [authors [Walker, Daryle]] + [copyright 2001, 2003, 2004, 2012 Daryle Walker] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[section Rationale] + +When developing a class, sometimes a base class needs to be initialized +with a member of the current class. As a na\u00EFve example: + + #include /* for std::streambuf */ + #include /* for std::ostream */ + + class fdoutbuf + : public std::streambuf + { + public: + explicit fdoutbuf( int fd ); + //... + }; + + class fdostream + : public std::ostream + { + protected: + fdoutbuf buf; + public: + explicit fdostream( int fd ) + : buf( fd ), std::ostream( &buf ) {} + //... + }; + +This is undefined because C++'s initialization order mandates that the base +class is initialized before the member it uses. [@http://www.moocat.org R. +Samuel Klatchko] developed a way around this by using the initialization +order in his favor. Base classes are intialized in order of declaration, so +moving the desired member to another base class, that is initialized before +the desired base class, can ensure proper initialization. + +A custom base class can be made for this idiom: + + #include /* for std::streambuf */ + #include /* for std::ostream */ + + class fdoutbuf + : public std::streambuf + { + public: + explicit fdoutbuf( int fd ); + //... + }; + + struct fdostream_pbase + { + fdoutbuf sbuffer; + + explicit fdostream_pbase( int fd ) + : sbuffer( fd ) {} + }; + + class fdostream + : private fdostream_pbase + , public std::ostream + { + typedef fdostream_pbase pbase_type; + typedef std::ostream base_type; + + public: + explicit fdostream( int fd ) + : pbase_type( fd ), base_type( &sbuffer ) {} + //... + }; + +Other projects can use similar custom base classes. The technique is basic +enough to make a template, with a sample template class in this library. +The main template parameter is the type of the enclosed member. The +template class has several (explicit) constructor member templates, which +implicitly type the constructor arguments and pass them to the member. The +template class uses implicit copy construction and assignment, cancelling +them if the enclosed member is non-copyable. + +Manually coding a base class may be better if the construction and/or +copying needs are too complex for the supplied template class, or if the +compiler is not advanced enough to use it. + +Since base classes are unnamed, a class cannot have multiple (direct) base +classes of the same type. The supplied template class has an extra template +parameter, an integer, that exists solely to provide type differentiation. +This parameter has a default value so a single use of a particular member +type does not need to concern itself with the integer. + +[endsect] + +[section Synopsis] + + #include /* exposition only */ + + #ifndef BOOST_BASE_FROM_MEMBER_MAX_ARITY + #define BOOST_BASE_FROM_MEMBER_MAX_ARITY 10 + #endif + + template < typename MemberType, int UniqueID = 0 > + class boost::base_from_member + { + protected: + MemberType member; + + #if ``['C++11 is in use]`` + template< typename ...T > + explicit constexpr base_from_member( T&& ...x ) + noexcept( std::is_nothrow_constructible::value ); + #else + base_from_member(); + + template< typename T1 > + explicit base_from_member( T1 x1 ); + + template< typename T1, typename T2 > + base_from_member( T1 x1, T2 x2 ); + + //... + + template< typename T1, typename T2, typename T3, typename T4, + typename T5, typename T6, typename T7, typename T8, typename T9, + typename T10 > + base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7, + T8 x8, T9 x9, T10 x10 ); + #endif + }; + + template < typename MemberType, int UniqueID > + class base_from_member + { + protected: + MemberType& member; + + explicit constexpr base_from_member( MemberType& x ) + noexcept; + }; + +The class template has a first template parameter `MemberType` representing +the type of the based-member. It has a last template parameter `UniqueID`, +that is an `int`, to differentiate between multiple base classes that use +the same based-member type. The last template parameter has a default value +of zero if it is omitted. The class template has a protected data member +called `member` that the derived class can use for later base classes (or +itself). + +If the appropriate features of C++11 are present, there will be a single +constructor template. It implements ['perfect forwarding] to the best +constructor call of `member` (if any). The constructor template is marked +both `constexpr` and `explicit`. The former will be ignored if the +corresponding inner constructor call (of `member`) does not have the marker. +The latter binds the other way; always taking effect, even when the inner +constructor call does not have the marker. The constructor template +propagates the `noexcept` status of the inner constructor call. (The +constructor template has a trailing parameter with a default value that +disables the template when its signature is too close to the signatures of +the automatically-defined non-template copy- and/or move-constructors of +`base_from_member`.) + +On earlier-standard compilers, there is a default constructor and several +constructor member templates. These constructor templates can take as many +arguments (currently up to ten) as possible and pass them to a constructor +of the data member. + +A specialization for member references offers a single constructor taking +a `MemberType&`, which is the only way to initialize a reference. + +Since C++ does not allow any way to explicitly state the template parameters +of a templated constructor, make sure that the arguments are already close +as possible to the actual type used in the data member's desired constructor. +Explicit conversions may be necessary. + +The `BOOST_BASE_FROM_MEMBER_MAX_ARITY` macro constant specifies the maximum +argument length for the constructor templates. The constant may be overridden +if more (or less) argument configurations are needed. The constant may be +read for code that is expandable like the class template and needs to +maintain the same maximum size. (Example code would be a class that uses +this class template as a base class for a member with a flexible set of +constructors.) This constant is ignored when C++11 features are present. + +[endsect] + +[section Usage] + +With the starting example, the `fdoutbuf` sub-object needs to be +encapsulated in a base class that is inheirited before `std::ostream`. + + #include + + #include // for std::streambuf + #include // for std::ostream + + class fdoutbuf + : public std::streambuf + { + public: + explicit fdoutbuf( int fd ); + //... + }; + + class fdostream + : private boost::base_from_member + , public std::ostream + { + // Helper typedef's + typedef boost::base_from_member pbase_type; + typedef std::ostream base_type; + + public: + explicit fdostream( int fd ) + : pbase_type( fd ), base_type( &member ){} + //... + }; + +The base-from-member idiom is an implementation detail, so it should not +be visible to the clients (or any derived classes) of `fdostream`. Due to +the initialization order, the `fdoutbuf` sub-object will get initialized +before the `std::ostream` sub-object does, making the former sub-object +safe to use in the latter sub-object's construction. Since the `fdoutbuf` +sub-object of the final type is the only sub-object with the name `member` +that name can be used unqualified within the final class. + +[endsect] + +[section Example] + +The base-from-member class templates should commonly involve only one +base-from-member sub-object, usually for attaching a stream-buffer to an +I/O stream. The next example demonstrates how to use multiple +base-from-member sub-objects and the resulting qualification issues. + + #include + + #include /* for NULL */ + + struct an_int + { + int y; + + an_int( float yf ); + }; + + class switcher + { + public: + switcher(); + switcher( double, int * ); + //... + }; + + class flow_regulator + { + public: + flow_regulator( switcher &, switcher & ); + //... + }; + + template < unsigned Size > + class fan + { + public: + explicit fan( switcher ); + //... + }; + + class system + : private boost::base_from_member + , private boost::base_from_member + , private boost::base_from_member + , private boost::base_from_member + , protected flow_regulator + , public fan<6> + { + // Helper typedef's + typedef boost::base_from_member pbase0_type; + typedef boost::base_from_member pbase1_type; + typedef boost::base_from_member pbase2_type; + typedef boost::base_from_member pbase3_type; + + typedef flow_regulator base1_type; + typedef fan<6> base2_type; + + public: + system( double x ); + //... + }; + + system::system( double x ) + : pbase0_type( 0.2 ) + , pbase1_type() + , pbase2_type( -16, &this->pbase0_type::member.y ) + , pbase3_type( x, static_cast(NULL) ) + , base1_type( pbase3_type::member, pbase1_type::member ) + , base2_type( pbase2_type::member ) + { + //... + } + +The final class has multiple sub-objects with the name `member`, so any +use of that name needs qualification by a name of the appropriate base +type. (Using `typedef`s ease mentioning the base types.) However, the fix +introduces a new problem when a pointer is needed. Using the address +operator with a sub-object qualified with its class's name results in a +pointer-to-member (here, having a type of `an_int boost::base_from_member< +an_int, 0> :: *`) instead of a pointer to the member (having a type of +`an_int *`). The new problem is fixed by qualifying the sub-object with +`this->` and is needed just for pointers, and not for references or values. + +There are some argument conversions in the initialization. The constructor +argument for `pbase0_type` is converted from `double` to `float`. The first +constructor argument for `pbase2_type` is converted from `int` to `double`. +The second constructor argument for `pbase3_type` is a special case of +necessary conversion; all forms of the null-pointer literal in C++ (except +`nullptr` from C++11) also look like compile-time integral expressions, so +C++ always interprets such code as an integer when it has overloads that can +take either an integer or a pointer. The last conversion is necessary for the +compiler to call a constructor form with the exact pointer type used in +`switcher`'s constructor. (If C++11's `nullptr` is used, it still needs a +conversion if multiple pointer types can be accepted in a constructor call +but `std::nullptr_t` cannot.) + +[endsect] + +[section Acknowledgments] + +* [@http://www.boost.org/people/ed_brey.htm Ed Brey] suggested some interface +changes. + +* [@http://www.moocat.org R. Samuel Klatchko] ([@mailto:rsk@moocat.org +rsk@moocat.org], [@mailto:rsk@brightmail.com rsk@brightmail.com]) invented +the idiom of how to use a class member for initializing a base class. + +* [@http://www.boost.org/people/dietmar_kuehl.htm Dietmar Kuehl] popularized the + base-from-member idiom in his [@http://www.informatik.uni-konstanz.de/~kuehl/c++/iostream/ + IOStream example classes]. + +* Jonathan Turkanis supplied an implementation of generating the constructor +templates that can be controlled and automated with macros. The +implementation uses the [@../../../preprocessor/index.html Preprocessor library]. + +* [@http://www.boost.org/people/daryle_walker.html">Daryle Walker] started the +library. Contributed the test file [@../../base_from_member_test.cpp +base_from_member_test.cpp]. + +[endsect] + diff --git a/tools/boost_1_65_1/libs/utility/doc/compressed_pair.qbk b/tools/boost_1_65_1/libs/utility/doc/compressed_pair.qbk new file mode 100644 index 0000000000000000000000000000000000000000..eac4266b4eadc13493c5b7415e07ee8602b0bd47 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/compressed_pair.qbk @@ -0,0 +1,99 @@ +[/ + Copyright 2000 Beman Dawes & John Maddock. + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + +[article Compressed_Pair + [quickbook 1.5] + [authors [Cleary, Steve]] + [authors [Dawes, Beman]] + [authors [Hinnant, Howard]] + [authors [Maddock, John]] + [copyright 2000 Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[section Overview] + +All of the contents of `` are defined inside +`namespace boost`. + +The class `compressed_pair` is very similar to `std::pair`, but if either of +the template arguments are empty classes, then the ['empty base-class +optimisation] is applied to compress the size of the pair. + +[endsect] + +[section Synopsis] + + template + class compressed_pair + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base() {} + compressed_pair(first_param_type x, second_param_type y); + explicit compressed_pair(first_param_type x); + explicit compressed_pair(second_param_type y); + + compressed_pair& operator=(const compressed_pair&); + + first_reference first(); + first_const_reference first() const; + + second_reference second(); + second_const_reference second() const; + + void swap(compressed_pair& y); + }; + +The two members of the pair can be accessed using the member functions +`first()` and `second()`. Note that not all member functions can be +instantiated for all template parameter types. In particular +`compressed_pair` can be instantiated for reference and array types, +however in these cases the range of constructors that can be used are +limited. If types `T1` and `T2` are the same type, then there is only +one version of the single-argument constructor, and this constructor +initialises both values in the pair to the passed value. + +Note that if either member is a POD type, then that member is not +zero-initialized by the `compressed_pair` default constructor: it's up +to you to supply an initial value for these types if you want them to have +a default value. + +Note that `compressed_pair` can not be instantiated if either of the +template arguments is a union type, unless there is compiler support for +`boost::is_union`, or if `boost::is_union` is specialised for the union +type. + +Finally, a word of caution for Visual C++ 6 users: if either argument is an +empty type, then assigning to that member will produce memory corruption, +unless the empty type has a "do nothing" assignment operator defined. This +is due to a bug in the way VC6 generates implicit assignment operators. + +[endsect] + +[section Acknowledgments] + +Based on contributions by Steve Cleary, Beman Dawes, Howard Hinnant and +John Maddock. + +Maintained by [@mailto:john@johnmaddock.co.uk John Maddock]. + +[endsect] diff --git a/tools/boost_1_65_1/libs/utility/doc/declval.qbk b/tools/boost_1_65_1/libs/utility/doc/declval.qbk new file mode 100644 index 0000000000000000000000000000000000000000..910aaf6a600a95cc0499576eff2827dcad01cb45 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/declval.qbk @@ -0,0 +1,114 @@ +[/ + / Copyright (c) 2008 Howard Hinnant + / Copyright (c) 2009-20012 Vicente J. Botet Escriba + / + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /] + +[article Declval + [quickbook 1.5] + [authors [Hinnant, Howard]] + [authors [Botet Escriba, Vicente J.]] + [copyright 2008 Howard Hinnant] + [copyright 2009-2012 Vicente J. Botet Escriba] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[/===============] +[section Overview] +[/===============] + +The motivation for `declval` was introduced in [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2958.html#Value N2958: +Moving Swap Forward]. Here follows a rewording of this chapter. + +With the provision of decltype, late-specified return types, and default template-arguments for function templates a +new generation of SFINAE patterns will emerge to at least partially compensate the lack of concepts on the C++0x timescale. +Using this technique, it is sometimes necessary to obtain an object of a known type in a non-using context, e.g. given the declaration + + template + T&& declval(); // not used + +as part of the function template declaration + + template + decltype(static_cast(declval())) convert(From&&); + +or as part of a class template definition + + template class result_of; + + template + struct result_of + { + typedef decltype(declval()(declval()...)) type; + }; + +The role of the function template declval() is a transformation of a type T into a value without using or evaluating this function. +The name is supposed to direct the reader's attention to the fact that the expression `declval()` is an lvalue if and only if +T is an lvalue-reference, otherwise an rvalue. To extend the domain of this function we can do a bit better by changing its declaration to + + template + typename std::add_rvalue_reference::type declval(); // not used + +which ensures that we can also use cv void as template parameter. The careful reader might have noticed that `declval()` +already exists under the name create() as part of the definition of the semantics of the type trait is_convertible in the C++0x standard. + +The provision of a new library component that allows the production of values in unevaluated expressions is considered +important to realize constrained templates in C++0x where concepts are not available. +This extremely light-weight function is expected to be part of the daily tool-box of the C++0x programmer. + +[endsect] + + +[/=================] +[section:reference Reference ] +[/=================] + +`#include ` + + namespace boost { + + template + typename add_rvalue_reference::type declval() noexcept; // as unevaluated operand + + } // namespace boost + + +The library provides the function template declval to simplify the definition of expressions which occur as unevaluated operands. + + template + typename add_rvalue_reference::type declval(); + +[*Remarks:] If this function is used, the program is ill-formed. + +[*Remarks:] The template parameter T of declval may be an incomplete type. + +[*Example:] + + template + decltype(static_cast(declval())) convert(From&&); + +Declares a function template convert which only participates in overloading if the type From can be explicitly converted to type To. + +[endsect] + +[/===============] +[section History] +[/===============] + +[heading boost 1.50] + +Fixes: + +* [@http://svn.boost.org/trac/boost/ticket/6570 #6570] Adding noexcept to boost::declval. + +[endsect] + + + + diff --git a/tools/boost_1_65_1/libs/utility/doc/html/base_from_member.html b/tools/boost_1_65_1/libs/utility/doc/html/base_from_member.html new file mode 100644 index 0000000000000000000000000000000000000000..63f5f5589182abefba1bccdcef1aed83996d2d5b --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/base_from_member.html @@ -0,0 +1,437 @@ + + + +Base_From_Member + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+
+
+
+

+Base_From_Member

+

+Daryle Walker +

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+
+
+
+

Table of Contents

+
+
Rationale
+
Synopsis
+
Usage
+
Example
+
Acknowledgments
+
+
+
+ +

+ When developing a class, sometimes a base class needs to be initialized with + a member of the current class. As a naïve example: +

+
#include <streambuf>  /* for std::streambuf */
+#include <ostream>    /* for std::ostream */
+
+class fdoutbuf
+  : public std::streambuf
+{
+public:
+    explicit fdoutbuf( int fd );
+    //...
+};
+
+class fdostream
+  : public std::ostream
+{
+protected:
+    fdoutbuf buf;
+public:
+    explicit fdostream( int fd )
+      : buf( fd ), std::ostream( &buf ) {}
+    //...
+};
+
+

+ This is undefined because C++'s initialization order mandates that the base + class is initialized before the member it uses. R. + Samuel Klatchko developed a way around this by using the initialization + order in his favor. Base classes are intialized in order of declaration, so + moving the desired member to another base class, that is initialized before + the desired base class, can ensure proper initialization. +

+

+ A custom base class can be made for this idiom: +

+
#include <streambuf>  /* for std::streambuf */
+#include <ostream>    /* for std::ostream */
+
+class fdoutbuf
+  : public std::streambuf
+{
+public:
+    explicit fdoutbuf( int fd );
+    //...
+};
+
+struct fdostream_pbase
+{
+    fdoutbuf sbuffer;
+
+    explicit fdostream_pbase( int fd )
+      : sbuffer( fd ) {}
+};
+
+class fdostream
+  : private fdostream_pbase
+  , public std::ostream
+{
+    typedef fdostream_pbase  pbase_type;
+    typedef std::ostream     base_type;
+
+public:
+    explicit fdostream( int fd )
+      : pbase_type( fd ), base_type( &sbuffer ) {}
+    //...
+};
+
+

+ Other projects can use similar custom base classes. The technique is basic + enough to make a template, with a sample template class in this library. The + main template parameter is the type of the enclosed member. The template class + has several (explicit) constructor member templates, which implicitly type + the constructor arguments and pass them to the member. The template class uses + implicit copy construction and assignment, cancelling them if the enclosed + member is non-copyable. +

+

+ Manually coding a base class may be better if the construction and/or copying + needs are too complex for the supplied template class, or if the compiler is + not advanced enough to use it. +

+

+ Since base classes are unnamed, a class cannot have multiple (direct) base + classes of the same type. The supplied template class has an extra template + parameter, an integer, that exists solely to provide type differentiation. + This parameter has a default value so a single use of a particular member type + does not need to concern itself with the integer. +

+
+
+ +
#include <type_traits>  /* exposition only */
+
+#ifndef BOOST_BASE_FROM_MEMBER_MAX_ARITY
+#define BOOST_BASE_FROM_MEMBER_MAX_ARITY  10
+#endif
+
+template < typename MemberType, int UniqueID = 0 >
+class boost::base_from_member
+{
+protected:
+    MemberType  member;
+
+#if C++11 is in use
+    template< typename ...T >
+    explicit constexpr   base_from_member( T&& ...x )
+     noexcept( std::is_nothrow_constructible<MemberType, T...>::value );
+#else
+    base_from_member();
+
+    template< typename T1 >
+    explicit  base_from_member( T1 x1 );
+
+    template< typename T1, typename T2 >
+    base_from_member( T1 x1, T2 x2 );
+
+    //...
+
+    template< typename T1, typename T2, typename T3, typename T4,
+     typename T5, typename T6, typename T7, typename T8, typename T9,
+     typename T10 >
+    base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7,
+     T8 x8, T9 x9, T10 x10 );
+#endif
+};
+
+template < typename MemberType, int UniqueID >
+class base_from_member<MemberType&, UniqueID>
+{
+protected:
+    MemberType& member;
+
+    explicit constexpr base_from_member( MemberType& x )
+        noexcept;
+};
+
+

+ The class template has a first template parameter MemberType + representing the type of the based-member. It has a last template parameter + UniqueID, that is an int, to differentiate between multiple base + classes that use the same based-member type. The last template parameter has + a default value of zero if it is omitted. The class template has a protected + data member called member that + the derived class can use for later base classes (or itself). +

+

+ If the appropriate features of C++11 are present, there will be a single constructor + template. It implements perfect forwarding to the best + constructor call of member + (if any). The constructor template is marked both constexpr + and explicit. The former will + be ignored if the corresponding inner constructor call (of member) + does not have the marker. The latter binds the other way; always taking effect, + even when the inner constructor call does not have the marker. The constructor + template propagates the noexcept + status of the inner constructor call. (The constructor template has a trailing + parameter with a default value that disables the template when its signature + is too close to the signatures of the automatically-defined non-template copy- + and/or move-constructors of base_from_member.) +

+

+ On earlier-standard compilers, there is a default constructor and several constructor + member templates. These constructor templates can take as many arguments (currently + up to ten) as possible and pass them to a constructor of the data member. +

+

+ A specialization for member references offers a single constructor taking a + MemberType&, + which is the only way to initialize a reference. +

+

+ Since C++ does not allow any way to explicitly state the template parameters + of a templated constructor, make sure that the arguments are already close + as possible to the actual type used in the data member's desired constructor. + Explicit conversions may be necessary. +

+

+ The BOOST_BASE_FROM_MEMBER_MAX_ARITY + macro constant specifies the maximum argument length for the constructor templates. + The constant may be overridden if more (or less) argument configurations are + needed. The constant may be read for code that is expandable like the class + template and needs to maintain the same maximum size. (Example code would be + a class that uses this class template as a base class for a member with a flexible + set of constructors.) This constant is ignored when C++11 features are present. +

+
+
+

+Usage +

+

+ With the starting example, the fdoutbuf + sub-object needs to be encapsulated in a base class that is inheirited before + std::ostream. +

+
#include <boost/utility/base_from_member.hpp>
+
+#include <streambuf>  // for std::streambuf
+#include <ostream>    // for std::ostream
+
+class fdoutbuf
+  : public std::streambuf
+{
+public:
+    explicit fdoutbuf( int fd );
+    //...
+};
+
+class fdostream
+  : private boost::base_from_member<fdoutbuf>
+  , public std::ostream
+{
+    // Helper typedef's
+    typedef boost::base_from_member<fdoutbuf>  pbase_type;
+    typedef std::ostream                        base_type;
+
+public:
+    explicit fdostream( int fd )
+      : pbase_type( fd ), base_type( &member ){}
+    //...
+};
+
+

+ The base-from-member idiom is an implementation detail, so it should not be + visible to the clients (or any derived classes) of fdostream. + Due to the initialization order, the fdoutbuf + sub-object will get initialized before the std::ostream + sub-object does, making the former sub-object safe to use in the latter sub-object's + construction. Since the fdoutbuf + sub-object of the final type is the only sub-object with the name member that name can be used unqualified + within the final class. +

+
+
+ +

+ The base-from-member class templates should commonly involve only one base-from-member + sub-object, usually for attaching a stream-buffer to an I/O stream. The next + example demonstrates how to use multiple base-from-member sub-objects and the + resulting qualification issues. +

+
#include <boost/utility/base_from_member.hpp>
+
+#include <cstddef>  /* for NULL */
+
+struct an_int
+{
+    int  y;
+
+    an_int( float yf );
+};
+
+class switcher
+{
+public:
+    switcher();
+    switcher( double, int * );
+    //...
+};
+
+class flow_regulator
+{
+public:
+    flow_regulator( switcher &, switcher & );
+    //...
+};
+
+template < unsigned Size >
+class fan
+{
+public:
+    explicit fan( switcher );
+    //...
+};
+
+class system
+  : private boost::base_from_member<an_int>
+  , private boost::base_from_member<switcher>
+  , private boost::base_from_member<switcher, 1>
+  , private boost::base_from_member<switcher, 2>
+  , protected flow_regulator
+  , public fan<6>
+{
+    // Helper typedef's
+    typedef boost::base_from_member<an_int>       pbase0_type;
+    typedef boost::base_from_member<switcher>     pbase1_type;
+    typedef boost::base_from_member<switcher, 1>  pbase2_type;
+    typedef boost::base_from_member<switcher, 2>  pbase3_type;
+
+    typedef flow_regulator  base1_type;
+    typedef fan<6>          base2_type;
+
+public:
+    system( double x );
+    //...
+};
+
+system::system( double x )
+  : pbase0_type( 0.2 )
+  , pbase1_type()
+  , pbase2_type( -16, &this->pbase0_type::member.y )
+  , pbase3_type( x, static_cast<int *>(NULL) )
+  , base1_type( pbase3_type::member, pbase1_type::member )
+  , base2_type( pbase2_type::member )
+{
+    //...
+}
+
+

+ The final class has multiple sub-objects with the name member, + so any use of that name needs qualification by a name of the appropriate base + type. (Using typedefs ease mentioning + the base types.) However, the fix introduces a new problem when a pointer is + needed. Using the address operator with a sub-object qualified with its class's + name results in a pointer-to-member (here, having a type of an_int + boost::base_from_member< + an_int, + 0> :: *) instead + of a pointer to the member (having a type of an_int + *). The new problem is fixed by qualifying + the sub-object with this-> + and is needed just for pointers, and not for references or values. +

+

+ There are some argument conversions in the initialization. The constructor + argument for pbase0_type is + converted from double to float. The first constructor argument for pbase2_type is converted from int to double. + The second constructor argument for pbase3_type + is a special case of necessary conversion; all forms of the null-pointer literal + in C++ (except nullptr from C++11) + also look like compile-time integral expressions, so C++ always interprets + such code as an integer when it has overloads that can take either an integer + or a pointer. The last conversion is necessary for the compiler to call a constructor + form with the exact pointer type used in switcher's + constructor. (If C++11's nullptr + is used, it still needs a conversion if multiple pointer types can be accepted + in a constructor call but std::nullptr_t + cannot.) +

+
+
+ +
+
+
+ + + +

Last revised: September 02, 2017 at 10:10:54 GMT

+
+
+ + diff --git a/tools/boost_1_65_1/libs/utility/doc/html/compressed_pair.html b/tools/boost_1_65_1/libs/utility/doc/html/compressed_pair.html new file mode 100644 index 0000000000000000000000000000000000000000..d926c7aa7bd7139396c0423cff01d1390a9ac537 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/compressed_pair.html @@ -0,0 +1,155 @@ + + + +Compressed_Pair + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+
+
+
+

+Compressed_Pair

+
+

+Steve Cleary +

+

+Beman Dawes +

+

+Howard Hinnant +

+

+John Maddock +

+
+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+
+
+
+

Table of Contents

+
+
Overview
+
Synopsis
+
Acknowledgments
+
+
+
+ +

+ All of the contents of <boost/compressed_pair.hpp> + are defined inside namespace boost. +

+

+ The class compressed_pair is + very similar to std::pair, but if either of the template arguments + are empty classes, then the empty base-class optimisation + is applied to compress the size of the pair. +

+
+
+ +
template <class T1, class T2>
+class compressed_pair
+{
+public:
+    typedef T1                                                 first_type;
+    typedef T2                                                 second_type;
+    typedef typename call_traits<first_type>::param_type       first_param_type;
+    typedef typename call_traits<second_type>::param_type      second_param_type;
+    typedef typename call_traits<first_type>::reference        first_reference;
+    typedef typename call_traits<second_type>::reference       second_reference;
+    typedef typename call_traits<first_type>::const_reference  first_const_reference;
+    typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+             compressed_pair() : base() {}
+             compressed_pair(first_param_type x, second_param_type y);
+    explicit compressed_pair(first_param_type x);
+    explicit compressed_pair(second_param_type y);
+
+    compressed_pair& operator=(const compressed_pair&);
+
+    first_reference       first();
+    first_const_reference first() const;
+
+    second_reference       second();
+    second_const_reference second() const;
+
+    void swap(compressed_pair& y);
+};
+
+

+ The two members of the pair can be accessed using the member functions first() and + second(). + Note that not all member functions can be instantiated for all template parameter + types. In particular compressed_pair + can be instantiated for reference and array types, however in these cases the + range of constructors that can be used are limited. If types T1 and T2 + are the same type, then there is only one version of the single-argument constructor, + and this constructor initialises both values in the pair to the passed value. +

+

+ Note that if either member is a POD type, then that member is not zero-initialized + by the compressed_pair default + constructor: it's up to you to supply an initial value for these types if you + want them to have a default value. +

+

+ Note that compressed_pair can + not be instantiated if either of the template arguments is a union type, unless + there is compiler support for boost::is_union, + or if boost::is_union is specialised for the union type. +

+

+ Finally, a word of caution for Visual C++ 6 users: if either argument is an + empty type, then assigning to that member will produce memory corruption, unless + the empty type has a "do nothing" assignment operator defined. This + is due to a bug in the way VC6 generates implicit assignment operators. +

+
+
+ +

+ Based on contributions by Steve Cleary, Beman Dawes, Howard Hinnant and John + Maddock. +

+

+ Maintained by John Maddock. +

+
+
+ + + +

Last revised: September 02, 2017 at 10:10:56 GMT

+
+
+ + diff --git a/tools/boost_1_65_1/libs/utility/doc/html/declval.html b/tools/boost_1_65_1/libs/utility/doc/html/declval.html new file mode 100644 index 0000000000000000000000000000000000000000..8b67ee23db9dfe58a6faf1ba28e8e54c8ee8ab0a --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/declval.html @@ -0,0 +1,178 @@ + + + +Declval + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+
+
+
+

+Declval

+
+

+Howard Hinnant +

+

+Vicente J. Botet Escriba +

+
+
+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+
+
+
+

Table of Contents

+
+
Overview
+
Reference
+
History
+
+
+
+ +

+ The motivation for declval + was introduced in N2958: + Moving Swap Forward. Here follows a rewording of this chapter. +

+

+ With the provision of decltype, late-specified return types, and default template-arguments + for function templates a new generation of SFINAE patterns will emerge to at + least partially compensate the lack of concepts on the C++0x timescale. Using + this technique, it is sometimes necessary to obtain an object of a known type + in a non-using context, e.g. given the declaration +

+
template<class T>
+T&& declval(); // not used
+
+

+ as part of the function template declaration +

+
template<class To, class From>
+decltype(static_cast<To>(declval<From>())) convert(From&&);
+
+

+ or as part of a class template definition +

+
template<class> class result_of;
+
+template<class Fn, class... ArgTypes>
+struct result_of<Fn(ArgTypes...)>
+{
+  typedef decltype(declval<Fn>()(declval<ArgTypes>()...)) type;
+};
+
+

+ The role of the function template declval() is a transformation of a type T + into a value without using or evaluating this function. The name is supposed + to direct the reader's attention to the fact that the expression declval<T>() is + an lvalue if and only if T is an lvalue-reference, otherwise an rvalue. To + extend the domain of this function we can do a bit better by changing its declaration + to +

+
template<class T>
+typename std::add_rvalue_reference<T>::type declval(); // not used
+
+

+ which ensures that we can also use cv void as template parameter. The careful + reader might have noticed that declval() already exists under the name create() as + part of the definition of the semantics of the type trait is_convertible in + the C++0x standard. +

+

+ The provision of a new library component that allows the production of values + in unevaluated expressions is considered important to realize constrained templates + in C++0x where concepts are not available. This extremely light-weight function + is expected to be part of the daily tool-box of the C++0x programmer. +

+
+
+ +

+ #include <boost/utility/declval.hpp> +

+
namespace boost {
+
+    template <typename T>
+    typename add_rvalue_reference<T>::type declval() noexcept; // as unevaluated operand
+
+}  // namespace boost
+
+

+ The library provides the function template declval to simplify the definition + of expressions which occur as unevaluated operands. +

+
template <typename T>
+typename add_rvalue_reference<T>::type declval();
+
+

+ Remarks: If this function is used, the program + is ill-formed. +

+

+ Remarks: The template parameter T of declval + may be an incomplete type. +

+

+ Example: +

+
template <class To, class From>
+decltype(static_cast<To>(declval<From>())) convert(From&&);
+
+

+ Declares a function template convert which only participates in overloading + if the type From can be explicitly converted to type To. +

+
+
+ +

+ + boost + 1.50 +

+

+ Fixes: +

+
  • + #6570 + Adding noexcept to boost::declval. +
+
+
+ + + +

Last revised: September 02, 2017 at 10:10:57 GMT

+
+
+ + diff --git a/tools/boost_1_65_1/libs/utility/doc/html/standalone_base_from_member_HTML.manifest b/tools/boost_1_65_1/libs/utility/doc/html/standalone_base_from_member_HTML.manifest new file mode 100644 index 0000000000000000000000000000000000000000..dec55fa6e2ca9723dbd99d121b3e7107450043df --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/standalone_base_from_member_HTML.manifest @@ -0,0 +1 @@ +base_from_member.html diff --git a/tools/boost_1_65_1/libs/utility/doc/html/standalone_compressed_pair_HTML.manifest b/tools/boost_1_65_1/libs/utility/doc/html/standalone_compressed_pair_HTML.manifest new file mode 100644 index 0000000000000000000000000000000000000000..213fbdbd392b3ff4e0c9736192e548819a24f582 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/standalone_compressed_pair_HTML.manifest @@ -0,0 +1 @@ +compressed_pair.html diff --git a/tools/boost_1_65_1/libs/utility/doc/html/standalone_declval_HTML.manifest b/tools/boost_1_65_1/libs/utility/doc/html/standalone_declval_HTML.manifest new file mode 100644 index 0000000000000000000000000000000000000000..f76a68592e5b948d1311f713fe98d8b3014f618f --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/standalone_declval_HTML.manifest @@ -0,0 +1 @@ +declval.html diff --git a/tools/boost_1_65_1/libs/utility/doc/html/standalone_string_ref_HTML.manifest b/tools/boost_1_65_1/libs/utility/doc/html/standalone_string_ref_HTML.manifest new file mode 100644 index 0000000000000000000000000000000000000000..2c3d54be43aec65bc85d96bb7c454b1246bbe9c7 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/standalone_string_ref_HTML.manifest @@ -0,0 +1 @@ +string_ref.html diff --git a/tools/boost_1_65_1/libs/utility/doc/html/string_ref.html b/tools/boost_1_65_1/libs/utility/doc/html/string_ref.html new file mode 100644 index 0000000000000000000000000000000000000000..bb717f6838a0d75129af25c8c0b6c4177d80e956 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/html/string_ref.html @@ -0,0 +1,280 @@ + + + +String_Ref + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+
+
+
+

+String_Ref

+

+Marshall Clow +

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+
+
+
+

Table of Contents

+
+
Overview
+
Examples
+
Reference
+
History
+
+
+
+ +

+ Boost.StringRef is an implementation of Jeffrey Yaskin's N3442: + string_ref: a non-owning reference to a string. +

+

+ When you are parsing/processing strings from some external source, frequently + you want to pass a piece of text to a procedure for specialized processing. + The canonical way to do this is as a std::string, + but that has certain drawbacks: +

+

+ 1) If you are processing a buffer of text (say a HTTP response or the contents + of a file), then you have to create the string from the text you want to pass, + which involves memory allocation and copying of data. +

+

+ 2) if a routine receives a constant std::string + and wants to pass a portion of that string to another routine, then it must + create a new string of that substring. +

+

+ 3) A routine receives a constant std::string + and wants to return a portion of the string, then it must create a new string + to return. +

+

+ string_ref is designed to solve + these efficiency problems. A string_ref + is a read-only reference to a contiguous sequence of characters, and provides + much of the functionality of std::string. + A string_ref is cheap to create, + copy and pass by value, because it does not actually own the storage that it + points to. +

+

+ A string_ref is implemented + as a small struct that contains a pointer to the start of the character data + and a count. A string_ref is + cheap to create and cheap to copy. +

+

+ string_ref acts as a container; + it includes all the methods that you would expect in a container, including + iteration support, operator [], + at and size. + It can be used with any of the iterator-based algorithms in the STL - as long + as you don't need to change the underlying data (sort + and remove, for example, will + not work) +

+

+ Besides generic container functionality, string_ref + provides a subset of the interface of std::string. + This makes it easy to replace parameters of type const + std::string & + with boost::string_ref. Like std::string, + string_ref has a static member + variable named npos to denote + the result of failed searches, and to mean "the end". +

+

+ Because a string_ref does not + own the data that it "points to", it introduces lifetime issues into + code that uses it. The programmer must ensure that the data that a string_ref refers to exists as long as the + string_ref does. +

+
+
+ +

+ Integrating string_ref into + your code is fairly simple. Wherever you pass a const + std::string & + or std::string as a parameter, that's a candidate + for passing a boost::string_ref. +

+
std::string extract_part ( const std::string &bar ) {
+    return bar.substr ( 2, 3 );
+    }
+
+if ( extract_part ( "ABCDEFG" ).front() == 'C' ) { /* do something */ }
+
+

+ Let's figure out what happens in this (contrived) example. +

+

+ First, a temporary string is created from the string literal "ABCDEFG", and it is passed (by reference) + to the routine extract_part. + Then a second string is created in the call std::string::substr + and returned to extract_part + (this copy may be elided by RVO). Then extract_part + returns that string back to the caller (again this copy may be elided). The + first temporary string is deallocated, and front + is called on the second string, and then it is deallocated as well. +

+

+ Two std::strings are created, and two copy operations. + That's (potentially) four memory allocations and deallocations, and the associated + copying of data. +

+

+ Now let's look at the same code with string_ref: +

+
boost::string_ref extract_part ( boost::string_ref bar ) {
+    return bar.substr ( 2, 3 );
+    }
+
+if ( extract_part ( "ABCDEFG" ).front() == "C" ) { /* do something */ }
+
+

+ No memory allocations. No copying of character data. No changes to the code + other than the types. There are two string_refs + created, and two string_refs + copied, but those are cheap operations. +

+
+
+ +

+ The header file "string_ref.hpp" defines a template boost::basic_string_ref, + and four specializations - for char + / wchar_t / char16_t + / char32_t . +

+

+ #include <boost/utility/string_ref.hpp> +

+

+ Construction and copying: +

+
BOOST_CONSTEXPR basic_string_ref ();    // Constructs an empty string_ref
+BOOST_CONSTEXPR basic_string_ref(const charT* str); // Constructs from a NULL-terminated string
+BOOST_CONSTEXPR basic_string_ref(const charT* str, size_type len); // Constructs from a pointer, length pair
+template<typename Allocator>
+basic_string_ref(const std::basic_string<charT, traits, Allocator>& str); // Constructs from a std::string
+basic_string_ref (const basic_string_ref &rhs);
+basic_string_ref& operator=(const basic_string_ref &rhs);
+
+

+ string_ref does not define + a move constructor nor a move-assignment operator because copying a string_ref is just a cheap as moving one. +

+

+ Basic container-like functions: +

+
BOOST_CONSTEXPR size_type size()     const ;
+BOOST_CONSTEXPR size_type length()   const ;
+BOOST_CONSTEXPR size_type max_size() const ;
+BOOST_CONSTEXPR bool empty()         const ;
+
+// All iterators are const_iterators
+BOOST_CONSTEXPR const_iterator  begin() const ;
+BOOST_CONSTEXPR const_iterator cbegin() const ;
+BOOST_CONSTEXPR const_iterator    end() const ;
+BOOST_CONSTEXPR const_iterator   cend() const ;
+const_reverse_iterator         rbegin() const ;
+const_reverse_iterator        crbegin() const ;
+const_reverse_iterator           rend() const ;
+const_reverse_iterator          crend() const ;
+
+

+ Access to the individual elements (all of which are const): +

+
BOOST_CONSTEXPR const charT& operator[](size_type pos) const ;
+const charT& at(size_t pos) const ;
+BOOST_CONSTEXPR const charT& front() const ;
+BOOST_CONSTEXPR const charT& back()  const ;
+BOOST_CONSTEXPR const charT* data()  const ;
+
+

+ Modifying the string_ref (but + not the underlying data): +

+
void clear();
+void remove_prefix(size_type n);
+void remove_suffix(size_type n);
+
+

+ Searching: +

+
size_type find(basic_string_ref s) const ;
+size_type find(charT c) const ;
+size_type rfind(basic_string_ref s) const ;
+size_type rfind(charT c) const ;
+size_type find_first_of(charT c) const ;
+size_type find_last_of (charT c) const ;
+
+size_type find_first_of(basic_string_ref s) const ;
+size_type find_last_of(basic_string_ref s) const ;
+size_type find_first_not_of(basic_string_ref s) const ;
+size_type find_first_not_of(charT c) const ;
+size_type find_last_not_of(basic_string_ref s) const ;
+size_type find_last_not_of(charT c) const ;
+
+

+ String-like operations: +

+
BOOST_CONSTEXPR basic_string_ref substr(size_type pos, size_type n=npos) const ; // Creates a new string_ref
+bool starts_with(charT c) const ;
+bool starts_with(basic_string_ref x) const ;
+bool ends_with(charT c) const ;
+bool ends_with(basic_string_ref x) const ;
+
+
+
+ +

+ + boost + 1.53 +

+
  • + Introduced +
+
+
+ + + +

Last revised: September 02, 2017 at 10:10:58 GMT

+
+
+ + diff --git a/tools/boost_1_65_1/libs/utility/doc/string_ref.qbk b/tools/boost_1_65_1/libs/utility/doc/string_ref.qbk new file mode 100644 index 0000000000000000000000000000000000000000..4c6fc79212b869fa15d07915a2d94b54a17efdd4 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/doc/string_ref.qbk @@ -0,0 +1,167 @@ +[/ + / Copyright (c) 2012 Marshall Clow + / + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /] + +[article String_Ref + [quickbook 1.5] + [authors [Clow, Marshall]] + [copyright 2012 Marshall Clow] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[/===============] +[section Overview] +[/===============] + +Boost.StringRef is an implementation of Jeffrey Yaskin's [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html N3442: +string_ref: a non-owning reference to a string]. + +When you are parsing/processing strings from some external source, frequently you want to pass a piece of text to a procedure for specialized processing. The canonical way to do this is as a `std::string`, but that has certain drawbacks: + +1) If you are processing a buffer of text (say a HTTP response or the contents of a file), then you have to create the string from the text you want to pass, which involves memory allocation and copying of data. + +2) if a routine receives a constant `std::string` and wants to pass a portion of that string to another routine, then it must create a new string of that substring. + +3) A routine receives a constant `std::string` and wants to return a portion of the string, then it must create a new string to return. + +`string_ref` is designed to solve these efficiency problems. A `string_ref` is a read-only reference to a contiguous sequence of characters, and provides much of the functionality of `std::string`. A `string_ref` is cheap to create, copy and pass by value, because it does not actually own the storage that it points to. + +A `string_ref` is implemented as a small struct that contains a pointer to the start of the character data and a count. A `string_ref` is cheap to create and cheap to copy. + +`string_ref` acts as a container; it includes all the methods that you would expect in a container, including iteration support, `operator []`, `at` and `size`. It can be used with any of the iterator-based algorithms in the STL - as long as you don't need to change the underlying data (`sort` and `remove`, for example, will not work) + +Besides generic container functionality, `string_ref` provides a subset of the interface of `std::string`. This makes it easy to replace parameters of type `const std::string &` with `boost::string_ref`. Like `std::string`, `string_ref` has a static member variable named `npos` to denote the result of failed searches, and to mean "the end". + +Because a `string_ref` does not own the data that it "points to", it introduces lifetime issues into code that uses it. The programmer must ensure that the data that a `string_ref` refers to exists as long as the `string_ref` does. + +[endsect] + + +[/===============] +[section Examples] +[/===============] + +Integrating `string_ref` into your code is fairly simple. Wherever you pass a `const std::string &` or `std::string` as a parameter, that's a candidate for passing a `boost::string_ref`. + + std::string extract_part ( const std::string &bar ) { + return bar.substr ( 2, 3 ); + } + + if ( extract_part ( "ABCDEFG" ).front() == 'C' ) { /* do something */ } + +Let's figure out what happens in this (contrived) example. + +First, a temporary string is created from the string literal `"ABCDEFG"`, and it is passed (by reference) to the routine `extract_part`. Then a second string is created in the call `std::string::substr` and returned to `extract_part` (this copy may be elided by RVO). Then `extract_part` returns that string back to the caller (again this copy may be elided). The first temporary string is deallocated, and `front` is called on the second string, and then it is deallocated as well. + +Two `std::string`s are created, and two copy operations. That's (potentially) four memory allocations and deallocations, and the associated copying of data. + +Now let's look at the same code with `string_ref`: + + boost::string_ref extract_part ( boost::string_ref bar ) { + return bar.substr ( 2, 3 ); + } + + if ( extract_part ( "ABCDEFG" ).front() == "C" ) { /* do something */ } + +No memory allocations. No copying of character data. No changes to the code other than the types. There are two `string_ref`s created, and two `string_ref`s copied, but those are cheap operations. + +[endsect] + + +[/=================] +[section:reference Reference ] +[/=================] + +The header file "string_ref.hpp" defines a template `boost::basic_string_ref`, and four specializations - for `char` / `wchar_t` / `char16_t` / `char32_t` . + +`#include ` + +Construction and copying: + + BOOST_CONSTEXPR basic_string_ref (); // Constructs an empty string_ref + BOOST_CONSTEXPR basic_string_ref(const charT* str); // Constructs from a NULL-terminated string + BOOST_CONSTEXPR basic_string_ref(const charT* str, size_type len); // Constructs from a pointer, length pair + template + basic_string_ref(const std::basic_string& str); // Constructs from a std::string + basic_string_ref (const basic_string_ref &rhs); + basic_string_ref& operator=(const basic_string_ref &rhs); + +`string_ref` does not define a move constructor nor a move-assignment operator because copying a `string_ref` is just a cheap as moving one. + +Basic container-like functions: + + BOOST_CONSTEXPR size_type size() const ; + BOOST_CONSTEXPR size_type length() const ; + BOOST_CONSTEXPR size_type max_size() const ; + BOOST_CONSTEXPR bool empty() const ; + + // All iterators are const_iterators + BOOST_CONSTEXPR const_iterator begin() const ; + BOOST_CONSTEXPR const_iterator cbegin() const ; + BOOST_CONSTEXPR const_iterator end() const ; + BOOST_CONSTEXPR const_iterator cend() const ; + const_reverse_iterator rbegin() const ; + const_reverse_iterator crbegin() const ; + const_reverse_iterator rend() const ; + const_reverse_iterator crend() const ; + +Access to the individual elements (all of which are const): + + BOOST_CONSTEXPR const charT& operator[](size_type pos) const ; + const charT& at(size_t pos) const ; + BOOST_CONSTEXPR const charT& front() const ; + BOOST_CONSTEXPR const charT& back() const ; + BOOST_CONSTEXPR const charT* data() const ; + +Modifying the `string_ref` (but not the underlying data): + + void clear(); + void remove_prefix(size_type n); + void remove_suffix(size_type n); + +Searching: + + size_type find(basic_string_ref s) const ; + size_type find(charT c) const ; + size_type rfind(basic_string_ref s) const ; + size_type rfind(charT c) const ; + size_type find_first_of(charT c) const ; + size_type find_last_of (charT c) const ; + + size_type find_first_of(basic_string_ref s) const ; + size_type find_last_of(basic_string_ref s) const ; + size_type find_first_not_of(basic_string_ref s) const ; + size_type find_first_not_of(charT c) const ; + size_type find_last_not_of(basic_string_ref s) const ; + size_type find_last_not_of(charT c) const ; + +String-like operations: + + BOOST_CONSTEXPR basic_string_ref substr(size_type pos, size_type n=npos) const ; // Creates a new string_ref + bool starts_with(charT c) const ; + bool starts_with(basic_string_ref x) const ; + bool ends_with(charT c) const ; + bool ends_with(basic_string_ref x) const ; + +[endsect] + +[/===============] +[section History] +[/===============] + +[heading boost 1.53] +* Introduced + + +[endsect] + + + + diff --git a/tools/boost_1_65_1/libs/utility/enable_if.html b/tools/boost_1_65_1/libs/utility/enable_if.html new file mode 100644 index 0000000000000000000000000000000000000000..0cd1a985aeaf2a15ef942ffaf957753ceffd2710 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/enable_if.html @@ -0,0 +1,15 @@ + + + + +Automatic redirection + + +Automatic redirection failed, please go to +enable_if.html
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/generator_iterator.htm b/tools/boost_1_65_1/libs/utility/generator_iterator.htm new file mode 100644 index 0000000000000000000000000000000000000000..b0e376ebe85356e002bd2caa5b68080574d224b5 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/generator_iterator.htm @@ -0,0 +1,163 @@ + + + + + + + + Generator Iterator Adaptor Documentation + + + + boost.png (6897 bytes) + +

Generator Iterator Adaptor

+ +

Defined in header boost/generator_iterator.hpp

+ +

The generator iterator adaptor makes it easier to create custom input + iterators from 0-ary functions and function objects. The adaptor takes a + Generator and + creates a model of Input Iterator. Each + increment retrieves an item from the generator and makes it available to be + retrieved by dereferencing. The motivation for this iterator is that some + concepts can be more naturally expressed as a generator, while most STL + algorithms expect an iterator. An example is the Random Number library.

+ +

Synopsis

+ +
+
+namespace boost {
+  template <class Generator>
+  class generator_iterator_policies;
+
+  template <class Generator>
+  class generator_iterator_generator;
+
+  template <class Generator>
+  typename generator_iterator_generator<Generator>::type
+  make_generator_iterator(Generator & gen);
+}
+
+
+
+ +

The Generator Iterator Generator Class

+ +

The class generator_iterator_generator is a helper class whose purpose + is to construct a generator iterator type. The template parameter for this + class is the Generator function object type that is being wrapped. The + generator iterator adaptor only holds a reference (or pointer) to the + function object, therefore the function object must outlive the generator + iterator adaptor constructed from it.

+
+template <class Generator>
+class generator_iterator_generator
+{
+public:
+  typedef unspecified type; // the resulting generator iterator type 
+}
+
+ +

Template Parameters

+ + + + + + + + + + + + + +
ParameterDescription
GeneratorThe generator (0-ary function object) type being wrapped. The + return type of the function must be defined as + Generator::result_type. The function object must be a model of + Generator.
+ +

Concept Model

+ +

The generator iterator class is a model of Input Iterator.

+ +

Members

+ +

The generator iterator implements the member functions and operators + required of the Input Iterator + concept.

+
+ +

The + Generator Iterator Object Generator

+ +

The make_generator_iterator() function provides a convenient + way to create generator iterator objects. The function saves the user the + trouble of explicitly writing out the iterator types.

+ +
+
+template <class Generator>
+typename generator_iterator_generator<Generator>::type
+make_generator_iterator(Generator & gen);
+
+
+
+ +

Example

+ +

The following program shows how generator_iterator + transforms a generator into an input iterator.

+ +
+
+#include <iostream>
+#include <boost/generator_iterator.hpp>
+
+class my_generator
+{
+public:
+  typedef int result_type;
+  my_generator() : state(0) { }
+  int operator()() { return ++state; }
+private:
+  int state;
+};
+
+int main()
+{
+  my_generator gen;
+  boost::generator_iterator_generator<my_generator>::type it = boost::make_generator_iterator(gen);
+  for(int i = 0; i < 10; ++i, ++it)
+    std::cout << *it << std::endl;
+}
+
+
+
+ +

Valid HTML 4.01 Transitional

+ +

Revised + 05 December, 2006

+ +

Copyright © 2001 Jens Maurer

+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at http://www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/utility/identity_type/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..07ca29ec93a7c02a9c1b500a34f4175b7cd72edf --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/doc/Jamfile.v2 @@ -0,0 +1,44 @@ + +# Copyright (C) 2009-2012 Lorenzo Caminiti +# Distributed under the Boost Software License, Version 1.0 +# (see accompanying file LICENSE_1_0.txt or a copy at +# http://www.boost.org/LICENSE_1_0.txt) +# Home at http://www.boost.org/libs/utility/identity_type + +import quickbook ; +using boostbook ; + +doxygen reference : ../../../../boost/utility/identity_type.hpp + : "Reference" + PREDEFINED="DOXYGEN" + QUIET=YES + WARN_IF_UNDOCUMENTED=NO + HIDE_UNDOC_MEMBERS=YES + HIDE_UNDOC_CLASSES=YES + ALIASES=" Params=\"Parameters: \" Param{2}=\"\" EndParams=\"
\\1\\2
\" Returns=\"Returns:\" Note=\"Note:\" Warning=\"Warning:\" See=\"See:\" RefSect{2}=\"\\xmlonly\\2\\endxmlonly\" RefClass{1}=\"\\xmlonly\\1\\endxmlonly\" RefFunc{1}=\"\\xmlonly\\1\\endxmlonly\" RefMacro{1}=\"\\xmlonly\\1\\endxmlonly\" " + ; + +# This target must be called "index" so to generate "index.html" file. +xml index : identity_type.qbk : reference ; + +boostbook doc : index + : html + onehtml + toc.section.depth=0 + html.stylesheet=../../../../../doc/src/boostbook.css + boost.root=../../../../.. + ; + +# +# This is very imperfect - it results in both html and pdf docs being built, +# for some reason I can't get the "onehtml" format specified above to play nice +# with the usual incantations for mixed pdf/html builds. JM 06/2012. +# +boostbook pdf_doc : index + : + pdf + html:no + ; + +install pdf_doc_install : pdf_doc : . identity_type.pdf PDF ; +explicit pdf_doc_install ; diff --git a/tools/boost_1_65_1/libs/utility/identity_type/doc/html/index.html b/tools/boost_1_65_1/libs/utility/identity_type/doc/html/index.html new file mode 100644 index 0000000000000000000000000000000000000000..13869dbd8138c0677a4fdfd17e663bba1cfd2535 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/doc/html/index.html @@ -0,0 +1,252 @@ +Boost.Utility/IdentityType 1.0.0

Boost.Utility/IdentityType 1.0.0

Lorenzo Caminiti

+ Distributed under the Boost Software License, Version 1.0 (see accompanying + file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt) +

+ This library allows to wrap types within round parenthesis so they can always + be passed as macro parameters. +

+ Consider the following macro which declares a variable named varn + with the specified type (see also + var_error.cpp): +

+

#define VAR(type, n) type var ## n
+
+VAR(int, 1);                    // OK.
+VAR(std::map<int, char>, 2);    // Error.
+

+

+ The first macro invocation works correctly declaring a variable named var1 of type int. + However, the second macro invocation fails generating a preprocessor error + similar to the following: +

error: macro "VAR" passed 3 arguments, but takes just 2
+

+ That is because the std::map type passed as the first macro parameter + contains a comma , not wrapped + by round parenthesis (). The preprocessor + interprets that unwrapped comma as a separation between macro parameters concluding + that a total of three (and not two) parameters are passed to the macro in the + following order: +

  1. + std::map<int +
  2. + char> +
  3. + 2 +

+ Note that, differently from the compiler, the preprocessor only recognizes + round parenthesis (). Angular + <> and squared [] parenthesis are not recognized by the preprocessor + when parsing macro parameters. +

+ In some cases, it might be possible to workaround this issue by avoiding to + pass the type expression to the macro all together. For example, in the case + above a typedef could have been + used to specify the type expression with the commas outside the macro (see + also var.cpp): +

+

typedef std::map<int, char> map_type;
+VAR(map_type, 3); // OK.
+

+

+ When this is neither possible nor desired (e.g., see the function template + f in the section below), this + library header boost/utility/identity_type.hpp + defines a macro BOOST_IDENTITY_TYPE + which can be used to workaround the issue while keeping the type expression + as one of the macro parameters (see also var.cpp). +

+

#include <boost/utility/identity_type.hpp>
+
+VAR(BOOST_IDENTITY_TYPE((std::map<int, char>)), 4); // OK.
+

+

+ The BOOST_IDENTITY_TYPE macro + expands to an expression that evaluates (at compile-time) to the specified + type. The specified type is never split into multiple macro parameters because + it is always wrapped by a set of extra round parenthesis (). + In fact, a total of two sets of round parenthesis must be used: The parenthesis + to invoke the macro BOOST_IDENTITY_TYPE(...) plus the inner parenthesis to wrap the + type passed to the macro BOOST_IDENTITY_TYPE((...)). +

+ This macro works on any C++03 + compiler (and it does not use variadic + macros). [1] The authors originally developed and tested this library using + GNU Compiler Collection (GCC) C++ 4.5.3 (with and without C++11 features enabled + -std=c++0x) on Cygwin + and Miscrosoft Visual C++ (MSVC) 8.0 on Windows 7. See the library regressions + test results for more information on supported compilers and platforms. +

+ This macro must be prefixed by typename + when used within templates. For example, let's program a macro that declares + a function parameter named argn + with the specified type (see also + template.cpp): +

+

#define ARG(type, n) type arg ## n
+
+template<typename T>
+void f( // Prefix macro with `typename` in templates.
+    ARG(typename BOOST_IDENTITY_TYPE((std::map<int, T>)), 1)
+) {
+    std::cout << arg1[0] << std::endl;
+}
+

+

+

std::map<int, char> a;
+a[0] = 'a';
+
+f<char>(a); // OK...
+// f(a);    // ... but error.
+

+

+ However, note that the template parameter char + must be manually specified when invoking the function as in f<char>(a). In fact, + when the BOOST_IDENTITY_TYPE + macro is used to wrap a function template parameter, the template parameter + can no longer be automatically deduced by the compiler form the function call + as f(a) would + have done. [2] (This limitation does not apply to class templates because class + template parameters must always be explicitly specified.) In other words, without + using the BOOST_IDENTITY_TYPE + macro, C++ would normally be able to automatically deduce the function template + parameter as shown below: +

+

template<typename T>
+void g(
+    std::map<int, T> arg1
+) {
+    std::cout << arg1[0] << std::endl;
+}
+

+

+

g<char>(a); // OK...
+g(a);       // ... and also OK.
+

+

+ On some compilers (e.g., GCC), using this macro on abstract types (i.e., classes + with one or more pure virtual functions) generates a compiler error. This can + be avoided by manipulating the type adding and removing a reference to it. +

+ Let's program a macro that performs a static assertion on a Template + Meta-Programming (TMP) meta-function (similarly to Boost.MPL BOOST_MPL_ASSERT). The BOOST_IDENTITY_TYPE macro can be used + to pass a meta-function with multiple template parameters to the assert macro + (so to handle the commas separating the template parameters). In this case, + if the meta-function is an abstract type, it needs to be manipulated adding + and removing a reference to it (see also abstract.cpp): +

+

#define TMP_ASSERT(metafunction) \
+    BOOST_STATIC_ASSERT(metafunction::value)
+
+template<typename T, bool b>
+struct abstract {
+    static const bool value = b;
+    virtual void f(T const& x) = 0;     // Pure virtual function.
+};
+
+TMP_ASSERT(
+    boost::remove_reference<            // Add and remove
+        BOOST_IDENTITY_TYPE((           // reference for
+            boost::add_reference<       // abstract type.
+                abstract<int, true>
+            >::type
+        ))
+    >::type
+);
+

+

+ The BOOST_IDENTITY_TYPE macro + can be used either when calling a user-defined macro (as shown by the examples + so far), or internally when implementing a user-defined macro (as shown below). + When BOOST_IDENTITY_TYPE is + used in the implementation of the user-defined macro, the caller of the user + macro will have to specify the extra parenthesis (see also paren.cpp): +

+

#define TMP_ASSERT_PAREN(parenthesized_metafunction) \
+    /* use `BOOST_IDENTITY_TYPE` in macro definition instead of invocation */ \
+    BOOST_STATIC_ASSERT(BOOST_IDENTITY_TYPE(parenthesized_metafunction)::value)
+
+#define TMP_ASSERT(metafunction) \
+    BOOST_STATIC_ASSERT(metafunction::value)
+
+// Specify only extra parenthesis `((...))`.
+TMP_ASSERT_PAREN((boost::is_const<std::map<int, char> const>));
+
+// Specify both the extra parenthesis `((...))` and `BOOST_IDENTITY_TYPE` macro.
+TMP_ASSERT(BOOST_IDENTITY_TYPE((boost::is_const<std::map<int, char> const>)));
+

+

+ However, note that the caller will always have to specify + the extra parenthesis even when the macro parameters contain no comma: +

+

TMP_ASSERT_PAREN((boost::is_const<int const>)); // Always extra `((...))`.
+
+TMP_ASSERT(boost::is_const<int const>); // No extra `((...))` and no macro.
+

+

+ In some cases, using BOOST_IDENTITY_TYPE + in the implementation of the user-defined macro might provide the best syntax + for the caller. For example, this is the case for BOOST_MPL_ASSERT + because the majority of template meta-programming expressions contain unwrapped + commas so it is less confusing for the user to always specify the extra parenthesis + ((...)) instead of using BOOST_IDENTITY_TYPE: +

BOOST_MPL_ASSERT(( // Natural syntax.
+    boost::mpl::and_<
+          boost::is_const<T>
+        , boost::is_reference<T>
+    >
+));
+

+ However, in other situations it might be preferable to not require the extra + parenthesis in the common cases and handle commas as special cases using BOOST_IDENTITY_TYPE. For example, this + is the case for BOOST_LOCAL_FUNCTION for which always + requiring the extra parenthesis ((...)) + around the types would lead to an unnatural syntax for the local function signature: +

int BOOST_LOCAL_FUNCTION( ((int&)) x, ((int&)) y ) { // Unnatural syntax.
+    return x + y;
+} BOOST_LOCAL_FUNCTION_NAME(add)
+

+ Instead requiring the user to specify BOOST_IDENTITY_TYPE + only when needed allows for the more natural syntax BOOST_LOCAL_FUNCTION(int& + x, int& y) in the common cases when the parameter types + contain no comma (while still allowing to specify parameter types with commas + as special cases using BOOST_LOCAL_FUNCTION(BOOST_IDENTITY_TYPE((std::map<int, char>))& + x, int& y)). +

+ The implementation of this library macro is equivalent to the following: [3] +

#include <boost/type_traits/function_traits.hpp>
+
+#define BOOST_IDENTITY_TYPE(parenthesized_type) \
+    boost::function_traits<void parenthesized_type>::arg1_type
+

+ Essentially, the type is wrapped between round parenthesis (std::map<int, + char>) + so it can be passed as a single macro parameter even if it contains commas. + Then the parenthesized type is transformed into the type of a function returning + void and with the specified type + as the type of the first and only argument void + (std::map<int, char>). Finally, the type of the first argument + arg1_type is extracted at compile-time + using the function_traits meta-function + therefore obtaining the original type from the parenthesized type (effectively + stripping the extra parenthesis from around the specified type). +

Reference

Wrap type expressions with round parenthesis so they can be passed to macros even if they contain commas.

+
+BOOST_IDENTITY_TYPE(parenthesized_type)

Macro BOOST_IDENTITY_TYPE

BOOST_IDENTITY_TYPE — This macro allows to wrap the specified type expression within extra round parenthesis so the type can be passed as a single macro parameter even if it contains commas (not already wrapped within round parenthesis).

Synopsis

// In header: <boost/utility/identity_type.hpp>
+
+BOOST_IDENTITY_TYPE(parenthesized_type)

Description

Parameters:

parenthesized_typeThe type expression to be passed as macro parameter wrapped by a single set of round parenthesis (...). This type expression can contain an arbitrary number of commas.

+

This macro works on any C++03 compiler (it does not use variadic macros).

This macro must be prefixed by typename when used within templates. Note that the compiler will not be able to automatically determine function template parameters when they are wrapped with this macro (these parameters need to be explicitly specified when calling the function template).

On some compilers (like GCC), using this macro on abstract types requires to add and remove a reference to the specified type.



[1] + Using variadic macros, it would be possible to require a single set of extra + parenthesis BOOST_IDENTITY_TYPE(type) instead of two BOOST_IDENTITY_TYPE((type)) but variadic macros are not part of C++03 + (even if nowadays they are supported by most modern compilers and they are + also part of C++11). +

[2] + This is because the implementation of BOOST_IDENTITY_TYPE + wraps the specified type within a meta-function. +

[3] + There is absolutely no guarantee that the macro is actually implemented using + the code listed in this documentation. The listed code is for explanatory + purposes only. +

diff --git a/tools/boost_1_65_1/libs/utility/identity_type/doc/identity_type.qbk b/tools/boost_1_65_1/libs/utility/identity_type/doc/identity_type.qbk new file mode 100644 index 0000000000000000000000000000000000000000..1c97616e1b4df90060a02b413ed8b2f40c501cea --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/doc/identity_type.qbk @@ -0,0 +1,165 @@ + +[/ Copyright (C) 2009-2012 Lorenzo Caminiti ] +[/ Distributed under the Boost Software License, Version 1.0 ] +[/ (see accompanying file LICENSE_1_0.txt or a copy at ] +[/ http://www.boost.org/LICENSE_1_0.txt) ] +[/ Home at http://www.boost.org/libs/utility/identity_type ] + +[library Boost.Utility/IdentityType + [quickbook 1.5] + [version 1.0.0] + [copyright 2009-2012 Lorenzo Caminiti] + [purpose wraps types with round parenthesis] + [license + Distributed under the Boost Software License, Version 1.0 + (see accompanying file LICENSE_1_0.txt or a copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] + [authors [Caminiti lorcaminiti@gmail.com, Lorenzo]] + [category Utilities] +] + +This library allows to wrap types within round parenthesis so they can always be passed as macro parameters. + +[import ../test/var_error.cpp] +[import ../test/var.cpp] +[import ../test/template.cpp] +[import ../test/abstract.cpp] +[import ../test/paren.cpp] + +[section Motivation] + +Consider the following macro which declares a variable named `var`[^['n]] with the specified [^['type]] (see also [@../../test/var_error.cpp =var_error.cpp=]): + +[var_error] + +The first macro invocation works correctly declaring a variable named `var1` of type `int`. +However, the second macro invocation fails generating a preprocessor error similar to the following: + +[pre + error: macro "VAR" passed 3 arguments, but takes just 2 +] + +That is because the `std::map` type passed as the first macro parameter contains a comma `,` not wrapped by round parenthesis `()`. +The preprocessor interprets that unwrapped comma as a separation between macro parameters concluding that a total of three (and not two) parameters are passed to the macro in the following order: + +# `std::map` +# `2` + +Note that, differently from the compiler, the preprocessor only recognizes round parenthesis `()`. +Angular `<>` and squared `[]` parenthesis are not recognized by the preprocessor when parsing macro parameters. + +[endsect] + +[section Solution] + +In some cases, it might be possible to workaround this issue by avoiding to pass the type expression to the macro all together. +For example, in the case above a `typedef` could have been used to specify the type expression with the commas outside the macro (see also [@../../test/var.cpp =var.cpp=]): + +[var_typedef] + +When this is neither possible nor desired (e.g., see the function template `f` in the section below), this library header [headerref boost/utility/identity_type.hpp] defines a macro [macroref BOOST_IDENTITY_TYPE] which can be used to workaround the issue while keeping the type expression as one of the macro parameters (see also [@../../test/var.cpp =var.cpp=]). + +[var_ok] + +The [macroref BOOST_IDENTITY_TYPE] macro expands to an expression that evaluates (at compile-time) to the specified type. +The specified type is never split into multiple macro parameters because it is always wrapped by a set of extra round parenthesis `()`. +In fact, a total of two sets of round parenthesis must be used: The parenthesis to invoke the macro `BOOST_IDENTITY_TYPE(...)` plus the inner parenthesis to wrap the type passed to the macro `BOOST_IDENTITY_TYPE((...))`. + +This macro works on any [@http://www.open-std.org/JTC1/SC22/WG21/docs/standards C++03] compiler (and it does not use [@http://en.wikipedia.org/wiki/Variadic_macro variadic macros]). +[footnote +Using variadic macros, it would be possible to require a single set of extra parenthesis `BOOST_IDENTITY_TYPE(`[^['type]]`)` instead of two `BOOST_IDENTITY_TYPE((`[^['type]]`))` but variadic macros are not part of C++03 (even if nowadays they are supported by most modern compilers and they are also part of C++11). +] +The authors originally developed and tested this library using GNU Compiler Collection (GCC) C++ 4.5.3 (with and without C++11 features enabled `-std=c++0x`) on Cygwin and Miscrosoft Visual C++ (MSVC) 8.0 on Windows 7. +See the library [@http://www.boost.org/development/tests/release/developer/utility-identity_type.html regressions test results] for more information on supported compilers and platforms. + +[endsect] + +[section Templates] + +This macro must be prefixed by `typename` when used within templates. +For example, let's program a macro that declares a function parameter named `arg`[^['n]] with the specified [^['type]] (see also [@../../test/template.cpp =template.cpp=]): + +[template_f_decl] +[template_f_call] + +However, note that the template parameter `char` must be manually specified when invoking the function as in `f(a)`. +In fact, when the [macroref BOOST_IDENTITY_TYPE] macro is used to wrap a function template parameter, the template parameter can no longer be automatically deduced by the compiler form the function call as `f(a)` would have done. +[footnote +This is because the implementation of [macroref BOOST_IDENTITY_TYPE] wraps the specified type within a meta-function. +] +(This limitation does not apply to class templates because class template parameters must always be explicitly specified.) +In other words, without using the [macroref BOOST_IDENTITY_TYPE] macro, C++ would normally be able to automatically deduce the function template parameter as shown below: + +[template_g_decl] +[template_g_call] + +[endsect] + +[section Abstract Types] + +On some compilers (e.g., GCC), using this macro on abstract types (i.e., classes with one or more pure virtual functions) generates a compiler error. +This can be avoided by manipulating the type adding and removing a reference to it. + +Let's program a macro that performs a static assertion on a [@http://en.wikipedia.org/wiki/Template_metaprogramming Template Meta-Programming] (TMP) meta-function (similarly to Boost.MPL [@http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/assert.html `BOOST_MPL_ASSERT`]). +The [macroref BOOST_IDENTITY_TYPE] macro can be used to pass a meta-function with multiple template parameters to the assert macro (so to handle the commas separating the template parameters). +In this case, if the meta-function is an abstract type, it needs to be manipulated adding and removing a reference to it (see also [@../../test/abstract.cpp =abstract.cpp=]): + +[abstract] + +[endsect] + +[section Annex: Usage] + +The [macroref BOOST_IDENTITY_TYPE] macro can be used either when calling a user-defined macro (as shown by the examples so far), or internally when implementing a user-defined macro (as shown below). +When [macroref BOOST_IDENTITY_TYPE] is used in the implementation of the user-defined macro, the caller of the user macro will have to specify the extra parenthesis (see also [@../../test/paren.cpp =paren.cpp=]): + +[paren] + +However, note that the caller will /always/ have to specify the extra parenthesis even when the macro parameters contain no comma: + +[paren_always] + +In some cases, using [macroref BOOST_IDENTITY_TYPE] in the implementation of the user-defined macro might provide the best syntax for the caller. +For example, this is the case for `BOOST_MPL_ASSERT` because the majority of template meta-programming expressions contain unwrapped commas so it is less confusing for the user to always specify the extra parenthesis `((...))` instead of using [macroref BOOST_IDENTITY_TYPE]: + + BOOST_MPL_ASSERT(( // Natural syntax. + boost::mpl::and_< + boost::is_const + , boost::is_reference + > + )); + +However, in other situations it might be preferable to not require the extra parenthesis in the common cases and handle commas as special cases using [macroref BOOST_IDENTITY_TYPE]. +For example, this is the case for [@http://www.boost.org/libs/local_function `BOOST_LOCAL_FUNCTION`] for which always requiring the extra parenthesis `((...))` around the types would lead to an unnatural syntax for the local function signature: + + int BOOST_LOCAL_FUNCTION( ((int&)) x, ((int&)) y ) { // Unnatural syntax. + return x + y; + } BOOST_LOCAL_FUNCTION_NAME(add) + +Instead requiring the user to specify [macroref BOOST_IDENTITY_TYPE] only when needed allows for the more natural syntax `BOOST_LOCAL_FUNCTION(int& x, int& y)` in the common cases when the parameter types contain no comma (while still allowing to specify parameter types with commas as special cases using `BOOST_LOCAL_FUNCTION(BOOST_IDENTITY_TYPE((std::map))& x, int& y)`). + +[endsect] + +[section Annex: Implementation] + +The implementation of this library macro is equivalent to the following: +[footnote +There is absolutely no guarantee that the macro is actually implemented using the code listed in this documentation. +The listed code is for explanatory purposes only. +] + + #include + + #define BOOST_IDENTITY_TYPE(parenthesized_type) \ + boost::function_traits::arg1_type + +Essentially, the type is wrapped between round parenthesis `(std::map)` so it can be passed as a single macro parameter even if it contains commas. +Then the parenthesized type is transformed into the type of a function returning `void` and with the specified type as the type of the first and only argument `void (std::map)`. +Finally, the type of the first argument `arg1_type` is extracted at compile-time using the `function_traits` meta-function therefore obtaining the original type from the parenthesized type (effectively stripping the extra parenthesis from around the specified type). + +[endsect] + +[xinclude reference.xml] + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/index.html b/tools/boost_1_65_1/libs/utility/identity_type/index.html new file mode 100644 index 0000000000000000000000000000000000000000..00b33623c73b208cb97c55f3a588a00b183249e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/index.html @@ -0,0 +1,15 @@ + + + + + + + Automatic redirection failed, click this + link  
+

© Copyright Lorenzo Caminiti, 2009-2012

+

Distributed under the Boost Software License, Version 1.0 (see + accompanying file + LICENSE_1_0.txt or a copy at + www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/Jamfile.v2 b/tools/boost_1_65_1/libs/utility/identity_type/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..5cb50366d1b75cd29799662ff76a33b7d3f488fa --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/Jamfile.v2 @@ -0,0 +1,16 @@ + +# Copyright (C) 2009-2012 Lorenzo Caminiti +# Distributed under the Boost Software License, Version 1.0 +# (see accompanying file LICENSE_1_0.txt or a copy at +# http://www.boost.org/LICENSE_1_0.txt) +# Home at http://www.boost.org/libs/utility/identity_type + +import testing ; + +compile-fail var_error.cpp ; +run var.cpp ; +run template.cpp ; +run abstract.cpp ; +run noncopyable.cpp ; +run paren.cpp ; + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/abstract.cpp b/tools/boost_1_65_1/libs/utility/identity_type/test/abstract.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39b10c35a227e492e38c2ff1bb768edebcde5ee8 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/abstract.cpp @@ -0,0 +1,35 @@ + +// Copyright (C) 2009-2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/utility/identity_type + +#include +#include +#include +#include + +//[abstract +#define TMP_ASSERT(metafunction) \ + BOOST_STATIC_ASSERT(metafunction::value) + +template +struct abstract { + static const bool value = b; + virtual void f(T const& x) = 0; // Pure virtual function. +}; + +TMP_ASSERT( + boost::remove_reference< // Add and remove + BOOST_IDENTITY_TYPE(( // reference for + boost::add_reference< // abstract type. + abstract + >::type + )) + >::type +); +//] + +int main() { return 0; } + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/noncopyable.cpp b/tools/boost_1_65_1/libs/utility/identity_type/test/noncopyable.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2819e685070f78a78665a38e8c0ae87f3cd6b50e --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/noncopyable.cpp @@ -0,0 +1,25 @@ + +// Copyright (C) 2009-2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/utility/identity_type + +#include +#include +#include + +//[noncopyable +#define TMP_ASSERT(metafunction) \ + BOOST_STATIC_ASSERT(metafunction::value) + +template +struct noncopyable : boost::noncopyable { + static const T value = init; +}; + +TMP_ASSERT(BOOST_IDENTITY_TYPE((noncopyable))); +//] + +int main() { return 0; } + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/paren.cpp b/tools/boost_1_65_1/libs/utility/identity_type/test/paren.cpp new file mode 100644 index 0000000000000000000000000000000000000000..51b355fe97baf397d731934db77d166f2f80a3c4 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/paren.cpp @@ -0,0 +1,35 @@ + +// Copyright (C) 2009-2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/utility/identity_type + +#include +#include +#include +#include + +//[paren +#define TMP_ASSERT_PAREN(parenthesized_metafunction) \ + /* use `BOOST_IDENTITY_TYPE` in macro definition instead of invocation */ \ + BOOST_STATIC_ASSERT(BOOST_IDENTITY_TYPE(parenthesized_metafunction)::value) + +#define TMP_ASSERT(metafunction) \ + BOOST_STATIC_ASSERT(metafunction::value) + +// Specify only extra parenthesis `((...))`. +TMP_ASSERT_PAREN((boost::is_const const>)); + +// Specify both the extra parenthesis `((...))` and `BOOST_IDENTITY_TYPE` macro. +TMP_ASSERT(BOOST_IDENTITY_TYPE((boost::is_const const>))); +//] + +//[paren_always +TMP_ASSERT_PAREN((boost::is_const)); // Always extra `((...))`. + +TMP_ASSERT(boost::is_const); // No extra `((...))` and no macro. +//] + +int main() { return 0; } + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/template.cpp b/tools/boost_1_65_1/libs/utility/identity_type/test/template.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dfc10979580f2158ce7d0bbdfaaa79bc9d1a879c --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/template.cpp @@ -0,0 +1,48 @@ + +// Copyright (C) 2009-2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/utility/identity_type + +#include +#include +#include + +//[template_f_decl +#define ARG(type, n) type arg ## n + +template +void f( // Prefix macro with `typename` in templates. + ARG(typename BOOST_IDENTITY_TYPE((std::map)), 1) +) { + std::cout << arg1[0] << std::endl; +} +//] + +//[template_g_decl +template +void g( + std::map arg1 +) { + std::cout << arg1[0] << std::endl; +} +//] + +int main() { + //[template_f_call + std::map a; + a[0] = 'a'; + + f(a); // OK... + // f(a); // ... but error. + //] + + //[template_g_call + g(a); // OK... + g(a); // ... and also OK. + //] + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/var.cpp b/tools/boost_1_65_1/libs/utility/identity_type/test/var.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ed165d71c7b92e8f77b2c7c9ca1cc67aa555cf7 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/var.cpp @@ -0,0 +1,26 @@ + +// Copyright (C) 2009-2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/utility/identity_type + +#include + +#define VAR(type, n) type var ## n + +VAR(int, 1); // OK. + +//[var_typedef +typedef std::map map_type; +VAR(map_type, 3); // OK. +//] + +//[var_ok +#include + +VAR(BOOST_IDENTITY_TYPE((std::map)), 4); // OK. +//] + +int main() { return 0; } + diff --git a/tools/boost_1_65_1/libs/utility/identity_type/test/var_error.cpp b/tools/boost_1_65_1/libs/utility/identity_type/test/var_error.cpp new file mode 100644 index 0000000000000000000000000000000000000000..efb9743f5ab7a08a7a4c3118881bcbcb6beb5240 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/identity_type/test/var_error.cpp @@ -0,0 +1,18 @@ + +// Copyright (C) 2009-2012 Lorenzo Caminiti +// Distributed under the Boost Software License, Version 1.0 +// (see accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt) +// Home at http://www.boost.org/libs/utility/identity_type + +#include + +//[var_error +#define VAR(type, n) type var ## n + +VAR(int, 1); // OK. +VAR(std::map, 2); // Error. +//] + +int main() { return 0; } + diff --git a/tools/boost_1_65_1/libs/utility/in_place_factories.html b/tools/boost_1_65_1/libs/utility/in_place_factories.html new file mode 100644 index 0000000000000000000000000000000000000000..8eb7ea8d416a957343690b26118bf51255095131 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/in_place_factories.html @@ -0,0 +1,296 @@ + + + + + + +In_place_factory Documentation + + + +

+ +
+
+
+
+
+
+

Header <boost/utility/in_place_factory.hpp>

+ +

Header <boost/utility/typed_in_place_factory.hpp>

+ +
+
+
+
+
+
+

 

+ +

Contents

+
+
Motivation
+
Framework
+
Specification
+
Container-side Usage
+
User-side Usage
+
+ +
+ +

Motivation

+ +

Suppose we have a class

+
struct X
+{
+  X ( int, std::string ) ;
+} ;
+

And a container for it which supports an empty state (that is, which can contain zero objects):

+
struct C
+{
+   C() : contained_(0) {}
+  ~C() { delete contained_ ; }
+  X* contained_ ;
+} ;
+

A container designed to support an empty state typically doesn't require the contained type to be DefaultConstructible, +but it typically requires it to be CopyConstructible as a mechanism to +initialize the object to store:

+
struct C
+{
+   C() : contained_(0) {}
+   C ( X const& v ) : contained_ ( new X(v) ) {}
+  ~C() { delete contained_ ; }
+  X* contained_ ;
+} ;
+

There is a subtle problem with this: since the mechanism used to initialize the stored object is copy construction, +there must exist a previously constructed source object to copy from. This +object is likely to be temporary and serve no purpose besides being the source

+
void foo()
+{
+  // Temporary object created.
+  C c( X(123,"hello") ) ;
+}
+
+

A solution to this problem is to support direct construction of the contained +object right in the container's storage.
+In this scheme, the user supplies the arguments for the X constructor +directly to the container:

+
struct C
+{
+   C() : contained_(0) {}
+   C ( X const& v ) : contained_ ( new X(v) ) {}
+   C ( int a0, std::string a1 ) : contained_ ( new X(a0,a1) ) {}
+  ~C() { delete contained_ ; }
+  X* contained_ ;
+} ;
+
void foo()
+{
+  // Wrapped object constructed in-place
+  // No temporary created.
+  C c(123,"hello") ;
+}
+
+

Clearly, this solution doesn't scale well since the container must duplicate all the constructor overloads from the contained type +(at least all those which are to be supported directly in the container).

+ +

Framework

+

+This library proposes a framework to allow some containers to directly contruct contained objects in-place without requiring +the entire set of constructor overloads from the contained type. It also allows the container to remove the CopyConstuctible +requirement from the contained type since objects can be directly constructed in-place without need of a copy.
+The only requirement on the container is that it must provide proper storage (that is, correctly aligned and sized). +Naturally, the container will typically support uninitialized storage to avoid the in-place construction to override +a fully-constructed object (as this would defeat the purpose of in-place construction) +

+

For this purpose, the framework provides two families of classes collectively called: InPlaceFactories and TypedInPlaceFactories.
+Essentially, these classes hold a sequence of actual parameters and a method to contruct an object in place using these parameters. +Each member of the family differs only in the number (and type) of the parameter list. The first family +takes the type of the object to construct directly in method provided for that +purpose, whereas the second family incorporates that type in the factory class +itself..

+

From the container POV, using the framework amounts to calling the factory's method to contruct the object in place. +From the user POV, it amounts to creating the right factory object to hold the parameters and pass it to the container.
+The following simplified example shows the basic idea. A complete example follows the formal specification of the framework:

+
struct C
+{
+   template<class InPlaceFactory>
+   C ( InPlaceFactory const& aFactory )
+    :
+    contained_ ( uninitialized_storage() )
+   {
+     aFactory.template apply<X>(contained_);
+   }
+
+  ~C() 
+  { 
+    contained_ -> X::~X();
+    delete[] contained_ ; 
+  }
+
+  char* uninitialized_storage() { return new char[sizeof(X)] ; }
+
+  char* contained_ ;
+} ;
+
+void foo()
+{
+  C c( in_place(123,"hello") ) ;
+}
+
+ +
+ +

Specification

+ +

The following is the first member of the family of 'in_place_factory' classes, along with its corresponding helper template function. +The rest of the family varies only in the number and type of template (and constructor) parameters.

+
namespace boost {
+
+struct in_place_factory_base {} ;
+
+template<class A0>
+class in_place_factory : public in_place_factory_base
+{
+  public:
+ +
    in_place_factory ( A0 const& a0 ) : m_a0(a0) {}
+
+    template< class T >
+    void apply ( void* address ) const
+    {
+      new (address) T(m_a0);
+    }
+
+  private:
+ +
    A0 const& m_a0 ;
+} ;
+
+template<class A0>
+in_place_factory<A0> in_place ( A0 const& a0 )
+{
+  return in_place_factory<A0>(a0);
+}
+
+ +

Similarly, the following is the first member of the family of 'typed_in_place_factory' classes, along with its corresponding +helper template function. The rest of the family varies only in the number and type of template (and constructor) parameters.

+
namespace boost {
+
+struct typed_in_place_factory_base {} ;
+
+template<class T, class A0>
+class typed_in_place_factory : public typed_in_place_factory_base
+{
+  public:
+ +
    typed_in_place_factory ( A0 const& a0 ) : m_a0(a0) {}
+
+    void apply ( void* address ) const
+    {
+      new (address) T(m_a0);
+    }
+
+  private:
+ +
    A0 const& m_a0 ;
+} ;
+
+template<class T, class A0>
+typed_in_place_factory<A0> in_place ( A0 const& a0 )
+{
+  return typed_in_place_factory<T,A0>(a0);
+}
+ +
}
+
+ +

As you can see, the 'in_place_factory' and 'typed_in_place_factory' template classes varies only in the way they specify +the target type: in the first family, the type is given as a template argument to the apply member function while in the +second it is given directly as part of the factory class.
+When the container holds a unique non-polymorphic type (such as the case of Boost.Optional), it knows the exact dynamic-type +of the contained object and can pass it to the apply() method of a (non-typed) factory. +In this case, end users can use an 'in_place_factory' instance which can be constructed without the type of the object to construct.
+However, if the container holds heterogeneous or polymorphic objects (such as the case of Boost.Variant), the dynamic-type +of the object to be constructed must be known by the factory itslef. In this case, end users must use a 'typed_in_place_factory' +instead.

+ +
+ +

Container-side Usage

+ +

As shown in the introductory simplified example, the container class must +contain methods that accept an instance of +these factories and pass the object's storage to the factory's apply method.
+However, the type of the factory class cannot be completly specified in the container class because that would +defeat the whole purpose of the factories which is to allow the container to accept a variadic argument list +for the constructor of its contained object.
+The correct function overload must be based on the only distinctive and common +characteristic of all the classes in each family, the base class.
+Depending on the container class, you can use 'enable_if' to generate the right overload, or use the following +dispatch technique (used in the Boost.Optional class): +

+
struct C
+{
+   C() : contained_(0) {}
+   C ( X const& v ) : contained_ ( new X(v) ) {}
+
+   template<class Expr>
+   C ( Expr const& expr )
+    :
+    contained_ ( uninitialized_storage() )
+   {
+    construct(expr,&expr)
+   }
+
+  ~C() { delete contained_ ; }
+
+  template<class InPlaceFactory>
+  void construct ( InPlaceFactory const& aFactory, boost::in_place_factory_base* )
+  {
+    aFactory.template apply<X>(contained_);
+  }
+
+  template<class TypedInPlaceFactory>
+  void construct ( TypedInPlaceFactory const& aFactory, boost::typed_in_place_factory_base* )
+  {
+    aFactory.apply(contained_);
+  }
+
+  X* uninitialized_storage() { return static_cast<X*>(new char[sizeof(X)]) ; }
+
+  X* contained_ ;
+} ;
+
+ +
+ +

User-side Usage

+ +

End users pass to the container an instance of a factory object holding the actual parameters needed to construct the +contained object directly within the container. For this, the helper template function 'in_place' is used.
+The call 'in_place(a0,a1,a2,...,an)' constructs a (non-typed) 'in_place_factory' instance with the given argument list.
+The call 'in_place<T>(a0,a1,a2,...,an)' constructs a 'typed_in_place_factory' instance with the given argument list for the +type 'T'.

+
void foo()
+{
+  C a( in_place(123,"hello") ) ;    // in_place_factory passed
+  C b( in_place<X>(456,"world") ) ; // typed_in_place_factory passed
+}
+
+ +

Revised September 17, 2004

+

© Copyright Fernando Luis Cacciola Carballal, 2004

+

Use, modification, and distribution are subject to the Boost Software +License, Version 1.0. (See accompanying file +LICENSE_1_0.txt or copy at +www.boost.org/LICENSE_1_0.txt)

+

Developed by Fernando Cacciola, +the latest version of this file can be found at www.boost.org, and the boost +discussion lists

+ + diff --git a/tools/boost_1_65_1/libs/utility/index.html b/tools/boost_1_65_1/libs/utility/index.html new file mode 100644 index 0000000000000000000000000000000000000000..493be93e0527bc392b55fbc18119e7741a3574de --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/index.html @@ -0,0 +1,48 @@ + + + + + + + Boost Utility Library + + +

Boost + Utility Library

+

The Boost Utility Library isn't really a single library at all. It is just a + collection for components too small to be called libraries in their own right.

+

But that doesn't mean there isn't useful stuff here. Take a look:

+
+

+ addressof (moved to the Boost.Core library)
+ base_from_member
+ BOOST_BINARY
+ call_traits
+ checked_delete (moved to the Boost.Core library)
+ compressed_pair
+ declval
+ enable_if (moved to the Boost.Core library)
+ in_place_factory
+ iterator_adaptors
+ generator iterator adaptors
+ next/prior
+ noncopyable (moved to the Boost.Core library)
+ operators
+ result_of
+ throw_exception
+ utility
+ string_ref
+ value_init
+

+
+
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See + accompanying file + LICENSE_1_0.txt or copy at + + www.boost.org/LICENSE_1_0.txt)

+

Revised + 07 November, 2006

+ + diff --git a/tools/boost_1_65_1/libs/utility/iterator_adaptors.htm b/tools/boost_1_65_1/libs/utility/iterator_adaptors.htm new file mode 100644 index 0000000000000000000000000000000000000000..7232ac297a2b7b11a59060b566329802039cdb6a --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/iterator_adaptors.htm @@ -0,0 +1,11 @@ + + + + + + + + +This documentation moved to ../iterator/doc/index.html. + + diff --git a/tools/boost_1_65_1/libs/utility/meta/libraries.json b/tools/boost_1_65_1/libs/utility/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..5674dafc83277ecf2a4ab080614c67727419ce0b --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/meta/libraries.json @@ -0,0 +1,113 @@ +[ + { + "key": "utility", + "name": "Utility", + "authors": [ + "Dave Abrahams and others" + ], + "description": "Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.", + "documentation": "utility.htm", + "category": [ + "Algorithms", + "Function-objects", + "Memory", + "Miscellaneous", + "Patterns" + ] + }, + { + "key": "utility/call_traits", + "name": "Call Traits", + "authors": [ + "John Maddock, Howard Hinnant, et al" + ], + "description": "Defines types for passing parameters.", + "documentation": "call_traits.htm", + "category": [ + "Generic" + ] + }, + { + "key": "utility/compressed_pair", + "name": "Compressed Pair", + "authors": [ + "John Maddock, Howard Hinnant, et al" + ], + "description": "Empty member optimization.", + "documentation": "compressed_pair.htm", + "category": [ + "Data", + "Patterns" + ] + }, + { + "key": "utility/identity_type", + "name": "Identity Type", + "authors": [ + "Lorenzo Caminiti" + ], + "description": "Wrap types within round parenthesis so they can always be passed as macro parameters.", + "documentation": "identity_type/", + "category": [ + "Preprocessor" + ], + "maintainers": [ + "Lorenzo Caminiti " + ] + }, + { + "key": "utility/in_place_factories", + "name": "In Place Factory, Typed In Place Factory", + "authors": [ + "Fernando Cacciola" + ], + "description": "Generic in-place construction of contained objects with a variadic argument-list.", + "documentation": "in_place_factories.html", + "category": [ + "Generic" + ] + }, + { + "key": "utility/operators", + "name": "Operators", + "authors": [ + "Dave Abrahams", + "Jeremy Siek" + ], + "description": "Templates ease arithmetic classes and iterators.", + "documentation": "operators.htm", + "category": [ + "Generic", + "Iterators", + "Math" + ], + "maintainers": [ + "Daniel Frey " + ] + }, + { + "key": "utility/result_of", + "name": "Result Of", + "description": "Determines the type of a function call expression.", + "documentation": "utility.htm#result_of", + "category": [ + "Function-objects" + ], + "authors": "", + "maintainers": [ + "Daniel Walker " + ] + }, + { + "key": "utility/value_initialized", + "name": "Value Initialized", + "authors": [ + "Fernando Cacciola" + ], + "description": "Wrapper for uniform-syntax value initialization, based on the original idea of David Abrahams.", + "documentation": "value_init.htm", + "category": [ + "Miscellaneous" + ] + } +] diff --git a/tools/boost_1_65_1/libs/utility/operators.htm b/tools/boost_1_65_1/libs/utility/operators.htm new file mode 100644 index 0000000000000000000000000000000000000000..37820e1608faeb45771a4e6bab558c94d32b9381 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/operators.htm @@ -0,0 +1,2144 @@ + + + + + + + + Header <boost/operators.hpp> Documentation + + + +

boost.png (6897 bytes)Header <boost/operators.hpp>

+ +

The header <boost/operators.hpp> supplies + several sets of class templates (in namespace boost). These + templates define operators at namespace scope in terms of a minimal + number of fundamental operators provided by the class.

+ +

Contents

+ + + +

Rationale

+ +

Overloaded operators for class types typically occur in groups. If you + can write x + y, you probably also want to be able + to write x += y. If you can write x < y, you + also want x > y, x >= y, and x <= y. + Moreover, unless your class has really surprising behavior, some of these + related operators can be defined in terms of others (e.g. x >= y + <=> !(x < y)). Replicating this boilerplate for multiple + classes is both tedious and error-prone. The boost/operators.hpp templates help + by generating operators for you at namespace scope based on other + operators you've defined in your class.

+ +

If, for example, you declare a class like this:

+ +
+
+class MyInt
+    : boost::operators<MyInt>
+{
+    bool operator<(const MyInt& x) const;
+    bool operator==(const MyInt& x) const;
+    MyInt& operator+=(const MyInt& x);
+    MyInt& operator-=(const MyInt& x);
+    MyInt& operator*=(const MyInt& x);
+    MyInt& operator/=(const MyInt& x);
+    MyInt& operator%=(const MyInt& x);
+    MyInt& operator|=(const MyInt& x);
+    MyInt& operator&=(const MyInt& x);
+    MyInt& operator^=(const MyInt& x);
+    MyInt& operator++();
+    MyInt& operator--();
+};
+
+
+ +

then the operators<> + template adds more than a dozen additional operators, such as + operator>, <=, >=, and + (binary) +. Two-argument forms of the + templates are also provided to allow interaction with other types.

+ +

Summary of Template Semantics

+ +
    +
  1. Each operator template completes the concept(s) it describes by + defining overloaded operators for its target class.
  2. + +
  3. The name of an operator class template indicates the concept that its target class will model.
  4. + +
  5. Usually, the target class uses an instantation of the operator + class template as a base class. Some operator templates support an alternate method.
  6. + +
  7. The concept can be compound, i.e. it may represent a common + combination of other, simpler concepts.
  8. + +
  9. Most operator templates require their target class to support + operations related to the operators supplied by the template. In + accordance with widely accepted coding style recommendations, the + target class is often required to supply the assignment counterpart + operator of the concept's "main operator." For example, the + addable template requires operator+=(T + const&) and in turn supplies operator+(T const&, T + const&).
  10. +
+ +

Use of concepts

+ +

The discussed concepts are not necessarily the standard library's + concepts (CopyConstructible, etc.), although some of them could + be; they are what we call concepts with a small 'c'. In + particular, they are different from the former ones in that they do + not describe precise semantics of the operators they require to be + defined, except the requirements that (a) the semantics of the operators + grouped in one concept should be consistent (e.g. effects of + evaluating of a += b and + a = a + b expressions should be the + same), and (b) that the return types of the operators should follow + semantics of return types of corresponding operators for built-in types + (e.g. operator< should return a type convertible + to bool, and T::operator-= should return type + convertible to T). Such "loose" requirements make operators + library applicable to broader set of target classes from different + domains, i.e. eventually more useful.

+ +

Usage

+ +

Two-Argument Template Forms

+ +

General Considerations

+ +

The arguments to a binary operator commonly have identical types, but + it is not unusual to want to define operators which combine different + types. For example, one might want to multiply a + mathematical vector by a scalar. The two-argument template forms of the + arithmetic operator templates are supplied for this purpose. When + applying the two-argument form of a template, the desired return type of + the operators typically determines which of the two types in question + should be derived from the operator template. For example, if the result + of T + U is of type T, then + T (not U) should be derived from addable<T, U>. The comparison templates + (less_than_comparable<T, + U>, equality_comparable<T, U>, + equivalent<T, U>, and + partially_ordered<T, + U>) are exceptions to this guideline, since the return type + of the operators they define is bool.

+ +

On compilers which do not support partial specialization, the + two-argument forms must be specified by using the names shown below with + the trailing '2'. The single-argument forms with the + trailing '1' are provided for symmetry and to enable certain + applications of the base class chaining + technique.

+ +

Mixed Arithmetics

+ +

Another application of the two-argument template forms is for mixed + arithmetics between a type T and a type U that + is convertible to T. In this case there are two ways where + the two-argument template forms are helpful: one is to provide the + respective signatures for operator overloading, the second is + performance.

+ +

With respect to the operator overloading assume e.g. that + U is int, that T is an + user-defined unlimited integer type, and that double + operator-(double, const T&) exists. If one wants to compute + int - T and does not provide T operator-(int, const + T&), the compiler will consider double operator-(double, + const T&) to be a better match than T operator-(const + T&, const T&), which will probably be different from the + user's intention. To define a complete set of operator signatures, + additional 'left' forms of the two-argument template forms are provided + (subtractable2_left<T, + U>, dividable2_left<T, + U>, modable2_left<T, + U>) that define the signatures for non-commutative + operators where U appears on the left hand side + (operator-(const U&, const T&), + operator/(const U&, const T&), operator%(const + U&, const T&)).

+ +

With respect to the performance observe that when one uses the single + type binary operator for mixed type arithmetics, the type U + argument has to be converted to type T. In practice, + however, there are often more efficient implementations of, say + T::operator-=(const U&) that avoid unnecessary + conversions from U to T. The two-argument + template forms of the arithmetic operator create additional operator + interfaces that use these more efficient implementations. There is, + however, no performance gain in the 'left' forms: they still need a + conversion from U to T and have an + implementation equivalent to the code that would be automatically created + by the compiler if it considered the single type binary operator to be + the best match.

+ +

Base Class Chaining and Object Size

+ +

Every operator class template, except the arithmetic examples and the iterator + helpers, has an additional, but optional, template type parameter + B. This parameter will be a publicly-derived base class of + the instantiated template. This means it must be a class type. It can be + used to avoid the bloating of object sizes that is commonly associated + with multiple-inheritance from several empty base classes (see the note for users of older versions for more + details). To provide support for a group of operators, use the + B parameter to chain operator templates into a single-base + class hierarchy, demostrated in the usage example. + The technique is also used by the composite operator templates to group + operator definitions. If a chain becomes too long for the compiler to + support, try replacing some of the operator templates with a single + grouped operator template that chains the old templates together; the + length limit only applies to the number of templates directly in the + chain, not those hidden in group templates.

+ +

Caveat: to chain to a base class which is + not a Boost operator template when using the single-argument form of a Boost operator template, you + must specify the operator template with the trailing '1' in + its name. Otherwise the library will assume you mean to define a binary + operation combining the class you intend to use as a base class and the + class you're deriving.

+ +

Separate, Explicit + Instantiation

+ +

On some compilers (e.g. Borland, GCC) even single-inheritance + seems to cause an increase in object size in some cases. If you are not + defining a class template, you may get better object-size performance by + avoiding derivation altogether, and instead explicitly instantiating the + operator template as follows:

+ +
+
+    class myclass // lose the inheritance...
+    {
+        //...
+    };
+
+    // explicitly instantiate the operators I need.
+    template struct less_than_comparable<myclass>;
+    template struct equality_comparable<myclass>;
+    template struct incrementable<myclass>;
+    template struct decrementable<myclass>;
+    template struct addable<myclass,long>;
+    template struct subtractable<myclass,long>;
+
+
+ +

Note that some operator templates cannot use this workaround and must + be a base class of their primary operand type. Those templates define + operators which must be member functions, and the workaround needs the + operators to be independent friend functions. The relevant templates + are:

+ + + +

As Daniel Krügler pointed out, this technique violates 14.6.5/2 + and is thus non-portable. The reasoning is, that the operators injected + by the instantiation of e.g. + less_than_comparable<myclass> can not be found + by ADL according to the rules given by 3.4.2/2, since myclass is + not an associated class of + less_than_comparable<myclass>. + Thus only use this technique if all else fails.

+ +

Requirement Portability

+ +

Many compilers (e.g. MSVC 6.3, GCC 2.95.2) will not enforce the + requirements in the operator template tables unless the operations which + depend on them are actually used. This is not standard-conforming + behavior. In particular, although it would be convenient to derive all + your classes which need binary operators from the operators<> and operators2<> templates, regardless of + whether they implement all the requirements of those templates, this + shortcut is not portable. Even if this currently works with your + compiler, it may not work later.

+ +

Example

+ +

This example shows how some of the arithmetic + operator templates can be used with a geometric point class + (template).

+
+template <class T>
+class point    // note: private inheritance is OK here!
+    : boost::addable< point<T>          // point + point
+    , boost::subtractable< point<T>     // point - point
+    , boost::dividable2< point<T>, T    // point / T
+    , boost::multipliable2< point<T>, T // point * T, T * point
+      > > > >
+{
+public:
+    point(T, T);
+    T x() const;
+    T y() const;
+
+    point operator+=(const point&);
+    // point operator+(point, const point&) automatically
+    // generated by addable.
+
+    point operator-=(const point&);
+    // point operator-(point, const point&) automatically
+    // generated by subtractable.
+
+    point operator*=(T);
+    // point operator*(point, const T&) and
+    // point operator*(const T&, point) auto-generated
+    // by multipliable.
+
+    point operator/=(T);
+    // point operator/(point, const T&) auto-generated
+    // by dividable.
+private:
+    T x_;
+    T y_;
+};
+
+// now use the point<> class:
+
+template <class T>
+T length(const point<T> p)
+{
+    return sqrt(p.x()*p.x() + p.y()*p.y());
+}
+
+const point<float> right(0, 1);
+const point<float> up(1, 0);
+const point<float> pi_over_4 = up + right;
+const point<float> pi_over_4_normalized = pi_over_4 / length(pi_over_4);
+
+ +

Arithmetic Operators

+ +

The arithmetic operator templates ease the task of creating a custom + numeric type. Given a core set of operators, the templates add related + operators to the numeric class. These operations are like the ones the + standard arithmetic types have, and may include comparisons, adding, + incrementing, logical and bitwise manipulations, etc. Further, + since most numeric types need more than one of these operators, some + templates are provided to combine several of the basic operator templates + in one declaration.

+ +

The requirements for the types used to instantiate the simple operator + templates are specified in terms of expressions which must be valid and + the expression's return type. The composite operator templates only list + what other templates they use. The supplied operations and requirements + of the composite operator templates can be inferred from the operations + and requirements of the listed components.

+ +

Simple Arithmetic Operators

+ +

These templates are "simple" since they provide operators based on a + single operation the base type has to provide. They have an additional + optional template parameter B, which is not shown, for the + base class chaining technique.

+ +

The primary operand type T needs to be of class type, + built-in types are not supported.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Simple Arithmetic Operator Template Classes +
+ + + + + + + + + + + + + + +
+ Key +
T: primary operand typeU: alternate operand type
t, t1: values of type + Tu: value of type U
+
TemplateSupplied OperationsRequirements
less_than_comparable<T>
+ less_than_comparable1<T>
bool operator>(const T&, const T&)
+ bool operator<=(const T&, const T&)
+ bool operator>=(const T&, const T&)
t < t1.
+ Return convertible to bool. See the Ordering Note.
less_than_comparable<T, + U>
+ less_than_comparable2<T, U>
bool operator<=(const T&, const U&)
+ bool operator>=(const T&, const U&)
+ bool operator>(const U&, const T&)
+ bool operator<(const U&, const T&)
+ bool operator<=(const U&, const T&)
+ bool operator>=(const U&, const T&)
t < u. t > u.
+ Returns convertible to bool. See the Ordering Note.
equality_comparable<T>
+ equality_comparable1<T>
bool operator!=(const T&, const T&)t == t1.
+ Return convertible to bool.
equality_comparable<T, + U>
+ equality_comparable2<T, U>
bool operator==(const U&, const T&)
+ bool operator!=(const U&, const T&)
+ bool operator!=(const T&, const U&)
t == u.
+ Return convertible to bool.
addable<T>
+ addable1<T>
T operator+(const T&, const T&)T temp(t); temp += t1.
+ Return convertible to T. See the Symmetry Note.
addable<T, U>
+ addable2<T, U>
T operator+(const T&, const U&)
+ T operator+(const U&, const T& )
T temp(t); temp += u.
+ Return convertible to T. See the Symmetry Note.
subtractable<T>
+ subtractable1<T>
T operator-(const T&, const T&)T temp(t); temp -= t1.
+ Return convertible to T. See the Symmetry Note.
subtractable<T, + U>
+ subtractable2<T, U>
T operator-(const T&, const U&)T temp(t); temp -= u.
+ Return convertible to T. See the Symmetry Note.
subtractable2_left<T, + U>T operator-(const U&, const T&)T temp(u); temp -= t.
+ Return convertible to T.
multipliable<T>
+ multipliable1<T>
T operator*(const T&, const T&)T temp(t); temp *= t1.
+ Return convertible to T. See the Symmetry Note.
multipliable<T, + U>
+ multipliable2<T, U>
T operator*(const T&, const U&)
+ T operator*(const U&, const T&)
T temp(t); temp *= u.
+ Return convertible to T. See the Symmetry Note.
dividable<T>
+ dividable1<T>
T operator/(const T&, const T&)T temp(t); temp /= t1.
+ Return convertible to T. See the Symmetry Note.
dividable<T, U>
+ dividable2<T, U>
T operator/(const T&, const U&)T temp(t); temp /= u.
+ Return convertible to T. See the Symmetry Note.
dividable2_left<T, + U>T operator/(const U&, const T&)T temp(u); temp /= t.
+ Return convertible to T.
modable<T>
+ modable1<T>
T operator%(const T&, const T&)T temp(t); temp %= t1.
+ Return convertible to T. See the Symmetry Note.
modable<T, U>
+ modable2<T, U>
T operator%(const T&, const U&)T temp(t); temp %= u.
+ Return convertible to T. See the Symmetry Note.
modable2_left<T, + U>T operator%(const U&, const T&)T temp(u); temp %= t.
+ Return convertible to T.
orable<T>
+ orable1<T>
T operator|(const T&, const T&)T temp(t); temp |= t1.
+ Return convertible to T. See the Symmetry Note.
orable<T, U>
+ orable2<T, U>
T operator|(const T&, const U&)
+ T operator|(const U&, const T&)
T temp(t); temp |= u.
+ Return convertible to T. See the Symmetry Note.
andable<T>
+ andable1<T>
T operator&(const T&, const T&)T temp(t); temp &= t1.
+ Return convertible to T. See the Symmetry Note.
andable<T, U>
+ andable2<T, U>
T operator&(const T&, const U&)
+ T operator&(const U&, const T&)
T temp(t); temp &= u.
+ Return convertible to T. See the Symmetry Note.
xorable<T>
+ xorable1<T>
T operator^(const T&, const T&)T temp(t); temp ^= t1.
+ Return convertible to T. See the Symmetry Note.
xorable<T, U>
+ xorable2<T, U>
T operator^(const T&, const U&)
+ T operator^(const U&, const T&)
T temp(t); temp ^= u.
+ Return convertible to T. See the Symmetry Note.
incrementable<T>T operator++(T&, int)T temp(t); ++t
+ Return convertible to T.
decrementable<T>T operator--(T&, int)T temp(t); --t;
+ Return convertible to T.
left_shiftable<T>
+ left_shiftable1<T>
T operator<<(const T&, const T&)T temp(t); temp <<= t1.
+ Return convertible to T. See the Symmetry Note.
left_shiftable<T, + U>
+ left_shiftable2<T, U>
T operator<<(const T&, const U&)T temp(t); temp <<= u.
+ Return convertible to T. See the Symmetry Note.
right_shiftable<T>
+ right_shiftable1<T>
T operator>>(const T&, const T&)T temp(t); temp >>= t1.
+ Return convertible to T. See the Symmetry Note.
right_shiftable<T, + U>
+ right_shiftable2<T, U>
T operator>>(const T&, const U&)T temp(t); temp >>= u.
+ Return convertible to T. See the Symmetry Note.
equivalent<T>
+ equivalent1<T>
bool operator==(const T&, const T&)t < t1.
+ Return convertible to bool. See the Ordering Note.
equivalent<T, U>
+ equivalent2<T, U>
bool operator==(const T&, const U&)t < u. t > u.
+ Returns convertible to bool. See the Ordering Note.
partially_ordered<T>
+ partially_ordered1<T>
bool operator>(const T&, const T&)
+ bool operator<=(const T&, const T&)
+ bool operator>=(const T&, const T&)
t < t1. t == t1.
+ Returns convertible to bool. See the Ordering Note.
partially_ordered<T, + U>
+ partially_ordered2<T, U>
bool operator<=(const T&, const U&)
+ bool operator>=(const T&, const U&)
+ bool operator>(const U&, const T&)
+ bool operator<(const U&, const T&)
+ bool operator<=(const U&, const T&)
+ bool operator>=(const U&, const T&)
t < u. t > u. t == + u.
+ Returns convertible to bool. See the Ordering Note.
+ +

Ordering Note

+ +

The less_than_comparable<T> and + partially_ordered<T> + templates provide the same set of operations. However, the workings of + less_than_comparable<T> assume + that all values of type T can be placed in a total order. If + that is not true (e.g. Not-a-Number values in IEEE floating point + arithmetic), then partially_ordered<T> should be + used. The partially_ordered<T> template can + be used for a totally-ordered type, but it is not as efficient as + less_than_comparable<T>. This + rule also applies for less_than_comparable<T, U> and + partially_ordered<T, + U> with respect to the ordering of all T and + U values, and for both versions of equivalent<>. The solution for equivalent<> is to write a custom + operator== for the target class.

+ +

Symmetry Note

+ +

Before talking about symmetry, we need to talk about optimizations to + understand the reasons for the different implementation styles of + operators. Let's have a look at operator+ for a class + T as an example:

+
+T operator+( const T& lhs, const T& rhs )
+{
+   return T( lhs ) += rhs;
+}
+
+ This would be a normal implementation of operator+, but it + is not an efficient one. An unnamed local copy of lhs is + created, operator+= is called on it and it is copied to the + function return value (which is another unnamed object of type + T). The standard doesn't generally allow the intermediate + object to be optimized away: + +
+ 3.7.2/2: Automatic storage duration
+
+ If a named automatic object has initialization or a destructor with + side effects, it shall not be destroyed before the end of its block, + nor shall it be eliminated as an optimization even if it appears to be + unused, except that a class object or its copy may be eliminated as + specified in 12.8. +
+ The reference to 12.8 is important for us: + +
+ 12.8/15: Copying class objects
+ ...
+ For a function with a class return type, if the expression in the + return statement is the name of a local object, and the cv-unqualified + type of the local object is the same as the function return type, an + implementation is permitted to omit creating the temporary object to + hold the function return value, even if the class copy constructor or + destructor has side effects. +
+ This optimization is known as the named return value optimization (NRVO), + which leads us to the following implementation for + operator+: +
+T operator+( const T& lhs, const T& rhs )
+{
+   T nrv( lhs );
+   nrv += rhs;
+   return nrv;
+}
+
+ Given this implementation, the compiler is allowed to remove the + intermediate object. Sadly, not all compiler implement the NRVO, some + even implement it in an incorrect way which makes it useless here. + Without the NRVO, the NRVO-friendly code is no worse than the original + code showed above, but there is another possible implementation, which + has some very special properties: +
+T operator+( T lhs, const T& rhs )
+{
+   return lhs += rhs;
+}
+
+ The difference to the first implementation is that lhs is + not taken as a constant reference used to create a copy; instead, + lhs is a by-value parameter, thus it is already the copy + needed. This allows another optimization (12.2/2) for some cases. + Consider a + b + c where the result of + a + b is not copied when used as lhs + when adding c. This is more efficient than the original + code, but not as efficient as a compiler using the NRVO. For most people, + it is still preferable for compilers that don't implement the NRVO, but + the operator+ now has a different function signature. Also, + the number of objects created differs for + (a + b ) + c and + a + ( b + c ). Most probably, + this won't be a problem for you, but if your code relies on the function + signature or a strict symmetric behaviour, you should set + BOOST_FORCE_SYMMETRIC_OPERATORS in your user-config. This + will force the NRVO-friendly implementation to be used even for compilers + that don't implement the NRVO.
+
+ +

Grouped Arithmetic Operators

+ +

The following templates provide common groups of related operations. + For example, since a type which is addable is usually also subractable, + the additive template provides the + combined operators of both. The grouped operator templates have an + additional optional template parameter B, which is not + shown, for the base class chaining technique.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Grouped Arithmetic Operator Template Classes +
+ + + + + + + + +
+ Key +
T: primary operand typeU: alternate operand type
+
TemplateComponent Operator Templates
totally_ordered<T>
+ totally_ordered1<T>
+ +
totally_ordered<T, + U>
+ totally_ordered2<T, U>
+ +
additive<T>
+ additive1<T>
+ +
additive<T, U>
+ additive2<T, U>
+ +
multiplicative<T>
+ multiplicative1<T>
+ +
multiplicative<T, + U>
+ multiplicative2<T, U>
+ +
integer_multiplicative<T>
+ + integer_multiplicative1<T>
+ +
integer_multiplicative<T, + U>
+ integer_multiplicative2<T, U>
+ +
arithmetic<T>
+ arithmetic1<T>
+ +
arithmetic<T, U>
+ arithmetic2<T, U>
+ +
integer_arithmetic<T>
+ integer_arithmetic1<T>
+ +
integer_arithmetic<T, + U>
+ integer_arithmetic2<T, U>
+ +
bitwise<T>
+ bitwise1<T>
+ +
bitwise<T, U>
+ bitwise2<T, U>
+ +
unit_steppable<T> + +
shiftable<T>
+ shiftable1<T>
+ +
shiftable<T, U>
+ shiftable2<T, U>
+ +
ring_operators<T>
+ ring_operators1<T>
+ +
ring_operators<T, + U>
+ ring_operators2<T, U>
+ +
ordered_ring_operators<T>
+ + ordered_ring_operators1<T>
+ +
ordered_ring_operators<T, + U>
+ ordered_ring_operators2<T, U>
+ +
field_operators<T>
+ field_operators1<T>
+ +
field_operators<T, + U>
+ field_operators2<T, U>
+ +
ordered_field_operators<T>
+ + ordered_field_operators1<T>
+ +
ordered_field_operators<T, + U>
+ ordered_field_operators2<T, U>
+ +
euclidean_ring_operators<T>
+ + euclidean_ring_operators1<T>
+ +
euclidean_ring_operators<T, + U>
+ euclidean_ring_operators2<T, U>
+ +
ordered_euclidean_ring_operators<T>
+ + ordered_euclidean_ring_operators1<T>
+ +
ordered_euclidean_ring_operators<T, + U>
+ ordered_euclidean_ring_operators2<T, U>
+ +
+ +

Spelling: euclidean vs. euclidian

+ +

Older versions of the Boost.Operators library used + "euclidian", but it was pointed out that + "euclidean" is the more common spelling. + To be compatible with older version, the library now supports + both spellings. +

+ +

Example Templates

+ +

The arithmetic operator class templates operators<> and operators2<> are examples of + non-extensible operator grouping classes. These legacy class templates, + from previous versions of the header, cannot be used for base class chaining.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Final Arithmetic Operator Template Classes +
+ + + + + + + + +
+ Key +
T: primary operand typeU: alternate operand type
+
TemplateComponent Operator Templates
operators<T> + +
operators<T, U>
+ operators2<T, U>
+ +
+ +

Arithmetic Operators Demonstration and Test + Program

+ +

The operators_test.cpp + program demonstrates the use of the arithmetic operator templates, and + can also be used to verify correct operation. Check the compiler status + report for the test results with selected platforms.

+ +

Dereference Operators and Iterator Helpers

+ +

The iterator helper templates ease the task of + creating a custom iterator. Similar to arithmetic types, a complete + iterator has many operators that are "redundant" and can be implemented + in terms of the core set of operators.

+ +

The dereference operators were motivated by + the iterator helpers, but are often useful in + non-iterator contexts as well. Many of the redundant iterator operators + are also arithmetic operators, so the iterator helper classes borrow many + of the operators defined above. In fact, only two new operators need to + be defined (the pointer-to-member operator-> and the + subscript operator[])!

+ +

The requirements for the types used to instantiate the dereference + operators are specified in terms of expressions which must be valid and + their return type. The composite operator templates list their component + templates, which the instantiating type must support, and possibly other + requirements.

+ +

Dereference Operators

+ +

All the dereference operator templates in this table accept an + optional template parameter (not shown) to be used for base class chaining.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Dereference Operator Template Classes +
+ + + + + + + + + + + + + + + + + + + + +
+ Key +
T: operand typeP: pointer type
D: difference_typeR: reference type
i: object of type T (an + iterator)n: object of type D (an + index)
+
TemplateSupplied OperationsRequirements
dereferenceable<T, + P>P operator->() const(&*i). Return convertible to + P.
indexable<T, D, + R>R operator[](D n) const*(i + n). Return of type + R.
+ +

Grouped Iterator Operators

+ +

There are five iterator operator class templates, each for a different + category of iterator. The following table shows the operator groups for + any category that a custom iterator could define. These class templates + have an additional optional template parameter B, which is + not shown, to support base class chaining.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Iterator Operator Class Templates +
+ + + + + + + + + + + + + + + + + + + + +
+ Key +
T: operand typeP: pointer type
D: difference_typeR: reference type
V: value_type +
+
TemplateComponent Operator Templates
input_iteratable<T, + P> + +
output_iteratable<T> + +
forward_iteratable<T, + P> + +
bidirectional_iteratable<T, + P> + +
random_access_iteratable<T, P, D, + R> + +
+ +

Iterator Helpers

+ +

There are also five iterator helper class templates, each + corresponding to a different iterator category. These classes cannot be + used for base class chaining. The following + summaries show that these class templates supply both the iterator + operators from the iterator operator class + templates and the iterator typedef's required by the C++ standard + (iterator_category, value_type, + etc.).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Iterator Helper Class Templates +
+ + + + + + + + + + + + + + + + + + + + +
+ Key +
T: operand typeP: pointer type
D: difference_typeR: reference type
V: value_typex1, x2: objects of type T
+
TemplateOperations & Requirements
input_iterator_helper<T, + V, D, P, R> + Supports the operations and has the requirements of + + +
output_iterator_helper<T> + Supports the operations and has the requirements of + + + See also [1], [2]. +
forward_iterator_helper<T, V, D, P, + R> + Supports the operations and has the requirements of + + +
bidirectional_iterator_helper<T, + V, D, P, R> + Supports the operations and has the requirements of + + +
random_access_iterator_helper<T, + V, D, P, R> + Supports the operations and has the requirements of + + + To satisfy RandomAccessIterator, + x1 - x2 with return convertible to D is + also required. +
+ +

Iterator Helper Notes

+ +

[1] Unlike other iterator helpers templates, + output_iterator_helper takes only one template parameter - + the type of its target class. Although to some it might seem like an + unnecessary restriction, the standard requires + difference_type and value_type of any output + iterator to be void (24.3.1 [lib.iterator.traits]), and + output_iterator_helper template respects this requirement. + Also, output iterators in the standard have void pointer and + reference types, so the output_iterator_helper + does the same.

+ +

[2] As self-proxying is the easiest and most common + way to implement output iterators (see, for example, insert [24.4.2] and + stream iterators [24.5] in the standard library), + output_iterator_helper supports the idiom by defining + operator* and operator++ member functions which + just return a non-const reference to the iterator itself. Support for + self-proxying allows us, in many cases, to reduce the task of writing an + output iterator to writing just two member functions - an appropriate + constructor and a copy-assignment operator. For example, here is a + possible implementation of boost::function_output_iterator + adaptor:

+
+template<class UnaryFunction>
+struct function_output_iterator
+    : boost::output_iterator_helper< function_output_iterator<UnaryFunction> >
+{
+    explicit function_output_iterator(UnaryFunction const& f = UnaryFunction())
+        : func(f) {}
+
+    template<typename T>
+    function_output_iterator& operator=(T const& value)
+    {
+        this->func(value);
+        return *this;
+    }
+
+ private:
+    UnaryFunction func;
+};
+
+ +

Note that support for self-proxying does not prevent you from using + output_iterator_helper to ease any other, different kind of + output iterator's implementation. If + output_iterator_helper's target type provides its own + definition of operator* or/and operator++, then + these operators will get used and the ones supplied by + output_iterator_helper will never be instantiated.

+ +

Iterator Demonstration and Test Program

+ +

The iterators_test.cpp + program demonstrates the use of the iterator templates, and can also be + used to verify correct operation. The following is the custom iterator + defined in the test program. It demonstrates a correct (though trivial) + implementation of the core operations that must be defined in order for + the iterator helpers to "fill in" the rest of the iterator + operations.

+ +
+
+template <class T, class R, class P>
+struct test_iter
+  : public boost::random_access_iterator_helper<
+     test_iter<T,R,P>, T, std::ptrdiff_t, P, R>
+{
+  typedef test_iter self;
+  typedef R Reference;
+  typedef std::ptrdiff_t Distance;
+
+public:
+  explicit test_iter(T* i =0);
+  test_iter(const self& x);
+  self& operator=(const self& x);
+  Reference operator*() const;
+  self& operator++();
+  self& operator--();
+  self& operator+=(Distance n);
+  self& operator-=(Distance n);
+  bool operator==(const self& x) const;
+  bool operator<(const self& x) const;
+  friend Distance operator-(const self& x, const self& y);
+};
+
+
+ +

Check the compiler status + report for the test results with selected platforms.

+
+ +

Contributors

+ +
+
Dave Abrahams
+ +
Started the library and contributed the arithmetic operators in + boost/operators.hpp.
+ +
Jeremy Siek
+ +
Contributed the dereference operators and iterator + helpers in boost/operators.hpp. Also + contributed iterators_test.cpp.
+ +
Aleksey + Gurtovoy
+ +
Contributed the code to support base class + chaining while remaining backward-compatible with old versions of + the library.
+ +
Beman Dawes
+ +
Contributed operators_test.cpp.
+ +
Daryle Walker
+ +
Contributed classes for the shift operators, equivalence, partial + ordering, and arithmetic conversions. Added the grouped operator + classes. Added helper classes for input and output iterators.
+ +
Helmut Zeisel
+ +
Contributed the 'left' operators and added some grouped operator + classes.
+ +
Daniel Frey
+ +
Contributed the NRVO-friendly and symmetric implementation of + arithmetic operators.
+ +
+ +

Note for Users of Older Versions

+ +

The changes in the library interface and + recommended usage were motivated by some practical issues described + below. The new version of the library is still backward-compatible with + the former one (so you're not forced change any existing code), + but the old usage is deprecated. Though it was arguably simpler and more + intuitive than using base class chaining, it has + been discovered that the old practice of deriving from multiple operator + templates can cause the resulting classes to be much larger than they + should be. Most modern C++ compilers significantly bloat the size of + classes derived from multiple empty base classes, even though the base + classes themselves have no state. For instance, the size of + point<int> from the example + above was 12-24 bytes on various compilers for the Win32 platform, + instead of the expected 8 bytes.

+ +

Strictly speaking, it was not the library's fault--the language rules + allow the compiler to apply the empty base class optimization in that + situation. In principle an arbitrary number of empty base classes can be + allocated at the same offset, provided that none of them have a common + ancestor (see section 10.5 [class.derived] paragraph 5 of the standard). + But the language definition also doesn't require implementations + to do the optimization, and few if any of today's compilers implement it + when multiple inheritance is involved. What's worse, it is very unlikely + that implementors will adopt it as a future enhancement to existing + compilers, because it would break binary compatibility between code + generated by two different versions of the same compiler. As Matt Austern + said, "One of the few times when you have the freedom to do this sort of + thing is when you're targeting a new architecture...". On the other hand, + many common compilers will use the empty base optimization for single + inheritance hierarchies.

+ +

Given the importance of the issue for the users of the library (which + aims to be useful for writing light-weight classes like + MyInt or point<>), and the forces + described above, we decided to change the library interface so that the + object size bloat could be eliminated even on compilers that support only + the simplest form of the empty base class optimization. The current + library interface is the result of those changes. Though the new usage is + a bit more complicated than the old one, we think it's worth it to make + the library more useful in real world. Alexy Gurtovoy contributed the + code which supports the new usage idiom while allowing the library remain + backward-compatible.

+
+ +

Revised: 7 Aug 2008

+ +

Copyright © Beman Dawes, David Abrahams, 1999-2001.

+

Copyright © Daniel Frey, 2002-2009.

+

Use, modification, and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at + + www.boost.org/LICENSE_1_0.txt)

+ + + diff --git a/tools/boost_1_65_1/libs/utility/shared_container_iterator.html b/tools/boost_1_65_1/libs/utility/shared_container_iterator.html new file mode 100644 index 0000000000000000000000000000000000000000..ed149b538e95746263b13a51934bf355cc744acb --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/shared_container_iterator.html @@ -0,0 +1,322 @@ + + + + + + +Shared Container Iterator Documentation + + + + +boost.png (6897 bytes) + +

Shared Container Iterator

+ +Defined in header +boost/shared_container_iterator.hpp + +

+The purpose of the shared container iterator is to attach the lifetime +of a container to the lifetime of its iterators. In other words, the +container will not be deleted until after all its iterators are +destroyed. The shared container iterator is typically used to +implement functions that return iterators over a range of objects that +only need to exist for the lifetime of the iterators. By returning a +pair of shared iterators from a function, the callee can return a +heap-allocated range of objects whose lifetime is automatically managed. +

+The shared container iterator augments an iterator over a shared +container. It maintains a reference count on the shared +container. If only shared container iterators hold references to +the container, the container's lifetime will end when the last shared +container iterator over it is destroyed. In any case, the shared +container is guaranteed to persist beyond the lifetime of all +the iterators. In all other ways, the +shared container iterator behaves the same as its base iterator. + + +

Synopsis

+ +
+namespace boost {
+  template <typename Container>
+  class shared_container_iterator;
+
+  template <typename Container>
+  shared_container_iterator<Container>
+  make_shared_container_iterator(typename Container::iterator base, 
+    boost::shared_ptr<Container> const& container);
+
+  std::pair<
+    typename shared_container_iterator<Container>,
+    typename shared_container_iterator<Container>
+  >
+  make_shared_container_range(boost::shared_ptr<Container> const& container);
+}
+
+ +
+ +

The Shared Container Iterator Type

+ +
+template <typename Container> class shared_container_iterator;
+
+ +The class template shared_container_iterator +is the shared container iterator type. The Container template +type argument must model the +Container +concept. + +

Example

+ +

+The following example illustrates how to create an iterator that +regulates the lifetime of a reference counted std::vector. +Though the original shared pointer ints ceases to exist +after set_range() returns, the +shared_counter_iterator objects maintain references to the + underlying vector and thereby extend the container's lifetime. +

+shared_iterator_example1.cpp: +

+#include "shared_container_iterator.hpp"
+#include "boost/shared_ptr.hpp"
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+typedef boost::shared_container_iterator< std::vector<int> > iterator;
+
+
+void set_range(iterator& i, iterator& end)  {
+
+  boost::shared_ptr< std::vector<int> > ints(new std::vector<int>());
+  
+  ints->push_back(0);
+  ints->push_back(1);
+  ints->push_back(2);
+  ints->push_back(3);
+  ints->push_back(4);
+  ints->push_back(5);
+  
+  i = iterator(ints->begin(),ints);
+  end = iterator(ints->end(),ints);
+}
+
+
+int main() {
+
+  iterator i,end;
+
+  set_range(i,end);
+
+  std::copy(i,end,std::ostream_iterator<int>(std::cout,","));
+  std::cout.put('\n');
+
+  return 0;
+}
+
+ +The output from this part is: +
+0,1,2,3,4,5,
+
+ +

Template Parameters

+ + + + + + + + + + +
ParameterDescription
ContainerThe type of the container that we wish to iterate over. It must be +a model of the +Container +concept. +
+ +

Model of

+ +The shared_container_iterator type models the +same iterator concept as the base iterator + (Container::iterator). + +

Members

+ +The shared container iterator type implements the member functions and +operators required of the Random Access Iterator +concept, though only operations defined for the base iterator will be valid. +In addition it has the following constructor: + +
+shared_container_iterator(Container::iterator const& it,
+                          boost::shared_ptr<Container> const& container)
+
+ +

+


+

+ + +

The Shared Container Iterator Object Generator

+ +
+template <typename Container>
+shared_container_iterator<Container>
+make_shared_container_iterator(Container::iterator base,
+                               boost::shared_ptr<Container> const& container)
+
+ +This function provides an alternative to directly constructing a +shared container iterator. Using the object generator, a shared +container iterator can be created and passed to a function without +explicitly specifying its type. + +

Example

+ +This example, similar to the previous, uses +make_shared_container_iterator() to create the iterators. + +

+shared_iterator_example2.cpp: + +

+#include "shared_container_iterator.hpp"
+#include "boost/shared_ptr.hpp"
+#include <algorithm>
+#include <iterator>
+#include <iostream>
+#include <vector>
+
+
+template <typename Iterator>
+void print_range_nl (Iterator begin, Iterator end) {
+  typedef typename std::iterator_traits<Iterator>::value_type val;
+  std::copy(begin,end,std::ostream_iterator<val>(std::cout,","));
+  std::cout.put('\n');
+}
+
+
+int main() {
+
+  typedef boost::shared_ptr< std::vector<int> > ints_t;
+  {
+    ints_t ints(new std::vector<int>());
+
+    ints->push_back(0);
+    ints->push_back(1);
+    ints->push_back(2);
+    ints->push_back(3);
+    ints->push_back(4);
+    ints->push_back(5);
+
+    print_range_nl(boost::make_shared_container_iterator(ints->begin(),ints),
+		   boost::make_shared_container_iterator(ints->end(),ints));
+  }
+  
+
+
+  return 0;
+}
+
+ +Observe that the shared_container_iterator type is never +explicitly named. The output from this example is the same as the previous. + +

The Shared Container Iterator Range Generator

+ +
+template <typename Container>
+std::pair<
+  shared_container_iterator<Container>,
+  shared_container_iterator<Container>
+>
+make_shared_container_range(boost::shared_ptr<Container> const& container);
+
+ +Class shared_container_iterator is meant primarily to return, +using iterators, a range of values that we can guarantee will be alive as +long as the iterators are. This is a convenience +function to do just that. It is equivalent to + +
+std::make_pair(make_shared_container_iterator(container->begin(),container),
+               make_shared_container_iterator(container->end(),container));
+
+ +

Example

+ +In the following example, a range of values is returned as a pair of +shared_container_iterator objects. + + +

+shared_iterator_example3.cpp: + +

+#include "shared_container_iterator.hpp"
+#include "boost/shared_ptr.hpp"
+#include "boost/tuple/tuple.hpp" // for boost::tie
+#include <algorithm>              // for std::copy
+#include <iostream>              
+#include <vector>
+
+
+typedef boost::shared_container_iterator< std::vector<int> > iterator; 
+
+std::pair<iterator,iterator>
+return_range() {
+  boost::shared_ptr< std::vector<int> > range(new std::vector<int>());
+  range->push_back(0);
+  range->push_back(1);
+  range->push_back(2);
+  range->push_back(3);
+  range->push_back(4);
+  range->push_back(5);
+  return boost::make_shared_container_range(range);
+}
+
+
+int main() {
+
+
+  iterator i,end;
+  
+  boost::tie(i,end) = return_range();
+
+  std::copy(i,end,std::ostream_iterator<int>(std::cout,","));
+  std::cout.put('\n');
+
+  return 0;
+}
+
+ +Though the range object only lives for the duration of the +return_range call, the reference counted +std::vector will live until i and end +are both destroyed. The output from this example is the same as +the previous two. + + +
+ +Last modified: Mon Aug 11 11:27:03 EST 2003 + +

© Copyright 2003 The Trustees of Indiana University. + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt)

+ + + + diff --git a/tools/boost_1_65_1/libs/utility/shared_iterator_example1.cpp b/tools/boost_1_65_1/libs/utility/shared_iterator_example1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f88e0944f5e919a89dc1f30c583b176aba85cc2c --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/shared_iterator_example1.cpp @@ -0,0 +1,42 @@ +// Copyright 2003 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/shared_container_iterator.hpp" +#include "boost/shared_ptr.hpp" +#include +#include +#include + +typedef boost::shared_container_iterator< std::vector > iterator; + + +void set_range(iterator& i, iterator& end) { + + boost::shared_ptr< std::vector > ints(new std::vector()); + + ints->push_back(0); + ints->push_back(1); + ints->push_back(2); + ints->push_back(3); + ints->push_back(4); + ints->push_back(5); + + i = iterator(ints->begin(),ints); + end = iterator(ints->end(),ints); +} + + +int main() { + + iterator i,end; + + set_range(i,end); + + std::copy(i,end,std::ostream_iterator(std::cout,",")); + std::cout.put('\n'); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/shared_iterator_example2.cpp b/tools/boost_1_65_1/libs/utility/shared_iterator_example2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a9577078c5cf4b83c5a9b6e6bf748d0284d8584b --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/shared_iterator_example2.cpp @@ -0,0 +1,43 @@ +// Copyright 2003 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/shared_container_iterator.hpp" +#include "boost/shared_ptr.hpp" +#include +#include +#include +#include + + +template +void print_range_nl (Iterator begin, Iterator end) { + typedef typename std::iterator_traits::value_type val; + std::copy(begin,end,std::ostream_iterator(std::cout,",")); + std::cout.put('\n'); +} + + +int main() { + + typedef boost::shared_ptr< std::vector > ints_t; + { + ints_t ints(new std::vector()); + + ints->push_back(0); + ints->push_back(1); + ints->push_back(2); + ints->push_back(3); + ints->push_back(4); + ints->push_back(5); + + print_range_nl(boost::make_shared_container_iterator(ints->begin(),ints), + boost::make_shared_container_iterator(ints->end(),ints)); + } + + + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/shared_iterator_example3.cpp b/tools/boost_1_65_1/libs/utility/shared_iterator_example3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5615d45470e08e0e2e9549cd8ebaa4d305537e2b --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/shared_iterator_example3.cpp @@ -0,0 +1,41 @@ +// Copyright 2003 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/shared_container_iterator.hpp" +#include "boost/shared_ptr.hpp" +#include "boost/tuple/tuple.hpp" // for boost::tie +#include // for std::copy +#include +#include + + +typedef boost::shared_container_iterator< std::vector > iterator; + +std::pair +return_range() { + boost::shared_ptr< std::vector > range(new std::vector()); + range->push_back(0); + range->push_back(1); + range->push_back(2); + range->push_back(3); + range->push_back(4); + range->push_back(5); + return boost::make_shared_container_range(range); +} + + +int main() { + + + iterator i,end; + + boost::tie(i,end) = return_range(); + + std::copy(i,end,std::ostream_iterator(std::cout,",")); + std::cout.put('\n'); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/sublibs b/tools/boost_1_65_1/libs/utility/sublibs new file mode 100644 index 0000000000000000000000000000000000000000..721d7c4a92882ef85d27b82b41fa8f2b7a27502f --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/sublibs @@ -0,0 +1 @@ +The existance of this file tells the regression reporting programs that the directory contains sub-directories which are libraries. \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/utility/test/Jamfile.v2 b/tools/boost_1_65_1/libs/utility/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..6708c47e4b35183da845a523585a94e3c15684be --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/Jamfile.v2 @@ -0,0 +1,56 @@ +# Copyright David Abrahams 2003. + +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt + +# For more information, see http://www.boost.org/ + +# bring in rules for testing +import testing ; + +alias unit_test_framework + : # sources + /boost//unit_test_framework + ; + +run base_from_member_test.cpp ; +run base_from_member_ref_test.cpp ; + +run binary_test.cpp ; + +run call_traits_test.cpp : -u ; + +run compressed_pair_test.cpp ../../test/build//boost_test_exec_monitor/static ; + +run iterators_test.cpp ../../test/build//boost_test_exec_monitor/static ; + +run next_prior_test.cpp ../../test/build//boost_test_exec_monitor/static ; + +run numeric_traits_test.cpp ; + +run operators_test.cpp ../../test/build//boost_test_exec_monitor/static ; + +compile result_of_test.cpp ; + +run shared_iterator_test.cpp ; + +# compile-fail string_ref_from_rvalue.cpp ; +run string_ref_test1.cpp unit_test_framework ; +run string_ref_test2.cpp unit_test_framework ; +run string_ref_test_io.cpp unit_test_framework ; +# compile-fail string_view_from_rvalue.cpp ; +compile string_view_constexpr_test1.cpp ; +run string_view_test1.cpp unit_test_framework ; +run string_view_test2.cpp unit_test_framework ; +run string_view_test_io.cpp unit_test_framework ; + +run value_init_test.cpp ; +run value_init_workaround_test.cpp ; +run initialized_test.cpp ; +compile-fail value_init_test_fail1.cpp ; +compile-fail value_init_test_fail2.cpp ; +compile-fail value_init_test_fail3.cpp ; +compile-fail initialized_test_fail1.cpp ; +compile-fail initialized_test_fail2.cpp ; + +run generator_iterator_test.cpp ; diff --git a/tools/boost_1_65_1/libs/utility/test/base_from_member_ref_test.cpp b/tools/boost_1_65_1/libs/utility/test/base_from_member_ref_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fc6f249b3e23a9479c3ac1babd535c375902b012 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/base_from_member_ref_test.cpp @@ -0,0 +1,29 @@ +// +// Test that a base_from_member can be properly constructed +// +// Copyright 2014 Agustin Berge +// +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// + +#include + +#include + +struct foo : boost::base_from_member +{ + explicit foo(int& ref) : boost::base_from_member(ref) + { + BOOST_TEST(&member == &ref); + } +}; + +int main() +{ + int i = 0; + foo f(i); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/utility/test/base_from_member_test.cpp b/tools/boost_1_65_1/libs/utility/test/base_from_member_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..538e8076eda014340f904b524191fa0707a9f51c --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/base_from_member_test.cpp @@ -0,0 +1,594 @@ +// Boost test program for base-from-member class templates -----------------// + +// Copyright 2001, 2003 Daryle Walker. Use, modification, and distribution are +// subject to the Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or a copy at .) + +// See for the library's home page. + +// Revision History +// 14 Jun 2003 Adjusted code for Boost.Test changes (Daryle Walker) +// 29 Aug 2001 Initial Version (Daryle Walker) + +#include // for BOOST_CHECK, main + +#include // for BOOST_NO_MEMBER_TEMPLATES +#include // for boost::exit_success +#include // for boost::noncopyable + +#include // for boost::base_from_member + +#include // for std::less +#include // for std::cout (std::ostream, std::endl indirectly) +#include // for std::set +#include // for std::type_info +#include // for std::pair, std::make_pair +#include // for std::vector + + +// Control if extra information is printed +#ifndef CONTROL_EXTRA_PRINTING +#define CONTROL_EXTRA_PRINTING 1 +#endif + + +// A (sub)object can be identified by its memory location and its type. +// Both are needed since an object can start at the same place as its +// first base class subobject and/or contained subobject. +typedef std::pair< void *, std::type_info const * > object_id; + +// Object IDs need to be printed +std::ostream & operator <<( std::ostream &os, object_id const &oi ); + +// A way to generate an object ID +template < typename T > + object_id identify( T &obj ); + +// A custom comparison type is needed +struct object_id_compare +{ + bool operator ()( object_id const &a, object_id const &b ) const; + +}; // object_id_compare + +// A singleton of this type coordinates the acknowledgements +// of objects being created and used. +class object_registrar + : private boost::noncopyable +{ +public: + + #ifndef BOOST_NO_MEMBER_TEMPLATES + template < typename T > + void register_object( T &obj ) + { this->register_object_imp( identify(obj) ); } + template < typename T, typename U > + void register_use( T &owner, U &owned ) + { this->register_use_imp( identify(owner), identify(owned) ); } + template < typename T, typename U > + void unregister_use( T &owner, U &owned ) + { this->unregister_use_imp( identify(owner), identify(owned) ); } + template < typename T > + void unregister_object( T &obj ) + { this->unregister_object_imp( identify(obj) ); } + #endif + + void register_object_imp( object_id obj ); + void register_use_imp( object_id owner, object_id owned ); + void unregister_use_imp( object_id owner, object_id owned ); + void unregister_object_imp( object_id obj ); + + typedef std::set set_type; + + typedef std::vector error_record_type; + typedef std::vector< std::pair > error_pair_type; + + set_type db_; + + error_pair_type defrauders_in_, defrauders_out_; + error_record_type overeager_, overkilled_; + +}; // object_registrar + +// A sample type to be used by containing types +class base_or_member +{ +public: + explicit base_or_member( int x = 1, double y = -0.25 ); + ~base_or_member(); + +}; // base_or_member + +// A sample type that uses base_or_member, used +// as a base for the main demonstration classes +class base_class +{ +public: + explicit base_class( base_or_member &x, base_or_member *y = 0, + base_or_member *z = 0 ); + + ~base_class(); + +private: + base_or_member *x_, *y_, *z_; + +}; // base_class + +// This bad class demonstrates the direct method of a base class needing +// to be initialized by a member. This is improper since the member +// isn't initialized until after the base class. +class bad_class + : public base_class +{ +public: + bad_class(); + ~bad_class(); + +private: + base_or_member x_; + +}; // bad_class + +// The first good class demonstrates the correct way to initialize a +// base class with a member. The member is changed to another base +// class, one that is initialized before the base that needs it. +class good_class_1 + : private boost::base_from_member + , public base_class +{ + typedef boost::base_from_member pbase_type; + typedef base_class base_type; + +public: + good_class_1(); + ~good_class_1(); + +}; // good_class_1 + +// The second good class also demonstrates the correct way to initialize +// base classes with other subobjects. This class uses the other helpers +// in the library, and shows the technique of using two base subobjects +// of the "same" type. +class good_class_2 + : private boost::base_from_member + , private boost::base_from_member + , private boost::base_from_member + , public base_class +{ + typedef boost::base_from_member pbase_type0; + typedef boost::base_from_member pbase_type1; + typedef boost::base_from_member pbase_type2; + typedef base_class base_type; + +public: + good_class_2(); + ~good_class_2(); + +}; // good_class_2 + +// Declare/define the single object registrar +object_registrar obj_reg; + + +// Main functionality +int +test_main( int , char * [] ) +{ + BOOST_CHECK( obj_reg.db_.empty() ); + BOOST_CHECK( obj_reg.defrauders_in_.empty() ); + BOOST_CHECK( obj_reg.defrauders_out_.empty() ); + BOOST_CHECK( obj_reg.overeager_.empty() ); + BOOST_CHECK( obj_reg.overkilled_.empty() ); + + // Make a separate block to examine pre- and post-effects + { + using std::cout; + using std::endl; + + bad_class bc; + BOOST_CHECK( obj_reg.db_.size() == 3 ); + BOOST_CHECK( obj_reg.defrauders_in_.size() == 1 ); + + good_class_1 gc1; + BOOST_CHECK( obj_reg.db_.size() == 6 ); + BOOST_CHECK( obj_reg.defrauders_in_.size() == 1 ); + + good_class_2 gc2; + BOOST_CHECK( obj_reg.db_.size() == 11 ); + BOOST_CHECK( obj_reg.defrauders_in_.size() == 1 ); + + BOOST_CHECK( obj_reg.defrauders_out_.empty() ); + BOOST_CHECK( obj_reg.overeager_.empty() ); + BOOST_CHECK( obj_reg.overkilled_.empty() ); + + // Getting the addresses of the objects ensure + // that they're used, and not optimized away. + cout << "Object 'bc' is at " << &bc << '.' << endl; + cout << "Object 'gc1' is at " << &gc1 << '.' << endl; + cout << "Object 'gc2' is at " << &gc2 << '.' << endl; + } + + BOOST_CHECK( obj_reg.db_.empty() ); + BOOST_CHECK( obj_reg.defrauders_in_.size() == 1 ); + BOOST_CHECK( obj_reg.defrauders_out_.size() == 1 ); + BOOST_CHECK( obj_reg.overeager_.empty() ); + BOOST_CHECK( obj_reg.overkilled_.empty() ); + + return boost::exit_success; +} + + +// Print an object's ID +std::ostream & +operator << +( + std::ostream & os, + object_id const & oi +) +{ + // I had an std::ostringstream to help, but I did not need it since + // the program never screws around with formatting. Worse, using + // std::ostringstream is an issue with some compilers. + + return os << '[' << ( oi.second ? oi.second->name() : "NOTHING" ) + << " at " << oi.first << ']'; +} + +// Get an object ID given an object +template < typename T > +inline +object_id +identify +( + T & obj +) +{ + return std::make_pair( static_cast(&obj), &(typeid( obj )) ); +} + +// Compare two object IDs +bool +object_id_compare::operator () +( + object_id const & a, + object_id const & b +) const +{ + std::less vp_cmp; + if ( vp_cmp(a.first, b.first) ) + { + return true; + } + else if ( vp_cmp(b.first, a.first) ) + { + return false; + } + else + { + // object pointers are equal, compare the types + if ( a.second == b.second ) + { + return false; + } + else if ( !a.second ) + { + return true; // NULL preceeds anything else + } + else if ( !b.second ) + { + return false; // NULL preceeds anything else + } + else + { + return a.second->before( *b.second ) != 0; + } + } +} + +// Let an object register its existence +void +object_registrar::register_object_imp +( + object_id obj +) +{ + if ( db_.count(obj) <= 0 ) + { + db_.insert( obj ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "Registered " << obj << '.' << std::endl; + #endif + } + else + { + overeager_.push_back( obj ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "Attempted to register a non-existant " << obj + << '.' << std::endl; + #endif + } +} + +// Let an object register its use of another object +void +object_registrar::register_use_imp +( + object_id owner, + object_id owned +) +{ + if ( db_.count(owned) > 0 ) + { + // We don't care to record usage registrations + } + else + { + defrauders_in_.push_back( std::make_pair(owner, owned) ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "Attempted to own a non-existant " << owned + << " by " << owner << '.' << std::endl; + #endif + } +} + +// Let an object un-register its use of another object +void +object_registrar::unregister_use_imp +( + object_id owner, + object_id owned +) +{ + if ( db_.count(owned) > 0 ) + { + // We don't care to record usage un-registrations + } + else + { + defrauders_out_.push_back( std::make_pair(owner, owned) ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "Attempted to disown a non-existant " << owned + << " by " << owner << '.' << std::endl; + #endif + } +} + +// Let an object un-register its existence +void +object_registrar::unregister_object_imp +( + object_id obj +) +{ + set_type::iterator const i = db_.find( obj ); + + if ( i != db_.end() ) + { + db_.erase( i ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "Unregistered " << obj << '.' << std::endl; + #endif + } + else + { + overkilled_.push_back( obj ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "Attempted to unregister a non-existant " << obj + << '.' << std::endl; + #endif + } +} + +// Macros to abstract the registration of objects +#ifndef BOOST_NO_MEMBER_TEMPLATES +#define PRIVATE_REGISTER_BIRTH(o) obj_reg.register_object( (o) ) +#define PRIVATE_REGISTER_DEATH(o) obj_reg.unregister_object( (o) ) +#define PRIVATE_REGISTER_USE(o, w) obj_reg.register_use( (o), (w) ) +#define PRIVATE_UNREGISTER_USE(o, w) obj_reg.unregister_use( (o), (w) ) +#else +#define PRIVATE_REGISTER_BIRTH(o) obj_reg.register_object_imp( \ + identify((o)) ) +#define PRIVATE_REGISTER_DEATH(o) obj_reg.unregister_object_imp( \ + identify((o)) ) +#define PRIVATE_REGISTER_USE(o, w) obj_reg.register_use_imp( identify((o)), \ + identify((w)) ) +#define PRIVATE_UNREGISTER_USE(o, w) obj_reg.unregister_use_imp( \ + identify((o)), identify((w)) ) +#endif + +// Create a base_or_member, with arguments to simulate member initializations +base_or_member::base_or_member +( + int x, // = 1 + double y // = -0.25 +) +{ + PRIVATE_REGISTER_BIRTH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy x-factor is " << x << " and my y-factor is " << y + << '.' << std::endl; + #endif +} + +// Destroy a base_or_member +inline +base_or_member::~base_or_member +( +) +{ + PRIVATE_REGISTER_DEATH( *this ); +} + +// Create a base_class, registering any objects used +base_class::base_class +( + base_or_member & x, + base_or_member * y, // = 0 + base_or_member * z // = 0 +) + : x_( &x ), y_( y ), z_( z ) +{ + PRIVATE_REGISTER_BIRTH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy x-factor is " << x_; + #endif + + PRIVATE_REGISTER_USE( *this, *x_ ); + + if ( y_ ) + { + #if CONTROL_EXTRA_PRINTING + std::cout << ", my y-factor is " << y_; + #endif + + PRIVATE_REGISTER_USE( *this, *y_ ); + } + + if ( z_ ) + { + #if CONTROL_EXTRA_PRINTING + std::cout << ", my z-factor is " << z_; + #endif + + PRIVATE_REGISTER_USE( *this, *z_ ); + } + + #if CONTROL_EXTRA_PRINTING + std::cout << '.' << std::endl; + #endif +} + +// Destroy a base_class, unregistering the objects it uses +base_class::~base_class +( +) +{ + PRIVATE_REGISTER_DEATH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy x-factor was " << x_; + #endif + + PRIVATE_UNREGISTER_USE( *this, *x_ ); + + if ( y_ ) + { + #if CONTROL_EXTRA_PRINTING + std::cout << ", my y-factor was " << y_; + #endif + + PRIVATE_UNREGISTER_USE( *this, *y_ ); + } + + if ( z_ ) + { + #if CONTROL_EXTRA_PRINTING + std::cout << ", my z-factor was " << z_; + #endif + + PRIVATE_UNREGISTER_USE( *this, *z_ ); + } + + #if CONTROL_EXTRA_PRINTING + std::cout << '.' << std::endl; + #endif +} + +// Create a bad_class, noting the improper construction order +bad_class::bad_class +( +) + : x_( -7, 16.75 ), base_class( x_ ) // this order doesn't matter +{ + PRIVATE_REGISTER_BIRTH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy factor is at " << &x_ + << " and my base is at " << static_cast(this) << '.' + << std::endl; + #endif +} + +// Destroy a bad_class, noting the improper destruction order +bad_class::~bad_class +( +) +{ + PRIVATE_REGISTER_DEATH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy factor was at " << &x_ + << " and my base was at " << static_cast(this) + << '.' << std::endl; + #endif +} + +// Create a good_class_1, noting the proper construction order +good_class_1::good_class_1 +( +) + : pbase_type( 8 ), base_type( member ) +{ + PRIVATE_REGISTER_BIRTH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy factor is at " << &member + << " and my base is at " << static_cast(this) << '.' + << std::endl; + #endif +} + +// Destroy a good_class_1, noting the proper destruction order +good_class_1::~good_class_1 +( +) +{ + PRIVATE_REGISTER_DEATH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy factor was at " << &member + << " and my base was at " << static_cast(this) + << '.' << std::endl; + #endif +} + +// Create a good_class_2, noting the proper construction order +good_class_2::good_class_2 +( +) + : pbase_type0(), pbase_type1(-16, 0.125), pbase_type2(2, -3) + , base_type( pbase_type1::member, &this->pbase_type0::member, + &this->pbase_type2::member ) +{ + PRIVATE_REGISTER_BIRTH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy factors are at " << &this->pbase_type0::member + << ", " << &this->pbase_type1::member << ", " + << &this->pbase_type2::member << ", and my base is at " + << static_cast(this) << '.' << std::endl; + #endif +} + +// Destroy a good_class_2, noting the proper destruction order +good_class_2::~good_class_2 +( +) +{ + PRIVATE_REGISTER_DEATH( *this ); + + #if CONTROL_EXTRA_PRINTING + std::cout << "\tMy factors were at " << &this->pbase_type0::member + << ", " << &this->pbase_type1::member << ", " + << &this->pbase_type2::member << ", and my base was at " + << static_cast(this) << '.' << std::endl; + #endif +} diff --git a/tools/boost_1_65_1/libs/utility/test/binary_test.cpp b/tools/boost_1_65_1/libs/utility/test/binary_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aacfab998e0945a40efee5807be5ed54cdacb29d --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/binary_test.cpp @@ -0,0 +1,647 @@ +/*============================================================================= + Copyright (c) 2006, 2007 Matthew Calabrese + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(disable:4996) // warning C4996: 'std::equal': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' +#endif + +/* +Note: This file tests every single valid bit-grouping on its own, and some + random combinations of bit-groupings. +*/ + +std::size_t const num_random_test_values = 32; + +// Note: These hex values should all correspond with the binary array below +unsigned int const random_unsigned_ints_hex[num_random_test_values] + = { 0x0103u, 0x77ebu, 0x5f36u, 0x1f18u, 0xc530u, 0xa73au, 0xd6f8u, 0x0919u + , 0xfbb0u, 0x3e7cu, 0xd0e9u, 0x22c8u, 0x724eu, 0x14fau, 0xd98eu, 0x40b5 + , 0xeba0u, 0xfe50u, 0x688au, 0x1b05u, 0x5f9cu, 0xe4fcu, 0xa7b8u, 0xd3acu + , 0x1dddu, 0xbf04u, 0x8352u, 0xe89cu, 0x7506u, 0xe767u, 0xf489u, 0xe167 + }; + +unsigned int const random_unsigned_ints_binary[num_random_test_values] + = { BOOST_BINARY( 0 00010000 0011 ), BOOST_BINARY( 0 11101 1111 101011 ) + , BOOST_BINARY( 010111 1100110 1 1 0 ), BOOST_BINARY( 000 1 11110 00 11000 ) + , BOOST_BINARY( 110 001010 0110 000 ), BOOST_BINARY( 1010 01110011 1010 ) + , BOOST_BINARY( 11 010 1 101111 1000 ), BOOST_BINARY( 0000 100100 0110 01 ) + , BOOST_BINARY( 1111 101110 11 0000 ), BOOST_BINARY( 00111110 01111100 ) + , BOOST_BINARY( 11 010 000111 01001 ), BOOST_BINARY( 00100 010110 01000 ) + , BOOST_BINARY( 01 11001001 001110 ), BOOST_BINARY( 0010 1001111 1010 ) + , BOOST_BINARY( 1101 1 00110 0 01110 ), BOOST_BINARY( 100 000 01011010 1 ) + , BOOST_BINARY( 11 1010 1110 1000 00 ), BOOST_BINARY( 11111 110010 10000 ) + , BOOST_BINARY( 01101 00010 001010 ), BOOST_BINARY( 000 11011 000001 01 ) + , BOOST_BINARY( 01 01111 1100111 00 ), BOOST_BINARY( 1 110010 0111111 00 ) + , BOOST_BINARY( 101 0011 11 01110 00 ), BOOST_BINARY( 110100 1 110101 100 ) + , BOOST_BINARY( 00 1110111 011 101 ), BOOST_BINARY( 1011 1111 00000 100 ) + , BOOST_BINARY( 1000 00110 101 0010 ), BOOST_BINARY( 1110 10001 001110 0 ) + , BOOST_BINARY( 011 1010100 000 110 ), BOOST_BINARY( 1110 0111 01100 111 ) + , BOOST_BINARY( 11110 10010 001001 ), BOOST_BINARY( 11 1000010 1100 111 ) + }; + +unsigned int const unsigned_ints_1_bit[2] = +{ BOOST_BINARY( 0 ) +, BOOST_BINARY( 1 ) +}; + +unsigned int const unsigned_ints_2_bits[4] = +{ BOOST_BINARY( 00 ) +, BOOST_BINARY( 01 ) +, BOOST_BINARY( 10 ) +, BOOST_BINARY( 11 ) +}; + +unsigned int const unsigned_ints_3_bits[8] = +{ BOOST_BINARY( 000 ) +, BOOST_BINARY( 001 ) +, BOOST_BINARY( 010 ) +, BOOST_BINARY( 011 ) +, BOOST_BINARY( 100 ) +, BOOST_BINARY( 101 ) +, BOOST_BINARY( 110 ) +, BOOST_BINARY( 111 ) +}; + +unsigned int const unsigned_ints_4_bits[16] = +{ BOOST_BINARY( 0000 ) +, BOOST_BINARY( 0001 ) +, BOOST_BINARY( 0010 ) +, BOOST_BINARY( 0011 ) +, BOOST_BINARY( 0100 ) +, BOOST_BINARY( 0101 ) +, BOOST_BINARY( 0110 ) +, BOOST_BINARY( 0111 ) +, BOOST_BINARY( 1000 ) +, BOOST_BINARY( 1001 ) +, BOOST_BINARY( 1010 ) +, BOOST_BINARY( 1011 ) +, BOOST_BINARY( 1100 ) +, BOOST_BINARY( 1101 ) +, BOOST_BINARY( 1110 ) +, BOOST_BINARY( 1111 ) +}; + +unsigned int const unsigned_ints_5_bits[32] = +{ BOOST_BINARY( 00000 ) +, BOOST_BINARY( 00001 ) +, BOOST_BINARY( 00010 ) +, BOOST_BINARY( 00011 ) +, BOOST_BINARY( 00100 ) +, BOOST_BINARY( 00101 ) +, BOOST_BINARY( 00110 ) +, BOOST_BINARY( 00111 ) +, BOOST_BINARY( 01000 ) +, BOOST_BINARY( 01001 ) +, BOOST_BINARY( 01010 ) +, BOOST_BINARY( 01011 ) +, BOOST_BINARY( 01100 ) +, BOOST_BINARY( 01101 ) +, BOOST_BINARY( 01110 ) +, BOOST_BINARY( 01111 ) +, BOOST_BINARY( 10000 ) +, BOOST_BINARY( 10001 ) +, BOOST_BINARY( 10010 ) +, BOOST_BINARY( 10011 ) +, BOOST_BINARY( 10100 ) +, BOOST_BINARY( 10101 ) +, BOOST_BINARY( 10110 ) +, BOOST_BINARY( 10111 ) +, BOOST_BINARY( 11000 ) +, BOOST_BINARY( 11001 ) +, BOOST_BINARY( 11010 ) +, BOOST_BINARY( 11011 ) +, BOOST_BINARY( 11100 ) +, BOOST_BINARY( 11101 ) +, BOOST_BINARY( 11110 ) +, BOOST_BINARY( 11111 ) +}; + +unsigned int const unsigned_ints_6_bits[64] = +{ BOOST_BINARY( 000000 ) +, BOOST_BINARY( 000001 ) +, BOOST_BINARY( 000010 ) +, BOOST_BINARY( 000011 ) +, BOOST_BINARY( 000100 ) +, BOOST_BINARY( 000101 ) +, BOOST_BINARY( 000110 ) +, BOOST_BINARY( 000111 ) +, BOOST_BINARY( 001000 ) +, BOOST_BINARY( 001001 ) +, BOOST_BINARY( 001010 ) +, BOOST_BINARY( 001011 ) +, BOOST_BINARY( 001100 ) +, BOOST_BINARY( 001101 ) +, BOOST_BINARY( 001110 ) +, BOOST_BINARY( 001111 ) +, BOOST_BINARY( 010000 ) +, BOOST_BINARY( 010001 ) +, BOOST_BINARY( 010010 ) +, BOOST_BINARY( 010011 ) +, BOOST_BINARY( 010100 ) +, BOOST_BINARY( 010101 ) +, BOOST_BINARY( 010110 ) +, BOOST_BINARY( 010111 ) +, BOOST_BINARY( 011000 ) +, BOOST_BINARY( 011001 ) +, BOOST_BINARY( 011010 ) +, BOOST_BINARY( 011011 ) +, BOOST_BINARY( 011100 ) +, BOOST_BINARY( 011101 ) +, BOOST_BINARY( 011110 ) +, BOOST_BINARY( 011111 ) +, BOOST_BINARY( 100000 ) +, BOOST_BINARY( 100001 ) +, BOOST_BINARY( 100010 ) +, BOOST_BINARY( 100011 ) +, BOOST_BINARY( 100100 ) +, BOOST_BINARY( 100101 ) +, BOOST_BINARY( 100110 ) +, BOOST_BINARY( 100111 ) +, BOOST_BINARY( 101000 ) +, BOOST_BINARY( 101001 ) +, BOOST_BINARY( 101010 ) +, BOOST_BINARY( 101011 ) +, BOOST_BINARY( 101100 ) +, BOOST_BINARY( 101101 ) +, BOOST_BINARY( 101110 ) +, BOOST_BINARY( 101111 ) +, BOOST_BINARY( 110000 ) +, BOOST_BINARY( 110001 ) +, BOOST_BINARY( 110010 ) +, BOOST_BINARY( 110011 ) +, BOOST_BINARY( 110100 ) +, BOOST_BINARY( 110101 ) +, BOOST_BINARY( 110110 ) +, BOOST_BINARY( 110111 ) +, BOOST_BINARY( 111000 ) +, BOOST_BINARY( 111001 ) +, BOOST_BINARY( 111010 ) +, BOOST_BINARY( 111011 ) +, BOOST_BINARY( 111100 ) +, BOOST_BINARY( 111101 ) +, BOOST_BINARY( 111110 ) +, BOOST_BINARY( 111111 ) +}; + +unsigned int const unsigned_ints_7_bits[128] = +{ BOOST_BINARY( 0000000 ) +, BOOST_BINARY( 0000001 ) +, BOOST_BINARY( 0000010 ) +, BOOST_BINARY( 0000011 ) +, BOOST_BINARY( 0000100 ) +, BOOST_BINARY( 0000101 ) +, BOOST_BINARY( 0000110 ) +, BOOST_BINARY( 0000111 ) +, BOOST_BINARY( 0001000 ) +, BOOST_BINARY( 0001001 ) +, BOOST_BINARY( 0001010 ) +, BOOST_BINARY( 0001011 ) +, BOOST_BINARY( 0001100 ) +, BOOST_BINARY( 0001101 ) +, BOOST_BINARY( 0001110 ) +, BOOST_BINARY( 0001111 ) +, BOOST_BINARY( 0010000 ) +, BOOST_BINARY( 0010001 ) +, BOOST_BINARY( 0010010 ) +, BOOST_BINARY( 0010011 ) +, BOOST_BINARY( 0010100 ) +, BOOST_BINARY( 0010101 ) +, BOOST_BINARY( 0010110 ) +, BOOST_BINARY( 0010111 ) +, BOOST_BINARY( 0011000 ) +, BOOST_BINARY( 0011001 ) +, BOOST_BINARY( 0011010 ) +, BOOST_BINARY( 0011011 ) +, BOOST_BINARY( 0011100 ) +, BOOST_BINARY( 0011101 ) +, BOOST_BINARY( 0011110 ) +, BOOST_BINARY( 0011111 ) +, BOOST_BINARY( 0100000 ) +, BOOST_BINARY( 0100001 ) +, BOOST_BINARY( 0100010 ) +, BOOST_BINARY( 0100011 ) +, BOOST_BINARY( 0100100 ) +, BOOST_BINARY( 0100101 ) +, BOOST_BINARY( 0100110 ) +, BOOST_BINARY( 0100111 ) +, BOOST_BINARY( 0101000 ) +, BOOST_BINARY( 0101001 ) +, BOOST_BINARY( 0101010 ) +, BOOST_BINARY( 0101011 ) +, BOOST_BINARY( 0101100 ) +, BOOST_BINARY( 0101101 ) +, BOOST_BINARY( 0101110 ) +, BOOST_BINARY( 0101111 ) +, BOOST_BINARY( 0110000 ) +, BOOST_BINARY( 0110001 ) +, BOOST_BINARY( 0110010 ) +, BOOST_BINARY( 0110011 ) +, BOOST_BINARY( 0110100 ) +, BOOST_BINARY( 0110101 ) +, BOOST_BINARY( 0110110 ) +, BOOST_BINARY( 0110111 ) +, BOOST_BINARY( 0111000 ) +, BOOST_BINARY( 0111001 ) +, BOOST_BINARY( 0111010 ) +, BOOST_BINARY( 0111011 ) +, BOOST_BINARY( 0111100 ) +, BOOST_BINARY( 0111101 ) +, BOOST_BINARY( 0111110 ) +, BOOST_BINARY( 0111111 ) +, BOOST_BINARY( 1000000 ) +, BOOST_BINARY( 1000001 ) +, BOOST_BINARY( 1000010 ) +, BOOST_BINARY( 1000011 ) +, BOOST_BINARY( 1000100 ) +, BOOST_BINARY( 1000101 ) +, BOOST_BINARY( 1000110 ) +, BOOST_BINARY( 1000111 ) +, BOOST_BINARY( 1001000 ) +, BOOST_BINARY( 1001001 ) +, BOOST_BINARY( 1001010 ) +, BOOST_BINARY( 1001011 ) +, BOOST_BINARY( 1001100 ) +, BOOST_BINARY( 1001101 ) +, BOOST_BINARY( 1001110 ) +, BOOST_BINARY( 1001111 ) +, BOOST_BINARY( 1010000 ) +, BOOST_BINARY( 1010001 ) +, BOOST_BINARY( 1010010 ) +, BOOST_BINARY( 1010011 ) +, BOOST_BINARY( 1010100 ) +, BOOST_BINARY( 1010101 ) +, BOOST_BINARY( 1010110 ) +, BOOST_BINARY( 1010111 ) +, BOOST_BINARY( 1011000 ) +, BOOST_BINARY( 1011001 ) +, BOOST_BINARY( 1011010 ) +, BOOST_BINARY( 1011011 ) +, BOOST_BINARY( 1011100 ) +, BOOST_BINARY( 1011101 ) +, BOOST_BINARY( 1011110 ) +, BOOST_BINARY( 1011111 ) +, BOOST_BINARY( 1100000 ) +, BOOST_BINARY( 1100001 ) +, BOOST_BINARY( 1100010 ) +, BOOST_BINARY( 1100011 ) +, BOOST_BINARY( 1100100 ) +, BOOST_BINARY( 1100101 ) +, BOOST_BINARY( 1100110 ) +, BOOST_BINARY( 1100111 ) +, BOOST_BINARY( 1101000 ) +, BOOST_BINARY( 1101001 ) +, BOOST_BINARY( 1101010 ) +, BOOST_BINARY( 1101011 ) +, BOOST_BINARY( 1101100 ) +, BOOST_BINARY( 1101101 ) +, BOOST_BINARY( 1101110 ) +, BOOST_BINARY( 1101111 ) +, BOOST_BINARY( 1110000 ) +, BOOST_BINARY( 1110001 ) +, BOOST_BINARY( 1110010 ) +, BOOST_BINARY( 1110011 ) +, BOOST_BINARY( 1110100 ) +, BOOST_BINARY( 1110101 ) +, BOOST_BINARY( 1110110 ) +, BOOST_BINARY( 1110111 ) +, BOOST_BINARY( 1111000 ) +, BOOST_BINARY( 1111001 ) +, BOOST_BINARY( 1111010 ) +, BOOST_BINARY( 1111011 ) +, BOOST_BINARY( 1111100 ) +, BOOST_BINARY( 1111101 ) +, BOOST_BINARY( 1111110 ) +, BOOST_BINARY( 1111111 ) +}; +unsigned int const unsigned_ints_8_bits[256] = +{ BOOST_BINARY( 00000000 ) +, BOOST_BINARY( 00000001 ) +, BOOST_BINARY( 00000010 ) +, BOOST_BINARY( 00000011 ) +, BOOST_BINARY( 00000100 ) +, BOOST_BINARY( 00000101 ) +, BOOST_BINARY( 00000110 ) +, BOOST_BINARY( 00000111 ) +, BOOST_BINARY( 00001000 ) +, BOOST_BINARY( 00001001 ) +, BOOST_BINARY( 00001010 ) +, BOOST_BINARY( 00001011 ) +, BOOST_BINARY( 00001100 ) +, BOOST_BINARY( 00001101 ) +, BOOST_BINARY( 00001110 ) +, BOOST_BINARY( 00001111 ) +, BOOST_BINARY( 00010000 ) +, BOOST_BINARY( 00010001 ) +, BOOST_BINARY( 00010010 ) +, BOOST_BINARY( 00010011 ) +, BOOST_BINARY( 00010100 ) +, BOOST_BINARY( 00010101 ) +, BOOST_BINARY( 00010110 ) +, BOOST_BINARY( 00010111 ) +, BOOST_BINARY( 00011000 ) +, BOOST_BINARY( 00011001 ) +, BOOST_BINARY( 00011010 ) +, BOOST_BINARY( 00011011 ) +, BOOST_BINARY( 00011100 ) +, BOOST_BINARY( 00011101 ) +, BOOST_BINARY( 00011110 ) +, BOOST_BINARY( 00011111 ) +, BOOST_BINARY( 00100000 ) +, BOOST_BINARY( 00100001 ) +, BOOST_BINARY( 00100010 ) +, BOOST_BINARY( 00100011 ) +, BOOST_BINARY( 00100100 ) +, BOOST_BINARY( 00100101 ) +, BOOST_BINARY( 00100110 ) +, BOOST_BINARY( 00100111 ) +, BOOST_BINARY( 00101000 ) +, BOOST_BINARY( 00101001 ) +, BOOST_BINARY( 00101010 ) +, BOOST_BINARY( 00101011 ) +, BOOST_BINARY( 00101100 ) +, BOOST_BINARY( 00101101 ) +, BOOST_BINARY( 00101110 ) +, BOOST_BINARY( 00101111 ) +, BOOST_BINARY( 00110000 ) +, BOOST_BINARY( 00110001 ) +, BOOST_BINARY( 00110010 ) +, BOOST_BINARY( 00110011 ) +, BOOST_BINARY( 00110100 ) +, BOOST_BINARY( 00110101 ) +, BOOST_BINARY( 00110110 ) +, BOOST_BINARY( 00110111 ) +, BOOST_BINARY( 00111000 ) +, BOOST_BINARY( 00111001 ) +, BOOST_BINARY( 00111010 ) +, BOOST_BINARY( 00111011 ) +, BOOST_BINARY( 00111100 ) +, BOOST_BINARY( 00111101 ) +, BOOST_BINARY( 00111110 ) +, BOOST_BINARY( 00111111 ) +, BOOST_BINARY( 01000000 ) +, BOOST_BINARY( 01000001 ) +, BOOST_BINARY( 01000010 ) +, BOOST_BINARY( 01000011 ) +, BOOST_BINARY( 01000100 ) +, BOOST_BINARY( 01000101 ) +, BOOST_BINARY( 01000110 ) +, BOOST_BINARY( 01000111 ) +, BOOST_BINARY( 01001000 ) +, BOOST_BINARY( 01001001 ) +, BOOST_BINARY( 01001010 ) +, BOOST_BINARY( 01001011 ) +, BOOST_BINARY( 01001100 ) +, BOOST_BINARY( 01001101 ) +, BOOST_BINARY( 01001110 ) +, BOOST_BINARY( 01001111 ) +, BOOST_BINARY( 01010000 ) +, BOOST_BINARY( 01010001 ) +, BOOST_BINARY( 01010010 ) +, BOOST_BINARY( 01010011 ) +, BOOST_BINARY( 01010100 ) +, BOOST_BINARY( 01010101 ) +, BOOST_BINARY( 01010110 ) +, BOOST_BINARY( 01010111 ) +, BOOST_BINARY( 01011000 ) +, BOOST_BINARY( 01011001 ) +, BOOST_BINARY( 01011010 ) +, BOOST_BINARY( 01011011 ) +, BOOST_BINARY( 01011100 ) +, BOOST_BINARY( 01011101 ) +, BOOST_BINARY( 01011110 ) +, BOOST_BINARY( 01011111 ) +, BOOST_BINARY( 01100000 ) +, BOOST_BINARY( 01100001 ) +, BOOST_BINARY( 01100010 ) +, BOOST_BINARY( 01100011 ) +, BOOST_BINARY( 01100100 ) +, BOOST_BINARY( 01100101 ) +, BOOST_BINARY( 01100110 ) +, BOOST_BINARY( 01100111 ) +, BOOST_BINARY( 01101000 ) +, BOOST_BINARY( 01101001 ) +, BOOST_BINARY( 01101010 ) +, BOOST_BINARY( 01101011 ) +, BOOST_BINARY( 01101100 ) +, BOOST_BINARY( 01101101 ) +, BOOST_BINARY( 01101110 ) +, BOOST_BINARY( 01101111 ) +, BOOST_BINARY( 01110000 ) +, BOOST_BINARY( 01110001 ) +, BOOST_BINARY( 01110010 ) +, BOOST_BINARY( 01110011 ) +, BOOST_BINARY( 01110100 ) +, BOOST_BINARY( 01110101 ) +, BOOST_BINARY( 01110110 ) +, BOOST_BINARY( 01110111 ) +, BOOST_BINARY( 01111000 ) +, BOOST_BINARY( 01111001 ) +, BOOST_BINARY( 01111010 ) +, BOOST_BINARY( 01111011 ) +, BOOST_BINARY( 01111100 ) +, BOOST_BINARY( 01111101 ) +, BOOST_BINARY( 01111110 ) +, BOOST_BINARY( 01111111 ) +, BOOST_BINARY( 10000000 ) +, BOOST_BINARY( 10000001 ) +, BOOST_BINARY( 10000010 ) +, BOOST_BINARY( 10000011 ) +, BOOST_BINARY( 10000100 ) +, BOOST_BINARY( 10000101 ) +, BOOST_BINARY( 10000110 ) +, BOOST_BINARY( 10000111 ) +, BOOST_BINARY( 10001000 ) +, BOOST_BINARY( 10001001 ) +, BOOST_BINARY( 10001010 ) +, BOOST_BINARY( 10001011 ) +, BOOST_BINARY( 10001100 ) +, BOOST_BINARY( 10001101 ) +, BOOST_BINARY( 10001110 ) +, BOOST_BINARY( 10001111 ) +, BOOST_BINARY( 10010000 ) +, BOOST_BINARY( 10010001 ) +, BOOST_BINARY( 10010010 ) +, BOOST_BINARY( 10010011 ) +, BOOST_BINARY( 10010100 ) +, BOOST_BINARY( 10010101 ) +, BOOST_BINARY( 10010110 ) +, BOOST_BINARY( 10010111 ) +, BOOST_BINARY( 10011000 ) +, BOOST_BINARY( 10011001 ) +, BOOST_BINARY( 10011010 ) +, BOOST_BINARY( 10011011 ) +, BOOST_BINARY( 10011100 ) +, BOOST_BINARY( 10011101 ) +, BOOST_BINARY( 10011110 ) +, BOOST_BINARY( 10011111 ) +, BOOST_BINARY( 10100000 ) +, BOOST_BINARY( 10100001 ) +, BOOST_BINARY( 10100010 ) +, BOOST_BINARY( 10100011 ) +, BOOST_BINARY( 10100100 ) +, BOOST_BINARY( 10100101 ) +, BOOST_BINARY( 10100110 ) +, BOOST_BINARY( 10100111 ) +, BOOST_BINARY( 10101000 ) +, BOOST_BINARY( 10101001 ) +, BOOST_BINARY( 10101010 ) +, BOOST_BINARY( 10101011 ) +, BOOST_BINARY( 10101100 ) +, BOOST_BINARY( 10101101 ) +, BOOST_BINARY( 10101110 ) +, BOOST_BINARY( 10101111 ) +, BOOST_BINARY( 10110000 ) +, BOOST_BINARY( 10110001 ) +, BOOST_BINARY( 10110010 ) +, BOOST_BINARY( 10110011 ) +, BOOST_BINARY( 10110100 ) +, BOOST_BINARY( 10110101 ) +, BOOST_BINARY( 10110110 ) +, BOOST_BINARY( 10110111 ) +, BOOST_BINARY( 10111000 ) +, BOOST_BINARY( 10111001 ) +, BOOST_BINARY( 10111010 ) +, BOOST_BINARY( 10111011 ) +, BOOST_BINARY( 10111100 ) +, BOOST_BINARY( 10111101 ) +, BOOST_BINARY( 10111110 ) +, BOOST_BINARY( 10111111 ) +, BOOST_BINARY( 11000000 ) +, BOOST_BINARY( 11000001 ) +, BOOST_BINARY( 11000010 ) +, BOOST_BINARY( 11000011 ) +, BOOST_BINARY( 11000100 ) +, BOOST_BINARY( 11000101 ) +, BOOST_BINARY( 11000110 ) +, BOOST_BINARY( 11000111 ) +, BOOST_BINARY( 11001000 ) +, BOOST_BINARY( 11001001 ) +, BOOST_BINARY( 11001010 ) +, BOOST_BINARY( 11001011 ) +, BOOST_BINARY( 11001100 ) +, BOOST_BINARY( 11001101 ) +, BOOST_BINARY( 11001110 ) +, BOOST_BINARY( 11001111 ) +, BOOST_BINARY( 11010000 ) +, BOOST_BINARY( 11010001 ) +, BOOST_BINARY( 11010010 ) +, BOOST_BINARY( 11010011 ) +, BOOST_BINARY( 11010100 ) +, BOOST_BINARY( 11010101 ) +, BOOST_BINARY( 11010110 ) +, BOOST_BINARY( 11010111 ) +, BOOST_BINARY( 11011000 ) +, BOOST_BINARY( 11011001 ) +, BOOST_BINARY( 11011010 ) +, BOOST_BINARY( 11011011 ) +, BOOST_BINARY( 11011100 ) +, BOOST_BINARY( 11011101 ) +, BOOST_BINARY( 11011110 ) +, BOOST_BINARY( 11011111 ) +, BOOST_BINARY( 11100000 ) +, BOOST_BINARY( 11100001 ) +, BOOST_BINARY( 11100010 ) +, BOOST_BINARY( 11100011 ) +, BOOST_BINARY( 11100100 ) +, BOOST_BINARY( 11100101 ) +, BOOST_BINARY( 11100110 ) +, BOOST_BINARY( 11100111 ) +, BOOST_BINARY( 11101000 ) +, BOOST_BINARY( 11101001 ) +, BOOST_BINARY( 11101010 ) +, BOOST_BINARY( 11101011 ) +, BOOST_BINARY( 11101100 ) +, BOOST_BINARY( 11101101 ) +, BOOST_BINARY( 11101110 ) +, BOOST_BINARY( 11101111 ) +, BOOST_BINARY( 11110000 ) +, BOOST_BINARY( 11110001 ) +, BOOST_BINARY( 11110010 ) +, BOOST_BINARY( 11110011 ) +, BOOST_BINARY( 11110100 ) +, BOOST_BINARY( 11110101 ) +, BOOST_BINARY( 11110110 ) +, BOOST_BINARY( 11110111 ) +, BOOST_BINARY( 11111000 ) +, BOOST_BINARY( 11111001 ) +, BOOST_BINARY( 11111010 ) +, BOOST_BINARY( 11111011 ) +, BOOST_BINARY( 11111100 ) +, BOOST_BINARY( 11111101 ) +, BOOST_BINARY( 11111110 ) +, BOOST_BINARY( 11111111 ) +}; + +struct left_is_not_one_less_than_right +{ + bool operator ()( unsigned int left, unsigned int right ) const + { + return right != left + 1; + } +}; + +template< std::size_t Size > +bool is_ascending_from_0_array( unsigned int const (&array)[Size] ) +{ + unsigned int const* const curr = array, + * const end = array + Size; + + return ( *curr == 0 ) + && ( std::adjacent_find( curr, end + , left_is_not_one_less_than_right() + ) + == end + ); +} + +std::size_t const unsigned_int_id = 1, + unsigned_long_int_id = 2; + +typedef char (&unsigned_int_id_type)[unsigned_int_id]; +typedef char (&unsigned_long_int_id_type)[unsigned_long_int_id]; + +// Note: Functions only used for type checking +unsigned_int_id_type binary_type_checker( unsigned int ); +unsigned_long_int_id_type binary_type_checker( unsigned long int ); + +int test_main( int, char *[] ) +{ + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_1_bit ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_2_bits ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_3_bits ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_4_bits ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_5_bits ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_6_bits ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_7_bits ) ); + BOOST_CHECK( is_ascending_from_0_array( unsigned_ints_8_bits ) ); + + BOOST_CHECK( std::equal( &random_unsigned_ints_hex[0] + , random_unsigned_ints_hex + num_random_test_values + , &random_unsigned_ints_binary[0] + ) + ); + + BOOST_CHECK( sizeof( binary_type_checker( BOOST_BINARY_U( 110100 1010 ) ) ) + == unsigned_int_id + ); + + BOOST_CHECK( sizeof( binary_type_checker( BOOST_BINARY_UL( 11110 ) ) ) + == unsigned_long_int_id + ); + + BOOST_CHECK( sizeof( binary_type_checker( BOOST_BINARY_LU( 10 0001 ) ) ) + == unsigned_long_int_id + ); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/call_traits_test.cpp b/tools/boost_1_65_1/libs/utility/test/call_traits_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e49b68a482030ef264e7fd502a4e519f9c9d0f1 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/call_traits_test.cpp @@ -0,0 +1,418 @@ +// boost::compressed_pair test program + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + + +// standalone test program for +// 18 Mar 2002: +// Changed some names to prevent conflicts with some new type_traits additions. +// 03 Oct 2000: +// Enabled extra tests for VC6. + +#include +#include +#include +#include +#include + +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(disable:4181) // : warning C4181: qualifier applied to reference type; ignored +#endif + +// a way prevent warnings for unused variables +template inline void unused_variable(const T&) {} + +// +// struct contained models a type that contains a type (for example std::pair) +// arrays are contained by value, and have to be treated as a special case: +// +template +struct contained +{ + // define our typedefs first, arrays are stored by value + // so value_type is not the same as result_type: + typedef typename boost::call_traits::param_type param_type; + typedef typename boost::call_traits::reference reference; + typedef typename boost::call_traits::const_reference const_reference; + typedef T value_type; + typedef typename boost::call_traits::value_type result_type; + + // stored value: + value_type v_; + + // constructors: + contained() {} + contained(param_type p) : v_(p){} + // return byval: + result_type value()const { return v_; } + // return by_ref: + reference get() { return v_; } + const_reference const_get()const { return v_; } + // pass value: + void call(param_type){} +private: + contained& operator=(const contained&); +}; + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct contained +{ + typedef typename boost::call_traits::param_type param_type; + typedef typename boost::call_traits::reference reference; + typedef typename boost::call_traits::const_reference const_reference; + typedef T value_type[N]; + typedef typename boost::call_traits::value_type result_type; + + value_type v_; + + contained(param_type p) + { + std::copy(p, p+N, v_); + } + // return byval: + result_type value()const { return v_; } + // return by_ref: + reference get() { return v_; } + const_reference const_get()const { return v_; } + void call(param_type){} +private: + contained& operator=(const contained&); +}; +#endif + +template +contained::value_type> test_wrap_type(const T& t) +{ + typedef typename boost::call_traits::value_type ct; + return contained(t); +} + +namespace test{ + +template +std::pair< + typename boost::call_traits::value_type, + typename boost::call_traits::value_type> + make_pair(const T1& t1, const T2& t2) +{ + return std::pair< + typename boost::call_traits::value_type, + typename boost::call_traits::value_type>(t1, t2); +} + +} // namespace test + +using namespace std; + +// +// struct call_traits_checker: +// verifies behaviour of contained example: +// +template +struct call_traits_checker +{ + typedef typename boost::call_traits::param_type param_type; + void operator()(param_type); +}; + +template +void call_traits_checker::operator()(param_type p) +{ + T t(p); + contained c(t); + cout << "checking contained<" << typeid(T).name() << ">..." << endl; + BOOST_CHECK(t == c.value()); + BOOST_CHECK(t == c.get()); + BOOST_CHECK(t == c.const_get()); +#ifndef __ICL + //cout << "typeof contained<" << typeid(T).name() << ">::v_ is: " << typeid(&contained::v_).name() << endl; + cout << "typeof contained<" << typeid(T).name() << ">::value() is: " << typeid(&contained::value).name() << endl; + cout << "typeof contained<" << typeid(T).name() << ">::get() is: " << typeid(&contained::get).name() << endl; + cout << "typeof contained<" << typeid(T).name() << ">::const_get() is: " << typeid(&contained::const_get).name() << endl; + cout << "typeof contained<" << typeid(T).name() << ">::call() is: " << typeid(&contained::call).name() << endl; + cout << endl; +#endif +} + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct call_traits_checker +{ + typedef typename boost::call_traits::param_type param_type; + void operator()(param_type t) + { + contained c(t); + cout << "checking contained<" << typeid(T[N]).name() << ">..." << endl; + unsigned int i = 0; + for(i = 0; i < N; ++i) + BOOST_CHECK(t[i] == c.value()[i]); + for(i = 0; i < N; ++i) + BOOST_CHECK(t[i] == c.get()[i]); + for(i = 0; i < N; ++i) + BOOST_CHECK(t[i] == c.const_get()[i]); + + cout << "typeof contained<" << typeid(T[N]).name() << ">::v_ is: " << typeid(&contained::v_).name() << endl; + cout << "typeof contained<" << typeid(T[N]).name() << ">::value is: " << typeid(&contained::value).name() << endl; + cout << "typeof contained<" << typeid(T[N]).name() << ">::get is: " << typeid(&contained::get).name() << endl; + cout << "typeof contained<" << typeid(T[N]).name() << ">::const_get is: " << typeid(&contained::const_get).name() << endl; + cout << "typeof contained<" << typeid(T[N]).name() << ">::call is: " << typeid(&contained::call).name() << endl; + cout << endl; + } +}; +#endif + +// +// check_wrap: +template +void check_wrap(const W& w, const U& u) +{ + cout << "checking " << typeid(W).name() << "..." << endl; + BOOST_CHECK(w.value() == u); +} + +// +// check_make_pair: +// verifies behaviour of "make_pair": +// +template +void check_make_pair(T c, U u, V v) +{ + cout << "checking std::pair<" << typeid(c.first).name() << ", " << typeid(c.second).name() << ">..." << endl; + BOOST_CHECK(c.first == u); + BOOST_CHECK(c.second == v); + cout << endl; +} + + +struct comparible_UDT +{ + int i_; + comparible_UDT() : i_(2){} + comparible_UDT(const comparible_UDT& other) : i_(other.i_){} + comparible_UDT& operator=(const comparible_UDT& other) + { + i_ = other.i_; + return *this; + } + bool operator == (const comparible_UDT& v){ return v.i_ == i_; } +}; + +int main() +{ + call_traits_checker c1; + comparible_UDT u; + c1(u); + call_traits_checker c2; + call_traits_checker c2b; + int i = 2; + c2(i); + c2b(one); + int* pi = &i; + int a[2] = {1,2}; +#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) && !defined(__ICL) + call_traits_checker c3; + c3(pi); + call_traits_checker c4; + c4(i); + call_traits_checker c5; + c5(i); +#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__MWERKS__) && !defined(__SUNPRO_CC) + call_traits_checker c6; + c6(a); +#endif +#endif + + check_wrap(test_wrap_type(2), 2); +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__SUNPRO_CC) + check_wrap(test_wrap_type(a), a); + check_make_pair(test::make_pair(a, a), a, a); +#endif + + // cv-qualifiers applied to reference types should have no effect + // declare these here for later use with is_reference and remove_reference: + typedef int& r_type; + typedef const r_type cr_type; + + BOOST_CHECK_TYPE(comparible_UDT, boost::call_traits::value_type); + BOOST_CHECK_TYPE(comparible_UDT&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const comparible_UDT&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const comparible_UDT&, boost::call_traits::param_type); + BOOST_CHECK_TYPE(int, boost::call_traits::value_type); + BOOST_CHECK_TYPE(int&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const int&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const int, boost::call_traits::param_type); + BOOST_CHECK_TYPE(int*, boost::call_traits::value_type); + BOOST_CHECK_TYPE(int*&, boost::call_traits::reference); + BOOST_CHECK_TYPE(int*const&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(int*const, boost::call_traits::param_type); +#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) + BOOST_CHECK_TYPE(int&, boost::call_traits::value_type); + BOOST_CHECK_TYPE(int&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const int&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(int&, boost::call_traits::param_type); +#if !(defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC__ == 3) && (__GNUC_MINOR__ < 1))) + BOOST_CHECK_TYPE(int&, boost::call_traits::value_type); + BOOST_CHECK_TYPE(int&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const int&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(int&, boost::call_traits::param_type); +#else + std::cout << "Your compiler cannot instantiate call_traits, skipping four tests (4 errors)" << std::endl; +#endif + BOOST_CHECK_TYPE(const int&, boost::call_traits::value_type); + BOOST_CHECK_TYPE(const int&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const int&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const int&, boost::call_traits::param_type); +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_CHECK_TYPE(const int*, boost::call_traits::value_type); + BOOST_CHECK_TYPE(int(&)[3], boost::call_traits::reference); + BOOST_CHECK_TYPE(const int(&)[3], boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const int*const, boost::call_traits::param_type); + BOOST_CHECK_TYPE(const int*, boost::call_traits::value_type); + BOOST_CHECK_TYPE(const int(&)[3], boost::call_traits::reference); + BOOST_CHECK_TYPE(const int(&)[3], boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const int*const, boost::call_traits::param_type); + // test with abstract base class: + BOOST_CHECK_TYPE(test_abc1, boost::call_traits::value_type); + BOOST_CHECK_TYPE(test_abc1&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const test_abc1&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const test_abc1&, boost::call_traits::param_type); +#else + std::cout << "You're compiler does not support partial template specialiation, skipping 8 tests (8 errors)" << std::endl; +#endif +#else + std::cout << "You're compiler does not support partial template specialiation, skipping 20 tests (20 errors)" << std::endl; +#endif + // test with an incomplete type: + BOOST_CHECK_TYPE(incomplete_type, boost::call_traits::value_type); + BOOST_CHECK_TYPE(incomplete_type&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const incomplete_type&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const incomplete_type&, boost::call_traits::param_type); + // test enum: + BOOST_CHECK_TYPE(enum_UDT, boost::call_traits::value_type); + BOOST_CHECK_TYPE(enum_UDT&, boost::call_traits::reference); + BOOST_CHECK_TYPE(const enum_UDT&, boost::call_traits::const_reference); + BOOST_CHECK_TYPE(const enum_UDT, boost::call_traits::param_type); + return 0; +} + +// +// define call_traits tests to check that the assertions in the docs do actually work +// this is an compile-time only set of tests: +// +template +struct call_traits_test +{ + typedef ::boost::call_traits ct; + typedef typename ct::param_type param_type; + typedef typename ct::reference reference; + typedef typename ct::const_reference const_reference; + typedef typename ct::value_type value_type; + static void assert_construct(param_type val); +}; + +template +void call_traits_test::assert_construct(typename call_traits_test::param_type val) +{ + // + // this is to check that the call_traits assertions are valid: + T t(val); + value_type v(t); + reference r(t); + const_reference cr(t); + param_type p(t); + value_type v2(v); + value_type v3(r); + value_type v4(p); + reference r2(v); + reference r3(r); + const_reference cr2(v); + const_reference cr3(r); + const_reference cr4(cr); + const_reference cr5(p); + param_type p2(v); + param_type p3(r); + param_type p4(p); + + unused_variable(v2); + unused_variable(v3); + unused_variable(v4); + unused_variable(r2); + unused_variable(r3); + unused_variable(cr2); + unused_variable(cr3); + unused_variable(cr4); + unused_variable(cr5); + unused_variable(p2); + unused_variable(p3); + unused_variable(p4); +} +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct call_traits_test +{ + typedef ::boost::call_traits ct; + typedef typename ct::param_type param_type; + typedef typename ct::reference reference; + typedef typename ct::const_reference const_reference; + typedef typename ct::value_type value_type; + static void assert_construct(param_type val); +}; + +template +void call_traits_test::assert_construct(typename boost::call_traits::param_type val) +{ + // + // this is to check that the call_traits assertions are valid: + T t; + value_type v(t); + value_type v5(val); + reference r = t; + const_reference cr = t; + reference r2 = r; + #ifndef __BORLANDC__ + // C++ Builder buglet: + const_reference cr2 = r; + #endif + param_type p(t); + value_type v2(v); + const_reference cr3 = cr; + value_type v3(r); + value_type v4(p); + param_type p2(v); + param_type p3(r); + param_type p4(p); + + unused_variable(v2); + unused_variable(v3); + unused_variable(v4); + unused_variable(v5); +#ifndef __BORLANDC__ + unused_variable(r2); + unused_variable(cr2); +#endif + unused_variable(cr3); + unused_variable(p2); + unused_variable(p3); + unused_variable(p4); +} +#endif //BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +// +// now check call_traits assertions by instantiating call_traits_test: +template struct call_traits_test; +template struct call_traits_test; +template struct call_traits_test; +#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) +template struct call_traits_test; +template struct call_traits_test; +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__SUNPRO_CC) +template struct call_traits_test; +#endif +#endif + diff --git a/tools/boost_1_65_1/libs/utility/test/compressed_pair_test.cpp b/tools/boost_1_65_1/libs/utility/test/compressed_pair_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7687f0a0aa4e3ba9e27e0c04bf878a102c90156d --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/compressed_pair_test.cpp @@ -0,0 +1,395 @@ +// boost::compressed_pair test program + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +// standalone test program for +// Revised 03 Oct 2000: +// Enabled tests for VC6. + +#include +#include +#include + +#include +#include + +using namespace boost; + +struct empty_UDT +{ + ~empty_UDT(){}; + empty_UDT& operator=(const empty_UDT&){ return *this; } + bool operator==(const empty_UDT&)const + { return true; } +}; +struct empty_POD_UDT +{ + empty_POD_UDT& operator=(const empty_POD_UDT&){ return *this; } + bool operator==(const empty_POD_UDT&)const + { return true; } +}; + +struct non_empty1 +{ + int i; + non_empty1() : i(1){} + non_empty1(int v) : i(v){} + friend bool operator==(const non_empty1& a, const non_empty1& b) + { return a.i == b.i; } +}; + +struct non_empty2 +{ + int i; + non_empty2() : i(3){} + non_empty2(int v) : i(v){} + friend bool operator==(const non_empty2& a, const non_empty2& b) + { return a.i == b.i; } +}; + +#ifdef __GNUC__ +using std::swap; +#endif + +template +struct compressed_pair_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +{ +#ifndef __GNUC__ + // gcc 2.90 can't cope with function scope using + // declarations, and generates an internal compiler error... + using std::swap; +#endif + // default construct: + boost::compressed_pair cp1; + // first param construct: + boost::compressed_pair cp2(p1); + cp2.second() = p2; + BOOST_CHECK(cp2.first() == p1); + BOOST_CHECK(cp2.second() == p2); + // second param construct: + boost::compressed_pair cp3(p2); + cp3.first() = p1; + BOOST_CHECK(cp3.second() == p2); + BOOST_CHECK(cp3.first() == p1); + // both param construct: + boost::compressed_pair cp4(p1, p2); + BOOST_CHECK(cp4.first() == p1); + BOOST_CHECK(cp4.second() == p2); + boost::compressed_pair cp5(p3, p4); + BOOST_CHECK(cp5.first() == p3); + BOOST_CHECK(cp5.second() == p4); + // check const members: + const boost::compressed_pair& cpr1 = cp4; + BOOST_CHECK(cpr1.first() == p1); + BOOST_CHECK(cpr1.second() == p2); + + // copy construct: + boost::compressed_pair cp6(cp4); + BOOST_CHECK(cp6.first() == p1); + BOOST_CHECK(cp6.second() == p2); + // assignment: + cp1 = cp4; + BOOST_CHECK(cp1.first() == p1); + BOOST_CHECK(cp1.second() == p2); + cp1 = cp5; + BOOST_CHECK(cp1.first() == p3); + BOOST_CHECK(cp1.second() == p4); + // swap: + cp4.swap(cp5); + BOOST_CHECK(cp4.first() == p3); + BOOST_CHECK(cp4.second() == p4); + BOOST_CHECK(cp5.first() == p1); + BOOST_CHECK(cp5.second() == p2); + swap(cp4,cp5); + BOOST_CHECK(cp4.first() == p1); + BOOST_CHECK(cp4.second() == p2); + BOOST_CHECK(cp5.first() == p3); + BOOST_CHECK(cp5.second() == p4); +} + +// +// tests for case where one or both +// parameters are reference types: +// +template +struct compressed_pair_reference_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_reference_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +{ +#ifndef __GNUC__ + // gcc 2.90 can't cope with function scope using + // declarations, and generates an internal compiler error... + using std::swap; +#endif + // both param construct: + boost::compressed_pair cp4(p1, p2); + BOOST_CHECK(cp4.first() == p1); + BOOST_CHECK(cp4.second() == p2); + boost::compressed_pair cp5(p3, p4); + BOOST_CHECK(cp5.first() == p3); + BOOST_CHECK(cp5.second() == p4); + // check const members: + const boost::compressed_pair& cpr1 = cp4; + BOOST_CHECK(cpr1.first() == p1); + BOOST_CHECK(cpr1.second() == p2); + + // copy construct: + boost::compressed_pair cp6(cp4); + BOOST_CHECK(cp6.first() == p1); + BOOST_CHECK(cp6.second() == p2); + // assignment: + // VC6 bug: + // When second() is an empty class, VC6 performs the + // assignment by doing a memcpy - even though the empty + // class is really a zero sized base class, the result + // is that the memory of first() gets trampled over. + // Similar arguments apply to the case that first() is + // an empty base class. + // Strangely the problem is dependent upon the compiler + // settings - some generate the problem others do not. + cp4.first() = p3; + cp4.second() = p4; + BOOST_CHECK(cp4.first() == p3); + BOOST_CHECK(cp4.second() == p4); +} +// +// supplimentary tests for case where first arg only is a reference type: +// +template +struct compressed_pair_reference1_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_reference1_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) +{ +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + // first param construct: + boost::compressed_pair cp2(p1); + cp2.second() = p2; + BOOST_CHECK(cp2.first() == p1); + BOOST_CHECK(cp2.second() == p2); +#endif +} +// +// supplimentary tests for case where second arg only is a reference type: +// +template +struct compressed_pair_reference2_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_reference2_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) +{ +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + // second param construct: + boost::compressed_pair cp3(p2); + cp3.first() = p1; + BOOST_CHECK(cp3.second() == p2); + BOOST_CHECK(cp3.first() == p1); +#endif +} + +// +// tests for where one or the other parameter is an array: +// +template +struct compressed_pair_array1_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_array1_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) +{ + // default construct: + boost::compressed_pair cp1; + // second param construct: + boost::compressed_pair cp3(p2); + cp3.first()[0] = p1[0]; + BOOST_CHECK(cp3.second() == p2); + BOOST_CHECK(cp3.first()[0] == p1[0]); + // check const members: + const boost::compressed_pair& cpr1 = cp3; + BOOST_CHECK(cpr1.first()[0] == p1[0]); + BOOST_CHECK(cpr1.second() == p2); + + BOOST_CHECK(sizeof(T1) == sizeof(cp1.first())); +} + +template +struct compressed_pair_array2_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_array2_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) +{ + // default construct: + boost::compressed_pair cp1; + // first param construct: + boost::compressed_pair cp2(p1); + cp2.second()[0] = p2[0]; + BOOST_CHECK(cp2.first() == p1); + BOOST_CHECK(cp2.second()[0] == p2[0]); + // check const members: + const boost::compressed_pair& cpr1 = cp2; + BOOST_CHECK(cpr1.first() == p1); + BOOST_CHECK(cpr1.second()[0] == p2[0]); + + BOOST_CHECK(sizeof(T2) == sizeof(cp1.second())); +} + +template +struct compressed_pair_array_tester +{ + // define the types we need: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + // define our test proc: + static void test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4); +}; + +template +void compressed_pair_array_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) +{ + // default construct: + boost::compressed_pair cp1; + cp1.first()[0] = p1[0]; + cp1.second()[0] = p2[0]; + BOOST_CHECK(cp1.first()[0] == p1[0]); + BOOST_CHECK(cp1.second()[0] == p2[0]); + // check const members: + const boost::compressed_pair& cpr1 = cp1; + BOOST_CHECK(cpr1.first()[0] == p1[0]); + BOOST_CHECK(cpr1.second()[0] == p2[0]); + + BOOST_CHECK(sizeof(T1) == sizeof(cp1.first())); + BOOST_CHECK(sizeof(T2) == sizeof(cp1.second())); +} + +int test_main(int, char *[]) +{ + // declare some variables to pass to the tester: + non_empty1 ne1(2); + non_empty1 ne2(3); + non_empty2 ne3(4); + non_empty2 ne4(5); + empty_POD_UDT e1; + empty_UDT e2; + + // T1 != T2, both non-empty + compressed_pair_tester::test(ne1, ne3, ne2, ne4); + // T1 != T2, T2 empty + compressed_pair_tester::test(ne1, e1, ne2, e1); + // T1 != T2, T1 empty + compressed_pair_tester::test(e1, ne3, e1, ne4); + // T1 != T2, both empty + compressed_pair_tester::test(e1, e2, e1, e2); + // T1 == T2, both non-empty + compressed_pair_tester::test(ne1, ne1, ne2, ne2); + // T1 == T2, both empty + compressed_pair_tester::test(e2, e2, e2, e2); + + + // test references: + + // T1 != T2, both non-empty + compressed_pair_reference_tester::test(ne1, ne3, ne2, ne4); + compressed_pair_reference_tester::test(ne1, ne3, ne2, ne4); + compressed_pair_reference1_tester::test(ne1, ne3, ne2, ne4); + compressed_pair_reference2_tester::test(ne1, ne3, ne2, ne4); + // T1 != T2, T2 empty + compressed_pair_reference_tester::test(ne1, e1, ne2, e1); + compressed_pair_reference1_tester::test(ne1, e1, ne2, e1); + // T1 != T2, T1 empty + compressed_pair_reference_tester::test(e1, ne3, e1, ne4); + compressed_pair_reference2_tester::test(e1, ne3, e1, ne4); + // T1 == T2, both non-empty + compressed_pair_reference_tester::test(ne1, ne1, ne2, ne2); + + // tests arrays: + non_empty1 nea1[2]; + non_empty1 nea2[2]; + non_empty2 nea3[2]; + non_empty2 nea4[2]; + nea1[0] = non_empty1(5); + nea2[0] = non_empty1(6); + nea3[0] = non_empty2(7); + nea4[0] = non_empty2(8); + + // T1 != T2, both non-empty + compressed_pair_array1_tester::test(nea1, ne3, nea2, ne4); + compressed_pair_array2_tester::test(ne1, nea3, ne2, nea4); + compressed_pair_array_tester::test(nea1, nea3, nea2, nea4); + // T1 != T2, T2 empty + compressed_pair_array1_tester::test(nea1, e1, nea2, e1); + // T1 != T2, T1 empty + compressed_pair_array2_tester::test(e1, nea3, e1, nea4); + // T1 == T2, both non-empty + compressed_pair_array_tester::test(nea1, nea1, nea2, nea2); + return 0; +} + + +unsigned int expected_failures = 0; + + + + + diff --git a/tools/boost_1_65_1/libs/utility/test/generator_iterator_test.cpp b/tools/boost_1_65_1/libs/utility/test/generator_iterator_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c7a1104071c9c53818f2eca5d3ec8f6def97bbb --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/generator_iterator_test.cpp @@ -0,0 +1,63 @@ +// +// Copyright 2014 Peter Dimov +// +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// + +#include +#include +#include + +class X +{ +private: + + int v; + +public: + + typedef int result_type; + + X(): v( 0 ) + { + } + + int operator()() + { + return ++v; + } +}; + +template OutputIterator copy_n( InputIterator first, Size n, OutputIterator result ) +{ + while( n-- > 0 ) + { + *result++ = *first++; + } + + return result; +} + +void copy_test() +{ + X x; + boost::generator_iterator in( &x ); + + int const N = 4; + int v[ N ] = { 0 }; + + ::copy_n( in, 4, v ); + + BOOST_TEST_EQ( v[0], 1 ); + BOOST_TEST_EQ( v[1], 2 ); + BOOST_TEST_EQ( v[2], 3 ); + BOOST_TEST_EQ( v[3], 4 ); +} + +int main() +{ + copy_test(); + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/utility/test/initialized_test.cpp b/tools/boost_1_65_1/libs/utility/test/initialized_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9380957a3a8320b7fee7b3d2bc3e3ac204a98a60 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/initialized_test.cpp @@ -0,0 +1,116 @@ +// Copyright 2010, Niels Dekker. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for boost::initialized. +// +// 2 May 2010 (Created) Niels Dekker + +#include +#include + +#include + +namespace +{ + // Typical use case for boost::initialized: A generic class that + // holds a value of type T, which must be initialized by either + // value-initialization or direct-initialization. + template class key_value_pair + { + std::string m_key; + boost::initialized m_value; + public: + + // Value-initializes the object held by m_value. + key_value_pair() { } + + // Value-initializes the object held by m_value. + explicit key_value_pair(const std::string& key) + : + m_key(key) + { + } + + // Direct-initializes the object held by m_value. + key_value_pair(const std::string& key, const T& value) + : + m_key(key), m_value(value) + { + } + + const T& get_value() const + { + return m_value; + } + }; + + + // Tells whether the argument is value-initialized. + bool is_value_initialized(const int& arg) + { + return arg == 0; + } + + + // Tells whether the argument is value-initialized. + bool is_value_initialized(const std::string& arg) + { + return arg.empty(); + } + + struct foo + { + int data; + }; + + bool operator==(const foo& lhs, const foo& rhs) + { + return lhs.data == rhs.data; + } + + + // Tells whether the argument is value-initialized. + bool is_value_initialized(const foo& arg) + { + return arg.data == 0; + } + + + template + void test_key_value_pair(const T& magic_value) + { + // The value component of a default key_value_pair must be value-initialized. + key_value_pair default_key_value_pair; + BOOST_TEST( is_value_initialized(default_key_value_pair.get_value() ) ); + + // The value component of a key_value_pair that only has its key explicitly specified + // must also be value-initialized. + BOOST_TEST( is_value_initialized(key_value_pair("key").get_value()) ); + + // However, the value component of the following key_value_pair must be + // "magic_value", as it must be direct-initialized. + BOOST_TEST( key_value_pair("key", magic_value).get_value() == magic_value ); + } +} + + +// Tests boost::initialize for a fundamental type, a type with a +// user-defined constructor, and a user-defined type without +// a user-defined constructor. +int main() +{ + + const int magic_number = 42; + test_key_value_pair(magic_number); + + const std::string magic_string = "magic value"; + test_key_value_pair(magic_string); + + const foo magic_foo = { 42 }; + test_key_value_pair(magic_foo); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/utility/test/initialized_test_fail1.cpp b/tools/boost_1_65_1/libs/utility/test/initialized_test_fail1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ffeecab5bb1fc2968a5570bbe581a9d11d43041d --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/initialized_test_fail1.cpp @@ -0,0 +1,33 @@ +// Copyright 2010, Niels Dekker. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for boost::initialized. Must fail to compile. +// +// Initial: 2 May 2010 + +#include + +namespace +{ + void direct_initialize_from_int() + { + // Okay: initialized supports direct-initialization from T. + boost::initialized direct_initialized_int(1); + } + + void copy_initialize_from_int() + { + // The following line should not compile, because initialized + // was not intended to supports copy-initialization from T. + boost::initialized copy_initialized_int = 1; + } +} + +int main() +{ + // This should fail to compile, so there is no need to call any function. + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/initialized_test_fail2.cpp b/tools/boost_1_65_1/libs/utility/test/initialized_test_fail2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f3fbf391e1bd8bac0ba55d35d569e40f2f6657f3 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/initialized_test_fail2.cpp @@ -0,0 +1,37 @@ +// Copyright 2010, Niels Dekker. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for boost::initialized. Must fail to compile. +// +// Initial: 2 May 2010 + +#include + +namespace +{ + void from_value_initialized_to_initialized() + { + boost::value_initialized value_initialized_int; + + // Okay: initialized can be initialized by value_initialized. + boost::initialized initialized_int(value_initialized_int); + } + + void from_initialized_to_value_initialized() + { + boost::initialized initialized_int(13); + + // The following line should not compile, because initialized + // should not be convertible to value_initialized. + boost::value_initialized value_initialized_int(initialized_int); + } +} + +int main() +{ + // This should fail to compile, so there is no need to call any function. + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/iterators_test.cpp b/tools/boost_1_65_1/libs/utility/test/iterators_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7ac1191bd7590cfc08246f39708bb474dc1af644 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/iterators_test.cpp @@ -0,0 +1,324 @@ +// Demonstrate and test boost/operators.hpp on std::iterators --------------// + +// (C) Copyright Jeremy Siek 1999. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 29 May 01 Factored implementation, added comparison tests, use Test Tools +// library (Daryle Walker) +// 12 Dec 99 Initial version with iterator operators (Jeremy Siek) + +#define BOOST_INCLUDE_MAIN +#include // for main + +#include // for BOOST_STATIC_CONSTANT +#include // for boost::exit_success +#include // for boost::random_access_iterator_helper + +#include // for std::ptrdiff_t, std::size_t +#include // for std::strcmp +#include // for std::cout (std::endl, ends, and flush indirectly) +#include // for std::string +#include // for std::stringstream + +# ifdef BOOST_NO_STDC_NAMESPACE + namespace std { using ::strcmp; } +# endif + + +// Iterator test class +template +struct test_iter + : public boost::random_access_iterator_helper< + test_iter, T, std::ptrdiff_t, P, R> +{ + typedef test_iter self; + typedef R Reference; + typedef std::ptrdiff_t Distance; + +public: + explicit test_iter(T* i =0) : _i(i) { } + test_iter(const self& x) : _i(x._i) { } + self& operator=(const self& x) { _i = x._i; return *this; } + Reference operator*() const { return *_i; } + self& operator++() { ++_i; return *this; } + self& operator--() { --_i; return *this; } + self& operator+=(Distance n) { _i += n; return *this; } + self& operator-=(Distance n) { _i -= n; return *this; } + bool operator==(const self& x) const { return _i == x._i; } + bool operator<(const self& x) const { return _i < x._i; } + friend Distance operator-(const self& x, const self& y) { + return x._i - y._i; + } +protected: + P _i; +}; + +// Iterator operator testing classes +class test_opr_base +{ +protected: + // Test data and types + BOOST_STATIC_CONSTANT( std::size_t, fruit_length = 6u ); + + typedef std::string fruit_array_type[ fruit_length ]; + + static fruit_array_type fruit; + +}; // test_opr_base + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +// A definition is required even for integral static constants +const std::size_t test_opr_base::fruit_length; +#endif + +template +class test_opr + : public test_opr_base +{ + typedef test_opr self_type; + +public: + // Types + typedef T value_type; + typedef R reference; + typedef P pointer; + + typedef test_iter iter_type; + + // Test controller + static void master_test( char const name[] ); + +private: + // Test data + static iter_type const fruit_begin; + static iter_type const fruit_end; + + // Test parts + static void post_increment_test(); + static void post_decrement_test(); + static void indirect_referral_test(); + static void offset_addition_test(); + static void reverse_offset_addition_test(); + static void offset_subtraction_test(); + static void comparison_test(); + static void indexing_test(); + +}; // test_opr + + +// Class-static data definitions +test_opr_base::fruit_array_type + test_opr_base::fruit = { "apple", "orange", "pear", "peach", "grape", "plum" }; + +template + typename test_opr::iter_type const + test_opr::fruit_begin = test_iter( fruit ); + +template +typename test_opr::iter_type const + test_opr::fruit_end = test_iter( fruit + fruit_length ); + + +// Main testing function +int +test_main( int , char * [] ) +{ + using std::string; + + typedef test_opr test1_type; + typedef test_opr test2_type; + + test1_type::master_test( "non-const string" ); + test2_type::master_test( "const string" ); + + return boost::exit_success; +} + +// Tests for all of the operators added by random_access_iterator_helper +template +void +test_opr::master_test +( + char const name[] +) +{ + std::cout << "Doing test run for " << name << '.' << std::endl; + + post_increment_test(); + post_decrement_test(); + indirect_referral_test(); + offset_addition_test(); + reverse_offset_addition_test(); + offset_subtraction_test(); + comparison_test(); + indexing_test(); +} + +// Test post-increment +template +void +test_opr::post_increment_test +( +) +{ + std::cout << "\tDoing post-increment test." << std::endl; + + std::stringstream oss; + for ( iter_type i = fruit_begin ; i != fruit_end ; ) + { + oss << *i++ << ' '; + } + + BOOST_CHECK( oss.str() == "apple orange pear peach grape plum "); +} + +// Test post-decrement +template +void +test_opr::post_decrement_test +( +) +{ + std::cout << "\tDoing post-decrement test." << std::endl; + + std::stringstream oss; + for ( iter_type i = fruit_end ; i != fruit_begin ; ) + { + i--; + oss << *i << ' '; + } + + BOOST_CHECK( oss.str() == "plum grape peach pear orange apple "); +} + +// Test indirect structure referral +template +void +test_opr::indirect_referral_test +( +) +{ + std::cout << "\tDoing indirect reference test." << std::endl; + + std::stringstream oss; + for ( iter_type i = fruit_begin ; i != fruit_end ; ++i ) + { + oss << i->size() << ' '; + } + + BOOST_CHECK( oss.str() == "5 6 4 5 5 4 "); +} + +// Test offset addition +template +void +test_opr::offset_addition_test +( +) +{ + std::cout << "\tDoing offset addition test." << std::endl; + + std::ptrdiff_t const two = 2; + std::stringstream oss; + for ( iter_type i = fruit_begin ; i != fruit_end ; i = i + two ) + { + oss << *i << ' '; + } + + BOOST_CHECK( oss.str() == "apple pear grape "); +} + +// Test offset addition, in reverse order +template +void +test_opr::reverse_offset_addition_test +( +) +{ + std::cout << "\tDoing reverse offset addition test." << std::endl; + + std::ptrdiff_t const two = 2; + std::stringstream oss; + for ( iter_type i = fruit_begin ; i != fruit_end ; i = two + i ) + { + oss << *i << ' '; + } + + BOOST_CHECK( oss.str() == "apple pear grape "); +} + +// Test offset subtraction +template +void +test_opr::offset_subtraction_test +( +) +{ + std::cout << "\tDoing offset subtraction test." << std::endl; + + std::ptrdiff_t const two = 2; + std::stringstream oss; + for ( iter_type i = fruit_end ; fruit_begin < i ; ) + { + i = i - two; + if ( (fruit_begin < i) || (fruit_begin == i) ) + { + oss << *i << ' '; + } + } + + BOOST_CHECK( oss.str() == "grape pear apple "); +} + +// Test comparisons +template +void +test_opr::comparison_test +( +) +{ + using std::cout; + using std::ptrdiff_t; + + cout << "\tDoing comparison tests.\n\t\tPass:"; + + for ( iter_type i = fruit_begin ; i != fruit_end ; ++i ) + { + ptrdiff_t const i_offset = i - fruit_begin; + + cout << ' ' << *i << std::flush; + for ( iter_type j = fruit_begin ; j != fruit_end ; ++j ) + { + ptrdiff_t const j_offset = j - fruit_begin; + + BOOST_CHECK( (i != j) == (i_offset != j_offset) ); + BOOST_CHECK( (i > j) == (i_offset > j_offset) ); + BOOST_CHECK( (i <= j) == (i_offset <= j_offset) ); + BOOST_CHECK( (i >= j) == (i_offset >= j_offset) ); + } + } + cout << std::endl; +} + +// Test indexing +template +void +test_opr::indexing_test +( +) +{ + std::cout << "\tDoing indexing test." << std::endl; + + std::stringstream oss; + for ( std::size_t k = 0u ; k < fruit_length ; ++k ) + { + oss << fruit_begin[ k ] << ' '; + } + + BOOST_CHECK( oss.str() == "apple orange pear peach grape plum "); +} diff --git a/tools/boost_1_65_1/libs/utility/test/next_prior_test.cpp b/tools/boost_1_65_1/libs/utility/test/next_prior_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cd2812fe19c81c4657b320d8ef7cc0b4774b3670 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/next_prior_test.cpp @@ -0,0 +1,104 @@ +// Boost test program for next() and prior() utilities. + +// Copyright 2003 Daniel Walker. Use, modification, and distribution +// are subject to the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or a copy at +// http://www.boost.org/LICENSE_1_0.txt.) + +// See http://www.boost.org/libs/utility for documentation. + +// Revision History 13 Dec 2003 Initial Version (Daniel Walker) + +// next() and prior() are replacements for operator+ and operator- for +// non-random-access iterators. The semantics of these operators are +// such that after executing j = i + n, std::distance(i, j) equals +// n. Tests are provided to ensure next() has the same +// result. Parallel tests are provided for prior(). The tests call +// next() and prior() several times. next() and prior() are very +// simple functions, though, and it would be very strange if these +// tests were to fail. + +#define BOOST_INCLUDE_MAIN +#include + +#include +#include + +#include + +template +bool plus_one_test(RandomAccessIterator first, RandomAccessIterator last, ForwardIterator first2) +{ + RandomAccessIterator i = first; + ForwardIterator j = first2; + while(i != last) + i = i + 1, j = boost::next(j); + return std::distance(first, i) == std::distance(first2, j); +} + +template +bool plus_n_test(RandomAccessIterator first, RandomAccessIterator last, ForwardIterator first2) +{ + RandomAccessIterator i = first; + ForwardIterator j = first2; + for(int n = 0; i != last; ++n) + i = first + n, j = boost::next(first2, n); + return std::distance(first, i) == std::distance(first2, j); +} + +template +bool minus_one_test(RandomAccessIterator first, RandomAccessIterator last, BidirectionalIterator last2) +{ + RandomAccessIterator i = last; + BidirectionalIterator j = last2; + while(i != first) + i = i - 1, j = boost::prior(j); + return std::distance(i, last) == std::distance(j, last2); +} + +template +bool minus_n_test(RandomAccessIterator first, RandomAccessIterator last, BidirectionalIterator last2) +{ + RandomAccessIterator i = last; + BidirectionalIterator j = last2; + for(int n = 0; i != first; ++n) + i = last - n, j = boost::prior(last2, n); + return std::distance(i, last) == std::distance(j, last2); +} + +template +bool minus_n_unsigned_test(Iterator first, Iterator last, Distance size) +{ + Iterator i = boost::prior(last, size); + return i == first; +} + +int test_main(int, char*[]) +{ + std::vector x(8); + std::list y(x.begin(), x.end()); + + // Tests with iterators + BOOST_REQUIRE(plus_one_test(x.begin(), x.end(), y.begin())); + BOOST_REQUIRE(plus_n_test(x.begin(), x.end(), y.begin())); + BOOST_REQUIRE(minus_one_test(x.begin(), x.end(), y.end())); + BOOST_REQUIRE(minus_n_test(x.begin(), x.end(), y.end())); + BOOST_REQUIRE(minus_n_unsigned_test(x.begin(), x.end(), x.size())); + BOOST_REQUIRE(minus_n_unsigned_test(y.begin(), y.end(), y.size())); + + BOOST_REQUIRE(plus_one_test(x.rbegin(), x.rend(), y.begin())); + BOOST_REQUIRE(plus_n_test(x.rbegin(), x.rend(), y.begin())); + BOOST_REQUIRE(minus_one_test(x.rbegin(), x.rend(), y.end())); + BOOST_REQUIRE(minus_n_test(x.rbegin(), x.rend(), y.end())); + BOOST_REQUIRE(minus_n_unsigned_test(x.rbegin(), x.rend(), x.size())); + BOOST_REQUIRE(minus_n_unsigned_test(x.rbegin(), x.rend(), y.size())); + + // Tests with integers + BOOST_REQUIRE(boost::next(5) == 6); + BOOST_REQUIRE(boost::next(5, 7) == 12); + BOOST_REQUIRE(boost::prior(5) == 4); + BOOST_REQUIRE(boost::prior(5, 7) == -2); + BOOST_REQUIRE(boost::prior(5, 7u) == -2); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/numeric_traits_test.cpp b/tools/boost_1_65_1/libs/utility/test/numeric_traits_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ffd301c75f7bf20ca12691e51d9392b82ab2164d --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/numeric_traits_test.cpp @@ -0,0 +1,406 @@ +// (C) Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 1 Apr 2001 Fixes for ICL; use BOOST_STATIC_CONSTANT +// 11 Feb 2001 Fixes for Borland (David Abrahams) +// 23 Jan 2001 Added test for wchar_t (David Abrahams) +// 23 Jan 2001 Now statically selecting a test for signed numbers to avoid +// warnings with fancy compilers. Added commentary and +// additional dumping of traits data for tested types (David +// Abrahams). +// 21 Jan 2001 Initial version (David Abrahams) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef BOOST_NO_LIMITS +# include +#endif + +// ================================================================================= +// template class complement_traits -- +// +// statically computes the max and min for 1s and 2s-complement binary +// numbers. This helps on platforms without support. It also shows +// an example of a recursive template that works with MSVC! +// + +template struct complement; // forward + +// The template complement, below, does all the real work, using "poor man's +// partial specialization". We need complement_traits_aux<> so that MSVC doesn't +// complain about undefined min/max as we're trying to recursively define them. +template +struct complement_traits_aux +{ + BOOST_STATIC_CONSTANT(Number, max = complement::template traits::max); + BOOST_STATIC_CONSTANT(Number, min = complement::template traits::min); +}; + +template +struct complement +{ + template + struct traits + { + private: + // indirection through complement_traits_aux necessary to keep MSVC happy + typedef complement_traits_aux prev; + public: +#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2 + // GCC 4.0.2 ICEs on these C-style casts + BOOST_STATIC_CONSTANT(Number, max = + Number((prev::max) << CHAR_BIT) + + Number(UCHAR_MAX)); + BOOST_STATIC_CONSTANT(Number, min = Number((prev::min) << CHAR_BIT)); +#else + // Avoid left shifting negative integers, use multiplication instead + BOOST_STATIC_CONSTANT(Number, shift = 1u << CHAR_BIT); + BOOST_STATIC_CONSTANT(Number, max = + Number(Number(prev::max) * shift) + + Number(UCHAR_MAX)); + BOOST_STATIC_CONSTANT(Number, min = Number(Number(prev::min) * shift)); +#endif + }; +}; + +// Template class complement_base<> -- defines values for min and max for +// complement<1>, at the deepest level of recursion. Uses "poor man's partial +// specialization" again. +template struct complement_base; + +template <> struct complement_base +{ + template + struct values + { + BOOST_STATIC_CONSTANT(Number, min = 0); + BOOST_STATIC_CONSTANT(Number, max = UCHAR_MAX); + }; +}; + +template <> struct complement_base +{ + template + struct values + { + BOOST_STATIC_CONSTANT(Number, min = SCHAR_MIN); + BOOST_STATIC_CONSTANT(Number, max = SCHAR_MAX); + }; +}; + +// Base specialization of complement, puts an end to the recursion. +template <> +struct complement<1> +{ + template + struct traits + { + BOOST_STATIC_CONSTANT(bool, is_signed = boost::detail::is_signed::value); + BOOST_STATIC_CONSTANT(Number, min = + complement_base::template values::min); + BOOST_STATIC_CONSTANT(Number, max = + complement_base::template values::max); + }; +}; + +// Now here's the "pretty" template you're intended to actually use. +// complement_traits::min, complement_traits::max are the +// minimum and maximum values of Number if Number is a built-in integer type. +template +struct complement_traits +{ + BOOST_STATIC_CONSTANT(Number, max = (complement_traits_aux::max)); + BOOST_STATIC_CONSTANT(Number, min = (complement_traits_aux::min)); +}; + +// ================================================================================= + +// Support for streaming various numeric types in exactly the format I want. I +// needed this in addition to all the assertions so that I could see exactly +// what was going on. +// +// Numbers go through a 2-stage conversion process (by default, though, no real +// conversion). +// +template struct stream_as { + typedef T t1; + typedef T t2; +}; + +// char types first get converted to unsigned char, then to unsigned. +template <> struct stream_as { + typedef unsigned char t1; + typedef unsigned t2; +}; +template <> struct stream_as { + typedef unsigned char t1; typedef unsigned t2; +}; +template <> struct stream_as { + typedef unsigned char t1; typedef unsigned t2; +}; + +#if defined(BOOST_MSVC_STD_ITERATOR) // No intmax streaming built-in + +// With this library implementation, __int64 and __uint64 get streamed as strings +template <> struct stream_as { + typedef std::string t1; + typedef std::string t2; +}; + +template <> struct stream_as { + typedef std::string t1; + typedef std::string t2; +}; +#endif + +// Standard promotion process for streaming +template struct promote +{ + static typename stream_as::t1 from(T x) { + typedef typename stream_as::t1 t1; + return t1(x); + } +}; + +#if defined(BOOST_MSVC_STD_ITERATOR) // No intmax streaming built-in + +// On this platform, stream them as long/unsigned long if they fit. +// Otherwise, write a string. +template <> struct promote { + std::string static from(const boost::uintmax_t x) { + if (x > ULONG_MAX) + return std::string("large unsigned value"); + else + return boost::lexical_cast((unsigned long)x); + } +}; +template <> struct promote { + std::string static from(const boost::intmax_t x) { + if (x > boost::intmax_t(ULONG_MAX)) + return std::string("large positive signed value"); + else if (x >= 0) + return boost::lexical_cast((unsigned long)x); + + if (x < boost::intmax_t(LONG_MIN)) + return std::string("large negative signed value"); + else + return boost::lexical_cast((long)x); + } +}; +#endif + +// This is the function which converts types to the form I want to stream them in. +template +typename stream_as::t2 stream_number(T x) +{ + return promote::from(x); +} +// ================================================================================= + +// +// Tests for built-in signed and unsigned types +// + +// Tag types for selecting tests +struct unsigned_tag {}; +struct signed_tag {}; + +// Tests for unsigned numbers. The extra default Number parameter works around +// an MSVC bug. +template +void test_aux(unsigned_tag, Number*) +{ + typedef typename boost::detail::numeric_traits::difference_type difference_type; + BOOST_STATIC_ASSERT(!boost::detail::is_signed::value); + BOOST_STATIC_ASSERT( + (sizeof(Number) < sizeof(boost::intmax_t)) + | (boost::is_same::value)); + +#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2 + // GCC 4.0.2 ICEs on this C-style cases + BOOST_STATIC_ASSERT((complement_traits::max) > Number(0)); + BOOST_STATIC_ASSERT((complement_traits::min) == Number(0)); +#else + // Force casting to Number here to work around the fact that it's an enum on MSVC + BOOST_STATIC_ASSERT(Number(complement_traits::max) > Number(0)); + BOOST_STATIC_ASSERT(Number(complement_traits::min) == Number(0)); +#endif + + const Number max = complement_traits::max; + const Number min = complement_traits::min; + + const Number test_max = (sizeof(Number) < sizeof(boost::intmax_t)) + ? max + : max / 2 - 1; + + std::cout << std::hex << "(unsigned) min = " << stream_number(min) << ", max = " + << stream_number(max) << "..." << std::flush; + std::cout << "difference_type = " << typeid(difference_type).name() << "..." + << std::flush; + + difference_type d1 = boost::detail::numeric_distance(Number(0), test_max); + difference_type d2 = boost::detail::numeric_distance(test_max, Number(0)); + + std::cout << "0->" << stream_number(test_max) << "==" << std::dec << stream_number(d1) << "; " + << std::hex << stream_number(test_max) << "->0==" << std::dec << stream_number(d2) << "..." << std::flush; + + assert(d1 == difference_type(test_max)); + assert(d2 == -difference_type(test_max)); +} + +// Tests for signed numbers. The extra default Number parameter works around an +// MSVC bug. +struct out_of_range_tag {}; +struct in_range_tag {}; + +// This test morsel gets executed for numbers whose difference will always be +// representable in intmax_t +template +void signed_test(in_range_tag, Number*) +{ + BOOST_STATIC_ASSERT(boost::detail::is_signed::value); + typedef typename boost::detail::numeric_traits::difference_type difference_type; + const Number max = complement_traits::max; + const Number min = complement_traits::min; + + difference_type d1 = boost::detail::numeric_distance(min, max); + difference_type d2 = boost::detail::numeric_distance(max, min); + + std::cout << stream_number(min) << "->" << stream_number(max) << "=="; + std::cout << std::dec << stream_number(d1) << "; "; + std::cout << std::hex << stream_number(max) << "->" << stream_number(min) + << "==" << std::dec << stream_number(d2) << "..." << std::flush; + assert(d1 == difference_type(max) - difference_type(min)); + assert(d2 == difference_type(min) - difference_type(max)); +} + +// This test morsel gets executed for numbers whose difference may exceed the +// capacity of intmax_t. +template +void signed_test(out_of_range_tag, Number*) +{ + BOOST_STATIC_ASSERT(boost::detail::is_signed::value); + typedef typename boost::detail::numeric_traits::difference_type difference_type; + const Number max = complement_traits::max; + const Number min = complement_traits::min; + + difference_type min_distance = complement_traits::min; + difference_type max_distance = complement_traits::max; + + const Number n1 = Number(min + max_distance); + const Number n2 = Number(max + min_distance); + difference_type d1 = boost::detail::numeric_distance(min, n1); + difference_type d2 = boost::detail::numeric_distance(max, n2); + + std::cout << stream_number(min) << "->" << stream_number(n1) << "=="; + std::cout << std::dec << stream_number(d1) << "; "; + std::cout << std::hex << stream_number(max) << "->" << stream_number(n2) + << "==" << std::dec << stream_number(d2) << "..." << std::flush; + assert(d1 == max_distance); + assert(d2 == min_distance); +} + +template +void test_aux(signed_tag, Number*) +{ + typedef typename boost::detail::numeric_traits::difference_type difference_type; + BOOST_STATIC_ASSERT(boost::detail::is_signed::value); + BOOST_STATIC_ASSERT( + (sizeof(Number) < sizeof(boost::intmax_t)) + | (boost::is_same::value)); + +#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2 + // GCC 4.0.2 ICEs on this cast + BOOST_STATIC_ASSERT((complement_traits::max) > Number(0)); + BOOST_STATIC_ASSERT((complement_traits::min) < Number(0)); +#else + // Force casting to Number here to work around the fact that it's an enum on MSVC + BOOST_STATIC_ASSERT(Number(complement_traits::max) > Number(0)); + BOOST_STATIC_ASSERT(Number(complement_traits::min) < Number(0)); +#endif + const Number max = complement_traits::max; + const Number min = complement_traits::min; + + std::cout << std::hex << "min = " << stream_number(min) << ", max = " + << stream_number(max) << "..." << std::flush; + std::cout << "difference_type = " << typeid(difference_type).name() << "..." + << std::flush; + + typedef typename boost::detail::if_true< + (sizeof(Number) < sizeof(boost::intmax_t))> + ::template then< + in_range_tag, + out_of_range_tag + >::type + range_tag; + signed_test(range_tag(), 0); +} + + +// Test for all numbers. The extra default Number parameter works around an MSVC +// bug. +template +void test(Number* = 0) +{ + std::cout << "testing " << typeid(Number).name() << ":\n" +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + << "is_signed: " << (std::numeric_limits::is_signed ? "true\n" : "false\n") + << "is_bounded: " << (std::numeric_limits::is_bounded ? "true\n" : "false\n") + << "digits: " << std::numeric_limits::digits << "\n" +#endif + << "..." << std::flush; + + // factoring out difference_type for the assert below confused Borland :( + typedef boost::detail::is_signed< +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 + typename +#endif + boost::detail::numeric_traits::difference_type + > is_signed; + BOOST_STATIC_ASSERT(is_signed::value); + + typedef typename boost::detail::if_true< + boost::detail::is_signed::value + >::template then::type signedness; + + test_aux(signedness(), 0); + std::cout << "passed" << std::endl; +} + +int main() +{ + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); +#if defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T) + test< ::boost::long_long_type>(); + test< ::boost::ulong_long_type>(); +#elif defined(BOOST_MSVC) + // The problem of not having compile-time static class constants other than + // enums prevents this from working, since values get truncated. + // test(); + // test(); +#endif + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/operators_test.cpp b/tools/boost_1_65_1/libs/utility/test/operators_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f445945bd955a70f84e5d88b330d744051b23507 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/operators_test.cpp @@ -0,0 +1,939 @@ +// Demonstrate and test boost/operators.hpp -------------------------------// + +// Copyright Beman Dawes 1999. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/utility for documentation. + +// Revision History +// 03 Apr 08 Added convertible_to_bool (Daniel Frey) +// 01 Oct 01 Added tests for "left" operators +// and new grouped operators. (Helmut Zeisel) +// 20 May 01 Output progress messages. Added tests for new operator +// templates. Updated random number generator. Changed tests to +// use Boost Test Tools library. (Daryle Walker) +// 04 Jun 00 Added regression test for a bug I found (David Abrahams) +// 17 Jun 00 Fix for broken compilers (Aleksey Gurtovoy) +// ?? ??? 00 Major update to randomly test all one- and two- argument forms by +// wrapping integral types and comparing the results of operations +// to the results for the raw types (David Abrahams) +// 12 Dec 99 Minor update, output confirmation message. +// 15 Nov 99 Initial version + +#define BOOST_INCLUDE_MAIN + +#include // for BOOST_MSVC +#include // for boost::exit_success +#include // for the tested items +#include // for boost::minstd_rand +#include // for main + +#include // for std::cout (std::endl indirectly) + + +namespace +{ + // avoiding a template version of true_value so as to not confuse VC++ + int true_value(int x) { return x; } + long true_value(long x) { return x; } + signed char true_value(signed char x) { return x; } + unsigned int true_value(unsigned int x) { return x; } + unsigned long true_value(unsigned long x) { return x; } + unsigned char true_value(unsigned char x) { return x; } + + // verify the minimum requirements for some operators + class convertible_to_bool + { + private: + bool _value; + + typedef bool convertible_to_bool::*unspecified_bool_type; + + void operator!() const; + + public: + convertible_to_bool( const bool value ) : _value( value ) {} + + operator unspecified_bool_type() const + { return _value ? &convertible_to_bool::_value : 0; } + }; + + // The use of operators<> here tended to obscure + // interactions with certain compiler bugs + template + class Wrapped1 + : boost::operators > + , boost::shiftable > + { + public: + explicit Wrapped1( T v = T() ) : _value(v) {} + T value() const { return _value; } + + convertible_to_bool operator<(const Wrapped1& x) const + { return _value < x._value; } + convertible_to_bool operator==(const Wrapped1& x) const + { return _value == x._value; } + + Wrapped1& operator+=(const Wrapped1& x) + { _value += x._value; return *this; } + Wrapped1& operator-=(const Wrapped1& x) + { _value -= x._value; return *this; } + Wrapped1& operator*=(const Wrapped1& x) + { _value *= x._value; return *this; } + Wrapped1& operator/=(const Wrapped1& x) + { _value /= x._value; return *this; } + Wrapped1& operator%=(const Wrapped1& x) + { _value %= x._value; return *this; } + Wrapped1& operator|=(const Wrapped1& x) + { _value |= x._value; return *this; } + Wrapped1& operator&=(const Wrapped1& x) + { _value &= x._value; return *this; } + Wrapped1& operator^=(const Wrapped1& x) + { _value ^= x._value; return *this; } + Wrapped1& operator<<=(const Wrapped1& x) + { _value <<= x._value; return *this; } + Wrapped1& operator>>=(const Wrapped1& x) + { _value >>= x._value; return *this; } + Wrapped1& operator++() { ++_value; return *this; } + Wrapped1& operator--() { --_value; return *this; } + + private: + T _value; + }; + template + T true_value(Wrapped1 x) { return x.value(); } + + template + class Wrapped2 + : boost::operators > + , boost::operators2, U> + , boost::shiftable1 + , boost::shiftable2, U > > + { + public: + explicit Wrapped2( T v = T() ) : _value(v) {} + T value() const { return _value; } + + convertible_to_bool operator<(const Wrapped2& x) const + { return _value < x._value; } + convertible_to_bool operator==(const Wrapped2& x) const + { return _value == x._value; } + + Wrapped2& operator+=(const Wrapped2& x) + { _value += x._value; return *this; } + Wrapped2& operator-=(const Wrapped2& x) + { _value -= x._value; return *this; } + Wrapped2& operator*=(const Wrapped2& x) + { _value *= x._value; return *this; } + Wrapped2& operator/=(const Wrapped2& x) + { _value /= x._value; return *this; } + Wrapped2& operator%=(const Wrapped2& x) + { _value %= x._value; return *this; } + Wrapped2& operator|=(const Wrapped2& x) + { _value |= x._value; return *this; } + Wrapped2& operator&=(const Wrapped2& x) + { _value &= x._value; return *this; } + Wrapped2& operator^=(const Wrapped2& x) + { _value ^= x._value; return *this; } + Wrapped2& operator<<=(const Wrapped2& x) + { _value <<= x._value; return *this; } + Wrapped2& operator>>=(const Wrapped2& x) + { _value >>= x._value; return *this; } + Wrapped2& operator++() { ++_value; return *this; } + Wrapped2& operator--() { --_value; return *this; } + + convertible_to_bool operator<(U u) const + { return _value < u; } + convertible_to_bool operator>(U u) const + { return _value > u; } + convertible_to_bool operator==(U u) const + { return _value == u; } + + Wrapped2& operator+=(U u) { _value += u; return *this; } + Wrapped2& operator-=(U u) { _value -= u; return *this; } + Wrapped2& operator*=(U u) { _value *= u; return *this; } + Wrapped2& operator/=(U u) { _value /= u; return *this; } + Wrapped2& operator%=(U u) { _value %= u; return *this; } + Wrapped2& operator|=(U u) { _value |= u; return *this; } + Wrapped2& operator&=(U u) { _value &= u; return *this; } + Wrapped2& operator^=(U u) { _value ^= u; return *this; } + Wrapped2& operator<<=(U u) { _value <<= u; return *this; } + Wrapped2& operator>>=(U u) { _value >>= u; return *this; } + + private: + T _value; + }; + template + T true_value(Wrapped2 x) { return x.value(); } + + template + class Wrapped3 + : boost::equivalent > + , boost::partially_ordered > + , boost::equality_comparable > + { + public: + explicit Wrapped3( T v = T() ) : _value(v) {} + T value() const { return _value; } + + convertible_to_bool operator<(const Wrapped3& x) const + { return _value < x._value; } + + private: + T _value; + }; + template + T true_value(Wrapped3 x) { return x.value(); } + + template + class Wrapped4 + : boost::equality_comparable1 + , boost::equivalent1 + , boost::partially_ordered1 > > > + , boost::partially_ordered2, U + , boost::equivalent2, U + , boost::equality_comparable2, U> > > + { + public: + explicit Wrapped4( T v = T() ) : _value(v) {} + T value() const { return _value; } + + convertible_to_bool operator<(const Wrapped4& x) const + { return _value < x._value; } + + convertible_to_bool operator<(U u) const + { return _value < u; } + convertible_to_bool operator>(U u) const + { return _value > u; } + + private: + T _value; + }; + template + T true_value(Wrapped4 x) { return x.value(); } + + // U must be convertible to T + template + class Wrapped5 + : boost::ordered_field_operators2, U> + , boost::ordered_field_operators1 > + { + public: + explicit Wrapped5( T v = T() ) : _value(v) {} + + // Conversion from U to Wrapped5 + Wrapped5(U u) : _value(u) {} + + T value() const { return _value; } + + convertible_to_bool operator<(const Wrapped5& x) const + { return _value < x._value; } + convertible_to_bool operator<(U u) const + { return _value < u; } + convertible_to_bool operator>(U u) const + { return _value > u; } + convertible_to_bool operator==(const Wrapped5& u) const + { return _value == u._value; } + convertible_to_bool operator==(U u) const + { return _value == u; } + + Wrapped5& operator/=(const Wrapped5& u) { _value /= u._value; return *this;} + Wrapped5& operator/=(U u) { _value /= u; return *this;} + Wrapped5& operator*=(const Wrapped5& u) { _value *= u._value; return *this;} + Wrapped5& operator*=(U u) { _value *= u; return *this;} + Wrapped5& operator-=(const Wrapped5& u) { _value -= u._value; return *this;} + Wrapped5& operator-=(U u) { _value -= u; return *this;} + Wrapped5& operator+=(const Wrapped5& u) { _value += u._value; return *this;} + Wrapped5& operator+=(U u) { _value += u; return *this;} + + private: + T _value; + }; + template + T true_value(Wrapped5 x) { return x.value(); } + + // U must be convertible to T + template + class Wrapped6 + : boost::ordered_euclidean_ring_operators2, U> + , boost::ordered_euclidean_ring_operators1 > + { + public: + explicit Wrapped6( T v = T() ) : _value(v) {} + + // Conversion from U to Wrapped6 + Wrapped6(U u) : _value(u) {} + + T value() const { return _value; } + + convertible_to_bool operator<(const Wrapped6& x) const + { return _value < x._value; } + convertible_to_bool operator<(U u) const + { return _value < u; } + convertible_to_bool operator>(U u) const + { return _value > u; } + convertible_to_bool operator==(const Wrapped6& u) const + { return _value == u._value; } + convertible_to_bool operator==(U u) const + { return _value == u; } + + Wrapped6& operator%=(const Wrapped6& u) { _value %= u._value; return *this;} + Wrapped6& operator%=(U u) { _value %= u; return *this;} + Wrapped6& operator/=(const Wrapped6& u) { _value /= u._value; return *this;} + Wrapped6& operator/=(U u) { _value /= u; return *this;} + Wrapped6& operator*=(const Wrapped6& u) { _value *= u._value; return *this;} + Wrapped6& operator*=(U u) { _value *= u; return *this;} + Wrapped6& operator-=(const Wrapped6& u) { _value -= u._value; return *this;} + Wrapped6& operator-=(U u) { _value -= u; return *this;} + Wrapped6& operator+=(const Wrapped6& u) { _value += u._value; return *this;} + Wrapped6& operator+=(U u) { _value += u; return *this;} + + private: + T _value; + }; + template + T true_value(Wrapped6 x) { return x.value(); } + + // MyInt uses only the single template-argument form of all_operators<> + typedef Wrapped1 MyInt; + + typedef Wrapped2 MyLong; + + typedef Wrapped3 MyChar; + + typedef Wrapped4 MyShort; + + typedef Wrapped5 MyDoubleInt; + + typedef Wrapped6 MyLongInt; + + template + void sanity_check(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + BOOST_CHECK( true_value(y1) == true_value(y2) ); + BOOST_CHECK( true_value(x1) == true_value(x2) ); + } + + template + void test_less_than_comparable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + BOOST_CHECK( static_cast(x1 < y1) == static_cast(x2 < y2) ); + BOOST_CHECK( static_cast(x1 <= y1) == static_cast(x2 <= y2) ); + BOOST_CHECK( static_cast(x1 >= y1) == static_cast(x2 >= y2) ); + BOOST_CHECK( static_cast(x1 > y1) == static_cast(x2 > y2) ); + } + + template + void test_less_than_comparable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_less_than_comparable_aux( x1, y1, x2, y2 ); + test_less_than_comparable_aux( y1, x1, y2, x2 ); + } + + template + void test_equality_comparable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + BOOST_CHECK( static_cast(x1 == y1) == static_cast(x2 == y2) ); + BOOST_CHECK( static_cast(x1 != y1) == static_cast(x2 != y2) ); + } + + template + void test_equality_comparable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_equality_comparable_aux( x1, y1, x2, y2 ); + test_equality_comparable_aux( y1, x1, y2, x2 ); + } + + template + void test_multipliable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + BOOST_CHECK( (x1 * y1).value() == (x2 * y2) ); + } + + template + void test_multipliable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_multipliable_aux( x1, y1, x2, y2 ); + test_multipliable_aux( y1, x1, y2, x2 ); + } + + template + void test_value_equality(A a, B b) + { + BOOST_CHECK(a.value() == b); + } + +#define TEST_OP_R(op) test_value_equality(x1 op y1, x2 op y2) +#define TEST_OP_L(op) test_value_equality(y1 op x1, y2 op x2) + + template + void test_addable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + TEST_OP_R(+); + } + + template + void test_addable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_addable_aux( x1, y1, x2, y2 ); + test_addable_aux( y1, x1, y2, x2 ); + } + + template + void test_subtractable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + TEST_OP_R(-); + } + + template + void test_subtractable_left(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + TEST_OP_L(-); + } + + template + void test_dividable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + if ( y2 != 0 ) + TEST_OP_R(/); + } + + template + void test_dividable_left(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + if ( x2 != 0 ) + TEST_OP_L(/); + } + + template + void test_modable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + if ( y2 != 0 ) + TEST_OP_R(%); + } + + template + void test_modable_left(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + if ( x2 != 0 ) + TEST_OP_L(%); + } + + template + void test_xorable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + TEST_OP_R(^); + } + + template + void test_xorable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_xorable_aux( x1, y1, x2, y2 ); + test_xorable_aux( y1, x1, y2, x2 ); + } + + template + void test_andable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + TEST_OP_R(&); + } + + template + void test_andable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_andable_aux( x1, y1, x2, y2 ); + test_andable_aux( y1, x1, y2, x2 ); + } + + template + void test_orable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + TEST_OP_R(|); + } + + template + void test_orable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + test_orable_aux( x1, y1, x2, y2 ); + test_orable_aux( y1, x1, y2, x2 ); + } + + template + void test_left_shiftable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + TEST_OP_R(<<); + } + + template + void test_right_shiftable(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + sanity_check( x1, y1, x2, y2 ); + TEST_OP_R(>>); + } + + template + void test_incrementable(X1 x1, X2 x2) + { + sanity_check( x1, x1, x2, x2 ); + BOOST_CHECK( (x1++).value() == x2++ ); + BOOST_CHECK( x1.value() == x2 ); + } + + template + void test_decrementable(X1 x1, X2 x2) + { + sanity_check( x1, x1, x2, x2 ); + BOOST_CHECK( (x1--).value() == x2-- ); + BOOST_CHECK( x1.value() == x2 ); + } + + template + void test_all(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + test_less_than_comparable( x1, y1, x2, y2 ); + test_equality_comparable( x1, y1, x2, y2 ); + test_multipliable( x1, y1, x2, y2 ); + test_addable( x1, y1, x2, y2 ); + test_subtractable( x1, y1, x2, y2 ); + test_dividable( x1, y1, x2, y2 ); + test_modable( x1, y1, x2, y2 ); + test_xorable( x1, y1, x2, y2 ); + test_andable( x1, y1, x2, y2 ); + test_orable( x1, y1, x2, y2 ); + test_left_shiftable( x1, y1, x2, y2 ); + test_right_shiftable( x1, y1, x2, y2 ); + test_incrementable( x1, x2 ); + test_decrementable( x1, x2 ); + } + + template + void test_left(X1 x1, Y1 y1, X2 x2, Y2 y2) + { + test_subtractable_left( x1, y1, x2, y2 ); + test_dividable_left( x1, y1, x2, y2 ); + test_modable_left( x1, y1, x2, y2 ); + } + + template + struct tester + { + void operator()(boost::minstd_rand& randomizer) const + { + Big b1 = Big( randomizer() ); + Big b2 = Big( randomizer() ); + Small s = Small( randomizer() ); + + test_all( Wrapped1(b1), Wrapped1(b2), b1, b2 ); + test_all( Wrapped2(b1), s, b1, s ); + } + }; + + template + struct tester_left + { + void operator()(boost::minstd_rand& randomizer) const + { + Big b1 = Big( randomizer() ); + Small s = Small( randomizer() ); + + test_left( Wrapped6(b1), s, b1, s ); + } + }; + + // added as a regression test. We had a bug which this uncovered. + struct Point + : boost::addable > + { + Point( int h, int v ) : h(h), v(v) {} + Point() :h(0), v(0) {} + const Point& operator+=( const Point& rhs ) + { h += rhs.h; v += rhs.v; return *this; } + const Point& operator-=( const Point& rhs ) + { h -= rhs.h; v -= rhs.v; return *this; } + + int h; + int v; + }; + +} // unnamed namespace + + +// workaround for MSVC bug; for some reasons the compiler doesn't instantiate +// inherited operator templates at the moment it must, so the following +// explicit instantiations force it to do that. + +#if defined(BOOST_MSVC) && (_MSC_VER < 1300) +template Wrapped1; +template Wrapped1; +template Wrapped1; +template Wrapped1; + +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; +template Wrapped2; + +template Wrapped6; +template Wrapped6; +template Wrapped6; +template Wrapped6; +template Wrapped6; +template Wrapped6; +#endif + +#define PRIVATE_EXPR_TEST(e, t) BOOST_CHECK( ((e), (t)) ) + +int +test_main( int , char * [] ) +{ + using std::cout; + using std::endl; + + // Regression test. + Point x; + x = x + Point(3, 4); + x = x - Point(3, 4); + + cout << "Created point, and operated on it." << endl; + + for (int n = 0; n < 1000; ++n) // was 10,000 but took too long (Beman) + { + boost::minstd_rand r; + tester()(r); + tester()(r); + tester()(r); + tester()(r); + tester()(r); + + tester()(r); + tester()(r); + tester()(r); + tester()(r); + tester()(r); + + tester_left()(r); + tester_left()(r); + tester_left()(r); + + tester_left()(r); + tester_left()(r); + tester_left()(r); + } + + cout << "Did random tester loop." << endl; + + MyInt i1(1); + MyInt i2(2); + MyInt i; + + BOOST_CHECK( i1.value() == 1 ); + BOOST_CHECK( i2.value() == 2 ); + BOOST_CHECK( i.value() == 0 ); + + cout << "Created MyInt objects.\n"; + + PRIVATE_EXPR_TEST( (i = i2), (i.value() == 2) ); + + BOOST_CHECK( static_cast(i2 == i) ); + BOOST_CHECK( static_cast(i1 != i2) ); + BOOST_CHECK( static_cast(i1 < i2) ); + BOOST_CHECK( static_cast(i1 <= i2) ); + BOOST_CHECK( static_cast(i <= i2) ); + BOOST_CHECK( static_cast(i2 > i1) ); + BOOST_CHECK( static_cast(i2 >= i1) ); + BOOST_CHECK( static_cast(i2 >= i) ); + + PRIVATE_EXPR_TEST( (i = i1 + i2), (i.value() == 3) ); + PRIVATE_EXPR_TEST( (i = i + i2), (i.value() == 5) ); + PRIVATE_EXPR_TEST( (i = i - i1), (i.value() == 4) ); + PRIVATE_EXPR_TEST( (i = i * i2), (i.value() == 8) ); + PRIVATE_EXPR_TEST( (i = i / i2), (i.value() == 4) ); + PRIVATE_EXPR_TEST( (i = i % ( i - i1 )), (i.value() == 1) ); + PRIVATE_EXPR_TEST( (i = i2 + i2), (i.value() == 4) ); + PRIVATE_EXPR_TEST( (i = i1 | i2 | i), (i.value() == 7) ); + PRIVATE_EXPR_TEST( (i = i & i2), (i.value() == 2) ); + PRIVATE_EXPR_TEST( (i = i + i1), (i.value() == 3) ); + PRIVATE_EXPR_TEST( (i = i ^ i1), (i.value() == 2) ); + PRIVATE_EXPR_TEST( (i = ( i + i1 ) * ( i2 | i1 )), (i.value() == 9) ); + + PRIVATE_EXPR_TEST( (i = i1 << i2), (i.value() == 4) ); + PRIVATE_EXPR_TEST( (i = i2 >> i1), (i.value() == 1) ); + + cout << "Performed tests on MyInt objects.\n"; + + MyLong j1(1); + MyLong j2(2); + MyLong j; + + BOOST_CHECK( j1.value() == 1 ); + BOOST_CHECK( j2.value() == 2 ); + BOOST_CHECK( j.value() == 0 ); + + cout << "Created MyLong objects.\n"; + + PRIVATE_EXPR_TEST( (j = j2), (j.value() == 2) ); + + BOOST_CHECK( static_cast(j2 == j) ); + BOOST_CHECK( static_cast(2 == j) ); + BOOST_CHECK( static_cast(j2 == 2) ); + BOOST_CHECK( static_cast(j == j2) ); + BOOST_CHECK( static_cast(j1 != j2) ); + BOOST_CHECK( static_cast(j1 != 2) ); + BOOST_CHECK( static_cast(1 != j2) ); + BOOST_CHECK( static_cast(j1 < j2) ); + BOOST_CHECK( static_cast(1 < j2) ); + BOOST_CHECK( static_cast(j1 < 2) ); + BOOST_CHECK( static_cast(j1 <= j2) ); + BOOST_CHECK( static_cast(1 <= j2) ); + BOOST_CHECK( static_cast(j1 <= j) ); + BOOST_CHECK( static_cast(j <= j2) ); + BOOST_CHECK( static_cast(2 <= j2) ); + BOOST_CHECK( static_cast(j <= 2) ); + BOOST_CHECK( static_cast(j2 > j1) ); + BOOST_CHECK( static_cast(2 > j1) ); + BOOST_CHECK( static_cast(j2 > 1) ); + BOOST_CHECK( static_cast(j2 >= j1) ); + BOOST_CHECK( static_cast(2 >= j1) ); + BOOST_CHECK( static_cast(j2 >= 1) ); + BOOST_CHECK( static_cast(j2 >= j) ); + BOOST_CHECK( static_cast(2 >= j) ); + BOOST_CHECK( static_cast(j2 >= 2) ); + + BOOST_CHECK( static_cast((j1 + 2) == 3) ); + BOOST_CHECK( static_cast((1 + j2) == 3) ); + PRIVATE_EXPR_TEST( (j = j1 + j2), (j.value() == 3) ); + + BOOST_CHECK( static_cast((j + 2) == 5) ); + BOOST_CHECK( static_cast((3 + j2) == 5) ); + PRIVATE_EXPR_TEST( (j = j + j2), (j.value() == 5) ); + + BOOST_CHECK( static_cast((j - 1) == 4) ); + PRIVATE_EXPR_TEST( (j = j - j1), (j.value() == 4) ); + + BOOST_CHECK( static_cast((j * 2) == 8) ); + BOOST_CHECK( static_cast((4 * j2) == 8) ); + PRIVATE_EXPR_TEST( (j = j * j2), (j.value() == 8) ); + + BOOST_CHECK( static_cast((j / 2) == 4) ); + PRIVATE_EXPR_TEST( (j = j / j2), (j.value() == 4) ); + + BOOST_CHECK( static_cast((j % 3) == 1) ); + PRIVATE_EXPR_TEST( (j = j % ( j - j1 )), (j.value() == 1) ); + + PRIVATE_EXPR_TEST( (j = j2 + j2), (j.value() == 4) ); + + BOOST_CHECK( static_cast((1 | j2 | j) == 7) ); + BOOST_CHECK( static_cast((j1 | 2 | j) == 7) ); + BOOST_CHECK( static_cast((j1 | j2 | 4) == 7) ); + PRIVATE_EXPR_TEST( (j = j1 | j2 | j), (j.value() == 7) ); + + BOOST_CHECK( static_cast((7 & j2) == 2) ); + BOOST_CHECK( static_cast((j & 2) == 2) ); + PRIVATE_EXPR_TEST( (j = j & j2), (j.value() == 2) ); + + PRIVATE_EXPR_TEST( (j = j | j1), (j.value() == 3) ); + + BOOST_CHECK( static_cast((3 ^ j1) == 2) ); + BOOST_CHECK( static_cast((j ^ 1) == 2) ); + PRIVATE_EXPR_TEST( (j = j ^ j1), (j.value() == 2) ); + + PRIVATE_EXPR_TEST( (j = ( j + j1 ) * ( j2 | j1 )), (j.value() == 9) ); + + BOOST_CHECK( static_cast((j1 << 2) == 4) ); + BOOST_CHECK( static_cast((j2 << 1) == 4) ); + PRIVATE_EXPR_TEST( (j = j1 << j2), (j.value() == 4) ); + + BOOST_CHECK( static_cast((j >> 2) == 1) ); + BOOST_CHECK( static_cast((j2 >> 1) == 1) ); + PRIVATE_EXPR_TEST( (j = j2 >> j1), (j.value() == 1) ); + + cout << "Performed tests on MyLong objects.\n"; + + MyChar k1(1); + MyChar k2(2); + MyChar k; + + BOOST_CHECK( k1.value() == 1 ); + BOOST_CHECK( k2.value() == 2 ); + BOOST_CHECK( k.value() == 0 ); + + cout << "Created MyChar objects.\n"; + + PRIVATE_EXPR_TEST( (k = k2), (k.value() == 2) ); + + BOOST_CHECK( static_cast(k2 == k) ); + BOOST_CHECK( static_cast(k1 != k2) ); + BOOST_CHECK( static_cast(k1 < k2) ); + BOOST_CHECK( static_cast(k1 <= k2) ); + BOOST_CHECK( static_cast(k <= k2) ); + BOOST_CHECK( static_cast(k2 > k1) ); + BOOST_CHECK( static_cast(k2 >= k1) ); + BOOST_CHECK( static_cast(k2 >= k) ); + + cout << "Performed tests on MyChar objects.\n"; + + MyShort l1(1); + MyShort l2(2); + MyShort l; + + BOOST_CHECK( l1.value() == 1 ); + BOOST_CHECK( l2.value() == 2 ); + BOOST_CHECK( l.value() == 0 ); + + cout << "Created MyShort objects.\n"; + + PRIVATE_EXPR_TEST( (l = l2), (l.value() == 2) ); + + BOOST_CHECK( static_cast(l2 == l) ); + BOOST_CHECK( static_cast(2 == l) ); + BOOST_CHECK( static_cast(l2 == 2) ); + BOOST_CHECK( static_cast(l == l2) ); + BOOST_CHECK( static_cast(l1 != l2) ); + BOOST_CHECK( static_cast(l1 != 2) ); + BOOST_CHECK( static_cast(1 != l2) ); + BOOST_CHECK( static_cast(l1 < l2) ); + BOOST_CHECK( static_cast(1 < l2) ); + BOOST_CHECK( static_cast(l1 < 2) ); + BOOST_CHECK( static_cast(l1 <= l2) ); + BOOST_CHECK( static_cast(1 <= l2) ); + BOOST_CHECK( static_cast(l1 <= l) ); + BOOST_CHECK( static_cast(l <= l2) ); + BOOST_CHECK( static_cast(2 <= l2) ); + BOOST_CHECK( static_cast(l <= 2) ); + BOOST_CHECK( static_cast(l2 > l1) ); + BOOST_CHECK( static_cast(2 > l1) ); + BOOST_CHECK( static_cast(l2 > 1) ); + BOOST_CHECK( static_cast(l2 >= l1) ); + BOOST_CHECK( static_cast(2 >= l1) ); + BOOST_CHECK( static_cast(l2 >= 1) ); + BOOST_CHECK( static_cast(l2 >= l) ); + BOOST_CHECK( static_cast(2 >= l) ); + BOOST_CHECK( static_cast(l2 >= 2) ); + + cout << "Performed tests on MyShort objects.\n"; + + MyDoubleInt di1(1); + MyDoubleInt di2(2.); + MyDoubleInt half(0.5); + MyDoubleInt di; + MyDoubleInt tmp; + + BOOST_CHECK( di1.value() == 1 ); + BOOST_CHECK( di2.value() == 2 ); + BOOST_CHECK( di2.value() == 2 ); + BOOST_CHECK( di.value() == 0 ); + + cout << "Created MyDoubleInt objects.\n"; + + PRIVATE_EXPR_TEST( (di = di2), (di.value() == 2) ); + + BOOST_CHECK( static_cast(di2 == di) ); + BOOST_CHECK( static_cast(2 == di) ); + BOOST_CHECK( static_cast(di == 2) ); + BOOST_CHECK( static_cast(di1 < di2) ); + BOOST_CHECK( static_cast(1 < di2) ); + BOOST_CHECK( static_cast(di1 <= di2) ); + BOOST_CHECK( static_cast(1 <= di2) ); + BOOST_CHECK( static_cast(di2 > di1) ); + BOOST_CHECK( static_cast(di2 > 1) ); + BOOST_CHECK( static_cast(di2 >= di1) ); + BOOST_CHECK( static_cast(di2 >= 1) ); + BOOST_CHECK( static_cast(di1 / di2 == half) ); + BOOST_CHECK( static_cast(di1 / 2 == half) ); + BOOST_CHECK( static_cast(1 / di2 == half) ); + PRIVATE_EXPR_TEST( (tmp=di1), static_cast((tmp/=2) == half) ); + PRIVATE_EXPR_TEST( (tmp=di1), static_cast((tmp/=di2) == half) ); + BOOST_CHECK( static_cast(di1 * di2 == di2) ); + BOOST_CHECK( static_cast(di1 * 2 == di2) ); + BOOST_CHECK( static_cast(1 * di2 == di2) ); + PRIVATE_EXPR_TEST( (tmp=di1), static_cast((tmp*=2) == di2) ); + PRIVATE_EXPR_TEST( (tmp=di1), static_cast((tmp*=di2) == di2) ); + BOOST_CHECK( static_cast(di2 - di1 == di1) ); + BOOST_CHECK( static_cast(di2 - 1 == di1) ); + BOOST_CHECK( static_cast(2 - di1 == di1) ); + PRIVATE_EXPR_TEST( (tmp=di2), static_cast((tmp-=1) == di1) ); + PRIVATE_EXPR_TEST( (tmp=di2), static_cast((tmp-=di1) == di1) ); + BOOST_CHECK( static_cast(di1 + di1 == di2) ); + BOOST_CHECK( static_cast(di1 + 1 == di2) ); + BOOST_CHECK( static_cast(1 + di1 == di2) ); + PRIVATE_EXPR_TEST( (tmp=di1), static_cast((tmp+=1) == di2) ); + PRIVATE_EXPR_TEST( (tmp=di1), static_cast((tmp+=di1) == di2) ); + + cout << "Performed tests on MyDoubleInt objects.\n"; + + MyLongInt li1(1); + MyLongInt li2(2); + MyLongInt li; + MyLongInt tmp2; + + BOOST_CHECK( li1.value() == 1 ); + BOOST_CHECK( li2.value() == 2 ); + BOOST_CHECK( li.value() == 0 ); + + cout << "Created MyLongInt objects.\n"; + + PRIVATE_EXPR_TEST( (li = li2), (li.value() == 2) ); + + BOOST_CHECK( static_cast(li2 == li) ); + BOOST_CHECK( static_cast(2 == li) ); + BOOST_CHECK( static_cast(li == 2) ); + BOOST_CHECK( static_cast(li1 < li2) ); + BOOST_CHECK( static_cast(1 < li2) ); + BOOST_CHECK( static_cast(li1 <= li2) ); + BOOST_CHECK( static_cast(1 <= li2) ); + BOOST_CHECK( static_cast(li2 > li1) ); + BOOST_CHECK( static_cast(li2 > 1) ); + BOOST_CHECK( static_cast(li2 >= li1) ); + BOOST_CHECK( static_cast(li2 >= 1) ); + BOOST_CHECK( static_cast(li1 % li2 == li1) ); + BOOST_CHECK( static_cast(li1 % 2 == li1) ); + BOOST_CHECK( static_cast(1 % li2 == li1) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2%=2) == li1) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2%=li2) == li1) ); + BOOST_CHECK( static_cast(li1 / li2 == 0) ); + BOOST_CHECK( static_cast(li1 / 2 == 0) ); + BOOST_CHECK( static_cast(1 / li2 == 0) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2/=2) == 0) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2/=li2) == 0) ); + BOOST_CHECK( static_cast(li1 * li2 == li2) ); + BOOST_CHECK( static_cast(li1 * 2 == li2) ); + BOOST_CHECK( static_cast(1 * li2 == li2) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2*=2) == li2) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2*=li2) == li2) ); + BOOST_CHECK( static_cast(li2 - li1 == li1) ); + BOOST_CHECK( static_cast(li2 - 1 == li1) ); + BOOST_CHECK( static_cast(2 - li1 == li1) ); + PRIVATE_EXPR_TEST( (tmp2=li2), static_cast((tmp2-=1) == li1) ); + PRIVATE_EXPR_TEST( (tmp2=li2), static_cast((tmp2-=li1) == li1) ); + BOOST_CHECK( static_cast(li1 + li1 == li2) ); + BOOST_CHECK( static_cast(li1 + 1 == li2) ); + BOOST_CHECK( static_cast(1 + li1 == li2) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2+=1) == li2) ); + PRIVATE_EXPR_TEST( (tmp2=li1), static_cast((tmp2+=li1) == li2) ); + + cout << "Performed tests on MyLongInt objects.\n"; + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/utility/test/result_of_test.cpp b/tools/boost_1_65_1/libs/utility/test/result_of_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ea72f122adbd07256f16a0e668cc2cbd0af0a42 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/result_of_test.cpp @@ -0,0 +1,316 @@ +// Boost result_of library + +// Copyright Douglas Gregor 2003-2004. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Examples: +// To run the default test: +// $ cd libs/utility/test && bjam +// To test decltype on g++ 2.7: +// $ cd libs/utility/test && bjam cxxflags="-std=c++11 -D BOOST_RESULT_OF_USE_DECLTYPE" + +#include + +// For more information, see http://www.boost.org/libs/utility +#include +#include +#include +#include + +struct int_result_type +{ + typedef int result_type; + result_type operator()(float); +}; + +struct int_result_of +{ + template struct result { typedef int type; }; + result::type operator()(double); + result::type operator()(double) const; + result::type operator()(); + result::type operator()() volatile; +}; + +struct int_result_type_and_float_result_of_and_char_return +{ + typedef int result_type; + template struct result { typedef float type; }; + char operator()(char); +}; + +template +struct int_result_type_template +{ + typedef int result_type; + result_type operator()(float); +}; + +template +struct int_result_of_template +{ + template struct result; + template struct result { typedef int type; }; + typename result(double)>::type operator()(double); + typename result(double)>::type operator()(double) const; + typename result(double)>::type operator()(); + typename result(double)>::type operator()() volatile; +}; + +template +struct int_result_type_and_float_result_of_and_char_return_template +{ + typedef int result_type; + template struct result; + template struct result { typedef float type; }; + char operator()(char); +}; + +template +struct cv_overload_check {}; + +struct result_of_member_function_template +{ + template struct result; + + template struct result { typedef That type; }; + template typename result::type operator()(T); + + template struct result { typedef cv_overload_check type; }; + template typename result::type operator()(T) const; + + template struct result { typedef cv_overload_check type; }; + template typename result::type operator()(T) volatile; + + template struct result { typedef cv_overload_check type; }; + template typename result::type operator()(T) const volatile; + + template struct result { typedef That & type; }; + template typename result::type operator()(T &, T); + + template struct result { typedef That const & type; }; + template typename result::type operator()(T const &, T); + + template struct result { typedef That volatile & type; }; + template typename result::type operator()(T volatile &, T); + + template struct result { typedef That const volatile & type; }; + template typename result::type operator()(T const volatile &, T); +}; + +struct no_result_type_or_result +{ + short operator()(double); + cv_overload_check operator()(double) const; + cv_overload_check operator()(double) volatile; + cv_overload_check operator()(double) const volatile; + int operator()(); + cv_overload_check operator()() const; + cv_overload_check operator()() volatile; + cv_overload_check operator()() const volatile; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + short operator()(int&&); + int operator()(int&); + long operator()(int const&); +#endif +}; + +template +struct no_result_type_or_result_template +{ + short operator()(double); + cv_overload_check operator()(double) const; + cv_overload_check operator()(double) volatile; + cv_overload_check operator()(double) const volatile; + int operator()(); + cv_overload_check operator()() const; + cv_overload_check operator()() volatile; + cv_overload_check operator()() const volatile; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + short operator()(int&&); + int operator()(int&); + long operator()(int const&); +#endif +}; + +// sfinae_tests are derived from example code from Joel de Guzman, +// which demonstrated the interaction between result_of and SFINAE. +template +typename boost::result_of::type +sfinae_test(F f, Arg const& arg) +{ + return f(arg); +} + +template +typename boost::result_of::type +sfinae_test(F f, Arg& arg) +{ + return f(arg); +} + +int sfinae_test_f(int& i) +{ + return i; +} + +struct X {}; + +int main() +{ + using namespace boost; + + typedef int (*func_ptr)(float, double); + typedef int (&func_ref)(float, double); + typedef int (*func_ptr_0)(); + typedef int (&func_ref_0)(); + typedef void (*func_ptr_void)(float, double); + typedef void (&func_ref_void)(float, double); + typedef void (*func_ptr_void_0)(); + typedef void (&func_ref_void_0)(); + typedef int (X::*mem_func_ptr)(float); + typedef int (X::*mem_func_ptr_c)(float) const; + typedef int (X::*mem_func_ptr_v)(float) volatile; + typedef int (X::*mem_func_ptr_cv)(float) const volatile; + typedef int (X::*mem_func_ptr_0)(); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(float)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, int>::value)); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(float)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, int>::value)); + + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, void>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, void>::value)); + + // Prior to decltype, result_of could not deduce the return type + // of nullary function objects unless they exposed a result_type. +#if defined(BOOST_RESULT_OF_USE_DECLTYPE) + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, int>::value)); +#else + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, void>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, void>::value)); +#endif + + // Prior to decltype, result_of ignored a nested result<> if + // result_type was defined. After decltype, result_of deduces the + // actual return type of the function object, ignoring both + // result<> and result_type. +#if defined(BOOST_RESULT_OF_USE_DECLTYPE) + BOOST_STATIC_ASSERT((is_same::type, char>::value)); + BOOST_STATIC_ASSERT((is_same(char)>::type, char>::value)); +#else + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(char)>::type, int>::value)); +#endif + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(char)>::type, int>::value)); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + + BOOST_STATIC_ASSERT((is_same::type, double>::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, int &>::value)); + BOOST_STATIC_ASSERT((is_same::type, int const &>::value)); + BOOST_STATIC_ASSERT((is_same::type, int volatile &>::value)); + BOOST_STATIC_ASSERT((is_same::type, int const volatile &>::value)); + + BOOST_STATIC_ASSERT((is_same::type, double>::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, int &>::value)); + BOOST_STATIC_ASSERT((is_same::type, int const &>::value)); + BOOST_STATIC_ASSERT((is_same::type, int volatile &>::value)); + BOOST_STATIC_ASSERT((is_same::type, int const volatile &>::value)); + + typedef int (*pf_t)(int); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type,int>::value)); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type,int>::value)); + +#if defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) + BOOST_STATIC_ASSERT((is_same::type, short>::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same::type, cv_overload_check >::value)); + + BOOST_STATIC_ASSERT((is_same(double)>::type, short>::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same(double)>::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, cv_overload_check >::value)); + BOOST_STATIC_ASSERT((is_same(void)>::type, cv_overload_check >::value)); +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + BOOST_STATIC_ASSERT((is_same::type, short>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, long>::value)); + BOOST_STATIC_ASSERT((is_same(int&&)>::type, short>::value)); + BOOST_STATIC_ASSERT((is_same(int&)>::type, int>::value)); + BOOST_STATIC_ASSERT((is_same(int const&)>::type, long>::value)); +#endif +#endif + +#if defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) + int i = 123; + sfinae_test(sfinae_test_f, i); +#endif // defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/shared_iterator_test.cpp b/tools/boost_1_65_1/libs/utility/test/shared_iterator_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ff5b9c6f3a9fdeea07452f970316cd584b061127 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/shared_iterator_test.cpp @@ -0,0 +1,64 @@ +// Copyright 2003 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Shared container iterator adaptor +// Author: Ronald Garcia +// See http://boost.org/libs/utility/shared_container_iterator.html +// for documentation. + +// +// shared_iterator_test.cpp - Regression tests for shared_container_iterator. +// + + +#include "boost/shared_container_iterator.hpp" +#include "boost/shared_ptr.hpp" +#include +#include + +struct resource { + static int count; + resource() { ++count; } + resource(resource const&) { ++count; } + ~resource() { --count; } +}; +int resource::count = 0; + +typedef std::vector resources_t; + +typedef boost::shared_container_iterator< resources_t > iterator; + + +void set_range(iterator& i, iterator& end) { + + boost::shared_ptr< resources_t > objs(new resources_t()); + + for (int j = 0; j != 6; ++j) + objs->push_back(resource()); + + i = iterator(objs->begin(),objs); + end = iterator(objs->end(),objs); + assert(resource::count == 6); +} + + +int main() { + + assert(resource::count == 0); + + { + iterator i; + { + iterator end; + set_range(i,end); + assert(resource::count == 6); + } + assert(resource::count == 6); + } + assert(resource::count == 0); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_ref_from_rvalue.cpp b/tools/boost_1_65_1/libs/utility/test/string_ref_from_rvalue.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a109f1740d4111167e5797ad8d76d5b8ddc49d05 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_ref_from_rvalue.cpp @@ -0,0 +1,28 @@ +/* + Copyright (c) Marshall Clow 2017. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include +#include +#include + +#include + +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) +#error "Unsupported test" +#endif + +#include "boost/test/minimal.hpp" + +std::string makeatemp() { return "abc"; } + +int test_main(int, char **) +{ + boost::basic_string_ref sv(makeatemp()); + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_ref_test1.cpp b/tools/boost_1_65_1/libs/utility/test/string_ref_test1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f1d4df2f4772f8035ae5d609e131a41a9182bd61 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_ref_test1.cpp @@ -0,0 +1,109 @@ +/* + Copyright (c) Marshall Clow 2012-2012. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include +#include +#include + +#include + +#define BOOST_TEST_MAIN +#include + +typedef boost::string_ref string_ref; + +// Should be equal +void interop ( const std::string &str, string_ref ref ) { +// BOOST_CHECK ( str == ref ); + BOOST_CHECK ( str.size () == ref.size ()); + BOOST_CHECK ( std::equal ( str.begin (), str.end (), ref.begin ())); + BOOST_CHECK ( std::equal ( str.rbegin (), str.rend (), ref.rbegin ())); + } + +void null_tests ( const char *p ) { +// All zero-length string-refs should be equal + string_ref sr1; // NULL, 0 + string_ref sr2 ( NULL, 0 ); + string_ref sr3 ( p, 0 ); + string_ref sr4 ( p ); + sr4.clear (); + + BOOST_CHECK ( sr1 == sr2 ); + BOOST_CHECK ( sr1 == sr3 ); + BOOST_CHECK ( sr2 == sr3 ); + BOOST_CHECK ( sr1 == sr4 ); + } + +// make sure that substrings work just like strings +void test_substr ( const std::string &str ) { + const size_t sz = str.size (); + string_ref ref ( str ); + +// Substrings at the end + for ( size_t i = 0; i <= sz; ++ i ) + interop ( str.substr ( i ), ref.substr ( i )); + +// Substrings at the beginning + for ( size_t i = 0; i <= sz; ++ i ) + interop ( str.substr ( 0, i ), ref.substr ( 0, i )); + +// All possible substrings + for ( size_t i = 0; i < sz; ++i ) + for ( size_t j = i; j < sz; ++j ) + interop ( str.substr ( i, j ), ref.substr ( i, j )); + } + +// make sure that removing prefixes and suffixes work just like strings +void test_remove ( const std::string &str ) { + const size_t sz = str.size (); + std::string work; + string_ref ref; + + for ( size_t i = 1; i <= sz; ++i ) { + work = str; + ref = str; + while ( ref.size () >= i ) { + interop ( work, ref ); + work.erase ( 0, i ); + ref.remove_prefix (i); + } + } + + for ( size_t i = 1; i < sz; ++ i ) { + work = str; + ref = str; + while ( ref.size () >= i ) { + interop ( work, ref ); + work.erase ( work.size () - i, i ); + ref.remove_suffix (i); + } + } + } + +const char *test_strings [] = { + "", + "1", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "0123456789", + NULL + }; + +BOOST_AUTO_TEST_CASE( test_main ) +{ + const char **p = &test_strings[0]; + + while ( *p != NULL ) { + interop ( *p, *p ); + test_substr ( *p ); + test_remove ( *p ); + null_tests ( *p ); + + p++; + } +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_ref_test2.cpp b/tools/boost_1_65_1/libs/utility/test/string_ref_test2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..081af54a5bb5c7095086a4ea1e9e006407b16b3c --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_ref_test2.cpp @@ -0,0 +1,318 @@ +/* + Copyright (c) Marshall Clow 2012-2012. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include +#include // for std::strchr + +#include + +#define BOOST_TEST_MAIN +#include + +typedef boost::string_ref string_ref; + +void ends_with ( const char *arg ) { + const size_t sz = std::strlen ( arg ); + string_ref sr ( arg ); + string_ref sr2 ( arg ); + const char *p = arg; + + while ( *p ) { + BOOST_CHECK ( sr.ends_with ( p )); + ++p; + } + + while ( !sr2.empty ()) { + BOOST_CHECK ( sr.ends_with ( sr2 )); + sr2.remove_prefix (1); + } + + sr2 = arg; + while ( !sr2.empty ()) { + BOOST_CHECK ( sr.ends_with ( sr2 )); + sr2.remove_prefix (1); + } + + char ch = sz == 0 ? '\0' : arg [ sz - 1 ]; + sr2 = arg; + if ( sz > 0 ) + BOOST_CHECK ( sr2.ends_with ( ch )); + BOOST_CHECK ( !sr2.ends_with ( ++ch )); + BOOST_CHECK ( sr2.ends_with ( string_ref ())); + } + +void starts_with ( const char *arg ) { + const size_t sz = std::strlen ( arg ); + string_ref sr ( arg ); + string_ref sr2 ( arg ); + const char *p = arg + std::strlen ( arg ) - 1; + while ( p >= arg ) { + std::string foo ( arg, p + 1 ); + BOOST_CHECK ( sr.starts_with ( foo )); + --p; + } + + while ( !sr2.empty ()) { + BOOST_CHECK ( sr.starts_with ( sr2 )); + sr2.remove_suffix (1); + } + + char ch = *arg; + sr2 = arg; + if ( sz > 0 ) + BOOST_CHECK ( sr2.starts_with ( ch )); + BOOST_CHECK ( !sr2.starts_with ( ++ch )); + BOOST_CHECK ( sr2.starts_with ( string_ref ())); + } + +void reverse ( const char *arg ) { +// Round trip + string_ref sr1 ( arg ); + std::string string1 ( sr1.rbegin (), sr1.rend ()); + string_ref sr2 ( string1 ); + std::string string2 ( sr2.rbegin (), sr2.rend ()); + + BOOST_CHECK ( std::equal ( sr2.rbegin (), sr2.rend (), arg )); + BOOST_CHECK ( string2 == arg ); + BOOST_CHECK ( std::equal ( sr1.begin (), sr1.end (), string2.begin ())); + } + +// This helper function eliminates signed vs. unsigned warnings +string_ref::size_type ptr_diff ( const char *res, const char *base ) { + BOOST_CHECK ( res >= base ); + return static_cast ( res - base ); + } + +void find ( const char *arg ) { + string_ref sr1; + string_ref sr2; + const char *p; + +// Look for each character in the string(searching from the start) + p = arg; + sr1 = arg; + while ( *p ) { + string_ref::size_type pos = sr1.find(*p); + BOOST_CHECK ( pos != string_ref::npos && ( pos <= ptr_diff ( p, arg ))); + ++p; + } + +// Look for each character in the string (searching from the end) + p = arg; + sr1 = arg; + while ( *p ) { + string_ref::size_type pos = sr1.rfind(*p); + BOOST_CHECK ( pos != string_ref::npos && pos < sr1.size () && ( pos >= ptr_diff ( p, arg ))); + ++p; + } + +// Look for pairs on characters (searching from the start) + sr1 = arg; + p = arg; + while ( *p && *(p+1)) { + string_ref sr3 ( p, 2 ); + string_ref::size_type pos = sr1.find ( sr3 ); + BOOST_CHECK ( pos != string_ref::npos && pos <= static_cast( p - arg )); + p++; + } + + sr1 = arg; + p = arg; +// for all possible chars, see if we find them in the right place. +// Note that strchr will/might do the _wrong_ thing if we search for NULL + for ( int ch = 1; ch < 256; ++ch ) { + string_ref::size_type pos = sr1.find(ch); + const char *strp = std::strchr ( arg, ch ); + BOOST_CHECK (( strp == NULL ) == ( pos == string_ref::npos )); + if ( strp != NULL ) + BOOST_CHECK ( ptr_diff ( strp, arg ) == pos ); + } + + sr1 = arg; + p = arg; +// for all possible chars, see if we find them in the right place. +// Note that strchr will/might do the _wrong_ thing if we search for NULL + for ( int ch = 1; ch < 256; ++ch ) { + string_ref::size_type pos = sr1.rfind(ch); + const char *strp = std::strrchr ( arg, ch ); + BOOST_CHECK (( strp == NULL ) == ( pos == string_ref::npos )); + if ( strp != NULL ) + BOOST_CHECK ( ptr_diff ( strp, arg ) == pos ); + } + + +// Find everything at the start + p = arg; + sr1 = arg; + while ( !sr1.empty ()) { + string_ref::size_type pos = sr1.find(*p); + BOOST_CHECK ( pos == 0 ); + sr1.remove_prefix (1); + ++p; + } + +// Find everything at the end + sr1 = arg; + p = arg + std::strlen ( arg ) - 1; + while ( !sr1.empty ()) { + string_ref::size_type pos = sr1.rfind(*p); + BOOST_CHECK ( pos == sr1.size () - 1 ); + sr1.remove_suffix (1); + --p; + } + +// Find everything at the start + sr1 = arg; + p = arg; + while ( !sr1.empty ()) { + string_ref::size_type pos = sr1.find_first_of(*p); + BOOST_CHECK ( pos == 0 ); + sr1.remove_prefix (1); + ++p; + } + + +// Find everything at the end + sr1 = arg; + p = arg + std::strlen ( arg ) - 1; + while ( !sr1.empty ()) { + string_ref::size_type pos = sr1.find_last_of(*p); + BOOST_CHECK ( pos == sr1.size () - 1 ); + sr1.remove_suffix (1); + --p; + } + +// Basic sanity checking for "find_first_of / find_first_not_of" + sr1 = arg; + sr2 = arg; + while ( !sr1.empty() ) { + BOOST_CHECK ( sr1.find_first_of ( sr2 ) == 0 ); + BOOST_CHECK ( sr1.find_first_not_of ( sr2 ) == string_ref::npos ); + sr1.remove_prefix ( 1 ); + } + + p = arg; + sr1 = arg; + while ( *p ) { + string_ref::size_type pos1 = sr1.find_first_of(*p); + string_ref::size_type pos2 = sr1.find_first_not_of(*p); + BOOST_CHECK ( pos1 != string_ref::npos && pos1 < sr1.size () && pos1 <= ptr_diff ( p, arg )); + if ( pos2 != string_ref::npos ) { + for ( size_t i = 0 ; i < pos2; ++i ) + BOOST_CHECK ( sr1[i] == *p ); + BOOST_CHECK ( sr1 [ pos2 ] != *p ); + } + + BOOST_CHECK ( pos2 != pos1 ); + ++p; + } + +// Basic sanity checking for "find_last_of / find_last_not_of" + sr1 = arg; + sr2 = arg; + while ( !sr1.empty() ) { + BOOST_CHECK ( sr1.find_last_of ( sr2 ) == ( sr1.size () - 1 )); + BOOST_CHECK ( sr1.find_last_not_of ( sr2 ) == string_ref::npos ); + sr1.remove_suffix ( 1 ); + } + + p = arg; + sr1 = arg; + while ( *p ) { + string_ref::size_type pos1 = sr1.find_last_of(*p); + string_ref::size_type pos2 = sr1.find_last_not_of(*p); + BOOST_CHECK ( pos1 != string_ref::npos && pos1 < sr1.size () && pos1 >= ptr_diff ( p, arg )); + BOOST_CHECK ( pos2 == string_ref::npos || pos1 < sr1.size ()); + if ( pos2 != string_ref::npos ) { + for ( size_t i = sr1.size () -1 ; i > pos2; --i ) + BOOST_CHECK ( sr1[i] == *p ); + BOOST_CHECK ( sr1 [ pos2 ] != *p ); + } + + BOOST_CHECK ( pos2 != pos1 ); + ++p; + } + + } + + +void to_string ( const char *arg ) { + string_ref sr1; + std::string str1; + std::string str2; + + str1.assign ( arg ); + sr1 = arg; +// str2 = sr1.to_string > (); + str2 = sr1.to_string (); + BOOST_CHECK ( str1 == str2 ); + +#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS + std::string str3 = static_cast ( sr1 ); + BOOST_CHECK ( str1 == str3 ); +#endif + } + +void compare ( const char *arg ) { + string_ref sr1; + std::string str1; + std::string str2 = str1; + + str1.assign ( arg ); + sr1 = arg; + BOOST_CHECK ( sr1 == sr1); // compare string_ref and string_ref + BOOST_CHECK ( sr1 == str1); // compare string and string_ref + BOOST_CHECK ( str1 == sr1 ); // compare string_ref and string + BOOST_CHECK ( sr1 == arg ); // compare string_ref and pointer + BOOST_CHECK ( arg == sr1 ); // compare pointer and string_ref + + if ( sr1.size () > 0 ) { + (*str1.rbegin())++; + BOOST_CHECK ( sr1 != str1 ); + BOOST_CHECK ( str1 != sr1 ); + BOOST_CHECK ( sr1 < str1 ); + BOOST_CHECK ( sr1 <= str1 ); + BOOST_CHECK ( str1 > sr1 ); + BOOST_CHECK ( str1 >= sr1 ); + + (*str1.rbegin()) -= 2; + BOOST_CHECK ( sr1 != str1 ); + BOOST_CHECK ( str1 != sr1 ); + BOOST_CHECK ( sr1 > str1 ); + BOOST_CHECK ( sr1 >= str1 ); + BOOST_CHECK ( str1 < sr1 ); + BOOST_CHECK ( str1 <= sr1 ); + } + } + +const char *test_strings [] = { + "", + "0", + "abc", + "AAA", // all the same + "adsfadadiaef;alkdg;aljt;j agl;sjrl;tjs;lga;lretj;srg[w349u5209dsfadfasdfasdfadsf", + "abc\0asdfadsfasf", + NULL + }; + +BOOST_AUTO_TEST_CASE( test_main ) +{ + const char **p = &test_strings[0]; + + while ( *p != NULL ) { + starts_with ( *p ); + ends_with ( *p ); + reverse ( *p ); + find ( *p ); + to_string ( *p ); + compare ( *p ); + + p++; + } +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_ref_test_io.cpp b/tools/boost_1_65_1/libs/utility/test/string_ref_test_io.cpp new file mode 100644 index 0000000000000000000000000000000000000000..72f58377fd1378ae033237fb5e58a32d2ac436ec --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_ref_test_io.cpp @@ -0,0 +1,179 @@ +/* + * Copyright Andrey Semashev 2013. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +/*! + * \file string_ref_test_io.cpp + * \author Andrey Semashev + * \date 26.05.2013 + * + * \brief This header contains tests for stream operations of \c basic_string_ref. + */ + +#define BOOST_TEST_MODULE string_ref_test_io + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +typedef boost::mpl::vector< + char +#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) + , wchar_t +#endif +/* Current implementations seem to be missing codecvt facets to convert chars to char16_t and char32_t even though the types are available. +#if !defined(BOOST_NO_CXX11_CHAR16_T) + , char16_t +#endif +#if !defined(BOOST_NO_CXX11_CHAR32_T) + , char32_t +#endif +*/ +>::type char_types; + +static const char* test_strings[] = +{ + "begin", + "abcd", + "end" +}; + +//! The context with test data for particular character type +template< typename CharT > +struct context +{ + typedef CharT char_type; + typedef std::basic_string< char_type > string_type; + typedef std::basic_ostringstream< char_type > ostream_type; + + string_type begin, abcd, end; + + context() + { + boost::string_ref str = test_strings[0]; + std::copy(str.begin(), str.end(), std::back_inserter(begin)); + + str = test_strings[1]; + std::copy(str.begin(), str.end(), std::back_inserter(abcd)); + + str = test_strings[2]; + std::copy(str.begin(), str.end(), std::back_inserter(end)); + } +}; + +// Test regular output +BOOST_AUTO_TEST_CASE_TEMPLATE(string_ref_output, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_ref< char_type > string_ref_type; + + context< char_type > ctx; + + ostream_type strm; + strm << string_ref_type(ctx.abcd); + BOOST_CHECK(strm.str() == ctx.abcd); +} + +// Test support for padding +BOOST_AUTO_TEST_CASE_TEMPLATE(padding, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_ref< char_type > string_ref_type; + + context< char_type > ctx; + + // Test for padding + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::setw(8) << string_ref_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } + + // Test for long padding + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::setw(100) << string_ref_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setw(100) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } + + // Test that short width does not truncate the string + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::setw(1) << string_ref_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setw(1) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } +} + +// Test support for padding fill +BOOST_AUTO_TEST_CASE_TEMPLATE(padding_fill, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_ref< char_type > string_ref_type; + + context< char_type > ctx; + + ostream_type strm_ref; + strm_ref << ctx.begin << std::setfill(static_cast< char_type >('x')) << std::setw(8) << string_ref_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setfill(static_cast< char_type >('x')) << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); +} + +// Test support for alignment +BOOST_AUTO_TEST_CASE_TEMPLATE(alignment, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_ref< char_type > string_ref_type; + + context< char_type > ctx; + + // Left alignment + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::left << std::setw(8) << string_ref_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::left << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } + + // Right alignment + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::right << std::setw(8) << string_ref_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::right << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_view_constexpr_test1.cpp b/tools/boost_1_65_1/libs/utility/test/string_view_constexpr_test1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..014ef1ea58fa50c11a403979b6b0ec171375c512 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_view_constexpr_test1.cpp @@ -0,0 +1,121 @@ +/* + Copyright (c) Marshall Clow 2017-2017. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include // for placement new +#include +#include // for NULL, std::size_t, std::ptrdiff_t +#include // for std::strchr and std::strcmp +#include // for std::malloc and std::free + +#include +#include + +#define BOOST_TEST_MAIN +#include + + +#if __cplusplus < 201402L +BOOST_AUTO_TEST_CASE( test_main ) {} +#else + +struct constexpr_char_traits +{ + typedef char char_type; + typedef int int_type; + typedef std::streamoff off_type; + typedef std::streampos pos_type; + typedef std::mbstate_t state_type; + + static void assign(char_type& c1, const char_type& c2) noexcept { c1 = c2; } + static constexpr bool eq(char_type c1, char_type c2) noexcept { return c1 == c2; } + static constexpr bool lt(char_type c1, char_type c2) noexcept { return c1 < c2; } + + static constexpr int compare(const char_type* s1, const char_type* s2, size_t n) noexcept; + static constexpr size_t length(const char_type* s) noexcept; + static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a) noexcept; + static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n) noexcept; + static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n) noexcept; + static constexpr char_type* assign(char_type* s, size_t n, char_type a) noexcept; + + static constexpr int_type not_eof(int_type c) noexcept { return eq_int_type(c, eof()) ? ~eof() : c; } + static constexpr char_type to_char_type(int_type c) noexcept { return char_type(c); } + static constexpr int_type to_int_type(char_type c) noexcept { return int_type(c); } + static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept { return c1 == c2; } + static constexpr int_type eof() noexcept { return EOF; } +}; + +// yields: +// 0 if for each i in [0,n), X::eq(s1[i],s2[i]) is true; +// else, a negative value if, for some j in [0,n), X::lt(s1[j],s2[j]) is true and +// for each i in [0,j) X::eq(s2[i],s2[i]) is true; +// else a positive value. +constexpr int constexpr_char_traits::compare(const char_type* s1, const char_type* s2, size_t n) noexcept +{ + for (; n != 0; --n, ++s1, ++s2) + { + if (lt(*s1, *s2)) + return -1; + if (lt(*s2, *s1)) + return 1; + } + return 0; +} + +// yields: the smallest i such that X::eq(s[i],charT()) is true. +constexpr size_t constexpr_char_traits::length(const char_type* s) noexcept +{ + size_t len = 0; + for (; !eq(*s, char_type(0)); ++s) + ++len; + return len; +} + +typedef boost::basic_string_view string_view; + +BOOST_AUTO_TEST_CASE( test_main ) +{ + constexpr string_view sv1; + constexpr string_view sv2{"abc", 3}; // ptr, len + constexpr string_view sv3{"def"}; // ptr + + constexpr const char *s1 = ""; + constexpr const char *s2 = "abc"; + + static_assert( (sv1 == sv1), "" ); + + static_assert(!(sv1 == sv2), "" ); + static_assert( (sv1 != sv2), "" ); + static_assert( (sv1 < sv2), "" ); + static_assert( (sv1 <= sv2), "" ); + static_assert(!(sv1 > sv2), "" ); + static_assert(!(sv1 >= sv2), "" ); + + static_assert(!(s1 == sv2), "" ); + static_assert( (s1 != sv2), "" ); + static_assert( (s1 < sv2), "" ); + static_assert( (s1 <= sv2), "" ); + static_assert(!(s1 > sv2), "" ); + static_assert(!(s1 >= sv2), "" ); + + static_assert(!(sv1 == s2), "" ); + static_assert( (sv1 != s2), "" ); + static_assert( (sv1 < s2), "" ); + static_assert( (sv1 <= s2), "" ); + static_assert(!(sv1 > s2), "" ); + static_assert(!(sv1 >= s2), "" ); + + static_assert( sv1.compare(sv2) < 0, "" ); + static_assert( sv1.compare(sv1) == 0, "" ); + static_assert( sv3.compare(sv1) > 0, "" ); + + static_assert( sv1.compare(s2) < 0, "" ); + static_assert( sv1.compare(s1) == 0, "" ); + static_assert( sv3.compare(s1) > 0, "" ); +} +#endif diff --git a/tools/boost_1_65_1/libs/utility/test/string_view_from_rvalue.cpp b/tools/boost_1_65_1/libs/utility/test/string_view_from_rvalue.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3402a084d670a75d009676f45bed7c74e36bc93e --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_view_from_rvalue.cpp @@ -0,0 +1,28 @@ +/* + Copyright (c) Marshall Clow 2017. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include +#include +#include + +#include + +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) +#error "Unsupported test" +#endif + +#include "boost/test/minimal.hpp" + +std::string makeatemp() { return "abc"; } + +int test_main(int, char **) +{ + boost::basic_string_view sv(makeatemp()); + return 0; +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_view_test1.cpp b/tools/boost_1_65_1/libs/utility/test/string_view_test1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a8b0cd0449e033bee3394b0db71ff5e2b03bfa35 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_view_test1.cpp @@ -0,0 +1,109 @@ +/* + Copyright (c) Marshall Clow 2012-2012. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include +#include +#include + +#include + +#define BOOST_TEST_MAIN +#include + +typedef boost::string_view string_view; + +// Should be equal +void interop ( const std::string &str, string_view ref ) { +// BOOST_CHECK ( str == ref ); + BOOST_CHECK ( str.size () == ref.size ()); + BOOST_CHECK ( std::equal ( str.begin (), str.end (), ref.begin ())); + BOOST_CHECK ( std::equal ( str.rbegin (), str.rend (), ref.rbegin ())); + } + +void null_tests ( const char *p ) { +// All zero-length string-refs should be equal + string_view sr1; // NULL, 0 + string_view sr2 ( NULL, 0 ); + string_view sr3 ( p, 0 ); + string_view sr4 ( p ); + sr4.clear (); + + BOOST_CHECK ( sr1 == sr2 ); + BOOST_CHECK ( sr1 == sr3 ); + BOOST_CHECK ( sr2 == sr3 ); + BOOST_CHECK ( sr1 == sr4 ); + } + +// make sure that substrings work just like strings +void test_substr ( const std::string &str ) { + const size_t sz = str.size (); + string_view ref ( str ); + +// Substrings at the end + for ( size_t i = 0; i <= sz; ++ i ) + interop ( str.substr ( i ), ref.substr ( i )); + +// Substrings at the beginning + for ( size_t i = 0; i <= sz; ++ i ) + interop ( str.substr ( 0, i ), ref.substr ( 0, i )); + +// All possible substrings + for ( size_t i = 0; i < sz; ++i ) + for ( size_t j = i; j < sz; ++j ) + interop ( str.substr ( i, j ), ref.substr ( i, j )); + } + +// make sure that removing prefixes and suffixes work just like strings +void test_remove ( const std::string &str ) { + const size_t sz = str.size (); + std::string work; + string_view ref; + + for ( size_t i = 1; i <= sz; ++i ) { + work = str; + ref = str; + while ( ref.size () >= i ) { + interop ( work, ref ); + work.erase ( 0, i ); + ref.remove_prefix (i); + } + } + + for ( size_t i = 1; i < sz; ++ i ) { + work = str; + ref = str; + while ( ref.size () >= i ) { + interop ( work, ref ); + work.erase ( work.size () - i, i ); + ref.remove_suffix (i); + } + } + } + +const char *test_strings [] = { + "", + "1", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "0123456789", + NULL + }; + +BOOST_AUTO_TEST_CASE( test_main ) +{ + const char **p = &test_strings[0]; + + while ( *p != NULL ) { + interop ( *p, *p ); + test_substr ( *p ); + test_remove ( *p ); + null_tests ( *p ); + + p++; + } +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_view_test2.cpp b/tools/boost_1_65_1/libs/utility/test/string_view_test2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b9675d2ebc5e699ce3b0aa949efc0735392cf163 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_view_test2.cpp @@ -0,0 +1,405 @@ +/* + Copyright (c) Marshall Clow 2012-2012. + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + For more information, see http://www.boost.org +*/ + +#include // for placement new +#include +#include // for NULL, std::size_t, std::ptrdiff_t +#include // for std::strchr and std::strcmp +#include // for std::malloc and std::free + +#include +#include + +#define BOOST_TEST_MAIN +#include + +typedef boost::string_view string_view; + +void ends_with ( const char *arg ) { + const size_t sz = std::strlen ( arg ); + string_view sr ( arg ); + string_view sr2 ( arg ); + const char *p = arg; + + while ( *p ) { + BOOST_CHECK ( sr.ends_with ( p )); + ++p; + } + + while ( !sr2.empty ()) { + BOOST_CHECK ( sr.ends_with ( sr2 )); + sr2.remove_prefix (1); + } + + sr2 = arg; + while ( !sr2.empty ()) { + BOOST_CHECK ( sr.ends_with ( sr2 )); + sr2.remove_prefix (1); + } + + char ch = sz == 0 ? '\0' : arg [ sz - 1 ]; + sr2 = arg; + if ( sz > 0 ) + BOOST_CHECK ( sr2.ends_with ( ch )); + BOOST_CHECK ( !sr2.ends_with ( ++ch )); + BOOST_CHECK ( sr2.ends_with ( string_view())); + } + +void starts_with ( const char *arg ) { + const size_t sz = std::strlen ( arg ); + string_view sr ( arg ); + string_view sr2 ( arg ); + const char *p = arg + std::strlen ( arg ) - 1; + while ( p >= arg ) { + std::string foo ( arg, p + 1 ); + BOOST_CHECK ( sr.starts_with ( foo )); + --p; + } + + while ( !sr2.empty ()) { + BOOST_CHECK ( sr.starts_with ( sr2 )); + sr2.remove_suffix (1); + } + + char ch = *arg; + sr2 = arg; + if ( sz > 0 ) + BOOST_CHECK ( sr2.starts_with ( ch )); + BOOST_CHECK ( !sr2.starts_with ( ++ch )); + BOOST_CHECK ( sr2.starts_with ( string_view ())); + } + +void reverse ( const char *arg ) { +// Round trip + string_view sr1 ( arg ); + std::string string1 ( sr1.rbegin (), sr1.rend ()); + string_view sr2 ( string1 ); + std::string string2 ( sr2.rbegin (), sr2.rend ()); + + BOOST_CHECK ( std::equal ( sr2.rbegin (), sr2.rend (), arg )); + BOOST_CHECK ( string2 == arg ); + BOOST_CHECK ( std::equal ( sr1.begin (), sr1.end (), string2.begin ())); + } + +// This helper function eliminates signed vs. unsigned warnings +string_view::size_type ptr_diff ( const char *res, const char *base ) { + BOOST_CHECK ( res >= base ); + return static_cast ( res - base ); + } + +void find ( const char *arg ) { + string_view sr1; + string_view sr2; + const char *p; + +// Look for each character in the string(searching from the start) + p = arg; + sr1 = arg; + while ( *p ) { + string_view::size_type pos = sr1.find(*p); + BOOST_CHECK ( pos != string_view::npos && ( pos <= ptr_diff ( p, arg ))); + ++p; + } + +// Look for each character in the string (searching from the end) + p = arg; + sr1 = arg; + while ( *p ) { + string_view::size_type pos = sr1.rfind(*p); + BOOST_CHECK ( pos != string_view::npos && pos < sr1.size () && ( pos >= ptr_diff ( p, arg ))); + ++p; + } + +// Look for pairs on characters (searching from the start) + sr1 = arg; + p = arg; + while ( *p && *(p+1)) { + string_view sr3 ( p, 2 ); + string_view::size_type pos = sr1.find ( sr3 ); + BOOST_CHECK ( pos != string_view::npos && pos <= static_cast( p - arg )); + p++; + } + + sr1 = arg; + p = arg; +// for all possible chars, see if we find them in the right place. +// Note that strchr will/might do the _wrong_ thing if we search for NULL + for ( int ch = 1; ch < 256; ++ch ) { + string_view::size_type pos = sr1.find(ch); + const char *strp = std::strchr ( arg, ch ); + BOOST_CHECK (( strp == NULL ) == ( pos == string_view::npos )); + if ( strp != NULL ) + BOOST_CHECK ( ptr_diff ( strp, arg ) == pos ); + } + + sr1 = arg; + p = arg; +// for all possible chars, see if we find them in the right place. +// Note that strchr will/might do the _wrong_ thing if we search for NULL + for ( int ch = 1; ch < 256; ++ch ) { + string_view::size_type pos = sr1.rfind(ch); + const char *strp = std::strrchr ( arg, ch ); + BOOST_CHECK (( strp == NULL ) == ( pos == string_view::npos )); + if ( strp != NULL ) + BOOST_CHECK ( ptr_diff ( strp, arg ) == pos ); + } + + +// Find everything at the start + p = arg; + sr1 = arg; + while ( !sr1.empty ()) { + string_view::size_type pos = sr1.find(*p); + BOOST_CHECK ( pos == 0 ); + sr1.remove_prefix (1); + ++p; + } + +// Find everything at the end + sr1 = arg; + p = arg + std::strlen ( arg ) - 1; + while ( !sr1.empty ()) { + string_view::size_type pos = sr1.rfind(*p); + BOOST_CHECK ( pos == sr1.size () - 1 ); + sr1.remove_suffix (1); + --p; + } + +// Find everything at the start + sr1 = arg; + p = arg; + while ( !sr1.empty ()) { + string_view::size_type pos = sr1.find_first_of(*p); + BOOST_CHECK ( pos == 0 ); + sr1.remove_prefix (1); + ++p; + } + + +// Find everything at the end + sr1 = arg; + p = arg + std::strlen ( arg ) - 1; + while ( !sr1.empty ()) { + string_view::size_type pos = sr1.find_last_of(*p); + BOOST_CHECK ( pos == sr1.size () - 1 ); + sr1.remove_suffix (1); + --p; + } + +// Basic sanity checking for "find_first_of / find_first_not_of" + sr1 = arg; + sr2 = arg; + while ( !sr1.empty() ) { + BOOST_CHECK ( sr1.find_first_of ( sr2 ) == 0 ); + BOOST_CHECK ( sr1.find_first_not_of ( sr2 ) == string_view::npos ); + sr1.remove_prefix ( 1 ); + } + + p = arg; + sr1 = arg; + while ( *p ) { + string_view::size_type pos1 = sr1.find_first_of(*p); + string_view::size_type pos2 = sr1.find_first_not_of(*p); + BOOST_CHECK ( pos1 != string_view::npos && pos1 < sr1.size () && pos1 <= ptr_diff ( p, arg )); + if ( pos2 != string_view::npos ) { + for ( size_t i = 0 ; i < pos2; ++i ) + BOOST_CHECK ( sr1[i] == *p ); + BOOST_CHECK ( sr1 [ pos2 ] != *p ); + } + + BOOST_CHECK ( pos2 != pos1 ); + ++p; + } + +// Basic sanity checking for "find_last_of / find_last_not_of" + sr1 = arg; + sr2 = arg; + while ( !sr1.empty() ) { + BOOST_CHECK ( sr1.find_last_of ( sr2 ) == ( sr1.size () - 1 )); + BOOST_CHECK ( sr1.find_last_not_of ( sr2 ) == string_view::npos ); + sr1.remove_suffix ( 1 ); + } + + p = arg; + sr1 = arg; + while ( *p ) { + string_view::size_type pos1 = sr1.find_last_of(*p); + string_view::size_type pos2 = sr1.find_last_not_of(*p); + BOOST_CHECK ( pos1 != string_view::npos && pos1 < sr1.size () && pos1 >= ptr_diff ( p, arg )); + BOOST_CHECK ( pos2 == string_view::npos || pos1 < sr1.size ()); + if ( pos2 != string_view::npos ) { + for ( size_t i = sr1.size () -1 ; i > pos2; --i ) + BOOST_CHECK ( sr1[i] == *p ); + BOOST_CHECK ( sr1 [ pos2 ] != *p ); + } + + BOOST_CHECK ( pos2 != pos1 ); + ++p; + } + + } + +template +class custom_allocator { +public: + typedef T value_type; + typedef T* pointer; + typedef const T* const_pointer; + typedef void* void_pointer; + typedef const void* const_void_pointer; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef T& reference; + typedef const T& const_reference; + + template + struct rebind { + typedef custom_allocator other; + }; + + custom_allocator() BOOST_NOEXCEPT {} + template + custom_allocator(custom_allocator const&) BOOST_NOEXCEPT {} + + pointer allocate(size_type n) const { + return static_cast(std::malloc(sizeof(value_type) * n)); + } + void deallocate(pointer p, size_type) const BOOST_NOEXCEPT { + std::free(p); + } + + pointer address(reference value) const BOOST_NOEXCEPT { + return &value; + } + + const_pointer address(const_reference value) const BOOST_NOEXCEPT { + return &value; + } + + BOOST_CONSTEXPR size_type max_size() const BOOST_NOEXCEPT { + return (~(size_type)0u) / sizeof(value_type); + } + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template + void construct(U* ptr, Args&&... args) const { + ::new((void*)ptr) U(static_cast(args)...); + } +#else + template + void construct(U* ptr, V&& value) const { + ::new((void*)ptr) U(static_cast(value)); + } +#endif +#else + template + void construct(U* ptr, const V& value) const { + ::new((void*)ptr) U(value); + } +#endif + + template + void construct(U* ptr) const { + ::new((void*)ptr) U(); + } + + template + void destroy(U* ptr) const { + (void)ptr; + ptr->~U(); + } + }; + +template +BOOST_CONSTEXPR bool operator==(const custom_allocator &, const custom_allocator &) BOOST_NOEXCEPT { + return true; + } +template +BOOST_CONSTEXPR bool operator!=(const custom_allocator &, const custom_allocator &) BOOST_NOEXCEPT { + return false; + } + +void to_string ( const char *arg ) { + string_view sr1; + std::string str1; + std::string str2; + + str1.assign ( arg ); + sr1 = arg; +// str2 = sr1.to_string > (); + str2 = sr1.to_string (); + BOOST_CHECK ( str1 == str2 ); + + std::basic_string, custom_allocator > str3 = sr1.to_string(custom_allocator()); + BOOST_CHECK ( std::strcmp(str1.c_str(), str3.c_str()) == 0 ); + +#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS + std::string str4 = static_cast ( sr1 ); + BOOST_CHECK ( str1 == str4 ); +#endif + } + +void compare ( const char *arg ) { + string_view sr1; + std::string str1; + std::string str2 = str1; + + str1.assign ( arg ); + sr1 = arg; + BOOST_CHECK ( sr1 == sr1); // compare string_view and string_view + BOOST_CHECK ( sr1 == str1); // compare string and string_view + BOOST_CHECK ( str1 == sr1 ); // compare string_view and string + BOOST_CHECK ( sr1 == arg ); // compare string_view and pointer + BOOST_CHECK ( arg == sr1 ); // compare pointer and string_view + + if ( sr1.size () > 0 ) { + (*str1.rbegin())++; + BOOST_CHECK ( sr1 != str1 ); + BOOST_CHECK ( str1 != sr1 ); + BOOST_CHECK ( sr1 < str1 ); + BOOST_CHECK ( sr1 <= str1 ); + BOOST_CHECK ( str1 > sr1 ); + BOOST_CHECK ( str1 >= sr1 ); + + (*str1.rbegin()) -= 2; + BOOST_CHECK ( sr1 != str1 ); + BOOST_CHECK ( str1 != sr1 ); + BOOST_CHECK ( sr1 > str1 ); + BOOST_CHECK ( sr1 >= str1 ); + BOOST_CHECK ( str1 < sr1 ); + BOOST_CHECK ( str1 <= sr1 ); + } + } + +const char *test_strings [] = { + "", + "0", + "abc", + "AAA", // all the same + "adsfadadiaef;alkdg;aljt;j agl;sjrl;tjs;lga;lretj;srg[w349u5209dsfadfasdfasdfadsf", + "abc\0asdfadsfasf", + NULL + }; + +BOOST_AUTO_TEST_CASE( test_main ) +{ + const char **p = &test_strings[0]; + + while ( *p != NULL ) { + starts_with ( *p ); + ends_with ( *p ); + reverse ( *p ); + find ( *p ); + to_string ( *p ); + compare ( *p ); + + p++; + } +} diff --git a/tools/boost_1_65_1/libs/utility/test/string_view_test_io.cpp b/tools/boost_1_65_1/libs/utility/test/string_view_test_io.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d8dc8eb73045458bb06b5aca14ecdc1eaed99913 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/string_view_test_io.cpp @@ -0,0 +1,179 @@ +/* + * Copyright Andrey Semashev 2013. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +/*! + * \file string_ref_test_io.cpp + * \author Andrey Semashev + * \date 26.05.2013 + * + * \brief This header contains tests for stream operations of \c basic_string_ref. + */ + +#define BOOST_TEST_MODULE string_ref_test_io + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +typedef boost::mpl::vector< + char +#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) + , wchar_t +#endif +/* Current implementations seem to be missing codecvt facets to convert chars to char16_t and char32_t even though the types are available. +#if !defined(BOOST_NO_CXX11_CHAR16_T) + , char16_t +#endif +#if !defined(BOOST_NO_CXX11_CHAR32_T) + , char32_t +#endif +*/ +>::type char_types; + +static const char* test_strings[] = +{ + "begin", + "abcd", + "end" +}; + +//! The context with test data for particular character type +template< typename CharT > +struct context +{ + typedef CharT char_type; + typedef std::basic_string< char_type > string_type; + typedef std::basic_ostringstream< char_type > ostream_type; + + string_type begin, abcd, end; + + context() + { + boost::string_view str = test_strings[0]; + std::copy(str.begin(), str.end(), std::back_inserter(begin)); + + str = test_strings[1]; + std::copy(str.begin(), str.end(), std::back_inserter(abcd)); + + str = test_strings[2]; + std::copy(str.begin(), str.end(), std::back_inserter(end)); + } +}; + +// Test regular output +BOOST_AUTO_TEST_CASE_TEMPLATE(string_view_output, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_view< char_type > string_view_type; + + context< char_type > ctx; + + ostream_type strm; + strm << string_view_type(ctx.abcd); + BOOST_CHECK(strm.str() == ctx.abcd); +} + +// Test support for padding +BOOST_AUTO_TEST_CASE_TEMPLATE(padding, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_view< char_type > string_view_type; + + context< char_type > ctx; + + // Test for padding + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::setw(8) << string_view_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } + + // Test for long padding + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::setw(100) << string_view_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setw(100) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } + + // Test that short width does not truncate the string + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::setw(1) << string_view_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setw(1) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } +} + +// Test support for padding fill +BOOST_AUTO_TEST_CASE_TEMPLATE(padding_fill, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_view< char_type > string_view_type; + + context< char_type > ctx; + + ostream_type strm_ref; + strm_ref << ctx.begin << std::setfill(static_cast< char_type >('x')) << std::setw(8) << string_view_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::setfill(static_cast< char_type >('x')) << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); +} + +// Test support for alignment +BOOST_AUTO_TEST_CASE_TEMPLATE(alignment, CharT, char_types) +{ + typedef CharT char_type; + typedef std::basic_ostringstream< char_type > ostream_type; + typedef boost::basic_string_view< char_type > string_view_type; + + context< char_type > ctx; + + // Left alignment + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::left << std::setw(8) << string_view_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::left << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } + + // Right alignment + { + ostream_type strm_ref; + strm_ref << ctx.begin << std::right << std::setw(8) << string_view_type(ctx.abcd) << ctx.end; + + ostream_type strm_correct; + strm_correct << ctx.begin << std::right << std::setw(8) << ctx.abcd << ctx.end; + + BOOST_CHECK(strm_ref.str() == strm_correct.str()); + } +} diff --git a/tools/boost_1_65_1/libs/utility/test/value_init_test.cpp b/tools/boost_1_65_1/libs/utility/test/value_init_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bee8e10e2ac0cecf912728128dc24798e4be3516 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/value_init_test.cpp @@ -0,0 +1,369 @@ +// Copyright 2002-2008, Fernando Luis Cacciola Carballal. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for "boost/utility/value_init.hpp" +// +// 21 Ago 2002 (Created) Fernando Cacciola +// 15 Jan 2008 (Added tests regarding compiler issues) Fernando Cacciola, Niels Dekker +// 23 May 2008 (Added tests regarding initialized_value) Niels Dekker +// 21 Ago 2008 (Added swap test) Niels Dekker + +#include // For memcmp. +#include +#include + +#include "boost/utility/value_init.hpp" +#include + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include + +// +// Sample POD type +// +struct POD +{ + POD () : f(0), c(0), i(0){} + + POD ( char c_, int i_, float f_ ) : f(f_), c(c_), i(i_) {} + + friend std::ostream& operator << ( std::ostream& os, POD const& pod ) + { return os << '(' << pod.c << ',' << pod.i << ',' << pod.f << ')' ; } + + friend bool operator == ( POD const& lhs, POD const& rhs ) + { return lhs.f == rhs.f && lhs.c == rhs.c && lhs.i == rhs.i ; } + + float f; + char c; + int i; +} ; + +// +// Sample non POD type +// +struct NonPODBase +{ + virtual ~NonPODBase() {} +} ; +struct NonPOD : NonPODBase +{ + NonPOD () : id() {} + explicit NonPOD ( std::string const& id_) : id(id_) {} + + friend std::ostream& operator << ( std::ostream& os, NonPOD const& npod ) + { return os << '(' << npod.id << ')' ; } + + friend bool operator == ( NonPOD const& lhs, NonPOD const& rhs ) + { return lhs.id == rhs.id ; } + + std::string id ; +} ; + +// +// Sample aggregate POD struct type +// Some compilers do not correctly value-initialize such a struct, for example: +// Borland C++ Report #51854, "Value-initialization: POD struct should be zero-initialized " +// http://qc.codegear.com/wc/qcmain.aspx?d=51854 +// +struct AggregatePODStruct +{ + float f; + char c; + int i; +}; + +bool operator == ( AggregatePODStruct const& lhs, AggregatePODStruct const& rhs ) +{ return lhs.f == rhs.f && lhs.c == rhs.c && lhs.i == rhs.i ; } + +// +// An aggregate struct that contains an std::string and an int. +// Pavel Kuznetsov (MetaCommunications Engineering) used a struct like +// this to reproduce the Microsoft Visual C++ compiler bug, reported as +// Feedback ID 100744, "Value-initialization in new-expression" +// https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100744 +// +struct StringAndInt +{ + std::string s; + int i; +}; + +bool operator == ( StringAndInt const& lhs, StringAndInt const& rhs ) +{ return lhs.s == rhs.s && lhs.i == rhs.i ; } + + +// +// A struct that has an explicit (user defined) destructor. +// Some compilers do not correctly value-initialize such a struct, for example: +// Microsoft Visual C++, Feedback ID 100744, "Value-initialization in new-expression" +// https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100744 +// +struct StructWithDestructor +{ + int i; + ~StructWithDestructor() {} +}; + +bool operator == ( StructWithDestructor const& lhs, StructWithDestructor const& rhs ) +{ return lhs.i == rhs.i ; } + + +// +// A struct that has a virtual function. +// Some compilers do not correctly value-initialize such a struct either, for example: +// Microsoft Visual C++, Feedback ID 100744, "Value-initialization in new-expression" +// https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100744 +// +struct StructWithVirtualFunction +{ + int i; + virtual void VirtualFunction(); +}; + +void StructWithVirtualFunction::VirtualFunction() +{ +} + +bool operator == ( StructWithVirtualFunction const& lhs, StructWithVirtualFunction const& rhs ) +{ return lhs.i == rhs.i ; } + + +// +// A struct that is derived from an aggregate POD struct. +// Some compilers do not correctly value-initialize such a struct, for example: +// GCC Bugzilla Bug 30111, "Value-initialization of POD base class doesn't initialize members", +// reported by Jonathan Wakely, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 +// +struct DerivedFromAggregatePODStruct : AggregatePODStruct +{ + DerivedFromAggregatePODStruct() : AggregatePODStruct() {} +}; + +// +// A struct that wraps an aggregate POD struct as data member. +// +struct AggregatePODStructWrapper +{ + AggregatePODStructWrapper() : dataMember() {} + AggregatePODStruct dataMember; +}; + +bool operator == ( AggregatePODStructWrapper const& lhs, AggregatePODStructWrapper const& rhs ) +{ return lhs.dataMember == rhs.dataMember ; } + +typedef unsigned char ArrayOfBytes[256]; + + +// +// A struct that allows testing whether the appropriate copy functions are called. +// +struct CopyFunctionCallTester +{ + bool is_copy_constructed; + bool is_assignment_called; + + CopyFunctionCallTester() + : is_copy_constructed(false), is_assignment_called(false) {} + + CopyFunctionCallTester(const CopyFunctionCallTester & ) + : is_copy_constructed(true), is_assignment_called(false) {} + + CopyFunctionCallTester & operator=(const CopyFunctionCallTester & ) + { + is_assignment_called = true ; + return *this ; + } +}; + + +// +// A struct that allows testing whether its customized swap function is called. +// +struct SwapFunctionCallTester +{ + bool is_custom_swap_called; + int data; + + SwapFunctionCallTester() + : is_custom_swap_called(false), data(0) {} + + SwapFunctionCallTester(const SwapFunctionCallTester & arg) + : is_custom_swap_called(false), data(arg.data) {} + + void swap(SwapFunctionCallTester & arg) + { + std::swap(data, arg.data); + is_custom_swap_called = true; + arg.is_custom_swap_called = true; + } +}; + +void swap(SwapFunctionCallTester & lhs, SwapFunctionCallTester & rhs) +{ + lhs.swap(rhs); +} + + + +template +void check_initialized_value ( T const& y ) +{ + T initializedValue = boost::initialized_value ; + BOOST_TEST ( y == initializedValue ) ; +} + +#ifdef __BORLANDC__ +#if __BORLANDC__ == 0x582 +void check_initialized_value( NonPOD const& ) +{ + // The initialized_value check is skipped for Borland 5.82 + // and this type (NonPOD), because the following statement + // won't compile on this particular compiler version: + // NonPOD initializedValue = boost::initialized_value() ; + // + // This is caused by a compiler bug, that is fixed with a newer version + // of the Borland compiler. The Release Notes for Delphi(R) 2007 for + // Win32(R) and C++Builder(R) 2007 (http://dn.codegear.com/article/36575) + // say about similar statements: + // both of these statements now compile but under 5.82 got the error: + // Error E2015: Ambiguity between 'V::V(const A &)' and 'V::V(const V &)' +} +#endif +#endif + +// +// This test function tests boost::value_initialized for a specific type T. +// The first argument (y) is assumed have the value of a value-initialized object. +// Returns true on success. +// +template +bool test ( T const& y, T const& z ) +{ + const int errors_before_test = boost::detail::test_errors(); + + check_initialized_value(y); + + boost::value_initialized x ; + BOOST_TEST ( y == x ) ; + BOOST_TEST ( y == boost::get(x) ) ; + + static_cast(x) = z ; + boost::get(x) = z ; + BOOST_TEST ( x == z ) ; + + boost::value_initialized const x_c ; + BOOST_TEST ( y == x_c ) ; + BOOST_TEST ( y == boost::get(x_c) ) ; + T& x_c_ref = const_cast( boost::get(x_c) ) ; + x_c_ref = z ; + BOOST_TEST ( x_c == z ) ; + + boost::value_initialized const copy1 = x; + BOOST_TEST ( boost::get(copy1) == boost::get(x) ) ; + + boost::value_initialized copy2; + copy2 = x; + BOOST_TEST ( boost::get(copy2) == boost::get(x) ) ; + + boost::shared_ptr > ptr( new boost::value_initialized ); + BOOST_TEST ( y == *ptr ) ; + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + boost::value_initialized cx ; + BOOST_TEST ( y == cx ) ; + BOOST_TEST ( y == boost::get(cx) ) ; + + boost::value_initialized const cx_c ; + BOOST_TEST ( y == cx_c ) ; + BOOST_TEST ( y == boost::get(cx_c) ) ; +#endif + + return boost::detail::test_errors() == errors_before_test ; +} + +int main(int, char **) +{ + BOOST_TEST ( test( 0,1234 ) ) ; + BOOST_TEST ( test( 0.0,12.34 ) ) ; + BOOST_TEST ( test( POD(0,0,0.0), POD('a',1234,56.78f) ) ) ; + BOOST_TEST ( test( NonPOD( std::string() ), NonPOD( std::string("something") ) ) ) ; + + NonPOD NonPOD_object( std::string("NonPOD_object") ); + BOOST_TEST ( test( 0, &NonPOD_object ) ) ; + + AggregatePODStruct zeroInitializedAggregatePODStruct = { 0.0f, '\0', 0 }; + AggregatePODStruct nonZeroInitializedAggregatePODStruct = { 1.25f, 'a', -1 }; + BOOST_TEST ( test(zeroInitializedAggregatePODStruct, nonZeroInitializedAggregatePODStruct) ); + + StringAndInt stringAndInt0; + StringAndInt stringAndInt1; + stringAndInt0.i = 0; + stringAndInt1.i = 1; + stringAndInt1.s = std::string("1"); + BOOST_TEST ( test(stringAndInt0, stringAndInt1) ); + + StructWithDestructor structWithDestructor0; + StructWithDestructor structWithDestructor1; + structWithDestructor0.i = 0; + structWithDestructor1.i = 1; + BOOST_TEST ( test(structWithDestructor0, structWithDestructor1) ); + + StructWithVirtualFunction structWithVirtualFunction0; + StructWithVirtualFunction structWithVirtualFunction1; + structWithVirtualFunction0.i = 0; + structWithVirtualFunction1.i = 1; + BOOST_TEST ( test(structWithVirtualFunction0, structWithVirtualFunction1) ); + + DerivedFromAggregatePODStruct derivedFromAggregatePODStruct0; + DerivedFromAggregatePODStruct derivedFromAggregatePODStruct1; + static_cast(derivedFromAggregatePODStruct0) = zeroInitializedAggregatePODStruct; + static_cast(derivedFromAggregatePODStruct1) = nonZeroInitializedAggregatePODStruct; + BOOST_TEST ( test(derivedFromAggregatePODStruct0, derivedFromAggregatePODStruct1) ); + + AggregatePODStructWrapper aggregatePODStructWrapper0; + AggregatePODStructWrapper aggregatePODStructWrapper1; + aggregatePODStructWrapper0.dataMember = zeroInitializedAggregatePODStruct; + aggregatePODStructWrapper1.dataMember = nonZeroInitializedAggregatePODStruct; + BOOST_TEST ( test(aggregatePODStructWrapper0, aggregatePODStructWrapper1) ); + + ArrayOfBytes zeroInitializedArrayOfBytes = { 0 }; + boost::value_initialized valueInitializedArrayOfBytes; + BOOST_TEST (std::memcmp(get(valueInitializedArrayOfBytes), zeroInitializedArrayOfBytes, sizeof(ArrayOfBytes)) == 0); + + boost::value_initialized valueInitializedArrayOfBytes2; + valueInitializedArrayOfBytes2 = valueInitializedArrayOfBytes; + BOOST_TEST (std::memcmp(get(valueInitializedArrayOfBytes), get(valueInitializedArrayOfBytes2), sizeof(ArrayOfBytes)) == 0); + + boost::value_initialized copyFunctionCallTester1; + BOOST_TEST ( ! get(copyFunctionCallTester1).is_copy_constructed); + BOOST_TEST ( ! get(copyFunctionCallTester1).is_assignment_called); + + boost::value_initialized copyFunctionCallTester2 = boost::value_initialized(copyFunctionCallTester1); + BOOST_TEST ( get(copyFunctionCallTester2).is_copy_constructed); + BOOST_TEST ( ! get(copyFunctionCallTester2).is_assignment_called); + + boost::value_initialized copyFunctionCallTester3; + copyFunctionCallTester3 = boost::value_initialized(copyFunctionCallTester1); + BOOST_TEST ( ! get(copyFunctionCallTester3).is_copy_constructed); + BOOST_TEST ( get(copyFunctionCallTester3).is_assignment_called); + + boost::value_initialized swapFunctionCallTester1; + boost::value_initialized swapFunctionCallTester2; + get(swapFunctionCallTester1).data = 1; + get(swapFunctionCallTester2).data = 2; + boost::swap(swapFunctionCallTester1, swapFunctionCallTester2); + BOOST_TEST( get(swapFunctionCallTester1).data == 2 ); + BOOST_TEST( get(swapFunctionCallTester2).data == 1 ); + BOOST_TEST( get(swapFunctionCallTester1).is_custom_swap_called ); + BOOST_TEST( get(swapFunctionCallTester2).is_custom_swap_called ); + + return boost::report_errors(); +} + + diff --git a/tools/boost_1_65_1/libs/utility/test/value_init_test_fail1.cpp b/tools/boost_1_65_1/libs/utility/test/value_init_test_fail1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e3f6f1a0c3230877ee0af920649a89b5d8cb6829 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/value_init_test_fail1.cpp @@ -0,0 +1,37 @@ +// Copyright 2002, Fernando Luis Cacciola Carballal. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for "boost/utility/value_init.hpp" +// +// Initial: 21 Agu 2002 + +#include +#include + +#include "boost/utility/value_init.hpp" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "boost/test/minimal.hpp" + +int test_main(int, char **) +{ + boost::value_initialized const x_c ; + + get(x_c) = 1234 ; // this should produce an ERROR + + return 0; +} + + +unsigned int expected_failures = 0; + + + + + diff --git a/tools/boost_1_65_1/libs/utility/test/value_init_test_fail2.cpp b/tools/boost_1_65_1/libs/utility/test/value_init_test_fail2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bbc7c9039db273d0c35ebade8e16e5882e196167 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/value_init_test_fail2.cpp @@ -0,0 +1,36 @@ +// Copyright 2002, Fernando Luis Cacciola Carballal. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for "boost/utility/value_init.hpp" +// +// Initial: 21 Agu 2002 + +#include +#include + +#include "boost/utility/value_init.hpp" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "boost/test/minimal.hpp" + +int test_main(int, char **) +{ + boost::value_initialized cx ; + + get(cx) = 1234 ; // this should produce an ERROR + + return 0; +} + +unsigned int expected_failures = 0; + + + + + diff --git a/tools/boost_1_65_1/libs/utility/test/value_init_test_fail3.cpp b/tools/boost_1_65_1/libs/utility/test/value_init_test_fail3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bea5bab4132d267636861734ddc2a3148c6dc99 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/value_init_test_fail3.cpp @@ -0,0 +1,37 @@ +// Copyright 2002, Fernando Luis Cacciola Carballal. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for "boost/utility/value_init.hpp" +// +// Initial: 21 Agu 2002 + +#include +#include + +#include "boost/utility/value_init.hpp" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "boost/test/minimal.hpp" + +int test_main(int, char **) +{ + boost::value_initialized const cx_c ; + + get(cx_c) = 1234 ; // this should produce an ERROR + + return 0; +} + + +unsigned int expected_failures = 0; + + + + + diff --git a/tools/boost_1_65_1/libs/utility/test/value_init_workaround_test.cpp b/tools/boost_1_65_1/libs/utility/test/value_init_workaround_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..10c9b4cc49f83a3fb086920426409a72d3bfc212 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/test/value_init_workaround_test.cpp @@ -0,0 +1,144 @@ +// Copyright 2010, Niels Dekker. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Test program for the boost::value_initialized workaround. +// +// 17 June 2010 (Created) Niels Dekker + +// Switch the workaround off, before inluding "value_init.hpp". +#define BOOST_DETAIL_VALUE_INIT_WORKAROUND 0 +#include + +#include // For cout. +#include // For EXIT_SUCCESS and EXIT_FAILURE. + +namespace +{ + struct empty_struct + { + }; + + // A POD aggregate struct derived from an empty struct. + // Similar to struct Foo1 from Microsoft Visual C++ bug report 484295, + // "VC++ does not value-initialize members of derived classes without + // user-declared constructor", reported in 2009 by Sylvester Hesp: + // https://connect.microsoft.com/VisualStudio/feedback/details/484295 + struct derived_struct: empty_struct + { + int data; + }; + + bool is_value_initialized(const derived_struct& arg) + { + return arg.data == 0; + } + + + class virtual_destructor_holder + { + public: + int i; + virtual ~virtual_destructor_holder() + { + } + }; + + bool is_value_initialized(const virtual_destructor_holder& arg) + { + return arg.i == 0; + } + + // Equivalent to the Stats class from GCC Bug 33916, + // "Default constructor fails to initialize array members", reported in 2007 by + // Michael Elizabeth Chastain: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 + // and fixed for GCC 4.2.4. + class private_int_array_pair + { + friend bool is_value_initialized(const private_int_array_pair& arg); + private: + int first[12]; + int second[12]; + }; + + bool is_value_initialized(const private_int_array_pair& arg) + { + for ( unsigned i = 0; i < 12; ++i) + { + if ( (arg.first[i] != 0) || (arg.second[i] != 0) ) + { + return false; + } + } + return true; + } + + template + bool is_value_initialized(const T(& arg)[2]) + { + return + is_value_initialized(arg[0]) && + is_value_initialized(arg[1]); + } + + template + bool is_value_initialized(const boost::value_initialized& arg) + { + return is_value_initialized(arg.data()); + } + + // Returns zero when the specified object is value-initializated, and one otherwise. + // Prints a message to standard output if the value-initialization has failed. + template + unsigned failed_to_value_initialized(const T& object, const char *const object_name) + { + if ( is_value_initialized(object) ) + { + return 0u; + } + else + { + std::cout << "Note: Failed to value-initialize " << object_name << '.' << std::endl; + return 1u; + } + } + +// A macro that passed both the name and the value of the specified object to +// the function above here. +#define FAILED_TO_VALUE_INITIALIZE(value) failed_to_value_initialized(value, #value) + + // Equivalent to the dirty_stack() function from GCC Bug 33916, + // "Default constructor fails to initialize array members", reported in 2007 by + // Michael Elizabeth Chastain: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 + void dirty_stack() + { + unsigned char array_on_stack[4096]; + for (unsigned i = 0; i < sizeof(array_on_stack); ++i) + { + array_on_stack[i] = 0x11; + } + } + +} + + +int main() +{ + dirty_stack(); + + // TODO More types may be added later. + const unsigned num_failures = + FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()) + + FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()) + + FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()); + +#ifdef BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED + // One or more failures are expected. + return num_failures > 0 ? EXIT_SUCCESS : EXIT_FAILURE; +#else + // No failures are expected. + return num_failures == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +#endif +} diff --git a/tools/boost_1_65_1/libs/utility/throw_exception.html b/tools/boost_1_65_1/libs/utility/throw_exception.html new file mode 100644 index 0000000000000000000000000000000000000000..141f48759841856574775b9f4fa25e6e7693bc25 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/throw_exception.html @@ -0,0 +1,15 @@ + + + + +Automatic redirection + + +Automatic redirection failed, please go to +throw_exception.html
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/utility/utility.htm b/tools/boost_1_65_1/libs/utility/utility.htm new file mode 100644 index 0000000000000000000000000000000000000000..5443bd4890a5773ee4bcdeb32df473345db32339 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/utility.htm @@ -0,0 +1,622 @@ + + + + Header boost/utility.hpp Documentation + + +

boost.png (6897 bytes)Header + boost/utility.hpp

+

The entire contents of the header <boost/utility.hpp> + are in namespace boost.

+

Contents

+ +

+ Function templates next() and prior()

+

Certain data types, such as the C++ Standard Library's forward and bidirectional + iterators, do not provide addition and subtraction via operator+() or + operator-().  This means that non-modifying computation of the next or + prior value requires a temporary, even though operator++() or operator--() is + provided.  It also means that writing code like itr+1 inside + a template restricts the iterator category to random access iterators.

+

The next() and prior() functions provide a simple way around these problems:

+
+
template <class T>
+T next(T x) { return ++x; }
+
+template <class T, class Distance>
+T next(T x, Distance n)
+{
+    std::advance(x, n);
+    return x;
+}
+
+template <class T>
+T prior(T x) { return --x; }
+
+template <class T, class Distance>
+T prior(T x, Distance n)
+{
+    std::advance(x, -n);
+    return x;
+}
+
+

Usage is simple:

+
+
const std::list<T>::iterator p = get_some_iterator();
+const std::list<T>::iterator prev = boost::prior(p);
+const std::list<T>::iterator next = boost::next(prev, 2);
+
+

The distance from the given iterator should be supplied as an absolute value. For + example, the iterator four iterators prior to the given iterator p + may be obtained by prior(p, 4).

+

Contributed by Dave Abrahams. Two-argument versions by Daniel Walker.

+ +

Class template + result_of

The class template + result_of helps determine the type of a + call expression. For example, given an lvalue f of + type F and lvalues t1, + t2, ..., tN of + types T1, T2, ..., + TN, respectively, the type + result_of<F(T1, T2, ..., + TN)>::type defines the result type + of the expression f(t1, t2, + ...,tN). This implementation permits + the type F to be a function pointer, + function reference, member function pointer, or class + type. By default, N may be any value between 0 and + 16. To change the upper limit, define the macro + BOOST_RESULT_OF_NUM_ARGS to the maximum + value for N. Class template result_of + resides in the header <boost/utility/result_of.hpp>.

+ +

If your compiler's support for decltype is + adequate, result_of automatically uses it to + deduce the type of the call expression, in which case + result_of<F(T1, T2, ..., + TN)>::type names the type + decltype(boost::declval<F>()(boost::declval<T1>(), + boost::declval<T2>(), ..., + boost::declval<TN>())), as in the + following example.

+ +
+
struct functor {
+    template<class T>
+    T operator()(T x)
+    {
+        return x;
+    }
+};
+
+typedef boost::result_of<
+    functor(int)
+>::type type; // type is int
+
+ +

You can test whether result_of is using + decltype by checking if the macro + BOOST_RESULT_OF_USE_DECLTYPE is defined after + including result_of.hpp. You can also force + result_of to use decltype by + defining BOOST_RESULT_OF_USE_DECLTYPE prior + to including result_of.hpp.

+ +

If decltype is not used, + then automatic result type deduction of function + objects is not possible. Instead, result_of + uses the following protocol to allow the programmer to + specify a type. When F is a class type with a + member type result_type, + result_of<F(T1, T2, ..., + TN)>::type is + F::result_type. When F does + not contain result_type, + result_of<F(T1, T2, ..., + TN)>::type is F::result<F(T1, + T2, ..., TN)>::type when + N > 0 or void + when N = 0. Note that it is the + responsibility of the programmer to ensure that + function objects accurately advertise their result + type via this protocol, as in the following + example.

+ +
+
struct functor {
+    template<class> struct result;
+
+    template<class F, class T>
+    struct result<F(T)> {
+        typedef T type;
+    };
+
+    template<class T>
+    T operator()(T x)
+    {
+        return x;
+    }
+};
+
+typedef boost::result_of<
+    functor(int)
+>::type type; // type is int
+
+ +

Since decltype is a new language + feature recently standardized in C++11, + if you are writing a function object + to be used with result_of, for + maximum portability, you might consider following + the above protocol even if your compiler has + proper decltype support. If you wish to continue to + use the protocol on compilers that + support decltype, there are two options: + You can use boost::tr1_result_of, which is also + defined in <boost/utility/result_of.hpp>. + Alternatively, you can define the macro + BOOST_RESULT_OF_USE_TR1, which causes + result_of to use the protocol described + above instead of decltype. If you choose to + follow the protocol, take care to ensure that the + result_type and + result<> members accurately + represent the return type of + operator() given a call expression.

+ +

Additionally, boost::result_of + provides a third mode of operation, which some users + may find convenient. When + BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK + is defined, boost::result_of behaves as + follows. If the function object has a member + type result_type or member + template result<>, then + boost::result_of will use the TR1 + protocol. Otherwise, + boost::result_of will + use decltype. Using TR1 with + a declytpe fallback may workaround + certain problems at the cost of portability. For + example: +

    +
  • Deficient compiler: If your code + requires boost::result_of to work + with incomplete return types but your + compiler's decltype implementation + does not support incomplete return types, then you + can use the TR1 protocol as a workaround. Support + for incomplete return types was added late in the + C++11 standardization process + (see N3276) + and is not implemented by some compilers.
  • + +
  • Deficient legacy code: If your existing TR1 + function object advertises a different type than + the actual result type deduced + by decltype, then using TR1 with a + decltype fallback will allow you to + work with both your existing TR1 function objects + and new C++11 function object. This situation + could occur if your legacy function objects + misused the TR1 protocol. See the documentation on + known differences + between boost::result_of and TR1.
  • +
+ + +

This implementation of result_of + requires class template partial specialization, the + ability to parse function types properly, and support + for SFINAE. If result_of is not supported + by your compiler, including the header + boost/utility/result_of.hpp will + define the macro BOOST_NO_RESULT_OF.

+ +

For additional information + about result_of, see the C++ Library + Technical Report, + N1836, + or, for motivation and design rationale, + the result_of proposal.

+ + +

Usage guidelines for boost::result_of

+
+ +

The following are general suggestions about when + and how to use boost::result_of.

+ +
    +
  1. If you are targeting C++11 and are not concerned + about portability to non-compliant compilers or + previous versions of the standard, then use + std::result_of. If std::result_of + meets your needs, then there's no reason to stop using + it.
  2. + +
  3. If you are targeting C++11 but may port your code + to legacy compilers at some time in the future, then + use boost::result_of with + decltype. When decltype is + used boost::result_of + and std::result_of are usually + interchangeable. See the documentation on + known differences + between boost::result_of and C++11 result_of.
  4. + +
  5. If compiler portability is required, + use boost::result_of with the TR1 protocol.
  6. +
+ +

Regardless of how you + configure boost::result_of, it is + important to bear in mind that the return type of a + function may change depending on its arguments, and + additionally, the return type of a member function may + change depending on the cv-qualification of the + object. boost::result_of must be passed + the appropriately cv-qualified types in order to + deduce the corresponding return type. For example: + +

+
struct functor {
+    int& operator()(int);
+    int const& operator()(int) const;
+
+    float& operator()(float&);
+    float const& operator()(float const&);
+};
+
+typedef boost::result_of<
+    functor(int)
+>::type type1; // type1 is int &
+
+typedef boost::result_of<
+    const functor(int)
+>::type type2; // type2 is int const &
+
+typedef boost::result_of<
+    functor(float&)
+>::type type3; // type3 is float &
+
+typedef boost::result_of<
+    functor(float const&)
+>::type type4; // type4 is float const &
+
+ + +

Usage guidelines for the TR1 result_of protocol

+
+ +

On compliant C++11 + compilers, boost::result_of can + use decltype to deduce the type of any + call expression, including calls to function + objects. However, on pre-C++11 compilers or on + compilers without adequate decltype support, + additional scaffolding is needed from function + objects as described above. The following are + suggestions about how to use the TR1 protocol.

+ +
    +
  • When the return type does not depend on the + argument types or the cv-qualification of the + function object, simply + define result_type. There is no need + to use the result template unless the + return type varies.
  • + +
  • Use the protocol specified type when defining + function prototypes. This can help ensure the + actual return type does not get out of sync with + the protocol specification. For example: + +
    +
    struct functor {
    +    typedef int result_type;
    +    result_type operator()(int);
    +};
    +
  • + +
  • Always specify the result + specialization near the corresponding + operator() overload. This can make it + easier to keep the specializations in sync with the + overloads. For example: + +
    +
    struct functor {
    +    template<class> struct result;
    +
    +    template<class F>
    +    struct result<F(int)> {
    +        typedef int& type;
    +    };
    +    result<functor(int)>::type operator()(int);
    +
    +    template<class F>
    +    struct result<const F(int)> {
    +        typedef int const& type;
    +    };
    +    result<const functor(int)>::type operator()(int) const;
    +};
    +
  • + +
  • Use type transformations to simplify + the result template specialization. For + example, the following uses + Boost.TypeTraits + to specialize the result template for + a single operator() that can be called on + both a const and non-const function object with + either an lvalue or rvalue argument. + +
    +
    struct functor {
    +    template<class> struct result;
    +
    +    template<class F, class T>
    +    struct result<F(T)> 
    +        : boost::remove_cv<
    +              typename boost::remove_reference<T>::type
    +          >
    +    {};
    +
    +    template<class T>
    +    T operator()(T const& x) const;
    +};
    +
  • +
+ + +

Known differences between boost::result_of and TR1 result_of

+
+ + When using decltype, boost::result_of + ignores the TR1 protocol and instead deduces the + return type of function objects directly + via decltype. In most situations, users + will not notice a difference, so long as they use the + protocol correctly. The following are situations in + which the type deduced + by boost::result_of is known to differ depending on + whether decltype or the TR1 protocol is + used. + +
    +
  • TR1 protocol misusage + +

    When using the TR1 + protocol, boost::result_of cannot + detect whether the actual type of a call to a + function object is the same as the type specified + by the protocol, which allows for the possibility + of inadvertent mismatches between the specified + type and the actual type. When + using decltype, these subtle bugs + may result in compilation errors. For example:

    + +
    +
    struct functor {
    +   typedef short result_type;
    +   int operator()(short);
    +};
    +
    +#ifdef BOOST_RESULT_OF_USE_DECLTYPE
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<boost::result_of<functor(short)>::type, int>::value
    +)); 
    +
    +#else
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<boost::result_of<functor(short)>::type, short>::value
    +));
    +
    +#endif
    +
    + +

    Note that the user can + force boost::result_of to use the TR1 + protocol even on platforms that + support decltype by + defining BOOST_RESULT_OF_USE_TR1.

  • + +
  • Nullary function objects + +

    When using the TR1 protocol, boost::result_of + cannot always deduce the type of calls to + nullary function objects, in which case the + type defaults to void. When using decltype, + boost::result_of always gives the actual type of the + call expression. For example:

    + +
    +
    struct functor {
    +   template<class> struct result {
    +       typedef int type;
    +   };
    +   int operator()();
    +};
    +
    +#ifdef BOOST_RESULT_OF_USE_DECLTYPE
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<boost::result_of<functor()>::type, int>::value
    +));
    +
    +#else
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<boost::result_of<functor()>::type, void>::value
    +));
    +
    +#endif
    +
    + +

    Note that there are some workarounds for the + nullary function problem. So long as the return + type does not vary, + result_type can always be used to + specify the return type regardless of arity. If the + return type does vary, then the user can + specialize boost::result_of itself for + nullary calls.

  • + +
  • Non-class prvalues and cv-qualification + +

    When using the TR1 + protocol, boost::result_of will + report the cv-qualified type specified + by result_type or + the result template regardless of + the actual cv-qualification of the call + expression. When using + decltype, boost::result_of + will report the actual type of the call expression, + which is not cv-qualified when the expression is a + non-class prvalue. For example:

    + +
    +
    struct functor {
    +   template<class> struct result;
    +   template<class F, class T> struct result<F(const T)> {
    +       typedef const T type;
    +   };
    +
    +   const short operator()(const short);
    +   int const & operator()(int const &);
    +};
    +
    +// Non-prvalue call expressions work the same with or without decltype.
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<
    +       boost::result_of<functor(int const &)>::type,
    +       int const &
    +::value
    +));
    +
    +// Non-class prvalue call expressions are not actually cv-qualified,
    +// but only the decltype-based result_of reports this accurately.
    +
    +#ifdef BOOST_RESULT_OF_USE_DECLTYPE
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<
    +       boost::result_of<functor(const short)>::type,
    +       short
    +::value
    +));
    +
    +#else
    +
    +BOOST_STATIC_ASSERT((
    +   boost::is_same<
    +       boost::result_of<functor(const short)>::type,
    +       const short
    +::value
    +));
    +
    +#endif
    +
  • +
+ + +

Known differences between boost::result_of and C++11 result_of

+
+ +

When using decltype, boost::result_of + implements most of the C++11 result_of + specification. One known exception is that + boost::result_of does not implement the + requirements regarding pointers to member data.

+ +

Created by Doug Gregor. Contributions from Daniel Walker, Eric Niebler, Michel Morin and others

+ +

Macro BOOST_BINARY

+ +

The macro BOOST_BINARY is used for the + representation of binary literals. It takes as an argument + a binary number arranged as an arbitrary amount of 1s and 0s in + groupings of length 1 to 8, with groups separated + by spaces. The type of the literal yielded is determined by + the same rules as those of hex and octal + literals (2.13.1p1). By implementation, this macro + expands directly to an octal literal during preprocessing, so + there is no overhead at runtime and the result is useable in + any place that an octal literal would be.

+ +

In order to directly support binary literals with suffixes, + additional macros of the form BOOST_BINARY_XXX are also + provided, where XXX is a standard integer suffix in all capital + letters. In addition, LL and ULL suffixes may be used for representing + long long and unsigned long long types in compilers which provide + them as an extension.

+ + +

The BOOST_BINARY family of macros resides in the header + <boost/utility/binary.hpp> + which is automatically included by + <boost/utility.hpp>. + +

Contributed by Matt Calabrese.

+

Example

+
+
+void foo( int );
+
+void foo( unsigned long );
+
+void bar()
+{
+  int value1 = BOOST_BINARY( 100 111000 01 1 110 );
+
+  unsigned long value2 = BOOST_BINARY_UL( 100 001 ); // unsigned long
+
+  long long value3 = BOOST_BINARY_LL( 11 000 ); // long long if supported
+
+  assert(    BOOST_BINARY( 10010 )
+          &  BOOST_BINARY( 11000 )
+          == BOOST_BINARY( 10000 )
+        );
+
+  foo( BOOST_BINARY( 1010 ) ); // calls the first foo
+
+  foo( BOOST_BINARY_LU( 1010 ) ); // calls the second foo
+}
+
+
+

Revised  04 September, 2008 +

+

© Copyright Beman Dawes 1999-2003.

+

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

+ + + diff --git a/tools/boost_1_65_1/libs/utility/value_init.htm b/tools/boost_1_65_1/libs/utility/value_init.htm new file mode 100644 index 0000000000000000000000000000000000000000..3222f691ce34bd110d1306057f94e96fe77f4b33 --- /dev/null +++ b/tools/boost_1_65_1/libs/utility/value_init.htm @@ -0,0 +1,514 @@ + + + + + value_initialized + + + + +

+ Header <boost/utility/value_init.hpp> +

+ +

Contents

+ +
+
Rationale
+
Introduction
+
Details
+
+ + + +
+
Types and objects
+
+ + + Acknowledgements
+
+ +
+

Rationale

+ +

Constructing and initializing objects in a generic way is difficult in + C++. The problem is that there are several different rules that apply +for initialization. Depending on the type, the value of a newly constructed + object can be zero-initialized (logically 0), default-constructed (using + the default constructor), or indeterminate. When writing generic code, +this problem must be addressed. The template value_initialized provides +a solution with consistent syntax for value initialization of scalar, +union and class types. +Moreover, value_initialized offers a workaround to various +compiler issues regarding value-initialization. + +Furthermore, a const object, initialized_value is provided, +to avoid repeating the type name when retrieving the value from a +value_initialized<T> object. +
+

+ +

Introduction

+ +

+There are various ways to initialize a variable, in C++. The following +declarations all may have a local variable initialized to its default +value: +

+  T1 var1;
+  T2 var2 = 0;
+  T3 var3 = {};
+  T4 var4 = T4();
+
+Unfortunately, whether or not any of those declarations correctly +initialize the variable very much depends on its type. The first +declaration is valid for any +DefaultConstructible type (by definition). +However, it does not always do an initialization! +It correctly initializes the variable when it's an instance of a +class, and the author of the class has provided a proper default +constructor. On the other hand, the value of var1 is indeterminate when +its type is an arithmetic type, like int, float, or char. +An arithmetic variable +is of course initialized properly by the second declaration, T2 +var2 = 0. But this initialization form usually won't work for a +class type (unless the class was especially written to support being +initialized that way). The third form, T3 var3 = {} +initializes an aggregate, typically a "C-style" struct or a "C-style" array. +However, the syntax is not allowed for a class that has an explicitly declared +constructor. (But watch out for an upcoming C++ language change, +by Bjarne Stroustrup et al [1]!) +The fourth form is the most generic form of them, as it +can be used to initialize arithmetic types, class types, aggregates, pointers, and +other types. The declaration, T4 var4 = T4(), should be read +as follows: First a temporary object is created, by T4(). +This object is value-initialized. Next the temporary +object is copied to the named variable, var4. Afterwards, the temporary +is destroyed. While the copying and the destruction are likely to +be optimized away, C++ still requires the type T4 to be +CopyConstructible. +(So T4 needs to be both DefaultConstructible and CopyConstructible.) +A class may not be CopyConstructible, for example because it may have a +private and undefined copy constructor, +or because it may be derived from boost::noncopyable. +Scott Meyers [2] explains why a class would be defined like that. +

+

+There is another, less obvious disadvantage to the fourth form, T4 var4 = T4(): +It suffers from various compiler issues, causing +a variable to be left uninitialized in some compiler specific cases. +

+

+The template value_initialized +offers a generic way to initialize +an object, like T4 var4 = T4(), but without requiring its type +to be CopyConstructible. And it offers a workaround to those compiler issues +regarding value-initialization as well! It allows getting an initialized +variable of any type; it only requires the type to be DefaultConstructible. +A properly value-initialized object of type T is +constructed by the following declaration: +

+  value_initialized<T> var;
+
+

+

+The template initialized +offers both value-initialization and direct-initialization. +It is especially useful as a data member type, allowing the very same object +to be either direct-initialized or value-initialized. +

+

+The const object initialized_value +allows value-initializing a variable as follows: +

+  T var = initialized_value ;
+
+This form of initialization is semantically equivalent to T4 var4 = T4(), +but robust against the aforementioned compiler issues. + +

+ +

Details

+

The C++ standard [3] contains the definitions + of zero-initialization and default-initialization. + Informally, zero-initialization means that the object is given the initial + value 0 (converted to the type) and default-initialization means that + POD [4] types are zero-initialized, while non-POD class + types are initialized with their corresponding default constructors. A +declaration can contain an initializer, which specifies the +object's initial value. The initializer can be just '()', which states that +the object shall be value-initialized (but see below). However, if a declaration + has no initializer and it is of a non-const, non-static + POD type, the initial value is indeterminate: (see §8.5, [dcl.init], for the + accurate definitions).

+ +
int x ; // no initializer. x value is indeterminate.
std::string s ; // no initializer, s is default-constructed.

int y = int() ;
// y is initialized using copy-initialization
// but the temporary uses an empty set of parentheses as the initializer,
// so it is default-constructed.
// A default constructed POD type is zero-initialized,
// therefore, y == 0.

void foo ( std::string ) ;
foo ( std::string() ) ;
// the temporary string is default constructed
// as indicated by the initializer ()
+ +

value-initialization

+ +

The first Technical + Corrigendum for the C++ Standard (TC1), whose draft was released to + the public in November 2001, introduced Core + Issue 178 (among many other issues, of course).

+ +

That issue introduced the new concept of value-initialization + (it also fixed the wording for zero-initialization). Informally, value-initialization + is similar to default-initialization with the exception that in some cases + non-static data members and base class sub-objects are also value-initialized. + The difference is that an object that is value-initialized won't have +(or at least is less likely to have) indeterminate values for data members + and base class sub-objects; unlike the case of an object default constructed. + (see Core Issue 178 for a normative description).

+ +

In order to specify value-initialization of an object we need to use the + empty-set initializer: ().

+ +

As before, a declaration with no intializer specifies default-initialization, + and a declaration with a non-empty initializer specifies copy (=xxx) or + direct (xxx) initialization.

+ +
template<class T> void eat(T);
int x ; // indeterminate initial value.
std::string s; // default-initialized.
eat ( int() ) ; // value-initialized
eat ( std::string() ) ; // value-initialized
+ +

value-initialization syntax

+ +

Value initialization is specified using (). However, the empty set of +parentheses is not permitted by the syntax of initializers because it is +parsed as the declaration of a function taking no arguments:

+ +
int x() ; // declares function int(*)()
+ +

Thus, the empty () must be put in some other initialization context.

+ +

One alternative is to use copy-initialization syntax:

+ +
int x = int() ;
+ +

This works perfectly fine for POD types. But for non-POD class types, +copy-initialization searches for a suitable constructor, which could be, +for instance, the copy-constructor (it also searches for a suitable conversion +sequence but this doesn't apply in this context). For an arbitrary unknown +type, using this syntax may not have the value-initialization effect intended +because we don't know if a copy from a default constructed object is exactly +the same as a default constructed object, and the compiler is allowed (in +some cases), but never required to, optimize the copy away.

+ +

One possible generic solution is to use value-initialization of a non static +data member:

+ +
template<class T> 
struct W
{
// value-initialization of 'data' here.
W() : data() {}
T data ;
} ;
W<int> w ;
// w.data is value-initialized for any type.
+ +

This is the solution as it was supplied by earlier versions of the +value_initialized<T> template + class. Unfortunately this approach suffered from various compiler issues.

+ +

compiler issues

+ +Various compilers haven't yet fully implemented value-initialization. +So when an object should be value-initialized (according to the C++ Standard), +it may in practice still be left uninitialized, because of those +compiler issues! It's hard to make a general statement on what those issues +are like, because they depend on the compiler you are using, its version number, +and the type of object you would like to have value-initialized. +All compilers we have tested so far support value-initialization for arithmetic types properly. +However, various compilers may leave some types of aggregates uninitialized, when they +should be value-initialized. Value-initialization of objects of a pointer-to-member type may also +go wrong on various compilers. +

+

+At the moment of writing, May 2010, the following reported issues regarding +value-initialization are still there in current compiler releases: +

+Note that all known GCC issues regarding value-initialization are +fixed with GCC version 4.4, including +GCC Bug 30111. +Clang also has completely implemented value-initialization, as far as we know, +now that Clang Bug 7139 is fixed. +

+ +New versions of value_initialized +(Boost release version 1.35 or higher) +offer a workaround to these issues: value_initialized may now clear +its internal data, prior to constructing the object that it contains. It will do +so for those compilers that need to have such a workaround, based on the +compiler defect macro BOOST_NO_COMPLETE_VALUE_INITIALIZATION. +

+ +

Types and objects

+ +

template class value_initialized<T>

+ +
namespace boost {

template<class T>
class value_initialized
{ +
public : +
value_initialized() : x() {} +
operator T const &() const { return x ; } +
operator T&() { return x ; } +
T const &data() const { return x ; } +
T& data() { return x ; } +
void swap( value_initialized& ); +
+
private : +
unspecified x ; +
} ; +
+
template<class T> +
T const& get ( value_initialized<T> const& x ) +
{ +
return x.data() ; +
} +
+
template<class T> +
T& get ( value_initialized<T>& x ) +
{ +
return x.data() ; +
} +
+
template<class T> +
void swap ( value_initialized<T>& lhs, value_initialized<T>& rhs ) +
{ +
lhs.swap(rhs) ; +
} +
+
} // namespace boost +
+ +

An object of this template class is a T-wrapper convertible + to 'T&' whose wrapped object (data member of type T) + is value-initialized upon default-initialization + of this wrapper class:

+ +
int zero = 0 ;
value_initialized<int> x ;
assert ( x == zero ) ;

std::string def ;
value_initialized< std::string > y ;
assert ( y == def ) ;
+ +

The purpose of this wrapper is to provide a consistent syntax for value + initialization of scalar, union and class types (POD and non-POD) since + the correct syntax for value initialization varies (see value-initialization syntax)

+ +

The wrapped object can be accessed either through the conversion operator + T&, the member function data(), or the +non-member function get():

+ +
void watch(int);
value_initialized<int> x; +

watch(x) ; // operator T& used.
watch(x.data());
watch( get(x) ) // function get() used
+ +

Both const and non-const objects can be wrapped. + Mutable objects can be modified directly from within the wrapper but constant + objects cannot:

+ +

When T is a Swappable type, value_initialized<T> + is swappable as well, by calling its swap member function + as well as by calling boost::swap.

+ +
value_initialized<int> x ; 
static_cast<int&>(x) = 1 ; // OK
get(x) = 1 ; // OK +

value_initialized<int const> y ;
static_cast<int&>(y) = 1 ; // ERROR: cannot cast to int&
static_cast<int const&>(y) = 1 ; // ERROR: cannot modify a const value
get(y) = 1 ; // ERROR: cannot modify a const value
+ +

Warning:

+ +

The value_initialized implementation of Boost version 1.40.0 and older +allowed non-const access to the wrapped object, from a constant wrapper, +both by its conversion operator and its data() member function. For example:

+ +
value_initialized<int> const x_c ;
int& xr = x_c ; // OK, conversion to int& available even though x_c is itself const. +
xr = 2 ;
+ +

The reason for this obscure behavior was that some compilers + didn't accept the following valid code:

+ +
struct X
{
operator int&() ;
operator int const&() const ;
};
X x ;
(x == 1 ) ; // ERROR HERE!
+ +

The current version of value_initialized no longer has this obscure behavior. +As compilers nowadays widely support overloading the conversion operator by having a const and a non-const version, we have decided to fix the issue accordingly. So the current version supports the idea of logical constness. +
+

+ +

Recommended practice: The non-member get() idiom

+ +

The obscure behavior of being able to modify a non-const +wrapped object from within a constant wrapper (as was supported by previous +versions of value_initialized) +can be avoided if access to +the wrapped object is always performed with the get() idiom:

+ +
value_initialized<int> x ;
get(x) = 1 ; // OK

value_initialized<int const> cx ;
get(x) = 1 ; // ERROR: Cannot modify a const object

value_initialized<int> const x_c ;
get(x_c) = 1 ; // ERROR: Cannot modify a const object

value_initialized<int const> const cx_c ;
get(cx_c) = 1 ; // ERROR: Cannot modify a const object
+ +

template class initialized<T>

+ +
namespace boost {

template<class T>
class initialized
{ +
public : +
initialized() : x() {} +
explicit initialized(T const & arg) : x(arg) {} +
operator T const &() const; +
operator T&(); +
T const &data() const; +
T& data(); +
void swap( initialized& ); +
+
private : +
unspecified x ; +
} ; +
+
template<class T> +
T const& get ( initialized<T> const& x ); +
+
template<class T> +
T& get ( initialized<T>& x ); +
+
template<class T> +
void swap ( initialized<T>& lhs, initialized<T>& rhs ); +
+
} // namespace boost +
+ +The template class boost::initialized<T> supports both value-initialization +and direct-initialization, so its interface is a superset of the interface +of value_initialized<T>: Its default-constructor +value-initializes the wrapped object just like the default-constructor of +value_initialized<T>, but boost::initialized<T> +also offers an extra explicit +constructor, which direct-initializes the wrapped object by the specified value. +

+ +initialized<T> is especially useful when the wrapped +object must be either value-initialized or direct-initialized, depending on +runtime conditions. For example, initialized<T> could +hold the value of a data member that may be value-initialized by some +constructors, and direct-initialized by others. +On the other hand, if it is known beforehand that the +object must always be value-initialized, value_initialized<T> +may be preferable. And if the object must always be +direct-initialized, none of the two wrappers really needs to be used. +

+ + +

initialized_value

+ +
+namespace boost {
+class initialized_value_t
+{
+  public :
+    template <class T> operator T() const ;
+};
+
+initialized_value_t const initialized_value = {} ;
+
+} // namespace boost
+
+ +initialized_value provides a convenient way to get +an initialized value: its conversion operator provides an appropriate +value-initialized object for any CopyConstructible type. + +Suppose you need to have an initialized variable of type T. +You could do it as follows: +
+  T var = T();
+
+But as mentioned before, this form suffers from various compiler issues. +The template value_initialized offers a workaround: +
+  T var = get( value_initialized<T>() );
+
+Unfortunately both forms repeat the type name, which +is rather short now (T), but could of course be +more like Namespace::Template<Arg>::Type. +Instead, one could use initialized_value as follows: +
+  T var = initialized_value ;
+
+ +

References

+ [1] Bjarne Stroustrup, Gabriel Dos Reis, and J. Stephen Adamczyk wrote + various papers, proposing to extend the support for brace-enclosed initializer lists + in the next version of C++. + This would allow a variable var of any DefaultConstructible type + T to be value-initialized by doing T var = {}. + The papers are listed at Bjarne's web page, + My C++ Standards committee papers
+ [2] Scott Meyers, Effective C++, Third Edition, item 6, + Explicitly disallow the use of compiler-generated functions you do not want, + Scott Meyers: Books and CDs
+ [3] The C++ Standard, Second edition (2003), ISO/IEC 14882:2003
+ [4] POD stands for "Plain Old Data" + +

Acknowledgements

+ value_initialized was developed by Fernando Cacciola, with help and +suggestions from David Abrahams and Darin Adler.
+Special thanks to Björn Karlsson who carefully edited and completed this documentation. + +

value_initialized was reimplemented by Fernando Cacciola and Niels Dekker +for Boost release version 1.35 (2008), offering a workaround to various compiler issues. +

+

boost::initialized was very much inspired by feedback from Edward Diener and + Jeffrey Hellrung. +

+

initialized_value was written by Niels Dekker, and added to Boost release version 1.36 (2008). +

+

Developed by Fernando Cacciola, + the latest version of this file can be found at www.boost.org. +

+ +
+

Revised 30 May 2010

+ +

© Copyright Fernando Cacciola, 2002 - 2010.

+ +

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

+ +
+
+ + + diff --git a/tools/boost_1_65_1/libs/uuid/doc/readme b/tools/boost_1_65_1/libs/uuid/doc/readme new file mode 100644 index 0000000000000000000000000000000000000000..41fee8a5ce1e278b99f440d6ed3970b520daf080 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/doc/readme @@ -0,0 +1,2 @@ +The documentation for the uuid library can be viewed by +opening index.html from the uuid top-level directory. diff --git a/tools/boost_1_65_1/libs/uuid/index.html b/tools/boost_1_65_1/libs/uuid/index.html new file mode 100644 index 0000000000000000000000000000000000000000..03de8aa5bec04a1beb7b2183d9799573673f2c9b --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/index.html @@ -0,0 +1,43 @@ + + + + +Boost Uuid Library + + + + + + + + + + + + + +
boost.png (6897 bytes)Home Libraries People FAQ More
+ +

Uuid library

+ +

The header uuid.hpp provides an implementation of Universally Unique Identifiers. +

+ +

This implementation is intended for general use.

+ + + +

Revised  May 14, 2007

+ +
+

© Copyright Andy Tompkins, 2006

+

Distributed under the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/uuid/meta/libraries.json b/tools/boost_1_65_1/libs/uuid/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..8b41acc587c4490b33265f82c99c07ff137320db --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/meta/libraries.json @@ -0,0 +1,15 @@ +{ + "key": "uuid", + "name": "Uuid", + "authors": [ + "Andy Tompkins" + ], + "description": "A universally unique identifier.", + "category": [ + "Data", + "Domain" + ], + "maintainers": [ + "Andy Tompkins " + ] +} diff --git a/tools/boost_1_65_1/libs/uuid/test/Jamfile.v2 b/tools/boost_1_65_1/libs/uuid/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..a6ff3a65b0eb329be00f33ece982b43cc92bfd32 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/Jamfile.v2 @@ -0,0 +1,61 @@ +# Copyright 2007 Andy Tompkins. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import testing ; + +test-suite uuid : + # make sure each header file is self-contained + [ compile compile_uuid.cpp ] + [ compile compile_uuid.cpp : BOOST_UUID_NO_TYPE_TRAITS : compile_uuid_no_type_traits ] + [ compile compile_uuid_io.cpp ] + [ compile compile_uuid_serialize.cpp ] + [ compile compile_uuid_generators.cpp ] + [ compile compile_nil_generator.cpp ] + [ compile compile_name_generator.cpp ] + [ compile compile_string_generator.cpp ] + [ compile compile_random_generator.cpp ] + [ compile compile_seed_rng.cpp ] + + # test inclucing all .hpp files in 2 translations units + # to look for issues when using multiple translation units + # eg. missing inline on a global functionstate is not missing + [ run test_include1.cpp test_include2.cpp ] + + # main test + [ run test_uuid.cpp ] + [ run test_uuid_no_simd.cpp ] + + # test uuid_io.hpp + [ run test_io.cpp ] + + # test generators + [ run test_nil_generator.cpp ] + [ run test_name_generator.cpp ] + [ run test_string_generator.cpp ] + [ run test_random_generator.cpp ] + + # test tagging an object + [ run test_tagging.cpp ] + + # test use cases + [ run test_uuid_class.cpp ] + [ run test_uuid_in_map.cpp ] + + # test serializing uuids + [ run test_serialization.cpp ../../serialization/build//boost_serialization ] + # TODO - This test fails to like with boost_wserialization + #[ run test_wserialization.cpp + # ../../serialization/build//boost_serialization + # ../../serialization/build//boost_wserialization + # : : : ../../config/test/all//BOOST_NO_STD_WSTREAMBUF + #] + + # test sha1 hash function + [ run test_sha1.cpp ] + + # test MSVC 12 (VS2013) optimizer bug with SIMD operations. See https://svn.boost.org/trac/boost/ticket/8509#comment:3. + # Only happens in Release x64 builds. + [ run test_msvc_simd_bug981648_main.cpp test_msvc_simd_bug981648_foo.cpp : : : release on : test_msvc_simd_bug981648 ] + ; diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_name_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_name_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..66109754423617068013649d357ea3bac27af688 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_name_generator.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_nil_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_nil_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d103f3c4697bdc468cc78f2ba5d0c4009dca8f00 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_nil_generator.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_random_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_random_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4913ffca7c4614b0a750baeb37f67dcd9bcaadf8 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_random_generator.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_seed_rng.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_seed_rng.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c30546bb45b266a7f338949209c956572eadb738 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_seed_rng.cpp @@ -0,0 +1,14 @@ +// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include +#include // to test issue #5974 diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_string_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_string_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ae4595a571ca2321695eecd75bec43db91f24dd7 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_string_generator.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_uuid.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_uuid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39f1ebbf82aa1c060e170c6cf9da2d80491609f1 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_uuid.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_uuid_generators.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_uuid_generators.cpp new file mode 100644 index 0000000000000000000000000000000000000000..da7a8f1d89a0e8efcf1f9902386056c0ec289198 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_uuid_generators.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_uuid_io.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_uuid_io.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2970fc76ac7ae42d5db1b7ec4ded1f19e5b65b2d --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_uuid_io.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/compile_uuid_serialize.cpp b/tools/boost_1_65_1/libs/uuid/test/compile_uuid_serialize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6ddb053344770b9abed4c175b9fc31e422c40629 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/compile_uuid_serialize.cpp @@ -0,0 +1,13 @@ +// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to make sure that a translation unit consisting of just the contents +// of the header file will compile successfully. + +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/test_generators.cpp b/tools/boost_1_65_1/libs/uuid/test/test_generators.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6fca15d66fc5f31bf9763f8cd3a421e89e53e8aa --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_generators.cpp @@ -0,0 +1,137 @@ +// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_generators.cpp -------------------------------// + +#include +#include +#include + +#include +#include + +#include + +template +void check_random_generator(RandomUuidGenerator& uuid_gen) +{ + boost::uuids::uuid u1 = uuid_gen(); + boost::uuids::uuid u2 = uuid_gen(); + + BOOST_CHECK_NE(u1, u2); + + // check variant + BOOST_CHECK_EQUAL(u1.variant(), boost::uuids::uuid::variant_rfc_4122); +// BOOST_CHECK_EQUAL( *(u1.begin()+8) & 0xC0, 0x80); + // version + BOOST_CHECK_EQUAL( *(u1.begin()+6) & 0xF0, 0x40); +} + +int test_main(int, char*[]) +{ + using namespace boost::uuids; + using boost::test_tools::output_test_stream; + + { // test nil generator + uuid u1 = nil_generator()(); + uuid u2 = {{0}}; + BOOST_CHECK_EQUAL(u1, u2); + + uuid u3 = nil_uuid(); + BOOST_CHECK_EQUAL(u3, u2); + } + + { // test string_generator + string_generator gen; + uuid u = gen("00000000-0000-0000-0000-000000000000"); + BOOST_CHECK_EQUAL(u, nil_uuid()); + BOOST_CHECK_EQUAL(u.is_nil(), true); + + const uuid u_increasing = {{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }}; + const uuid u_decreasing = {{ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }}; + + u = gen("0123456789abcdef0123456789ABCDEF"); + BOOST_CHECK_EQUAL(u, u_increasing); + + u = gen("{0123456789abcdef0123456789ABCDEF}"); + BOOST_CHECK_EQUAL(u, u_increasing); + + u = gen("{01234567-89AB-CDEF-0123-456789abcdef}"); + BOOST_CHECK_EQUAL(u, u_increasing); + + u = gen("01234567-89AB-CDEF-0123-456789abcdef"); + BOOST_CHECK_EQUAL(u, u_increasing); + + u = gen(std::string("fedcba98-7654-3210-fedc-ba9876543210")); + BOOST_CHECK_EQUAL(u, u_decreasing); + +#ifndef BOOST_NO_STD_WSTRING + u = gen(L"fedcba98-7654-3210-fedc-ba9876543210"); + BOOST_CHECK_EQUAL(u, u_decreasing); + + u = gen(std::wstring(L"01234567-89ab-cdef-0123-456789abcdef")); + BOOST_CHECK_EQUAL(u, u_increasing); +#endif //BOOST_NO_STD_WSTRING + } + + { // test name_generator + uuid dns_namespace_uuid = {{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}}; + uuid correct = {{0x21, 0xf7, 0xf8, 0xde, 0x80, 0x51, 0x5b, 0x89, 0x86, 0x80, 0x01, 0x95, 0xef, 0x79, 0x8b, 0x6a}}; + uuid wcorrect = {{0xb9, 0x50, 0x66, 0x13, 0x2c, 0x04, 0x51, 0x2d, 0xb8, 0xfe, 0xbf, 0x8d, 0x0b, 0xa1, 0xb2, 0x71}}; + + name_generator gen(dns_namespace_uuid); + + uuid u = gen("www.widgets.com"); + BOOST_CHECK_EQUAL(u, correct); + BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + u = gen(L"www.widgets.com"); + BOOST_CHECK_EQUAL(u, wcorrect); + BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + u = gen(std::string("www.widgets.com")); + BOOST_CHECK_EQUAL(u, correct); + BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + u = gen(std::wstring(L"www.widgets.com")); + BOOST_CHECK_EQUAL(u, wcorrect); + BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + char name[] = "www.widgets.com"; + u = gen(name, 15); + BOOST_CHECK_EQUAL(u, correct); + BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122); + } + + { // test random_generator + // default random number generator + random_generator uuid_gen1; + check_random_generator(uuid_gen1); + + // specific random number generator + basic_random_generator uuid_gen2; + check_random_generator(uuid_gen2); + + // pass by reference + boost::ecuyer1988 ecuyer1988_gen; + basic_random_generator uuid_gen3(ecuyer1988_gen); + check_random_generator(uuid_gen3); + + // pass by pointer + boost::lagged_fibonacci607 lagged_fibonacci607_gen; + basic_random_generator uuid_gen4(&lagged_fibonacci607_gen); + check_random_generator(uuid_gen4); + + // random device + //basic_random_generator uuid_gen5; + //check_random_generator(uuid_gen5); + } + + return 0; +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_include1.cpp b/tools/boost_1_65_1/libs/uuid/test/test_include1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b4f168c2cc38b7386bfca03dec2f46cde1821452 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_include1.cpp @@ -0,0 +1,24 @@ +// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_include1.cpp -------------------------------// + +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int, char*[]) +{ + return 0; +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_include2.cpp b/tools/boost_1_65_1/libs/uuid/test/test_include2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c3252ca704431c4ced8f030e188ddd45dfca82a --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_include2.cpp @@ -0,0 +1,19 @@ +// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_include2.cpp -------------------------------// + +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/tools/boost_1_65_1/libs/uuid/test/test_io.cpp b/tools/boost_1_65_1/libs/uuid/test/test_io.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c425a87d044df93ab641f5e38cc3a69e8051d8b9 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_io.cpp @@ -0,0 +1,162 @@ +// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_io.cpp -------------------------------// + +#include +#include +#include + +#include +#include +#include +#include + +#ifndef BOOST_NO_STD_WSTRING +namespace std { +template +std::basic_ostream& operator<<(std::basic_ostream& os, std::wstring const& s) { + // convert to string + std::string temp(s.begin(), s.end()); + os << temp; + return os; +} +} // namespace std +#endif + +int main(int, char*[]) +{ + using namespace boost::uuids; + + const uuid u1 = {{0}}; + const uuid u2 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + const uuid u3 = {{0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}}; + + { // test insert/extract operators + std::stringstream ss1; + ss1 << u1; + BOOST_TEST_EQ(ss1.str(), "00000000-0000-0000-0000-000000000000"); + + std::stringstream ss2; + ss2 << u2; + BOOST_TEST_EQ(ss2.str(), "00010203-0405-0607-0809-0a0b0c0d0e0f"); + + std::stringstream ss3; + ss3 << u3; + BOOST_TEST_EQ(ss3.str(), "12345678-90ab-cdef-1234-567890abcdef"); + + std::stringstream ss4; + ss4 << std::uppercase << u3; + BOOST_TEST_EQ(ss4.str(), "12345678-90AB-CDEF-1234-567890ABCDEF"); + + std::stringstream ss5; + ss5 << 'a' << std::right << std::setfill('*') << std::setw(40) << u1 << 'a'; + BOOST_TEST_EQ(ss5.str(), "a****00000000-0000-0000-0000-000000000000a"); + + std::stringstream ss6; + ss6 << std::left << std::setfill('*') << std::setw(45) << u1; + BOOST_TEST_EQ(ss6.str(), "00000000-0000-0000-0000-000000000000*********"); + + std::stringstream ss7; + ss7 << std::left << std::setfill('*') << std::setw(45) << u2; + BOOST_TEST_EQ(ss7.str(), "00010203-0405-0607-0809-0a0b0c0d0e0f*********"); + } + + #ifndef BOOST_NO_STD_WSTRING + { // test insert/extract operators + std::wstringstream ss1; + ss1 << u1; + BOOST_TEST_EQ(ss1.str(), L"00000000-0000-0000-0000-000000000000"); + + std::wstringstream ss2; + ss2 << u2; + BOOST_TEST_EQ(ss2.str(), L"00010203-0405-0607-0809-0a0b0c0d0e0f"); + + std::wstringstream ss3; + ss3 << u3; + BOOST_TEST_EQ(ss3.str(), L"12345678-90ab-cdef-1234-567890abcdef"); + + std::wstringstream ss4; + ss4 << std::uppercase << u3; + BOOST_TEST_EQ(ss4.str(), L"12345678-90AB-CDEF-1234-567890ABCDEF"); + + std::wstringstream ss5; + ss5 << L'a' << std::right << std::setfill(L'*') << std::setw(40) << u1 << L'a'; + BOOST_TEST_EQ(ss5.str(), L"a****00000000-0000-0000-0000-000000000000a"); + + std::wstringstream ss6; + ss6 << std::left << std::setfill(L'*') << std::setw(45) << u1; + BOOST_TEST_EQ(ss6.str(), L"00000000-0000-0000-0000-000000000000*********"); + + std::wstringstream ss7; + ss7 << std::left << std::setfill(L'*') << std::setw(45) << u2; + BOOST_TEST_EQ(ss7.str(), L"00010203-0405-0607-0809-0a0b0c0d0e0f*********"); + } +#endif + + { + uuid u; + + std::stringstream ss; + ss << "00000000-0000-0000-0000-000000000000"; + ss >> u; + BOOST_TEST_EQ(u, u1); + + ss << "12345678-90ab-cdef-1234-567890abcdef"; + ss >> u; + BOOST_TEST_EQ(u, u3); + } + + #ifndef BOOST_NO_STD_WSTRING + { + uuid u; + + std::wstringstream ss; + ss << L"00000000-0000-0000-0000-000000000000"; + ss >> u; + BOOST_TEST_EQ(u, u1); + + ss << L"12345678-90ab-cdef-1234-567890abcdef"; + ss >> u; + BOOST_TEST_EQ(u, u3); + } +#endif + + { // test with lexical_cast + BOOST_TEST_EQ(boost::lexical_cast(u1), std::string("00000000-0000-0000-0000-000000000000")); + BOOST_TEST_EQ(boost::lexical_cast("00000000-0000-0000-0000-000000000000"), u1); + + BOOST_TEST_EQ(boost::lexical_cast(u3), std::string("12345678-90ab-cdef-1234-567890abcdef")); + BOOST_TEST_EQ(boost::lexical_cast("12345678-90ab-cdef-1234-567890abcdef"), u3); + } + +#ifndef BOOST_NO_STD_WSTRING + { // test with lexical_cast + BOOST_TEST_EQ(boost::lexical_cast(u1), std::wstring(L"00000000-0000-0000-0000-000000000000")); + BOOST_TEST_EQ(boost::lexical_cast(L"00000000-0000-0000-0000-000000000000"), u1); + + BOOST_TEST_EQ(boost::lexical_cast(u3), std::wstring(L"12345678-90ab-cdef-1234-567890abcdef")); + BOOST_TEST_EQ(boost::lexical_cast(L"12345678-90ab-cdef-1234-567890abcdef"), u3); + } +#endif + + { // test to_string + BOOST_TEST_EQ(to_string(u1), std::string("00000000-0000-0000-0000-000000000000")); + BOOST_TEST_EQ(to_string(u3), std::string("12345678-90ab-cdef-1234-567890abcdef")); + } + +#ifndef BOOST_NO_STD_WSTRING + { // test to_wstring + BOOST_TEST_EQ(to_wstring(u1), std::wstring(L"00000000-0000-0000-0000-000000000000")); + BOOST_TEST_EQ(to_wstring(u3), std::wstring(L"12345678-90ab-cdef-1234-567890abcdef")); + } +#endif + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648.hpp b/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f81e08e76fb5b0100412e3965989cff623e43d62 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648.hpp @@ -0,0 +1,34 @@ +/* +* Copyright 2014 Andrey Semashev +* +* Distributed under the Boost Software License, Version 1.0. +* See accompanying file LICENSE_1_0.txt or copy at +* http://www.boost.org/LICENSE_1_0.txt +*/ +/* +* This is a part of the test for a workaround for MSVC 12 (VS2013) optimizer bug +* which causes incorrect SIMD code generation for operator==. See: +* +* https://svn.boost.org/trac/boost/ticket/8509#comment:3 +* https://connect.microsoft.com/VisualStudio/feedbackdetail/view/981648#tabs +* +* The header contains common definitions for the two source files. +*/ +#include +using boost::uuids::uuid; +class headerProperty +{ +public: +virtual ~headerProperty() {} +}; +class my_obj: +public headerProperty +{ +public: +// This char tmp[8] forces the following uuid to be misaligned. +char tmp[8]; +// This m_uuid is misaligned (not 16-byte aligned) and causes the != operator to crash. +uuid m_uuid; +const uuid &get_marker_id() const { return m_uuid; } +uuid get_id() const { return m_uuid; } +}; diff --git a/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648_foo.cpp b/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648_foo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5e2cc79f1cb20c9426dfcccde3549793f6f902ce --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648_foo.cpp @@ -0,0 +1,31 @@ +/* +* Copyright 2014 Andrey Semashev +* +* Distributed under the Boost Software License, Version 1.0. +* See accompanying file LICENSE_1_0.txt or copy at +* http://www.boost.org/LICENSE_1_0.txt +*/ +/* +* This is a part of the test for a workaround for MSVC 12 (VS2013) optimizer bug +* which causes incorrect SIMD code generation for operator==. See: +* +* https://svn.boost.org/trac/boost/ticket/8509#comment:3 +* https://connect.microsoft.com/VisualStudio/feedbackdetail/view/981648#tabs +* +* The file contains the function that actually causes the crash. Reproduces only +* in Release x64 builds. +*/ +#include +#include "test_msvc_simd_bug981648.hpp" +void mp_grid_update_marker_parameters(headerProperty* header_prop, my_obj ¤t_marker) +{ +headerProperty *old_header_prop = NULL; +my_obj *p = dynamic_cast(header_prop); +/* +* This != statement crashes with a GP. +* */ +if (p != NULL && (current_marker.get_id() != p->get_marker_id())) { +std::printf("works okay, if it reaches this printf: %p\n",p); +old_header_prop = header_prop; +} +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648_main.cpp b/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648_main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..35d3a11139759c64764685ad0efc508c374a03c9 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_msvc_simd_bug981648_main.cpp @@ -0,0 +1,40 @@ +/* +* Copyright 2014 Andrey Semashev +* +* Distributed under the Boost Software License, Version 1.0. +* See accompanying file LICENSE_1_0.txt or copy at +* http://www.boost.org/LICENSE_1_0.txt +*/ +/* +* This is a part of the test for a workaround for MSVC 12 (VS2013) optimizer bug +* which causes incorrect SIMD code generation for operator==. See: +* +* https://svn.boost.org/trac/boost/ticket/8509#comment:3 +* https://connect.microsoft.com/VisualStudio/feedbackdetail/view/981648#tabs +* +* This file contains the main entry point. +*/ +#include +#include "test_msvc_simd_bug981648.hpp" +extern void mp_grid_update_marker_parameters(headerProperty* header_prop, my_obj ¤t_marker); +static my_obj g_my_obj; +int main(int argc, char* argv[]) +{ +my_obj *p = &g_my_obj; +p->m_uuid = uuid(); +uuid one, two; +one.data[0] = 0; two.data[0] = 1; +//***************************************** +// This != statement generates two movdqu statements or pcmpeqd with a memory operand which crashes +if (one != two) { +std::printf("The first != operator works okay if it reaches this printf.\n"); +} +my_obj a; +a.m_uuid.data[0] = 1; +std::printf("There should be a another printf coming next.\n"); +//***************************************** +// The != statement in this function generates a movups and a movdqu statement. +// It also crashes because the optimizer also creates a pcmpeqd for a non-aligned memory location. +mp_grid_update_marker_parameters(p, a); +return 0; +} \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/uuid/test/test_name_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/test_name_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..13ac115464f3d85014ed149381157125d9a97414 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_name_generator.cpp @@ -0,0 +1,49 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_name_generator.cpp -------------------------------// + +#include +#include +#include +#include + +int main(int, char*[]) +{ + using namespace boost::uuids; + + uuid dns_namespace_uuid = {{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}}; + uuid correct = {{0x21, 0xf7, 0xf8, 0xde, 0x80, 0x51, 0x5b, 0x89, 0x86, 0x80, 0x01, 0x95, 0xef, 0x79, 0x8b, 0x6a}}; + uuid wcorrect = {{0xc3, 0x15, 0x27, 0x0b, 0xa4, 0x66, 0x58, 0x72, 0xac, 0xa4, 0x96, 0x26, 0xce, 0xc0, 0xf4, 0xbe}}; + + name_generator gen(dns_namespace_uuid); + + uuid u = gen("www.widgets.com"); + BOOST_TEST_EQ(u, correct); + BOOST_TEST_EQ(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + u = gen(L"www.widgets.com"); + BOOST_TEST_EQ(u, wcorrect); + BOOST_TEST_EQ(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + u = gen(std::string("www.widgets.com")); + BOOST_TEST_EQ(u, correct); + BOOST_TEST_EQ(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + u = gen(std::wstring(L"www.widgets.com")); + BOOST_TEST_EQ(u, wcorrect); + BOOST_TEST_EQ(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + char name[] = "www.widgets.com"; + u = gen(name, 15); + BOOST_TEST_EQ(u, correct); + BOOST_TEST_EQ(u.variant(), boost::uuids::uuid::variant_rfc_4122); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_nil_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/test_nil_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4aaffb6cc5f49a3ce09bad5a5b43d47fcac6f32c --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_nil_generator.cpp @@ -0,0 +1,29 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_nil_generator.cpp -------------------------------// + +#include +#include +#include +#include + +int main(int, char*[]) +{ + using namespace boost::uuids; + + uuid u1 = nil_generator()(); + uuid u2 = {{0}}; + BOOST_TEST_EQ(u1, u2); + + uuid u3 = nil_uuid(); + BOOST_TEST_EQ(u3, u2); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_random_generator.cpp b/tools/boost_1_65_1/libs/uuid/test/test_random_generator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..32e065fb8a17fc5c3213ae46805e96e3d73ca2a8 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_random_generator.cpp @@ -0,0 +1,71 @@ +// (C) Copyright Andy Tompkins 2010. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_random_generator.cpp -------------------------------// + +#include +#include +#include +#include +#include + +template +void check_random_generator(RandomUuidGenerator& uuid_gen) +{ + boost::uuids::uuid u1 = uuid_gen(); + boost::uuids::uuid u2 = uuid_gen(); + + BOOST_TEST_NE(u1, u2); + + // check variant + BOOST_TEST_EQ(u1.variant(), boost::uuids::uuid::variant_rfc_4122); + + // version + BOOST_TEST_EQ(u1.version(), boost::uuids::uuid::version_random_number_based); +} + +int main(int, char*[]) +{ + using namespace boost::uuids; + + // default random number generator + random_generator uuid_gen1; + check_random_generator(uuid_gen1); + + // specific random number generator + basic_random_generator uuid_gen2; + check_random_generator(uuid_gen2); + + // pass by reference + boost::ecuyer1988 ecuyer1988_gen; + basic_random_generator uuid_gen3(ecuyer1988_gen); + check_random_generator(uuid_gen3); + + // pass by pointer + boost::lagged_fibonacci607 lagged_fibonacci607_gen; + basic_random_generator uuid_gen4(&lagged_fibonacci607_gen); + check_random_generator(uuid_gen4); + + // random device + //basic_random_generator uuid_gen5; + //check_random_generator(uuid_gen5); + + // there was a bug in basic_random_generator where it did not + // produce very random numbers. This checks for that bug. + uuid u = random_generator()(); + if ( (u.data[4] == u.data[12]) && + (u.data[5] == u.data[9] && u.data[5] == u.data[13]) && + (u.data[7] == u.data[11] && u.data[7] == u.data[15]) && + (u.data[10] == u.data[14]) ) + { + BOOST_ERROR("basic_random_generator is not producing random uuids"); + } + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_serialization.cpp b/tools/boost_1_65_1/libs/uuid/test/test_serialization.cpp new file mode 100644 index 0000000000000000000000000000000000000000..570e5e2d09a805497703663dc3068840465bdf9e --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_serialization.cpp @@ -0,0 +1,71 @@ +// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to test serializing uuids with narrow archives + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +template +void test_archive() +{ + using namespace std; + using namespace boost::uuids; + + OStringStreamType o_stream; + + uuid u1 = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}}; + + uuid u2; + + // save + { + OArchiveType oa(o_stream); + + oa << BOOST_SERIALIZATION_NVP(u1); + } + + //cout << "stream:" << o_stream.str() << "\n\n"; + + // load + { + IStringStreamType i_stream(o_stream.str()); + IArchiveType ia(i_stream); + + ia >> BOOST_SERIALIZATION_NVP(u2); + } + + BOOST_TEST_EQ(u1, u2); +} + +int main( int /* argc */, char* /* argv */[] ) +{ + using namespace std; + using namespace boost::archive; + + test_archive(); + test_archive(); + test_archive(); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_sha1.cpp b/tools/boost_1_65_1/libs/uuid/test/test_sha1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ed8e0737366fcc337df068517f5b1945b31e4fbf --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_sha1.cpp @@ -0,0 +1,306 @@ +// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_sha1.cpp -------------------------------// + +#include +#include +#include +#include +#include + +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std { + using ::strlen; + using ::size_t; +} //namespace std +#endif + +void test_sha1_digest_equal_array(char const * file, int line, char const * function, + const unsigned int (&lhs)[5], const unsigned int (&rhs)[5]) +{ + for (size_t i=0; i<5; i++) { + if ( lhs[i] != rhs[i]) { + std::cerr << file << "(" << line << "): sha1 digest ["; + for (size_t l=0; l<5; l++) { + if (l != 0) { + std::cerr << " "; + } + std::cerr << std::hex << (int)lhs[l]; + } + + std::cerr << "] not equal ["; + for (size_t r=0; r<5; r++) { + if (r != 0) { + std::cerr << " "; + } + std::cerr << std::hex << (int)rhs[r]; + } + std::cerr << "] in function '" << function << "'" << std::endl; + ++boost::detail::test_errors(); + return; + } + } +} + + +#define BOOST_TEST_SHA1_DIGEST(lhs, rhs) ( test_sha1_digest_equal_array(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, lhs, rhs) ) + +void test_sha1(char const*const message, unsigned int length, const unsigned int (&correct_digest)[5]) +{ + boost::uuids::detail::sha1 sha; + sha.process_bytes(message, length); + + unsigned int digest[5]; + sha.get_digest(digest); + + BOOST_TEST_SHA1_DIGEST(digest, correct_digest); +} + +void test_quick() +{ + struct test_case + { + char const* message; + unsigned int digest[5]; + }; + test_case cases[] = + { { "", + { 0xda39a3ee, 0x5e6b4b0d, 0x3255bfef, 0x95601890, 0xafd80709 } } + , { "The quick brown fox jumps over the lazy dog", + { 0x2fd4e1c6, 0x7a2d28fc, 0xed849ee1, 0xbb76e739, 0x1b93eb12 } } + , { "The quick brown fox jumps over the lazy cog", + { 0xde9f2c7f, 0xd25e1b3a, 0xfad3e85a, 0x0bd17d9b, 0x100db4b3 } } + }; + + for (int i=0; i!=sizeof(cases)/sizeof(cases[0]); ++i) { + test_case const& tc = cases[i]; + test_sha1(tc.message, std::strlen(tc.message), tc.digest); + } +} + +//SHA Test Vector for Hashing Byte-Oriented Messages +//http://csrc.nist.gov/cryptval/shs.htm +//http://csrc.nist.gov/cryptval/shs/shabytetestvectors.zip +//values from SHA1ShortMsg.txt +void test_short_messages() +{ + struct test_case + { + char const* message; + unsigned int digest[5]; + }; + test_case cases[] = + { { "", + { 0xda39a3ee, 0x5e6b4b0d, 0x3255bfef, 0x95601890, 0xafd80709 } } + , { "a8", + { 0x99f2aa95, 0xe36f95c2, 0xacb0eaf2, 0x3998f030, 0x638f3f15 } } + , { "3000", + { 0xf944dcd6, 0x35f9801f, 0x7ac90a40, 0x7fbc4799, 0x64dec024 } } + , { "42749e", + { 0xa444319e, 0x9b6cc1e8, 0x464c511e, 0xc0969c37, 0xd6bb2619 } } + , { "9fc3fe08", + { 0x16a0ff84, 0xfcc156fd, 0x5d3ca3a7, 0x44f20a23, 0x2d172253 } } + , { "b5c1c6f1af", + { 0xfec9deeb, 0xfcdedaf6, 0x6dda525e, 0x1be43597, 0xa73a1f93 } } + , { "e47571e5022e", + { 0x8ce05118, 0x1f0ed5e9, 0xd0c498f6, 0xbc4caf44, 0x8d20deb5 } } + , { "3e1b28839fb758", + { 0x67da5383, 0x7d89e03b, 0xf652ef09, 0xc369a341, 0x5937cfd3 } } + , { "a81350cbb224cb90", + { 0x305e4ff9, 0x888ad855, 0xa78573cd, 0xdf4c5640, 0xcce7e946 } } + , { "c243d167923dec3ce1", + { 0x5902b77b, 0x3265f023, 0xf9bbc396, 0xba1a93fa, 0x3509bde7 } } + , { "50ac18c59d6a37a29bf4", + { 0xfcade5f5, 0xd156bf6f, 0x9af97bdf, 0xa9c19bcc, 0xfb4ff6ab } } + , { "98e2b611ad3b1cccf634f6", + { 0x1d20fbe0, 0x0533c10e, 0x3cbd6b27, 0x088a5de0, 0xc632c4b5 } } + , { "73fe9afb68e1e8712e5d4eec", + { 0x7e1b7e0f, 0x7a8f3455, 0xa9c03e95, 0x80fd63ae, 0x205a2d93 } } + , { "9e701ed7d412a9226a2a130e66", + { 0x706f0677, 0x146307b2, 0x0bb0e8d6, 0x311e3299, 0x66884d13 } } + , { "6d3ee90413b0a7cbf69e5e6144ca", + { 0xa7241a70, 0x3aaf0d53, 0xfe142f86, 0xbf2e8492, 0x51fa8dff } } + , { "fae24d56514efcb530fd4802f5e71f", + { 0x400f5354, 0x6916d33a, 0xd01a5e6d, 0xf66822df, 0xbdc4e9e6 } } + , { "c5a22dd6eda3fe2bdc4ddb3ce6b35fd1", + { 0xfac8ab93, 0xc1ae6c16, 0xf0311872, 0xb984f729, 0xdc928ccd } } + , { "d98cded2adabf08fda356445c781802d95", + { 0xfba6d750, 0xc18da58f, 0x6e2aab10, 0x112b9a5e, 0xf3301b3b } } + , { "bcc6d7087a84f00103ccb32e5f5487a751a2", + { 0x29d27c2d, 0x44c205c8, 0x107f0351, 0xb05753ac, 0x708226b6 } } + , { "36ecacb1055434190dbbc556c48bafcb0feb0d", + { 0xb971bfc1, 0xebd6f359, 0xe8d74cb7, 0xecfe7f89, 0x8d0ba845 } } + , { "5ff9edb69e8f6bbd498eb4537580b7fba7ad31d0", + { 0x96d08c43, 0x0094b9fc, 0xc164ad2f, 0xb6f72d0a, 0x24268f68 } } + , { "c95b441d8270822a46a798fae5defcf7b26abace36", + { 0xa287ea75, 0x2a593d52, 0x09e28788, 0x1a09c49f, 0xa3f0beb1 } } + , { "83104c1d8a55b28f906f1b72cb53f68cbb097b44f860", + { 0xa06c7137, 0x79cbd885, 0x19ed4a58, 0x5ac0cb8a, 0x5e9d612b } } + , { "755175528d55c39c56493d697b790f099a5ce741f7754b", + { 0xbff7d52c, 0x13a36881, 0x32a1d407, 0xb1ab40f5, 0xb5ace298 } } + , { "088fc38128bbdb9fd7d65228b3184b3faac6c8715f07272f", + { 0xc7566b91, 0xd7b6f56b, 0xdfcaa978, 0x1a7b6841, 0xaacb17e9 } } + , { "a4a586eb9245a6c87e3adf1009ac8a49f46c07e14185016895", + { 0xffa30c0b, 0x5c550ea4, 0xb1e34f8a, 0x60ec9295, 0xa1e06ac1 } } + , { "8e7c555270c006092c2a3189e2a526b873e2e269f0fb28245256", + { 0x29e66ed2, 0x3e914351, 0xe872aa76, 0x1df6e4f1, 0xa07f4b81 } } + , { "a5f3bfa6bb0ba3b59f6b9cbdef8a558ec565e8aa3121f405e7f2f0", + { 0xb28cf5e5, 0xb806a014, 0x91d41f69, 0xbd924876, 0x5c5dc292 } } + , { "589054f0d2bd3c2c85b466bfd8ce18e6ec3e0b87d944cd093ba36469", + { 0x60224fb7, 0x2c460696, 0x52cd78bc, 0xd08029ef, 0x64da62f3 } } + , { "a0abb12083b5bbc78128601bf1cbdbc0fdf4b862b24d899953d8da0ff3", + { 0xb72c4a86, 0xf72608f2, 0x4c05f3b9, 0x088ef92f, 0xba431df7 } } + , { "82143f4cea6fadbf998e128a8811dc75301cf1db4f079501ea568da68eeb", + { 0x73779ad5, 0xd6b71b9b, 0x8328ef72, 0x20ff12eb, 0x167076ac } } + , { "9f1231dd6df1ff7bc0b0d4f989d048672683ce35d956d2f57913046267e6f3", + { 0xa09671d4, 0x452d7cf5, 0x0015c914, 0xa1e31973, 0xd20cc1a0 } } + , { "041c512b5eed791f80d3282f3a28df263bb1df95e1239a7650e5670fc2187919", + { 0xe88cdcd2, 0x33d99184, 0xa6fd260b, 0x8fca1b7f, 0x7687aee0 } } + , { "17e81f6ae8c2e5579d69dafa6e070e7111461552d314b691e7a3e7a4feb3fae418", + { 0x010def22, 0x850deb11, 0x68d525e8, 0xc84c2811, 0x6cb8a269 } } + , { "d15976b23a1d712ad28fad04d805f572026b54dd64961fda94d5355a0cc98620cf77", + { 0xaeaa40ba, 0x1717ed54, 0x39b1e6ea, 0x901b294b, 0xa500f9ad } } + , { "09fce4d434f6bd32a44e04b848ff50ec9f642a8a85b37a264dc73f130f22838443328f", + { 0xc6433791, 0x238795e3, 0x4f080a5f, 0x1f1723f0, 0x65463ca0 } } + , { "f17af27d776ec82a257d8d46d2b46b639462c56984cc1be9c1222eadb8b26594a25c709d", + { 0xe21e22b8, 0x9c1bb944, 0xa32932e6, 0xb2a2f20d, 0x491982c3 } } + , { "b13ce635d6f8758143ffb114f2f601cb20b6276951416a2f94fbf4ad081779d79f4f195b22", + { 0x575323a9, 0x661f5d28, 0x387964d2, 0xba6ab92c, 0x17d05a8a } } + , { "5498793f60916ff1c918dde572cdea76da8629ba4ead6d065de3dfb48de94d234cc1c5002910", + { 0xfeb44494, 0xaf72f245, 0xbfe68e86, 0xc4d7986d, 0x57c11db7 } } + , { "498a1e0b39fa49582ae688cd715c86fbaf8a81b8b11b4d1594c49c902d197c8ba8a621fd6e3be5", + { 0xcff2290b, 0x3648ba28, 0x31b98dde, 0x436a72f9, 0xebf51eee } } + , { "3a36ae71521f9af628b3e34dcb0d4513f84c78ee49f10416a98857150b8b15cb5c83afb4b570376e", + { 0x9b4efe9d, 0x27b96590, 0x5b0c3dab, 0x67b8d7c9, 0xebacd56c } } + , { "dcc76b40ae0ea3ba253e92ac50fcde791662c5b6c948538cffc2d95e9de99cac34dfca38910db2678f", + { 0xafedb0ff, 0x156205bc, 0xd831cbdb, 0xda43db8b, 0x0588c113 } } + , { "5b5ec6ec4fd3ad9c4906f65c747fd4233c11a1736b6b228b92e90cddabb0c7c2fcf9716d3fad261dff33", + { 0x8deb1e85, 0x8f88293a, 0x5e5e4d52, 0x1a34b2a4, 0xefa70fc4 } } + , { "df48a37b29b1d6de4e94717d60cdb4293fcf170bba388bddf7a9035a15d433f20fd697c3e4c8b8c5f590ab", + { 0x95cbdac0, 0xf74afa69, 0xcebd0e5c, 0x7defbc6f, 0xaf0cbeaf } } + , { "1f179b3b82250a65e1b0aee949e218e2f45c7a8dbfd6ba08de05c55acfc226b48c68d7f7057e5675cd96fcfc", + { 0xf0307bcb, 0x92842e5a, 0xe0cd4f4f, 0x14f3df7f, 0x877fbef2 } } + , { "ee3d72da3a44d971578972a8e6780ce64941267e0f7d0179b214fa97855e1790e888e09fbe3a70412176cb3b54", + { 0x7b13bb0d, 0xbf14964b, 0xd63b133a, 0xc85e2210, 0x0542ef55 } } + , { "d4d4c7843d312b30f610b3682254c8be96d5f6684503f8fbfbcd15774fc1b084d3741afb8d24aaa8ab9c104f7258", + { 0xc314d2b6, 0xcf439be6, 0x78d2a74e, 0x890d96cf, 0xac1c02ed } } + , { "32c094944f5936a190a0877fb9178a7bf60ceae36fd530671c5b38c5dbd5e6a6c0d615c2ac8ad04b213cc589541cf6", + { 0x4d0be361, 0xe410b47a, 0x9d67d8ce, 0x0bb6a8e0, 0x1c53c078 } } + , { "e5d3180c14bf27a5409fa12b104a8fd7e9639609bfde6ee82bbf9648be2546d29688a65e2e3f3da47a45ac14343c9c02", + { 0xe5353431, 0xffae097f, 0x675cbf49, 0x8869f6fb, 0xb6e1c9f2 } } + , { "e7b6e4b69f724327e41e1188a37f4fe38b1dba19cbf5a7311d6e32f1038e97ab506ee05aebebc1eed09fc0e357109818b9", + { 0xb8720a70, 0x68a085c0, 0x18ab1896, 0x1de2765a, 0xa6cd9ac4 } } + , { "bc880cb83b8ac68ef2fedc2da95e7677ce2aa18b0e2d8b322701f67af7d5e7a0d96e9e33326ccb7747cfff0852b961bfd475", + { 0xb0732181, 0x568543ba, 0x85f2b6da, 0x602b4b06, 0x5d9931aa } } + , { "235ea9c2ba7af25400f2e98a47a291b0bccdaad63faa2475721fda5510cc7dad814bce8dabb611790a6abe56030b798b75c944", + { 0x9c22674c, 0xf3222c3b, 0xa9216726, 0x94aafee4, 0xce67b96b } } + , { "07e3e29fed63104b8410f323b975fd9fba53f636af8c4e68a53fb202ca35dd9ee07cb169ec5186292e44c27e5696a967f5e67709", + { 0xd128335f, 0x4cecca90, 0x66cdae08, 0x958ce656, 0xff0b4cfc } } + , { "65d2a1dd60a517eb27bfbf530cf6a5458f9d5f4730058bd9814379547f34241822bf67e6335a6d8b5ed06abf8841884c636a25733f", + { 0x0b67c57a, 0xc578de88, 0xa2ae055c, 0xaeaec8bb, 0x9b0085a0 } } + , { "dcc86b3bd461615bab739d8daafac231c0f462e819ad29f9f14058f3ab5b75941d4241ea2f17ebb8a458831b37a9b16dead4a76a9b0e", + { 0xc766f912, 0xa89d4ccd, 0xa88e0cce, 0x6a713ef5, 0xf178b596 } } + , { "4627d54f0568dc126b62a8c35fb46a9ac5024400f2995e51635636e1afc4373dbb848eb32df23914230560b82477e9c3572647a7f2bb92", + { 0x9aa3925a, 0x9dcb177b, 0x15ccff9b, 0x78e70cf3, 0x44858779 } } + , { "ba531affd4381168ef24d8b275a84d9254c7f5cc55fded53aa8024b2c5c5c8aa7146fe1d1b83d62b70467e9a2e2cb67b3361830adbab28d7", + { 0x4811fa30, 0x042fc076, 0xacf37c8e, 0x2274d025, 0x307e5943 } } + , { "8764dcbcf89dcf4282eb644e3d568bdccb4b13508bfa7bfe0ffc05efd1390be22109969262992d377691eb4f77f3d59ea8466a74abf57b2ef4", + { 0x67430184, 0x50c97307, 0x61ee2b13, 0x0df9b91c, 0x1e118150 } } + , { "497d9df9ddb554f3d17870b1a31986c1be277bc44feff713544217a9f579623d18b5ffae306c25a45521d2759a72c0459b58957255ab592f3be4", + { 0x71ad4a19, 0xd37d92a5, 0xe6ef3694, 0xddbeb5aa, 0x61ada645 } } + , { "72c3c2e065aefa8d9f7a65229e818176eef05da83f835107ba90ec2e95472e73e538f783b416c04654ba8909f26a12db6e5c4e376b7615e4a25819", + { 0xa7d9dc68, 0xdacefb7d, 0x61161860, 0x48cb355c, 0xc548e11d } } + , { "7cc9894454d0055ab5069a33984e2f712bef7e3124960d33559f5f3b81906bb66fe64da13c153ca7f5cabc89667314c32c01036d12ecaf5f9a78de98", + { 0x142e429f, 0x0522ba5a, 0xbf5131fa, 0x81df82d3, 0x55b96909 } } + , { "74e8404d5a453c5f4d306f2cfa338ca65501c840ddab3fb82117933483afd6913c56aaf8a0a0a6b2a342fc3d9dc7599f4a850dfa15d06c61966d74ea59", + { 0xef72db70, 0xdcbcab99, 0x1e963797, 0x6c6faf00, 0xd22caae9 } } + , { "46fe5ed326c8fe376fcc92dc9e2714e2240d3253b105adfbb256ff7a19bc40975c604ad7c0071c4fd78a7cb64786e1bece548fa4833c04065fe593f6fb10", + { 0xf220a745, 0x7f4588d6, 0x39dc2140, 0x7c942e98, 0x43f8e26b } } + , { "836dfa2524d621cf07c3d2908835de859e549d35030433c796b81272fd8bc0348e8ddbc7705a5ad1fdf2155b6bc48884ac0cd376925f069a37849c089c8645", + { 0xddd2117b, 0x6e309c23, 0x3ede85f9, 0x62a0c2fc, 0x215e5c69 } } + , { "7e3a4c325cb9c52b88387f93d01ae86d42098f5efa7f9457388b5e74b6d28b2438d42d8b64703324d4aa25ab6aad153ae30cd2b2af4d5e5c00a8a2d0220c6116", + { 0xa3054427, 0xcdb13f16, 0x4a610b34, 0x8702724c, 0x808a0dcc } } + }; + + char const xdigits[17] = "0123456789abcdef"; + char const*const xdigits_end = xdigits+16; + + for (std::size_t i=0; i!=sizeof(cases)/sizeof(cases[0]); ++i) { + test_case const& tc = cases[i]; + + boost::uuids::detail::sha1 sha; + std::size_t message_length = std::strlen(tc.message); + BOOST_TEST_EQ(message_length % 2, 0u); + + for (std::size_t b=0; b(std::distance(&xdigits[0], f)); + + c = tc.message[b+1]; + f = std::find(xdigits, xdigits_end, c); + BOOST_TEST_NE(f, xdigits_end); + + byte <<= 4; + byte |= static_cast(std::distance(&xdigits[0], f)); + + sha.process_byte(byte); + } + + unsigned int digest[5]; + sha.get_digest(digest); + + BOOST_TEST_SHA1_DIGEST(digest, tc.digest); + } +} + +// test long strings of 'a's +void test_long() +{ + + // test 1 million 'a's + struct test_case + { + unsigned int count; + unsigned int digest[5]; + }; + test_case cases[] = + { { 1000000, { 0x34aa973c, 0xd4c4daa4, 0xf61eeb2b, 0xdbad2731, 0x6534016f } } + , { 1000000000, { 0xd0f3e4f2, 0xf31c665a, 0xbbd8f518, 0xe848d5cb, 0x80ca78f7 } } + //, { 2000000000, { 0xda19be1b, 0x5ec3bc13, 0xda5533bd, 0x0c225a2f, 0x38da50ed } } + //, { 2147483647, { 0x1e5b490b, 0x10255e37, 0xfd96d096, 0x4f2fbfb9, 0x1ed47536 } } + //, { 4294967295 /*2^32 - 1*/, { 0xd84b866e, 0x70f6348f, 0xb0ddc21f, 0x373fe956, 0x1bf1005d } } + }; + + for (size_t iCase=0; iCase +#include +#include +#include +#include +#include + +int main(int, char*[]) +{ + using namespace boost::uuids; + + uuid nil_uuid = {{0}}; + BOOST_TEST_EQ(nil_uuid.is_nil(), true); + + string_generator gen; + uuid u = gen("00000000-0000-0000-0000-000000000000"); + BOOST_TEST_EQ(u, nil_uuid); + BOOST_TEST_EQ(u.is_nil(), true); + + const uuid u_increasing = {{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }}; + const uuid u_decreasing = {{ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }}; + + u = gen("0123456789abcdef0123456789ABCDEF"); + BOOST_TEST_EQ(u, u_increasing); + + u = gen("{0123456789abcdef0123456789ABCDEF}"); + BOOST_TEST_EQ(u, u_increasing); + + u = gen("{01234567-89AB-CDEF-0123-456789abcdef}"); + BOOST_TEST_EQ(u, u_increasing); + + u = gen("01234567-89AB-CDEF-0123-456789abcdef"); + BOOST_TEST_EQ(u, u_increasing); + + u = gen(std::string("fedcba98-7654-3210-fedc-ba9876543210")); + BOOST_TEST_EQ(u, u_decreasing); + +#ifndef BOOST_NO_STD_WSTRING + u = gen(L"fedcba98-7654-3210-fedc-ba9876543210"); + BOOST_TEST_EQ(u, u_decreasing); + + u = gen(std::wstring(L"01234567-89ab-cdef-0123-456789abcdef")); + BOOST_TEST_EQ(u, u_increasing); +#endif //BOOST_NO_STD_WSTRING + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_tagging.cpp b/tools/boost_1_65_1/libs/uuid/test/test_tagging.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49264fa2a2c9965f1452590a74023a05437e08db --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_tagging.cpp @@ -0,0 +1,80 @@ +// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_tagging.cpp -------------------------------// + +#include +#include +#include + +class object +{ +public: + object() + : tag(boost::uuids::random_generator()()) + , state(0) + {} + + explicit object(int state) + : tag(boost::uuids::random_generator()()) + , state(state) + {} + + object(object const& rhs) + : tag(rhs.tag) + , state(rhs.state) + {} + + bool operator==(object const& rhs) const { + return tag == rhs.tag; + } + bool operator!=(object const& rhs) const { + return !(operator==(rhs)); + } + + object& operator=(object const& rhs) { + tag = rhs.tag; + state = rhs.state; + return *this; + } + + int get_state() const { return state; } + void set_state(int new_state) { state = new_state; } + +private: + boost::uuids::uuid tag; + + int state; +}; + +template +std::basic_ostream& operator<<(std::basic_ostream& os, object const& o) +{ + os << o.get_state(); + return os; +} + +int main(int, char*[]) +{ + object o1(1); + + object o2 = o1; + BOOST_TEST_EQ(o1, o2); + + o2.set_state(2); + BOOST_TEST_EQ(o1, o2); + + object o3; + o3.set_state(3); + + BOOST_TEST_NE(o1, o3); + BOOST_TEST_NE(o2, o3); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_uuid.cpp b/tools/boost_1_65_1/libs/uuid/test/test_uuid.cpp new file mode 100644 index 0000000000000000000000000000000000000000..95edcf231301218b09af134d8ea431fb187a93b2 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_uuid.cpp @@ -0,0 +1,245 @@ +// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_uuid.cpp -------------------------------// + +#include +#include +#include +#include +#include +#include + +void test_uuid_equal_array(char const * file, int line, char const * function, + boost::uuids::uuid const& lhs, const unsigned char (&rhs)[16]) +{ + for (size_t i=0; i<16; i++) { + if ( *(lhs.begin()+i) != rhs[i]) { + std::cerr << file << "(" << line << "): uuid " << lhs << " not equal " << "{"; + for (size_t j=0; j<16; j++) { + if (j != 0) { + std::cerr << " "; + } + std::cerr << std::hex << (int)rhs[j]; + } + std::cerr << "} in function '" << function << "'" << std::endl; + ++boost::detail::test_errors(); + return; + } + } +} + + +#define BOOST_TEST_UUID(lhs, rhs) ( test_uuid_equal_array(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, lhs, rhs) ) + +int main(int, char*[]) +{ + using namespace boost::uuids; + + // uuid::static_size + BOOST_TEST_EQ(uuid::static_size(), 16U); + + { // uuid::operator=() + uuid u1 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + uuid u2 = u1; + BOOST_TEST_EQ(u2, u1); + } + + { // uuid::begin(), end() + uuid u = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + unsigned char values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + BOOST_TEST_UUID(u, values); + } + + { // uuid::begin() const, end() const + const uuid u = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + unsigned char values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + BOOST_TEST_UUID(u, values); + } + + { // uuid::size() + uuid u; // uninitialized + BOOST_TEST_EQ(u.size(), 16U); + } + + { // uuid::is_nil() + uuid u1 = {{0}}; + BOOST_TEST_EQ(u1.is_nil(), true); + + uuid u2 = {{1,0}}; + BOOST_TEST_EQ(u2.is_nil(), false); + } + + { // uuid::variant() + struct Test { + unsigned char octet7; + boost::uuids::uuid::variant_type variant; + }; + const Test tests[] = + { { 0x00, boost::uuids::uuid::variant_ncs } + , { 0x10, boost::uuids::uuid::variant_ncs } + , { 0x20, boost::uuids::uuid::variant_ncs } + , { 0x30, boost::uuids::uuid::variant_ncs } + , { 0x40, boost::uuids::uuid::variant_ncs } + , { 0x50, boost::uuids::uuid::variant_ncs } + , { 0x60, boost::uuids::uuid::variant_ncs } + , { 0x70, boost::uuids::uuid::variant_ncs } + , { 0x80, boost::uuids::uuid::variant_rfc_4122 } + , { 0x90, boost::uuids::uuid::variant_rfc_4122 } + , { 0xa0, boost::uuids::uuid::variant_rfc_4122 } + , { 0xb0, boost::uuids::uuid::variant_rfc_4122 } + , { 0xc0, boost::uuids::uuid::variant_microsoft } + , { 0xd0, boost::uuids::uuid::variant_microsoft } + , { 0xe0, boost::uuids::uuid::variant_future } + , { 0xf0, boost::uuids::uuid::variant_future } + }; + for (size_t i=0; i= u1); + BOOST_TEST(u3 >= u1); + + BOOST_TEST(u3 >= u3); + BOOST_TEST(u2 >= u1); + BOOST_TEST(u3 >= u1); + } + + { // ticket 10510 + // the uuids in the report + uuid u6 = {{0x14,0x5c,0xfc,0x95,0x80,0x50,0x45,0x5a,0x83,0x82,0x44,0xca,0x57,0xc1,0x48,0x3b}}; + uuid u7 = {{0x14,0x5c,0xfc,0x95,0x80,0x50,0x45,0x5a,0x83,0x82,0x44,0xca,0x57,0xc1,0x48,0x3c}}; + + // simple uuids to reproduce problem + uuid u8 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}; + uuid u9 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2}}; + uuid u10 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254}}; + uuid u11 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255}}; + + // some additional uuids for testing boundary cases + uuid u12 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}}; + uuid u13 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,2}}; + uuid u14 = {{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}; + uuid u15 = {{255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255}}; + + BOOST_TEST(u6 < u7); + BOOST_TEST(!(u7 < u6)); + + BOOST_TEST(u8 < u9); + BOOST_TEST(!(u9 < u8)); + BOOST_TEST(u8 < u10); + BOOST_TEST(!(u10 < u8)); + BOOST_TEST(u8 < u11); + BOOST_TEST(!(u11 < u8)); + + BOOST_TEST(u9 < u10); + BOOST_TEST(!(u10 < u9)); + BOOST_TEST(u9 < u11); + BOOST_TEST(!(u11 < u9)); + + BOOST_TEST(u10 < u11); + BOOST_TEST(!(u11 < u10)); + + BOOST_TEST(u12 < u13); + BOOST_TEST(!(u13 < u12)); + BOOST_TEST(u14 < u15); + BOOST_TEST(!(u15 < u14)); + } + + { // test hash + uuid u1 = {{0}}; + uuid u2 = {{1,0}}; + uuid u3 = {{255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255}}; + + boost::hash uuid_hasher; + + BOOST_TEST_NE(uuid_hasher(u1), uuid_hasher(u2)); + BOOST_TEST_NE(uuid_hasher(u1), uuid_hasher(u3)); + BOOST_TEST_NE(uuid_hasher(u2), uuid_hasher(u3)); + } + + { // test is_pod + BOOST_TEST_EQ(boost::is_pod::value, true); + } + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_uuid_class.cpp b/tools/boost_1_65_1/libs/uuid/test/test_uuid_class.cpp new file mode 100644 index 0000000000000000000000000000000000000000..63b25e2d970d6c158b718568f6047f67c67b98ec --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_uuid_class.cpp @@ -0,0 +1,42 @@ +// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_uuid_class.cpp -------------------------------// + +#include +#include +#include + +#include + +class uuid_class : public boost::uuids::uuid +{ +public: + uuid_class() + : boost::uuids::uuid(boost::uuids::random_generator()()) + {} + + explicit uuid_class(boost::uuids::uuid const& u) + : boost::uuids::uuid(u) + {} +}; + +int main(int, char*[]) +{ + uuid_class u1; + uuid_class u2; + BOOST_TEST_NE(u1, u2); + BOOST_TEST_EQ(u1.is_nil(), false); + BOOST_TEST_EQ(u2.is_nil(), false); + + u2 = u1; + BOOST_TEST_EQ(u1, u2); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_uuid_in_map.cpp b/tools/boost_1_65_1/libs/uuid/test/test_uuid_in_map.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f2f3a07e5f5c1002a081f2c0b7fe50806492ad3 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_uuid_in_map.cpp @@ -0,0 +1,36 @@ +// (C) Copyright Andy Tompkins 2011. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_uuid_in_map.cpp -------------------------------// + +#include +#include +#include + +#include + +int main(int, char*[]) +{ + boost::uuids::random_generator gen; + + boost::uuids::uuid u1 = gen(); + boost::uuids::uuid u2 = gen(); + boost::uuids::uuid u3 = gen(); + + std::map uuid_map; + uuid_map[u1] = 1; + uuid_map[u2] = 2; + uuid_map[u3] = 3; + + BOOST_TEST_EQ(1, uuid_map[u1]); + BOOST_TEST_EQ(2, uuid_map[u2]); + BOOST_TEST_EQ(3, uuid_map[u3]); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_uuid_no_simd.cpp b/tools/boost_1_65_1/libs/uuid/test/test_uuid_no_simd.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0220302361e102408af6fa515075337f08d0e107 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_uuid_no_simd.cpp @@ -0,0 +1,153 @@ +// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// libs/uuid/test/test_uuid_no_simd.cpp -------------------------------// + +// This test is a subset of libs/uuid/test/test_uuid.cpp, compiled without any +// SIMD optimizations. The test specifically verifies generic implementations +// of the routines. + +#define BOOST_UUID_NO_SIMD + +#include +#include +#include +#include +#include + +void test_uuid_equal_array(char const * file, int line, char const * function, + boost::uuids::uuid const& lhs, const unsigned char (&rhs)[16]) +{ + for (size_t i=0; i<16; i++) { + if ( *(lhs.begin()+i) != rhs[i]) { + std::cerr << file << "(" << line << "): uuid " << lhs << " not equal " << "{"; + for (size_t j=0; j<16; j++) { + if (j != 0) { + std::cerr << " "; + } + std::cerr << std::hex << (int)rhs[j]; + } + std::cerr << "} in function '" << function << "'" << std::endl; + ++boost::detail::test_errors(); + return; + } + } +} + + +#define BOOST_TEST_UUID(lhs, rhs) ( test_uuid_equal_array(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, lhs, rhs) ) + + +int main(int, char*[]) +{ + using namespace boost::uuids; + + { // uuid::operator=() + uuid u1 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + uuid u2 = u1; + BOOST_TEST_EQ(u2, u1); + } + + { // uuid::is_nil() + uuid u1 = {{0}}; + BOOST_TEST_EQ(u1.is_nil(), true); + + uuid u2 = {{1,0}}; + BOOST_TEST_EQ(u2.is_nil(), false); + } + + { // uuid::swap(), swap() + uuid u1 = {{0}}; + uuid u2 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + u1.swap(u2); + + unsigned char values1[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + unsigned char values2[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + BOOST_TEST_UUID(u1, values2); + BOOST_TEST_UUID(u2, values1); + + swap(u1, u2); + BOOST_TEST_UUID(u1, values1); + BOOST_TEST_UUID(u2, values2); + } + + { // test comparsion + uuid u1 = {{0}}; + uuid u2 = {{1,0}}; + uuid u3 = {{255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255}}; + uuid u4 = {{0,1,0}}; + uuid u5 = {{0,255,0}}; + + BOOST_TEST_EQ(u1, u1); + + BOOST_TEST_NE(u1, u2); + + BOOST_TEST(u1 < u2); + BOOST_TEST(u2 < u3); + BOOST_TEST(u1 < u4); + BOOST_TEST(u1 < u5); + BOOST_TEST(u4 < u5); + BOOST_TEST(u4 < u2); + BOOST_TEST(u5 < u2); + + BOOST_TEST(u1 <= u1); + BOOST_TEST(u1 <= u2); + BOOST_TEST(u2 <= u3); + + BOOST_TEST(u2 >= u1); + BOOST_TEST(u3 >= u1); + + BOOST_TEST(u3 >= u3); + BOOST_TEST(u2 >= u1); + BOOST_TEST(u3 >= u1); + } + + { // ticket 10510 + // the uuids in the report + uuid u6 = {{0x14,0x5c,0xfc,0x95,0x80,0x50,0x45,0x5a,0x83,0x82,0x44,0xca,0x57,0xc1,0x48,0x3b}}; + uuid u7 = {{0x14,0x5c,0xfc,0x95,0x80,0x50,0x45,0x5a,0x83,0x82,0x44,0xca,0x57,0xc1,0x48,0x3c}}; + + // simple uuids to reproduce problem + uuid u8 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}; + uuid u9 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2}}; + uuid u10 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254}}; + uuid u11 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255}}; + + // some additional uuids for testing boundary cases + uuid u12 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}}; + uuid u13 = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,2}}; + uuid u14 = {{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}; + uuid u15 = {{255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255}}; + + BOOST_TEST(u6 < u7); + BOOST_TEST(!(u7 < u6)); + + BOOST_TEST(u8 < u9); + BOOST_TEST(!(u9 < u8)); + BOOST_TEST(u8 < u10); + BOOST_TEST(!(u10 < u8)); + BOOST_TEST(u8 < u11); + BOOST_TEST(!(u11 < u8)); + + BOOST_TEST(u9 < u10); + BOOST_TEST(!(u10 < u9)); + BOOST_TEST(u9 < u11); + BOOST_TEST(!(u11 < u9)); + + BOOST_TEST(u10 < u11); + BOOST_TEST(!(u11 < u10)); + + BOOST_TEST(u12 < u13); + BOOST_TEST(!(u13 < u12)); + BOOST_TEST(u14 < u15); + BOOST_TEST(!(u15 < u14)); + } + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/test/test_wserialization.cpp b/tools/boost_1_65_1/libs/uuid/test/test_wserialization.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dacc51c3daf0fab22948499b73e01e1388603469 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/test/test_wserialization.cpp @@ -0,0 +1,71 @@ +// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Purpose to test serializing uuids with wide stream archives + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +template +void test_archive() +{ + using namespace std; + using namespace boost::uuids; + + OStringStreamType o_stream; + + uuid u1 = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}}; + + uuid u2; + + // save + { + OArchiveType oa(o_stream); + + oa << BOOST_SERIALIZATION_NVP(u1); + } + + //wcout << "stream:" << o_stream.str() << "\n\n"; + + // load + { + IStringStreamType i_stream(o_stream.str()); + IArchiveType ia(i_stream); + + ia >> BOOST_SERIALIZATION_NVP(u2); + } + + BOOST_TEST_EQ(u1, u2); +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + using namespace std; + using namespace boost::archive; + + test_archive(); + test_archive(); + test_archive(); + + return boost::report_errors(); +} diff --git a/tools/boost_1_65_1/libs/uuid/uuid.html b/tools/boost_1_65_1/libs/uuid/uuid.html new file mode 100644 index 0000000000000000000000000000000000000000..03f4e7ca76af21fb73ab3959193f448c9c16df72 --- /dev/null +++ b/tools/boost_1_65_1/libs/uuid/uuid.html @@ -0,0 +1,689 @@ + + + +Uuid Library + + + +

BoostUuid

+ +

Contents

+ +
    +
  1. Introduction
  2. +
  3. Configuration
  4. +
  5. Examples
  6. + Reference + +
  7. Design notes
  8. +
  9. History and Acknowledgements
  10. +
+ +

Introduction

+

+A UUID, or Universally unique identifier, is intended to uniquely identify +information in a distributed environment without significant central +coordination. It can be used to tag objects with very short lifetimes, or +to reliably identify very persistent objects across a network. +

+UUIDs have many applications. Some examples follow: Databases may use UUIDs +to identify rows or records in order to ensure that they are unique across +different databases, or for publication/subscription services. Network messages +may be identified with a UUID to ensure that different parts of a message are put +back together again. Distributed computing may use UUIDs to identify a remote +procedure call. Transactions and classes involved in serialization may be +identified by UUIDs. Microsoft's component object model (COM) uses UUIDs to +distinguish different software component interfaces. UUIDs are inserted into +documents from Microsoft Office programs. UUIDs identify audio or +video streams in the Advanced Systems Format (ASF). UUIDs are also a basis +for OIDs (object identifiers), and URNs (uniform resource name). + +

+An attractive feature of UUIDs when compared to alternatives is their relative +small size, of 128-bits, or 16-bytes. Another is that the creation of UUIDs +does not require a centralized authority. + +

When UUIDs are generated by one of the defined +mechanisms, they are either guaranteed to be unique, different from all other +generated UUIDs (that is, it has never been generated before and it will +never be generated again), or it is extremely likely to be unique (depending +on the mechanism). + +

Configuration

+ +

+The library does not require building or any special configuration to be used. +However, there are a few options that can be enabled by defining macros prior to +including library headers. These macros are summarized in the following table. + +

+ + + + + + + + + + + + + + + + +
MacroDescription
BOOST_UUID_NO_SIMDIf defined, disables any optimizations for SIMD-enabled processors. Generic versions of algorithms will be used instead. This may result in suboptimal performance. By default, optimized algorithms are used, when the library is able to detect the availability of SIMD extensions at compile time.
BOOST_UUID_USE_SSE2If defined, enables optimizations for SSE2 exstensions available in modern x86 processors.
BOOST_UUID_USE_SSE3If defined, enables optimizations for SSE3 exstensions available in modern x86 processors.
BOOST_UUID_USE_SSE41If defined, enables optimizations for SSE4.1 exstensions available in modern x86 processors.
+ +

+By default the library attempts to detect the availability of SIMD extensions in the target CPU at compile time and automatically defines the appropriate macros if succeeded. The BOOST_UUID_USE_SSE* macros can be defined by users, if auto-detection fails and it is known that the target CPU will have the extension. Do not enable these extensions unless you're certain that they will always be available on any machine that will run your program. The library performs no run time checks, so if an extension is missing, the program will likely crash. Note that enabling more advanced extensions implies that more basic ones are also available. + +

Examples

+

Tagging

+
+// example of tagging an object with a uuid
+// see boost/libs/uuid/test/test_tagging.cpp
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+
+class object
+{
+public:
+    object()
+        : tag(boost::uuids::random_generator()())
+        , state(0)
+    {}
+
+    explicit object(int state)
+        : tag(boost::uuids::random_generator()())
+        , state(state)
+    {}
+
+    object(object const& rhs)
+        : tag(rhs.tag)
+        , state(rhs.state)
+    {}
+
+    bool operator==(object const& rhs) const {
+        return tag == rhs.tag;
+    }
+
+    object& operator=(object const& rhs) {
+        tag = rhs.tag;
+        state = rhs.state;
+    }
+
+    int get_state() const { return state; }
+    void set_state(int new_state) { state = new_state; }
+
+private:
+    boost::uuids::uuid tag;
+
+    int state;
+};
+
+object o1(1);
+object o2 = o1;
+o2.set_state(2);
+assert(o1 == o2);
+
+object o3(3);
+assert(o1 != o3);
+assert(o2 != o3);
+
+ +

POD Efficiencies

+

+This library implements a UUID as a POD allowing a UUID +to be used in the most efficient ways, including using memcpy, +and aggregate initializers. A drawback is that a POD can +not have any constructors, and thus declaring a UUID will not +initialize it to a value generated by one of the defined +mechanisms. But a class based on a UUID can be defined +that does initialize itself to a value generated by one of +the defined mechanisms. +

+Note that boost::is_pod is specialized for boost::uuids::uuid +and depends on Boost.TypeTraits. +Define BOOST_UUID_NO_TYPE_TRAITS before including boost/uuid/uuid.hpp +to remove the dependency on Boost.TypeTraits. +

+// example using memcpy and aggregate initializers
+// example of a class uuid see boost/libs/uuid/test/test_uuid_class.cpp
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+
+{ // example using memcpy
+    unsigned char uuid_data[16];
+    // fill uuid_data
+
+    boost::uuids::uuid u;
+
+    memcpy(&u, uuid_data, 16);
+}
+
+{ // example using aggregate initializers
+    boost::uuids::uuid u =
+    { 0x12 ,0x34, 0x56, 0x78
+    , 0x90, 0xab
+    , 0xcd, 0xef
+    , 0x12, 0x34
+    , 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef
+    };
+}
+
+// example of creating a uuid class that
+// initializes the uuid in the constructor
+// using a defined mechanism
+
+class uuid_class : public boost::uuids::uuid
+{
+public:
+    uuid_class()
+        : boost::uuids::uuid(boost::uuids::random_generator()())
+    {}
+
+    explicit uuid_class(boost::uuids::uuid const& u)
+        : boost::uuids::uuid(u)
+    {}
+
+    operator boost::uuids::uuid() {
+        return static_cast<boost::uuids::uuid&>(*this);
+    }
+
+    operator boost::uuids::uuid() const {
+        return static_cast<boost::uuids::uuid const&>(*this);
+    }
+};
+
+uuid_class u1;
+uuid_class u2;
+
+assert(u1 != u2);
+
+ +

Byte Extraction

+

It is sometimes useful to get at the 16 bytes of a uuid directly. +Typical use is as follows: + +

+boost::uuids::uuid u;
+std::vector<char> v(u.size());
+std::copy(u.begin(), u.end(), v.begin());
+
+ +

Note: boost::uuids::uuid::size() always returns 16. + +

Reference

+

boost/uuid/uuid.hpp

+

Synopsis

+
+namespace boost {
+namespace uuids {
+
+class uuid {
+public:
+    typedef uint8_t value_type;
+    typedef uint8_t& reference;
+    typedef uint8_t const& const_reference;
+    typedef uint8_t* iterator;
+    typedef uint8_t const* const_iterator;
+    typedef std::size_t size_type;
+    typedef std::ptrdiff_t difference_type;
+
+    static constexpr size_type static_size() noexcept;
+
+    // iteration
+    iterator begin() noexcept;
+    iterator end() noexcept;
+    const_iterator begin() const noexcept;
+    const_iterator end() const noexcept;
+
+    constexpr size_type size() const noexcept;
+
+    bool is_nil() const noexcept;
+
+    enum variant_type {
+        variant_ncs, // NCS backward compatibility
+        variant_rfc_4122, // defined in RFC 4122 document
+        variant_microsoft, // Microsoft Corporation backward compatibility
+        variant_future // future definition
+    };
+    variant_type variant() const noexcept;
+
+    enum version_type {
+        version_unknown = -1,
+        version_time_based = 1,
+        version_dce_security = 2,
+        version_name_based_md5 = 3,
+        version_random_number_based = 4,
+        version_name_based_sha1 = 5
+    };
+    version_type version() const noexcept;
+
+    // Swap function
+    void swap(uuid& rhs) noexcept;
+
+    uint8_t data[static_size()];
+};
+
+// standard operators
+bool operator==(uuid const& lhs, uuid const& rhs) noexcept;
+bool operator!=(uuid const& lhs, uuid const& rhs) noexcept;
+bool operator<(uuid const& lhs, uuid const& rhs) noexcept;
+bool operator>(uuid const& lhs, uuid const& rhs) noexcept;
+bool operator<=(uuid const& lhs, uuid const& rhs) noexcept;
+bool operator>=(uuid const& lhs, uuid const& rhs) noexcept;
+
+void swap(uuid& lhs, uuid& rhs) noexcept;
+
+std::size_t hash_value(uuid const& u) noexcept;
+
+}} // namespace boost::uuids
+
+ +

Size

+ +

The size of a uuid (in bytes) can be obtained either by +calling the function boost::uuids::uuid::size() or by +calling the static function boost::uuids::uuid::static_size(), +both always return 16. +

+    boost::uuids::uuid u;
+    assert(16 == u.size());
+    assert(16 == boost::uuids::uuid::static_size());
+
+ +

Iteration

+ +

Both iterators and constant iterators are provided. +

+    boost::uuids::uuid u;
+    for (boost::uuids::uuid::const_iterator it=u.begin(); it!=u.end(); ++it) {
+        boost::uuids::uuid::value_type v = *it;
+    }
+    for (boost::uuids::uuid::iterator it=u.begin(); it!=u.end(); ++it) {
+        *it = 0;
+    }
+
+ +

Nil uuid

+

The function, boost::uuids::uuid::is_nil() returns true if and +only if the uuid is equal to {00000000-0000-0000-0000-000000000000}. +

+ +

Variant

+

Three bits of a uuid determine the variant.

+
+    boost::uuids::uuid u;
+    boost::uuids::uuid::variant_type v = u.variant();
+
+ +

Version

+

Four bits of a uuid determine the variant, that is the mechanism +used to generate the uuid. +

+
+    boost::uuids::uuid u;
+    boost::uuids::uuid::version_type v = u.version();
+
+ +

Swap

+

Both boost::uuids::uuid::swap() and boost::uuids::swap() +are provided. +

+
+    boost::uuids::uuid u1, u2;
+    u1.swap(u2);
+    swap(u1, u2);
+
+ +

Operators

+

+All of the standard numeric operators are defined for the uuid +class. These include: +

+    operator==
+    operator!=
+    operator<
+    operator>
+    operator<=
+    operator>=
+
+ +

Hash Function

+

+This function allows uuids to be used with +boost::hash + +

+boost::hash<boost::uuids::uuid> uuid_hasher;
+std::size_t uuid_hash_value = uuid_hasher(boost::uuids::uuid());
+
+ +

boost/uuid/uuid_generators.hpp

+

Synopsis

+This file includes all the uuid generators for convenience. +
+#include <boost/uuid/nil_generator.hpp>
+#include <boost/uuid/string_generator.hpp>
+#include <boost/uuid/name_generator.hpp>
+#include <boost/uuid/random_generator.hpp>
+
+ +

boost/uuid/nil_generator.hpp

+

Synopsis

+
+namespace boost {
+namespace uuids {
+
+struct nil_generator {
+    typedef uuid result_type;
+    
+    uuid operator()() const;
+};
+uuid nil_uuid();
+
+}} //namespace boost::uuids
+
+ +

Nil Generator

+

The boost::uuids::nil_generator class always generates a nil uuid. +

+boost::uuids::nil_generator gen;
+boost::uuids::uuid u = gen();
+assert(u.is_nil() == true);
+
+// or for convenience
+boost::uuids::uuid u = boost::uuids::nil_uuid();
+assert(u.is_nil() == true);
+
+ +

boost/uuid/string_generator.hpp

+

Synopsis

+ +
+namespace boost {
+namespace uuids {
+
+struct string_generator {
+    typedef uuid result_type;
+
+    template <typename ch, typename char_traits, typename alloc>
+        uuid operator()(std::basic_string<ch, char_traits, alloc> const& s) const;
+};
+
+}} //namespace boost::uuids
+
+ +

String Generator

+

The boost::uuids::string_generator class generates a uuid from a string. +

+boost::uuids::string_generator gen;
+boost::uuids::uuid u1 = gen("{01234567-89ab-cdef-0123-456789abcdef}");
+boost::uuids::uuid u2 = gen(L"01234567-89ab-cdef-0123-456789abcdef");
+boost::uuids::uuid u3 = gen(std::string("0123456789abcdef0123456789abcdef"));
+boost::uuids::uuid u4 = gen(std::wstring(L"01234567-89ab-cdef-0123-456789abcdef"));
+
+ +

boost/uuid/name_generator.hpp

+

Synopsis

+ +
+namespace boost {
+namespace uuids {
+
+class name_generator {
+public:
+    typedef uuid result_type;
+    
+    explicit name_generator(uuid const& namespace_uuid);
+
+    uuid operator()(const char* name) const;
+    uuid operator()(const wchar_t* name) const;
+    tempate <typename ch, typename char_traits, typename alloc>
+        uuid operator()(std::basic_string<ch, char_traits, alloc> const& name) const;
+    uuid operator()(void const* buffer, std::size_t byte_count) const;
+};
+
+}} //namespace boost::uuids
+
+ +

Name Generator

+

+The boost::uuids::name_generator class generates a name based uuid from a +namespace uuid and a name. +

+boost::uuids::uuid dns_namespace_uuid; // initialize to {6ba7b810-9dad-11d1-80b4-00c04fd430c8}
+
+boost::uuids::name_generator gen(dns_namespace_uuid);
+boost::uuids::uuid u = gen("boost.org");
+
+ +

boost/uuid/random_generator.hpp

+

Synopsis

+ +
+namespace boost {
+namespace uuids {
+
+template <typename UniformRandomNumberGenerator>
+class basic_random_generator {
+public:
+    typedef uuid result_type;
+    
+    basic_random_generator();
+    explicit basic_random_generator(UniformRandomNumberGenerator& gen);
+    explicit basic_random_generator(UniformRandomNumberGenerator* pGen);
+    
+    uuid operator()();
+};
+typedef basic_random_generator<mt19937> random_generator;
+
+}} // namespace boost::uuids
+
+ +

Random Generator

+

+The boost::uuids::basic_random_generator class generates a random number +based uuid from a random number generator (one that conforms to the +UniformRandomNumberGenerator +concept). +

+//default construct the random number generator and seed it
+boost::uuids::basic_random_generator<boost::mt19937> gen;
+boost::uuids::uuid u = gen();
+
+//for convenience boost::uuids::random_generator
+//is equivalent to boost::uuids::basic_random_generator<boost::mt19937>
+boost::uuids::random_generator gen;
+boost::uuids::uuid u = gen();
+
+//use an existing random number generator
+//pass either a reference or a pointer to the random number generator
+boost::mt19937 ran;
+boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+boost::uuids::uuid u = gen();
+
+ +

boost/uuid/uuid_io.hpp

+

Synopsis

+
+namespace boost {
+namespace uuids {
+
+template <typename ch, typename char_traits>
+    std::basic_ostream<ch, char_traits>& operator<<(std::basic_ostream<ch, char_traits> &os, uuid const& u);
+
+template <typename ch, typename char_traits>
+    std::basic_istream<ch, char_traits>& operator>>(std::basic_istream<ch, char_traits> &is, uuid &u);
+    
+std::string to_string(uuid const& u);
+std::wstring to_wstring(uuid const& u);
+
+}} // namespace boost::uuids
+
+ +

Stream Operators

+

+The standard input and output stream operators << and >> +are provided by including boost/uuid/uuid_io.hpp. +The string representation of a uuid is hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh +where h is a hexidecimal digit. +

+boost::uuids::uuid u1; // initialize uuid
+
+std::stringstream ss;
+ss << u1;
+
+boost::uuids::uuid u2;
+ss >> u2;
+
+assert(u1, u2);
+
+ +

+One can also use boost::lexical_cast. +

+boost::uuids::uuid u1; // initialize uuid
+
+std::string s = boost::lexical_cast<std::string>(u);
+boost::uuids::uuid u2 = boost::lexical_cast<boost::uuids::uuid>(s);
+
+assert(u1 == u2);
+
+ +

To String

+

+The functions to_string and to_wstring are provided as a +convenience to convert a uuid to a string. They are also likely faster than +the stream operators or using boost::lexical_cast. +

+boost::uuids::uuid u; // initialize uuid
+
+std::string s1 = to_string(u);
+
+std::wstring s2 = to_wstring(u);
+
+ +

boost/uuid/uuid_serialize.hpp

+

Synopsis

+
+namespace boost {
+namespace uuids {
+
+BOOST_CLASS_IMPLEMENTATION(boost::uuids::uuid, boost::serialization::primitive_type)
+
+}} // namespace boost::uuids
+
+ +

Serialization

+

+Serialization is accomplished with the +Boost Serialization library. A uuid is serialized as a + +primitive type, thus only the uuid value will be saved to/loaded from an archive. +

+Include boost/uuid/uuid_serialize.hpp to enable serialization for uuids. + +

Design notes

+

+The document, +http://www.itu.int/ITU-T/studygroups/com17/oid/X.667-E.pdf, was used to design +and implement the boost::uuids::uuid struct. + +

The boost::uuids::basic_random_generator class' default constructor +seeds the random number generator with a SHA-1 hash of a number of different +values including std::time(0), std::clock(), uninitialized +data, value return from new unsigned int, etc.. + +

Using Valgrind produces a number of false +positives with the default constructor of boost::uuids::basic_random_generator. +One solution is to suppress the errors as described in +Valgrind's documentation. +Another solution is to use a different constructor of boost::uuids::basic_random_generator +and explicitly pass in a random number generator. +

+boost::mt19937 ran;
+ran.seed(time(NULL)); // one should likely seed in a better way
+boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+boost::uuids::uuid u = gen();
+
+ +

The boost::uuids::name_generator class uses the SHA-1 hash function to +compute the uuid. + +

All functions are re-entrant. Classes are as thread-safe as an int. That is an +instance can not be shared between threads without proper synchronization. + +

History and Acknowledgements

+

+A number of people on the boost.org +mailing list provided useful comments and greatly helped to shape the library. + +

Revised  February 6, 2010

+ +
+

© Copyright Andy Tompkins, 2006

+

Distributed under the Boost Software +License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +www.boost.org/LICENSE_1_0.txt)

+ + diff --git a/tools/boost_1_65_1/libs/variant/README.md b/tools/boost_1_65_1/libs/variant/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1594a22136a865cb0b6069a57e6fdb339389554f --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/README.md @@ -0,0 +1,16 @@ +# [Boost.Variant](http://boost.org/libs/variant) +Boost.Variant, part of collection of the [Boost C++ Libraries](http://github.com/boostorg). It is a safe, generic, stack-based discriminated union container, offering a simple solution for manipulating an object from a heterogeneous set of types in a uniform manner. + +### Test results + +@ | Build | Tests coverage | More info +----------------|-------------- | -------------- |----------- +Develop branch: | [![Build Status](https://travis-ci.org/apolukhin/variant.svg?branch=develop)](https://travis-ci.org/apolukhin/variant) [![Build status](https://ci.appveyor.com/api/projects/status/o5hmsaj53v9vc624/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/variant/branch/develop) | [![Coverage Status](https://coveralls.io/repos/apolukhin/variant/badge.png?branch=develop)](https://coveralls.io/r/apolukhin/variant?branch=develop) | [details...](http://www.boost.org/development/tests/develop/developer/variant.html) +Master branch: | [![Build Status](https://travis-ci.org/apolukhin/variant.svg?branch=master)](https://travis-ci.org/apolukhin/variant) [![Build status](https://ci.appveyor.com/api/projects/status/o5hmsaj53v9vc624/branch/master?svg=true)](https://ci.appveyor.com/project/apolukhin/variant/branch/master) | [![Coverage Status](https://coveralls.io/repos/apolukhin/variant/badge.png?branch=master)](https://coveralls.io/r/apolukhin/variant?branch=master) | [details...](http://www.boost.org/development/tests/master/developer/variant.html) + + +[Open Issues](https://svn.boost.org/trac/boost/query?status=!closed&component=variant) + +### License + +Distributed under the [Boost Software License, Version 1.0](http://boost.org/LICENSE_1_0.txt). diff --git a/tools/boost_1_65_1/libs/variant/doc/Jamfile.v2 b/tools/boost_1_65_1/libs/variant/doc/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..1459b6b142aba62a0cb73e1ef2a7367fe9cc9ebd --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/Jamfile.v2 @@ -0,0 +1,29 @@ +# Boost.Variant Library doc Jamfile +# +# Copyright (C) 2003, Eric Friedman, Itay Maman. +# +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +project variant/doc ; +import boostbook : boostbook ; + +boostbook variant-doc + : + variant.xml + : + boost.root=../../../.. + pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html + ; + +############################################################################### +alias boostdoc + : variant.xml + : + : + : ; +explicit boostdoc ; +alias boostrelease ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/variant/doc/biblio.xml b/tools/boost_1_65_1/libs/variant/doc/biblio.xml new file mode 100644 index 0000000000000000000000000000000000000000..892ddca8d177337c9e10c5215eadb73cde9447d3 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/biblio.xml @@ -0,0 +1,118 @@ + + + +
+ References + + + [Abr00] + David Abrahams. + "Exception-Safety in Generic Components." + M. Jazayeri, R. Loos, D. Musser (eds.): + Generic Programming '98, Proc. of a Dagstuhl Seminar, Lecture Notes on Computer Science, Vol. 1766, pp. 69-79. + Springer-Verlag Berlin Heidelberg. + 2000. + + + [Abr01] + David Abrahams. + "Error and Exception Handling." + Boost technical article. + 2001-2003. + + + [Ale01a] + Andrei Alexandrescu. + "An Implementation of Discriminated Unions in C++." + OOPSLA 2001, Second Workshop on C++ Template Programming. + Tampa Bay, 14 October 2001. + + + [Ale01b] + Andrei Alexandrescu. + Modern C++ Design. + Addison-Wesley, C++ In-Depth series. + 2001. + + + [Ale02] + Andrei Alexandrescu. + "Generic<Programming>: Discriminated Unions" series: + Part 1, + Part 2, + Part 3. + C/C++ Users Journal. + 2002. + + + [Boo02] + Various Boost members. + "Proposal --- A type-safe union." + Boost public discussion. + 2002. + + + [C++98] + International Standard, Programming Languages – C++. + ISO/IEC:14882. + 1998. + + + [GoF95] + Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. + Design Patterns: Elements of Reusable Object-Oriented Software. + Addison-Wesley. + 1995. + + + [Gre02] + Douglas Gregor. + "BOOST_USER: variant." + Boost Wiki paper. + 2002. + + + [Gur02] + Aleksey Gurtovoy. + Boost Metaprogramming Library. + 2002. + + + [Hen01] + Kevlin Henney. + Boost Any Library. + 2001. + + + [MK02] + Paul Mensonides and Vesa Karvonen. + Boost Preprocessor Library. + 2002. + + + [MCD+01] + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, John Maddock, Jeremy Siek. + Boost Type Traits Library. + 2001. + + + [Sut00] + Herb Sutter. + Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions. + Addison-Wesley, C++ In-Depth series. + 2000. + + + [Wil02] + Anthony Williams. + Double-Storage Proposal. + 2002. + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/design.xml b/tools/boost_1_65_1/libs/variant/doc/design.xml new file mode 100644 index 0000000000000000000000000000000000000000..756a6bddebed8283f4b4de318dca96f6d79a1b4e --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/design.xml @@ -0,0 +1,310 @@ + + + +
+ Design Overview + + + +
+ "Never-Empty" Guarantee + +
+ The Guarantee + + All instances v of type + variant<T1,T2,...,TN> + guarantee that v has constructed content of one of the + types Ti, even if an operation on + v has previously failed. + + This implies that variant may be viewed precisely as + a union of exactly its bounded types. This + "never-empty" property insulates the user from the + possibility of undefined variant content and the + significant additional complexity-of-use attendant with such a + possibility. +
+ +
+ The Implementation Problem + + While the + never-empty guarantee + might at first seem "obvious," it is in fact not even + straightforward how to implement it in general (i.e., without + unreasonably restrictive additional requirements on + bounded types). + + The central difficulty emerges in the details of + variant assignment. Given two instances v1 + and v2 of some concrete variant type, there + are two distinct, fundamental cases we must consider for the assignment + v1 = v2. + + First consider the case that v1 and v2 + each contains a value of the same type. Call this type T. + In this situation, assignment is perfectly straightforward: use + T::operator=. + + However, we must also consider the case that v1 and + v2 contain values of distinct types. + Call these types T and U. At this point, + since variant manages its content on the stack, the + left-hand side of the assignment (i.e., v1) must destroy + its content so as to permit in-place copy-construction of the content + of the right-hand side (i.e., v2). In the end, whereas + v1 began with content of type T, it ends + with content of type U, namely a copy of the content of + v2. + + The crux of the problem, then, is this: in the event that + copy-construction of the content of v2 fails, how can + v1 maintain its "never-empty" guarantee? + By the time copy-construction from v2 is attempted, + v1 has already destroyed its content! +
+ +
+ The "Ideal" Solution: False Hopes + + Upon learning of this dilemma, clever individuals may propose the + following scheme hoping to solve the problem: + + + Provide some "backup" storage, appropriately + aligned, capable of holding values of the contained type of the + left-hand side. + Copy the memory (e.g., using memcpy) of the + storage of the left-hand side to the backup storage. + Attempt a copy of the right-hand side content to the + (now-replicated) left-hand side storage. + In the event of an exception from the copy, restore the + backup (i.e., copy the memory from the backup storage back into + the left-hand side storage). + Otherwise, in the event of success, now copy the memory + of the left-hand side storage to another "temporary" + aligned storage. + Now restore the backup (i.e., again copying the memory) + to the left-hand side storage; with the "old" content + now restored, invoke the destructor of the contained type on the + storage of the left-hand side. + Finally, copy the memory of the temporary storage to the + (now-empty) storage of the left-hand side. + + + + While complicated, it appears such a scheme could provide the + desired safety in a relatively efficient manner. In fact, several + early iterations of the library implemented this very approach. + + Unfortunately, as Dave Abraham's first noted, the scheme results + in undefined behavior: + +
+ "That's a lot of code to read through, but if it's + doing what I think it's doing, it's undefined behavior. + "Is the trick to move the bits for an existing object + into a buffer so we can tentatively construct a new object in + that memory, and later move the old bits back temporarily to + destroy the old object? + "The standard does not give license to do that: only one + object may have a given address at a time. See 3.8, and + particularly paragraph 4." +
+
+ + Additionally, as close examination quickly reveals, the scheme has + the potential to create irreconcilable race-conditions in concurrent + environments. + + Ultimately, even if the above scheme could be made to work on + certain platforms with particular compilers, it is still necessary to + find a portable solution. +
+ +
+ An Initial Solution: Double Storage + + Upon learning of the infeasibility of the above scheme, Anthony + Williams proposed in + [Wil02] a scheme that served + as the basis for a portable solution in some pre-release + implementations of variant. + + The essential idea to this scheme, which shall be referred to as + the "double storage" scheme, is to provide enough space + within a variant to hold two separate values of any of + the bounded types. + + With the secondary storage, a copy the right-hand side can be + attempted without first destroying the content of the left-hand side; + accordingly, the content of the left-hand side remains available in + the event of an exception. + + Thus, with this scheme, the variant implementation + needs only to keep track of which storage contains the content -- and + dispatch any visitation requests, queries, etc. accordingly. + + The most obvious flaw to this approach is the space overhead + incurred. Though some optimizations could be applied in special cases + to eliminate the need for double storage -- for certain bounded types + or in some cases entirely (see + for more + details) -- many users on the Boost mailing list strongly objected to + the use of double storage. In particular, it was noted that the + overhead of double storage would be at play at all times -- even if + assignment to variant never occurred. For this reason + and others, a new approach was developed. +
+ +
+ Current Approach: Temporary Heap Backup + + Despite the many objections to the double storage solution, it was + realized that no replacement would be without drawbacks. Thus, a + compromise was desired. + + To this end, Dave Abrahams suggested to include the following in + the behavior specification for variant assignment: + "variant assignment from one type to another may + incur dynamic allocation." That is, while variant would + continue to store its content in situ after + construction and after assignment involving identical contained types, + variant would store its content on the heap after + assignment involving distinct contained types. + + The algorithm for assignment would proceed as follows: + + + Copy-construct the content of the right-hand side to the + heap; call the pointer to this data p. + Destroy the content of the left-hand side. + Copy p to the left-hand side + storage. + + + Since all operations on pointers are nothrow, this scheme would allow + variant to meet its never-empty guarantee. + + + The most obvious concern with this approach is that while it + certainly eliminates the space overhead of double storage, it + introduces the overhead of dynamic-allocation to variant + assignment -- not just in terms of the initial allocation but also + as a result of the continued storage of the content on the heap. While + the former problem is unavoidable, the latter problem may be avoided + with the following "temporary heap backup" technique: + + + Copy-construct the content of the + left-hand side to the heap; call the pointer to + this data backup. + Destroy the content of the left-hand side. + Copy-construct the content of the right-hand side in the + (now-empty) storage of the left-hand side. + In the event of failure, copy backup to the + left-hand side storage. + In the event of success, deallocate the data pointed to + by backup. + + + + With this technique: 1) only a single storage is used; + 2) allocation is on the heap in the long-term only if the assignment + fails; and 3) after any successful assignment, + storage within the variant is guaranteed. For the + purposes of the initial release of the library, these characteristics + were deemed a satisfactory compromise solution. + + There remain notable shortcomings, however. In particular, there + may be some users for which heap allocation must be avoided at all + costs; for other users, any allocation may need to occur via a + user-supplied allocator. These issues will be addressed in the future + (see ). For now, + though, the library treats storage of its content as an implementation + detail. Nonetheless, as described in the next section, there + are certain things the user can do to ensure the + greatest efficiency for variant instances (see + for + details). +
+ +
+ Enabling Optimizations + + As described in + , the central + difficulty in implementing the never-empty guarantee is the + possibility of failed copy-construction during variant + assignment. Yet types with nothrow copy constructors clearly never + face this possibility. Similarly, if one of the bounded types of the + variant is nothrow default-constructible, then such a + type could be used as a safe "fallback" type in the event of + failed copy construction. + + Accordingly, variant is designed to enable the + following optimizations once the following criteria on its bounded + types are met: + + + + For each bounded type T that is nothrow + copy-constructible (as indicated by + boost::has_nothrow_copy), the + library guarantees variant will use only single + storage and in-place construction for T. + + If any bounded type is nothrow + default-constructible (as indicated by + boost::has_nothrow_constructor), + the library guarantees variant will use only single + storage and in-place construction for every + bounded type in the variant. Note, however, that in + the event of assignment failure, an unspecified nothrow + default-constructible bounded type will be default-constructed in + the left-hand side operand so as to preserve the never-empty + guarantee. + + + + + + Implementation Note: So as to make + the behavior of variant more predictable in the aftermath + of an exception, the current implementation prefers to default-construct + boost::blank if specified as a + bounded type instead of other nothrow default-constructible bounded + types. (If this is deemed to be a useful feature, it will become part + of the specification for variant; otherwise, it may be + obsoleted. Please provide feedback to the Boost mailing list.) +
+ +
+ Future Direction: Policy-based Implementation + + As the previous sections have demonstrated, much effort has been + expended in an attempt to provide a balance between performance, data + size, and heap usage. Further, significant optimizations may be + enabled in variant on the basis of certain traits of its + bounded types. + + However, there will be some users for whom the chosen compromise + is unsatisfactory (e.g.: heap allocation must be avoided at all costs; + if heap allocation is used, custom allocators must be used; etc.). For + this reason, a future version of the library will support a + policy-based implementation of variant. While this will + not eliminate the problems described in the previous sections, it will + allow the decisions regarding tradeoffs to be decided by the user + rather than the library designers. +
+ +
+ +
diff --git a/tools/boost_1_65_1/libs/variant/doc/introduction.xml b/tools/boost_1_65_1/libs/variant/doc/introduction.xml new file mode 100644 index 0000000000000000000000000000000000000000..e57928795857cdea0ca7c6e9b9eda8c96283b72f --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/introduction.xml @@ -0,0 +1,141 @@ + + + +
+ Introduction + + + +
+ Abstract + +The variant class template is a safe, generic, stack-based +discriminated union container, offering a simple solution for manipulating an +object from a heterogeneous set of types in a uniform manner. Whereas +standard containers such as std::vector may be thought of as +"multi-value, single type," +variant is "multi-type, +single value." + +Notable features of boost::variant +include: + + + Full value semantics, including adherence to standard + overload resolution rules for conversion operations. + Compile-time type-safe value visitation via + boost::apply_visitor. + Run-time checked explicit value retrieval via + boost::get. + Support for recursive variant types via both + boost::make_recursive_variant and + boost::recursive_wrapper. + Efficient implementation -- stack-based when possible (see + for more details). + + +
+ +
+ Motivation + +
+ Problem + +Many times, during the development of a C++ program, the +programmer finds himself in need of manipulating several distinct +types in a uniform manner. Indeed, C++ features direct language +support for such types through its union +keyword: + +union { int i; double d; } u; +u.d = 3.14; +u.i = 3; // overwrites u.d (OK: u.d is a POD type) + +C++'s union construct, however, is nearly +useless in an object-oriented environment. The construct entered +the language primarily as a means for preserving compatibility with +C, which supports only POD (Plain Old Data) types, and so does not +accept types exhibiting non-trivial construction or +destruction: + +union { + int i; + std::string s; // illegal: std::string is not a POD type! +} u; + +Clearly another approach is required. Typical solutions +feature the dynamic-allocation of objects, which are subsequently +manipulated through a common base type (often a virtual base class + [Hen01] +or, more dangerously, a void*). Objects of +concrete type may be then retrieved by way of a polymorphic downcast +construct (e.g., dynamic_cast, +boost::any_cast, etc.). + +However, solutions of this sort are highly error-prone, due +to the following: + + + Downcast errors cannot be detected at + compile-time. Thus, incorrect usage of downcast + constructs will lead to bugs detectable only at run-time. + Addition of new concrete types may be + ignored. If a new concrete type is added to the + hierarchy, existing downcast code will continue to work as-is, + wholly ignoring the new type. Consequently, the programmer must + manually locate and modify code at numerous locations, which often + results in run-time errors that are difficult to find. + + +Furthermore, even when properly implemented, these solutions tend +to incur a relatively significant abstraction penalty due to the use of +the heap, virtual function calls, and polymorphic downcasts. + +
+ +
+ Solution: A Motivating Example + +The boost::variant class template +addresses these issues in a safe, straightforward, and efficient manner. The +following example demonstrates how the class can be used: + +#include "boost/variant.hpp" +#include <iostream> + +class my_visitor : public boost::static_visitor<int> +{ +public: + int operator()(int i) const + { + return i; + } + + int operator()(const std::string & str) const + { + return str.length(); + } +}; + +int main() +{ + boost::variant< int, std::string > u("hello world"); + std::cout << u; // output: hello world + + int result = boost::apply_visitor( my_visitor(), u ); + std::cout << result; // output: 11 (i.e., length of "hello world") +} + + +
+ +
+ +
diff --git a/tools/boost_1_65_1/libs/variant/doc/misc.xml b/tools/boost_1_65_1/libs/variant/doc/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..43f8f5a80077bb488a978b094d576e6e833afa38 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/misc.xml @@ -0,0 +1,241 @@ + + + +
+ Miscellaneous Notes + + + +
+ Boost.Variant vs. Boost.Any + + As a discriminated union container, the Variant library shares many + of the same features of the Any library. + However, since neither library wholly encapsulates the features of the + other, one library cannot be generally recommended for use over the + other. + + That said, Boost.Variant has several advantages over Boost.Any, + such as: + + + Boost.Variant guarantees the type of its content is one of a + finite, user-specified set of types. + Boost.Variant provides compile-time + checked visitation of its content. (By contrast, the current version + of Boost.Any provides no visitation mechanism at all; but even if it + did, it would need to be checked at run-time.) + Boost.Variant enables generic visitation of its content. + (Even if Boost.Any did provide a visitation mechanism, it would enable + visitation only of explicitly-specified types.) + Boost.Variant offers an efficient, stack-based storage scheme + (avoiding the overhead of dynamic allocation). + + + + + Of course, Boost.Any has several advantages over Boost.Variant, + such as: + + + Boost.Any, as its name implies, allows virtually any type for + its content, providing great flexibility. + Boost.Any provides the no-throw guarantee of exception safety + for its swap operation. + Boost.Any makes little use of template metaprogramming + techniques (avoiding potentially hard-to-read error messages and + significant compile-time processor and memory demands). + + + + +
+ +
+ Portability + + The library aims for 100% ANSI/ISO C++ conformance. However, this is + strictly impossible due to the inherently non-portable nature of the + Type Traits library's + type_with_alignment facility. In + practice though, no compilers or platforms have been discovered where this + reliance on undefined behavior has been an issue. + + Additionally, significant effort has been expended to ensure proper + functioning despite various compiler bugs and other conformance problems. + To date the library testsuite has + been compiled and tested successfully on at least the following compilers + for basic and advanced functionality: + + + + + + + Basic + + variant<T&> + + + + make_variant_over + + + + + make_recursive_variant + + + + + + + Borland C++ 5.5.1 and 5.6.4 + X + X + + + + + Comeau C++ 4.3.0 + X + X + X + X + + + GNU GCC 3.3.1 + X + X + X + X + + + GNU GCC 2.95.3 + X + X + + X + + + Intel C++ 7.0 + X + + X + X + + + Metrowerks CodeWarrior 8.3 + X + + X + X + + + Microsoft Visual C++ 7.1 + X + X + X + X + + + Microsoft Visual C++ 6 SP5 and 7 + X + + + + + + + + + + + Finally, the current state of the testsuite in CVS may be found on the + Test Summary + page. Please note, however, that this page reports on day-to-day changes + to inter-release code found in the Boost CVS and thus likely does not + match the state of code found in Boost releases. + +
+ +
+ Troubleshooting + +Due to the heavy use of templates in the implementation of + variant, it is not uncommon when compiling to encounter + problems related to template instantiaton depth, compiler memory, etc. This + section attempts to provide advice to common problems experienced on several + popular compilers. + +(This section is still in progress, with additional advice/feedback + welcome. Please post to the Boost-Users list with any useful experiences you + may have.) + +
+ "Template instantiation depth exceeds maximum" + +
+ GNU GCC + The compiler option + -ftemplate-depth-NN can increase the + maximum allowed instantiation depth. (Try + -ftemplate-depth-50.) +
+
+ +
+ "Internal heap limit reached" + +
+ Microsoft Visual C++ + The compiler option /ZmNNN can + increase the memory allocation limit. The NNN is a + scaling percentage (i.e., 100 denotes the default limit). + (Try /Zm200.) +
+
+ +
+ +
+ Acknowledgments + +Eric Friedman and Itay Maman designed the initial submission; Eric was + the primary implementer. + +Eric is also the library maintainer and has expanded upon the initial + submission -- adding + make_recursive_variant, + make_variant_over, support for + reference content, etc. + +Andrei Alexandrescu's work in + [Ale01a] +and + [Ale02] +inspired the library's design. + +Jeff Garland was the formal review manager. + +Douglas Gregor, +Dave Abrahams, +Anthony Williams, +Fernando Cacciola, +Joel de Guzman, +Dirk Schreib, +Brad King, +Giovanni Bajo, +Eugene Gladyshev, +and others provided helpful feedback and suggestions to refine the semantics, +interface, and implementation of the library. + +
+ +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/apply_visitor.xml b/tools/boost_1_65_1/libs/variant/doc/reference/apply_visitor.xml new file mode 100644 index 0000000000000000000000000000000000000000..bd1f10fe751b0b660ca463cfa43a734da387df00 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/apply_visitor.xml @@ -0,0 +1,378 @@ + + + +
+ + + Adapts a visitor for use as a function object. + + Adapts the function given at construction for use as a + function object. This is useful, for example, when one needs to + operate on each element of a sequence of variant objects using a + standard library algorithm such as + std::for_each. + See the "visitor-only" form of + apply_visitor for a simple + way to create apply_visitor_delayed_t objects. + See apply_visitor_delayed_cpp14_t + which is used on C++14 compatible compilers when Visitor has no + result_type typedef. + + + + + + typename Visitor::result_type + + + + + Visitor & + + + + Constructs the function object with the given + visitor. + + + + + + + + + result_type + + Variant&... + + + + + + + + result_type + + Variant & + + + + + + + result_type + + Variant1 & + + + Variant2 & + + + + Function call operator. + + Invokes + apply_visitor on the + stored visitor using the given operands. + + Version with variadic templates is used by default if + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES is not defined. + + + + + + Adapts a visitor for use as a function object. + + Adapts the function given at construction for use as a + function object. This is useful, for example, when one needs to + operate on each element of a sequence of variant objects using a + standard library algorithm such as + std::for_each. + See the "visitor-only" form of + apply_visitor for a simple + way to create apply_visitor_delayed_t objects. + See apply_visitor_delayed_t + which is used when Visitor has result_type + typedef. + Available only if macro + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES is not defined and + compiler supports decltype(auto) and decltype(some-expression). + + + + + + + Visitor & + + + + Constructs the function object with the given + visitor. + + + + + + + + + decltype(auto) + + Variant&... + + + + Function call operator. + + Invokes + apply_visitor on the + stored visitor using the given operands. + + + + + + + + + + typename Visitor::result_type + + + Visitor & + + + Variant & + + + + + + + typename Visitor::result_type + + + const Visitor & + + + Variant & + + + + + + + typename BinaryVisitor::result_type OR decltype(auto) + + + BinaryVisitor & + + + Variant1 & + + + Variant2 & + + + + + + + typename BinaryVisitor::result_type OR decltype(auto) + + + const BinaryVisitor & + + + Variant1 & + + + Variant2 & + + + + + + + typename MultiVisitor::result_type OR decltype(auto) + + + MultiVisitor & + + + Variant1 & + + + Variant2 & + + + Variant3 & + + + ... + + + + + + + typename MultiVisitor::result_type OR decltype(auto) + + + const MultiVisitor & + + + Variant1 & + + + Variant2 & + + + Variant3 & + + + ... + + + + + + + apply_visitor_delayed_t<Visitor> + + + Visitor & + + + + + + + + apply_visitor_delayed_cpp14_t<Visitor> + + + Visitor & + + + + + Allows compile-time checked type-safe application of the + given visitor to the content of the given variant, ensuring that all + types are handled by the visitor. + + + + The behavior of apply_visitor is dependent on + the number of arguments on which it operates (i.e., other than the + visitor). The function behaves as follows: + + + Overloads accepting one operand invoke the unary function + call operator of the given visitor on the content of the given + variant operand. + + Overloads accepting two operands invoke the binary + function call operator of the given visitor on the content of + the given variant + operands. + + Overloads accepting three or more operands invoke the + function call operator of the given visitor on the content of + the given variant + operands. Maximum amount of parameters controlled by + BOOST_VARAINT_MAX_MULTIVIZITOR_PARAMS + macro. Those functions are actually defined in a header boost/variant/multivisitors.hpp + (See ). That header must be manually included + if multi visitors are meant for use. + + The overloads accepting only a visitor return a + C++03 compatible generic function object + or + C++14 compatible generic function object + that accepts either one, two or arbitrary count of arguments and invoke + apply_visitor using + these arguments and visitor, thus behaving as + specified above. (This behavior is particularly useful, for + example, when one needs to operate on each element of a sequence + of variant objects using a standard library + algorithm.) + + + + + + + The overloads acccepting operands return the result of + applying the given visitor to the content of the given operands. + The overload accepting only a visitor return a function object, thus + delaying application of the visitor to any operands. + + + + The given visitor must fulfill the + StaticVisitor + concept requirements with respect to each of the bounded types of the + given variant. + + + + The overloads accepting operands throw only if the given + visitor throws when applied. The overload accepting only a visitor + will not throw. (Note, however, that the returned + function object + may throw when invoked.) + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/bad_visit.xml b/tools/boost_1_65_1/libs/variant/doc/reference/bad_visit.xml new file mode 100644 index 0000000000000000000000000000000000000000..11400bc8ed829e5ab690cb169f5f5c726834f6da --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/bad_visit.xml @@ -0,0 +1,29 @@ + + + +
+ + + + + std::exception + + + + The exception thrown in the event of a visitor + unable to handle the visited value. + + + + const char * + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/concepts.xml b/tools/boost_1_65_1/libs/variant/doc/reference/concepts.xml new file mode 100644 index 0000000000000000000000000000000000000000..03534ec2c5eee9fa2e37d2bb50f8df6813d5432f --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/concepts.xml @@ -0,0 +1,176 @@ + + + +
+ Concepts + + + +
+ <emphasis>BoundedType</emphasis> + + The requirements on a bounded type + are as follows: + + + CopyConstructible or MoveConstructible. + Destructor upholds the no-throw exception-safety + guarantee. + Complete at the point of variant template + instantiation. (See + boost::recursive_wrapper<T> + for a type wrapper that accepts incomplete types to enable recursive + variant types.) + + + Every type specified as a template argument to + variant must at minimum fulfill the + above requirements. In addition, certain features of variant + are available only if its bounded types meet the requirements of these + following additional concepts: + + + Assignable: + variant is itself Assignable if and + only if every one of its bounded types meets the requirements of the + concept. (Note that top-level const-qualified types and + reference types do not meet these + requirements.) + MoveAssignable: + variant is itself MoveAssignable if and + only if every one of its bounded types meets the requirements of the + concept. (Note that top-level const-qualified types and + reference types do not meet these + requirements.) + DefaultConstructible [20.1.4]: + variant is itself + DefaultConstructible if and only if its first + bounded type (i.e., T1) meets the requirements of the + concept. + EqualityComparable: + variant is itself EqualityComparable + if and only if every one of its bounded types meets the requirements + of the concept. + LessThanComparable: + variant is itself LessThanComparable + if and only if every one of its bounded types meets the requirements + of the concept. + OutputStreamable: + variant is itself OutputStreamable + if and only if every one of its bounded types meets the requirements + of the concept. + Hashable: + variant is itself Hashable + if and only if every one of its bounded types meets the requirements + of the concept. + +
+ +
+ <emphasis>StaticVisitor</emphasis> + + The requirements on a static + visitor of a type T are as follows: + + + Must allow invocation as a function by overloading + operator(), unambiguously accepting any value of type + T. + Must expose inner type result_type. C++14 compatible compilers + could detect result_type automatically, but will stick to + result_type if it is defined. (See + boost::visitor_ptr for a + solution to using functions as visitors.) + If result_type is not void, then + each operation of the function object must return a value implicitly + convertible to result_type. + + +
+ Examples + + The following class satisfies the requirements of a static visitor + of several types (i.e., explicitly: int and + std::string; or, e.g., implicitly: short and + const char *; etc.): + +class my_visitor + : public boost::static_visitor<int> +{ +public: + + int operator()(int i) + { + return i * 2; + } + + int operator()(const std::string& s) + { + return s.length(); + } + +}; + + Another example is the following class, whose function-call + operator is a member template, allowing it to operate on values of many + types. Thus, the following class is a visitor of any type that supports + streaming output (e.g., int, double, + std::string, etc.): + +class printer + : public boost::static_visitor<> +{ + template <typename T> + void operator()(const T& t) + { + std::cout << t << std::endl; + } +}; + + C++14 compatible compilers detect result_type automatically: + + + boost::variant<int, float> v; + // ... + + boost::apply_visitor( + [](auto val) { return std::to_string(val); }, + v + ); + + +
+
+ +
+ <emphasis>OutputStreamable</emphasis> + + The requirements on an output + streamable type T are as follows: + + + For any object t of type T, + std::cout << t must be a valid + expression. + +
+ +
+ <emphasis>Hashable</emphasis> + + The requirements on an hashable type T are as follows: + + + For any object t of type T, + boost::hash<T>()(t) must be a valid + expression. + +
+ +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/get.xml b/tools/boost_1_65_1/libs/variant/doc/reference/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..134de071d9117b2e4e110f5e5a549d50a2b8e7be --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/get.xml @@ -0,0 +1,366 @@ + + + +
+ + + + + std::exception + + + + The exception thrown in the event of a failed application of + boost::get on the given + operand value. + + + + const char * + + + + + + + + U * + + + variant<T1, T2, ..., TN> * + + + + + + + const U * + + + const variant<T1, T2, ..., TN> * + + + + + + + U & + + + variant<T1, T2, ..., TN> & + + + + + + + const U & + + + const variant<T1, T2, ..., TN> & + + + + + + + U && + + + variant<T1, T2, ..., TN> && + + + + + Retrieves a value of a specified type from a given + variant. + Unlike strict_get does not assert at compile time + that type U is one of the types that can be stored in variant. + + + + The get function allows run-time checked, + type-safe retrieval of the content of the given + variant. The function succeeds + only if the content is of the specified type U, with + failure indicated as described below. + Recomendation: Use + get or strict_get in new code. + strict_get + provides more compile time checks and its behavior is closer to std::get + from C++ Standard Library. + Warning: After either + operand or its content is destroyed (e.g., when the + given variant is assigned a + value of different type), the returned reference is invalidated. + Thus, significant care and caution must be extended when handling + the returned reference. + + + + As part of its guarantee of type-safety, get + enforces const-correctness. Thus, the specified type + U must be const-qualified whenever + operand or its content is likewise + const-qualified. The converse, however, is not required: + that is, the specified type U may be + const-qualified even when operand and its + content are not. + + + + If passed a pointer, get returns a pointer to + the value content if it is of the specified type U; + otherwise, a null pointer is returned. If passed a reference, + get returns a reference to the value content if it is of + the specified type U; otherwise, an exception is thrown + (see below). + + + + Overloads taking a + variant pointer will not + throw; the overloads taking a + variant reference throw + bad_get if the content is not of + the specified type U. + + + + While visitation via + apply_visitor + is generally preferred due to its greater safety, get may + may be more convenient in some cases due to its straightforward + usage. + + + + + + + + U * + + + variant<T1, T2, ..., TN> * + + + + + + + const U * + + + const variant<T1, T2, ..., TN> * + + + + + + + U & + + + variant<T1, T2, ..., TN> & + + + + + + + const U & + + + const variant<T1, T2, ..., TN> & + + + + + + + U && + + + variant<T1, T2, ..., TN> && + + + + + Retrieves a value of a specified type from a given + variant. + + + + Acts exactly like relaxed_get but does a compile time check + that type U is one of the types that can be stored in variant. + + + + + + + + U * + + + variant<T1, T2, ..., TN> * + + + + + + + const U * + + + const variant<T1, T2, ..., TN> * + + + + + + + U & + + + variant<T1, T2, ..., TN> & + + + + + + + const U & + + + const variant<T1, T2, ..., TN> & + + + + + + + U && + + + variant<T1, T2, ..., TN> && + + + + + Retrieves a value of a specified type from a given + variant. + + + + Evaluates to strict_get if BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT + is not defined. If BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT + is defined then evaluates to relaxed_get. + + Recomendation: Use + get in new code without defining + BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT. In that way get + provides more compile time checks and its behavior is closer to std::get + from C++ Standard Library. + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/multivisitor.xml b/tools/boost_1_65_1/libs/variant/doc/reference/multivisitor.xml new file mode 100644 index 0000000000000000000000000000000000000000..aef4a3bd127dc55ec9d43ad70f22d4076e66473a --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/multivisitor.xml @@ -0,0 +1,96 @@ + + + +
+ + + Provides declarations of apply_visitor for three or more + variant parameters. + + + + Controls maximum amount of variant + parameters for multi visistors. Not used when std::tuple is available and + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + is not defined. + + + + Note: Default amount is 4. Define it + to bigger value before including <boost/variant/multivisitors.hpp> to + increase maximum amount of variant + parameters for apply_visitor. + + + + + + + Allows compile-time checked type-safe application of the + given visitor to the content of the given variant, ensuring that all + types are handled by the visitor. See apply_visitor + for more information. + + + + + + typename MultiVisitor::result_type OR decltype(auto) + + + MultiVisitor & + + + Variant1 & + + + Variant2 & + + + Variant3 & + + + ... + + + + + + + typename MultiVisitor::result_type OR decltype(auto) + + + const MultiVisitor & + + + Variant1 & + + + Variant2 & + + + Variant3 & + + + ... + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/polymorphic_get.xml b/tools/boost_1_65_1/libs/variant/doc/reference/polymorphic_get.xml new file mode 100644 index 0000000000000000000000000000000000000000..80c02a33a14ec044eee9be559944eb8ef1382248 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/polymorphic_get.xml @@ -0,0 +1,326 @@ + + + +
+ + + + + boost::bad_get + + + + The exception thrown in the event of a failed application of + boost::polymorphic_get on the given + operand value. + + + + const char * + + + + + + + + U * + + + variant<T1, T2, ..., TN> * + + + + + + + const U * + + + const variant<T1, T2, ..., TN> * + + + + + + + U & + + + variant<T1, T2, ..., TN> & + + + + + + + const U & + + + const variant<T1, T2, ..., TN> & + + + + + Retrieves a value of a specified type from a given + variant. + Unlike polymorphic_strict_get does not assert at compile time + that type U is one of the types that can be stored in variant. + + + + The polymorphic_get function allows run-time checked, + type-safe retrieval of the content of the given + variant. The function succeeds + only if the content is of the specified type U or of type + derived from type U, with + failure indicated as described below. + Recomendation: Use + polymorphic_get or polymorphic_strict_get + in new code. + polymorphic_strict_get + provides more compile time checks and its behavior is closer to std::get + from C++ Standard Library. + Warning: After either + operand or its content is destroyed (e.g., when the + given variant is assigned a + value of different type), the returned reference is invalidated. + Thus, significant care and caution must be extended when handling + the returned reference. + + + + As part of its guarantee of type-safety, polymorphic_get + enforces const-correctness. Thus, the specified type + U must be const-qualified whenever + operand or its content is likewise + const-qualified. The converse, however, is not required: + that is, the specified type U may be + const-qualified even when operand and its + content are not. + + + + If passed a pointer, polymorphic_get returns a pointer to + the value content if it is of the specified type U or of type + derived from type U; + otherwise, a null pointer is returned. If passed a reference, + polymorphic_get returns a reference to the value content if it is of + the specified type U or of type + derived from type U; otherwise, an exception is thrown + (see below). + + + + Overloads taking a + variant pointer will not + throw; the overloads taking a + variant reference throw + bad_polymorphic_get if the content is not of + the specified type Uor of type + derived from type U. + + + + While visitation via + apply_visitor + is generally preferred due to its greater safety, polymorphic_get may + may be more convenient in some cases due to its straightforward + usage. + + + + + + + + + + U * + + + variant<T1, T2, ..., TN> * + + + + + + + const U * + + + const variant<T1, T2, ..., TN> * + + + + + + + U & + + + variant<T1, T2, ..., TN> & + + + + + + + const U & + + + const variant<T1, T2, ..., TN> & + + + + + Retrieves a value of a specified type from a given + variant. + + + + Acts exactly like polymorphic_relaxed_get but does a compile time check + that type U is one of the types that can be stored in variant. + + + + + + + + U * + + + variant<T1, T2, ..., TN> * + + + + + + + const U * + + + const variant<T1, T2, ..., TN> * + + + + + + + U & + + + variant<T1, T2, ..., TN> & + + + + + + + const U & + + + const variant<T1, T2, ..., TN> & + + + + + Retrieves a value of a specified type from a given + variant. + + + + Evaluates to polymorphic_strict_get + if BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT + is not defined. If BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT + is defined then evaluates to polymorphic_relaxed_get. + + Recomendation: Use + polymorphic_get in new code without defining + BOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT. In that way + polymorphic_get + provides more compile time checks and its behavior is closer to std::get + from C++ Standard Library. + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/recursive_variant.xml b/tools/boost_1_65_1/libs/variant/doc/reference/recursive_variant.xml new file mode 100644 index 0000000000000000000000000000000000000000..4392bf2af0ff6a69c81ca911abb29ecd04ab578c --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/recursive_variant.xml @@ -0,0 +1,117 @@ + + + +
+ + + + unspecified + + + + Simplifies declaration of recursive variant types. + + + + + type has behavior equivalent in every respect to + some variant< U1, U2, ..., UN >, where each type + Ui is the result of the + corresponding type Ti undergone a + transformation function. The following pseudo-code specifies the + behavior of this transformation (call it substitute): + + + If Ti is + boost::recursive_variant_ then: + variant< U1, U2, ..., UN >; + Else if Ti is of the + form X * then: + substitute(X) *; + Else if Ti is of the + form X & then: + substitute(X) &; + Else if Ti is of the + form R (*)( X1, X2, ..., XN ) then: + substitute(R) (*)( substitute(X1), substitute(X2), ..., substitute(XN) ); + Else if Ti is of the + form F < X1, X2, ..., XN > then: + F< substitute(X1), substitute(X2), ..., substitute(XN) >; + Else: Ti. + + + + Note that cv-qualifiers are preserved and that the actual + process is generally a bit more complicated. However, the above does + convey the essential idea as well as describe the extent of the + substititions. + + Use of make_recursive_variant is demonstrated in + . + + Portability: Due to standard + conformance issues in several compilers, + make_recursive_variant is not universally supported. On + these compilers the library indicates its lack of support via the + definition of the preprocessor symbol + BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT. + + + + boost::variant< unspecified > + + + + + + + Exposes a recursive variant whose bounded types + are the elements of the given type sequence. + + + + + + variant< unspecified > + + + + type has behavior equivalent in every respect to + make_recursive_variant< Sequence[0], Sequence[1], ... >::type + (where Sequence[i] denotes the + i-th element of Sequence), except + that no upper limit is imposed on the number of types. + + Notes: + + Sequence must meet the requirements of + MPL's Sequence + concept. + Due to standard conformance problems in several compilers, + make_recursive_variant_over may not be supported on + your compiler. See + BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT + for more information. + + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/recursive_wrapper.xml b/tools/boost_1_65_1/libs/variant/doc/reference/recursive_wrapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..78fb2381cdb201d85d9aa6780443b4a8980e7344 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/recursive_wrapper.xml @@ -0,0 +1,270 @@ + + + +
+ + + + Solves circular dependencies, enabling recursive types. + + + + + The recursive_wrapper class template has an + interface similar to a simple value container, but its content is + allocated dynamically. This allows recursive_wrapper to + hold types T whose member data leads to a circular + dependency (e.g., a data member of T has a data member + of type T). + + The application of recursive_wrapper is easiest + understood in context. See + for a + demonstration of a common use of the class template. + + Notes: + + Any type specified as the template argument to + recursive_wrapper must be capable of construction via + operator new. Thus, for instance, references are not + supported. + + + + + T + + + + Destructor. + + Deletes the content of *this. + + + Will not throw. + + + + Default constructor. + + Initializes *this by default construction of + T. + + + + T must fulfill the requirements of the + DefaultConstructible [20.1.4] + concept. + + + + May fail with any exceptions arising from the default + constructor of T or, in the event of + insufficient memory, with std::bad_alloc. + + + + + + const recursive_wrapper & + + + Copy constructor. + + Copies the content of other into + *this. + + + + May fail with any exceptions arising from the + copy constructor of T or, in the event of + insufficient memory, with std::bad_alloc. + + + + + + const T & + + + Value constructor. + + Copies operand into + *this. + + + + May fail with any exceptions arising from the + copy constructor of T or, in the event of + insufficient memory, with std::bad_alloc. + + + + + + + void + + + recursive_wrapper & + + + + Exchanges contents of *this and + other. + + + Will not throw. + + + + recursive_wrapper & + + + const recursive_wrapper & + + + Copy assignment operator. + + Assigns the content of rhs to the content of + *this. + + + + T must fulfill the requirements of + the Assignable + concept. + + + + May fail with any exceptions arising from the assignment + operator of T. + + + + + recursive_wrapper & + + + const T & + + + Value assignment operator. + + Assigns rhs into the content of + *this. + + + + T must fulfill the requirements of the + Assignable + concept. + + + + May fail with any exceptions arising from the assignment + operator of T. + + + + + + + + + + T & + + + const T & + + + + Returns a reference to the content of + *this. + + + Will not throw. + + + + + T * + + + const T * + + + + Returns a pointer to the content of + *this. + + + Will not throw. + + + + + + + + + Determines whether the specified type is a specialization of + recursive_wrapper. + + + + + + Value is true iff T is a specialization of + recursive_wrapper. + Note: + is_recursive_wrapper is a model of + MPL's + IntegralConstant concept. + + + + unspecified + + + + bool + unspecified + + + + + + Unwraps the specified argument if given a specialization of + recursive_wrapper. + + + + + + type is equivalent to T::type if + T is a specialization of + recursive_wrapper. Otherwise, + type is equivalent to T. + + + + unspecified + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/reference.xml b/tools/boost_1_65_1/libs/variant/doc/reference/reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..ef1e6f05a00bbbad8940a3a11be1eb66ba2af9c8 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/reference.xml @@ -0,0 +1,32 @@ + + + + + + + +
+
+ This header exists simply as a convenience to the user, including + all of the headers in the boost/variant directory except <boost/multivisiors.hpp>. +
+
+ + + + + + + + + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/static_visitor.xml b/tools/boost_1_65_1/libs/variant/doc/reference/static_visitor.xml new file mode 100644 index 0000000000000000000000000000000000000000..3657e8ed941f075d3629fd8b4058f8ea43e0644b --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/static_visitor.xml @@ -0,0 +1,37 @@ + + + +
+ + + + + + Convenient base type for static visitors. + + Denotes the intent of the deriving class as meeting the + requirements of a static visitor of some type. Also exposes the + inner type result_type as required by the + StaticVisitor + concept. + Notes: + static_visitor is intended for use as a base type only + and is therefore noninstantiable. + + + + ResultType + Exposes result_type member as required by StaticVisitor concept. + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/variant.xml b/tools/boost_1_65_1/libs/variant/doc/reference/variant.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba67fbeab7dbc3274dd60902245ac71636122ab6 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/variant.xml @@ -0,0 +1,963 @@ + + + +
+ + + Safe, generic, stack-based discriminated union container. + + The variant class template (inspired by Andrei + Alexandrescu's class of the same name + [Ale01A]) is an efficient, + recursive-capable, + bounded discriminated union value type capable of containing any value + type (either POD or non-POD). It supports construction from any type + convertible to one of its bounded types or from a source + variant whose bounded types are each convertible to one + of the destination variant's bounded types. As well, + through apply_visitor, + variant supports compile-time checked, type-safe + visitation; and through get, + variant supports run-time checked, type-safe value + retrieval. + + Notes: + + The bounded types of the variant are exposed + via the nested typedef types, which is an + MPL-compatible Sequence containing the + set of types that must be handled by any + visitor to + the variant. + All members of variant satisfy at least the + basic guarantee of exception-safety. That is, all operations on + a variant remain defined even after previous + operations have failed. + Each type specified as a template argument to + variant must meet the requirements of the + BoundedType + concept. + Each type specified as a template argument to + variant must be distinct after removal of qualifiers. + Thus, for instance, both variant<int, int> and + variant<int, const int> have undefined + behavior. + Conforming implementations of variant must + allow at least ten types as template arguments. The exact number + of allowed arguments is exposed by the preprocessor macro + BOOST_VARIANT_LIMIT_TYPES. + (See make_variant_over for a + means to specify the bounded types of a variant by + the elements of an MPL or compatible + Sequence, thus overcoming this limitation.) + + + + + + + unspecified + + + + + Destroys the content of *this. + + + Will not throw. + + + + + The first bounded type of the variant (i.e., + T1) must fulfill the requirements of the + DefaultConstructible [20.1.4] + concept. + + + + Content of *this is the default value of the + first bounded type (i.e, T1). + + + + May fail with any exceptions arising from the default + constructor of T1. + + + + + + const variant & + + + + Content of *this is a copy of the content of + other. + + + + May fail with any exceptions arising from the + copy constructor of other's contained type. + + + + + + variant && + + + + C++11 compatible compiler. + + + + Content of *this is move constructed from the content of + other. + + + + May fail with any exceptions arising from the + move constructor of other's contained type. + + + + + + + + T & + + + + T must be unambiguously convertible to one of + the bounded types (i.e., T1, T2, + etc.). + + + + Content of *this is the best conversion of + operand to one of the bounded types, as determined + by standard overload resolution rules. + + + + May fail with any exceptions arising from the conversion of + operand to one of the bounded types. + + + + + + + + const T & + + + + Same semantics as previous constructor, but allows + construction from temporaries. + + + + + + + + T && + + + + C++11 compatible compiler. + + + + Same semantics as previous constructor, but allows + move construction if operand is an rvalue. + + + + + + + + variant<U1, U2, ..., UN> & + + + + Every one of U1, + U2, ..., UN must have an unambiguous + conversion to one of the bounded types (i.e., T1, + T2, ..., TN). + + + + If variant<U1, U2, ..., UN> is itself + one of the bounded types, then content of *this is a + copy of operand. Otherwise, content of + *this is the best conversion of the content of + operand to one of the bounded types, as determined + by standard overload resolution rules. + + + + If variant<U1, U2, ..., UN> is itself + one of the bounded types, then may fail with any exceptions arising + from the copy constructor of + variant<U1, U2, ..., UN>. Otherwise, may fail + with any exceptions arising from the conversion of the content of + operand to one of the bounded types. + + + + + + + + const variant<U1, U2, ..., UN> & + + + + Same semantics as previous constructor, but allows + construction from temporaries. + + + + + + + + C++11 compatible compiler. + + + + variant<U1, U2, ..., UN> && + + + + Same semantics as previous constructor, but allows + move construction. + + + + + + + void + + + variant & + + + + Every bounded type must fulfill the requirements of the + MoveAssignable + concept. + + + + Interchanges the content of *this and + other. + + + + If the contained type of other is the same as + the contained type of *this, then may fail with any + exceptions arising from the swap of the contents of + *this and other. Otherwise, may fail + with any exceptions arising from either of the move or copy constructors + of the contained types. Also, in the event of insufficient + memory, may fail with std::bad_alloc + (why?). + + + + + variant & + + + const variant & + + + + Every bounded type must fulfill the requirements of the + Assignable + concept. + + + + If the contained type of rhs is the same as + the contained type of *this, then assigns the + content of rhs into the content of + *this. Otherwise, makes the content of + *this a copy of the content of rhs, + destroying the previous content of *this. + + + + If the contained type of rhs is the same as + the contained type of *this, then may fail with any + exceptions arising from the assignment of the content of + rhs into the content *this. Otherwise, + may fail with any exceptions arising from the copy constructor + of the contained type of rhs. Also, in the event of + insufficient memory, may fail with std::bad_alloc + (why?). + + + + + variant & + + + variant && + + + + + C++11 compatible compiler. + Every bounded type must fulfill the requirements of the + MoveAssignable + concept. + + + + + If the contained type of rhs is the same as + the contained type of *this, then move assigns the + content of rhs into the content of + *this. Otherwise, move constructs + *this using the content of rhs, + destroying the previous content of *this. + + + + If the contained type of rhs is the same as + the contained type of *this, then may fail with any + exceptions arising from the move assignment of the content of + rhs into the content *this. Otherwise, + may fail with any exceptions arising from the move constructor + of the contained type of rhs. Also, in the event of + insufficient memory, may fail with std::bad_alloc + (why?). + + + + + variant & + + + + + const T & + + + + + T must be unambiguously convertible to + one of the bounded types (i.e., T1, + T2, etc.). + Every bounded type must fulfill the requirements of the + Assignable + concept. + + + + + If the contained type of *this is + T, then assigns rhs into the content + of *this. Otherwise, makes the content of + *this the best conversion of rhs to + one of the bounded types, as determined by standard overload + resolution rules, destroying the previous content of + *this. + + + + If the contained type of *this is + T, then may fail with any exceptions arising from + the assignment of rhs into the content + *this. Otherwise, may fail with any exceptions + arising from the conversion of rhs to one of the + bounded types. Also, in the event of insufficient memory, may + fail with std::bad_alloc + (why?). + + + + + variant & + + + + + T && + + + + + C++11 compatible compiler. + rhs is an rvalue. Otherwise previous operator will be used. + T must be unambiguously convertible to + one of the bounded types (i.e., T1, + T2, etc.). + Every bounded type must fulfill the requirements of the + MoveAssignable + concept. + + + + + If the contained type of *this is + T, then move assigns rhs into the content + of *this. Otherwise, makes the content of + *this the best conversion of rhs to + one of the bounded types, as determined by standard overload + resolution rules, destroying the previous content of + *this(conversion is usually done via move construction). + + + + If the contained type of *this is + T, then may fail with any exceptions arising from + the move assignment of rhs into the content + *this. Otherwise, may fail with any exceptions + arising from the conversion of rhs to one of the + bounded types. Also, in the event of insufficient memory, may + fail with std::bad_alloc + (why?). + + + + + + + + + int + + + The zero-based index into the set of bounded types + of the contained type of *this. (For instance, if + called on a variant<int, std::string> object + containing a std::string, which() + would return 1.) + + + Will not throw. + + + + bool + + + false: variant always contains + exactly one of its bounded types. (See + + for more information.) + + + + Facilitates generic compatibility with + boost::any. + + + Will not throw. + + + + const std::type_info & + + + boost::variant usues Boost.TypeIndex library so actually + const boost::typeindex::type_info & is returned. + This method is available even if RTTI is off. + + + + typeid(x), where x is the the + content of *this. + + + Will not throw. + + + + + + + + + Equality comparison. + + + bool + + const variant & + + + + + void + + + const U & + + + + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error. + + + + Every bounded type of the variant must + fulfill the requirements of the + EqualityComparable + concept. + + + + true if which() == rhs.which() + and + content_this == content_rhs, where + content_this is the content of *this + and content_rhs is the content of + rhs. + + + + If which() == rhs.which() then may fail with + any exceptions arising from operator==(T,T), where + T is the contained type of + *this. + + + + + InEquality comparison. + + + bool + + const variant & + + + + + void + + + const U & + + + + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error. + + + + Every bounded type of the variant must + fulfill the requirements of the + EqualityComparable + concept. + + + + true if !(*this == rhs). + + + + If which() == rhs.which() then may fail with + any exceptions arising from operator==(T,T), where + T is the contained type of + *this. + + + + + LessThan comparison. + + + bool + + const variant & + + + + + void + + + const U & + + + + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error. + + + + Every bounded type of the variant must + fulfill the requirements of the + LessThanComparable + concept. + + + + If which() == rhs.which() then: + content_this < content_rhs, where + content_this is the content of *this + and content_rhs is the content of rhs. + Otherwise: which() < rhs.which(). + + + + If which() == rhs.which() then may fail with + any exceptions arising from operator<(T,T), + where T is the contained type of + *this. + + + + + + GreaterThan comparison. + + + bool + + const variant & + + + + + void + + + const U & + + + + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error. + + + + Every bounded type of the variant must + fulfill the requirements of the + LessThanComparable + concept. + + + + true if rhs < *this. + + + + May fail with + any exceptions arising from operator<(T,T), + where T is the contained type of + *this. + + + + + + LessThan or Equal comparison. + + + bool + + const variant & + + + + + void + + + const U & + + + + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error. + + + + Every bounded type of the variant must + fulfill the requirements of the + LessThanComparable + concept. + + + + true if !(*this > rhs). + + + + May fail with + any exceptions arising from operator<(T,T), + where T is the contained type of + *this. + + + + + + GreaterThan or Equal comparison. + + + bool + + const variant & + + + + + void + + + const U & + + + + + The overload returning void exists only to + prohibit implicit conversion of the operator's right-hand side + to variant; thus, its use will (purposefully) + result in a compile-time error. + + + + Every bounded type of the variant must + fulfill the requirements of the + LessThanComparable + concept. + + + + true if !(*this < lhs). + + + + May fail with + any exceptions arising from operator<(T,T), + where T is the contained type of + *this. + + + + + + + + + + void + + + variant<T1, T2, ..., TN> & + + + + variant<T1, T2, ..., TN> & + + + + Swaps lhs with rhs by application + of variant::swap. + + + + May fail with any exception arising from + variant::swap. + + + + + Provides streaming output for variant types. + + + + std::basic_ostream<ElemType,Traits> & + + + std::basic_ostream<ElemType,Traits> & + + + + const variant<T1, T2, ..., TN> & + + + + Every bounded type of the variant must + fulfill the requirements of the + OutputStreamable + concept. + + + + Calls out << x, where x is + the content of rhs. + + + + Not available when BOOST_NO_IOSTREAM is + defined. + + + + + + Provides hashing for variant types so + that boost::hash may compute hash. + + + + std::size_t + + + const variant<T1, T2, ..., TN> & + + + + Every bounded type of the variant must + fulfill the requirements of the + Hashable + concept. + + + + Calls boost::hash<T>()(x), where x is + the content of rhs and T is its type. + + + + Actually, this function is defined in + <boost/variant/detail/hash_variant.hpp> + header. + + + + + + + Exposes a variant whose bounded types are the + elements of the given type sequence. + + + + + + variant< unspecified > + + + + type has behavior equivalent in every respect to + variant< Sequence[0], Sequence[1], ... > + (where Sequence[i] denotes the + i-th element of Sequence), except + that no upper limit is imposed on the number of types. + + Notes: + + Sequence must meet the requirements of + MPL's Sequence + concept. + Due to standard conformance problems in several compilers, + make_variant_over may not be supported on your + compiler. See + BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT + for more information. + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/variant_fwd.xml b/tools/boost_1_65_1/libs/variant/doc/reference/variant_fwd.xml new file mode 100644 index 0000000000000000000000000000000000000000..40344c2cebf27365acb38859e36bc2de115689ef --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/variant_fwd.xml @@ -0,0 +1,164 @@ + + + +
+ + + Provides forward declarations of the + boost::variant, + boost::make_variant_over, + boost::make_recursive_variant, and + boost::make_recursive_variant_over + class templates and the boost::recursive_variant_ tag type. + Also defines several preprocessor symbols, as described below. + + + + Expands to the length of the + template parameter list for + variant. Not used if + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + is not defined. + + + + + Note: Conforming + implementations of variant must allow at least ten + template arguments. That is, BOOST_VARIANT_LIMIT_TYPES must be greater + or equal to 10. + + + + + + If this macro is defined, then library won't use C++11 variadic templates. + Users may define this macro to make + BOOST_VARIANT_ENUM_PARAMS + and BOOST_VARIANT_ENUM_SHIFTED_PARAMS expand + to a comma-separated sequence instead of variadic templates. Define this macro if + your compiler has problems with compilation of variadic templates. + + + + + + + + + Enumerate parameters for use with + variant. + + + + When variadic templates are available and + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + is not defined, expands to variadic template list in the following manner: + + BOOST_VARIANT_ENUM_PARAMS(T) => T0, TN... + BOOST_VARIANT_ENUM_PARAMS(class T) => class T0, class... TN + BOOST_VARIANT_ENUM_PARAMS(class Something) => class Something0, class... SomethingN + BOOST_VARIANT_ENUM_PARAMS(typename Something) => typename Something0, typename... SomethingN + BOOST_VARIANT_ENUM_PARAMS(Something) => Something0, SomethingN... + BOOST_VARIANT_ENUM_PARAMS(Something) => Something0, SomethingN... + + + + + Otherwise expands to a comma-separated sequence of length + BOOST_VARIANT_LIMIT_TYPES, where + each element in the sequence consists of the concatenation of + param with its zero-based index into the + sequence. That is, + param ## 0, param ## 1, ..., param ## BOOST_VARIANT_LIMIT_TYPES - 1. + + Rationale: This macro greatly + simplifies for the user the process of declaring + variant types + in function templates or explicit partial specializations of class + templates, as shown in the + tutorial. + + + + + + + + Enumerate all but the first parameter for use with + variant. + + + + When variadic templates are available and + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + is not defined, expands to variadic template list in the following manner: + + BOOST_VARIANT_ENUM_SHIFTED_PARAMS(T) => TN... + BOOST_VARIANT_ENUM_SHIFTED_PARAMS(class T) => class... TN + BOOST_VARIANT_ENUM_SHIFTED_PARAMS(class Something) => class... SomethingN + BOOST_VARIANT_ENUM_SHIFTED_PARAMS(typename Something) => typename... SomethingN + BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something) => SomethingN... + BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something) => SomethingN... + + + + + Otherwise expands to a comma-separated sequence of length + BOOST_VARIANT_LIMIT_TYPES - 1, + where each element in the sequence consists of the concatenation of + param with its one-based index into the sequence. + That is, + param ## 1, ..., param ## BOOST_VARIANT_LIMIT_TYPES - 1. + + Note: This macro results in the + same expansion as + BOOST_VARIANT_ENUM_PARAMS -- but + without the first term. + + + + + + Indicates absence of support for specifying the bounded types + of a variant by the elements of a + type sequence. + + + + Defined only if + make_variant_over and + make_recursive_variant_over + are not supported for some reason on the target compiler. + + + + + + Indicates + make_recursive_variant operates in + an implementation-defined manner. + + + + Defined only if + make_recursive_variant does not + operate as documented on the target compiler, but rather in an + implementation-defined manner. + + Implementation Note: If + BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT is + defined for the target compiler, the current implementation uses the + MPL lambda mechanism to approximate the + desired behavior. (In most cases, however, such compilers do not have + full lambda support either.) + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/reference/visitor_ptr.xml b/tools/boost_1_65_1/libs/variant/doc/reference/visitor_ptr.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f2762f18471de167ef0fb51672334f1fdcae6af --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/reference/visitor_ptr.xml @@ -0,0 +1,114 @@ + + + +
+ + + + + + Adapts a function pointer for use as a static visitor. + + Adapts the function given at construction for use as a + static visitor + of type T with result type R. + + + static_visitor<R> + + + + R (*)(T) + + + + Constructs the visitor with the given function. + + + + + + + R + + + unspecified-forwarding-type + + + + + + + void + + + const U& + + + + + If passed a value or reference of type + T, it invokes the function given at + construction, appropriately forwarding + operand. + + Returns the result of the function invocation. + + + The overload taking a value or reference of type + T throws if the invoked function throws. + The overload taking all other values always + throws bad_visit. + + + + + + + + Returns a visitor object that adapts function pointers for + use as a static visitor. + + + Constructs and returns a + visitor_ptr_t adaptor over the + given function. + + + + + visitor_ptr_t<T,R> + + + R (*)(T) + + + + Returns a visitor_ptr_t + visitor object that, when applied, invokes the given + function. + + + + Will not throw. (Note, however, that the returned + visitor object may + throw when applied.) + + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/tutorial/advanced.xml b/tools/boost_1_65_1/libs/variant/doc/tutorial/advanced.xml new file mode 100644 index 0000000000000000000000000000000000000000..d4e8be738ccd5a39914f5d788145f8e3b820c93c --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/tutorial/advanced.xml @@ -0,0 +1,419 @@ + + + +
+ Advanced Topics + + + + +This section discusses several features of the library often required + for advanced uses of variant. Unlike in the above section, each + feature presented below is largely independent of the others. Accordingly, + this section is not necessarily intended to be read linearly or in its + entirety. + +
+ Preprocessor macros + + While the variant class template's variadic parameter + list greatly simplifies use for specific instantiations of the template, + it significantly complicates use for generic instantiations. For instance, + while it is immediately clear how one might write a function accepting a + specific variant instantiation, say + variant<int, std::string>, it is less clear how one + might write a function accepting any given variant. + + Due to the lack of support for true variadic template parameter lists + in the C++98 standard, the preprocessor is needed. While the + Preprocessor library provides a general and + powerful solution, the need to repeat + BOOST_VARIANT_LIMIT_TYPES + unnecessarily clutters otherwise simple code. Therefore, for common + use-cases, this library provides its own macro + BOOST_VARIANT_ENUM_PARAMS. + + This macro simplifies for the user the process of declaring + variant types in function templates or explicit partial + specializations of class templates, as shown in the following: + +// general cases +template <typename T> void some_func(const T &); +template <typename T> class some_class; + +// function template overload +template <BOOST_VARIANT_ENUM_PARAMS(typename T)> +void some_func(const boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> &); + +// explicit partial specialization +template <BOOST_VARIANT_ENUM_PARAMS(typename T)> +class some_class< boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >; + + + +
+ +
+ Using a type sequence to specify bounded types + + While convenient for typical uses, the variant class + template's variadic template parameter list is limiting in two significant + dimensions. First, due to the lack of support for true variadic template + parameter lists in C++, the number of parameters must be limited to some + implementation-defined maximum (namely, + BOOST_VARIANT_LIMIT_TYPES). + Second, the nature of parameter lists in general makes compile-time + manipulation of the lists excessively difficult. + + To solve these problems, + make_variant_over< Sequence > + exposes a variant whose bounded types are the elements of + Sequence (where Sequence is any type fulfilling + the requirements of MPL's + Sequence concept). For instance, + +typedef mpl::vector< std::string > types_initial; +typedef mpl::push_front< types_initial, int >::type types; + +boost::make_variant_over< types >::type v1; + + behaves equivalently to + +boost::variant< int, std::string > v2; + + + + Portability: Unfortunately, due to + standard conformance issues in several compilers, + make_variant_over is not universally available. On these + compilers the library indicates its lack of support for the syntax via the + definition of the preprocessor symbol + BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT. + +
+ +
+ Recursive <code>variant</code> types + + Recursive types facilitate the construction of complex semantics from + simple syntax. For instance, nearly every programmer is familiar with the + canonical definition of a linked list implementation, whose simple + definition allows sequences of unlimited length: + +template <typename T> +struct list_node +{ + T data; + list_node * next; +}; + + + + The nature of variant as a generic class template + unfortunately precludes the straightforward construction of recursive + variant types. Consider the following attempt to construct + a structure for simple mathematical expressions: + + struct add; +struct sub; +template <typename OpTag> struct binary_op; + +typedef boost::variant< + int + , binary_op<add> + , binary_op<sub> + > expression; + +template <typename OpTag> +struct binary_op +{ + expression left; // variant instantiated here... + expression right; + + binary_op( const expression & lhs, const expression & rhs ) + : left(lhs), right(rhs) + { + } + +}; // ...but binary_op not complete until here! + + + + While well-intentioned, the above approach will not compile because + binary_op is still incomplete when the variant + type expression is instantiated. Further, the approach suffers + from a more significant logical flaw: even if C++ syntax were different + such that the above example could be made to "work," + expression would need to be of infinite size, which is + clearly impossible. + + To overcome these difficulties, variant includes special + support for the + boost::recursive_wrapper class + template, which breaks the circular dependency at the heart of these + problems. Further, + boost::make_recursive_variant provides + a more convenient syntax for declaring recursive variant + types. Tutorials for use of these facilities is described in + and + . + +
+ Recursive types with <code>recursive_wrapper</code> + + The following example demonstrates how recursive_wrapper + could be used to solve the problem presented in + : + + typedef boost::variant< + int + , boost::recursive_wrapper< binary_op<add> > + , boost::recursive_wrapper< binary_op<sub> > + > expression; + + + + Because variant provides special support for + recursive_wrapper, clients may treat the resultant + variant as though the wrapper were not present. This is seen + in the implementation of the following visitor, which calculates the value + of an expression without any reference to + recursive_wrapper: + + class calculator : public boost::static_visitor<int> +{ +public: + + int operator()(int value) const + { + return value; + } + + int operator()(const binary_op<add> & binary) const + { + return boost::apply_visitor( calculator(), binary.left ) + + boost::apply_visitor( calculator(), binary.right ); + } + + int operator()(const binary_op<sub> & binary) const + { + return boost::apply_visitor( calculator(), binary.left ) + - boost::apply_visitor( calculator(), binary.right ); + } + +}; + + + + Finally, we can demonstrate expression in action: + + void f() +{ + // result = ((7-3)+8) = 12 + expression result( + binary_op<add>( + binary_op<sub>(7,3) + , 8 + ) + ); + + assert( boost::apply_visitor(calculator(),result) == 12 ); +} + + + + Performance: boost::recursive_wrapper + has no empty state, which makes its move constructor not very optimal. Consider using std::unique_ptr + or some other safe pointer for better performance on C++11 compatible compilers. + +
+ +
+ Recursive types with <code>make_recursive_variant</code> + + For some applications of recursive variant types, a user + may be able to sacrifice the full flexibility of using + recursive_wrapper with variant for the following + convenient syntax: + +typedef boost::make_recursive_variant< + int + , std::vector< boost::recursive_variant_ > + >::type int_tree_t; + + + + Use of the resultant variant type is as expected: + +std::vector< int_tree_t > subresult; +subresult.push_back(3); +subresult.push_back(5); + +std::vector< int_tree_t > result; +result.push_back(1); +result.push_back(subresult); +result.push_back(7); + +int_tree_t var(result); + + + + To be clear, one might represent the resultant content of + var as ( 1 ( 3 5 ) 7 ). + + Finally, note that a type sequence can be used to specify the bounded + types of a recursive variant via the use of + boost::make_recursive_variant_over, + whose semantics are the same as make_variant_over (which is + described in ). + + Portability: Unfortunately, due to + standard conformance issues in several compilers, + make_recursive_variant is not universally supported. On these + compilers the library indicates its lack of support via the definition + of the preprocessor symbol + BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT. + Thus, unless working with highly-conformant compilers, maximum portability + will be achieved by instead using recursive_wrapper, as + described in + . + +
+ +
+ +
+ Binary visitation + + As the tutorial above demonstrates, visitation is a powerful mechanism + for manipulating variant content. Binary visitation further + extends the power and flexibility of visitation by allowing simultaneous + visitation of the content of two different variant + objects. + + Notably this feature requires that binary visitors are incompatible + with the visitor objects discussed in the tutorial above, as they must + operate on two arguments. The following demonstrates the implementation of + a binary visitor: + +class are_strict_equals + : public boost::static_visitor<bool> +{ +public: + + template <typename T, typename U> + bool operator()( const T &, const U & ) const + { + return false; // cannot compare different types + } + + template <typename T> + bool operator()( const T & lhs, const T & rhs ) const + { + return lhs == rhs; + } + +}; + + + + As expected, the visitor is applied to two variant + arguments by means of apply_visitor: + +boost::variant< int, std::string > v1( "hello" ); + +boost::variant< double, std::string > v2( "hello" ); +assert( boost::apply_visitor(are_strict_equals(), v1, v2) ); + +boost::variant< int, const char * > v3( "hello" ); +assert( !boost::apply_visitor(are_strict_equals(), v1, v3) ); + + + + Finally, we must note that the function object returned from the + "delayed" form of + apply_visitor also supports + binary visitation, as the following demonstrates: + +typedef boost::variant<double, std::string> my_variant; + +std::vector< my_variant > seq1; +seq1.push_back("pi is close to "); +seq1.push_back(3.14); + +std::list< my_variant > seq2; +seq2.push_back("pi is close to "); +seq2.push_back(3.14); + +are_strict_equals visitor; +assert( std::equal( + seq1.begin(), seq1.end(), seq2.begin() + , boost::apply_visitor( visitor ) + ) ); + + + +
+ +
+ Multi visitation + + Multi visitation extends the power and flexibility of visitation by allowing simultaneous + visitation of the content of three and more different variant + objects. Note that header for multi visitors shall be included separately. + + Notably this feature requires that multi visitors are incompatible + with the visitor objects discussed in the tutorial above, as they must + operate on same amout of arguments that was passed to apply_visitor. + The following demonstrates the implementation of a multi visitor for three parameters: + + +#include <boost/variant/multivisitors.hpp> + +typedef boost::variant<int, double, bool> bool_like_t; +typedef boost::variant<int, double> arithmetics_t; + +struct if_visitor: public boost::static_visitor<arithmetics_t> { + template <class T1, class T2> + arithmetics_t operator()(bool b, T1 v1, T2 v2) const { + if (b) { + return v1; + } else { + return v2; + } + } +}; + + + + As expected, the visitor is applied to three variant + arguments by means of apply_visitor: + + +bool_like_t v0(true), v1(1), v2(2.0); + +assert( + boost::apply_visitor(if_visitor(), v0, v1, v2) + == + arithmetics_t(1) +); + + + + Finally, we must note that multi visitation does not support + "delayed" form of + apply_visitor if + BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES is defined. + + +
+ + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/tutorial/basic.xml b/tools/boost_1_65_1/libs/variant/doc/tutorial/basic.xml new file mode 100644 index 0000000000000000000000000000000000000000..f128b6353e3e43f0aa12b697a95d177a4a605ed9 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/tutorial/basic.xml @@ -0,0 +1,214 @@ + + + +
+ Basic Usage + + + + +A discriminated union container on some set of types is defined by + instantiating the boost::variant class + template with the desired types. These types are called + bounded types and are subject to the + requirements of the + BoundedType + concept. Any number of bounded types may be specified, up to some + implementation-defined limit (see + BOOST_VARIANT_LIMIT_TYPES). + +For example, the following declares a discriminated union container on + int and std::string: + +boost::variant< int, std::string > v; + + + +By default, a variant default-constructs its first + bounded type, so v initially contains int(0). If + this is not desired, or if the first bounded type is not + default-constructible, a variant can be constructed + directly from any value convertible to one of its bounded types. Similarly, + a variant can be assigned any value convertible to one of its + bounded types, as demonstrated in the following: + +v = "hello"; + + + +Now v contains a std::string equal to + "hello". We can demonstrate this by + streaming v to standard + output: + +std::cout << v << std::endl; + + + +Usually though, we would like to do more with the content of a + variant than streaming. Thus, we need some way to access the + contained value. There are two ways to accomplish this: + apply_visitor, which is safest + and very powerful, and + get<T>, which is + sometimes more convenient to use. + +For instance, suppose we wanted to concatenate to the string contained + in v. With value retrieval + by get, this may be accomplished + quite simply, as seen in the following: + +std::string& str = boost::get<std::string>(v); +str += " world! "; + + + +As desired, the std::string contained by v now + is equal to "hello world! ". Again, we can demonstrate this by + streaming v to standard output: + +std::cout << v << std::endl; + + + +While use of get is perfectly acceptable in this trivial + example, get generally suffers from several significant + shortcomings. For instance, if we were to write a function accepting a + variant<int, std::string>, we would not know whether + the passed variant contained an int or a + std::string. If we insisted upon continued use of + get, we would need to query the variant for its + contained type. The following function, which "doubles" the + content of the given variant, demonstrates this approach: + +void times_two( boost::variant< int, std::string > & operand ) +{ + if ( int* pi = boost::get<int>( &operand ) ) + *pi *= 2; + else if ( std::string* pstr = boost::get<std::string>( &operand ) ) + *pstr += *pstr; +} + + + +However, such code is quite brittle, and without careful attention will + likely lead to the introduction of subtle logical errors detectable only at + runtime. For instance, consider if we wished to extend + times_two to operate on a variant with additional + bounded types. Specifically, let's add + std::complex<double> to the set. Clearly, we would need + to at least change the function declaration: + +void times_two( boost::variant< int, std::string, std::complex<double> > & operand ) +{ + // as above...? +} + + + +Of course, additional changes are required, for currently if the passed + variant in fact contained a std::complex value, + times_two would silently return -- without any of the desired + side-effects and without any error. In this case, the fix is obvious. But in + more complicated programs, it could take considerable time to identify and + locate the error in the first place. + +Thus, real-world use of variant typically demands an access + mechanism more robust than get. For this reason, + variant supports compile-time checked + visitation via + apply_visitor. Visitation requires + that the programmer explicitly handle (or ignore) each bounded type. Failure + to do so results in a compile-time error. + +Visitation of a variant requires a visitor object. The + following demonstrates one such implementation of a visitor implementating + behavior identical to times_two: + +class times_two_visitor + : public boost::static_visitor<> +{ +public: + + void operator()(int & i) const + { + i *= 2; + } + + void operator()(std::string & str) const + { + str += str; + } + +}; + + + +With the implementation of the above visitor, we can then apply it to + v, as seen in the following: + +boost::apply_visitor( times_two_visitor(), v ); + + + +As expected, the content of v is now a + std::string equal to "hello world! hello world! ". + (We'll skip the verification this time.) + +In addition to enhanced robustness, visitation provides another + important advantage over get: the ability to write generic + visitors. For instance, the following visitor will "double" the + content of any variant (provided its + bounded types each support operator+=): + +class times_two_generic + : public boost::static_visitor<> +{ +public: + + template <typename T> + void operator()( T & operand ) const + { + operand += operand; + } + +}; + + + +Again, apply_visitor sets the wheels in motion: + +boost::apply_visitor( times_two_generic(), v ); + + + +While the initial setup costs of visitation may exceed that required for + get, the benefits quickly become significant. Before concluding + this section, we should explore one last benefit of visitation with + apply_visitor: + delayed visitation. Namely, a special form + of apply_visitor is available that does not immediately apply + the given visitor to any variant but rather returns a function + object that operates on any variant given to it. This behavior + is particularly useful when operating on sequences of variant + type, as the following demonstrates: + +std::vector< boost::variant<int, std::string> > vec; +vec.push_back( 21 ); +vec.push_back( "hello " ); + +times_two_generic visitor; +std::for_each( + vec.begin(), vec.end() + , boost::apply_visitor(visitor) + ); + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/tutorial/tutorial.xml b/tools/boost_1_65_1/libs/variant/doc/tutorial/tutorial.xml new file mode 100644 index 0000000000000000000000000000000000000000..565363ac5684fcffae5f7b37f6ea9620f159f2c5 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/tutorial/tutorial.xml @@ -0,0 +1,16 @@ + + + +
+ +Tutorial + + + +
diff --git a/tools/boost_1_65_1/libs/variant/doc/variant.xml b/tools/boost_1_65_1/libs/variant/doc/variant.xml new file mode 100644 index 0000000000000000000000000000000000000000..f71fd664fc417bf4c075be271e463293a40dfaf2 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/doc/variant.xml @@ -0,0 +1,55 @@ + + + + + + + Eric + Friedman + + + Itay + Maman + + + + 2002 + 2003 + Eric Friedman + Itay Maman + + + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) + + + + Safe, generic, stack-based discriminated union container + + + + +Boost.Variant + + + + + + + + + diff --git a/tools/boost_1_65_1/libs/variant/index.html b/tools/boost_1_65_1/libs/variant/index.html new file mode 100644 index 0000000000000000000000000000000000000000..17fc68c6370bbc5ade9bca7ca010d070a8b7a726 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/index.html @@ -0,0 +1,9 @@ + + + + + +Automatic redirection failed, please go to +../../doc/html/variant.html + + diff --git a/tools/boost_1_65_1/libs/variant/meta/libraries.json b/tools/boost_1_65_1/libs/variant/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..e0b9a5981987a6f4686088b85bcf4774d673a11a --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/meta/libraries.json @@ -0,0 +1,17 @@ +{ + "key": "variant", + "name": "Variant", + "authors": [ + "Eric Friedman", + "Itay Maman" + ], + "description": "Safe, generic, stack-based discriminated union container.", + "category": [ + "Containers", + "Data" + ], + "maintainers": [ + "Antony Polukhin ", + "Eric Friedman " + ] +} diff --git a/tools/boost_1_65_1/libs/variant/perf/Jamfile.v2 b/tools/boost_1_65_1/libs/variant/perf/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..b8d43b0825c8f0f8bbcf70e249ea34a1f7492321 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/perf/Jamfile.v2 @@ -0,0 +1,29 @@ +#============================================================================== +# Copyright (c) 2012 Antony Polukhin +# +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#============================================================================== + +# performance tests +import testing ; +import path ; + +path-constant TEST_DIR : . ; + +project performance/test + : source-location ./ + : requirements +# /boost/chrono//boost_chrono +# /boost/system//boost_system + static + freebsd:"-lrt" + linux:"-lrt" + gcc:-fvisibility=hidden + intel-linux:-fvisibility=hidden + sun:-xldscope=hidden + : default-build release + ; + +run move_perf.cpp : $(TEST_DIR) ; + diff --git a/tools/boost_1_65_1/libs/variant/perf/move_perf.cpp b/tools/boost_1_65_1/libs/variant/perf/move_perf.cpp new file mode 100644 index 0000000000000000000000000000000000000000..efdd31d0077bfc417d4bb3d6ea4ba8a20f0bc0bf --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/perf/move_perf.cpp @@ -0,0 +1,236 @@ +// (C) Copyright Antony Polukhin 2012-2014. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for most recent version. + +// +// Testing variant performance rvalue copy/assign performance +// + +#define BOOST_ERROR_CODE_HEADER_ONLY +#define BOOST_CHRONO_HEADER_ONLY +#include + +#include +#include +#include + + struct scope { + typedef boost::chrono::steady_clock test_clock; + typedef boost::chrono::milliseconds duration_t; + test_clock::time_point start_; + const char* const message_; + + explicit scope(const char* const message) + : start_(test_clock::now()) + , message_(message) + {} + + ~scope() { + std::cout << message_ << " " << boost::chrono::duration_cast(test_clock::now() - start_) << std::endl; + } + }; + + + +static void do_test(bool do_count_cleanup_time = false) { + BOOST_STATIC_CONSTANT(std::size_t, c_run_count = 5000000); + typedef std::vector str_t; + typedef boost::variant var_t; + + const char hello1_c[] = "hello long word"; + const str_t hello1(hello1_c, hello1_c + sizeof(hello1_c)); + + const char hello2_c[] = "Helllloooooooooooooooooooooooooooooooo!!!!!!!!!!!!!"; + const str_t hello2(hello2_c, hello2_c + sizeof(hello2_c)); + + if (do_count_cleanup_time) { + std::cout << "#############################################\n"; + std::cout << "#############################################\n"; + std::cout << "NOW TIMES WITH DATA DESTRUCTION\n"; + std::cout << "#############################################\n"; + } + + std::vector data_from, data_to; + data_from.resize(c_run_count, hello1); + data_to.reserve(c_run_count); + { + scope sc("boost::variant(const variant&) copying speed"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to.push_back(data_from[i]); + + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + data_from.resize(c_run_count, hello1); + data_to.clear(); + data_to.reserve(c_run_count); + { + scope sc("boost::variant(variant&&) moving speed"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to.push_back(boost::move(data_from[i])); + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + std::cout << "#############################################\n"; + + data_from.clear(); + data_from.resize(c_run_count, hello2); + data_to.clear(); + data_to.resize(c_run_count, hello2); + { + scope sc("boost::variant=(const variant&) copying speed on same types"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = data_from[i]; + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + data_from.resize(c_run_count, hello2); + data_to.clear(); + data_to.resize(c_run_count, hello2); + { + scope sc("boost::variant=(variant&&) moving speed on same types"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = boost::move(data_from[i]); + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + std::cout << "#############################################\n"; + + data_from.clear(); + data_from.resize(c_run_count, hello2); + + data_to.clear(); + data_to.resize(c_run_count, var_t(0)); + { + scope sc("boost::variant=(const variant&) copying speed on different types"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = data_from[i]; + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + data_from.resize(c_run_count, hello2); + data_to.clear(); + data_to.resize(c_run_count, var_t(0)); + { + scope sc("boost::variant=(variant&&) moving speed on different types"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = boost::move(data_from[i]); + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + std::cout << "#############################################\n"; + + data_from.clear(); + data_from.resize(c_run_count, var_t(0)); + + data_to.clear(); + data_to.resize(c_run_count, hello2); + { + scope sc("boost::variant=(const variant&) copying speed on different types II"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = data_from[i]; + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + data_from.resize(c_run_count, var_t(0)); + data_to.clear(); + data_to.resize(c_run_count, hello2); + { + scope sc("boost::variant=(variant&&) moving speed on different types II"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = boost::move(data_from[i]); + } + + if (do_count_cleanup_time) { + data_to.clear(); + data_from.clear(); + } + } + + + std::cout << "#############################################\n"; + + std::vector s1(c_run_count, hello2); + data_to.clear(); + data_to.resize(c_run_count, var_t(0)); + + { + scope sc("boost::variant=(const T&) copying speed"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = s1[i]; + } + + if (do_count_cleanup_time) { + data_to.clear(); + s1.clear(); + } + } + + std::vector s2(c_run_count, hello2); + data_to.clear(); + data_to.resize(c_run_count, var_t(0)); + { + scope sc("boost::variant=(T&&) moving speed"); + for (std::size_t i = 0; i < c_run_count; ++i) { + data_to[i] = boost::move(s2[i]); + } + + if (do_count_cleanup_time) { + data_to.clear(); + s2.clear(); + } + } +} + + +int main () { + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + std::cout << "# Running tests in C++11 mode (with rvalues).\n"; +#else + std::cout << "# Running tests in C++03 mode (without rvalues).\n"; +#endif + + do_test(false); + do_test(true); +} + + diff --git a/tools/boost_1_65_1/libs/variant/test/Jamfile.v2 b/tools/boost_1_65_1/libs/variant/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..c071b77d1430fdfceda18802e5287573ce4e4413 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/Jamfile.v2 @@ -0,0 +1,58 @@ +# Boost.Variant Library test Jamfile +# +# Copyright (C) 2003, Eric Friedman, Itay Maman. +# Copyright (C) 2013, Antony Polukhin. +# +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +project + : requirements + #/boost/test//minimal + msvc:on + ; +test-suite variant + : + [ run test1.cpp class_a.cpp : : : : variant_test1 ] + [ run test2.cpp : : : : variant_test2 ] + [ run test3.cpp : : : : variant_test3 ] + [ run test3.cpp : : : off BOOST_NO_RTTI BOOST_NO_TYPEID : variant_test3_no_rtti ] + [ run test4.cpp class_a.cpp + : : : : variant_test4 ] + [ run test5.cpp : : : : variant_test5 ] + [ run test6.cpp : : : : variant_test6 ] + [ run test7.cpp : : : : variant_test7 ] + [ run test8.cpp : : : : variant_test8 ] + [ run test9.cpp : : : : variant_test9 ] + [ run recursive_variant_test.cpp ] + [ run variant_reference_test.cpp ] + [ run variant_comparison_test.cpp ] + [ run variant_visit_test.cpp ] + [ run variant_get_test.cpp ] + [ compile-fail variant_rvalue_get_with_ampersand_test.cpp ] + [ run variant_polymorphic_get_test.cpp ] + [ run variant_multivisit_test.cpp ] + [ run hash_variant_test.cpp ] + [ run rvalue_test.cpp ] + [ run variant_nonempty_check.cpp ] + [ run recursive_variant_test.cpp : : : BOOST_NO_EXCEPTIONS + gcc-4.3:-fno-exceptions + gcc-4.4:-fno-exceptions + gcc-4.5:-fno-exceptions + gcc-4.6:-fno-exceptions + gcc-4.7:-fno-exceptions + gcc-4.8:-fno-exceptions + clang:-fno-exceptions + : variant_noexcept_test + ] + [ run recursive_variant_test.cpp : : : off BOOST_NO_RTTI BOOST_NO_TYPEID : variant_no_rtti_test ] + [ run hash_recursive_variant_test.cpp ] + [ run variant_swap_test.cpp ] + [ run auto_visitors.cpp ] + [ run overload_selection.cpp ] + [ run recursive_wrapper_move_test.cpp ] + [ run variant_over_joint_view_test.cpp ] + ; + + diff --git a/tools/boost_1_65_1/libs/variant/test/auto_visitors.cpp b/tools/boost_1_65_1/libs/variant/test/auto_visitors.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ae83314054630d84d57bd5cc1e1823abafc3d5f --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/auto_visitors.cpp @@ -0,0 +1,380 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/auto_visitors.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2014-2015 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" +#include "boost/variant/multivisitors.hpp" +#include "boost/lexical_cast.hpp" + +#include +#include + +namespace has_result_type_tests { + template + struct wrap { + typedef T result_type; + }; + + struct s1 : wrap {}; + struct s2 : wrap {}; + struct s3 : wrap {}; + struct s4 {}; + struct s5 : wrap {}; + struct s6 : wrap {}; + struct s7 : wrap {}; + struct s8 : wrap {}; + struct s9 : wrap {}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + struct s10 : wrap {}; +#endif + struct s11 : wrap {}; + struct s12 : wrap {}; + struct s13 : wrap {}; + struct s14 { typedef int result_type; }; + struct s15 { typedef int& result_type; }; + struct s16 { typedef const int& result_type; }; +} + + +void test_has_result_type_triat() { + using namespace has_result_type_tests; + using boost::detail::variant::has_result_type; + + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(!has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + BOOST_CHECK(has_result_type::value); +#endif + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); + BOOST_CHECK(has_result_type::value); +} + +struct lex_streamer_explicit: boost::static_visitor { + template + const char* operator()(const T& ) { + return "10"; + } + + template + const char* operator()(const T1& , const T2& ) { + return "100"; + } +}; + + +void run_explicit() +{ + typedef boost::variant variant_type; + variant_type v2("10"), v1("100"); + + lex_streamer_explicit visitor_ref; + + // Must return instance of std::string + BOOST_CHECK(boost::apply_visitor(visitor_ref, v2).c_str() == std::string("10")); + BOOST_CHECK(boost::apply_visitor(visitor_ref, v2, v1).c_str() == std::string("100")); +} + + +// Most part of tests from this file require decltype(auto) + +#ifdef BOOST_NO_CXX14_DECLTYPE_AUTO + +void run() +{ + BOOST_CHECK(true); +} + +void run2() +{ + BOOST_CHECK(true); +} + + +void run3() +{ + BOOST_CHECK(true); +} + +#else + +#include + +struct lex_streamer { + template + std::string operator()(const T& val) const { + return boost::lexical_cast(val); + } +}; + +struct lex_streamer_void { + template + void operator()(const T& val) const { + std::cout << val << std::endl; + } + + + template + void operator()(const T1& val, const T2& val2) const { + std::cout << val << '+' << val2 << std::endl; + } + + + template + void operator()(const T1& val, const T2& val2, const T3& val3) const { + std::cout << val << '+' << val2 << '+' << val3 << std::endl; + } +}; + + +struct lex_streamer2 { + std::string res; + + template + const char* operator()(const T& val) const { + return "fail"; + } + + template + const char* operator()(const T1& v1, const T2& v2) const { + return "fail2"; + } + + + template + const char* operator()(const T1& v1, const T2& v2, const T3& v3) const { + return "fail3"; + } + + template + std::string& operator()(const T& val) { + res = boost::lexical_cast(val); + return res; + } + + + template + std::string& operator()(const T1& v1, const T2& v2) { + res = boost::lexical_cast(v1) + "+" + boost::lexical_cast(v2); + return res; + } + + + template + std::string& operator()(const T1& v1, const T2& v2, const T3& v3) { + res = boost::lexical_cast(v1) + "+" + boost::lexical_cast(v2) + + "+" + boost::lexical_cast(v3); + return res; + } +}; + +#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES +# define BOOST_CHECK_IF_HAS_VARIADIC(x) BOOST_CHECK(x) +#else +# define BOOST_CHECK_IF_HAS_VARIADIC(x) /**/ +#endif + +void run() +{ + typedef boost::variant variant_type; + variant_type v1(1), v2("10"), v3(100.0); + lex_streamer lex_streamer_visitor; + + BOOST_CHECK(boost::apply_visitor(lex_streamer(), v1) == "1"); + BOOST_CHECK_IF_HAS_VARIADIC(boost::apply_visitor(lex_streamer_visitor)(v1) == "1"); + BOOST_CHECK(boost::apply_visitor(lex_streamer(), v2) == "10"); + BOOST_CHECK_IF_HAS_VARIADIC(boost::apply_visitor(lex_streamer_visitor)(v2) == "10"); + + #ifndef BOOST_NO_CXX14_GENERIC_LAMBDAS + BOOST_CHECK(boost::apply_visitor([](auto v) { return boost::lexical_cast(v); }, v1) == "1"); + BOOST_CHECK(boost::apply_visitor([](auto v) { return boost::lexical_cast(v); }, v2) == "10"); + + // Retun type must be the same in all instances, so this code does not compile + //boost::variant v_diff_types(1); + //BOOST_CHECK(boost::apply_visitor([](auto v) { return v; }, v_diff_types) == 1); + + boost::apply_visitor([](auto v) { std::cout << v << std::endl; }, v1); + boost::apply_visitor([](auto v) { std::cout << v << std::endl; }, v2); + #endif + + lex_streamer2 visitor_ref; + BOOST_CHECK(boost::apply_visitor(visitor_ref, v1) == "1"); + BOOST_CHECK(boost::apply_visitor(visitor_ref, v2) == "10"); +#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + std::string& ref_to_string = boost::apply_visitor(visitor_ref, v1); + BOOST_CHECK(ref_to_string == "1"); +#endif + lex_streamer_void lex_streamer_void_visitor; + boost::apply_visitor(lex_streamer_void(), v1); + boost::apply_visitor(lex_streamer_void(), v2); +#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + boost::apply_visitor(lex_streamer_void_visitor)(v2); +#endif + + boost::ignore_unused(lex_streamer_visitor, visitor_ref, lex_streamer_void_visitor); +} + + +struct lex_combine { + template + std::string operator()(const T1& v1, const T2& v2) const { + return boost::lexical_cast(v1) + "+" + boost::lexical_cast(v2); + } + + + template + std::string operator()(const T1& v1, const T2& v2, const T3& v3) const { + return boost::lexical_cast(v1) + "+" + + boost::lexical_cast(v2) + '+' + + boost::lexical_cast(v3); + } +}; + +void run2() +{ + typedef boost::variant variant_type; + variant_type v1(1), v2("10"), v3(100.0); + lex_combine lex_combine_visitor; + + BOOST_CHECK(boost::apply_visitor(lex_combine(), v1, v2) == "1+10"); + BOOST_CHECK(boost::apply_visitor(lex_combine(), v2, v1) == "10+1"); + BOOST_CHECK_IF_HAS_VARIADIC(boost::apply_visitor(lex_combine_visitor)(v2, v1) == "10+1"); + + + #ifndef BOOST_NO_CXX14_GENERIC_LAMBDAS + BOOST_CHECK( + boost::apply_visitor( + [](auto v1, auto v2) { + return boost::lexical_cast(v1) + "+" + + boost::lexical_cast(v2); + } + , v1 + , v2 + ) == "1+10" + ); + BOOST_CHECK( + boost::apply_visitor( + [](auto v1, auto v2) { + return boost::lexical_cast(v1) + "+" + + boost::lexical_cast(v2); + } + , v2 + , v1 + ) == "10+1" + ); + + boost::apply_visitor([](auto v1, auto v2) { std::cout << v1 << '+' << v2 << std::endl; }, v1, v2); + boost::apply_visitor([](auto v1, auto v2) { std::cout << v1 << '+' << v2 << std::endl; }, v2, v1); + #endif + + + lex_streamer2 visitor_ref; + BOOST_CHECK(boost::apply_visitor(visitor_ref, v1, v2) == "1+10"); + BOOST_CHECK(boost::apply_visitor(visitor_ref, v2, v1) == "10+1"); +#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + std::string& ref_to_string = boost::apply_visitor(visitor_ref)(v1, v2); + BOOST_CHECK(ref_to_string == "1+10"); +#endif + + boost::apply_visitor(lex_streamer_void(), v1, v2); + boost::apply_visitor(lex_streamer_void(), v2, v1); + + boost::ignore_unused(lex_combine_visitor, visitor_ref); +} + +#undef BOOST_CHECK_IF_HAS_VARIADIC + +void run3() +{ +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) + typedef boost::variant variant_type; + variant_type v1(1), v2("10"), v3(100); + lex_combine lex_combine_visitor; + + BOOST_CHECK(boost::apply_visitor(lex_combine(), v1, v2, v3) == "1+10+100"); + BOOST_CHECK(boost::apply_visitor(lex_combine(), v2, v1, v3) == "10+1+100"); + BOOST_CHECK(boost::apply_visitor(lex_combine_visitor)(v2, v1, v3) == "10+1+100"); + + + #ifndef BOOST_NO_CXX14_GENERIC_LAMBDAS + BOOST_CHECK( + boost::apply_visitor( + [](auto v1, auto v2, auto v3) { + return boost::lexical_cast(v1) + "+" + + boost::lexical_cast(v2) + "+" + + boost::lexical_cast(v3); + } + , v1 + , v2 + , v3 + ) == "1+10+100" + ); + BOOST_CHECK( + boost::apply_visitor( + [](auto v1, auto v2, auto v3) { + return boost::lexical_cast(v1) + "+" + + boost::lexical_cast(v2) + "+" + + boost::lexical_cast(v3); + } + , v3 + , v1 + , v3 + ) == "100+1+100" + ); + + boost::apply_visitor( + [](auto v1, auto v2, auto v3) { std::cout << v1 << '+' << v2 << '+' << v3 << std::endl; }, + v1, v2, v3 + ); + boost::apply_visitor( + [](auto v1, auto v2, auto v3) { std::cout << v1 << '+' << v2 << '+' << v3 << std::endl; }, + v2, v1, v3 + ); + #endif + + + lex_streamer2 visitor_ref; + BOOST_CHECK(boost::apply_visitor(visitor_ref, v1, v2) == "1+10"); + BOOST_CHECK(boost::apply_visitor(visitor_ref)(v2, v1) == "10+1"); + std::string& ref_to_string = boost::apply_visitor(visitor_ref, v1, v2); + BOOST_CHECK(ref_to_string == "1+10"); + + lex_streamer_void lex_streamer_void_visitor; + boost::apply_visitor(lex_streamer_void(), v1, v2, v1); + boost::apply_visitor(lex_streamer_void(), v2, v1, v1); + boost::apply_visitor(lex_streamer_void_visitor)(v2, v1, v1); +#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) +} +#endif + + +int test_main(int , char* []) +{ + run_explicit(); + run(); + run2(); + run3(); + test_has_result_type_triat(); + + return 0; +} diff --git a/tools/boost_1_65_1/libs/variant/test/class_a.cpp b/tools/boost_1_65_1/libs/variant/test/class_a.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7cb1ff81c9de73a289f57f8a5bc0b26f83747b1c --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/class_a.cpp @@ -0,0 +1,65 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/class_a.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include // for std::swap +#include +#include +#include + +#include "class_a.h" + + +using namespace std; + +class_a::~class_a() +{ + assert(self_p_ == this); +} + +class_a::class_a(int n) +{ + n_ = n; + self_p_ = this; +} + +class_a::class_a(const class_a& other) +{ + n_ = other.n_; + self_p_ = this; +} + + +class_a& class_a::operator=(const class_a& rhs) +{ + class_a temp(rhs); + swap(temp); + + return *this; +} + +void class_a::swap(class_a& other) +{ + std::swap(n_, other.n_); +} + +int class_a::get() const +{ + return n_; +} + + + + +std::ostream& operator<<(std::ostream& strm, const class_a& a) +{ + return strm << "class_a(" << a.get() << ")"; +} diff --git a/tools/boost_1_65_1/libs/variant/test/class_a.h b/tools/boost_1_65_1/libs/variant/test/class_a.h new file mode 100644 index 0000000000000000000000000000000000000000..097c2c402d41abcac133e027d2be20f55bf351e2 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/class_a.h @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/libs/test/class_a.h header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef _CLASSA_H_INC_ +#define _CLASSA_H_INC_ + + +#include + +struct class_a +{ + ~class_a(); + class_a(int n = 5511); + class_a(const class_a& other); + + class_a& operator=(const class_a& rhs); + void swap(class_a& other); + + int get() const; + +private: + int n_; + class_a* self_p_; + +}; //Class_a + +std::ostream& operator<<(std::ostream& strm, const class_a& a); + + + +#endif //_CLASSA_H_INC_ diff --git a/tools/boost_1_65_1/libs/variant/test/hash_recursive_variant_test.cpp b/tools/boost_1_65_1/libs/variant/test/hash_recursive_variant_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6148108374091da600b3de03bcf4bc598c406592 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/hash_recursive_variant_test.cpp @@ -0,0 +1,73 @@ +// Copyright (c) 2016 +// Mikhail Maximov +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" +#include "boost/test/minimal.hpp" + +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_HDR_UNORDERED_SET) +// Test is based on reported issues: +// https://svn.boost.org/trac/boost/ticket/12508 +// https://svn.boost.org/trac/boost/ticket/12645 +// Following hash function was not found at compile time, +// because boost::variant construction from boost::recursive_variant_ +// was forbidden. + +#include + +#include "boost/variant.hpp" + +struct hash; + +using int_t = int; + +template +using basic_set_t = std::unordered_set; + +using value_t = boost::make_recursive_variant< + int_t, + basic_set_t +>::type; + +using set_t = basic_set_t; + +struct hash +{ + size_t operator()(const value_t& value) const + { + return 0; + } +}; + +void run() +{ + set_t s; + int_t i = 3; + value_t v = i; + auto emplace_result = s.emplace(v); // raises error above + BOOST_CHECK(emplace_result.second); + v = s; + const set_t& check_set = boost::get(v); + BOOST_CHECK(!check_set.empty()); + for (const auto& check_v : check_set) { + BOOST_CHECK(s.find(check_v) != s.end()); + } + for (const auto& check_v : s) { + BOOST_CHECK(check_set.find(check_v) != check_set.end()); + } +} + +#else // !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_HDR_UNORDERED_SET) +// if no unordered_set and template aliases - does nothing +void run() {} +#endif + +int test_main(int , char* []) +{ + run(); + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/hash_variant_test.cpp b/tools/boost_1_65_1/libs/variant/test/hash_variant_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..16fdd1f5157909c58073b24f370803ef3a4c7489 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/hash_variant_test.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2011-2014 +// Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" +#include "boost/functional/hash/hash.hpp" + +void run() +{ + typedef boost::variant variant_type; + boost::hash hasher; + + variant_type bool_variant1 = true; + variant_type bool_variant2 = false; + variant_type int_variant = 1; + variant_type char_variant1 = '\1'; + variant_type char_variant2 = '\2'; + variant_type uint_variant = static_cast(1); + + BOOST_CHECK(hasher(bool_variant1) != hasher(bool_variant2)); + BOOST_CHECK(hasher(bool_variant1) == hasher(bool_variant1)); + BOOST_CHECK(hasher(int_variant) != hasher(uint_variant)); + BOOST_CHECK(hasher(char_variant1) != hasher(uint_variant)); + BOOST_CHECK(hasher(char_variant1) != hasher(char_variant2)); + BOOST_CHECK(hasher(char_variant1) == hasher(char_variant1)); + BOOST_CHECK(hasher(char_variant2) == hasher(char_variant2)); +} + +int test_main(int , char* []) +{ + run(); + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/jobs.h b/tools/boost_1_65_1/libs/variant/test/jobs.h new file mode 100644 index 0000000000000000000000000000000000000000..4f98fb09c85a0a12381d647309e6bae3a0548d00 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/jobs.h @@ -0,0 +1,335 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/libs/test/jobs.h header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef _JOBSH_INC_ +#define _JOBSH_INC_ + +#include +#include +#include +#include +#include +#include + +#include "boost/variant/variant_fwd.hpp" +#include "boost/variant/get.hpp" +#include "boost/variant/apply_visitor.hpp" +#include "boost/variant/static_visitor.hpp" + +#include "boost/type_index.hpp" +#include "boost/detail/workaround.hpp" +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) +# pragma warn -lvc +#endif + +struct to_text : boost::static_visitor +{ +private: // NO_FUNCTION_TEMPLATE_ORDERING workaround + + template < BOOST_VARIANT_ENUM_PARAMS(typename U) > + std::string to_text_impl( + const boost::variant< BOOST_VARIANT_ENUM_PARAMS(U) >& operand, long + ) const + { + std::ostringstream ost; + ost << "[V] " << boost::apply_visitor(to_text(), operand); + + return ost.str(); + } + + template + std::string to_text_impl(const Value& operand, int) const + { + std::ostringstream ost; + ost << "[V] " << operand; + + return ost.str(); + } + +public: + + template + std::string operator()(const T& operand) const + { + return to_text_impl(operand, 1L); + } + +}; + +struct total_sizeof : boost::static_visitor +{ + total_sizeof() : total_(0) { } + + template + int operator()(const Value&) const + { + total_ += sizeof(Value); + return total_; + } + + int result() const + { + return total_; + } + + mutable int total_; + +}; // total_sizeof + + + +//Function object: sum_int +//Description: Compute total sum of a series of numbers, (when called successively) +//Use sizeof(T) if applied with a non-integral type +struct sum_int : boost::static_visitor +{ + + sum_int() : total_(0) { } + + + template + struct int_to_type + { + BOOST_STATIC_CONSTANT(int, value = n); + }; + + //Integral type - add numerical value + template + void add(T t, int_to_type ) const + { + total_ += t; + } + + //Other types - add sizeof + template + void add(T& , int_to_type ) const + { + total_ += sizeof(T); + } + + template + int operator()(const T& t) const + { + //Int_to_type is used to select the correct add() overload + add(t, int_to_type::value>()); + return total_; + } + + int result() const + { + return total_; + } + +private: + mutable int total_; + +}; //sum_int + + + + + + +//Function object: sum_double +//Description: Compute total sum of a series of numbers, (when called successively) +//Accpetable input types: float, double (Other types are silently ignored) +struct sum_double : boost::static_visitor +{ + + sum_double() : total_(0) { } + + void operator()(float value) const + { + total_ += value; + } + + void operator()(double value) const + { + total_ += value; + } + + template + void operator()(const T&) const + { + //Do nothing + } + + double result() const + { + return total_; + } + +private: + mutable double total_; + +}; //sum_double + + + +struct int_printer : boost::static_visitor +{ + + int_printer(std::string prefix_s = "") : prefix_s_(prefix_s) { } + int_printer(const int_printer& other) : prefix_s_(other.prefix_s_) + { + ost_ << other.str(); + } + + std::string operator()(int x) const + { + ost_ << prefix_s_ << x; + return str(); + } + + std::string operator()(const std::vector& x) const + { + ost_ << prefix_s_; + + //Use another Int_printer object for printing a list of all integers + int_printer job(","); + ost_ << std::for_each(x.begin(), x.end(), job).str(); + + return str(); + } + + std::string str() const + { + return ost_.str(); + } + +private: + std::string prefix_s_; + mutable std::ostringstream ost_; +}; //int_printer + + +struct int_adder : boost::static_visitor<> +{ + + int_adder(int rhs) : rhs_(rhs) { } + + result_type operator()(int& lhs) const + { + lhs += rhs_; + } + + template + result_type operator()(const T& ) const + { + //Do nothing + } + + int rhs_; +}; //int_adder + + + +template +struct spec +{ + typedef T result; +}; + +template +inline void verify(VariantType& var, spec, std::string str = "") +{ + const VariantType& cvar = var; + + BOOST_CHECK(boost::apply_visitor(total_sizeof(), cvar) == sizeof(S)); + BOOST_CHECK(cvar.type() == boost::typeindex::type_id()); + + // + // Check get<>() + // + BOOST_CHECK(boost::get(&var)); + BOOST_CHECK(boost::get(&cvar)); + + const S* ptr1 = 0; + const S* ptr2 = 0; + try + { + S& r = boost::get(var); + ptr1 = &r; + } + catch(const boost::bad_get& ) + { + BOOST_ERROR( "get failed unexpectedly" ); + } + + try + { + const S& cr = boost::get(cvar); + ptr2 = &cr; + } + catch(const boost::bad_get& ) + { + BOOST_ERROR( "get const failed unexpectedly" ); + } + + BOOST_CHECK(ptr1 != 0 && ptr2 == ptr1); + + // + // Check string content + // + if(str.length() > 0) + { + std::string temp = boost::apply_visitor(to_text(), cvar); + std::cout << "temp = " << temp << ", str = " << str << std::endl; + BOOST_CHECK(temp == str); + } +} + + +template +inline void verify_not(VariantType& var, spec) +{ + const VariantType& cvar = var; + + BOOST_CHECK(cvar.type() != boost::typeindex::type_id()); + + // + // Check get<>() + // + BOOST_CHECK(!boost::get(&var)); + BOOST_CHECK(!boost::get(&cvar)); + + const S* ptr1 = 0; + const S* ptr2 = 0; + try + { + S& r = boost::get(var); // should throw + BOOST_ERROR( "get passed unexpectedly" ); + + ptr1 = &r; + } + catch(const boost::bad_get& ) + { + // do nothing except pass-through + } + + try + { + const S& cr = boost::get(var); // should throw + BOOST_ERROR( "get const passed unexpectedly" ); + + ptr2 = &cr; + } + catch(const boost::bad_get& ) + { + // do nothing except pass-through + } + + BOOST_CHECK(ptr1 == 0 && ptr2 == 0); +} + + +#endif //_JOBSH_INC_ diff --git a/tools/boost_1_65_1/libs/variant/test/overload_selection.cpp b/tools/boost_1_65_1/libs/variant/test/overload_selection.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1d4930e320384d9ec864ffc07d757b983a88cc47 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/overload_selection.cpp @@ -0,0 +1,215 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_get_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2016 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + + +// This test suite was created to cover issues reported in: +// https://svn.boost.org/trac/boost/ticket/5871 +// https://svn.boost.org/trac/boost/ticket/11602 + +#include "boost/variant/variant.hpp" +#include "boost/variant/recursive_variant.hpp" +#include "boost/test/minimal.hpp" + +#include +#include + +struct A{}; +struct B{}; +struct C{}; +struct D{}; + + +bool foo(const boost::variant& ) { + return false; +} + +bool foo(const boost::variant& ) { + return true; +} + +void test_overload_selection_variant_constructor() { + D d; + BOOST_CHECK(foo(d)); + + boost::variant v; + BOOST_CHECK(!foo(v)); +} + +// Pre msvc-14.0 could not dustinguish between multiple assignment operators: +// warning C4522: 'assignment_tester' : multiple assignment operators specified +// error C2666: variant::operator =' : 3 overloads have similar conversions +// Old versions of GCC have same issue: +// error: variant::operator=(const T&) cannot be overloaded +#if (defined(__GNUC__) && (__GNUC__ < 4)) || (defined(_MSC_VER) && _MSC_VER < 1900) + +void test_overload_selection_variant_assignment() { + BOOST_CHECK(true); +} + +#else + +struct assignment_tester: boost::variant, boost::variant { + using boost::variant::operator=; + using boost::variant::operator=; +}; + +void test_overload_selection_variant_assignment() { + A a; + assignment_tester tester; + tester = a; + const int which0 = static_cast< boost::variant& >(tester).which(); + BOOST_CHECK(which0 == 1); + + boost::variant b; + b = B(); + tester = b; + const int which1 = static_cast< boost::variant& >(tester).which(); + BOOST_CHECK(which1 == 0); +} + +#endif + +typedef boost::variant my_variant; + +struct convertible { + operator my_variant() const { + return my_variant(); + } +}; + +void test_implicit_conversion_operator() { + // https://svn.boost.org/trac/boost/ticket/8555 + my_variant y = convertible(); + BOOST_CHECK(y.which() == 0); +} + +struct X: boost::variant< int > {}; +class V1: public boost::variant {}; + +struct AB: boost::variant {}; + +void test_derived_from_variant_construction() { + // https://svn.boost.org/trac/boost/ticket/7120 + X x; + boost::variant y(x); + BOOST_CHECK(y.which() == 0); + + // https://svn.boost.org/trac/boost/ticket/10278 + boost::variant v2 = V1(); + BOOST_CHECK(v2.which() == 0); + + // https://svn.boost.org/trac/boost/ticket/12155 + AB ab; + boost::variant ab_c(ab); + BOOST_CHECK(ab_c.which() == 0); + + boost::variant a_b(ab); + BOOST_CHECK(a_b.which() == 0); + + boost::variant b_c_a1(static_cast& >(ab)); + BOOST_CHECK(b_c_a1.which() == 2); + + +// Following conversion seems harmful as it may lead to slicing: +// boost::variant b_c_a(ab); +// BOOST_CHECK(b_c_a.which() == 2); +} + +void test_derived_from_variant_assignment() { + // https://svn.boost.org/trac/boost/ticket/7120 + X x; + boost::variant y; + y = x; + BOOST_CHECK(y.which() == 0); + + // https://svn.boost.org/trac/boost/ticket/10278 + boost::variant v2; + v2 = V1(); + BOOST_CHECK(v2.which() == 0); + + // https://svn.boost.org/trac/boost/ticket/12155 + AB ab; + boost::variant ab_c; + ab_c = ab; + BOOST_CHECK(ab_c.which() == 0); + + boost::variant a_b; + a_b = ab; + BOOST_CHECK(a_b.which() == 0); + + boost::variant b_c_a1; + b_c_a1 = static_cast& >(ab); + BOOST_CHECK(b_c_a1.which() == 2); + + +// Following conversion seems harmful as it may lead to slicing: +// boost::variant b_c_a; +// b_c_a = ab; +// BOOST_CHECK(b_c_a.which() == 2); +} + + +// http://thread.gmane.org/gmane.comp.lib.boost.devel/267757 +struct info { + struct nil_ {}; + + typedef + boost::variant< + nil_ + , std::string + , boost::recursive_wrapper + , boost::recursive_wrapper > + , boost::recursive_wrapper > + > + value_type; + value_type v; + + inline void test_on_incomplete_types() { + info i0; + i0.v = "Hello"; + BOOST_CHECK(i0.v.which() == 1); + + info::value_type v0 = "Hello"; + BOOST_CHECK(v0.which() == 1); + + info::value_type v1("Hello"); + BOOST_CHECK(v1.which() == 1); + + info::value_type v2 = i0; + BOOST_CHECK(v2.which() == 2); + + info::value_type v3(i0); + BOOST_CHECK(v3.which() == 2); + + v0 = v3; + BOOST_CHECK(v0.which() == 2); + + v3 = v1; + BOOST_CHECK(v3.which() == 1); + + v3 = nil_(); + BOOST_CHECK(v3.which() == 0); + } +}; + + + +int test_main(int , char* []) +{ + test_overload_selection_variant_constructor(); + test_overload_selection_variant_assignment(); + test_implicit_conversion_operator(); + test_derived_from_variant_construction(); + test_derived_from_variant_assignment(); + info().test_on_incomplete_types(); + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/recursive_variant_test.cpp b/tools/boost_1_65_1/libs/variant/test/recursive_variant_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b3405bf11871b89dd4702f22daed753e768ab8e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/recursive_variant_test.cpp @@ -0,0 +1,383 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/recursive_variant_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 Eric Friedman, Itay Maman +// Copyright (c) 2013 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + + +// This file is used in two test cases: +// +// 1) recursive_variant_test.cpp that tests recursive usage of variant +// +// 2) variant_noexcept_test that tests Boost.Variant ability to compile +// and work with disabled exceptions + +#ifdef BOOST_NO_EXCEPTIONS +// `boost/test/minimal.hpp` cannot work with exceptions disabled, +// so we need the following workarounds for that case: +namespace boost { + int exit_success = 0; +} + +int test_main(int , char* []); + +int main( int argc, char* argv[] ) +{ + return test_main(argc, argv); +} + +#include +#define BOOST_CHECK(exp) if (!(exp)) exit(EXIT_FAILURE) + +#else // BOOST_NO_EXCEPTIONS +# include "boost/test/minimal.hpp" +#endif // BOOST_NO_EXCEPTIONS + + +#include "boost/variant.hpp" +#include "boost/mpl/vector.hpp" +#include "boost/mpl/copy.hpp" + +#include +#include +#include +#include +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) +#include +#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) + +struct printer + : boost::static_visitor +{ + template + std::string operator()( + const boost::variant &var) const + { + return boost::apply_visitor( printer(), var ); + } + + template + std::string operator()(const std::vector& vec) const + { + std::ostringstream ost; + + ost << "( "; + + typename std::vector::const_iterator it = vec.begin(); + for (; it != vec.end(); ++it) + ost << printer()( *it ); + + ost << ") "; + + return ost.str(); + } + +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) + template struct indices {}; + template + std::string operator()(const std::tuple& tup, indices) const + { + std::ostringstream ost; + ost << "( "; + int a[] = {0, (ost << printer()( std::get(tup) ), 0)... }; + (void)a; + ost << ") "; + return ost.str(); + } + + template + struct make_indices : make_indices {}; + template + struct make_indices<0, Is...> : indices {}; + template + std::string operator()(const std::tuple& tup) const + { + return printer()(tup, make_indices()); + } +#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) + + template + std::string operator()(const T& operand) const + { + std::ostringstream ost; + ost << operand << ' '; + return ost.str(); + } +}; + +void test_recursive_variant() +{ + typedef boost::make_recursive_variant< + int + , std::vector + >::type var1_t; + + std::vector vec1; + vec1.push_back(3); + vec1.push_back(5); + vec1.push_back(vec1); + vec1.push_back(7); + + var1_t var1(vec1); + std::string result1( printer()(var1) ); + + std::cout << "result1: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 ) 7 ) "); + + std::vector vec1_copy = vec1; + vec1_copy.erase(vec1_copy.begin() + 2); + vec1_copy.insert(vec1_copy.begin() + 2, vec1_copy); + var1 = vec1_copy; + result1 = printer()(var1); + std::cout << "result1+: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 7 ) 7 ) "); + + // Uses move construction on compilers with rvalue references support + result1 = printer()( + var1_t( + std::vector(vec1_copy) + ) + ); + std::cout << "result1++: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 7 ) 7 ) "); + + + var1_t vec1_another_copy(vec1_copy); + vec1_copy[2].swap(vec1_another_copy); + result1 = printer()( + var1_t(vec1_copy) + ); + std::cout << "result1+++1: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 ( 3 5 7 ) 7 ) 7 ) "); + + result1 = printer()(vec1_another_copy); + std::cout << "result1++2: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 7 ) "); + + vec1_copy[2].swap(vec1_copy[2]); + result1 = printer()( + var1_t(vec1_copy) + ); + std::cout << "result1.2: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 ( 3 5 7 ) 7 ) 7 ) "); + + typedef boost::make_recursive_variant< + boost::variant + , std::vector + >::type var2_t; + + std::vector vec2; + vec2.push_back(boost::variant(3)); + vec2.push_back(boost::variant(3.5)); + vec2.push_back(vec2); + vec2.push_back(boost::variant(7)); + + var2_t var2(vec2); + std::string result2( printer()(var2) ); + + std::cout << "result2: " << result2 << '\n'; + BOOST_CHECK(result2 == "( 3 3.5 ( 3 3.5 ) 7 ) "); + + typedef boost::make_recursive_variant< + int + , std::vector< + boost::variant< + double + , std::vector + > + > + >::type var3_t; + + typedef boost::variant > var4_t; + + std::vector vec3; + vec3.push_back(3); + vec3.push_back(5); + std::vector vec4; + vec4.push_back(3.5); + vec4.push_back(vec3); + vec3.push_back(vec4); + vec3.push_back(7); + + var4_t var4(vec3); + std::string result3( printer()(var4) ); + + std::cout << "result2: " << result3 << '\n'; + BOOST_CHECK(result3 == "( 3 5 ( 3.5 ( 3 5 ) ) 7 ) "); + + typedef boost::make_recursive_variant< + double, + std::vector + >::type var5_t; + + std::vector vec5; + vec5.push_back(3.5); + vec5.push_back(vec1); + vec5.push_back(17.25); + + std::string result5( printer()(vec5) ); + + std::cout << "result5: " << result5 << '\n'; + BOOST_CHECK(result5 == "( 3.5 ( 3 5 ( 3 5 ) 7 ) 17.25 ) "); + + typedef boost::make_recursive_variant< + int, + std::map + >::type var6_t; + var6_t var6; + +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) + typedef boost::make_recursive_variant< + int, + std::tuple + >::type var7_t; + var7_t var7 = 0; // !!! Do not replace with `var7_t var7{0}` or `var7_t var7(0)` !!! + var7 = std::tuple(1, var7); + var7 = std::tuple(2, var7); + + std::string result7( printer()(var7) ); + + std::cout << "result7: " << result7 << '\n'; + BOOST_CHECK(result7 == "( 2 ( 1 0 ) ) "); +#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE) +} + +void test_recursive_variant_over() +{ + typedef boost::make_recursive_variant_over< + boost::mpl::vector< + int + , std::vector + > + >::type var1_t; + + std::vector vec1; + vec1.push_back(3); + vec1.push_back(5); + vec1.push_back(vec1); + vec1.push_back(7); + + var1_t var1(vec1); + std::string result1( printer()(var1) ); + + std::cout << "result1: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 ) 7 ) "); + + std::vector vec1_copy = vec1; + vec1_copy.erase(vec1_copy.begin() + 2); + vec1_copy.insert(vec1_copy.begin() + 2, vec1_copy); + var1 = vec1_copy; + result1 = printer()(var1); + std::cout << "result1+: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 7 ) 7 ) "); + + // Uses move construction on compilers with rvalue references support + result1 = printer()( + var1_t( + std::vector(vec1_copy) + ) + ); + std::cout << "result1++: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 7 ) 7 ) "); + + + var1_t vec1_another_copy(vec1_copy); + vec1_copy[2].swap(vec1_another_copy); + result1 = printer()( + var1_t(vec1_copy) + ); + std::cout << "result1+++1: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 ( 3 5 ( 3 5 7 ) 7 ) 7 ) "); + + result1 = printer()(vec1_another_copy); + std::cout << "result1++2: " << result1 << '\n'; + BOOST_CHECK(result1 == "( 3 5 7 ) "); + + typedef boost::make_recursive_variant_over< + boost::mpl::vector< + boost::make_variant_over >::type + , std::vector + > + >::type var2_t; + + std::vector vec2; + vec2.push_back(boost::variant(3)); + vec2.push_back(boost::variant(3.5)); + vec2.push_back(vec2); + vec2.push_back(boost::variant(7)); + + var2_t var2(vec2); + std::string result2( printer()(var2) ); + + std::cout << "result2: " << result2 << '\n'; + BOOST_CHECK(result2 == "( 3 3.5 ( 3 3.5 ) 7 ) "); + + typedef boost::make_recursive_variant_over< + boost::mpl::vector< + int + , std::vector< + boost::make_variant_over< + boost::mpl::vector< + double + , std::vector + > + >::type + > + > + >::type var3_t; + + typedef boost::make_variant_over< + boost::mpl::copy< + boost::mpl::vector< + double + , std::vector + > + >::type + >::type var4_t; + + std::vector vec3; + vec3.push_back(3); + vec3.push_back(5); + std::vector vec4; + vec4.push_back(3.5); + vec4.push_back(vec3); + vec3.push_back(vec4); + vec3.push_back(7); + + var4_t var3(vec3); + std::string result3( printer()(var3) ); + + std::cout << "result2: " << result3 << '\n'; + BOOST_CHECK(result3 == "( 3 5 ( 3.5 ( 3 5 ) ) 7 ) "); + + typedef boost::make_recursive_variant_over< + boost::mpl::vector< + double + , std::vector + > + >::type var5_t; + + std::vector vec5; + vec5.push_back(3.5); + vec5.push_back(vec1); + vec5.push_back(17.25); + + std::string result5( printer()(vec5) ); + + std::cout << "result5: " << result5 << '\n'; + BOOST_CHECK(result5 == "( 3.5 ( 3 5 ( 3 5 ) 7 ) 17.25 ) "); +} + +int test_main(int , char* []) +{ + test_recursive_variant(); + test_recursive_variant_over(); + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/recursive_wrapper_move_test.cpp b/tools/boost_1_65_1/libs/variant/test/recursive_wrapper_move_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c63e454cb2b662a8fd5f19d28843bb8d2a89c47d --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/recursive_wrapper_move_test.cpp @@ -0,0 +1,78 @@ +// Copyright (c) 2017 +// Mikhail Maximov +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" +#include "boost/test/minimal.hpp" + +#ifdef __cpp_inheriting_constructors +// Test is based on reported issue: +// https://svn.boost.org/trac/boost/ticket/12680 +// GCC 6 crashed, trying to determine is boost::recursive_wrapper +// is_noexcept_move_constructible + +#include +#include + +#include +#include + +struct Leaf { }; +struct Node; + +typedef boost::variant> TreeBase; + +struct Tree : TreeBase { + using TreeBase::TreeBase; + + template + static Tree Create(Iter /*first*/, Iter /*last*/) { return Leaf{}; } +}; + +struct Node { + Tree left, right; +}; + + +// Test from https://svn.boost.org/trac/boost/ticket/7120 +template +struct node1_type; + +struct var_type; + +using var_base = boost::variant> +>; + +template +struct node1_type { + boost::array children; +}; + +struct var_type : var_base { + using var_base::var_base; +}; + +void run() { + std::string input{"abracadabra"}; + const Tree root = Tree::Create(input.begin(), input.end()); + (void)root; // prevents unused variable warning + + var_type v1 = 1; + (void)v1; +} + +#else // #!ifdef __cpp_inheriting_constructors +// if compiler does not support inheriting constructors - does nothing +void run() {} +#endif + +int test_main(int , char* []) +{ + run(); + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/rvalue_test.cpp b/tools/boost_1_65_1/libs/variant/test/rvalue_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..57bace6752cf70090a0765e011a6b5364bb22d04 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/rvalue_test.cpp @@ -0,0 +1,332 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/rvalue_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2012-2014 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" +#include "boost/type_traits/is_nothrow_move_assignable.hpp" +#include "boost/mpl/bool.hpp" + +#include +#include + +namespace swap_ambiguouty_test_ns { + struct A {}; + struct B {}; + + void swap_ambiguouty_test() { + // If boost::blank is not used, then it compiles. + typedef boost::variant Variant; + Variant v1, v2; + swap(v1, v2); + } +} // namespace swap_ambiguouty_test_ns + +// Most part of tests from this file require rvalue references support + +class move_copy_conting_class { +public: + static unsigned int moves_count; + static unsigned int copy_count; + + move_copy_conting_class(){} + move_copy_conting_class(BOOST_RV_REF(move_copy_conting_class) ) { + ++ moves_count; + } + + move_copy_conting_class& operator=(BOOST_RV_REF(move_copy_conting_class) ) { + ++ moves_count; + return *this; + } + + move_copy_conting_class(const move_copy_conting_class&) { + ++ copy_count; + } + move_copy_conting_class& operator=(BOOST_COPY_ASSIGN_REF(move_copy_conting_class) ) { + ++ copy_count; + return *this; + } +}; + +unsigned int move_copy_conting_class::moves_count = 0; +unsigned int move_copy_conting_class::copy_count = 0; + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + +void run() +{ + // Making sure that internals of Boost.Move do not interfere with + // internals of Boost.Variant and in case of C++03 or C++98 compilation + // is still possible. + typedef boost::variant variant_I_type; + variant_I_type v1, v2; + v1 = move_copy_conting_class(); + v2 = v1; + v2 = boost::move(v1); + v1.swap(v2); + + move_copy_conting_class val; + v2 = boost::move(val); + v2 = 10; + + variant_I_type v3(boost::move(val)); + variant_I_type v4(boost::move(v1)); +} + +void run1() +{ + BOOST_CHECK(true); +} + +void run_move_only() +{ + BOOST_CHECK(true); +} + +void run_moves_are_noexcept() +{ + BOOST_CHECK(true); +} + + +void run_const_rvalues() +{ + BOOST_CHECK(true); +} + + +#else + + +void run() +{ + typedef boost::variant variant_I_type; + variant_I_type v1, v2; + + // Assuring that `move_copy_conting_class` was not created + BOOST_CHECK(move_copy_conting_class::copy_count == 0); + BOOST_CHECK(move_copy_conting_class::moves_count == 0); + + v1 = move_copy_conting_class(); + // Assuring that `move_copy_conting_class` was moved at least once + BOOST_CHECK(move_copy_conting_class::moves_count != 0); + + unsigned int total_count = move_copy_conting_class::moves_count + move_copy_conting_class::copy_count; + move_copy_conting_class var; + v1 = 0; + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + v1 = var; + // Assuring that move assignment operator moves/copyes value not more times than copy assignment operator + BOOST_CHECK(total_count <= move_copy_conting_class::moves_count + move_copy_conting_class::copy_count); + + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + v2 = boost::move(v1); + // Assuring that `move_copy_conting_class` in v1 was moved at least once and was not copied + BOOST_CHECK(move_copy_conting_class::moves_count != 0); + BOOST_CHECK(move_copy_conting_class::copy_count == 0); + + v1 = move_copy_conting_class(); + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + v2 = boost::move(v1); + // Assuring that `move_copy_conting_class` in v1 was moved at least once and was not copied + BOOST_CHECK(move_copy_conting_class::moves_count != 0); + BOOST_CHECK(move_copy_conting_class::copy_count == 0); + total_count = move_copy_conting_class::moves_count + move_copy_conting_class::copy_count; + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + v1 = v2; + // Assuring that move assignment operator moves/copyes value not more times than copy assignment operator + BOOST_CHECK(total_count <= move_copy_conting_class::moves_count + move_copy_conting_class::copy_count); + + + typedef boost::variant variant_II_type; + variant_II_type v3; + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + v1 = boost::move(v3); + // Assuring that `move_copy_conting_class` in v3 was moved at least once (v1 and v3 have different types) + BOOST_CHECK(move_copy_conting_class::moves_count != 0); + + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + v2 = boost::move(v1); + // Assuring that `move_copy_conting_class` in v1 was moved at least once (v1 and v3 have different types) + BOOST_CHECK(move_copy_conting_class::moves_count != 0); + + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + variant_I_type v5(boost::move(v1)); + // Assuring that `move_copy_conting_class` in v1 was moved at least once and was not copied + BOOST_CHECK(move_copy_conting_class::moves_count != 0); + BOOST_CHECK(move_copy_conting_class::copy_count == 0); + + total_count = move_copy_conting_class::moves_count + move_copy_conting_class::copy_count; + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + variant_I_type v6(v1); + // Assuring that move constructor moves/copyes value not more times than copy constructor + BOOST_CHECK(total_count <= move_copy_conting_class::moves_count + move_copy_conting_class::copy_count); +} + +void run1() +{ + move_copy_conting_class::moves_count = 0; + move_copy_conting_class::copy_count = 0; + + move_copy_conting_class c1; + typedef boost::variant variant_I_type; + variant_I_type v1(boost::move(c1)); + + // Assuring that `move_copy_conting_class` was not copyied + BOOST_CHECK(move_copy_conting_class::copy_count == 0); + BOOST_CHECK(move_copy_conting_class::moves_count > 0); +} + +struct move_only_structure { + move_only_structure(){} + move_only_structure(move_only_structure&&){} + move_only_structure& operator=(move_only_structure&&) { return *this; } + +private: + move_only_structure(const move_only_structure&); + move_only_structure& operator=(const move_only_structure&); +}; + +struct visitor_returning_move_only_type: boost::static_visitor { + template + move_only_structure operator()(const T&) const { + return move_only_structure(); + } +}; + +void run_move_only() +{ + move_only_structure mo; + boost::variant vi, vi2(static_cast(mo)); + BOOST_CHECK(vi.which() == 0); + BOOST_CHECK(vi2.which() == 1); + + vi = 10; + vi2 = 10; + BOOST_CHECK(vi.which() == 0); + BOOST_CHECK(vi2.which() == 0); + + vi = static_cast(mo); + vi2 = static_cast(mo); + BOOST_CHECK(vi.which() == 1); + + boost::variant rvi (1); + BOOST_CHECK(rvi.which() == 1); + rvi = static_cast(mo); + BOOST_CHECK(rvi.which() == 0); + rvi = 1; + BOOST_CHECK(rvi.which() == 1); + rvi = static_cast&&>(vi2); + BOOST_CHECK(rvi.which() == 0); + + move_only_structure from_visitor = boost::apply_visitor(visitor_returning_move_only_type(), vi); + (void)from_visitor; +} + +void run_moves_are_noexcept() { +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && (!defined(__GNUC__) || defined(__clang__) || __GNUC__ > 4 || __GNUC_MINOR__ >= 8) + typedef boost::variant variant_noexcept_t; + BOOST_CHECK(boost::is_nothrow_move_assignable::value); + BOOST_CHECK(boost::is_nothrow_move_constructible::value); + + typedef boost::variant variant_except_t; + BOOST_CHECK(!boost::is_nothrow_move_assignable::value); + BOOST_CHECK(!boost::is_nothrow_move_constructible::value); +#endif +} + +inline const std::string get_string() { return "test"; } +inline const boost::variant get_variant() { return std::string("test"); } +inline const boost::variant get_variant2() { return std::string("test"); } + +void run_const_rvalues() +{ + typedef boost::variant variant_t; + const variant_t v1(get_string()); + const variant_t v2(get_variant()); + const variant_t v3(get_variant2()); + + variant_t v4, v5, v6, v7; + v4 = get_string(); + v5 = get_variant(); + v6 = get_variant2(); + v7 = boost::move(v1); +} + +#endif + +struct nothrow_copyable_throw_movable { + nothrow_copyable_throw_movable(){} + nothrow_copyable_throw_movable(const nothrow_copyable_throw_movable&) BOOST_NOEXCEPT {} + nothrow_copyable_throw_movable& operator=(const nothrow_copyable_throw_movable&) BOOST_NOEXCEPT { return *this; } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + nothrow_copyable_throw_movable(nothrow_copyable_throw_movable&&) BOOST_NOEXCEPT_IF(false) {} + nothrow_copyable_throw_movable& operator=(nothrow_copyable_throw_movable&&) BOOST_NOEXCEPT_IF(false) { return *this; } +#endif +}; + +// This test is created to cover the following situation: +// https://svn.boost.org/trac/boost/ticket/8772 +void run_tricky_compilation_test() +{ + boost::variant v; + v = nothrow_copyable_throw_movable(); +} + +template +struct is_container : boost::mpl::false_ {}; + +template +struct is_container > : is_container {}; + +template +struct is_container > + : boost::mpl::bool_::value + || is_container >::value> +{}; + +void run_is_container_compilation_test() +{ + BOOST_CHECK((!is_container >::value)); + BOOST_CHECK((!is_container >::value)); + BOOST_CHECK((!is_container >::value)); +} + +int test_main(int , char* []) +{ + swap_ambiguouty_test_ns::swap_ambiguouty_test(); + run(); + run1(); + run_move_only(); + run_moves_are_noexcept(); + run_tricky_compilation_test(); + run_const_rvalues(); + run_is_container_compilation_test(); + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 6) +# ifdef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES + BOOST_CHECK(false && + "Something wrong with macro definitions. GCC-4.7+ is known to work with variadic templates" + ); +# endif +#endif + + return 0; +} diff --git a/tools/boost_1_65_1/libs/variant/test/test1.cpp b/tools/boost_1_65_1/libs/variant/test/test1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..57d464970b2e1b772b322e3cafeaa016c2bd4832 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test1.cpp @@ -0,0 +1,150 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test1.cpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" + +#ifdef BOOST_MSVC +#pragma warning(disable:4244) // conversion from const int to const short +#endif + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include "class_a.h" +#include "jobs.h" + +#include +#include +#include + + + +void run() +{ + + using boost::apply_visitor; + using boost::variant; + using std::string; + using std::vector; + using std::cout; + using std::endl; + + typedef variant< char*, string, short > t_var0; + typedef variant< int, string, double > t_var1; + typedef variant< short, const char* > t_var2; + typedef variant< string, char > t_var3; + typedef variant< unsigned short, const char* > t_var4; + typedef variant< unsigned short, const char*, t_var2 > t_var5; + typedef variant< unsigned short, const char*, t_var5 > t_var6; + typedef variant< class_a, const void* > t_var7; + typedef variant< t_var6, int > t_var8; + typedef variant< t_var8, unsigned short > t_var9; + typedef variant< char, unsigned char > t_var10; + typedef variant< short, int, vector, long> t_var11; + + t_var1 v1; + t_var0 v0; + t_var2 v2; + t_var3 v3; + t_var4 v4; + t_var5 v5; + t_var6 v6; + t_var7 v7; + t_var8 v8; + t_var9 v9; + t_var10 v10; + t_var11 v11; + + + // + // Check assignment rules + // + + v2 = 4; + v4 = v2; + verify(v4, spec()); + + v2 = "abc"; + v4 = v2; + verify(v4, spec(), "[V] abc"); + + v5 = "def"; + verify(v5, spec(), "[V] def"); + + v5 = v2; + verify(v5, spec(), "[V] [V] abc"); + + v6 = 58; + verify(v6, spec(), "[V] 58"); + + v6 = v5; + verify(v6, spec(), "[V] [V] [V] abc"); + + v8 = v2; + verify(v8, spec(), "[V] [V] abc"); + + v8 = v6; + verify(v8, spec(), "[V] [V] [V] [V] abc"); + + v7 = v2; + verify(v7, spec()); + + v7 = 199; + verify(v7, spec(), "[V] class_a(199)"); + + v2 = 200; + v7 = v2; + verify(v7, spec(), "[V] class_a(200)"); + + + + // + // Check sizes of held values + // + total_sizeof ts; + + v1 = 5.9; + apply_visitor(ts, v1); + + v1 = 'B'; + apply_visitor(ts, v1); + + v1 = 3.4f; + apply_visitor(ts, v1); + + BOOST_CHECK(ts.result() == sizeof(int) + sizeof(double)*2); + + v11 = 5; + string res_s = apply_visitor(int_printer(), v11); + BOOST_CHECK(res_s == "5"); + + // + // A variant object holding an std::vector + // + vector int_vec_1; + int_vec_1.push_back(512); + int_vec_1.push_back(256); + int_vec_1.push_back(128); + int_vec_1.push_back(64); + + v11 = int_vec_1; + res_s = apply_visitor(int_printer(), v11); + BOOST_CHECK(res_s == ",512,256,128,64"); +} + + + +int test_main(int , char* []) +{ + run(); + return 0; +} diff --git a/tools/boost_1_65_1/libs/variant/test/test2.cpp b/tools/boost_1_65_1/libs/variant/test/test2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5f40ce72f2f98fbd717a765f65783bd76646bce1 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test2.cpp @@ -0,0 +1,149 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test2.cpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" + +#ifdef BOOST_MSVC +#pragma warning(disable:4244) // conversion from 'const int' to 'const short' +#endif + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include "jobs.h" + +#include +#include +#include +#include + +using boost::apply_visitor; + +struct short_string +{ + BOOST_STATIC_CONSTANT(size_t, e_limit = 101); + + short_string() : len_(0) + { + buffer_[0] = '\0'; + } + + short_string(const char* src) + { +#ifndef BOOST_NO_STDC_NAMESPACE + using std::strlen; +#endif // BOOST_NO_STDC_NAMESPACE + + size_t limit = this->e_limit; // avoid warnings on some compilers + size_t src_len = strlen(src); + + len_ = (std::min)(src_len, limit-1); + std::copy(src, src + len_, buffer_); + buffer_[len_] = '\0'; + } + + short_string(const short_string& other) : len_(other.len_) + { + std::copy(other.buffer_, other.buffer_ + e_limit, buffer_); + } + + void swap(short_string& other) + { + char temp[e_limit]; + + std::copy(buffer_, buffer_ + e_limit, temp); + std::copy(other.buffer_, other.buffer_ + e_limit, buffer_); + std::copy(temp, temp + e_limit, other.buffer_); + + std::swap(len_, other.len_); + } + + short_string& operator=(const short_string& rhs) + { + short_string temp(rhs); + swap(temp); + + return *this; + } + + operator const char*() const + { + return buffer_; + } + + +private: + char buffer_[e_limit]; + size_t len_; +}; //short_string + + +std::ostream& operator<<(std::ostream& out, const short_string& s) +{ + out << static_cast(s); + return out; +} + + + +void run() +{ + using boost::variant; + + variant v0; + variant v1; + variant v2; + + // + // Default construction + // + verify(v0, spec()); + verify(v1, spec()); + verify(v2, spec()); + + // + // Implicit conversion to bounded type + // + v1 = "I am v1"; + verify(v1, spec(), "[V] I am v1"); + + v2 = "I am v2"; + verify(v2, spec(), "[V] I am v2"); + + // + // Variant-to-variant assignment + // + + v0 = v1; + verify(v0, spec(), "[V] I am v1"); + + v1 = v0; + verify(v1, spec(), "[V] I am v1"); + + const int n0 = 88; + v1 = n0; + v0 = v1; + + // + // Implicit conversion to bounded type + // + verify(v0, spec(), "[V] 88"); + verify(v1, spec(), "[V] X"); +} + + +int test_main(int , char* []) +{ + run(); + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/test3.cpp b/tools/boost_1_65_1/libs/variant/test/test3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..729e9431dbd10ce0930966007ce77aecbc414c73 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test3.cpp @@ -0,0 +1,134 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test3.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include +#include +#include + +///////////////////////////////////////////////////////////////////// + +using boost::variant; +using boost::recursive_wrapper; +using std::cout; +using std::endl; + +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// + +struct Add; +struct Sub; + +typedef variant, recursive_wrapper > Expr; + +struct Sub +{ + Sub(); + Sub(const Expr& l, const Expr& r); + Sub(const Sub& other); + + Expr lhs_; + Expr rhs_; +}; + +struct Add +{ + Add() { } + Add(const Expr& l, const Expr& r) : lhs_(l), rhs_(r) { } + Add(const Add& other) : lhs_(other.lhs_), rhs_(other.rhs_) { } + + Expr lhs_; + Expr rhs_; +}; + +Sub::Sub() { } +Sub::Sub(const Expr& l, const Expr& r) : lhs_(l), rhs_(r) { } +Sub::Sub(const Sub& other) : lhs_(other.lhs_), rhs_(other.rhs_) { } + + +// +// insert-to operators +// +std::ostream& operator<<(std::ostream& out, const Sub& a); + +std::ostream& operator<<(std::ostream& out, const Add& a) +{ + out << '(' << a.lhs_ << '+' << a.rhs_ << ')'; + return out; +} + +std::ostream& operator<<(std::ostream& out, const Sub& a) +{ + out << '(' << a.lhs_ << '-' << a.rhs_ << ')'; + return out; +} + +// +// Expression evaluation visitor +// +struct Calculator : boost::static_visitor +{ + Calculator() { } + + int operator()(Add& x) const + { + Calculator calc; + int n1 = boost::apply_visitor(calc, x.lhs_); + int n2 = boost::apply_visitor(calc, x.rhs_); + + return n1 + n2; + } + + int operator()(Sub& x) const + { + return boost::apply_visitor(Calculator(), x.lhs_) + - boost::apply_visitor(Calculator(), x.rhs_); + } + + int operator()(Expr& x) const + { + Calculator calc; + return boost::apply_visitor(calc, x); + } + + int operator()(int x) const + { + return x; + } + +}; // Calculator + + +///////////////////////////////////////////////////////////////////// + + +int test_main(int, char* []) +{ + + int n = 13; + Expr e1( Add(n, Sub(Add(40,2),Add(10,4))) ); //n + (40+2)-(10+14) = n+28 + + std::ostringstream e1_str; + e1_str << e1; + + BOOST_CHECK(e1.type() == boost::typeindex::type_id()); + BOOST_CHECK(e1_str.str() == "(13+((40+2)-(10+4)))"); + + //Evaluate expression + int res = boost::apply_visitor(Calculator(), e1); + BOOST_CHECK(res == n + 28); + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/test4.cpp b/tools/boost_1_65_1/libs/variant/test/test4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9550489e7557c835e75df1cf08dc24310f60f415 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test4.cpp @@ -0,0 +1,57 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test4.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" + +#ifdef BOOST_MSVC +#pragma warning(disable:4244) // conversion from 'const int' to 'const short' +#endif + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include "jobs.h" + +#include + +struct class_a; + +using boost::variant; + +typedef variant var_type_1; +typedef variant var_type_2; + +#include "class_a.h" + +int test_main(int , char* []) +{ + using namespace boost; + + var_type_1 v1; + var_type_2 v2; + + v1 = class_a(); + verify(v1, spec(), "[V] class_a(5511)"); + + verify(v2, spec(), "[V] "); + + v2 = "abcde"; + verify(v2, spec(), "[V] abcde"); + + v2 = v1; + verify(v2, spec(), "[V] class_a(5511)"); + + v2 = 5; + v1 = v2; + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/test5.cpp b/tools/boost_1_65_1/libs/variant/test/test5.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a7be9a3e747a0cf474e6d1ead50c73eb08a48f76 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test5.cpp @@ -0,0 +1,90 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test5.cpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include "jobs.h" + +#include +#include +#include +#include + + +void run() +{ + using std::string; + using boost::variant; + using boost::apply_visitor; + + typedef variant t_var1; + typedef variant t_var2; + typedef variant t_var3; + + t_var1 v1; + t_var2 v2; + t_var2 v2_second; + t_var3 v3; + + const char c0 = 'x'; + v1 = c0; + + //v2 and v3 are holding (aka: containing) a variant + v2 = v1; + v3 = v2; + + verify(v1, spec()); + verify(v2, spec()); + verify(v3, spec()); + + + // + // assignment from const char (Converted to int) + // + v2 = c0; + v3 = c0; + + verify(v2, spec()); + verify(v3, spec()); + + + BOOST_CHECK(apply_visitor(sum_int(), v2) == c0); + BOOST_CHECK(apply_visitor(sum_int(), v3) == c0); + + sum_int adder; + apply_visitor(adder, v2); + apply_visitor(adder, v3); + + BOOST_CHECK(adder.result() == 2*c0); + + // + // A variant holding a variant + // + typedef variant t_var4; + typedef variant t_var5; + + t_var4 v4; + t_var5 v5; + + v5 = 22.5f; + verify(v5, spec(), "[V] [V] 22.5"); +} + + + +int test_main(int , char* []) +{ + run(); + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/test6.cpp b/tools/boost_1_65_1/libs/variant/test/test6.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bee23a88ab03669d134ecfe8991041677487ef6 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test6.cpp @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test6.cpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include + +#include "jobs.h" + + +//Just Another Class +struct jac +{ + jac() { } + jac(int ) { } + jac(const char* ) { } +}; + +std::ostream& operator<<(std::ostream& out, const jac& ) +{ + out << "jac "; + return out; +} + + +void run() +{ + using boost::variant; + + variant v1; + variant v2; + + v1 = v2; + + verify(v1, spec()); + verify(v2, spec()); + + verify_not(v1, spec()); + verify_not(v1, spec()); + verify_not(v1, spec()); + + verify_not(v2, spec()); + verify_not(v2, spec()); + verify_not(v2, spec()); + verify_not(v2, spec()); + + + variant v3; + variant v4; + + v3 = v4; + verify(v3, spec()); + verify(v4, spec()); + verify_not(v4, spec()); +} + + + +int test_main(int , char* []) +{ + run(); + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/test7.cpp b/tools/boost_1_65_1/libs/variant/test/test7.cpp new file mode 100644 index 0000000000000000000000000000000000000000..19f5f406ebac131b49500f1144a06577523035ae --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test7.cpp @@ -0,0 +1,255 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test7.cpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" + +#ifdef BOOST_MSVC +#pragma warning(disable:4244) // conversion from 'const int' to 'const short' +#endif + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include "jobs.h" + +#include +#include +#include +#include + +#include "boost/detail/workaround.hpp" +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) +# include "boost/mpl/bool.hpp" +# include "boost/type_traits/is_same.hpp" +#endif + + +using namespace boost; +using namespace std; + + +struct jas +{ + jas(int n = 364); + jas(const jas& other); + + ~jas(); + jas& operator=(const jas& other); + + void swap(jas& other); + + int n_; + + int sn_; + static int s_inst_id_; +}; + +struct Tracker +{ + typedef map table_type; + typedef table_type::iterator iterator_type; + + static table_type s_this_to_sn_; + + static void insert(const jas& j) + { + s_this_to_sn_[&j] = j.sn_; + cout << "jas( " << j.sn_ << ") Registered" << endl; + } + + static void remove(const jas& j) + { + iterator_type iter = s_this_to_sn_.find(&j); + BOOST_CHECK(iter != s_this_to_sn_.end()); + BOOST_CHECK( ((*iter).second) == j.sn_); + + int sn = (*iter).second; + if(sn != j.sn_) + { + cout << "Mismatch: this = " << (*iter).first << ", sn_ = " << sn + << ", other: this = " << &j << ", j.sn_ = " << j.sn_ << endl; + } + + BOOST_CHECK(sn == j.sn_); + + + + + + s_this_to_sn_.erase(&j); + cout << "jas( " << j.sn_ << ") Removed" << endl; + } + + static void check() + { + BOOST_CHECK(s_this_to_sn_.empty()); + } +}; + +Tracker::table_type Tracker::s_this_to_sn_; + + + +jas::jas(int n) : n_(n) +{ + sn_ = s_inst_id_; + s_inst_id_ += 1; + + Tracker::insert(*this); +} + +jas::jas(const jas& other) : n_(other.n_) +{ + sn_ = s_inst_id_; + s_inst_id_ += 1; + + Tracker::insert(*this); +} + +jas::~jas() +{ + Tracker::remove(*this); +} + +jas& jas::operator=(const jas& other) +{ + jas temp(other); + swap(temp); + + return *this; +} + +void jas::swap(jas& other) +{ + Tracker::remove(*this); + Tracker::remove(other); + + std::swap(n_, other.n_); + std::swap(sn_, other.sn_); + + Tracker::insert(*this); + Tracker::insert(other); +} + +int jas::s_inst_id_ = 0; + + +bool operator==(const jas& a, const jas& b) +{ + return a.n_ == b.n_; +} + +ostream& operator<<(ostream& out, const jas& a) +{ + cout << "jas::n_ = " << a.n_; + return out; +} + + +template +struct compare_helper : boost::static_visitor +{ + compare_helper(ValueType& expected) : expected_(expected) { } + +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) + + bool operator()(const ValueType& value) + { + return value == expected_; + } + + template + bool operator()(const T& ) + { + return false; + } + +#else // MSVC6 + +private: + + bool compare_impl(const ValueType& value, boost::mpl::true_) + { + return value == expected_; + } + + template + bool compare_impl(const T&, boost::mpl::false_) + { + return false; + } + +public: + + template + bool operator()(const T& value) + { + typedef typename boost::is_same::type + T_is_ValueType; + + return compare_impl(value, T_is_ValueType()); + } + +#endif // MSVC6 workaround + + ValueType& expected_; + +private: + compare_helper& operator=(const compare_helper&); + +}; + +template +void var_compare(const VariantType& v, ExpectedType expected) +{ + compare_helper ch(expected); + + bool checks = boost::apply_visitor(ch, v); + BOOST_CHECK(checks); +} + + +void run() +{ + variant v0; + + var_compare(v0, string("")); + + v0 = 8; + var_compare(v0, static_cast(8)); + + v0 = "penny lane"; + var_compare(v0, string("penny lane")); + + variant v1, v2 = jas(195); + var_compare(v1, jas(364)); + + v1 = jas(500); + v1.swap(v2); + + var_compare(v1, jas(195)); + var_compare(v2, jas(500)); + + + variant v3; + var_compare(v3, string("")); +} + + +int test_main(int , char* []) +{ + run(); + Tracker::check(); + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/test8.cpp b/tools/boost_1_65_1/libs/variant/test/test8.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e9fc8155d0836909521ac55868ee39c9b6484692 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test8.cpp @@ -0,0 +1,114 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test8.cpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include +#include +#include + +using namespace std; +using namespace boost; + +typedef variant > t_var1; + +struct int_sum : static_visitor<> +{ + int_sum() : result_(0) { } + + void operator()(int t) + { + result_ += t; + } + + result_type operator()(float ) { } + result_type operator()(const std::string& ) { } + result_type operator()(const std::vector& ) { } + + int result_; +}; + +template +T& check_pass(Variant& v, T value) +{ + BOOST_CHECK(get(&v)); + + try + { + T& r = get(v); + BOOST_CHECK(r == value); + return r; + } + catch(boost::bad_get&) + { + throw; // must never reach + } +} + +template +void check_fail(Variant& v) +{ + BOOST_CHECK(!relaxed_get(&v)); + + try + { + T& r = relaxed_get(v); + (void)r; // suppress warning about r not being used + BOOST_CHECK(false && relaxed_get(&v)); // should never reach + } + catch(const boost::bad_get& e) + { + BOOST_CHECK(!!e.what()); // make sure that what() is const qualified and returnes something + } +} + +int test_main(int , char* []) +{ + int_sum acc; + t_var1 v1 = 800; + + // check get on non-const variant + { + int& r1 = check_pass(v1, 800); + const int& cr1 = check_pass(v1, 800); + + check_fail(v1); + check_fail(v1); + check_fail(v1); + check_fail(v1); + + apply_visitor(acc, v1); + BOOST_CHECK(acc.result_ == 800); + + r1 = 920; // NOTE: modifies content of v1 + apply_visitor(acc, v1); + BOOST_CHECK(cr1 == 920); + BOOST_CHECK(acc.result_ == 800 + 920); + } + + // check const correctness: + { + const t_var1& c = v1; + + check_pass(c, 920); + + //check_fail(c); + check_fail(c); + //check_fail(c); + check_fail(c); + //check_fail(c); + } + + return boost::exit_success; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/test9.cpp b/tools/boost_1_65_1/libs/variant/test/test9.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7d4a43a04d34b688c5aedb2b61e8a08d5b66404d --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/test9.cpp @@ -0,0 +1,22 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/test9.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2016 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + + +// Test from https://github.com/boostorg/variant/pull/21 + +#include +#include +#include + +int main() { + boost::make_variant_over >::type t; + (void)t; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_comparison_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_comparison_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f46afbd10c702945a64308e37568484f8790bc4 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_comparison_test.cpp @@ -0,0 +1,158 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_comparison_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 Eric Friedman, Itay Maman +// Copyright (c) 2014 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/variant/variant.hpp" +#include "boost/test/minimal.hpp" + +#include +#include +#include + +#include +#include + +#include "boost/detail/workaround.hpp" +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) +# pragma warn -lvc // temporary used for parameter warning +#endif + +template +void assert_equality_comparable( + const T& x, const T& y, const T& z + ) +{ + // identity check + BOOST_CHECK( !(&x == &y) || (x == y) ); + BOOST_CHECK( !(&x == &z) || (x == z) ); + BOOST_CHECK( !(&y == &z) || (y == z) ); + BOOST_CHECK( !(&x == &y) || !(x != y) ); + BOOST_CHECK( !(&x == &z) || !(x != z) ); + BOOST_CHECK( !(&y == &z) || !(y != z) ); + + // reflexivity check + BOOST_CHECK( (x == x) ); + BOOST_CHECK( (y == y) ); + BOOST_CHECK( (z == z) ); + + // symmetry check + BOOST_CHECK( !(x == y) || (y == x) ); + BOOST_CHECK( !(y == x) || (x == y) ); + BOOST_CHECK( (x != y) || (y == x) ); + BOOST_CHECK( (y != x) || (x == y) ); + + BOOST_CHECK( !(x == z) || (z == x) ); + BOOST_CHECK( !(z == x) || (x == z) ); + BOOST_CHECK( (x != z) || (z == x) ); + BOOST_CHECK( (z != x) || (x == z) ); + + BOOST_CHECK( !(y == z) || (z == y) ); + BOOST_CHECK( !(z == y) || (y == z) ); + BOOST_CHECK( (y != z) || (z == y) ); + BOOST_CHECK( (z != y) || (y == z) ); + + // transitivity check + BOOST_CHECK( !(x == y && y == z) || (x == z) ); + BOOST_CHECK( !(x == z && z == y) || (x == y) ); + BOOST_CHECK( !(y == z && z == x) || (y == x) ); +} + +template +void assert_less_than_comparable( + const T& x, const T& y, const T& z + ) +{ + // irreflexivity check + BOOST_CHECK( !(x < x) ); + BOOST_CHECK( !(y < y) ); + BOOST_CHECK( !(z < z) ); + BOOST_CHECK( !(x > x) ); + BOOST_CHECK( !(y > y) ); + BOOST_CHECK( !(z > z) ); + + BOOST_CHECK( (x <= x) ); + BOOST_CHECK( (y <= y) ); + BOOST_CHECK( (z <= z) ); + BOOST_CHECK( (x >= x) ); + BOOST_CHECK( (y >= y) ); + BOOST_CHECK( (z >= z) ); + + // transitivity check + BOOST_CHECK( (x < y) ); + BOOST_CHECK( (y < z) ); + BOOST_CHECK( (x < z) ); + + BOOST_CHECK( (x <= y) ); + BOOST_CHECK( (y <= z) ); + BOOST_CHECK( (x <= z) ); + + BOOST_CHECK( (z > y) ); + BOOST_CHECK( (y > x) ); + BOOST_CHECK( (z > x) ); + + BOOST_CHECK( (z >= y) ); + BOOST_CHECK( (y >= x) ); + BOOST_CHECK( (z >= x) ); + + // antisymmetry check + BOOST_CHECK( !(y < x) ); + BOOST_CHECK( !(z < y) ); + BOOST_CHECK( !(z < x) ); +} + +template +std::string print_range(It first, It last) +{ + std::ostringstream result; + + while (first != last) + { + result << *first << ' '; + ++first; + } + + return result.str(); +} + +int test_main(int , char* []) +{ + typedef boost::variant var_t; + + var_t var1(3); + var_t var2(5); + var_t var3("goodbye"); + var_t var4("hello"); + + assert_equality_comparable(var1, var1, var1); + assert_equality_comparable(var_t(var1), var_t(var1), var_t(var1)); + assert_equality_comparable(var1, var2, var3); + + assert_less_than_comparable(var1, var2, var3); + assert_less_than_comparable(var2, var3, var4); + + std::vector vec; + vec.push_back( var3 ); + vec.push_back( var2 ); + vec.push_back( var4 ); + vec.push_back( var1 ); + std::sort(vec.begin(), vec.end()); + + std::string sort_result( print_range(vec.begin(), vec.end()) ); + BOOST_CHECK( sort_result == "3 5 goodbye hello " ); + + // https://svn.boost.org/trac/boost/ticket/11751 + int a = 0, b = 0; + + boost::variant< int& > v (a), u (b); + BOOST_CHECK(v == u); + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_get_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_get_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..392fdb625882a3a2d7feaa49baf4e3464f55b513 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_get_test.cpp @@ -0,0 +1,412 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_get_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2014-2017 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/variant/get.hpp" +#include "boost/variant/variant.hpp" +#include "boost/variant/polymorphic_get.hpp" +#include "boost/variant/recursive_wrapper.hpp" +#include "boost/test/minimal.hpp" + +struct base { + int trash; + + base() : trash(123) {} + base(const base& b) : trash(b.trash) { int i = 100; (void)i; } + const base& operator=(const base& b) { + trash = b.trash; + int i = 100; (void)i; + + return *this; + } + + virtual ~base(){} +}; + +struct derived1 : base{}; +struct derived2 : base{}; + +struct vbase { short trash; virtual ~vbase(){} virtual int foo() const { return 0; } }; +struct vderived1 : virtual vbase{ virtual int foo() const { return 1; } }; +struct vderived2 : virtual vbase{ virtual int foo() const { return 3; } }; +struct vderived3 : vderived1, vderived2 { virtual int foo() const { return 3; } }; + +typedef boost::variant var_t; +typedef boost::variant var_t_shortened; +typedef boost::variant var_t_no_fallback; +typedef boost::variant var_ref_t; +typedef boost::variant var_cref_t; + +struct recursive_structure; +typedef boost::variant< + int, base, derived1, derived2, std::string, boost::recursive_wrapper +> var_req_t; +struct recursive_structure { var_req_t var; }; + +template +inline void check_polymorphic_get_on_types_impl_single_type(V* v) +{ + typedef typename boost::add_reference::type ref_test_t; + typedef typename boost::add_reference::type cref_test_t; + const bool exact_same = !!boost::is_same::value; + const bool ref_same = !!boost::is_same::value; + + if (exact_same || ref_same) { + BOOST_CHECK(boost::polymorphic_get(v)); + BOOST_CHECK(boost::polymorphic_get(v)); + BOOST_CHECK(boost::polymorphic_strict_get(v)); + BOOST_CHECK(boost::polymorphic_strict_get(v)); + BOOST_CHECK(boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(boost::polymorphic_relaxed_get(v)); + + BOOST_CHECK(boost::polymorphic_get(v)); + BOOST_CHECK(boost::polymorphic_strict_get(v)); + BOOST_CHECK(boost::polymorphic_relaxed_get(v)); + + if (ref_same) { + BOOST_CHECK(boost::polymorphic_get(v)); + BOOST_CHECK(boost::polymorphic_get(v)); + BOOST_CHECK(boost::polymorphic_strict_get(v)); + BOOST_CHECK(boost::polymorphic_strict_get(v)); + BOOST_CHECK(boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(boost::polymorphic_relaxed_get(v)); + } + } else { + BOOST_CHECK(!boost::polymorphic_get(v)); + BOOST_CHECK(!boost::polymorphic_get(v)); + BOOST_CHECK(!boost::polymorphic_strict_get(v)); + BOOST_CHECK(!boost::polymorphic_strict_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + } +} + +template +inline void check_get_on_types_impl_single_type(V* v) +{ + typedef typename boost::add_reference::type ref_test_t; + typedef typename boost::add_reference::type cref_test_t; + const bool exact_same = !!boost::is_same::value; + const bool ref_same = !!boost::is_same::value; + + if (exact_same || ref_same) { + BOOST_CHECK(boost::get(v)); + BOOST_CHECK(boost::get(v)); + BOOST_CHECK(boost::strict_get(v)); + BOOST_CHECK(boost::strict_get(v)); + BOOST_CHECK(boost::relaxed_get(v)); + BOOST_CHECK(boost::relaxed_get(v)); + + BOOST_CHECK(boost::get(v)); + BOOST_CHECK(boost::strict_get(v)); + BOOST_CHECK(boost::relaxed_get(v)); + + if (ref_same) { + BOOST_CHECK(boost::get(v)); + BOOST_CHECK(boost::get(v)); + BOOST_CHECK(boost::strict_get(v)); + BOOST_CHECK(boost::strict_get(v)); + BOOST_CHECK(boost::relaxed_get(v)); + BOOST_CHECK(boost::relaxed_get(v)); + } + } else { + BOOST_CHECK(!boost::get(v)); + BOOST_CHECK(!boost::get(v)); + BOOST_CHECK(!boost::strict_get(v)); + BOOST_CHECK(!boost::strict_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + } +} + +template +inline void check_get_on_types_impl(V* v) +{ + check_get_on_types_impl_single_type(v); + check_polymorphic_get_on_types_impl_single_type(v); + + check_get_on_types_impl_single_type(v); + + check_get_on_types_impl_single_type(v); + check_polymorphic_get_on_types_impl_single_type(v); + + check_get_on_types_impl_single_type(v); + check_polymorphic_get_on_types_impl_single_type(v); + + check_get_on_types_impl_single_type(v); + check_polymorphic_get_on_types_impl_single_type(v); + + // Never exist in here + BOOST_CHECK(!boost::relaxed_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + BOOST_CHECK(!boost::relaxed_get(v)); + + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + BOOST_CHECK(!boost::polymorphic_relaxed_get(v)); + + boost::get(*v); // Must compile + boost::get(*v); // Must compile + boost::strict_get(*v); // Must compile + boost::strict_get(*v); // Must compile + + bool is_ref = boost::is_lvalue_reference::value; + (void)is_ref; + if (!is_ref) { + boost::polymorphic_get(*v); // Must compile + boost::polymorphic_get(*v); // Must compile + boost::polymorphic_strict_get(*v); // Must compile + boost::polymorphic_strict_get(*v); // Must compile + } +} + +template +inline void check_get_on_types(V* v) +{ + check_get_on_types_impl(v); + check_get_on_types_impl(v); +} + +inline void get_test() +{ + var_t v; + check_get_on_types(&v); + + var_t(base()).swap(v); + check_get_on_types(&v); + + var_t(derived1()).swap(v); + check_get_on_types(&v); + + var_t(derived2()).swap(v); + check_get_on_types(&v); + + var_t(std::string("Hello")).swap(v); + check_get_on_types(&v); + + var_t_shortened vs = derived2(); + check_polymorphic_get_on_types_impl_single_type(&vs); + check_polymorphic_get_on_types_impl_single_type(&vs); + // Checking that Base is really determinated + check_polymorphic_get_on_types_impl_single_type(&vs); + check_polymorphic_get_on_types_impl_single_type(&vs); + + vs = derived1(); + check_polymorphic_get_on_types_impl_single_type(&vs); + check_polymorphic_get_on_types_impl_single_type(&vs); + // Checking that Base is really determinated + check_polymorphic_get_on_types_impl_single_type(&vs); + check_polymorphic_get_on_types_impl_single_type(&vs); +} + +inline void get_test_no_fallback() +{ + var_t_no_fallback v; + var_t_no_fallback(base()).swap(v); + check_polymorphic_get_on_types_impl_single_type(&v); + check_polymorphic_get_on_types_impl_single_type(&v); + check_get_on_types_impl_single_type(&v); + check_get_on_types_impl_single_type(&v); + + var_t_no_fallback(derived1()).swap(v); + check_polymorphic_get_on_types_impl_single_type(&v); + check_polymorphic_get_on_types_impl_single_type(&v); + check_get_on_types_impl_single_type(&v); + check_get_on_types_impl_single_type(&v); + + var_t_no_fallback(derived2()).swap(v); + check_polymorphic_get_on_types_impl_single_type(&v); + check_polymorphic_get_on_types_impl_single_type(&v); + check_get_on_types_impl_single_type(&v); + check_get_on_types_impl_single_type(&v); +} + +inline void get_ref_test() +{ + int i = 0; + var_ref_t v(i); + check_get_on_types(&v); + check_get_on_types(&v); + + base b; + var_ref_t v1(b); + check_get_on_types(&v1); + check_get_on_types(&v1); + + derived1 d1; + var_ref_t v2(d1); + check_get_on_types(&v2); + check_get_on_types(&v2); + + derived2 d2; + var_ref_t v3(d2); + check_get_on_types(&v3); + check_get_on_types(&v3); + + std::string s("Hello"); + var_ref_t v4(s); + check_get_on_types(&v4); + check_get_on_types(&v4); +} + + +inline void get_cref_test() +{ + int i = 0; + var_cref_t v(i); + BOOST_CHECK(boost::get(&v)); + BOOST_CHECK(boost::get(&v)); + BOOST_CHECK(!boost::get(&v)); + + base b; + var_cref_t v1(b); + BOOST_CHECK(boost::get(&v1)); + BOOST_CHECK(!boost::get(&v1)); + BOOST_CHECK(!boost::get(&v1)); + + std::string s("Hello"); + const var_cref_t v4 = s; + BOOST_CHECK(boost::get(&v4)); + BOOST_CHECK(!boost::get(&v4)); +} + +inline void get_recursive_test() +{ + var_req_t v; + check_get_on_types(&v); + + var_req_t(base()).swap(v); + check_get_on_types(&v); + + var_req_t(derived1()).swap(v); + check_get_on_types(&v); + + var_req_t(derived2()).swap(v); + check_get_on_types(&v); + + var_req_t(std::string("Hello")).swap(v); + check_get_on_types(&v); + + recursive_structure s = { v }; // copying "v" + v = s; + check_get_on_types(&v); +} + +template +inline void check_that_does_not_exist_impl() +{ + using namespace boost::detail::variant; + + BOOST_CHECK((holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + BOOST_CHECK((!holds_element::value)); + + BOOST_CHECK((!holds_element >::value)); + BOOST_CHECK((!holds_element >::value)); + BOOST_CHECK((!holds_element >::value)); + + + BOOST_CHECK((holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + BOOST_CHECK((!holds_element_polymorphic::value)); + + BOOST_CHECK((!holds_element_polymorphic >::value)); + BOOST_CHECK((!holds_element_polymorphic >::value)); + BOOST_CHECK((!holds_element_polymorphic >::value)); +} + +inline void check_that_does_not_exist() +{ + using namespace boost::detail::variant; + + BOOST_CHECK((holds_element::value)); + BOOST_CHECK((holds_element::value)); + BOOST_CHECK((!holds_element::value)); + + check_that_does_not_exist_impl(); + check_that_does_not_exist_impl(); + check_that_does_not_exist_impl(); + check_that_does_not_exist_impl(); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +class MoveonlyType { +public: + MoveonlyType() {} + ~MoveonlyType() {} + + MoveonlyType(MoveonlyType&& other) {} + void operator=(MoveonlyType&& other) {} + +private: + MoveonlyType(const MoveonlyType&); + void operator=(const MoveonlyType& other); +}; + +const boost::variant foo1() { return ""; } +boost::variant foo2() { return ""; } + +inline void get_rvref_test() +{ + boost::get(foo1()); + boost::get(foo2()); + + boost::variant v; + + v = MoveonlyType(); + boost::get(boost::move(v)); + + v = 3; + + v = MoveonlyType(); + boost::get(v); + + boost::relaxed_get(boost::variant()); + + v = MoveonlyType(); + MoveonlyType moved_from_variant(boost::get(boost::move(v))); +} +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES + +int test_main(int , char* []) +{ + get_test(); + get_test_no_fallback(); + get_ref_test(); + get_cref_test(); + get_recursive_test(); + check_that_does_not_exist(); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + get_rvref_test(); +#endif + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_multivisit_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_multivisit_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f634fbacef4370f0aaee9e58cf2a1abac5811fea --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_multivisit_test.cpp @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_multivisit_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2013-2015 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/config.hpp" +#include "boost/noncopyable.hpp" +#define BOOST_VARAINT_MAX_MULTIVIZITOR_PARAMS 5 +#include "boost/variant/multivisitors.hpp" +#include "boost/variant.hpp" + +#include "boost/test/minimal.hpp" + +struct my_noncopyable : boost::noncopyable { + my_noncopyable(){} + ~my_noncopyable(){} +}; + +typedef boost::variant variant_noncopy_t; + + +typedef boost::variant variant6_t; + +struct test_visitor: boost::static_visitor<> { + // operators that shall not be called + template + void operator()(T1&, T2&, T3&) const + { + BOOST_CHECK(false); + } + + template + void operator()(T1&, T2&, T3&, T4&) const + { + BOOST_CHECK(false); + } + + template + void operator()(T1&, T2&, T3&, T4&, T5&) const + { + BOOST_CHECK(false); + } + + // operators that are OK to call + void operator()(char v0, unsigned char v1, signed char v2) const + { + BOOST_CHECK(v0 == 0); + BOOST_CHECK(v1 == 1); + BOOST_CHECK(v2 == 2); + } + + void operator()(char v0, unsigned char v1, signed char v2, unsigned short v3) const + { + BOOST_CHECK(v0 == 0); + BOOST_CHECK(v1 == 1); + BOOST_CHECK(v2 == 2); + BOOST_CHECK(v3 == 3); + } + + void operator()(char v0, unsigned char v1, signed char v2, unsigned short v3, int v4) const + { + BOOST_CHECK(v0 == 0); + BOOST_CHECK(v1 == 1); + BOOST_CHECK(v2 == 2); + BOOST_CHECK(v3 == 3); + BOOST_CHECK(v4 == 4); + } + + + // Noncopyables + void operator()(my_noncopyable&, my_noncopyable&, my_noncopyable&) const { + BOOST_CHECK(true); + } + void operator()(my_noncopyable&, my_noncopyable&, my_noncopyable&, my_noncopyable&) const { + BOOST_CHECK(true); + } + void operator()(my_noncopyable&, my_noncopyable&, my_noncopyable&, my_noncopyable&, my_noncopyable&) const { + BOOST_CHECK(true); + } + void operator()(my_noncopyable&, my_noncopyable&, my_noncopyable&, my_noncopyable&, my_noncopyable&, my_noncopyable&) const { + BOOST_CHECK(true); + } +}; + +typedef boost::variant bool_like_t; +typedef boost::variant arithmetics_t; + +struct if_visitor: public boost::static_visitor { + template + arithmetics_t operator()(T0 b, T1 v1, T2 v2) const { + if (!!b) { + return v1; + } else { + return v2; + } + } +}; + + +int test_main(int , char* []) +{ + test_visitor v; + + variant6_t v_array6[6]; + v_array6[0] = char(0); + v_array6[1] = static_cast(1); + v_array6[2] = static_cast(2); + v_array6[3] = static_cast(3); + v_array6[4] = static_cast(4); + v_array6[5] = static_cast(5); + + boost::apply_visitor(v, v_array6[0], v_array6[1], v_array6[2]); + boost::apply_visitor(test_visitor(), v_array6[0], v_array6[1], v_array6[2]); + +// Following test also pass, but requires many Gigabytes of RAM for compilation and compile for about 15 minutes +//#define BOOST_VARIANT_MULTIVISITORS_TEST_VERY_EXTREME +#ifdef BOOST_VARIANT_MULTIVISITORS_TEST_VERY_EXTREME + boost::apply_visitor(v, v_array6[0], v_array6[1], v_array6[2], v_array6[3]); + boost::apply_visitor(test_visitor(), v_array6[0], v_array6[1], v_array6[2], v_array6[3]); + + boost::apply_visitor(v, v_array6[0], v_array6[1], v_array6[2], v_array6[3], v_array6[4]); + boost::apply_visitor(test_visitor(), v_array6[0], v_array6[1], v_array6[2], v_array6[3], v_array6[4]); +#endif + + bool_like_t v0(1), v1(true), v2(1.0); + + BOOST_CHECK( + boost::apply_visitor(if_visitor(), v0, v1, v2) + == + arithmetics_t(true) + ); + +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + if_visitor if_vis; + BOOST_CHECK( + boost::apply_visitor(if_vis)(v0, v1, v2) + == + arithmetics_t(true) + ); +#endif + + + variant_noncopy_t vnonc[6]; + boost::apply_visitor(v, vnonc[0], vnonc[1], vnonc[2]); + boost::apply_visitor(test_visitor(), vnonc[0], vnonc[1], vnonc[2], vnonc[3]); + +#ifdef BOOST_VARIANT_MULTIVISITORS_TEST_VERY_EXTREME + boost::apply_visitor(v, vnonc[0], vnonc[1], vnonc[2], vnonc[3], vnonc[4]); + boost::apply_visitor(test_visitor(), vnonc[0], vnonc[1], vnonc[2], vnonc[3], vnonc[4], vnonc[5]); +#endif + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_nonempty_check.cpp b/tools/boost_1_65_1/libs/variant/test/variant_nonempty_check.cpp new file mode 100644 index 0000000000000000000000000000000000000000..644889ed65aa572b0a4cba28164c1426b61a17a1 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_nonempty_check.cpp @@ -0,0 +1,474 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_nonempty_check.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2014 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + + +// In this file we are making tests to ensure that variant guarantees nonemptiness. +// +// For that purpose we create a `throwing_class`, that throws exception at a specified +// assignment attempt. If exception was thrown during move/assignemnt operation we make sure +// that data in variant is same as before move/assignemnt operation or that a fallback type is +// stored in variant. +// +// Different nonthrowing_class'es are used to tests different variant internal policies: +// with/without fallback type + throw/nothrow copyable + throw/nothrow movable + + +#include "boost/variant/variant.hpp" +#include "boost/variant/get.hpp" +#include "boost/test/minimal.hpp" +#include + +struct exception_on_assignment : std::exception {}; +struct exception_on_move_assignment : exception_on_assignment {}; + +void prevent_compiler_noexcept_detection() { + char* p = new char; + *p = '\0'; + delete p; +} + + +struct throwing_class { + int trash; + enum helper_enum { + do_not_throw = 780, + throw_after_5, + throw_after_4, + throw_after_3, + throw_after_2, + throw_after_1 + }; + + bool is_throw() { + if (trash < do_not_throw) { + return true; + } + + if (trash > do_not_throw && trash <= throw_after_1) { + ++ trash; + return false; + } + + return trash != do_not_throw; + } + + throwing_class(int value = 123) BOOST_NOEXCEPT_IF(false) : trash(value) { + prevent_compiler_noexcept_detection(); + } + + throwing_class(const throwing_class& b) BOOST_NOEXCEPT_IF(false) : trash(b.trash) { + if (is_throw()) { + throw exception_on_assignment(); + } + } + + const throwing_class& operator=(const throwing_class& b) BOOST_NOEXCEPT_IF(false) { + trash = b.trash; + if (is_throw()) { + throw exception_on_assignment(); + } + + return *this; + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + throwing_class(throwing_class&& b) BOOST_NOEXCEPT_IF(false) : trash(b.trash) { + if (is_throw()) { + throw exception_on_move_assignment(); + } + } + + const throwing_class& operator=(throwing_class&& b) BOOST_NOEXCEPT_IF(false) { + trash = b.trash; + if (is_throw()) { + throw exception_on_move_assignment(); + } + + return *this; + } +#endif + + virtual ~throwing_class() {} +}; + +struct nonthrowing_class { + int trash; + + nonthrowing_class() BOOST_NOEXCEPT_IF(false) : trash(123) { + prevent_compiler_noexcept_detection(); + } + + nonthrowing_class(const nonthrowing_class&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + } + + const nonthrowing_class& operator=(const nonthrowing_class&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + return *this; + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + nonthrowing_class(nonthrowing_class&&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + } + + const nonthrowing_class& operator=(nonthrowing_class&&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + return *this; + } +#endif +}; + +struct nonthrowing_class2 { + int trash; + + nonthrowing_class2() BOOST_NOEXCEPT_IF(false) : trash(123) { + prevent_compiler_noexcept_detection(); + } +}; + +struct nonthrowing_class3 { + int trash; + + nonthrowing_class3() BOOST_NOEXCEPT_IF(true) : trash(123) {} + + nonthrowing_class3(const nonthrowing_class3&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + } + + const nonthrowing_class3& operator=(const nonthrowing_class3&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + return *this; + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + nonthrowing_class3(nonthrowing_class3&&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + } + + const nonthrowing_class3& operator=(nonthrowing_class3&&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + return *this; + } +#endif +}; + +struct nonthrowing_class4 { + int trash; + + nonthrowing_class4() BOOST_NOEXCEPT_IF(false) : trash(123) { + prevent_compiler_noexcept_detection(); + } + + nonthrowing_class4(const nonthrowing_class4&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + } + + const nonthrowing_class4& operator=(const nonthrowing_class4&) BOOST_NOEXCEPT_IF(false) { + prevent_compiler_noexcept_detection(); + return *this; + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + nonthrowing_class4(nonthrowing_class4&&) BOOST_NOEXCEPT_IF(true) { + } + + const nonthrowing_class4& operator=(nonthrowing_class4&&) BOOST_NOEXCEPT_IF(true) { + return *this; + } +#endif +}; + + +// Tests ///////////////////////////////////////////////////////////////////////////////////// + + +template +inline void check_1_impl(int helper) +{ + boost::variant v; + try { + v = throwing_class(helper); + BOOST_CHECK(!v.which()); + BOOST_CHECK(boost::get(&v)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v.which()); + BOOST_CHECK(boost::get(&v)); + } + + try { + throwing_class tc(helper); + v = tc; + BOOST_CHECK(!v.which()); + BOOST_CHECK(boost::get(&v)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v.which()); + BOOST_CHECK(boost::get(&v)); + } +} + +inline void check_1(int helper = 1) +{ + check_1_impl(helper); + check_1_impl(helper); + check_1_impl(helper); + check_1_impl(helper); + check_1_impl(helper); +} + +template +inline void check_2_impl(int helper) +{ + boost::variant v; + try { + v = throwing_class(helper); + BOOST_CHECK(v.which() == 1); + BOOST_CHECK(boost::get(&v)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v.which()); + BOOST_CHECK(boost::get(&v)); + } + + try { + throwing_class cl(helper); + v = cl; + BOOST_CHECK(v.which() == 1); + BOOST_CHECK(boost::get(&v)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v.which()); + BOOST_CHECK(boost::get(&v)); + } +} + +inline void check_2(int helper = 1) +{ + check_2_impl(helper); + check_2_impl(helper); + check_2_impl(helper); + check_2_impl(helper); + check_2_impl(helper); +} + +template +inline void check_3_impl(int helper) +{ + boost::variant v1, v2; + + swap(v1, v2); + try { + v1 = throwing_class(helper); + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(boost::get(&v1)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v1.which()); + BOOST_CHECK(boost::get(&v1)); + } + + + try { + v2 = throwing_class(helper); + BOOST_CHECK(v2.which() == 1); + BOOST_CHECK(boost::get(&v2)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v2.which()); + BOOST_CHECK(boost::get(&v2)); + } + + + if (!v1.which() && !v2.which()) { + swap(v1, v2); // Make sure that two backup holders swap well + BOOST_CHECK(!v1.which()); + BOOST_CHECK(boost::get(&v1)); + BOOST_CHECK(!v2.which()); + BOOST_CHECK(boost::get(&v2)); + + v1 = v2; + } +} + +inline void check_3(int helper = 1) +{ + check_3_impl(helper); + check_3_impl(helper); + check_3_impl(helper); + check_3_impl(helper); + check_3_impl(helper); +} + +inline void check_4(int helper = 1) +{ + // This one has a fallback + boost::variant v1, v2; + + swap(v1, v2); + try { + v1 = throwing_class(helper); + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(boost::get(&v1)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v1.which()); + BOOST_CHECK(boost::get(&v1)); + } + + + try { + v2 = throwing_class(helper); + BOOST_CHECK(v2.which() == 1); + BOOST_CHECK(boost::get(&v2)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(!v2.which()); + BOOST_CHECK(boost::get(&v2)); + } + + if (!v1.which() && !v2.which()) { + swap(v1, v2); + BOOST_CHECK(!v1.which()); + BOOST_CHECK(boost::get(&v1)); + BOOST_CHECK(!v2.which()); + BOOST_CHECK(boost::get(&v2)); + + v1 = v2; + } +} + +template +inline void check_5_impl(int helper) +{ + boost::variant v1, v2; + throwing_class throw_not_now; + throw_not_now.trash = throwing_class::do_not_throw; + v1 = throw_not_now; + v2 = throw_not_now; + + boost::get(v1).trash = 1; + boost::get(v2).trash = 1; + + try { + v1 = throwing_class(helper); + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(boost::get(&v1)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(boost::get(&v1)); + } + + boost::get(v1).trash = throwing_class::do_not_throw; + boost::get(v2).trash = throwing_class::do_not_throw; + v1 = Nonthrowing(); + v2 = Nonthrowing(); + try { + v1 = throwing_class(helper); + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(boost::get(&v1)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(v1.which() == 0); + BOOST_CHECK(boost::get(&v1)); + } + + int v1_type = v1.which(); + int v2_type = v2.which(); + try { + swap(v1, v2); // Make sure that backup holders swap well + BOOST_CHECK(v1.which() == v2_type); + BOOST_CHECK(v2.which() == v1_type); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(v1.which() == v1_type); + BOOST_CHECK(v2.which() == v2_type); + } +} + + +inline void check_5(int helper = 1) +{ + check_5_impl(helper); + check_5_impl(helper); + check_5_impl(helper); + check_5_impl(helper); + check_5_impl(helper); +} + +template +inline void check_6_impl(int helper) +{ + boost::variant v1, v2; + throwing_class throw_not_now; + throw_not_now.trash = throwing_class::do_not_throw; + v1 = throw_not_now; + v2 = throw_not_now; + + v1 = throw_not_now; + v2 = throw_not_now; + swap(v1, v2); + boost::get(v1).trash = 1; + boost::get(v2).trash = 1; + + v1 = throwing_class(throw_not_now); + v2 = v1; + + v1 = Nonthrowing(); + try { + throwing_class tc; + tc.trash = helper; + v1 = tc; + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(boost::get(&v1)); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(v1.which() == 0); + } + + v2 = Nonthrowing(); + try { + v2 = 2; + BOOST_CHECK(false); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(v2.which() == 0); + } + + // Probably the most significant test: + // unsuccessful swap must preserve old values of variant + v1 = throw_not_now; + boost::get(v1).trash = helper; + try { + swap(v1, v2); + } catch (const exception_on_assignment& /*e*/) { + BOOST_CHECK(v1.which() == 1); + BOOST_CHECK(v2.which() == 0); + BOOST_CHECK(boost::get(v1).trash == helper); + } +} + + +inline void check_6(int helper = 1) +{ + check_6_impl(helper); + check_6_impl(helper); + check_6_impl(helper); + check_6_impl(helper); + check_6_impl(helper); +} + +int test_main(int , char* []) +{ + // throwing_class::throw_after_1 + 1 => throw on first assignment/construction + // throwing_class::throw_after_1 => throw on second assignment/construction + // throwing_class::throw_after_2 => throw on third assignment/construction + // ... + for (int i = throwing_class::throw_after_1 + 1; i != throwing_class::do_not_throw; --i) { + check_1(i); + check_2(i); + check_3(i); + check_4(i); + check_5(i); + check_6(i); + } + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_over_joint_view_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_over_joint_view_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..293882766d97550e8e3a2f003410aa1a79fbec20 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_over_joint_view_test.cpp @@ -0,0 +1,64 @@ +// Copyright (c) 2017 +// Mikhail Maximov +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// The test is base on https://svn.boost.org/trac/boost/ticket/8554 +// variant was not able to extract types from mpl::joint_view + +#include + +#include "boost/config.hpp" +#include "boost/test/minimal.hpp" + +#include "boost/variant.hpp" +#include "boost/mpl/joint_view.hpp" +#include "boost/mpl/insert_range.hpp" +#include "boost/mpl/set.hpp" + +template +void check_exception_on_get(Variant& v) { + try { + boost::get(v); + BOOST_FAIL("Expected exception boost::bad_get, but got nothing."); + } catch (boost::bad_get&) { //okay it is expected behaviour + } catch (...) { BOOST_FAIL("Expected exception boost::bad_get, but got something else."); } +} + +void test_joint_view() { + typedef boost::variant v1; + typedef boost::variant v2; + typedef boost::make_variant_over::type>::type v3; + + v1 a = 1; + v2 b = "2"; + v3 c = a; + BOOST_CHECK(boost::get(c) == 1); + BOOST_CHECK(c.which() == 0); + v3 d = b; + BOOST_CHECK(boost::get(d) == "2"); + BOOST_CHECK(d.which() == 1); + check_exception_on_get(c); + check_exception_on_get(d); +} + +void test_set() { + typedef boost::mpl::set2< std::string, int > types; + typedef boost::make_variant_over< types >::type v; + + v a = 1; + BOOST_CHECK(boost::get(a) == 1); + check_exception_on_get(a); + a = "2"; + BOOST_CHECK(boost::get(a) == "2"); + check_exception_on_get(a); +} + +int test_main(int , char* []) +{ + test_joint_view(); + test_set(); + return 0; +} \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/variant/test/variant_polymorphic_get_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_polymorphic_get_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..43fc7b6b9d455f8e289acece1350ca5c18650de6 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_polymorphic_get_test.cpp @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_plymorphic_get_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 Eric Friedman +// Copyright (c) 2013-2014 Antony Polukhin +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/variant/variant.hpp" +#include "boost/variant/apply_visitor.hpp" +#include "boost/variant/static_visitor.hpp" +#include "boost/variant/polymorphic_get.hpp" +#include "boost/test/minimal.hpp" + +struct base {int trash;}; +struct derived1 : base{}; +struct derived2 : base{}; + +struct vbase { short trash; virtual ~vbase(){} virtual int foo() const { return 0; } }; +struct vderived1 : virtual vbase{ virtual int foo() const { return 1; } }; +struct vderived2 : virtual vbase{ virtual int foo() const { return 3; } }; +struct vderived3 : vderived1, vderived2 { virtual int foo() const { return 3; } }; + +template +inline void check_throws(Variant& v) { + try { + boost::polymorphic_get(v); + BOOST_CHECK(false); + } catch (const boost::bad_polymorphic_get& e) { + BOOST_CHECK(!!e.what()); + BOOST_CHECK(std::string(e.what()) != boost::bad_get().what()); + } +} + +int test_main(int , char* []) +{ + typedef boost::variant var_t; + + var_t var1; + BOOST_CHECK(!boost::polymorphic_get(&var1)); + check_throws(var1); + BOOST_CHECK(!boost::polymorphic_get(&var1)); + check_throws(var1); + + var1 = derived1(); + BOOST_CHECK(boost::polymorphic_get(&var1)); + BOOST_CHECK(boost::polymorphic_get(&var1)); + + derived2 d; + d.trash = 777; + var_t var2 = d; + BOOST_CHECK(boost::polymorphic_get(var2).trash == 777); + BOOST_CHECK(boost::polymorphic_get(var2).trash == 777); + + var2 = 777; + BOOST_CHECK(!boost::polymorphic_get(&var2)); + check_throws(var2); + BOOST_CHECK(!boost::polymorphic_get(&var2)); + check_throws(var2); + BOOST_CHECK(boost::polymorphic_get(var2) == 777); + BOOST_CHECK(boost::polymorphic_get(var2) == 777); + + typedef boost::variant vvar_t; + + vvar_t v = vderived3(); + boost::polymorphic_get(v).trash = 777; + const vvar_t& cv = v; + BOOST_CHECK(boost::polymorphic_get(cv).trash == 777); + BOOST_CHECK(boost::polymorphic_get(cv).trash == 777); + + BOOST_CHECK(boost::polymorphic_get(cv).foo() == 3); + BOOST_CHECK(boost::polymorphic_get(v).foo() == 3); + BOOST_CHECK(boost::polymorphic_get(cv).foo() == 3); + BOOST_CHECK(boost::polymorphic_get(v).foo() == 3); + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_reference_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_reference_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d10c0f8513542e17f865a6ffcae6b0bf40efedde --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_reference_test.cpp @@ -0,0 +1,116 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_reference_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman, Itay Maman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/variant.hpp" +#include "boost/test/minimal.hpp" + +#include "boost/mpl/bool.hpp" +#include "boost/type_traits/add_reference.hpp" +#include "boost/type_traits/is_pointer.hpp" + +///// +// support types and functions + +struct base_t { }; +struct derived_t : base_t { }; + +template +bool check_base_derived(Base* b, Derived* d, long) +{ + return b == d; +} + +template +bool check_base_derived(Base& b, Derived& d, int) +{ + return &b == &d; +} + +template + typename boost::add_reference::type +wknd_get(boost::variant& var, long) +{ + return boost::get(var); +} + +template + typename boost::add_reference::type +wknd_get(boost::variant& var, int) +{ + return boost::get(var); +} + +///// +// test functions + +template +void test_reference_content(T& t, const T& value1, const T& value2) +{ + BOOST_CHECK( !(value1 == value2) ); + + ///// + + boost::variant< T& > var(t); + BOOST_CHECK(( boost::get(&var) == &t )); + + t = value1; + BOOST_CHECK(( boost::get(var) == value1 )); + + ///// + + boost::variant< T > var2(var); + BOOST_CHECK(( boost::get(var2) == value1 )); + + t = value2; + BOOST_CHECK(( boost::get(var2) == value1 )); +} + +template +void base_derived_test(Derived d) +{ + Base b(d); + BOOST_CHECK((check_base_derived( + b + , d + , 1L + ))); + + boost::variant base_var(d); + BOOST_CHECK((check_base_derived( + wknd_get(base_var, 1L) + , d + , 1L + ))); + + boost::variant derived_var(d); + boost::variant base_from_derived_var(derived_var); + BOOST_CHECK((check_base_derived( + wknd_get(base_from_derived_var, 1L) + , wknd_get(derived_var, 1L) + , 1L + ))); +} + +int test_main(int , char* []) +{ + int i = 0; + test_reference_content(i, 1, 2); + + ///// + + derived_t d; + base_derived_test< int&,int >(i); + base_derived_test< base_t*,derived_t* >(&d); + base_derived_test< base_t&,derived_t& >(d); + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_rvalue_get_with_ampersand_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_rvalue_get_with_ampersand_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4160c093fead2b55556c5dcbd7fabc19b5bcf9de --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_rvalue_get_with_ampersand_test.cpp @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_get_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2017-2017 Albert Sverdlov +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/variant/get.hpp" +#include "boost/variant/variant.hpp" +#include "boost/test/minimal.hpp" + +#include +#include + +#include + +#define UNUSED(v) (void)(v) + +inline void run() +{ +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + typedef boost::variant var_t; + + std::string s = "abacaba"; + var_t v = s; + + // must spit an error at compile-time because of 'std::string&' + std::string new_s = boost::strict_get(boost::move(v)); + UNUSED(new_s); +#else + BOOST_STATIC_ASSERT_MSG(false, "Dummy compile-time error to pass the test on C++03"); +#endif +} + +int test_main(int /*argc*/, char* /*argv*/ []) +{ + run(); + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/variant/test/variant_swap_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_swap_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bab8dc0236f589605ecd1de238d65af2e0f1815 --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_swap_test.cpp @@ -0,0 +1,90 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_swap_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2009 ArtVPS Ltd. +// Copyright (c) 2013 Antony Polukhin. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/test/minimal.hpp" +#include "boost/variant.hpp" + +#include +#include + +void run1() +{ + using boost::variant; + typedef variant< int, std::vector* > t_var; + + std::vector vec; + t_var v0(23), v1(&vec); + + BOOST_REQUIRE(v0.which() == 0); + BOOST_REQUIRE(v1.which() == 1); + + swap(v0, v1); + + BOOST_CHECK(v0.which() == 1); + BOOST_CHECK(v1.which() == 0); +} + +void run2() +{ + using boost::variant; + using std::swap; + typedef variant< std::vector, std::vector > t_var; + + std::vector vec1; + std::vector vec2; + t_var v0(vec1), v1(vec2); + + BOOST_REQUIRE(v0.which() == 0); + BOOST_REQUIRE(v1.which() == 1); + + swap(v0, v1); + + BOOST_CHECK(v0.which() == 1); + BOOST_CHECK(v1.which() == 0); + + v0.swap(v1); + + BOOST_CHECK(v0.which() == 0); + BOOST_CHECK(v1.which() == 1); +} + +void run3() +{ + using boost::variant; + using std::swap; + typedef variant< int, double > t_var; + + t_var v0(1), v1(2.0); + + BOOST_REQUIRE(v0.which() == 0); + BOOST_REQUIRE(v1.which() == 1); + + swap(v0, v1); + + BOOST_CHECK(v0.which() == 1); + BOOST_CHECK(v1.which() == 0); + + v0.swap(v1); + + BOOST_CHECK(v0.which() == 0); + BOOST_CHECK(v1.which() == 1); +} + +int test_main(int , char* []) +{ + run1(); + run2(); + run3(); + + return 0; +} + diff --git a/tools/boost_1_65_1/libs/variant/test/variant_visit_test.cpp b/tools/boost_1_65_1/libs/variant/test/variant_visit_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b097f4c8d4276a9bc08c3c788c3ef0904193807d --- /dev/null +++ b/tools/boost_1_65_1/libs/variant/test/variant_visit_test.cpp @@ -0,0 +1,143 @@ +//----------------------------------------------------------------------------- +// boost-libs variant/test/variant_visit_test.cpp source file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/variant/variant.hpp" +#include "boost/variant/apply_visitor.hpp" +#include "boost/variant/static_visitor.hpp" +#include "boost/test/minimal.hpp" + +#include "boost/mpl/bool.hpp" +#include "boost/mpl/and.hpp" +#include "boost/type_traits/is_same.hpp" + +struct udt1 +{ +}; + +struct udt2 +{ +}; + +template +class unary_check_content_type + : public boost::static_visitor +{ +public: + + // not recommended design, but simplifies workarounds: + + template + bool operator()(U&) const + { + return ::boost::is_same::value; + } + +}; + +template +class binary_check_content_type + : public boost::static_visitor +{ +public: + + // not recommended design, but simplifies workarounds: + + template + bool operator()(U1&, U2&) const + { + return ::boost::mpl::and_< + boost::is_same + , boost::is_same + >::value; + } + +}; + +template +inline void unary_test(Variant& var, Checker* = 0) +{ + Checker checker; + const Checker& const_checker = checker; + + // standard tests + + BOOST_CHECK( boost::apply_visitor(checker, var) ); + BOOST_CHECK( boost::apply_visitor(const_checker, var) ); + BOOST_CHECK( boost::apply_visitor(Checker(), var) ); + + // delayed tests + + BOOST_CHECK( boost::apply_visitor(checker)(var) ); + BOOST_CHECK( boost::apply_visitor(const_checker)(var) ); +} + +template +inline void binary_test(Variant1& var1, Variant2& var2, Checker* = 0) +{ + Checker checker; + const Checker& const_checker = checker; + + // standard tests + + BOOST_CHECK( boost::apply_visitor(checker, var1, var2) ); + BOOST_CHECK( boost::apply_visitor(const_checker, var1, var2) ); + BOOST_CHECK( boost::apply_visitor(Checker(), var1, var2) ); + + // delayed tests + + BOOST_CHECK( boost::apply_visitor(checker)(var1, var2) ); + BOOST_CHECK( boost::apply_visitor(const_checker)(var1, var2) ); +} + +int test_main(int , char* []) +{ + typedef boost::variant var_t; + udt1 u1; + var_t var1(u1); + udt2 u2; + var_t var2(u2); + + const var_t& cvar1 = var1; + const var_t& cvar2 = var2; + + // + // unary tests + // + + typedef unary_check_content_type check1_t; + typedef unary_check_content_type check1_const_t; + typedef unary_check_content_type check2_t; + typedef unary_check_content_type check2_const_t; + + unary_test< check1_t >(var1); + unary_test< check1_const_t >(cvar1); + + unary_test< check2_t >(var2); + unary_test< check2_const_t >(cvar2); + + // + // binary tests + // + + typedef binary_check_content_type check12_t; + typedef binary_check_content_type check12_const_t; + typedef binary_check_content_type check21_t; + typedef binary_check_content_type check21_const_t; + + binary_test< check12_t >(var1,var2); + binary_test< check12_const_t >(cvar1,cvar2); + + binary_test< check21_t >(var2,var1); + binary_test< check21_const_t >(cvar2,cvar1); + + return boost::exit_success; +} diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ARRAY_TO_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ARRAY_TO_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..72337b9a9097e9eec0cb1ef1918dca595a1c6e61 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ARRAY_TO_SEQ.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_ARRAY_TO_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ARRAY_TO_SEQ

+

BOOST_VMD_ARRAY_TO_SEQ — converts an array to a seq.

+
+

Synopsis

+
// In header: <boost/vmd/array/to_seq.hpp>
+
+BOOST_VMD_ARRAY_TO_SEQ(array)
+
+

Description

+

array = array to be converted.

+

If the array is an array of 0 elements it is converted to an empty seq. Otherwise the array is converted to a seq with the same number of elements as the array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ARRAY_TO_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ARRAY_TO_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..c82f998a58249dcdaedc5b0eb342cf5095bcfb86 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ARRAY_TO_TUPLE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_ARRAY_TO_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ARRAY_TO_TUPLE

+

BOOST_VMD_ARRAY_TO_TUPLE — converts an array to a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/array/to_tuple.hpp>
+
+BOOST_VMD_ARRAY_TO_TUPLE(array)
+
+

Description

+

array = array to be converted.

+

If the array is an array of 0 elements it is converted to an empty tuple. Otherwise the array is converted to a tuple with the same number of elements as the array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT.html new file mode 100644 index 0000000000000000000000000000000000000000..347362a20ea715c2ffc50046e4479925f6d64f14 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT.html @@ -0,0 +1,57 @@ + + + +Macro BOOST_VMD_ASSERT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT

+

BOOST_VMD_ASSERT — Conditionally causes an error to be generated.

+
+

Synopsis

+
// In header: <boost/vmd/assert.hpp>
+
+BOOST_VMD_ASSERT(...)
+
+

Description

+

... = variadic parameters, maximum of 2 will be considered. Any variadic parameters beyond the maximum of 2 are just ignored.

+

The first variadic parameter is:

+

cond = A condition that determines whether an assertion occurs. Valid values range from 0 to BOOST_PP_LIMIT_MAG.

+

The second variadic parameter (optional) is:

+

errstr = An error string for generating a compiler error when using the VC++ compiler. The VC++ compiler is incapable of producing a preprocessor error so when the 'cond' is 0, a compiler error is generated by outputting C++ code in the form of:

+

typedef char errstr[-1];

+

The errstr defaults to BOOST_VMD_ASSERT_ERROR if not supplied. It is only relevant for VC++.

+

returns = If cond expands to 0, this macro causes an error. Otherwise, it expands to nothing. For all compilers other than Visual C++ the error is a preprocessing error. For Visual C++ the error is caused by output invalid C++: this error could be masked if the invalid output is ignored by a macro which invokes this macro.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_ARRAY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_ARRAY.html new file mode 100644 index 0000000000000000000000000000000000000000..45330a2febbfdf877cb8c21aea7a542eb1743910 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_ARRAY.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_ARRAY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_ARRAY

+

BOOST_VMD_ASSERT_IS_ARRAY — Asserts that the sequence is a Boost PP array.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_array.hpp>
+
+BOOST_VMD_ASSERT_IS_ARRAY(sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP array. If it is not a Boost PP array, it forces a compiler error.

+

The macro normally checks for a Boost PP array only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

sequence = a possible Boost PP array.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP array, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP array the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_ARRAY_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_ARRAY_D.html new file mode 100644 index 0000000000000000000000000000000000000000..b962fc0d47374a318d9cd17b8df39ad8dc290686 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_ARRAY_D.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_ARRAY_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_ARRAY_D

+

BOOST_VMD_ASSERT_IS_ARRAY_D — Asserts that the sequence is a Boost PP array. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_array.hpp>
+
+BOOST_VMD_ASSERT_IS_ARRAY_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP array. If it is not a Boost PP array, it forces a compiler error.

+

The macro normally checks for a Boost PP array only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP sequence.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP array, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP array the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_EMPTY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_EMPTY.html new file mode 100644 index 0000000000000000000000000000000000000000..8b29e286b0be7304902a94fcce2ed6eb983f9ee2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_EMPTY.html @@ -0,0 +1,64 @@ + + + +Macro BOOST_VMD_ASSERT_IS_EMPTY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_EMPTY

+

BOOST_VMD_ASSERT_IS_EMPTY — Asserts that the input is empty.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_empty.hpp>
+
+BOOST_VMD_ASSERT_IS_EMPTY(...)
+
+

Description

+

The macro checks to see if the input is empty or not. If it is not empty, it forces a compiler error.

+

The macro is a variadic macro taking any input. For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check and not variadic data.

+

The macro normally checks for emptiness only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

.... = variadic input, for VC++8 this must be a single parameter.

+

returns = Normally the macro returns nothing. If the input is empty, nothing is output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the input is not empty the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the input is not empty. +

+

It is recommended to append BOOST_PP_EMPTY() to whatever input is being tested in order to avoid possible warning messages from some compilers about no parameters being passed to the macro when the input is truly empty.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_IDENTIFIER.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_IDENTIFIER.html new file mode 100644 index 0000000000000000000000000000000000000000..03c000dbee674e8fea00eea99dbfe989bd4a6a64 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_IDENTIFIER.html @@ -0,0 +1,75 @@ + + + +Macro BOOST_VMD_ASSERT_IS_IDENTIFIER + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_IDENTIFIER

+

BOOST_VMD_ASSERT_IS_IDENTIFIER — Asserts that the sequence is an identifier.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_identifier.hpp>
+
+BOOST_VMD_ASSERT_IS_IDENTIFIER(...)
+
+

Description

+

The macro checks that the sequence is an identifier. If it is not an identifier, it forces a compiler error.

+

The macro normally checks for an identifier only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

... = variadic parameters

+

The variadic parameters are:

+

sequence = A sequence to test as an identifier. ids (optional) = The data may take one of two forms: it is either one or more single identifiers or a single Boost PP tuple of identifiers.

+

returns = Normally the macro returns nothing. If the sequence is an identifier, nothing is + output. If optional ids are specified, for the + sequence to be an identifier it must be an + identifier that matches one of the optional + ids. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not an identifier the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not an + identifier. +

+

Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +

+

The identifier must be registered to be found.

+

Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +

+

If you specify optional ids and have not specified the detection of an optional id, that id will never match an identifier.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_IDENTIFIER_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_IDENTIFIER_D.html new file mode 100644 index 0000000000000000000000000000000000000000..d0d4fe0e1550c31ba5a236250bd91579f2c8b82a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_IDENTIFIER_D.html @@ -0,0 +1,75 @@ + + + +Macro BOOST_VMD_ASSERT_IS_IDENTIFIER_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_IDENTIFIER_D

+

BOOST_VMD_ASSERT_IS_IDENTIFIER_D — Asserts that the sequence is an identifier. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_identifier.hpp>
+
+BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d, ...)
+
+

Description

+

The macro checks that the sequence is an identifier. If it is not an identifier, it forces a compiler error.

+

The macro normally checks for an identifier only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

d = The next available BOOST_PP_WHILE iteration. ... = variadic parameters

+

The variadic parameters are:

+

sequence = A sequence to test as an identifier. ids (optional) = The data may take one of two forms: it is either one or more single identifiers or a single Boost PP tuple of identifiers.

+

returns = Normally the macro returns nothing. If the sequence is an identifier, nothing is + output. If optional ids are specified, for the + sequence to be an identifier it must be an + identifier that matches one of the optional + ids. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not an identifier the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not an + identifier. +

+

Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +

+

The identifier must be registered to be found.

+

Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +

+

If you specify optional ids and have not specified the detection of an optional id, that id will never match an identifier.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_LIST.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_LIST.html new file mode 100644 index 0000000000000000000000000000000000000000..49ee7218546593902c844c1f59410b25036e4e18 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_LIST.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_LIST + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_LIST

+

BOOST_VMD_ASSERT_IS_LIST — Asserts that the sequence is a Boost PP list.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_list.hpp>
+
+BOOST_VMD_ASSERT_IS_LIST(sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP list. If it is not a Boost PP list, it forces a compiler error.

+

The macro normally checks for a Boost PP list only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

sequence = a possible Boost PP list.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP list, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP list the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the parameter is not a + Boost PP list.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_LIST_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_LIST_D.html new file mode 100644 index 0000000000000000000000000000000000000000..9633103913ce15511ec65b14deeb6dcc7963983f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_LIST_D.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_LIST_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_LIST_D

+

BOOST_VMD_ASSERT_IS_LIST_D — Asserts that the sequence is a Boost PP list. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_list.hpp>
+
+BOOST_VMD_ASSERT_IS_LIST_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP list. If it is not a Boost PP list, it forces a compiler error.

+

The macro normally checks for a Boost PP list only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP list.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP list, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP list the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the parameter is not a + Boost PP list.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_NUMBER.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_NUMBER.html new file mode 100644 index 0000000000000000000000000000000000000000..61d63272186a871eef96d3d1bd88e967e50a3815 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_NUMBER.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_NUMBER + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_NUMBER

+

BOOST_VMD_ASSERT_IS_NUMBER — Asserts that the sequence is a number.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_number.hpp>
+
+BOOST_VMD_ASSERT_IS_NUMBER(sequence)
+
+

Description

+

The macro checks that the parameter is a number. If it is not a number, it forces a compiler error.

+

The macro normally checks for a number only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

sequence = a possible number.

+

returns = Normally the macro returns nothing. If the sequence is a number, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a number the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + number.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..4e7c37de605424cea1b68272bbb6ef8307d2d057 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_SEQ.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_SEQ

+

BOOST_VMD_ASSERT_IS_SEQ — Asserts that the sequence is a Boost PP seq.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_seq.hpp>
+
+BOOST_VMD_ASSERT_IS_SEQ(sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP seq. If it is not a Boost PP seq, it forces a compiler error.

+

The macro normally checks for a Boost PP seq only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

sequence = a possible Boost PP seq.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP seq, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP seq the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP seq.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_SEQ_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_SEQ_D.html new file mode 100644 index 0000000000000000000000000000000000000000..dff284ce0f3b35c9ce10bc4d9d7e4d4296211d07 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_SEQ_D.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_SEQ_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_SEQ_D

+

BOOST_VMD_ASSERT_IS_SEQ_D — Asserts that the sequence is a Boost PP seq. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_seq.hpp>
+
+BOOST_VMD_ASSERT_IS_SEQ_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP seq. If it is not a Boost PP seq, it forces a compiler error.

+

The macro normally checks for a Boost PP seq only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP seq.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP seq, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP seq the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP seq.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..b5e04b0725541e7b28681f9b61ef3edbdc690ba7 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TUPLE.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_TUPLE

+

BOOST_VMD_ASSERT_IS_TUPLE — Asserts that the sequence is a Boost PP tuple.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_tuple.hpp>
+
+BOOST_VMD_ASSERT_IS_TUPLE(sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP tuple. If it is not a Boost PP tuple, it forces a compiler error.

+

The macro normally checks for a Boost PP tuple only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

sequence = a possible Boost PP tuple.

+

returns = Normally the macro returns nothing. If the sequence is a Boost PP tuple, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP tuple the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TYPE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TYPE.html new file mode 100644 index 0000000000000000000000000000000000000000..dbf84f55f017d000f90b539f43e7c8bb54c1d06f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TYPE.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_TYPE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_TYPE

+

BOOST_VMD_ASSERT_IS_TYPE — Asserts that the sequence is a VMD type.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_type.hpp>
+
+BOOST_VMD_ASSERT_IS_TYPE(sequence)
+
+

Description

+

The macro checks that the sequence is a VMD type. If it is not a VMD type, it forces a compiler error.

+

The macro normally checks for a VMD type only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

sequence = a possible VMD type.

+

returns = Normally the macro returns nothing. If the sequence is a VMD type, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a VMD type the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + VMD type.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TYPE_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TYPE_D.html new file mode 100644 index 0000000000000000000000000000000000000000..b9be3071abeb46cbc3b16adf459aa6266d8333c1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ASSERT_IS_TYPE_D.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_ASSERT_IS_TYPE_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ASSERT_IS_TYPE_D

+

BOOST_VMD_ASSERT_IS_TYPE_D — Asserts that the sequence is a VMD type. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/assert_is_type.hpp>
+
+BOOST_VMD_ASSERT_IS_TYPE_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a VMD type. If it is not a VMD type, it forces a compiler error.

+

The macro normally checks for a VMD type only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible VMD type.

+

returns = Normally the macro returns nothing. If the sequence is a VMD type, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a VMD type the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + VMD type.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ELEM.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ELEM.html new file mode 100644 index 0000000000000000000000000000000000000000..d940a9d8ac3a0968ee340082debcbb1e8afed80b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ELEM.html @@ -0,0 +1,75 @@ + + + +Macro BOOST_VMD_ELEM + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ELEM

+

BOOST_VMD_ELEM — Accesses an element of a sequence.

+
+

Synopsis

+
// In header: <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(elem, ...)
+
+

Description

+

elem = A sequence element number. From 0 to sequence size - 1. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to access. Further variadic parameters are all optional.

+

With no further variadic parameters the macro returns the particular element in the sequence. If the element number is outside the bounds of the sequence macro access fails and the macro turns emptiness.

+

Optional parameters determine what it means that an element is successfully accessed as well as what data is returned by the macro.

+

Filters: specifying a VMD type tells the macro to return the element only if it is of the VMD type specified, else macro access fails. If more than one VMD type is specified as an optional parameter the last one specified is the filter.

+

Matching Identifiers: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, optional parameters which are identifiers specify that the element accessed must match one of the identifiers else access fails. The identifiers may be specified multiple times as single optional parameters or once as a tuple of identifier parameters. If the identifiers are specified as single optional parameters they cannot be any of the specific BOOST_VMD_ optional parameters in order to be recognized as matching identifiers. Normally this should never be the case. The only situation where this could occur is if the VMD types, which are filters, are used as matching identifiers; in this case the matching identifiers need to be passed as a tuple of identifier parameters so they are not treated as filters.

+

Filters and matching identifiers change what it means that an element is successfully accessed. They do not change what data is returned by the macro. The remaining optional parameters do not change what it means that an element is successfully accessed but they do change what data is returned by the macro.

+

Splitting: Splitting allows the macro to return the rest of the sequence after the element accessed.

+

If BOOST_VMD_RETURN_AFTER is specified the return is a tuple with the element accessed as the first tuple parameter and the rest of the sequence as the second tuple parameter. If element access fails both tuple parameters are empty.

+

If BOOST_VMD_RETURN_ONLY_AFTER is specified the return is the rest of the sequence after the element accessed found. If the element access fails the return is emptiness.

+

If BOOST_VMD_RETURN_NO_AFTER, the default, is specified no splitting occurs.

+

If more than one of the splitting identifiers are specified the last one specified determines the splitting.

+

Return Type: The element accessed can be changed to return both the type of the element as well as the element data with optional return type parameters. When a type is returned, the element accessed which is returned becomes a two-element tuple where the type of the element accessed is the first tuple element and the element data itself is the second tuple element. If the macro fails to access the element the element access returned is emptiness and not a tuple.

+

If BOOST_VMD_RETURN_NO_TYPE, the default, is specified no type is returned as part of the element accessed.

+

If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple.

+

If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data.

+

If more than one return type optional parameter is specified the last one specified determines the return type.

+

If a filter is specified optional return type parameters are ignored and the default BOOST_VMD_RETURN_NO_TYPE is in effect.

+

Index: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, and matching identifiers are specified, an index parameter specifies that the numeric index, starting with 0, of the matching identifier found, be returned as part of the result.

+

If BOOST_VMD_RETURN_INDEX is specified an index is returned as part of the result.

+

If BOOST_VMD_RETURN_NO_INDEX, the default, is specified no index is returned as part of the result.

+

If both are specified the last one specified determines the index parameter.

+

When an index is returned as part of the result, the result is a tuple where the element accessed is the first tuple parameter and the index is the last tuple parameter. If element access fails the index is empty. If there is no BOOST_VMD_TYPE_IDENTIFIER filter or if there are no matching identifiers the BOOST_VMD_RETURN_INDEX is ignored and no index is returned as part of the result.

+

returns = With no optional parameters the element accessed is returned, or emptiness if element is outside the bounds of the sequence. Filters and matching identifiers can change the meaning of whether the element accessed is returned or failure occurs, but whenever failure occurs emptiness is returned as the element access part of that failure, else the element accessed is returned. Return type optional parameters, when filters are not used, return the element accessed as a two-element tuple where the first tuple element is the type and the second tuple element is the data; if the element is not accessed then emptiness is returned as the element access and not a tuple. Splitting with BOOST_VMD_RETURN_AFTER returns a tuple where the element accessed is the first tuple element and the rest of the sequence is the second tuple element. Splitting with BOOST_VMD_RETURN_ONLY_AFTER returns the rest of the sequence after the element accessed or emptiness if the element can not be accessed. Indexing returns the index as part of the output only if filtering with BOOST_VMD_TYPE_IDENTIFIER is specified and matching identifiers are specified. When the index is returned with BOOST_VMD_RETURN_AFTER it is the third element of the tuple returned, else it is the second element of a tuple where the element accessed is the first element of the tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ELEM_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ELEM_D.html new file mode 100644 index 0000000000000000000000000000000000000000..ec46eadbf8ce7327a6f841ebe1eab6546c4534fb --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ELEM_D.html @@ -0,0 +1,74 @@ + + + +Macro BOOST_VMD_ELEM_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ELEM_D

+

BOOST_VMD_ELEM_D — Accesses an element of a sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM_D(d, elem, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. elem = A sequence element number. From 0 to sequence size - 1. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to access. Further variadic parameters are all optional.

+

With no further variadic parameters the macro returns the particular element in the sequence. If the element number is outside the bounds of the sequence macro access fails and the macro turns emptiness.

+

Optional parameters determine what it means that an element is successfully accessed as well as what data is returned by the macro.

+

Filters: specifying a VMD type tells the macro to return the element only if it is of the VMD type specified, else macro access fails. If more than one VMD type is specified as an optional parameter the last one specified is the filter.

+

Matching Identifiers: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, optional parameters which are identifiers specify that the element accessed must match one of the identifiers else access fails. The identifiers may be specified multiple times as single optional parameters or once as a tuple of identifier parameters. If the identifiers are specified as single optional parameters they cannot be any of the specific BOOST_VMD_ optional parameters in order to be recognized as matching identifiers. Normally this should never be the case. The only situation where this could occur is if the VMD types, which are filters, are used as matching identifiers; in this case the matching identifiers need to be passed as a tuple of identifier parameters so they are not treated as filters.

+

Filters and matching identifiers change what it means that an element is successfully accessed. They do not change what data is returned by the macro. The remaining optional parameters do not change what it means that an element is successfully accessed but they do change what data is returned by the macro.

+

Splitting: Splitting allows the macro to return the rest of the sequence after the element accessed.

+

If BOOST_VMD_RETURN_AFTER is specified the return is a tuple with the element accessed as the first tuple parameter and the rest of the sequence as the second tuple parameter. If element access fails both tuple parameters are empty.

+

If BOOST_VMD_RETURN_ONLY_AFTER is specified the return is the rest of the sequence after the element accessed found. If the element access fails the return is emptiness.

+

If BOOST_VMD_RETURN_NO_AFTER, the default, is specified no splitting occurs.

+

If more than one of the splitting identifiers are specified the last one specified determines the splitting.

+

Return Type: The element accessed can be changed to return both the type of the element as well as the element data with optional return type parameters. When a type is returned, the element accessed which is returned becomes a two-element tuple where the type of the element accessed is the first tuple element and the element data itself is the second tuple element. If the macro fails to access the element the element access returned is emptiness and not a tuple.

+

If BOOST_VMD_RETURN_NO_TYPE, the default, is specified no type is returned as part of the element accessed.

+

If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple.

+

If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

If a filter is specified optional return type parameters are ignored and the default BOOST_VMD_RETURN_NO_TYPE is in effect.

+

Index: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, and matching identifiers are specified, an index parameter specifies that the numeric index, starting with 0, of the matching identifier found, be returned as part of the result.

+

If BOOST_VMD_RETURN_INDEX is specified an index is returned as part of the result.

+

If BOOST_VMD_RETURN_NO_INDEX, the default, is specified no index is returned as part of the result.

+

If both are specified the last one specified determines the index parameter.

+

When an index is returned as part of the result, the result is a tuple where the element accessed is the first tuple parameter and the index is the last tuple parameter. If element access fails the index is empty. If there is no BOOST_VMD_TYPE_IDENTIFIER filter or if there are no matching identifiers the BOOST_VMD_RETURN_INDEX is ignored and no index is returned as part of the result.

+

returns = With no optional parameters the element accessed is returned, or emptiness if element is outside the bounds of the sequence. Filters and matching identifiers can change the meaning of whether the element accessed is returned or failure occurs, but whenever failure occurs emptiness is returned as the element access part of that failure, else the element accessed is returned. Return type optional parameters, when filters are not used, return the element accessed as a two-element tuple where the first tuple element is the type and the second tuple element is the data; if the element is not accessed then emptiness is returned as the element access and not a tuple. Splitting with BOOST_VMD_RETURN_AFTER returns a tuple where the element accessed is the first tuple element and the rest of the sequence is the second tuple element. Splitting with BOOST_VMD_RETURN_ONLY_AFTER returns the rest of the sequence after the element accessed or emptiness if the element can not be accessed. Indexing returns the index as part of the output only if filtering with BOOST_VMD_TYPE_IDENTIFIER is specified and matching identifiers are specified. When the index is returned with BOOST_VMD_RETURN_AFTER it is the third element of the tuple returned, else it is the second element of a tuple where the element accessed is the first element of the tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EMPTY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EMPTY.html new file mode 100644 index 0000000000000000000000000000000000000000..6f44c5bc8fc10548add1e2f445faa78d64828381 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EMPTY.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_EMPTY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_EMPTY

+

BOOST_VMD_EMPTY — Outputs emptiness.

+
+

Synopsis

+
// In header: <boost/vmd/empty.hpp>
+
+BOOST_VMD_EMPTY(...)
+
+

Description

+

... = any variadic parameters. The parameters are ignored.

+

This macro is used to output emptiness ( nothing ) no matter what is passed to it.

+

If you use this macro to return a result, as in 'result BOOST_VMD_EMPTY' subsequently invoked, you should surround the result with BOOST_VMD_IDENTITY_RESULT to smooth over a VC++ problem.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ENUM.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ENUM.html new file mode 100644 index 0000000000000000000000000000000000000000..bf151ebc24e8c5239227e52132e057d0b2b40eab --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ENUM.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_ENUM + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ENUM

+

BOOST_VMD_ENUM — Converts a sequence to comma-separated elements which are the elements of the sequence.

+
+

Synopsis

+
// In header: <boost/vmd/enum.hpp>
+
+BOOST_VMD_ENUM(...)
+
+

Description

+

... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = Comma-separated data, otherwise known as variadic data. If the sequence is empty the variadic data is empty. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as part of the variadic data. Otherwise just the data of each element is returned, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ENUM_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ENUM_D.html new file mode 100644 index 0000000000000000000000000000000000000000..965f896b0a661524e3f653cc05c5355bd2e49a8b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_ENUM_D.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_ENUM_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_ENUM_D

+

BOOST_VMD_ENUM_D — Converts a sequence to comma-separated elements which are the elements of the sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/enum.hpp>
+
+BOOST_VMD_ENUM_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = Comma-separated data, otherwise known as variadic data. If the sequence is empty the variadic data is empty. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as part of the variadic data. Otherwise just the data of each element is returned, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EQUAL.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EQUAL.html new file mode 100644 index 0000000000000000000000000000000000000000..3a7e2cc463e2852e6bf6a6010c416710f795e703 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EQUAL.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_EQUAL + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_EQUAL

+

BOOST_VMD_EQUAL — Tests any two sequences for equality.

+
+

Synopsis

+
// In header: <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL(sequence, ...)
+
+

Description

+

sequence = First sequence. ... = variadic parameters, maximum of 2.

+

The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.

+

The macro tests any two sequences for equality. For sequences to be equal the VMD types of each sequence must be equal and the individual elements of the sequence must be equal. For Boost PP composite types the macro tests that the composite types have the same size and then tests that each element of the composite type is equal. This means that all elements of a composite type must be a VMD type in order to use this macro successfully.

+

The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to succeed.

+

returns = 1 upon success or 0 upon failure. Success means that both sequences are equal and, if the optional parameter is specified, that the sequences are of the optional VMD type.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EQUAL_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EQUAL_D.html new file mode 100644 index 0000000000000000000000000000000000000000..d8c5a48bec7d00e1f831f78adc06cc2e2516ad43 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_EQUAL_D.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_EQUAL_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_EQUAL_D

+

BOOST_VMD_EQUAL_D — Tests any two sequences for equality. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL_D(d, sequence, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = First sequence. ... = variadic parameters, maximum of 2.

+

The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.

+

The macro tests any two sequences for equality. For sequences to be equal the VMD types of each sequence must be equal and the individual elements of the sequence must be equal. For Boost PP composite types the macro tests that the composite types have the same size and then tests that each element of the composite type is equal. This means that all elements of a composite type must be a VMD type in order to use this macro successfully.

+

The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to succeed.

+

returns = 1 upon success or 0 upon failure. Success means that both sequences are equal and, if the optional parameter is specified, that the sequences are of the optional VMD type.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_GET_TYPE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_GET_TYPE.html new file mode 100644 index 0000000000000000000000000000000000000000..c936d6d6f4fb6b017e6b85c60d844752f3df594d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_GET_TYPE.html @@ -0,0 +1,61 @@ + + + +Macro BOOST_VMD_GET_TYPE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_GET_TYPE

+

BOOST_VMD_GET_TYPE — Returns the type of a sequence as a VMD type.

+
+

Synopsis

+
// In header: <boost/vmd/get_type.hpp>
+
+BOOST_VMD_GET_TYPE(...)
+
+

Description

+

... = variadic parameters.

+

The first variadic parameter is required and is the sequence whose type we are getting.

+

The optional variadic parameters are return type parameters.

+

The macro returns the type of a sequence as a VMD type. The type of an empty sequence is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the type of that single element.

+

The type returned can be modified by specifying an optional return type parameter.

+

If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element is returned.

+

If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro always returns the type of the sequence.

+

If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = the type of the sequence as a VMD type.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_GET_TYPE_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_GET_TYPE_D.html new file mode 100644 index 0000000000000000000000000000000000000000..956d50fa3a8cb37577c1c55da8c216eb780f82d3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_GET_TYPE_D.html @@ -0,0 +1,61 @@ + + + +Macro BOOST_VMD_GET_TYPE_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_GET_TYPE_D

+

BOOST_VMD_GET_TYPE_D — Returns the type of a sequence as a VMD type. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/get_type.hpp>
+
+BOOST_VMD_GET_TYPE_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = variadic parameters.

+

The first variadic parameter is required and is the sequence whose type we are getting.

+

The optional variadic parameters are return type parameters.

+

The macro returns the type of a sequence as a VMD type. The type of an empty sequence is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the type of that single element.

+

The type returned can be modified by specifying an optional return type parameter.

+

If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element is returned.

+

If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data.

+

If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro always returns the type of the sequence.

+

If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = the type of the sequence as a VMD type.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IDENTITY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IDENTITY.html new file mode 100644 index 0000000000000000000000000000000000000000..6407f85740a1b652638f54a5eedcefe6ed7fd09a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IDENTITY.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_IDENTITY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IDENTITY

+

BOOST_VMD_IDENTITY — Macro which expands to its argument when invoked with any number of parameters.

+
+

Synopsis

+
// In header: <boost/vmd/identity.hpp>
+
+BOOST_VMD_IDENTITY(item)
+
+

Description

+

item = any single argument

+

When BOOST_VMD_IDENTITY(item) is subsequently invoked with any number of parameters it expands to 'item'. Subsequently invoking the macro is done as 'BOOST_VMD_IDENTITY(item)(zero_or_more_arguments)'.

+

The macro is equivalent to the Boost PP macro BOOST_PP_IDENTITY(item) with the difference being that BOOST_PP_IDENTITY(item) is always invoked with no arguments, as in 'BOOST_VMD_IDENTITY(item)()' whereas BOOST_VMD_IDENTITY can be invoked with any number of arguments.

+

The macro is meant to be used in BOOST_PP_IF and BOOST_PP_IIF statements when only one of the clauses needs to be invoked with calling another macro and the other is meant to return an 'item'.

+

returns = the macro as 'BOOST_VMD_IDENTITY(item)', when invoked with any number of parameters as in '(zero_or_more_arguments)', returns 'item'. The macro itself returns 'item BOOST_VMD_EMPTY'.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IDENTITY_RESULT.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IDENTITY_RESULT.html new file mode 100644 index 0000000000000000000000000000000000000000..27479b9f56050218c0116a409f21e18a122146e6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IDENTITY_RESULT.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IDENTITY_RESULT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IDENTITY_RESULT

+

BOOST_VMD_IDENTITY_RESULT — Macro which wraps any result which can return its value using BOOST_VMD_IDENTITY or 'item BOOST_VMD_EMPTY'.

+
+

Synopsis

+
// In header: <boost/vmd/identity.hpp>
+
+BOOST_VMD_IDENTITY_RESULT(result)
+
+

Description

+

result = any single result returned when BOOST_VMD_IDENTITY is used or 'item BOOST_VMD_EMPTY'.

+

The reason for this macro is to smooth over a problem when using VC++ with BOOST_VMD_IDENTITY. If your BOOST_VMD_IDENTITY macro can be used where VC++ is the compiler then you need to surround your macro code which could return a result with this macro in order that VC++ handles BOOST_VMD_IDENTITY correctly.

+

If you are not using VC++ you do not have to use this macro, but doing so does no harm.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_ARRAY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_ARRAY.html new file mode 100644 index 0000000000000000000000000000000000000000..dd0fbbeb4ea79ed1f621286fecad071a089b932c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_ARRAY.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_ARRAY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_ARRAY

+

BOOST_VMD_IS_ARRAY — Determines if a sequence is a Boost PP array.

+
+

Synopsis

+
// In header: <boost/vmd/is_array.hpp>
+
+BOOST_VMD_IS_ARRAY(sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP array. It returns 1 if it is an array, else if returns 0.

+

sequence = a possible Boost PP array.

+

returns = 1 if it is an array, else returns 0.

+

The macro will generate a preprocessing error if the input is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&2,(0,1))' which is a valid tuple but an invalid array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_ARRAY_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_ARRAY_D.html new file mode 100644 index 0000000000000000000000000000000000000000..d6c373d09718cff1a6e85b941375feb6f0b062cf --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_ARRAY_D.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_ARRAY_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_ARRAY_D

+

BOOST_VMD_IS_ARRAY_D — Determines if a sequence is a Boost PP array. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_array.hpp>
+
+BOOST_VMD_IS_ARRAY_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP array. It returns 1 if it is an array, else if returns 0.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP array.

+

returns = 1 if it is an array, else returns 0.

+

The macro will generate a preprocessing error if the input is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&2,(0,1))' which is a valid tuple but an invalid array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY.html new file mode 100644 index 0000000000000000000000000000000000000000..d0834a1e9b489fe629117db88e3eb5011b19e2dd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY.html @@ -0,0 +1,56 @@ + + + +Macro BOOST_VMD_IS_EMPTY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_EMPTY

+

BOOST_VMD_IS_EMPTY — Tests whether its input is empty or not.

+
+

Synopsis

+
// In header: <boost/vmd/is_empty.hpp>
+
+BOOST_VMD_IS_EMPTY(...)
+
+

Description

+

The macro checks to see if the input is empty or not. It returns 1 if the input is empty, else returns 0.

+

The macro is a variadic macro taking any input. For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check.

+

The macro is not perfect, and can not be so. The problem area is if the input to be checked is a function-like macro name, in which case either a compiler error can result or a false result can occur.

+

This macro is a replacement, using variadic macro support, for the undocumented macro BOOST_PP_IS_EMPTY in the Boost PP library. The code is taken from a posting by Paul Mensonides of a variadic version for BOOST_PP_IS_EMPTY, and changed in order to also support VC++.

+

.... = variadic input, for VC++8 this must be a single parameter

+

returns = 1 if the input is empty, 0 if it is not

+

It is recommended to append BOOST_PP_EMPTY() to whatever input is being tested in order to avoid possible warning messages from some compilers about no parameters being passed to the macro when the input is truly empty.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_ARRAY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_ARRAY.html new file mode 100644 index 0000000000000000000000000000000000000000..b614c5afd13be57987499918bcb5381072dfbab6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_ARRAY.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_EMPTY_ARRAY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_EMPTY_ARRAY

+

BOOST_VMD_IS_EMPTY_ARRAY — Tests whether a sequence is an empty Boost PP array.

+
+

Synopsis

+
// In header: <boost/vmd/is_empty_array.hpp>
+
+BOOST_VMD_IS_EMPTY_ARRAY(sequence)
+
+

Description

+

An empty Boost PP array is a two element tuple where the first size element is 0 and the second element is a tuple with a single empty element, ie. '(0,())'.

+

sequence = a possible empty array

+

returns = 1 if the sequence is an empty Boost PP array 0 if it is not.

+

The macro will generate a preprocessing error if the sequence is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&0,())' which is a valid tuple but an invalid array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_ARRAY_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_ARRAY_D.html new file mode 100644 index 0000000000000000000000000000000000000000..03e164729b3e37793af8eabe1d5eca5a585e1781 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_ARRAY_D.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_EMPTY_ARRAY_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_EMPTY_ARRAY_D

+

BOOST_VMD_IS_EMPTY_ARRAY_D — Tests whether a sequence is an empty Boost PP array. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_empty_array.hpp>
+
+BOOST_VMD_IS_EMPTY_ARRAY_D(d, sequence)
+
+

Description

+

An empty Boost PP array is a two element tuple where the first size element is 0 and the second element is a tuple with a single empty element, ie. '(0,())'.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible empty array

+

returns = 1 if the sequence is an empty Boost PP array 0 if it is not.

+

The macro will generate a preprocessing error if the sequence is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&0,())' which is a valid tuple but an invalid array.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_LIST.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_LIST.html new file mode 100644 index 0000000000000000000000000000000000000000..fee024bcd4a70142236c3f9bf616ee12b2d476ef --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_LIST.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_EMPTY_LIST + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_EMPTY_LIST

+

BOOST_VMD_IS_EMPTY_LIST — Tests whether a sequence is an empty Boost PP list.

+
+

Synopsis

+
// In header: <boost/vmd/is_empty_list.hpp>
+
+BOOST_VMD_IS_EMPTY_LIST(sequence)
+
+

Description

+

An empty Boost PP list consists of the single identifier 'BOOST_PP_NIL'. This identifier also serves as a list terminator for a non-empty list.

+

sequence = a preprocessor parameter

+

returns = 1 if the sequence is an empty Boost PP list 0 if it is not.

+

The macro will generate a preprocessing error if the input as an empty list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '&BOOST_PP_NIL'.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_LIST_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_LIST_D.html new file mode 100644 index 0000000000000000000000000000000000000000..cb95cec773eca9c3001084c673f65ab9158c88ff --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_EMPTY_LIST_D.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_EMPTY_LIST_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_EMPTY_LIST_D

+

BOOST_VMD_IS_EMPTY_LIST_D — Tests whether a sequence is an empty Boost PP list. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_empty_list.hpp>
+
+BOOST_VMD_IS_EMPTY_LIST_D(d, sequence)
+
+

Description

+

An empty Boost PP list consists of the single identifier 'BOOST_PP_NIL'. This identifier also serves as a list terminator for a non-empty list.

+

d = The next available BOOST_PP_WHILE iteration sequence = a preprocessor parameter

+

returns = 1 if the sequence is an empty Boost PP list 0 if it is not.

+

The macro will generate a preprocessing error if the input as an empty list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '&BOOST_PP_NIL'.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_IDENTIFIER.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_IDENTIFIER.html new file mode 100644 index 0000000000000000000000000000000000000000..4195215191827be268bddaa0c5ae97b83e408b70 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_IDENTIFIER.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_IS_IDENTIFIER + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_IDENTIFIER

+

BOOST_VMD_IS_IDENTIFIER — Tests whether a parameter is an identifier.

+
+

Synopsis

+
// In header: <boost/vmd/is_identifier.hpp>
+
+BOOST_VMD_IS_IDENTIFIER(...)
+
+

Description

+

... = variadic parameters

+

The first variadic parameter is required and it is the input to test.

+

Further variadic parameters are optional and are identifiers to match. The data may take one of two forms; it is either one or more single identifiers or a single Boost PP tuple of identifiers.

+

returns = 1 if the parameter is an identifier, otherwise 0. If the parameter is not an identifier, + or if optional identifiers are specified and the identifier + does not match any of the optional identifiers, the macro returns 0. +

+

Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +

+

The identifier must be registered to be found.

+

Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +

+

If you specify optional identifiers and have not specified the detection of an optional identifier, that optional identifier will never match the input.

+

If the input is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the input is an identifier once it is determined that the input does not start with parenthesis. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_IDENTIFIER_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_IDENTIFIER_D.html new file mode 100644 index 0000000000000000000000000000000000000000..c34f86357acdb6f091d600c78ef09c2183148734 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_IDENTIFIER_D.html @@ -0,0 +1,63 @@ + + + +Macro BOOST_VMD_IS_IDENTIFIER_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_IDENTIFIER_D

+

BOOST_VMD_IS_IDENTIFIER_D — Tests whether a parameter is an identifier. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_identifier.hpp>
+
+BOOST_VMD_IS_IDENTIFIER_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = variadic parameters

+

The first variadic parameter is required and it is the input to test.

+

Further variadic parameters are optional and are identifiers to match. The data may take one of two forms; it is either one or more single identifiers or a single Boost PP tuple of identifiers.

+

returns = 1 if the parameter is an identifier, otherwise 0. If the parameter is not an identifier, + or if optional identifiers are specified and the identifier + does not match any of the optional identifiers, the macro returns 0. +

+

Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +

+

The identifier must be registered to be found.

+

Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +

+

If you specify optional identifiers and have not specified the detection of an optional identifier, that optional identifier will never match the input.

+

If the input is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the input is an identifier once it is determined that the input does not start with parenthesis. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_LIST.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_LIST.html new file mode 100644 index 0000000000000000000000000000000000000000..9abf13e3d8370b1eff87597db8dc553bf7969592 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_LIST.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_LIST + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_LIST

+

BOOST_VMD_IS_LIST — Determines if a sequence is a Boost pplib list.

+
+

Synopsis

+
// In header: <boost/vmd/is_list.hpp>
+
+BOOST_VMD_IS_LIST(sequence)
+
+

Description

+

The macro checks that the sequence is a pplib list. It returns 1 if it is a list, else if returns 0.

+

sequence = input as a possible Boost PP list.

+

returns = 1 if it a list, else returns 0.

+

The macro will generate a preprocessing error if the input is in the form of a list but its end-of-list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but an invalid list.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_LIST_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_LIST_D.html new file mode 100644 index 0000000000000000000000000000000000000000..ee5c21397f7ed27e1e7bf71a42c33b52df481dba --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_LIST_D.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_LIST_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_LIST_D

+

BOOST_VMD_IS_LIST_D — Determines if a sequence is a Boost pplib list. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_list.hpp>
+
+BOOST_VMD_IS_LIST_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a pplib list. It returns 1 if it is a list, else if returns 0.

+

d = The next available BOOST_PP_WHILE iteration. sequence = input as a possible Boost PP list.

+

returns = 1 if it a list, else returns 0.

+

The macro will generate a preprocessing error if the input is in the form of a list but its end-of-list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but an invalid list.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_MULTI.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_MULTI.html new file mode 100644 index 0000000000000000000000000000000000000000..66040a03e7f74d3c86a5eabd26bf76ad3a836dc1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_MULTI.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_MULTI + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_MULTI

+

BOOST_VMD_IS_MULTI — Determines if the sequence has more than one element, referred to as a multi-element sequence.

+
+

Synopsis

+
// In header: <boost/vmd/is_multi.hpp>
+
+BOOST_VMD_IS_MULTI(sequence)
+
+

Description

+

sequence = a sequence

+

returns = 1 if the sequence is a multi-element sequence, else returns 0.

+

If the size of a sequence is known it is faster comparing that size to be greater than one to find out if the sequence is multi-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is multi-element or not.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_MULTI_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_MULTI_D.html new file mode 100644 index 0000000000000000000000000000000000000000..de19345af0a2154f9145a6ac5d6090f949147b45 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_MULTI_D.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_MULTI_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_MULTI_D

+

BOOST_VMD_IS_MULTI_D — Determines if the sequence has more than one element, referred to as a multi-element sequence.

+
+

Synopsis

+
// In header: <boost/vmd/is_multi.hpp>
+
+BOOST_VMD_IS_MULTI_D(d, sequence)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = a sequence

+

returns = 1 if the sequence is a multi-element sequence, else returns 0.

+

If the size of a sequence is known it is faster comparing that size to be greater than one to find out if the sequence is multi-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is multi-element or not.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_NUMBER.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_NUMBER.html new file mode 100644 index 0000000000000000000000000000000000000000..916598ca258fdfd53e12f10bcf07cab216f55239 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_NUMBER.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_NUMBER + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_NUMBER

+

BOOST_VMD_IS_NUMBER — Tests whether a sequence is a Boost PP number.

+
+

Synopsis

+
// In header: <boost/vmd/is_number.hpp>
+
+BOOST_VMD_IS_NUMBER(sequence)
+
+

Description

+

The macro checks to see if a sequence is a Boost PP number. A Boost PP number is a value from 0 to 256.

+

sequence = a possible number

+

returns = 1 if the sequence is a Boost PP number, 0 if it is not.

+

If the input is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the input is a number once it is determined that the input does not start with parenthesis. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_PARENS_EMPTY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_PARENS_EMPTY.html new file mode 100644 index 0000000000000000000000000000000000000000..632818906577a90ec0fc8029de9d48ac9ab8699a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_PARENS_EMPTY.html @@ -0,0 +1,55 @@ + + + +Macro BOOST_VMD_IS_PARENS_EMPTY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_PARENS_EMPTY

+

BOOST_VMD_IS_PARENS_EMPTY — Determines if the sequence is a set of parens with no data.

+
+

Synopsis

+
// In header: <boost/vmd/is_parens_empty.hpp>
+
+BOOST_VMD_IS_PARENS_EMPTY(sequence)
+
+

Description

+

sequence = a VMD sequence

+

returns = 1 if the sequence is a set of parens with no data, else returns 0.

+

A set of parens with no data may be:

+

1) a tuple whose size is a single element which is empty or +

+

2) a single element seq whose data is empty

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_PARENS_EMPTY_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_PARENS_EMPTY_D.html new file mode 100644 index 0000000000000000000000000000000000000000..12ec4428435d058419e146bb96dac451cdfcf296 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_PARENS_EMPTY_D.html @@ -0,0 +1,55 @@ + + + +Macro BOOST_VMD_IS_PARENS_EMPTY_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_PARENS_EMPTY_D

+

BOOST_VMD_IS_PARENS_EMPTY_D — Determines if the sequence is a set of parens with no data. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_parens_empty.hpp>
+
+BOOST_VMD_IS_PARENS_EMPTY_D(d, sequence)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = a VMD sequence

+

returns = 1 if the sequence is a set of parens with no data, else returns 0.

+

A set of parens with no data may be:

+

1) a tuple whose size is a single element which is empty or +

+

2) a single element seq whose data is empty

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..66c1a9a05a27a1762f3506ab13e320018e883610 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_SEQ.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_SEQ

+

BOOST_VMD_IS_SEQ — Determines if a sequence is a Boost PP seq.

+
+

Synopsis

+
// In header: <boost/vmd/is_seq.hpp>
+
+BOOST_VMD_IS_SEQ(sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP seq. It returns 1 if it is a seq, else if returns 0.

+

sequence = a possible Boost PP seq

+

returns = 1 if it a seq, else returns 0.

+

A single set of parentheses, with a single element, is parsed as a tuple and not a seq. To be parsed as a seq the input needs to be more than one consecutive sets of parentheses, each with a single element of data.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_SEQ_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_SEQ_D.html new file mode 100644 index 0000000000000000000000000000000000000000..30ddfa952e680ae17b0ae62b22431e912defcea3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_SEQ_D.html @@ -0,0 +1,53 @@ + + + +Macro BOOST_VMD_IS_SEQ_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_SEQ_D

+

BOOST_VMD_IS_SEQ_D — Determines if a sequence is a Boost PP seq. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_seq.hpp>
+
+BOOST_VMD_IS_SEQ_D(d, sequence)
+
+

Description

+

The macro checks that the sequence is a Boost PP seq. It returns 1 if it is a seq, else if returns 0.

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP seq

+

returns = 1 if it a seq, else returns 0.

+

A single set of parentheses, with a single element, is parsed as a tuple and not a seq. To be parsed as a seq the input needs to be more than one consecutive sets of parentheses, each with a single element of data.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..c41d12b26d76427eeb674e71270d9e1b510f0ff6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TUPLE.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_TUPLE

+

BOOST_VMD_IS_TUPLE — Tests whether a sequence is a Boost PP tuple.

+
+

Synopsis

+
// In header: <boost/vmd/is_tuple.hpp>
+
+BOOST_VMD_IS_TUPLE(sequence)
+
+

Description

+

The macro checks to see if a sequence is a Boost PP tuple. A Boost PP tuple is preprocessor tokens enclosed by a set of parentheses with no preprocessing tokens before or after the parentheses.

+

sequence = a possible tuple

+

returns = 1 if the sequence is a Boost PP tuple. 0 if it is not.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TYPE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TYPE.html new file mode 100644 index 0000000000000000000000000000000000000000..432e1a7909ef56f972a95fea1e803c50a2ba5967 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TYPE.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_TYPE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_TYPE

+

BOOST_VMD_IS_TYPE — Tests whether a sequence is a VMD type.

+
+

Synopsis

+
// In header: <boost/vmd/is_type.hpp>
+
+BOOST_VMD_IS_TYPE(sequence)
+
+

Description

+

sequence = a possible VMD type

+

returns = 1 if the sequence is a VMD type, 0 if it is not.

+

If the sequence is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the sequence is an identifier once it is determined that the sequence does not start with parentheses. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TYPE_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TYPE_D.html new file mode 100644 index 0000000000000000000000000000000000000000..9d211878069c72fc7939fe1e186b3e83dfbfd97c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_TYPE_D.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_TYPE_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_TYPE_D

+

BOOST_VMD_IS_TYPE_D — Tests whether a sequence is a VMD type. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_type.hpp>
+
+BOOST_VMD_IS_TYPE_D(d, sequence)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = a possible VMD type

+

returns = 1 if the sequence is a VMD type, 0 if it is not.

+

If the sequence is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the sequence is an identifier once it is determined that the sequence does not start with parentheses. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_UNARY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_UNARY.html new file mode 100644 index 0000000000000000000000000000000000000000..7f1f26910fbcab3937162a23e138cf51b5c225c9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_UNARY.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_UNARY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_UNARY

+

BOOST_VMD_IS_UNARY — Determines if the sequence has only a single element, referred to as a single-element sequence.

+
+

Synopsis

+
// In header: <boost/vmd/is_unary.hpp>
+
+BOOST_VMD_IS_UNARY(sequence)
+
+

Description

+

sequence = a VMD sequence

+

returns = 1 if the sequence is a single-element sequence, else returns 0.

+

If the size of a sequence is known it is faster comparing that size to be equal to one to find out if the sequence is single-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is single-element or not.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_UNARY_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_UNARY_D.html new file mode 100644 index 0000000000000000000000000000000000000000..bbb36955060568ee7d68c570154ee54860bf17a8 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_UNARY_D.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_UNARY_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_UNARY_D

+

BOOST_VMD_IS_UNARY_D — Determines if the sequence has only a single element, referred to as a single-element sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/is_unary.hpp>
+
+BOOST_VMD_IS_UNARY_D(d, sequence)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = a sequence

+

returns = 1 if the sequence is a single-element sequence, else returns 0.

+

If the size of a sequence is known it is faster comparing that size to be equal to one to find out if the sequence is single-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is single-element or not.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_VMD_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_VMD_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..575f8d1368c41f00e147ca8956331f664b4f3c25 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_VMD_SEQ.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_VMD_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_VMD_SEQ

+

BOOST_VMD_IS_VMD_SEQ — Determines if a sequence is a VMD seq.

+
+

Synopsis

+
// In header: <boost/vmd/seq/is_vmd_seq.hpp>
+
+BOOST_VMD_IS_VMD_SEQ(sequence)
+
+

Description

+

The macro checks that the sequence is a VMD seq. A VMD seq, which may be a Boost PP seq or emptiness, is a superset of a Boost PP seq. It returns 1 if it is a VMD seq, else if returns 0.

+

sequence = a possible Boost PP seq

+

returns = 1 if it a VMD seq, else returns 0.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_VMD_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_VMD_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..5c5c94b2b7cbbb8889ff0a99e57e96600b92986e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_IS_VMD_TUPLE.html @@ -0,0 +1,52 @@ + + + +Macro BOOST_VMD_IS_VMD_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_IS_VMD_TUPLE

+

BOOST_VMD_IS_VMD_TUPLE — Determines if a sequence is a VMD tuple.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/is_vmd_tuple.hpp>
+
+BOOST_VMD_IS_VMD_TUPLE(sequence)
+
+

Description

+

The macro checks that the sequence is a VMD tuple. A VMD tuple, which may be a Boost PP tuple or emptiness, is a superset of a Boost PP tuple. It returns 1 if it is a VMD tuple, else if returns 0.

+

sequence = a possible Boost PP tuple

+

returns = 1 if it a VMD tuple, else returns 0.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_LIST_TO_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_LIST_TO_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..38228c1d9bd4af9c6e2dbeb7616e88b216b121d5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_LIST_TO_SEQ.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_LIST_TO_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_LIST_TO_SEQ

+

BOOST_VMD_LIST_TO_SEQ — converts a list to a seq.

+
+

Synopsis

+
// In header: <boost/vmd/list/to_seq.hpp>
+
+BOOST_VMD_LIST_TO_SEQ(list)
+
+

Description

+

list = list to be converted.

+

If the list is an empty list (BOOST_PP_NIL) it is converted to an empty seq. Otherwise the list is converted to a seq with the same number of elements as the list.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_LIST_TO_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_LIST_TO_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..54d2c49801abec59aef408f317a10fd8fe8d38f1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_LIST_TO_TUPLE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_LIST_TO_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_LIST_TO_TUPLE

+

BOOST_VMD_LIST_TO_TUPLE — converts a list to a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/list/to_tuple.hpp>
+
+BOOST_VMD_LIST_TO_TUPLE(list)
+
+

Description

+

list = list to be converted.

+

If the list is an empty list (BOOST_PP_NIL) it is converted to an empty tuple. Otherwise the list is converted to a tuple with the same number of elements as the list.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_NOT_EQUAL.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_NOT_EQUAL.html new file mode 100644 index 0000000000000000000000000000000000000000..5b560a30b1d45fd1ce70d3d3c046c0ab671b86bd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_NOT_EQUAL.html @@ -0,0 +1,55 @@ + + + +Macro BOOST_VMD_NOT_EQUAL + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_NOT_EQUAL

+

BOOST_VMD_NOT_EQUAL — Tests any two sequences for inequality.

+
+

Synopsis

+
// In header: <boost/vmd/not_equal.hpp>
+
+BOOST_VMD_NOT_EQUAL(sequence, ...)
+
+

Description

+

sequence = First sequence. ... = variadic parameters, maximum of 2.

+

The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.

+

The macro tests any two sequences for inequality. For sequences to be unequal either the VMD types of each sequence must be unequal or the individual elements of the sequence must be unequal.

+

The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to fail, else it succeeds.

+

returns = 1 upon success or 0 upon failure. Success means that the sequences are unequal or, if the optional parameter is specified, that the sequences are not of the optional VMD type; otherwise 0 is returned if the sequences are equal.

+

The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL would return 0 the macro would return 1.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_NOT_EQUAL_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_NOT_EQUAL_D.html new file mode 100644 index 0000000000000000000000000000000000000000..f3a8f163c46ea964f8397251f8e3113525d11284 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_NOT_EQUAL_D.html @@ -0,0 +1,55 @@ + + + +Macro BOOST_VMD_NOT_EQUAL_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_NOT_EQUAL_D

+

BOOST_VMD_NOT_EQUAL_D — Tests any two sequences for inequality. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/not_equal.hpp>
+
+BOOST_VMD_NOT_EQUAL_D(d, sequence, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = First sequence. ... = variadic parameters, maximum of 2.

+

The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.

+

The macro tests any two sequences for inequality. For sequences to be unequal either the VMD types of each sequence must be unequal or the individual elements of the sequence must be unequal.

+

The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to fail, else it succeeds.

+

returns = 1 upon success or 0 upon failure. Success means that the sequences are unequal or, if the optional parameter is specified, that the sequences are not of the optional VMD type; otherwise 0 is returned if the sequences are equal.

+

The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL would return 0 the macro would return 1.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_POP_BACK.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_POP_BACK.html new file mode 100644 index 0000000000000000000000000000000000000000..e3f5e39433cad7f67e0768c059c20a9b41b06dc3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_POP_BACK.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_POP_BACK + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_POP_BACK

+

BOOST_VMD_SEQ_POP_BACK — pops an element from the end of a seq.

+
+

Synopsis

+
// In header: <boost/vmd/seq/pop_back.hpp>
+
+BOOST_VMD_SEQ_POP_BACK(seq)
+
+

Description

+

seq = seq to pop an element from.

+

If the seq is an empty seq the result is undefined. If the seq is a single element the result is an empty seq. Otherwise the result is a seq after removing the last element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_POP_FRONT.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_POP_FRONT.html new file mode 100644 index 0000000000000000000000000000000000000000..12e49b6ba19168e2faf32c7b58b3bd4d9ad279f5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_POP_FRONT.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_POP_FRONT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_POP_FRONT

+

BOOST_VMD_SEQ_POP_FRONT — pops an element from the front of a seq.

+
+

Synopsis

+
// In header: <boost/vmd/seq/pop_front.hpp>
+
+BOOST_VMD_SEQ_POP_FRONT(seq)
+
+

Description

+

seq = seq to pop an element from.

+

If the seq is an empty seq the result is undefined. If the seq is a single element the result is an empty seq. Otherwise the result is a seq after removing the first element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_PUSH_BACK.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_PUSH_BACK.html new file mode 100644 index 0000000000000000000000000000000000000000..00aad1b71e917dd549fd254dae14a9f71501abfb --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_PUSH_BACK.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_PUSH_BACK + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_PUSH_BACK

+

BOOST_VMD_SEQ_PUSH_BACK — appends an element to the end of a seq.

+
+

Synopsis

+
// In header: <boost/vmd/seq/push_back.hpp>
+
+BOOST_VMD_SEQ_PUSH_BACK(seq, elem)
+
+

Description

+

seq = seq to to append an element to. elem = element to append.

+

If the seq is an empty seq the result is a seq with the single element. Otherwise the result is a seq after adding the element to the end.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_PUSH_FRONT.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_PUSH_FRONT.html new file mode 100644 index 0000000000000000000000000000000000000000..0876d0ff2b2f7459868e8ed110e1da8a45750f32 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_PUSH_FRONT.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_PUSH_FRONT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_PUSH_FRONT

+

BOOST_VMD_SEQ_PUSH_FRONT — inserts an element at the beginning of a seq.

+
+

Synopsis

+
// In header: <boost/vmd/seq/push_front.hpp>
+
+BOOST_VMD_SEQ_PUSH_FRONT(seq, elem)
+
+

Description

+

seq = seq to insert an element at. elem = element to insert.

+

If the seq is an empty seq the result is a seq with the single element. Otherwise the result is a seq after inserting the element at the beginning.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_REMOVE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_REMOVE.html new file mode 100644 index 0000000000000000000000000000000000000000..256cfce0bd367d127d4ed6b565ea2927a55ec4ca --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_REMOVE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_REMOVE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_REMOVE

+

BOOST_VMD_SEQ_REMOVE — removes an element from a seq.

+
+

Synopsis

+
// In header: <boost/vmd/seq/remove.hpp>
+
+BOOST_VMD_SEQ_REMOVE(seq, index)
+
+

Description

+

seq = seq from which an element is to be removed. index = The zero-based position in seq of the element to be removed.

+

If index is greater or equal to the seq size the result is undefined. If the seq is a single element and the index is 0 the result is an empty seq. Otherwise the result is a seq after removing the index element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_SIZE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_SIZE.html new file mode 100644 index 0000000000000000000000000000000000000000..585b703db24b7d540585ebcc70b893245d0718f0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_SIZE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_SIZE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_SIZE

+

BOOST_VMD_SEQ_SIZE — expands to the size of the seq passed to it.

+
+

Synopsis

+
// In header: <boost/vmd/seq/size.hpp>
+
+BOOST_VMD_SEQ_SIZE(seq)
+
+

Description

+

seq = seq whose size is to be extracted.

+

If the seq is an empty seq its size is 0. Otherwise the result is the number of elements in the seq.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_ARRAY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_ARRAY.html new file mode 100644 index 0000000000000000000000000000000000000000..d07efaf85db3cb7adcc157ec31bf5ff14186f9a3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_ARRAY.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_TO_ARRAY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_TO_ARRAY

+

BOOST_VMD_SEQ_TO_ARRAY — converts a seq to an array.

+
+

Synopsis

+
// In header: <boost/vmd/seq/to_array.hpp>
+
+BOOST_VMD_SEQ_TO_ARRAY(seq)
+
+

Description

+

seq = seq to be converted.

+

If the seq is an empty seq it is converted to an array with 0 elements. Otherwise the seq is converted to an array with the same number of elements as the seq.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_LIST.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_LIST.html new file mode 100644 index 0000000000000000000000000000000000000000..c6374f30174f3ec73c70a1c3bc8a28da9f7a2f40 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_LIST.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_TO_LIST + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_TO_LIST

+

BOOST_VMD_SEQ_TO_LIST — converts a seq to a list.

+
+

Synopsis

+
// In header: <boost/vmd/seq/to_list.hpp>
+
+BOOST_VMD_SEQ_TO_LIST(seq)
+
+

Description

+

seq = seq to be converted.

+

If the seq is an empty seq it is converted to an empty list (BOOST_PP_NIL). Otherwise the seq is converted to a list with the same number of elements as the seq.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..6a02c3eeafe13cec30179b8bdc779845f10e0b13 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SEQ_TO_TUPLE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SEQ_TO_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SEQ_TO_TUPLE

+

BOOST_VMD_SEQ_TO_TUPLE — converts a seq to a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/seq/to_tuple.hpp>
+
+BOOST_VMD_SEQ_TO_TUPLE(seq)
+
+

Description

+

seq = seq to be converted.

+

If the seq is an empty seq it is converted to an empty tuple. Otherwise the seq is converted to a tuple with the same number of elements as the seq.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SIZE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SIZE.html new file mode 100644 index 0000000000000000000000000000000000000000..6dd5a4690a2d927cfca46003a9e0f76272b0f898 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SIZE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SIZE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SIZE

+

BOOST_VMD_SIZE — Returns the size of a sequence.

+
+

Synopsis

+
// In header: <boost/vmd/size.hpp>
+
+BOOST_VMD_SIZE(sequence)
+
+

Description

+

sequence = A sequence to test.

+

returns = If the sequence is empty returns 0, else returns the number of elements in the sequence.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SIZE_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SIZE_D.html new file mode 100644 index 0000000000000000000000000000000000000000..74d9ba9729944d6dfed414a186137843112c78ab --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_SIZE_D.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_SIZE_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_SIZE_D

+

BOOST_VMD_SIZE_D — Returns the size of a sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/size.hpp>
+
+BOOST_VMD_SIZE_D(d, sequence)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. sequence = A sequence to test.

+

returns = If the sequence is empty returns 0, else returns the number of elements in the sequence.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_ARRAY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_ARRAY.html new file mode 100644 index 0000000000000000000000000000000000000000..7728a41210401ce242f43c1dd08f82fe520b6219 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_ARRAY.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_ARRAY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_ARRAY

+

BOOST_VMD_TO_ARRAY — Converts a sequence to a Boost PP array whose elements are the elements of the sequence.

+
+

Synopsis

+
// In header: <boost/vmd/to_array.hpp>
+
+BOOST_VMD_TO_ARRAY(...)
+
+

Description

+

... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP array. The sequence is empty the Boost PP array is an empty array. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the array element. Otherwise just the data is returned as the array element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_ARRAY_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_ARRAY_D.html new file mode 100644 index 0000000000000000000000000000000000000000..77b11d115c1268b7df26037d365dc2607dff6297 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_ARRAY_D.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_ARRAY_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_ARRAY_D

+

BOOST_VMD_TO_ARRAY_D — Converts a sequence to a Boost PP array whose elements are the elements of the sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/to_array.hpp>
+
+BOOST_VMD_TO_ARRAY_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP array. The sequence is empty the Boost PP array is empty. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the array element. Otherwise just the data is returned as the array element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_LIST.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_LIST.html new file mode 100644 index 0000000000000000000000000000000000000000..03f0bf529e6c723781d401166b5282a1f1215174 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_LIST.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_LIST + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_LIST

+

BOOST_VMD_TO_LIST — Converts a sequence to a Boost PP list whose elements are the elements of the sequence.

+
+

Synopsis

+
// In header: <boost/vmd/to_list.hpp>
+
+BOOST_VMD_TO_LIST(...)
+
+

Description

+

... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP list. The sequence is empty the Boost PP list is an empty list. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the list element. Otherwise just the data is returned as the list element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_LIST_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_LIST_D.html new file mode 100644 index 0000000000000000000000000000000000000000..c0ec05b9973b54cb67fb30ca7e13911bab2037b1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_LIST_D.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_LIST_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_LIST_D

+

BOOST_VMD_TO_LIST_D — Converts a sequence to a Boost PP list whose elements are the elements of the sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/to_list.hpp>
+
+BOOST_VMD_TO_LIST_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP list. The sequence is empty the Boost PP list is an empty list. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the list element. Otherwise just the data is returned as the list element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..be53ad4be6d8a0a27fd3cdfa4b7abf3694c5574e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_SEQ.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_SEQ

+

BOOST_VMD_TO_SEQ — Converts a sequence to a Boost PP seq whose elements are the elements of the sequence.

+
+

Synopsis

+
// In header: <boost/vmd/to_seq.hpp>
+
+BOOST_VMD_TO_SEQ(...)
+
+

Description

+

... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP seq. If the sequence is empty the return is emptiness since an empty seq does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the seq element. Otherwise just the data is returned as the seq element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_SEQ_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_SEQ_D.html new file mode 100644 index 0000000000000000000000000000000000000000..453b7cf2cb759d718900870430cc8539dd05baef --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_SEQ_D.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_SEQ_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_SEQ_D

+

BOOST_VMD_TO_SEQ_D — Converts a sequence to a Boost PP seq whose elements are the elements of the sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/to_seq.hpp>
+
+BOOST_VMD_TO_SEQ_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP seq. If the sequence is empty the return is emptiness since an empty seq does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the seq element. Otherwise just the data is returned as the seq element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_TUPLE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_TUPLE.html new file mode 100644 index 0000000000000000000000000000000000000000..53825a6c7b72f3a63138948b394ac0349b5fbded --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_TUPLE.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_TUPLE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_TUPLE

+

BOOST_VMD_TO_TUPLE — Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence.

+
+

Synopsis

+
// In header: <boost/vmd/to_tuple.hpp>
+
+BOOST_VMD_TO_TUPLE(...)
+
+

Description

+

... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP tuple. If the sequence is empty the return is emptiness since an empty tuple does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the tuple element. Otherwise just the data is returned as the tuple element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_TUPLE_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_TUPLE_D.html new file mode 100644 index 0000000000000000000000000000000000000000..a680e4a0ae05dc8a8ce40b10290cbaee7b3a18c8 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TO_TUPLE_D.html @@ -0,0 +1,54 @@ + + + +Macro BOOST_VMD_TO_TUPLE_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TO_TUPLE_D

+

BOOST_VMD_TO_TUPLE_D — Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence. Re-entrant version.

+
+

Synopsis

+
// In header: <boost/vmd/to_tuple.hpp>
+
+BOOST_VMD_TO_TUPLE_D(d, ...)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.

+

The first variadic parameter is required and is the sequence to convert.

+

Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.

+

The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.

+

returns = A Boost PP tuple. If the sequence is empty the return is emptiness since an empty tuple does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the tuple element. Otherwise just the data is returned as the tuple element, which is the default.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_BACK.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_BACK.html new file mode 100644 index 0000000000000000000000000000000000000000..5caeae5f9ef3aa326512d5b156b89f2a25e9ce67 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_BACK.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_POP_BACK + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_POP_BACK

+

BOOST_VMD_TUPLE_POP_BACK — pops an element from the end of a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/pop_back.hpp>
+
+BOOST_VMD_TUPLE_POP_BACK(tuple)
+
+

Description

+

tuple = tuple to pop an element from.

+

If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the last element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_BACK_Z.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_BACK_Z.html new file mode 100644 index 0000000000000000000000000000000000000000..2ff7569eef73ea32bfd5854ad1c806f158996216 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_BACK_Z.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_POP_BACK_Z + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_POP_BACK_Z

+

BOOST_VMD_TUPLE_POP_BACK_Z — pops an element from the end of a tuple. It reenters BOOST_PP_REPEAT with maximum efficiency.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/pop_back.hpp>
+
+BOOST_VMD_TUPLE_POP_BACK_Z(z, tuple)
+
+

Description

+

z = the next available BOOST_PP_REPEAT dimension. tuple = tuple to pop an element from.

+

If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the last element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_FRONT.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_FRONT.html new file mode 100644 index 0000000000000000000000000000000000000000..d228d3c60d0cb346537e17cbf2d409029869eb43 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_FRONT.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_POP_FRONT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_POP_FRONT

+

BOOST_VMD_TUPLE_POP_FRONT — pops an element from the front of a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/pop_front.hpp>
+
+BOOST_VMD_TUPLE_POP_FRONT(tuple)
+
+

Description

+

tuple = tuple to pop an element from.

+

If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the first element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_FRONT_Z.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_FRONT_Z.html new file mode 100644 index 0000000000000000000000000000000000000000..e300234d9a2ce624859e2618feb15fc7d234541f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_POP_FRONT_Z.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_POP_FRONT_Z + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_POP_FRONT_Z

+

BOOST_VMD_TUPLE_POP_FRONT_Z — pops an element from the front of a tuple. It reenters BOOST_PP_REPEAT with maximum efficiency.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/pop_front.hpp>
+
+BOOST_VMD_TUPLE_POP_FRONT_Z(z, tuple)
+
+

Description

+

z = the next available BOOST_PP_REPEAT dimension. tuple = tuple to pop an element from.

+

If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the first element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_PUSH_BACK.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_PUSH_BACK.html new file mode 100644 index 0000000000000000000000000000000000000000..ea95094ec39bd5513495b13e226bebee06e3642b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_PUSH_BACK.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_PUSH_BACK + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_PUSH_BACK

+

BOOST_VMD_TUPLE_PUSH_BACK — appends an element to the end of a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/push_back.hpp>
+
+BOOST_VMD_TUPLE_PUSH_BACK(tuple, elem)
+
+

Description

+

tuple = tuple to to append an element to. elem = element to append.

+

If the tuple is an empty tuple the result is a tuple with the single element. Otherwise the result is a tuple after adding the element to the end.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_PUSH_FRONT.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_PUSH_FRONT.html new file mode 100644 index 0000000000000000000000000000000000000000..57630112571949ea4e23a2f4df929ce8539e0ac0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_PUSH_FRONT.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_PUSH_FRONT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_PUSH_FRONT

+

BOOST_VMD_TUPLE_PUSH_FRONT — inserts an element at the beginning of a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/push_front.hpp>
+
+BOOST_VMD_TUPLE_PUSH_FRONT(tuple, elem)
+
+

Description

+

tuple = tuple to insert an element at. elem = element to insert.

+

If the tuple is an empty tuple the result is a tuple with the single element. Otherwise the result is a tuple after inserting the element at the beginning.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_REMOVE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_REMOVE.html new file mode 100644 index 0000000000000000000000000000000000000000..45f94924a711a756189dabe341c032bcfe4acc05 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_REMOVE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_REMOVE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_REMOVE

+

BOOST_VMD_TUPLE_REMOVE — removes an element from a tuple.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/remove.hpp>
+
+BOOST_VMD_TUPLE_REMOVE(tuple, index)
+
+

Description

+

tuple = tuple from which an element is to be removed. index = The zero-based position in tuple of the element to be removed.

+

If index is greater or equal to the tuple size the result is undefined. If the tuple is a single element and the index is 0 the result is an empty tuple. Otherwise the result is a tuple after removing the index element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_REMOVE_D.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_REMOVE_D.html new file mode 100644 index 0000000000000000000000000000000000000000..38822d2b330f87a71999a4fd92e6dc9583eea47c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_REMOVE_D.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_REMOVE_D + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_REMOVE_D

+

BOOST_VMD_TUPLE_REMOVE_D — removes an element from a tuple. It reenters BOOST_PP_WHILE with maximum efficiency.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/remove.hpp>
+
+BOOST_VMD_TUPLE_REMOVE_D(d, tuple, index)
+
+

Description

+

d = The next available BOOST_PP_WHILE iteration. tuple = tuple from which an element is to be removed. index = The zero-based position in tuple of the element to be removed.

+

If index is greater or equal to the tuple size the result is undefined. If the tuple is a single element and the index is 0 the result is an empty tuple. Otherwise the result is a tuple after removing the index element.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_SIZE.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_SIZE.html new file mode 100644 index 0000000000000000000000000000000000000000..605eab80cc8bd85b8f3970b2b1fdb83c4292c5a5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_SIZE.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_SIZE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_SIZE

+

BOOST_VMD_TUPLE_SIZE — expands to the size of the tuple passed to it.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/size.hpp>
+
+BOOST_VMD_TUPLE_SIZE(tuple)
+
+

Description

+

tuple = tuple whose size is to be extracted.

+

If the tuple is an empty tuple its size is 0. Otherwise the result is the number of elements in the tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_ARRAY.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_ARRAY.html new file mode 100644 index 0000000000000000000000000000000000000000..2c22f49979f12e89ffdc865ff70b0224d8ea1c32 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_ARRAY.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_TO_ARRAY + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_TO_ARRAY

+

BOOST_VMD_TUPLE_TO_ARRAY — converts a tuple to an array.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/to_array.hpp>
+
+BOOST_VMD_TUPLE_TO_ARRAY(tuple)
+
+

Description

+

tuple = tuple to be converted.

+

If the tuple is an empty tuple it is converted to an array with 0 elements. Otherwise the tuple is converted to an array with the same number of elements as the tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_LIST.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_LIST.html new file mode 100644 index 0000000000000000000000000000000000000000..15497365de7e27ac45b1b303b16d56f6273358a7 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_LIST.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_TO_LIST + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_TO_LIST

+

BOOST_VMD_TUPLE_TO_LIST — converts a tuple to a list.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/to_list.hpp>
+
+BOOST_VMD_TUPLE_TO_LIST(tuple)
+
+

Description

+

tuple = tuple to be converted.

+

If the tuple is an empty tuple it is converted to an empty list (BOOST_PP_NIL). Otherwise the tuple is converted to a list with the same number of elements as the tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_SEQ.html b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_SEQ.html new file mode 100644 index 0000000000000000000000000000000000000000..6dc1090320dcbf0c34c089ce984cc41b4ecfda15 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/BOOST_VMD_TUPLE_TO_SEQ.html @@ -0,0 +1,51 @@ + + + +Macro BOOST_VMD_TUPLE_TO_SEQ + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_VMD_TUPLE_TO_SEQ

+

BOOST_VMD_TUPLE_TO_SEQ — converts a tuple to a seq.

+
+

Synopsis

+
// In header: <boost/vmd/tuple/to_seq.hpp>
+
+BOOST_VMD_TUPLE_TO_SEQ(tuple)
+
+

Description

+

tuple = tuple to be converted.

+

If the tuple is an empty tuple it is converted to an empty seq. Otherwise the tuple is converted to a seq with the same number of elements as the tuple.

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/array/to_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/array/to_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..3ecbbd8b1f6fb80e2136dc5d6132f881fb205067 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/array/to_tuple_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/array/to_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..1dd90b6b7c7cd47704bf1de569f317f1f4ec52ab --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/assert.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_ASSERT(...)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_array_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_array_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..b65172d561bac3bf48cc15fbf52a295b2acebd78 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_array_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/assert_is_array.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_empty_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_empty_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..13ad856de0b8925956fc9d7be44d61736134f03d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_empty_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/assert_is_empty.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_identifier_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_identifier_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..380b81ab956eb4118bb37dad60c9a058a49c7fa5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_identifier_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/assert_is_identifier.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_list_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_list_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..b076fdfff84a7cc83986b0609a96e53ebda07253 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_list_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/assert_is_list.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_number_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_number_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..70f59161809a64335201f1b3ec8fdc7a98801182 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_number_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/assert_is_number.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_seq_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_seq_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..85f2abdc12194e9d5122ef39d2da947376df7391 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_seq_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/assert_is_seq.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..32f691af8199d822bf4d46845d45b42adfcb8a8a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_tuple_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/assert_is_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_type_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_type_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..88ea360ebbb098137ccc22450fae39b2fdcb7642 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/assert_is_type_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/assert_is_type.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/elem_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/elem_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..454aabb9e509035fad7beb8dc0bf9bf143fd8e6a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/elem_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/elem.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_ELEM(elem, ...)
+BOOST_VMD_ELEM_D(d, elem, ...)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/empty_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/empty_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..fd0c9a1408a920313838c4647badf992ee0d4d2e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/empty_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/empty.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_EMPTY(...)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/enum_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/enum_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..888ad02ed4dd511ce871261cea7723f7925b63ff --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/enum_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/enum.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_ENUM(...)
+BOOST_VMD_ENUM_D(d, ...)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/equal_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/equal_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..df45171e768a4cb51f24c1dafa50e532700cd025 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/equal_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/equal.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_EQUAL(sequence, ...)
+BOOST_VMD_EQUAL_D(d, sequence, ...)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/get_type_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/get_type_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..4d3012ae7b01afd075f1a1f5967a6c8846167e85 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/get_type_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/get_type.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/identity_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/identity_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..ebd65af5525511f97bf6a3a17ede46f6a1f2402e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/identity_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/identity.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_array_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_array_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..fd790ff4366443cdeb21bbc7f6a9c651ae738774 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_array_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_array.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_ARRAY(sequence)
+BOOST_VMD_IS_ARRAY_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_array_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_array_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..5dfde9a4aab6a25bef870e3173084e1a0900cd82 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_array_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_empty_array.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..cd8210510771397a03afc5cc53be2bfaf3c0680d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/is_empty.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_list_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_list_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..b6d00d2b91a0301f3a1643b3296bdb56f0afbc52 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_empty_list_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_empty_list.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_identifier_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_identifier_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..381d79f88b918b64eb58e72b8322434d5436cc42 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_identifier_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_identifier.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_list_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_list_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..7b7b50025e3e060ca39bae1b352237290537e968 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_list_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_list.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_LIST(sequence)
+BOOST_VMD_IS_LIST_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_multi_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_multi_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..323fbc9b95ebec236db9732a6e9b6192ab244b23 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_multi_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_multi.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_MULTI(sequence)
+BOOST_VMD_IS_MULTI_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_number_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_number_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..a29ee20283cfc64d63d44a14291cf7977eb0b3c1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_number_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/is_number.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_NUMBER(sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_parens_empty_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_parens_empty_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..dc0bc05706c322faa00f8380062d3043a4d0b7b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_parens_empty_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_parens_empty.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_seq_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_seq_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..9b71fe299d06f9dc8e28a6ad6a4c92831911e160 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_seq_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_seq.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_SEQ(sequence)
+BOOST_VMD_IS_SEQ_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..9363f87202a7e874ff26744032f5485fe7ca49f1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_tuple_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/is_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_TUPLE(sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_type_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_type_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..7f205a4c364780b73cfbd30556ab629cb8ea5840 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_type_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_type.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_TYPE(sequence)
+BOOST_VMD_IS_TYPE_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_unary_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_unary_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..a3a86dbb1ad31d4b8f54097573c60b321f52f55e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/is_unary_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/is_unary.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_IS_UNARY(sequence)
+BOOST_VMD_IS_UNARY_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/list/to_seq_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/list/to_seq_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..bfbe06d9d166c279c00901919db86cb1c5e4e474 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/list/to_seq_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/list/to_seq.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/list/to_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/list/to_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..abc2b63b641c3ab5d9aea0e3f44b60f59e408a90 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/list/to_tuple_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/list/to_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/not_equal_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/not_equal_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..1e09847dbdd99d9f38834fb509593ef38086899a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/not_equal_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/not_equal.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_NOT_EQUAL(sequence, ...)
+BOOST_VMD_NOT_EQUAL_D(d, sequence, ...)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/is_vmd_seq_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/is_vmd_seq_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..b312b3d38e973b230351ad85bc7cdcaa701e4ffb --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/is_vmd_seq_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/is_vmd_seq.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/pop_back_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/pop_back_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..cbd16b2054d240d0e46797782d57b382dafb9e73 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/pop_back_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/pop_back.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/pop_front_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/pop_front_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..2e93231f45f00995b8347523939f30df2558e73e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/pop_front_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/pop_front.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/push_back_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/push_back_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..5a0da99a898cf086ee1103d565de357efc3558bf --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/push_back_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/push_back.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/push_front_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/push_front_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..d1e125b3cd8aaafe7f2f203c6dd6d1258d4470c6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/push_front_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/push_front.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/remove_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/remove_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..1264f52361f5bfec1469a98965d039e14afbcacf --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/remove_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/remove.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_SEQ_REMOVE(seq, index)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/size_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/size_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..259153721ed1eed173d258dc2063a522ac68589c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/size_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/size.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_array_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_array_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..adce3b0943405c406b4c010e4316dd2bb352c0b0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_array_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/to_array.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_list_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_list_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..b34377b11aefd80714918fa0dcdd86eee53a075d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_list_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/to_list.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..3a73433293a86c81945840ce70c9ca31e703a085 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/seq/to_tuple_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/seq/to_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/size_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/size_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..532cd11d7e674c26b616cce748c9bf77f8cd910d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/size_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/size.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_SIZE(sequence)
+BOOST_VMD_SIZE_D(d, sequence)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_array_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_array_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..163515ab74b787e912c7068891452eed072451ea --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_array_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/to_array.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_list_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_list_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..5312ec1a81649dde3ac6adb5d89bc00c7dd2ac68 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_list_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/to_list.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_seq_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_seq_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..43e9ca6779867c55185cfaa1e5a7634ab15562c2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_seq_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/to_seq.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..288f26dbbbec904656fd79b73dfc63075cf3f62b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/to_tuple_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/to_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/is_vmd_tuple_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/is_vmd_tuple_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..d410dbe14ffc77c69017791ae1f736c94d84f448 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/is_vmd_tuple_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/is_vmd_tuple.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/pop_back_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/pop_back_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..0870451b827dafa01fc03f1071fd26c4d21cd2a6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/pop_back_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/tuple/pop_back.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/pop_front_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/pop_front_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..405c598a1e374f34f833d46cc05d91fc70f4dfc8 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/pop_front_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/tuple/pop_front.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/push_back_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/push_back_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..2a5c9b3ea643bf59051ec6958e0c5e6bb878f7e3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/push_back_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/push_back.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/push_front_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/push_front_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..fa92b2a8672e5c5befdd3b310d148c6a40bbf8b9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/push_front_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/push_front.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/remove_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/remove_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..726a8ef87dafced8d19b454510147b05a74aa3ff --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/remove_hpp.html @@ -0,0 +1,43 @@ + + + +Header <boost/vmd/tuple/remove.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+
+BOOST_VMD_TUPLE_REMOVE(tuple, index)
+BOOST_VMD_TUPLE_REMOVE_D(d, tuple, index)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/size_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/size_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..cef0da6fa5ec5bbb664b9f9b1a77b6c86890db67 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/size_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/size.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_array_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_array_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..ae10122abd6d9182dbf77e4f5a4ae15d06523ed0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_array_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/to_array.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_list_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_list_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..42ac45439c8b7506aade9fff176432dfb0c8f1f0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_list_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/to_list.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_seq_hpp.html b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_seq_hpp.html new file mode 100644 index 0000000000000000000000000000000000000000..d3f69770814f9bfcb3c9c95811b11e9961fbe04b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/header/boost/vmd/tuple/to_seq_hpp.html @@ -0,0 +1,42 @@ + + + +Header <boost/vmd/tuple/to_seq.hpp> + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/index.html b/tools/boost_1_65_1/libs/vmd/doc/html/index.html new file mode 100644 index 0000000000000000000000000000000000000000..f7304fe5ee8cc65262e5465e81d96aab74a7210d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/index.html @@ -0,0 +1,476 @@ + + + +Chapter 1. The Variadic Macro Data Library 1.9 + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
Next
+
+
+

+Chapter 1. The Variadic Macro Data Library 1.9

+

+Edward Diener +

+
+
+
+

Table of Contents

+
+
Introduction
+
Naming conventions
+
Why and how to use
+
Using variadic macros
+
Visual C++ define
+
Functional groups
+
Data types
+
Specific macros for working + with data types
+
+
Emptiness
+
Macro + constraints
+
Identifiers
+
Numbers
+
Types
+
VMD + and Boost PP data types
+
Identifying + data types
+
+
Generic macros for working + with data types
+
+
Parsing + sequences
+
+
Converting + sequences
+
Accessing + a sequence element
+
+
Getting + the type of data
+
Testing for + equality and inequality
+
+
Macros with modifiers
+
+
Return + type modifiers
+
Filtering + modifiers
+
Identifier + modifiers
+
Splitting + modifiers
+
Index + modifiers
+
Modifiers + and the single-element sequence
+
+
Identifier + subtypes
+
Useful variadic macros + not in Boost PP
+
+
Asserting + and data types
+
Generating + emptiness and identity
+
Functionality + for "empty" seqs and tuples
+
+
Controlling internal + usage
+
Boost PP re-entrant + versions
+
Input as dynamic + types
+
Visual C++ gotchas in + VMD
+
Version 1.7 to 1.8 conversion
+
Examples using VMD functionality
+
Variadic Macro Data Reference
+
+
Header <boost/vmd/array/to_seq.hpp>
+
+
Header <boost/vmd/list/to_seq.hpp>
+
+
Header <boost/vmd/to_seq.hpp>
+
+
Header <boost/vmd/tuple/to_seq.hpp>
+
+
Header <boost/vmd/array/to_tuple.hpp>
+
+
Header <boost/vmd/list/to_tuple.hpp>
+
+
Header <boost/vmd/seq/to_tuple.hpp>
+
+
Header <boost/vmd/to_tuple.hpp>
+
+
Header <boost/vmd/assert.hpp>
+
+
Header <boost/vmd/assert_is_array.hpp>
+
+
Header <boost/vmd/assert_is_empty.hpp>
+
+
Header <boost/vmd/assert_is_identifier.hpp>
+
+
Header <boost/vmd/assert_is_list.hpp>
+
+
Header <boost/vmd/assert_is_number.hpp>
+
+
Header <boost/vmd/assert_is_seq.hpp>
+
+
Header <boost/vmd/assert_is_tuple.hpp>
+
+
Header <boost/vmd/assert_is_type.hpp>
+
+
Header <boost/vmd/elem.hpp>
+
+
Header <boost/vmd/empty.hpp>
+
+
Header <boost/vmd/enum.hpp>
+
+
Header <boost/vmd/equal.hpp>
+
+
Header <boost/vmd/get_type.hpp>
+
+
Header <boost/vmd/identity.hpp>
+
+
Header <boost/vmd/is_array.hpp>
+
+
Header <boost/vmd/is_empty.hpp>
+
+
Header <boost/vmd/is_empty_array.hpp>
+
+
Header <boost/vmd/is_empty_list.hpp>
+
+
Header <boost/vmd/is_identifier.hpp>
+
+
Header <boost/vmd/is_list.hpp>
+
+
Header <boost/vmd/is_multi.hpp>
+
+
Header <boost/vmd/is_number.hpp>
+
+
Header <boost/vmd/is_parens_empty.hpp>
+
+
Header <boost/vmd/is_seq.hpp>
+
+
Header <boost/vmd/is_tuple.hpp>
+
+
Header <boost/vmd/is_type.hpp>
+
+
Header <boost/vmd/is_unary.hpp>
+
+
Header <boost/vmd/not_equal.hpp>
+
+
Header <boost/vmd/seq/is_vmd_seq.hpp>
+
+
Header <boost/vmd/seq/pop_back.hpp>
+
+
Header <boost/vmd/tuple/pop_back.hpp>
+
+
Header <boost/vmd/seq/pop_front.hpp>
+
+
Header <boost/vmd/tuple/pop_front.hpp>
+
+
Header <boost/vmd/seq/push_back.hpp>
+
+
Header <boost/vmd/tuple/push_back.hpp>
+
+
Header <boost/vmd/seq/push_front.hpp>
+
+
Header <boost/vmd/tuple/push_front.hpp>
+
+
Header <boost/vmd/seq/remove.hpp>
+
+
Header <boost/vmd/tuple/remove.hpp>
+
+
Header <boost/vmd/seq/size.hpp>
+
+
Header <boost/vmd/size.hpp>
+
+
Header <boost/vmd/tuple/size.hpp>
+
+
Header <boost/vmd/seq/to_array.hpp>
+
+
Header <boost/vmd/to_array.hpp>
+
+
Header <boost/vmd/tuple/to_array.hpp>
+
+
Header <boost/vmd/seq/to_list.hpp>
+
+
Header <boost/vmd/to_list.hpp>
+
+
Header <boost/vmd/tuple/to_list.hpp>
+
+
Header <boost/vmd/tuple/is_vmd_tuple.hpp>
+
+
+
Design
+
Compilers
+
History
+
Acknowledgements
+
Index
+
+
+
+ +

+ Welcome to the Variadic Macro Data library. +

+

+ The Variadic Macro Data library, referred to hereafter as VMD for short, is + a library of variadic macros which provide enhancements to the functionality + in the Boost preprocessor library ( Boost PP ), especially as it relates to + preprocessor data types. +

+

+ The preprocessor data types with which VMD has specific functionality are emptiness, + identifiers, numbers ( a subset of identifiers ), types ( a subset of identifiers + ), Boost PP arrays, Boost PP lists, Boost PP seqs, Boost PP tuples, and sequences. + The first four are basic preprocessor data types while the latter five are + composite preprocessor data types. A sequence is zero or more of the other + preprocessor data types following each other. +

+

+ + Data + type examples +

+
+

Table 1.1. Data types with examples

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Type +

+
+

+ Example +

+
+

+ identifier +

+
+

+ anyname +

+
+

+ number +

+
+

+ 47 +

+
+

+ type +

+
+

+ BOOST_VMD_TYPE_NUMBER +

+
+

+ array +

+
+

+ (4,(an_identifier,156,BOOST_VMD_TYPE_IDENTIFIER)) +

+
+

+ list +

+
+

+ (78,(some_identifier,(BOOST_VMD_TYPE_TYPE,BOOST_PP_NIL))) +

+
+

+ seq +

+
+

+ (identifier)(89)(245) +

+
+

+ tuple +

+
+

+ (any_id,175,BOOST_VMD_TYPE_LIST,happy,21) +

+
+

+ sequence +

+
+

+ tree 59 (56,BOOST_VMD_TYPE_SEQ) (128)(fire)(clown) (47,(BOOST_VMD_TYPE_TUPLE,BOOST_PP_NIL)) +

+
+
+

+ Emptiness is the lack of any preprocessing tokens. A macro which expands to + nothing, as in: +

+
#define RETURN_NOTHING(x)
+
+

+ is said to return emptiness. Conversely a macro could accept nothing when invoked, + such as in: +

+
RETURN_NOTHING()
+
+

+ Finally emptiness can be part of any composite data type as in: +

+
(45,,some_name)
+
+

+ where the second tuple element is empty. +

+

+ + What + is the advantage ? +

+

+ VMD can identify any of the preprocessor data types previously mentioned, and + can parse sequences into their individual preprocessor data types. You may + well ask why that is important. +

+

+ In Boost PP macro programming a great deal of the control logic of designing + a macro is based on the support Boost PP has for numbers and testing for the + value of a number, in particular 0 and 1 to represent boolean choices. Essentially + Boost PP often uses the value of a number to control the logic in a macro's + design. +

+

+ VMD does not attempt, in any way, to duplicate Boost PP's support for testing + the value of numbers or of the boolean 0 or 1 values, but just reuses that + functionality. What VMD offers, which goes beyond Boost PP, is a system for + deciphering the preprocessor data types, as well as comparing any of the preprocessor + data types for equality to any given value. This allows macro logic to be designed + in a more flexible way, relying on the type of data and/or the value of the + data. If this intrigues you, continue reading to understand how you can use + VMD to do macro programming. +

+

+ + Functionality + areas +

+

+ The functionality of the library may be summed up as: +

+
    +
  1. + Provide a better way of testing for and using empty parameters and empty + preprocessor data. +
  2. +
  3. + Provide ways for testing/parsing for identifiers, numbers, types, tuples, + arrays, lists, and seqs. +
  4. +
  5. + Provide ways for testing/parsing sequences of identifiers, numbers, types, + tuples, arrays, lists. and seqs. +
  6. +
  7. + Provide some useful variadic macros not in Boost PP. +
  8. +
+

+ The library is a header only library and all macros in the library are included + by a single header, whose name is 'vmd.hpp'. Individual headers may be used + for different functionality in the library and will be denoted when that functionality + is explained. +

+

+ All the macros in the library begin with the sequence 'BOOST_VMD_' to distinguish + them from other macros the end-user might use. Therefore the end-user should + not use any C++ identifiers, whether in macros or otherwise, which being with + the sequence 'BOOST_VMD_'. +

+

+ Use of the library is only dependent on Boost PP. The library also uses Boost + detail lightweight_test.hpp for its own tests. +

+
+
+ + + +

Last revised: September 02, 2017 at 10:10:38 GMT

+
+
Next
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/index/s24.html b/tools/boost_1_65_1/libs/vmd/doc/html/index/s24.html new file mode 100644 index 0000000000000000000000000000000000000000..bfaf8b18aa4fdee9d1fe8973bfcdcd91aea2f6fa --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/index/s24.html @@ -0,0 +1,1899 @@ + + + +Index + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHome +
+
+

+Index

+

A B C E F G H I L M N P R S T V W

+
+
+A +
+
+
+B +
+
+
+C +
+
+
+E +
+
+
+F +
+
+
+G +
+
+
+H +
+
+
+I +
+
+
+L +
+
+
+M +
+
+
+N +
+
+
+P +
+
+
+R +
+
+
+S +
+
+
+T +
+
+
+V +
+
+
+W +
+
+
+
+ + + +
+
+
+PrevUpHome +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/standalone_HTML.manifest b/tools/boost_1_65_1/libs/vmd/doc/html/standalone_HTML.manifest new file mode 100644 index 0000000000000000000000000000000000000000..b80016a8bb9c329882872e4a4d3322b7560cd5b6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/standalone_HTML.manifest @@ -0,0 +1,183 @@ +index.html +variadic_macro_data/vmd_naming.html +variadic_macro_data/vmd_whyhow.html +variadic_macro_data/vmd_vmacros.html +variadic_macro_data/vmd_vc.html +variadic_macro_data/vmd_detail.html +variadic_macro_data/vmd_data_types.html +variadic_macro_data/vmd_specific.html +variadic_macro_data/vmd_specific/vmd_constraints.html +variadic_macro_data/vmd_specific/vmd_identifier.html +variadic_macro_data/vmd_specific/vmd_number.html +variadic_macro_data/vmd_specific/vmd_type.html +variadic_macro_data/vmd_specific/vmd_pp_data_types.html +variadic_macro_data/vmd_specific/vmd_identifying.html +variadic_macro_data/vmd_generic.html +variadic_macro_data/vmd_generic/vmd_convert_sequence.html +variadic_macro_data/vmd_generic/vmd_assert.html +variadic_macro_data/vmd_modifiers.html +variadic_macro_data/vmd_modifiers/vmd_modifiers_filter.html +variadic_macro_data/vmd_modifiers/vmd_modifiers_identifier.html +variadic_macro_data/vmd_modifiers/vmd_modifiers_splitting.html +variadic_macro_data/vmd_modifiers/vmd_modifiers_index.html +variadic_macro_data/vmd_modifiers/vmd_modifiers_single.html +variadic_macro_data/vmd_identifier_subtype.html +variadic_macro_data/vmd_useful.html +variadic_macro_data/vmd_useful/vmd_identity.html +variadic_macro_data/vmd_useful/vmd_empty_ppdata.html +variadic_macro_data/vmd_internal_macros.html +variadic_macro_data/vmd_reentrant.html +variadic_macro_data/vmd_dynamic_typing.html +variadic_macro_data/vmd_vc_isms.html +variadic_macro_data/vmd_conv.html +variadic_macro_data/vmd_examples.html +variadic_macro_data_reference.html +BOOST_VMD_ARRAY_TO_SEQ.html +header/boost/vmd/list/to_seq_hpp.html +BOOST_VMD_LIST_TO_SEQ.html +header/boost/vmd/to_seq_hpp.html +BOOST_VMD_TO_SEQ.html +BOOST_VMD_TO_SEQ_D.html +header/boost/vmd/tuple/to_seq_hpp.html +BOOST_VMD_TUPLE_TO_SEQ.html +header/boost/vmd/array/to_tuple_hpp.html +BOOST_VMD_ARRAY_TO_TUPLE.html +header/boost/vmd/list/to_tuple_hpp.html +BOOST_VMD_LIST_TO_TUPLE.html +header/boost/vmd/seq/to_tuple_hpp.html +BOOST_VMD_SEQ_TO_TUPLE.html +header/boost/vmd/to_tuple_hpp.html +BOOST_VMD_TO_TUPLE.html +BOOST_VMD_TO_TUPLE_D.html +header/boost/vmd/assert_hpp.html +BOOST_VMD_ASSERT.html +header/boost/vmd/assert_is_array_hpp.html +BOOST_VMD_ASSERT_IS_ARRAY.html +BOOST_VMD_ASSERT_IS_ARRAY_D.html +header/boost/vmd/assert_is_empty_hpp.html +BOOST_VMD_ASSERT_IS_EMPTY.html +header/boost/vmd/assert_is_identifier_hpp.html +BOOST_VMD_ASSERT_IS_IDENTIFIER.html +BOOST_VMD_ASSERT_IS_IDENTIFIER_D.html +header/boost/vmd/assert_is_list_hpp.html +BOOST_VMD_ASSERT_IS_LIST.html +BOOST_VMD_ASSERT_IS_LIST_D.html +header/boost/vmd/assert_is_number_hpp.html +BOOST_VMD_ASSERT_IS_NUMBER.html +header/boost/vmd/assert_is_seq_hpp.html +BOOST_VMD_ASSERT_IS_SEQ.html +BOOST_VMD_ASSERT_IS_SEQ_D.html +header/boost/vmd/assert_is_tuple_hpp.html +BOOST_VMD_ASSERT_IS_TUPLE.html +header/boost/vmd/assert_is_type_hpp.html +BOOST_VMD_ASSERT_IS_TYPE.html +BOOST_VMD_ASSERT_IS_TYPE_D.html +header/boost/vmd/elem_hpp.html +BOOST_VMD_ELEM.html +BOOST_VMD_ELEM_D.html +header/boost/vmd/empty_hpp.html +BOOST_VMD_EMPTY.html +header/boost/vmd/enum_hpp.html +BOOST_VMD_ENUM.html +BOOST_VMD_ENUM_D.html +header/boost/vmd/equal_hpp.html +BOOST_VMD_EQUAL.html +BOOST_VMD_EQUAL_D.html +header/boost/vmd/get_type_hpp.html +BOOST_VMD_GET_TYPE.html +BOOST_VMD_GET_TYPE_D.html +header/boost/vmd/identity_hpp.html +BOOST_VMD_IDENTITY.html +BOOST_VMD_IDENTITY_RESULT.html +header/boost/vmd/is_array_hpp.html +BOOST_VMD_IS_ARRAY.html +BOOST_VMD_IS_ARRAY_D.html +header/boost/vmd/is_empty_hpp.html +BOOST_VMD_IS_EMPTY.html +header/boost/vmd/is_empty_array_hpp.html +BOOST_VMD_IS_EMPTY_ARRAY.html +BOOST_VMD_IS_EMPTY_ARRAY_D.html +header/boost/vmd/is_empty_list_hpp.html +BOOST_VMD_IS_EMPTY_LIST.html +BOOST_VMD_IS_EMPTY_LIST_D.html +header/boost/vmd/is_identifier_hpp.html +BOOST_VMD_IS_IDENTIFIER.html +BOOST_VMD_IS_IDENTIFIER_D.html +header/boost/vmd/is_list_hpp.html +BOOST_VMD_IS_LIST.html +BOOST_VMD_IS_LIST_D.html +header/boost/vmd/is_multi_hpp.html +BOOST_VMD_IS_MULTI.html +BOOST_VMD_IS_MULTI_D.html +header/boost/vmd/is_number_hpp.html +BOOST_VMD_IS_NUMBER.html +header/boost/vmd/is_parens_empty_hpp.html +BOOST_VMD_IS_PARENS_EMPTY.html +BOOST_VMD_IS_PARENS_EMPTY_D.html +header/boost/vmd/is_seq_hpp.html +BOOST_VMD_IS_SEQ.html +BOOST_VMD_IS_SEQ_D.html +header/boost/vmd/is_tuple_hpp.html +BOOST_VMD_IS_TUPLE.html +header/boost/vmd/is_type_hpp.html +BOOST_VMD_IS_TYPE.html +BOOST_VMD_IS_TYPE_D.html +header/boost/vmd/is_unary_hpp.html +BOOST_VMD_IS_UNARY.html +BOOST_VMD_IS_UNARY_D.html +header/boost/vmd/not_equal_hpp.html +BOOST_VMD_NOT_EQUAL.html +BOOST_VMD_NOT_EQUAL_D.html +header/boost/vmd/seq/is_vmd_seq_hpp.html +BOOST_VMD_IS_VMD_SEQ.html +header/boost/vmd/seq/pop_back_hpp.html +BOOST_VMD_SEQ_POP_BACK.html +header/boost/vmd/tuple/pop_back_hpp.html +BOOST_VMD_TUPLE_POP_BACK.html +BOOST_VMD_TUPLE_POP_BACK_Z.html +header/boost/vmd/seq/pop_front_hpp.html +BOOST_VMD_SEQ_POP_FRONT.html +header/boost/vmd/tuple/pop_front_hpp.html +BOOST_VMD_TUPLE_POP_FRONT.html +BOOST_VMD_TUPLE_POP_FRONT_Z.html +header/boost/vmd/seq/push_back_hpp.html +BOOST_VMD_SEQ_PUSH_BACK.html +header/boost/vmd/tuple/push_back_hpp.html +BOOST_VMD_TUPLE_PUSH_BACK.html +header/boost/vmd/seq/push_front_hpp.html +BOOST_VMD_SEQ_PUSH_FRONT.html +header/boost/vmd/tuple/push_front_hpp.html +BOOST_VMD_TUPLE_PUSH_FRONT.html +header/boost/vmd/seq/remove_hpp.html +BOOST_VMD_SEQ_REMOVE.html +header/boost/vmd/tuple/remove_hpp.html +BOOST_VMD_TUPLE_REMOVE.html +BOOST_VMD_TUPLE_REMOVE_D.html +header/boost/vmd/seq/size_hpp.html +BOOST_VMD_SEQ_SIZE.html +header/boost/vmd/size_hpp.html +BOOST_VMD_SIZE.html +BOOST_VMD_SIZE_D.html +header/boost/vmd/tuple/size_hpp.html +BOOST_VMD_TUPLE_SIZE.html +header/boost/vmd/seq/to_array_hpp.html +BOOST_VMD_SEQ_TO_ARRAY.html +header/boost/vmd/to_array_hpp.html +BOOST_VMD_TO_ARRAY.html +BOOST_VMD_TO_ARRAY_D.html +header/boost/vmd/tuple/to_array_hpp.html +BOOST_VMD_TUPLE_TO_ARRAY.html +header/boost/vmd/seq/to_list_hpp.html +BOOST_VMD_SEQ_TO_LIST.html +header/boost/vmd/to_list_hpp.html +BOOST_VMD_TO_LIST.html +BOOST_VMD_TO_LIST_D.html +header/boost/vmd/tuple/to_list_hpp.html +BOOST_VMD_TUPLE_TO_LIST.html +header/boost/vmd/tuple/is_vmd_tuple_hpp.html +BOOST_VMD_IS_VMD_TUPLE.html +variadic_macro_data/vmd_design.html +variadic_macro_data/vmd_compilers.html +variadic_macro_data/vmd_history.html +variadic_macro_data/vmd_ack.html +index/s24.html diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_ack.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_ack.html new file mode 100644 index 0000000000000000000000000000000000000000..1290fa12c4cb4c2b574c228eb8ffb053fc42f871 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_ack.html @@ -0,0 +1,50 @@ + + + +Acknowledgements + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ First and foremost I would like to thank Paul Mensonides for providing advice, + explanation and code for working with variadic macros and macros in general. + Secondly I would like to thank Steve Watanabe for his help, code, and explanations. + Finally I have to acknowledge that this library is an amalgam of already known + techniques for dealing with variadic macros themselves, among which are techniques + published online by Paul Mensonides. I have added design and some cleverness + in creating the library but I could not have done it without the previous knowledge + of others. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_compilers.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_compilers.html new file mode 100644 index 0000000000000000000000000000000000000000..83b3a8cc17a91b18a068d943d22fc0e61a0e20db --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_compilers.html @@ -0,0 +1,61 @@ + + + +Compilers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ On Windows I have tested this library using gcc/MingW, VC++, and clang targeting + gcc. The compilers tested are gcc 4.3.0, 4.4.0, 4.5.0-1, 4.5.2-1, 4.6.0, 4.6.1, + 4.6.2, 4.7.0, 4.7.2, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.9.0, 4.9.1, 4.9.2, + 4.9.3, 5.1.0, 5.2.0, VC++ 8.0, 9.0, 10.0, 11.0, 12.0, 14.0. and clang 3.4, + 3.5, 3.6, 3.7, and the latest clang build from source. +

+

+ On Linux I have tested this library using gcc 4.4.7, 4.6.4, 4.7.3, 4.8.2, 4.8.3, + 4.9.1, clang 3.3, 3.4, 3.5, and the latest clang build from source, and Intel + C++ 12.1. 13.0, 14.0, 15.0, 16.0. +

+

+ For VC++ 8.0 the BOOST_VMD_IS_EMPTY and BOOST_VMD_ASSERT_IS_EMPTY macros take + a single parameter rather than variadic data because this version of VC++ does + not accept variadic data which may be empty. +

+

+ The compilers supported are those which are deemed to offer C99/C++11 variadic + macro support for Boost PP as represented by the BOOST_PP_VARIADICS macro. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_conv.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_conv.html new file mode 100644 index 0000000000000000000000000000000000000000..d7553e23cbb2b9e46ba133facb4c8c13aed5d0bc --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_conv.html @@ -0,0 +1,434 @@ + + + +Version 1.7 to 1.8 conversion + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Since the current version of VMD has been drastically changed to make it easier + to use VMD functionality this section details equivalent functionality for + previous version 1.7 VMD macros. +

+

+ The changes in functionality involve the parsing of sequences. The equivalent + to all the V1.7 functionality, which looks for various data types at the beginning + of a sequence, is encompassed by the V1.8 macro BOOST_VMD_ELEM(0,sequence,...), + where '0' is the first sequence element and 'sequence' is the sequence, with + its optional parameters. +

+

+ + Identifier +

+

+ V1.7 +

+

+ BOOST_VMD_IDENTIFIER(sequence,keys,...) looked for an identifier at the beginning + of a sequence and returned a 2-element tuple, where the first element is the + matching index starting with 1, or 0 if no identifier is found, and the second + tuple element is the rest of the sequence or emptiness if no identifier is + found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX) + returns a 3-element tuple where the identifier found is the first tuple element, + the rest of the sequence is the second tuple element, and the matching index, + starting with 0, is the 3rd tuple element. If no identifier is found all elements + of the returned tuple are empty. +

+

+ V1.7 +

+

+ BOOST_VMD_BEGIN_IDENTIFIER(sequence,keys,...) looked for an identifier at the + beginning of a sequence and returned the matching index starting with 1, or + 0 if no identifier is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX) + returns a 2-element tuple where the identifier found is the first tuple element + and the matching index, starting with 0, is the 2nd tuple element. If no identifier + is found both elements of the returned tuple are empty. +

+

+ V1.7 +

+

+ BOOST_VMD_AFTER_IDENTIFIER(sequence,keys,...) looked for an identifier at the + beginning of a sequence and returned the rest of the sequence or emptiness + if no identifier is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER) + is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_IS_BEGIN_IDENTIFIER(sequence,keys,...) returns 1 if input begins + with an identifier, else 0 if it does not. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER) returns + the identifier found, otherwise emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,identifiers,BOOST_VMD_TYPE_IDENTIFIER))) + as the exact equivalent. +

+

+ + Number +

+

+ V1.7 +

+

+ BOOST_VMD_NUMBER(sequence,...) looked for a number at the beginning of a sequence + and returned a 2-element tuple, where the first element is the number and the + second tuple element is the rest of the sequence. If no number is found both + tuple elements are empty. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_AFTER) is + the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_BEGIN_NUMBER(sequence,...) looked for a number at the beginning of + a sequence and returned the number if found or emptiness if no number is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_AFTER_NUMBER(sequence,...) looked for a number at the beginning of + a sequence and returned the rest of the sequence or emptiness if no number + is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_ONLY_AFTER) + is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_IS_BEGIN_NUMBER(sequence,...) returns 1 if input begins with a number, + else 0 if it does not. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) returns the number found, + otherwise emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER))) + as the exact equivalent. +

+

+ + Array +

+

+ V1.7 +

+

+ BOOST_VMD_ARRAY(sequence) looked for an array at the beginning of a sequence + and returned a 2-element tuple, where the first element is the array and the + second tuple element is the rest of the sequence. If no array is found both + tuple elements are empty. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_AFTER) is the + exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_BEGIN_ARRAY(sequence) looked for an array at the beginning of a sequence + and returned the array if found or emptiness if no array is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_AFTER_ARRAY(sequence) looked for an array at the beginning of a sequence + and returned the rest of the sequence or emptiness if no array is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_ONLY_AFTER) + is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_IS_BEGIN_ARRAY(sequence,...) returns 1 if input begins with an array, + else 0 if it does not. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) returns the array found, otherwise + emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY))) + as the exact equivalent. +

+

+ + List +

+

+ V1.7 +

+

+ BOOST_VMD_LIST(sequence) looked for an list at the beginning of a sequence + and returned a 2-element tuple, where the first element is the list and the + second tuple element is the rest of the sequence. If no list is found both + tuple elements are empty. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_AFTER) is the + exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_BEGIN_LIST(sequence) looked for a list at the beginning of a sequence + and returned the list if found or emptiness if no list is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_AFTER_LIST(sequence) looked for an list at the beginning of a sequence + and returned the rest of the sequence or emptiness if no list is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_ONLY_AFTER) + is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_IS_BEGIN_LIST(sequence,...) returns 1 if input begins with an list, + else 0 if it does not. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) returns the list found, otherwise + emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST))) + as the exact equivalent. +

+

+ + Seq +

+

+ V1.7 +

+

+ BOOST_VMD_SEQ(sequence) looked for a seq at the beginning of a sequence and + returned a 2-element tuple, where the first element is the seq and the second + tuple element is the rest of the sequence. If no seq is found both tuple elements + are empty. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_AFTER) is the + exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_BEGIN_SEQ(sequence) looked for a seq at the beginning of a sequence + and returned the seq if found or emptiness if no seq is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_AFTER_SEQ(sequence) looked for an seq at the beginning of a sequence + and returned the rest of the sequence or emptiness if no seq is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_ONLY_AFTER) is + the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_IS_BEGIN_SEQ(sequence,...) returns 1 if input begins with an seq, + else 0 if it does not. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) returns the seq found, otherwise + emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ))) + as the exact equivalent. +

+

+ + Tuple +

+

+ V1.7 +

+

+ BOOST_VMD_TUPLE(sequence) looked for an tuple at the beginning of a sequence + and returned a 2-element tuple, where the first element is the tuple and the + second tuple element is the rest of the sequence. If no tuple is found both + tuple elements are empty. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_AFTER) is the + exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_BEGIN_TUPLE(sequence) looked for a tuple at the beginning of a sequence + and returned the tuple if found or emptiness if no tuple is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_AFTER_TUPLE(sequence) looked for an tuple at the beginning of a sequence + and returned the rest of the sequence or emptiness if no tuple is found. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_ONLY_AFTER) + is the exact equivalent. +

+

+ V1.7 +

+

+ BOOST_VMD_IS_BEGIN_TUPLE(sequence,...) returns 1 if input begins with an tuple, + else 0 if it does not. +

+

+ V1.8 equivalent +

+

+ BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) returns the tuple found, otherwise + emptiness if not found. You can use BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE))) + as the exact equivalent. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_data_types.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_data_types.html new file mode 100644 index 0000000000000000000000000000000000000000..828f812416fb321f9165d11c27450da89e1c7931 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_data_types.html @@ -0,0 +1,132 @@ + + + +Data types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The VMD library has functionality for testing and parsing preprocessor data. +

+

+ The C++ preprocessor defines preprocessor data as preprocessing tokens. The + types of preprocessing tokens can be seen in section 2.5 of the C++ standard + document. +

+

+ The VMD library works with a subset of two of these types of preprocessor tokens + as "data types". These are the "identifier" and "pp-number" + preprocessor tokens. The preprocessor token types which VMD cannot parse are: +

+
    +
  • + header-name +
  • +
  • + character-literal +
  • +
  • + user-defined-characteral-literal +
  • +
  • + string-literal +
  • +
  • + user-defined-string-literal +
  • +
  • + preprocessing-op-or-punc +
  • +
+

+ Even though VMD cannot parse these preprocessor token types, it is still a + very useful library since a large part of macro programming works with 'identifier' + and 'pp-number' tokens. +

+

+ VMD identifiers are preprocessing tokens consisting of alphanumeric characters + and the underscore ( _ ) character. This is very similar to a preprocessor + token "identifier" with the difference being that a VMD identifier + can start with a numeric character, allowing VMD identifiers to also be positive + integral literals. VMD offers functionality for parsing VMD identifiers both + as a separate element or in a sequence of preprocessing tokens. +

+

+ VMD numbers are Boost PP numbers, ie. preprocessing tokens of whole numbers + between 0 and 256 inclusive. These are a small subset of preprocessor token + "pp-number". VMD offers functionality for parsing numbers both as + a separate element or in a sequence of preprocessing tokens. A VMD number is + really a subset of VMD identifiers for which VMD offers specific functionality. + The Boost PP library has it own extensive support for numbers, which VMD does + not duplicate. +

+

+ VMD v-types are, like numbers, a subset of VMD identifiers consisting of identifiers + beginning with BOOST_VMD_TYPE_ followed by a data type mnemonic. Each v-type + can be recognized by VMD functionality and therefore passed or returned by + macros. Like any identifier a v-type can be parsed both as a separate element + or in a sequence of preprocessing tokens. +

+

+ VMD can also test for emptiness, or the absence of any preprocessing tokens + when passed as macro input. +

+

+ The Boost PP library supports four individual high-level data types. These + are arrays, lists, seqs, and tuples. When using variadic macros arrays are + really obsolete since tuples have all the functionality of arrays with a simpler + syntax. Nonetheless arrays are fully supported by VMD. A further data type + supported by Boost PP is variadic data, which is a comma separated grouping + of preprocessor elements. VMD has no special support for variadic data outside + of what is already in Boost PP. +

+

+ VMD has functionality to work with the four Boost PP high-level data types. + VMD can test the Boost PP data types and parse them in a sequence of preprocessor + tokens. +

+

+ VMD can also parse sequences. A sequence consists of zero or more other top-level + data types already mentioned represented consecutively. As such a sequence + represents any data type which VMD can parse since it can consist of emptiness, + a single data type, or multiple data types represented consecutively. +

+

+ Emptiness, the three identifier types, the four Boost PP composite data types, + and VMD sequences are the data types which VMD understands. Other low-level + preprocessor data types can of course be used in macro programming but VMD + cannot parse such preprocessor data. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_design.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_design.html new file mode 100644 index 0000000000000000000000000000000000000000..90dd9092d81002575670617745fda3c4f5c5d561 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_design.html @@ -0,0 +1,86 @@ + + + +Design + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Design +

+

+ The initial impetus for creating this library was entirely practical. I had + been working on another library of macro functionality, which used Boost PP + functionality, and I realized that if I could use variadic macros with my other + library, the end-user usability for that library would be easier. Therefore + the initial main design goal of this library was to interoperate variadic macro + data with Boost PP in the easiest and clearest way possible. +

+

+ This led to the original versions of the library as an impetus for adding variadic + macro data support to Boost PP. While this was being done, but the variadic + macro data support had not yet been finalized in Boost PP, I still maintained + the library in two modes, either its own variadic data functionality or deferring + to the implementation of variadic macros in the Boost PP library. +

+

+ Once support for variadic data had been added to Boost PP I stripped down the + functionality of this library to only include variadic macro support for functionality + which was an adjunct to the support in Boost PP. This functionality might be + seen as experimental, since it largely relied on a macro which tested for empty + input which Paul Mensonides, the author of Boost PP, had published on the Internet, + and which by the very nature of the C++ preprocessor is slightly flawed but + which was the closest approximation of such functionality which I believed + could be made. I had to tweak this macro somewhat for the Visual C++ preprocessor, + whose conformance to the C++ standard for macro processing is notably incorrect + in a number of areas. But I still felt this functionality could be used in + select situations and might be useful to others. Using this functionality I + was able to build up some other macros which tested for the various Boost PP + data types. I also was able to add in functionality, based on Paul Mendsonides + excellent work, for handling tuples in preprocessing data. +

+

+ All of this particular functionality is impossible to do effectively without + the use of variadic macros. But I had kept these features at a minimum because + of the difficulty of using variadic macros with compilers, most notably Visual + C++, whose implementation of variadic macros is substandard and therefore very + difficult to get to work correctly when variadic macros must be used. +

+

+ I then realized that if I am going to have a library which takes advantage + of variadic macros I should see what I could do in the area of parsing preprocessor + data. This has led to a reorganization of the library as a set of macros largely + for parsing preprocessor data. All of this is now built on top of my use of + the almost perfect checking for emptiness which Paul Mensonides originally + created. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_detail.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_detail.html new file mode 100644 index 0000000000000000000000000000000000000000..f30ddbaa511b8247b48d5c245bd5cdabd7a23573 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_detail.html @@ -0,0 +1,89 @@ + + + +Functional groups + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The particular constructs for which VMD has functionality can be divided into + these categories: +

+
    +
  1. + Emptiness +
  2. +
  3. + Identifiers +
  4. +
  5. + Numbers +
  6. +
  7. + Types +
  8. +
  9. + Boost PP data types ( array, list, seq, and tuple ) +
  10. +
  11. + Sequences +
  12. +
  13. + Additional helper variadic macros +
  14. +
+

+ The first six categories delineate the data types which VMD can parse. The + last category presents additional macros which will prove helpful for a macro + programmer using variadic macros with VMD and Boost PP. +

+

+ A general explanation of each of these categories will follow in the appropriate + place in the documentation. +

+

+ Furthermore VMD macros for working with the above data types which VMD understands + can be divided into 'specific' and 'generic' macros. +

+

+ The specific macros ask whether some input data is a particular data type. + The generic macros work with input data as any data type while allowing the + programmer to separately query the type of data. +

+

+ Both specific and generic macros have their place and the macro programmer + can decide which to use for any given situation. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_dynamic_typing.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_dynamic_typing.html new file mode 100644 index 0000000000000000000000000000000000000000..554c0b3a1ce226736021b9e918e2520d0e8d05a4 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_dynamic_typing.html @@ -0,0 +1,71 @@ + + + +Input as dynamic types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Within the constraints based on the top-level types which VMD can parse, the + libraries gives the end-user the ability to design macros with dynamic data + types. By this I mean that a macro could be designed to handle different data + types based on some documented agreement of different combinations of macro + input meaning slightly different things. Add to this the ability to design + such macros with variadic parameters and we have a preprocessor system of macro + creation which to a lesser extent rivals the DSELS of template metaprogramming. + Of course the preprocessor is not nearly as flexible as C++ templates, but + still the sort of preprocessor metaprogramming one could do with VMD, and the + underlying Boost PP, in creating flexible macros which can handle different + combinations of data types is very interesting. +

+

+ Of course macros need to be usable by an end-user so the syntactical ability + of sequences to represent different types of input data must be balanced against + ease of use and understanding when using a macro. But because certain sequences + can mimic C++ function calls to some extent it is possible to represent macros + as a language closer to C++ with VMD. +

+

+ What is important when designing a macro in which you parse input to decide + which type of data the invoker is passing to your macro is that you are aware + of the constraints when parsing a data type. As an example if you design a + macro where some input can either be a number, an identifier, or some other + data type top-level input then attempting to parse the data to see if it is + a number or identifier could fail with a preprocessor error and nullify your + design if the data is not a VMD data type. So designing a macro with data types + in mind often means restricting data to parseable top-level types. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_examples.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_examples.html new file mode 100644 index 0000000000000000000000000000000000000000..aa66181ace8283f17056952b6470c598d8d62d21 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_examples.html @@ -0,0 +1,994 @@ + + + +Examples using VMD functionality + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Examples of library use are always highly personal. Any given library employing + macro programming can decide what macro facilities are needed based on the + library itself and then decide if functionality in a macro library like VMD + makes macro programming in that library easier. To that end the examples presented + here are highly arbitrary and are just efforts to illustrate possible use of + functionality of VMD features without worrying too much if those examples have + any practical beneficial use in real programming situations. In these examples + I have endeavored, therefore, to present macro programming "snippets" + using VMD functionality rather than complete solutions to a given practical + problem. +

+

+ + Switch + macro +

+

+ In C++ there is a 'switch' statement which we can emulate in macro programming + using VMD. For the macro emulation we will have as parameters to our macro: +

+
    +
  1. + A value, which can be any data type VMD can parse. +
  2. +
  3. + A tuple of calling values. These will be used when calling the matching + macro. +
  4. +
  5. + Variadic parameters, each of which are tuples. Each tuple consists of two + elements, the name of a value to match and the name of a macro to call. + For the 'default' case the tuple is a single element which is the name + of a macro to call. These are our equivalents to the C++ switch 'case' + statements. +
  6. +
+

+ The macro looks like: +

+
BOOST_VMD_SWITCH(value,calling_values,...)
+
+

+ We have to be careful not to parse the name of our macro to call in any way + since this is a failing condition for BOOST_VMD_IS_EMPTY and subsequently for + any parsing of input data we might want to do. Instead we will just extract + the calling macro name and just call it, passing the calling values. +

+

+ Our processing is: +

+
    +
  1. + Convert our variadic parameters to a tuple since access to tuple elements + is easier. +
  2. +
  3. + Use a BOOST_PP_WHILE loop to find the matching value and extract the calling + macro from it. We will use BOOST_VMD_EQUAL to find the matching value. +
  4. +
  5. + Call the calling macro with the calling values when we return from our + BOOST_PP_WHILE loop. +
  6. +
+

+ Here is our code: +

+
#include <boost/vmd/detail/setup.hpp>
+
+#if BOOST_PP_VARIADICS
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/comparison/equal.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/enum.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+#include <boost/preprocessor/tuple/replace.hpp>
+#include <boost/preprocessor/tuple/size.hpp>
+#include <boost/preprocessor/variadic/to_tuple.hpp>
+#include <boost/preprocessor/variadic/size.hpp>
+#include <boost/vmd/equal.hpp>
+#include <boost/vmd/identity.hpp>
+#include <boost/vmd/is_empty.hpp>
+
+/*
+
+  State index into state values
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_ELEM_INDEX 2
+#define BOOST_VMD_SWITCH_STATE_ELEM_DEFAULT 4
+#define BOOST_VMD_SWITCH_STATE_ELEM_RESULT 5
+
+/*
+
+  Retrieve the state value, never changes
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_VALUE(state) \
+    BOOST_PP_TUPLE_ELEM(0,state) \
+/**/
+
+/*
+
+  Retrieve the state tuple of values, never changes
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_CHOICES(state) \
+    BOOST_PP_TUPLE_ELEM(1,state) \
+/**/
+
+/*
+
+  Retrieve the state index
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_INDEX(state) \
+    BOOST_PP_TUPLE_ELEM(2,state) \
+/**/
+
+/*
+
+  Retrieve the state tuple of values size, never changes
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_SIZE(state) \
+    BOOST_PP_TUPLE_ELEM(3,state) \
+/**/
+
+/*
+
+  Retrieve the state default tuple
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_DEFAULT(state) \
+    BOOST_PP_TUPLE_ELEM(4,state) \
+/**/
+
+/*
+
+  Retrieve the state result tuple
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_RESULT(state) \
+    BOOST_PP_TUPLE_ELEM(5,state) \
+/**/
+
+/*
+
+  Retrieve the current value tuple
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_GET_CURRENT_CHOICE(state) \
+    BOOST_PP_TUPLE_ELEM \
+        ( \
+        BOOST_VMD_SWITCH_STATE_GET_INDEX(state), \
+        BOOST_VMD_SWITCH_STATE_GET_CHOICES(state) \
+        ) \
+/**/
+
+/*
+
+  Expands to the state
+
+  value = value to compare against
+  tuple = choices as a tuple of values
+  size = size of tuple of values
+
+  None of these ever change in the WHILE state
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE_EXPAND(value,tuple,size) \
+    (value,tuple,0,size,(0,),(,)) \
+/**/
+
+/*
+
+  Expands to the WHILE state
+
+  The state to our WHILE consists of a tuple of elements:
+
+  1: value to compare against
+  2: tuple of values. Each value is a value/macro pair or if the default just a macro
+  3: index into the values
+  4: tuple for default macro. 0 means no default macro, 1 means default macro and then second value is the default macro.
+  5: tuple of result matched. Emptiness means no result yet specified, 0 means no match, 1 means match and second value is the matching macro.
+
+*/
+
+#define BOOST_VMD_SWITCH_STATE(value,...) \
+    BOOST_VMD_SWITCH_STATE_EXPAND \
+        ( \
+        value, \
+        BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__), \
+        BOOST_PP_VARIADIC_SIZE(__VA_ARGS__) \
+        ) \
+/**/
+
+/*
+
+  Sets the state upon a successful match.
+
+  macro = is the matching macro found
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_SUCCESS(d,state,macro) \
+    BOOST_PP_TUPLE_REPLACE_D \
+        ( \
+        d, \
+        state, \
+        BOOST_VMD_SWITCH_STATE_ELEM_RESULT, \
+        (1,macro) \
+        ) \
+/**/
+
+/*
+
+  Sets the state upon final failure to find a match.
+
+  def = default tuple macro, ignored
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_FAILURE(d,state,def) \
+    BOOST_PP_TUPLE_REPLACE_D \
+        ( \
+        d, \
+        state, \
+        BOOST_VMD_SWITCH_STATE_ELEM_RESULT, \
+        (0,) \
+        ) \
+/**/
+
+/*
+
+  Increments the state index into the tuple values
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_UPDATE_INDEX(d,state) \
+    BOOST_PP_TUPLE_REPLACE_D \
+        ( \
+        d, \
+        state, \
+        BOOST_VMD_SWITCH_STATE_ELEM_INDEX, \
+        BOOST_PP_INC(BOOST_VMD_SWITCH_STATE_GET_INDEX(state)) \
+        ) \
+/**/
+
+/*
+
+  Choose our current value's macro as our successful match
+
+  tuple = current tuple to test
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_MATCH(d,state,tuple) \
+    BOOST_VMD_SWITCH_OP_SUCCESS(d,state,BOOST_PP_TUPLE_ELEM(1,tuple)) \
+/**/
+
+/*
+
+  Update our state index
+
+  tuple = current tuple to test, ignored
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_UPDATE_INDEX(d,state,tuple) \
+    BOOST_VMD_SWITCH_OP_UPDATE_INDEX(d,state) \
+/**/
+
+/*
+
+  Test our current value against our value to compare against
+
+  tuple = current tuple to test
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE(d,state,tuple) \
+    BOOST_PP_IIF \
+        ( \
+        BOOST_VMD_EQUAL_D \
+            ( \
+            d, \
+            BOOST_VMD_SWITCH_STATE_GET_VALUE(state), \
+            BOOST_PP_TUPLE_ELEM(0,tuple) \
+            ), \
+        BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_MATCH, \
+        BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_UPDATE_INDEX \
+        ) \
+    (d,state,tuple)    \
+/**/
+
+/*
+
+  Set our default macro and update the index in our WHILE state
+
+  tuple = current tuple to test
+
+*/
+
+#if BOOST_VMD_MSVC
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT_NN(number,name) \
+    (number,name) \
+/**/
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT(d,state,tuple) \
+    BOOST_VMD_SWITCH_OP_UPDATE_INDEX \
+        ( \
+        d, \
+        BOOST_PP_TUPLE_REPLACE_D \
+            ( \
+            d, \
+            state, \
+            BOOST_VMD_SWITCH_STATE_ELEM_DEFAULT, \
+            BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT_NN(1,BOOST_PP_TUPLE_ENUM(tuple)) \
+            ) \
+        ) \
+/**/
+
+#else
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT(d,state,tuple) \
+    BOOST_VMD_SWITCH_OP_UPDATE_INDEX \
+        ( \
+        d, \
+        BOOST_PP_TUPLE_REPLACE_D \
+            ( \
+            d, \
+            state, \
+            BOOST_VMD_SWITCH_STATE_ELEM_DEFAULT, \
+            (1,BOOST_PP_TUPLE_ENUM(tuple)) \
+            ) \
+        ) \
+/**/
+
+#endif
+
+/*
+
+  If our current value is a default macro, just set the default macro,
+  else test our current value.
+
+  tuple = current tuple to test
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_TUPLE(d,state,tuple) \
+    BOOST_PP_IIF \
+        ( \
+        BOOST_PP_EQUAL_D \
+            ( \
+            d, \
+            BOOST_PP_TUPLE_SIZE(tuple), \
+            1 \
+            ), \
+        BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT, \
+        BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE \
+        ) \
+    (d,state,tuple) \
+/**/
+
+/*
+
+  Test the current value in our tuple of values
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_TEST_CURRENT(d,state) \
+    BOOST_VMD_SWITCH_OP_TEST_CURRENT_TUPLE \
+        ( \
+        d, \
+        state, \
+        BOOST_VMD_SWITCH_STATE_GET_CURRENT_CHOICE(state) \
+        ) \
+/**/
+
+/*
+
+  Choose the default macro as our successful match
+
+  def = default tuple consisting of just the default macro name
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_DEFAULT_RET_CHOSEN(d,state,def) \
+    BOOST_VMD_SWITCH_OP_SUCCESS \
+        ( \
+        d, \
+        state, \
+        BOOST_PP_TUPLE_ELEM(1,def) \
+        ) \
+/**/
+
+/*
+
+  If the default macro exists, choose it else indicate no macro was found
+
+  def = default tuple consisting of just the default macro name
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_DEFAULT_RET(d,state,def) \
+    BOOST_PP_IIF \
+        ( \
+        BOOST_PP_TUPLE_ELEM(0,def), \
+        BOOST_VMD_SWITCH_OP_DEFAULT_RET_CHOSEN, \
+        BOOST_VMD_SWITCH_OP_FAILURE \
+        ) \
+    (d,state,def) \
+/**/
+
+/*
+
+ Try to choose the default macro if it exists
+
+*/
+
+#define BOOST_VMD_SWITCH_OP_DEFAULT(d,state) \
+    BOOST_VMD_SWITCH_OP_DEFAULT_RET \
+        ( \
+        d, \
+        state, \
+        BOOST_VMD_SWITCH_STATE_GET_DEFAULT(state) \
+        ) \
+/**/
+
+/*
+
+  WHILE loop operation
+
+  Check for the next value match or try to choose the default if all matches have been checked
+
+*/
+
+#define BOOST_VMD_SWITCH_OP(d,state) \
+    BOOST_PP_IIF \
+        ( \
+        BOOST_PP_EQUAL_D \
+            (  \
+            d, \
+            BOOST_VMD_SWITCH_STATE_GET_INDEX(state), \
+            BOOST_VMD_SWITCH_STATE_GET_SIZE(state) \
+            ), \
+        BOOST_VMD_SWITCH_OP_DEFAULT, \
+        BOOST_VMD_SWITCH_OP_TEST_CURRENT \
+        ) \
+    (d,state) \
+/**/
+
+/*
+
+  WHILE loop predicate
+
+  Continue the WHILE loop if a result has not yet been specified
+
+*/
+
+#define BOOST_VMD_SWITCH_PRED(d,state) \
+    BOOST_VMD_IS_EMPTY \
+        ( \
+        BOOST_PP_TUPLE_ELEM \
+            ( \
+            0, \
+            BOOST_VMD_SWITCH_STATE_GET_RESULT(state) \
+            ) \
+        ) \
+/**/
+
+/*
+
+  Invokes the function-like macro
+
+  macro = function-like macro name
+  tparams = tuple of macro parameters
+
+*/
+
+#define BOOST_VMD_SWITCH_PROCESS_INVOKE_MACRO(macro,tparams) \
+    BOOST_PP_EXPAND(macro tparams) \
+/**/
+
+/*
+
+  Processes our WHILE loop result
+
+  callp = tuple of parameters for the called macro
+  result = tuple. The first tuple element is 0
+           if no macro has been found or 1 if a macro
+           has been found. If 1 the second element is
+           the name of a function-like macro
+
+*/
+
+#define BOOST_VMD_SWITCH_PROCESS(callp,result) \
+    BOOST_PP_EXPR_IIF \
+        ( \
+        BOOST_PP_TUPLE_ELEM(0,result), \
+        BOOST_VMD_SWITCH_PROCESS_INVOKE_MACRO \
+            ( \
+            BOOST_PP_TUPLE_ELEM(1,result), \
+            callp \
+            ) \
+        ) \
+/**/
+
+/*
+
+  Use BOOST_VMD_SWITCH_IDENTITY to pass a fixed value instead
+  of a function-like macro as the second element of
+  any tuple of the variadic parameters, or as the default
+  value, to BOOST_VMD_SWITCH.
+
+*/
+
+#if BOOST_VMD_MSVC
+#define BOOST_VMD_SWITCH_IDENTITY(item) BOOST_PP_CAT(BOOST_VMD_IDENTITY(item),)
+#else
+#define BOOST_VMD_SWITCH_IDENTITY BOOST_VMD_IDENTITY
+#endif
+
+/*
+
+  Switch macro
+
+  Parameters are:
+
+  value = value to compare against. May be any VMD data value.
+  callp = tuple of parameters for the called macro
+  variadic parameters = each parameter must be a tuple.
+    Each tuple consists of a two-element tuple. The first element is
+    a value, which may be any VMD data value, and the second element
+    is the name of a function-like macro to be called if the value
+    is equal to the value to compare against. For a default value
+    the tuple is a single-element tuple which contains the name of
+    a function-like macro to be called if no other value matches.
+
+*/
+
+#define BOOST_VMD_SWITCH(value,callp,...) \
+    BOOST_VMD_SWITCH_PROCESS \
+        ( \
+        callp, \
+        BOOST_VMD_SWITCH_STATE_GET_RESULT \
+            ( \
+            BOOST_PP_WHILE \
+                ( \
+                BOOST_VMD_SWITCH_PRED, \
+                BOOST_VMD_SWITCH_OP, \
+                BOOST_VMD_SWITCH_STATE(value,__VA_ARGS__) \
+                ) \
+            ) \
+        ) \
+/**/
+
+#endif /* BOOST_PP_VARIADICS */
+
+

+ The code is fairly involved but it is commented so that it can be understood. + There are a few workarounds for a VC++ preprocessor problem, which I discovered, + having to do with passing the name of a function-like macro in a tuple. +

+

+ The BOOST_VMD_SWITCH macro can be used with either macros to call or with fixed + values to return. When specifying macros to call the macro name is the second + element of the corresponding value-macro tuple, or in the 'default' case it + is just the macro name itself. When specifying fixed values to return the macro + 'name' is BOOST_VMD_SWITCH_IDENTITY(fixed_value), whether as the second element + of the corresponding value-macro tuple or as the macro 'name' of the 'default' + case. In the variadic parameters the user can mix macro names and fixed values + as he likes. +

+

+ Some simple examples: +

+
#define BOOST_VMD_SWITCH_TEST_1(number) \
+    test1_ ## number
+/**/
+
+#define BOOST_VMD_SWITCH_TEST_2(number) \
+    test2_ ## number
+/**/
+
+#define BOOST_VMD_SWITCH_TEST_3(number) \
+    test3_ ## number
+/**/
+
+#define BOOST_VMD_SWITCH_TEST_DEFAULT(number) \
+    test_default_ ## number
+/**/
+
+

+ We will use these simple macros in our calls to BOOST_VMD_SWITCH. +

+
BOOST_VMD_SWITCH(1,
+                (7),
+                (BOOST_VMD_SWITCH_TEST_DEFAULT),
+                (3,BOOST_VMD_SWITCH_TEST_3),
+                (1,BOOST_VMD_SWITCH_TEST_1),
+                (2,BOOST_VMD_SWITCH_TEST_2)
+                )
+
+

+ Here our macro will return 'test1_7'. +

+

+ Notice that 'cases' can be in any order. +

+
BOOST_VMD_SWITCH(4,
+                (7),
+                (BOOST_VMD_SWITCH_TEST_DEFAULT),
+                (2,BOOST_VMD_SWITCH_TEST_2),
+                (1,BOOST_VMD_SWITCH_TEST_1),
+                (3,BOOST_VMD_SWITCH_TEST_3)
+                )
+
+

+ Here are macro uses the default case and returns 'test_default_7'. +

+
BOOST_VMD_SWITCH(143,
+                (7),
+                (BOOST_VMD_SWITCH_TEST_DEFAULT),
+                (1,BOOST_VMD_SWITCH_TEST_1),
+                (2,BOOST_VMD_SWITCH_TEST_2),
+                (3,BOOST_VMD_SWITCH_TEST_3),
+                (143,BOOST_VMD_SWITCH_IDENTITY(55))
+                )
+
+

+ This shows how the matching case can be a fixed_value as the macro 'name'. +

+
BOOST_VMD_SWITCH(155,
+                (7),
+                (BOOST_VMD_SWITCH_IDENTITY(77)),
+                (1,BOOST_VMD_SWITCH_TEST_1),
+                (2,BOOST_VMD_SWITCH_TEST_2),
+                (3,BOOST_VMD_SWITCH_TEST_3),
+                (143,BOOST_VMD_SWITCH_IDENTITY(55))
+                )
+
+

+ This shows how the default value can be a fixed_value as the macro 'name'. +

+
BOOST_VMD_SWITCH(BOOST_VMD_TYPE_TUPLE,
+                (7),
+                (BOOST_VMD_SWITCH_TEST_DEFAULT),
+                (BOOST_VMD_TYPE_TUPLE,BOOST_VMD_SWITCH_TEST_1),
+                ((1,2,3),BOOST_VMD_SWITCH_TEST_3),
+                (2,BOOST_VMD_SWITCH_TEST_2)
+                )
+
+

+ This shows that the 'value' and each 'case' matching values can be different + data types just as long as the types are one which VMD can parse. +

+

+ There is more that can be done with the BOOST_VMD_SWITCH code but as it is + I believe it could be useful for programmers writing macro code. For instance + there is no checking that more than one 'case' value is the same. We could + generate a BOOST_VMD_ASSERT if that were the situation. There is no concept + of falling through to the next 'case' as their is when 'break' is not used + at the bottom of a particular C++ 'case' statement. Nonetheless the example + gives the macro programmer an idea of what can be done using the BOOST_VMD_EQUAL + macro in treating data types generically, using BOOST_VMD_IS_EMPTY to test + for emptiness and using BOOST_VMD_IDENTITY to generate a fixed value when a + macro call is made. +

+

+ + TTI + inner template +

+

+ As a more practical example, just to show the possible use of VMD functionality + in current Boost code, I will briefly illustrate a change that could be made + to the TTI library when using VMD functionality. +

+

+ The Boost TTI library, of which the current developer of VMD is also the developer, + specifies a way to introspect an inner class template of a class. The introspection + can occur for an inner class template of specific template parameters. +

+

+ In the library a macro is used to generate the metafunction which allows the + introspection to work. The macro used is called BOOST_TTI_TEMPLATE. The macro + has both a variadic version and a non-variadic version. +

+

+ In the non-variadic version the macro always takes two parameters for introspecting + for specific template parameters. The first parameter is the name of the template + and the second parameter is an array of the specific template parameters ( + with or without the parameter names themselves ). So for a class template of + the form: +

+
template <class X,int Y> class MyTemplate { ... code };
+
+

+ the non-variadic macro would be: +

+
BOOST_TTI_TEMPLATE(MyTemplate,(2,(class,int))) // uses array
+
+

+ I chose a Boost PP array rather than a Boost PP seq or a Boost PP list as I + felt the notation for specifying the template parameters was closer with the + array than with the others. Choosing a Boost PP tuple was not an option since + for non-variadic macros there is no way to automatically know the tuple size, + so an array was preferred. +

+

+ For the variadic version variadic parameters are used so the notation would + be: +

+
BOOST_TTI_TEMPLATE(MyTemplate,class,int) // uses variadic parameters
+
+

+ since this is the most natural notation. +

+

+ But for compatibility with the non-variadic version the end-user with variadic + macro support could also choose the Boost PP array form above. +

+

+ Using VMD the variadic version could support any of the other Boost PP composite + types for the specific template parameters, even though I feel that the variadic + parameters form is easiest to use. In this scenario a user could specify: +

+
BOOST_TTI_TEMPLATE(MyTemplate,(class,(int,BOOST_PP_NIL))) // use a list
+
+

+ or +

+
BOOST_TTI_TEMPLATE(MyTemplate,(class)(int)) // use a seq
+
+

+ or +

+
BOOST_TTI_TEMPLATE(MyTemplate,(class,int)) // use a tuple
+
+

+ The only change needed would be in the code which takes the second parameter + and converts it to the final form used internally ( a Boost PP array ). This + occurs in the macro BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS in + the <boost/tti/detail/dtemplate_params.hpp> file. The code has two situations, + one for VC++8 or below and one for all other compilers. For our example we + will concentrate just on the one for all other compilers. You do not need to + know what the code does internally to complete the creation of the appropriate + metafunction to follow this example. The macro code in question looks like + this: +

+
#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \
+  BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \
+    ( \
+      ( BOOST_PP_ADD(BOOST_PP_ARRAY_SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ARRAY_ENUM(tpArray) ) )  \
+    ) \
+/**/
+
+

+ In this code we are taking the name of the metafunction ( trait ), the name + of the template ( name ), and our specific template parameters ( tpArray ) + and passing the information in the form of a Boost PP array to another macro, + which will eventually create the metafunction which the end-user uses to test + if such a class template exists within some enclosing class. Even if tpArray + were a list, seq, or tuple we still want to pass the information internally + to BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE in the form you can see + above, which is a Boost PP array. We don't need or want to change that internal + representation. +

+

+ The current code, used by both the non-variadic and variadic version of the + BOOST_TTI_TEMPLATE template, assumes the 'tpArray' parameter is a Boost PP + array. But if it could be a tuple, seq, or list in the variadic version the + code could become, with the appropriate Boost PP and VMD header files: +

+
#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/array/enum.hpp>
+#include <boost/preprocessor/array/size.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/list/enum.hpp>
+#include <boost/preprocessor/list/size.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/tuple/enum.hpp>
+#include <boost/preprocessor/tuple/size.hpp>
+#include <boost/vmd/identity.hpp>
+#include <boost/vmd/is_array.hpp>
+#include <boost/vmd/is_list.hpp>
+#include <boost/vmd/is_seq.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+#if BOOST_PP_VARIADICS
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \
+  BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \
+    ( \
+      BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT \
+        ( \
+        trait,name,tpArray, \
+        BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE(tpArray) \
+        ) \
+    ) \
+/**/
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE(tpArray) \
+  BOOST_VMD_IDENTITY_RESULT \
+    ( \
+      BOOST_PP_IIF \
+        ( \
+        BOOST_VMD_IS_ARRAY(tpArray), \
+        BOOST_VMD_IDENTITY(ARRAY), \
+        BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_LIST \
+        ) \
+      (tpArray) \
+    ) \
+/**/
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_LIST(tpArray) \
+  BOOST_VMD_IDENTITY_RESULT \
+    ( \
+      BOOST_PP_IIF \
+        ( \
+        BOOST_VMD_IS_LIST(tpArray), \
+        BOOST_VMD_IDENTITY(LIST), \
+        BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_SEQ \
+        ) \
+      (tpArray) \
+    ) \
+/**/
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_SEQ(tpArray) \
+  BOOST_VMD_IDENTITY_RESULT \
+    ( \
+      BOOST_PP_IIF \
+        ( \
+        BOOST_VMD_IS_SEQ(tpArray), \
+        BOOST_VMD_IDENTITY(SEQ), \
+        BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_TUPLE \
+        ) \
+      (tpArray) \
+    ) \
+/**/
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_TUPLE(tpArray) \
+  BOOST_VMD_IDENTITY_RESULT \
+    ( \
+      BOOST_PP_EXPR_IIF \
+        ( \
+        BOOST_VMD_IS_TUPLE(tpArray), \
+        BOOST_VMD_IDENTITY(TUPLE) \
+        ) \
+    ) \
+/**/
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT(trait,name,tpArray,name) \
+  ( BOOST_PP_ADD(BOOST_PP_ ## name ## _SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ ## name ## _ENUM(tpArray) ) )  \
+/**/
+
+#else
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \
+  BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \
+    ( \
+      ( BOOST_PP_ADD(BOOST_PP_ARRAY_SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ARRAY_ENUM(tpArray) ) )  \
+    ) \
+/**/
+
+#endif
+
+

+ This of course gets more elaborate, but could be shortened considerably if + we chose to use BOOST_VMD_GET_TYPE and the invented BOOST_VMD_SWITCH of our + first example. We will assume in this second version of the code above that + our BOOST_VMD_SWITCH macro has been #included from somewhere. +

+
#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/array/enum.hpp>
+#include <boost/preprocessor/array/size.hpp>
+#include <boost/preprocessor/list/enum.hpp>
+#include <boost/preprocessor/list/size.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/tuple/enum.hpp>
+#include <boost/preprocessor/tuple/size.hpp>
+#include <boost/vmd/get_type.hpp>
+
+#if BOOST_PP_VARIADICS
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \
+  BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \
+    ( \
+      BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT \
+        ( \
+        trait,name,tpArray, \
+        BOOST_VMD_SWITCH \
+          ( \
+          BOOST_VMD_GET_TYPE(tpArray), \
+          (1), \
+          (BOOST_VMD_TYPE_ARRAY,BOOST_VMD_SWITCH_IDENTITY(ARRAY)), \
+          (BOOST_VMD_TYPE_LIST,BOOST_VMD_SWITCH_IDENTITY(LIST)), \
+          (BOOST_VMD_TYPE_SEQ,BOOST_VMD_SWITCH_IDENTITY(SEQ)), \
+          (BOOST_VMD_TYPE_TUPLE,BOOST_VMD_SWITCH_IDENTITY(TUPLE)) \
+          ) \
+        ) \
+    ) \
+/**/
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT(trait,name,tpArray,name) \
+  ( BOOST_PP_ADD(BOOST_PP_ ## name ## _SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ ## name ## _ENUM(tpArray) ) )  \
+/**/
+
+#else
+
+#define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \
+  BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \
+    ( \
+      ( BOOST_PP_ADD(BOOST_PP_ARRAY_SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ARRAY_ENUM(tpArray) ) )  \
+    ) \
+/**/
+
+#endif
+
+

+ This is shorter and easier to understand. The '(1)' passed as the calling values + to BOOST_VMD_SWITCH could just as well be '()' but VC8 has trouble with empty + parentheses so I avoid it here. +

+

+ In the case of the TTI, is such a change worth it to give more flexibility + to the end-user ? In reality, because the variadic version of passing the specific + template parameters as variadic data is syntactically easier to use than any + of the Boost PP composite forms, I am actually happy enough with that use not + to pursue the sort of functionality I presented in this example. But the example + nonetheless shows the power of the VMD functionality for creating macros which + add flexibility when the macro programmer feels he needs it for his library. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic.html new file mode 100644 index 0000000000000000000000000000000000000000..735d3879362c8783ee64f2ae5a83bcb2e479efe3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic.html @@ -0,0 +1,510 @@ + + + +Generic macros for working with data types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Besides the specific macros for working with data types VMD has a number of + generic macros for parsing sequences. +

+
+ + +

+ In the normal use of Boost PP data is passed as arguments to a macro in discrete + units so that each parameter expects a single data type. A typical macro + might be: +

+
#define AMACRO(anumber,atuple,anidentifier) someoutput
+
+

+ where the 'atuple', having the form of ( data1, data2, data3 ), itself may + contain different data types of elements. +

+

+ This is the standard macro design and internally it is the easiest way to + pass macro data back and forth. The Boost PP library has a rich set of functionality + to deal with all of its high-level data types, and variadic data, with its + own simpler functionality, also offers another alternative to representing + data. +

+

+ Occasionally designers of macros, especially for the use of others programmers + within a particular library, have expressed the need for a macro parameter + to allow a more C/C++ like syntax where a single parameter might mimic a + C++ function-call or a C-like type modification syntax, or some other more + complicated construct. Something along the lines of: +

+
areturn afunction ( aparameter1, aparameter2, aparameter3 )
+
+

+ or +

+
( type ) data
+
+

+ etc. etc. +

+

+ In other words, from a syntactical level when designing possible macro input, + is it possible to design parameter data to look more like C/C++ when macros + are used in a library and still do a certain amount of preprocessor metaprogramming + with such mixed token input ? +

+

+ VMD has functionality which allows more than one type of preprocessing token, + excluding an 'empty' token which always refers to some entire input, to be + part of a single parameter of input data. These preprocessing tokens as a + single parameter are syntactically a consecutive series of data. The single + limitation of this consecutive series of data is that each top-level part + of the data of this series is of some VMD data type. What this means is that + if some input consists of a series of data types it is possible to extract + the data for each data type in that series. +

+

+ In practicality what this means is that, given the examples just above, if + 'areturn', 'afunction', and 'data' are identifiers it would be possible to + parse either of the two inputs above so that one could identify the different + data types involved and do preprocessor metaprogramming based on those results. +

+
+ + Sequence + definition +
+

+ I will be calling such input data, which consists of all top-level data types + in a series, by the term of a 'sequence'. Each separate data type in the + sequence is called an 'element'. In this definition of a 'sequence' we can + have 0 or more elements, so that a sequence is a general name for any VMD + input. A sequence is therefore any input VMD can parse, whether it is emptiness, + a single element, or more than one element in a series. Therefore when we + speak of VMD macros parsing input data we are really speaking of VMD macros + parsing a sequence. A sequence can therefore also be part of a Boost PP composite + data type, or variadic data, and VMD can still parse such an embedded sequence + if asked to do so. +

+
+ + Sequence + parsing +
+

+ Parsing a sequence means that VMD can step through each element of a sequence + sequentially, determine the type and data of each element, then move on to + the next element. Parsing is sequential and can only be done in a forward + direction, but it can be done any number of times. In C++ iterator terms + parsing of a sequence is a forward iterator. +

+

+ Working with a sequence is equivalent to using VMD macros 'generically'. +

+

+ Before I give an explanation of how to use a sequence using VMD generic functionality + I would like to make two points: +

+
    +
  • + The possibility of working with a sequence which contains more than one + data type can be easily abused. In general keeping things simple is usually + better than making things overly complicated when it comes to the syntactical + side of things in a computer language. A macro parameter syntactical + possibility has to be understandable to be used. +
  • +
  • + Using VMD to parse the individual data types of a sequence takes more + preprocessing time than functionality offered with Boost PP data types, + because it is based on forward access through each top-level type of + the sequence. +
  • +
+

+ The one constraint in a sequence is that the top-level must consist of VMD + data types, in other words preprocessor tokens which VMD understands. By + top-level it is meant that a Boost PP composite data may have elements which + VMD cannot parse but as long as the input consists of the composite data + types and not the inner unparsable elements, VMD can parse the input. Therefore + if preprocessor data is one of the examples above, you will be successful + in using VMD. However if your preprocessor data takes the form of: +

+
&name identifier ( param )
+
+

+ or +

+
identifier "string literal"
+
+

+ or +

+
identifier + number
+
+

+ or +

+
identifier += 4.3
+
+

+ etc. etc. +

+

+ you will not be able to parse the data using VMD since '&', "string + literal", '+', '+=', and "4.3" are preprocessor tokens which + are not VMD top-level data types and therefore VMD cannot handle them at + the parsing level. You can still of course pass such data as preprocessing + input to macros but you cannot use VMD to recognize the parts of such data. +

+

+ This is similar to the fact that VMD cannot tell you what type preprocessor + data is as a whole, using any of the VMD identifying macros already discussed, + if the type is not one that VMD can handle. +

+

+ On the other hand you can still use VMD to parse such tokens in the input + if you use Boost PP data types as top-level data types to do so. Such as: +

+
( &name ) identifier ( param )
+
+

+ or +

+
identifier ( "string literal" )
+
+

+ or +

+
identifier ( + ) number
+
+

+ or +

+
identifier ( += ) 4 ( . ) 3
+
+

+ The succeeding topics explain the VMD functionality for parsing a sequence + for each individual VMD data type in that sequence. +

+
+ + Sequence + types +
+

+ A VMD sequence can be seen as one of either three general types: +

+
    +
  1. + An empty sequence +
  2. +
  3. + A single element sequence +
  4. +
  5. + A multi-element sequence +
  6. +
+

+ An empty sequence is merely input that is empty, what VMD calls "emptiness". + Use the previously explained BOOST_VMD_IS_EMPTY macro to test for an empty + sequence. +

+
#include <boost/vmd/is_empty.hpp>
+
+#define AN_EMPTY_SEQUENCE
+
+BOOST_VMD_IS_EMPTY(AN_EMPTY_SEQUENCE) will return 1
+
+

+ The type of an empty sequence is BOOST_VMD_TYPE_EMPTY. +

+

+ A single element sequence is a single VMD data type. This is what we have + been previously discussing as data which VMD can parse in this documentation + with our identifying macros. You can use the BOOST_VMD_IS_UNARY macro to + test for a single element sequence. +

+
#include <boost/vmd/is_unary.hpp>
+
+#define A_SINGLE_ELEMENT_SEQUENCE (1,2)
+
+BOOST_VMD_IS_UNARY(A_SINGLE_ELEMENT_SEQUENCE) will return 1
+
+

+ The type of a single element sequence is the type of the individual data + type. In our example above the type of A_SINGLE_ELEMENT_SEQUENCE is BOOST_VMD_TYPE_TUPLE. +

+

+ A multi-element sequence consists of more than one data type. This is the + "new" type which VMD can parse. You can use the BOOST_VMD_IS_MULTI + macro to test for a multi-element sequence. +

+
#define A_MULTI_ELEMENT_SEQUENCE (1,2) (1)(2) 45
+
+

+ The A_MULTI_ELEMENT_SEQUENCE consists of a tuple followed by a seq followed + by a number. +

+
#include <boost/vmd/is_multi.hpp>
+
+BOOST_VMD_IS_MULTI(A_MULTI_ELEMENT_SEQUENCE) will return 1
+
+

+ The type of a multi-element sequence is always BOOST_VMD_TYPE_SEQUENCE. +

+

+ The type of a sequence can be obtained generically with the BOOST_VMD_GET_TYPE + macro. We will be explaining this further in the documentation. +

+
+ + Sequence + size +
+

+ The size of any sequence can be accessed using the BOOST_VMD_SIZE macro. + For an empty sequence the size is always 0. For a single element sequence + the size is always 1. For a multi-element sequence the size is the number + of individual top-level data types in the sequence. +

+
#include <boost/vmd/size.hpp>
+
+BOOST_VMD_SIZE(AN_EMPTY_SEQUENCE) will return 0
+BOOST_VMD_SIZE(A_SINGLE_ELEMENT_SEQUENCE) will return 1
+BOOST_VMD_SIZE(A_MULTI_ELEMENT_SEQUENCE) will return 3
+
+
+ + Using + VMD to parse sequence input +
+

+ For a VMD sequence essentially two ways of parsing into individual data types + are offered by the VMD library: +

+
    +
  1. + The sequence can be converted to any of the Boost PP data types, or to + variadic data, where each individual data type in the sequence becomes + a separate element of the particular composite data type chosen. The + conversion to a particular Boost PP data type or variadic data is slow, + because it is based on forward access through each top-level type of + the sequence, but afterwards accessing any individual element is as fast + as accessing any element in the Boost PP data type or among variadic + data. +
  2. +
  3. + The sequence can be accessed directly through its individual elements. + This is slower than accessing an element of a Boost PP data type or variadic + data but offers conceptual access to the original sequence as a series + of elements. +
  4. +
+

+ These two techniques will be discussed in succeeding topics. +

+
+ +

+ The easiest way to work with a sequence is to convert it to a Boost PP + data type. Likewise you can also convert a sequence to variadic data even + though the Boost PP data types have much greater functionality than variadic + data in Boost PP. +

+

+ To convert a sequence to a Boost PP data type or variadic data the macros + to be used are: +

+
    +
  • + BOOST_VMD_TO_ARRAY(sequence) to convert the sequence to an array +
  • +
  • + BOOST_VMD_TO_LIST(sequence) to convert the sequence to a list +
  • +
  • + BOOST_VMD_TO_SEQ(sequence) to convert the sequence to a seq +
  • +
  • + BOOST_VMD_TO_TUPLE(sequence) to convert the sequence to a tuple +
  • +
  • + BOOST_VMD_ENUM(sequence) to convert the sequence to variadic data +
  • +
+

+ After the conversion the elements of a sequence become the elements of + the corresponding composite data type. +

+

+ Once the elements of the sequence have been converted to the elements of + the composite data type the full power of that composite data type can + be used to process each element. Furthermore the programmer can use VMD + to discover the type of an individual element for further processing. +

+

+ For single element sequences the result is always a single element composite + data type. For multi-element sequences the result is always a composite + data type of more than one element. +

+

+ For a sequence that is empty the result is emptiness when converting to + a seq, tuple, or variadic data; the result is an empty array or list when + converting to each of those composite data types respectively. +

+
#include <boost/vmd/enum.hpp>
+#include <boost/vmd/to_array.hpp>
+#include <boost/vmd/to_list.hpp>
+#include <boost/vmd/to_seq.hpp>
+#include <boost/vmd/to_tuple.hpp>
+
+#define BOOST_VMD_REGISTER_ANID (ANID)
+
+#define SEQUENCE_EMPTY
+#define SEQUENCE_SINGLE 35
+#define SEQUENCE_SINGLE_2 ANID
+#define SEQUENCE_MULTI (0,1) (2)(3)(4)
+#define SEQUENCE_MULTI_2 BOOST_VMD_TYPE_SEQ (2,(5,6))
+
+BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY) will return an empty array '(0,())'
+BOOST_VMD_TO_LIST(SEQUENCE_SINGLE) will return a one-element list '(35,BOOST_PP_NIL)'
+BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_2) will return a one-element seq '(ANID)'
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI) will return a multi-element tuple '((0,1),(2)(3)(4))'
+BOOST_VMD_ENUM(SEQUENCE_MULTI_2) will return multi-element variadic data 'BOOST_VMD_TYPE_SEQ,(2,(5,6))'
+
+
+ + Usage +
+

+ You can use the general header file: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or you can use individual header files for each of these macros. The individual + header files are: +

+
#include <boost/vmd/to_array.hpp> //  for the BOOST_VMD_TO_ARRAY macro
+#include <boost/vmd/to_list.hpp> //  for the BOOST_VMD_TO_LIST macro
+#include <boost/vmd/to_seq.hpp> //  for the BOOST_VMD_TO_SEQ macro
+#include <boost/vmd/to_tuple.hpp> // for the BOOST_VMD_TO_TUPLE macro.
+#include <boost/vmd/enum.hpp> // for the BOOST_VMD_ENUM macro.
+
+
+
+ +

+ It is possible to access an individual element of a sequence. The macro + to do this is called BOOST_VMD_ELEM. The macro takes two required parameters. + The required parameters are the element number to access and the sequence, + in that order. The element number is a 0-based number and its maximum value + should be one less than the size of the sequence. +

+

+ The BOOST_VMD_ELEM macro returns the actual sequence element. If the first + required parameter is greater or equal to the size of the sequence the + macro returns emptiness. Because of this using BOOST_VMD_ELEM on an empty + sequence, whose size is 0, always returns emptiness. +

+
#include <boost/vmd/elem.hpp>
+
+#define BOOST_VMD_REGISTER_ANAME (ANAME)
+#define A_SEQUENCE (1,2,3) 46 (list_data1,(list_data2,BOOST_PP_NIL)) BOOST_VMD_TYPE_SEQ ANAME
+#define AN_EMPTY_SEQUENCE
+
+BOOST_VMD_ELEM(0,A_SEQUENCE) will return (1,2,3)
+BOOST_VMD_ELEM(1,A_SEQUENCE) will return 46
+BOOST_VMD_ELEM(2,A_SEQUENCE) will return (list_data1,(list_data2,BOOST_PP_NIL))
+BOOST_VMD_ELEM(3,A_SEQUENCE) will return BOOST_VMD_TYPE_SEQ
+BOOST_VMD_ELEM(4,A_SEQUENCE) will return ANAME
+
+BOOST_VMD_ELEM(5,A_SEQUENCE) will return emptiness
+BOOST_VMD_ELEM(0,AN_EMPTY_SEQUENCE) will return emptiness
+
+

+ Accessing an element of a sequence directly is slower than accessing an + element of a Boost PP data type or even variadic data, since each access + has to directly cycle through each element of the sequence to get to the + one being accessed. The process of sequentially parsing each element again + each time is slower than accessing a Boost PP data type element. +

+
+ + Usage +
+

+ You can use the general header file: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or you can use the individual header file: +

+
#include <boost/vmd/elem.hpp>
+
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic/vmd_assert.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic/vmd_assert.html new file mode 100644 index 0000000000000000000000000000000000000000..02ead7517b8b3806f6c0c42b48fab64bda77d9ff --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic/vmd_assert.html @@ -0,0 +1,254 @@ + + + +Testing for equality and inequality + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ VMD allows the programmer to test generically for the equality or inequality + of any value which VMD can parse. This includes emptiness, identifiers, numbers, + types, arrays, lists, seqs, tuples, and multi-element sequences. +

+

+ The macro to test for equality is called BOOST_VMD_EQUAL and it has two required + parameters which are the two values against which to test. The values can + be any VMD data type. +

+

+ For the composite data types of array, list, seq, and tuple, or any of those + types in a multi-element sequence, the elements of those types must also + be a data type which VMD can parse. BOOST_VMD_EQUAL recursively parses the + elements in a composite data type for equality, up to a level of 16 inner + types, to test that one composite type equals another composite type. The + requirement, that composite elements must also be a data type which VMD can + parse, is different from most other macros in the VMD library, where only + the top-level composite type need be parsed enough to determine the type + of the data. If BOOST_VMD_EQUAL encounters a data type which it cannot parse + the result will be UB. +

+

+ VMD identifiers used in equality testing must be registered and pre-detected. + All numbers and v-types are already registered/pre-detected for equality + testing so it is only user-defined identifiers which must be registered and + pre-detected. If an identifier has not been both registered and predetected + it will never be equal to the same identifier value, so it will always fail + equality testing, although it will not give a preprocessing error doing so. +

+

+ The BOOST_VMD_EQUAL macro returns 1 if both parameters are equal and 0 if + the parameters are not equal. +

+

+ Conversely to test for inequality, of the same values as are required in + testing for equality, the VMD library has the macro BOOST_VMD_NOT_EQUAL. + This macro is simply a complement of the BOOST_VMD_EQUAL macro. If BOOST_VMD_EQUAL + returns 1 then BOOST_VMD_NOT_EQUAL returns 0 and if BOOST_VMD_EQUAL returns + 0 then BOOST_VMD_NOT_EQUAL returns 1. +

+

+ The BOOST_VMD_EQUAL and BOOST_VMD_NOT_EQUAL macros are called "equality + macros". +

+
#include <boost/vmd/equal.hpp>
+
+#define BOOST_VMD_REGISTER_AN_ID1 (AN_ID1)
+#define BOOST_VMD_REGISTER_AN_ID2 (AN_ID2)
+
+#define BOOST_VMD_DETECT_AN_ID1_AN_ID1
+#define BOOST_VMD_DETECT_AN_ID2_AN_ID2
+
+#define AN_IDENTIFIER1 AN_ID1
+#define AN_IDENTIFIER2 AN_ID2
+#define AN_IDENTIFIER3 AN_ID1 // same as AN_IDENTIFIER1 = AN_ID1
+
+#define A_NUMBER1 33
+#define A_NUMBER2 145
+#define A_NUMBER3 33 // same as A_NUMBER1 = 33
+
+#define A_TUPLE1 (AN_IDENTIFIER1,A_NUMBER1)
+#define A_TUPLE2 (AN_IDENTIFIER1,A_NUMBER2)
+#define A_TUPLE3 (AN_IDENTIFIER3,A_NUMBER3) // same as A_TUPLE1 = (AN_ID1,33)
+
+#define A_SEQ1 (A_NUMBER1)(A_TUPLE1)
+#define A_SEQ2 (A_NUMBER2)(A_TUPLE2)
+#define A_SEQ3 (A_NUMBER3)(A_TUPLE3) // same as A_SEQ1 = (33)((AN_ID1,33))
+
+BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER2) will return 0
+BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3) will return 1
+
+BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER2) will return 0
+BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3) will return 1
+
+BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2) will return 0
+BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3) will return 1
+
+BOOST_VMD_EQUAL(A_SEQ1,A_SEQ2) will return 0
+BOOST_VMD_EQUAL(A_SEQ1,A_SEQ3) will return 1
+
+

+ When BOOST_VMD_EQUAL tests for equality it always parses data for their most + specific types. The reason for this is that a valid tuple, which is also + an invalid list or array, can never be compared completely because all elements + of that tuple are not data types which VMD can parse. Therefore VMD always + tests equality based on the most specific type for any value being tested, + which speeds up testing for the more specific tuple data types such as lists + and arrays. +

+
#define TUPLE_IS_ARRAY1 (2,(3,4))
+#define TUPLE_IS_ARRAY2 (2,(4,5))
+#define TUPLE_IS_ARRAY3 (2,(3,4))
+
+#define TUPLE_IS_LIST1 (55,BOOST_PP_NIL)
+#define TUPLE_IS_LIST2 (135,BOOST_PP_NIL)
+#define TUPLE_IS_LIST3 (55,BOOST_PP_NIL)
+
+#define TUPLE_IS_LIST_OR_ARRAY1 (2,(3,BOOST_PP_NIL))
+#define TUPLE_IS_LIST_OR_ARRAY2 (2,(4,BOOST_PP_NIL))
+#define TUPLE_IS_LIST_OR_ARRAY3 (2,(3,BOOST_PP_NIL))
+
+#define TUPLE_BUT_INVALID_ARRAY1 (&2,(3,4))
+#define TUPLE_BUT_INVALID_ARRAY2 (&2,(4,4))
+#define TUPLE_BUT_INVALID_ARRAY3 (&2,(3,4))
+
+#define TUPLE_BUT_INVALID_LIST1 (55,^BOOST_PP_NIL)
+#define TUPLE_BUT_INVALID_LIST2 (135,^BOOST_PP_NIL)
+#define TUPLE_BUT_INVALID_LIST3 (55,^BOOST_PP_NIL)
+
+

+ All of the constructs above are valid tuples. +

+

+ The first three are valid arrays, so they will be parsed and compared as + arrays, so that they can be used as in: +

+
#include <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL(TUPLE_IS_ARRAY1,TUPLE_IS_ARRAY2) will return 0
+BOOST_VMD_EQUAL(TUPLE_IS_ARRAY1,TUPLE_IS_ARRAY3) will return 1
+
+

+ The next three are valid lists, so they will be parsed and compared as lists, + so that they can be used as in: +

+
#include <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL(TUPLE_IS_LIST1,TUPLE_IS_LIST2) will return 0
+BOOST_VMD_EQUAL(TUPLE_IS_LIST1,TUPLE_IS_LIST3) will return 1
+
+

+ The next three are valid lists or arrays but will be parsed as lists because + lists are more specific than arrays. They can be used as in: +

+
#include <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL(TUPLE_IS_LIST_OR_ARRAY1,TUPLE_IS_LIST_OR_ARRAY2) will return 0
+BOOST_VMD_EQUAL(TUPLE_IS_LIST_OR_ARRAY1,TUPLE_IS_LIST_OR_ARRAY3) will return 1
+
+

+ The next three are valid tuples but invalid arrays. The BOOST_VMD_EQUAL macro + attempts to parse them as the most specific type they can be, which is an + array. But the attempt to parse them as arrays will lead to UB because the + number which signifies the size of the array is invalid as a number. Now + let us suppose we should parse them as the less specific type of a tuple + instead of as an array. This will still give UB if we will attempt to compare + the first tuple element against a corresponding first tuple element of another + tuple, and when we do will again encounter UB because it is not a data type + VMD can parse. +

+
#include <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_ARRAY1,TUPLE_BUT_INVALID_ARRAY1) will generate UB
+BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_ARRAY1,TUPLE_BUT_INVALID_ARRAY1) will generate UB
+
+

+ The next three are valid tuples but invalid lists. The BOOST_VMD_EQUAL macro + attempts to parse them as the most specific type they can be, which is a + list. But the attempt to parse them as lists will lead to UB because the + identifier which signifies the end-of-list is invalid as an identifier. Now + let us suppose we should parse them as the less specific type of a tuple + instead of as a list. This will still give UB if we will attempt to compare + the second tuple element against a corresponding second tuple element of + another tuple, and when we do will again encounter UB because it is not a + data type VMD can parse. +

+
#include <boost/vmd/equal.hpp>
+
+BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_LIST1,TUPLE_BUT_INVALID_LIST2) will generate UB
+BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_LIST1,TUPLE_BUT_INVALID_LIST3) will generate UB
+
+

+ It is possible that a composite data type which has an element which VMD + cannot parse will not give UB when compared for equality, but rather just + the test for equality will fail. This can occur if the algorithm which tests + for equality tests false before parsing of the particular element. Such a + situation might be: +

+
#include <boost/vmd/equal.hpp>
+
+#define A_TUPLE1 (3,4,"astring")
+#define A_TUPLE2 (3,4)
+
+BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2) will return 0 rather than generate UB
+
+

+ The reason the above correctly returns 0, rather than generate UB when VMD + attempts to parse '"astring"', which is not a data type VMD can + parse, is because the algorithm for testing equality tests whether or not + the tuples have the same number of elements before it tests for the equality + of each element. This is just one example where testing for equality may + fail before UB is generated when BOOST_VMD_EQUAL attempts to parse a data + type which it cannot handle. Nevertheless the general rule should still be + considered that for BOOST_VMD_EQUAL/BOOT_VMD_NOT_EQUAL all data types, even + an element of a composite data type, must be a VMD data type if the macro + is to work properly, else UB could occur. +

+
+ + Usage +
+

+ You can use the general header file: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or you can use the individual header files: +

+
#include <boost/vmd/equal.hpp> for the BOOST_VMD_EQUAL macro
+#include <boost/vmd/not_equal.hpp> for the BOOST_VMD_NOT_EQUAL macro
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic/vmd_convert_sequence.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic/vmd_convert_sequence.html new file mode 100644 index 0000000000000000000000000000000000000000..6d36087555ede0427a4b9f405092b44a4f26804a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_generic/vmd_convert_sequence.html @@ -0,0 +1,98 @@ + + + +Getting the type of data + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ VMD has the ability to retrieve the type of any data which it can parse, + which means any VMD sequence. The macro to do this is called BOOST_VMD_GET_TYPE + and it takes a single required parameter, which is a VMD sequence. +

+

+ It returns one of the types previously discussed when introducing v-types + as an identifier subset. As explained previously in that topic a v-type is + fully recognized by VMD macros and can be part of a sequence and passed as + VMD data just like all the other data types VMD recognizes. +

+

+ When BOOST_VMD_GET_TYPE returns the type of data it returns by default the + most specific type that the data can be. This means that non-empty lists + and arrays are returned as such, not as tuples, and numbers and types and + empty lists are returned as such, not as identifiers. +

+
#include <boost/vmd/get_type.hpp>
+
+#define BOOST_VMD_REGISTER_ANID (ANID)
+#define SEQUENCE_EMPTY
+#define SEQUENCE_MULTI (1,2,3) 88
+#define SEQUENCE1 (3,(1,2,3))
+#define SEQUENCE2 ANID
+#define SEQUENCE3 (1,(2,(3,BOOST_PP_NIL)))
+#define SEQUENCE4 1
+#define SEQUENCE5 (1)(2)(3)
+#define SEQUENCE6 (1,2,3)
+#define SEQUENCE7 BOOST_VMD_TYPE_NUMBER
+
+BOOST_VMD_GET_TYPE(SEQUENCE_EMPTY) will return BOOST_VMD_TYPE_EMPTY
+BOOST_VMD_GET_TYPE(SEQUENCE_MULTI) will return BOOST_VMD_TYPE_SEQUENCE
+BOOST_VMD_GET_TYPE(SEQUENCE1) will return BOOST_VMD_TYPE_ARRAY
+BOOST_VMD_GET_TYPE(SEQUENCE2) will return BOOST_VMD_TYPE_IDENTIFIER
+BOOST_VMD_GET_TYPE(SEQUENCE3) will return BOOST_VMD_TYPE_LIST
+BOOST_VMD_GET_TYPE(SEQUENCE4) will return BOOST_VMD_TYPE_NUMBER
+BOOST_VMD_GET_TYPE(SEQUENCE5) will return BOOST_VMD_TYPE_SEQ
+BOOST_VMD_GET_TYPE(SEQUENCE6) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(SEQUENCE7) will return BOOST_VMD_TYPE_TYPE
+
+
+ + Usage +
+

+ You can use the general header file: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or you can use the individual header file: +

+
#include <boost/vmd/get_type.hpp>
+
+

+ for the BOOST_VMD_GET_TYPE macro. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_history.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_history.html new file mode 100644 index 0000000000000000000000000000000000000000..e945545c83934873b1c1a2fd9620109db5e9c579 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_history.html @@ -0,0 +1,314 @@ + + + +History + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Version 1.9, + Boost 1.60 +

+
  • + Added support for "empty" seqs and tuples +
+

+ + Version + 1.8 +

+
  • + After a review of VMD I have greatly simplified the main interfaces and + added optional functionality in the form of modifiers. The main changes + are the addition of the many generic macros for sequences and the expansions + of types to include the v-type. +
      +
    • + Added BOOST_VMD_ELEM macro. +
    • +
    • + Added BOOST_VMD_EQUAL macro. +
    • +
    • + Added BOOST_VMD_NOT_EQUAL macro. +
    • +
    • + Added BOOST_VMD_IS_MULTI macro. +
    • +
    • + Added BOOST_VMD_IS_TYPE macro. +
    • +
    • + Added BOOST_VMD_ASSERT_IS_TYPE macro. +
    • +
    • + Added BOOST_VMD_IS_UNARY macro. +
    • +
    • + Added BOOST_VMD_SIZE macro. +
    • +
    • + Replaced with the BOOST_VMD_ELEM macro, using modifiers, a number + of macros which were eliminated. These are: +
        +
      • + BOOST_VMD_IDENTIFER +
      • +
      • + BOOST_VMD_BEGIN_IDENTIFIER +
      • +
      • + BOOST_VMD_AFTER_IDENTIFIER +
      • +
      • + BOOST_VMD_IS_BEGIN_IDENTIFIER +
      • +
      • + BOOST_VMD_NUMBER +
      • +
      • + BOOST_VMD_BEGIN_NUMBER +
      • +
      • + BOOST_VMD_AFTER_NUMBER +
      • +
      • + BOOST_VMD_IS_BEGIN_NUMBER +
      • +
      • + BOOST_VMD_ARRAY +
      • +
      • + BOOST_VMD_BEGIN_ARRAY +
      • +
      • + BOOST_VMD_AFTER_ARRAY +
      • +
      • + BOOST_VMD_IS_BEGIN_ARRAY +
      • +
      • + BOOST_VMD_LIST +
      • +
      • + BOOST_VMD_BEGIN_LIST +
      • +
      • + BOOST_VMD_AFTER_LIST +
      • +
      • + BOOST_VMD_IS_BEGIN_LIST +
      • +
      • + BOOST_VMD_SEQ +
      • +
      • + BOOST_VMD_BEGIN_SEQ +
      • +
      • + BOOST_VMD_AFTER_SEQ +
      • +
      • + BOOST_VMD_IS_BEGIN_SEQ +
      • +
      • + BOOST_VMD_TUPLE +
      • +
      • + BOOST_VMD_BEGIN_TUPLE +
      • +
      • + BOOST_VMD_AFTER_TUPLE +
      • +
      • + BOOST_VMD_IS_BEGIN_TUPLE +
      • +
      +
    • +
    • + Every macro has its own header file. +
    • +
    +
+

+ + Version + 1.7 +

+
  • + The library has been reengineered to provide vastly added functionality. + This includes: +
      +
    • + Adding functionality for parsing v-types. +
    • +
    • + Adding functionality for parsing sequences of v-types. +
    • +
    • + Adding improved ASSERT macros. +
    • +
    • + Adding BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY. +
    • +
    +
+

+ + Version + 1.6 +

+
    +
  • + Stripped off all functionality duplicated by the variadic macro functionality + added to Boost PP. +
  • +
  • + Removed the notion of 'native' and 'pplib' modes. +
  • +
  • + Use the BOOST_PP_VARIADICS macro from the Boost PP library to determine + variadic macro availability and removed the native macro for determining + this from this library. +
  • +
  • + Updated documentation, especially to give fuller information of the use + of the BOOST_VMD_EMPTY macro and its flaw and use with Visual C++. +
  • +
  • + Changed the directory structure to adhere to the Modular Boost structure. +
  • +
+

+ + Version + 1.5 +

+
    +
  • + Added macros for verifying Boost PP data types. +
  • +
  • + Added macros for detecting and removing beginning parens. +
  • +
  • + Added a macro for testing for the emptiness of a parameter. +
  • +
  • + Added support for individual header files. +
  • +
  • + Added support for 'native' and 'pplib' modes. +
  • +
  • + Added control macros for controlling the variadic macro availability, mode, + and data verification. +
  • +
+

+ + Version + 1.4 +

+
  • + Removed internal dependency on BOOST_PP_CAT and BOOST_PP_ADD when using + VC++. +
+

+ + Version + 1.3 +

+
    +
  • + Moved version information and history into the documentation. +
  • +
  • + Separate files for build.txt in the doc sub-directory and readme.txt in + the top-level directory. +
  • +
  • + Breaking changes +
      +
    • + The name of the main header file is shortened to 'vmd.hpp'. +
    • +
    • + The library follows the Boost conventions. +
        +
      • + Changed the filenames to lower case and underscores. +
      • +
      • + The macros now start with BOOST_VMD_ rather than just VMD_ + as previously. +
      • +
      +
    • +
    +
  • +
+

+ + Version + 1.2 +

+
    +
  • + Added a readme.txt file. +
  • +
  • + Updated all jamfiles so that the library may be tested and docs generated + from its own local directory. +
  • +
+

+ + Version + 1.1 +

+
  • + Added better documentation for using variadic data with Boost PP and VMD. +
+

+ + Version + 1.0 +

+

+ Initial version of the library. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_identifier_subtype.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_identifier_subtype.html new file mode 100644 index 0000000000000000000000000000000000000000..16cfdf3e68c71755d13b2fca9d4783566c64b11d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_identifier_subtype.html @@ -0,0 +1,287 @@ + + + +Identifier subtypes + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Identifiers are the low-level data types which macro programmers use to pass + preprocessing data most often. As we have seen VMD has a system for registering + and detecting identifiers so that they can be parsed as part of preprocessor + data. This system also includes comparing identifiers for equality or inequality + using BOOST_VMD_EQUAL/BOOST_VMD_NOT_EQUAL and matching identifiers using identifier + modifiers in BOOST_VMD_IS_IDENTIFIER and BOOST_VMD_ELEM. Together these facilities + provide a rich set of functionality for handling identifiers in macros. +

+

+ Both numbers and v-types are subtypes of identifiers, and can both be individually + recognized as data types of their own or worked with as identifiers using the + identifier facilities already mentioned. Numbers, in particular, also have + a rich set of functionality within the Boost PP library. As subtypes numbers + and v-types can be used as filter modifiers and can be returned as specific + types either when invoking BOOST_VMD_GET_TYPE or when using return type modifiers. + Furthermore VMD recognizes their individual v-types, BOOST_VMD_TYPE_NUMBER + and BOOST_VMD_TYPE_TYPE, as VMD data when parsing sequences. +

+

+ It is possible for the end-user to define his own identifier subtype. This + is called a "user-defined subtype". Once a user-define subtype is + created all the generic type facilities of VMD which subtypes such as a number + or a v-type possess is automatically available for that user-defined subtype. +

+

+ + Defining + a subtype +

+

+ In order to define a user-defined subtype a number of steps need to be followed. + These steps will be explained in detail further below: +

+
    +
  1. + Register and pre-detect all identifiers of that subtype. +
  2. +
  3. + Register and pre-detect a v-type name for that subtype. +
  4. +
  5. + Subset register all identifiers of the subtype. +
  6. +
  7. + Subset register the v-type name for the subtype. +
  8. +
+

+ When we do the above, it is best to put all the macros in a single header file + and always include that header file when we work generically with our user-defined + subtype. +

+

+ + Register + and pre-detect all identifiers of that subtype +

+

+ Registering and pre-detecting all of the identifiers of that subtype is exactly + the same as registering and pre-detecting any identifier. +

+

+ Let's create some identifiers based for use in the mythical "udef" + library. We will put all our macros in the header file udef_vmd_macros.hpp. +

+

+ We will need distinct names for the identifiers in our library, so we will + append UDEF_ to our identifier names to make them unique. Our udef library + deals in geometrical shapes so we will create a user-defined subtype which + consists of identifiers for the various shapes our udef library can manipulate + in their macros. So our identifier registrations and pre-detections placed + in our header file will be: +

+
#define BOOST_VMD_REGISTER_UDEF_CIRCLE (UDEF_CIRCLE)
+#define BOOST_VMD_REGISTER_UDEF_SQUARE (UDEF_SQUARE)
+#define BOOST_VMD_REGISTER_UDEF_TRIANGLE (UDEF_TRIANGLE)
+#define BOOST_VMD_REGISTER_UDEF_HEXAGON (UDEF_HEXAGON)
+
+#define BOOST_VMD_DETECT_UDEF_CIRCLE_UDEF_CIRCLE
+#define BOOST_VMD_DETECT_UDEF_SQUARE_UDEF_SQUARE
+#define BOOST_VMD_DETECT_UDEF_TRIANGLE_UDEF_TRIANGLE
+#define BOOST_VMD_DETECT_UDEF_HEXAGON_UDEF_HEXAGON
+
+

+ + Register + and pre-detect a v-type name for that subtype +

+

+ We need to create a unique v-type name for our user-defined subtype. The name + does not have to begin with BOOST_VMD_TYPE_ but it should be unique. Since + BOOST_VMD_TYPE_ is the common beginning of all v-types we will use it for consistency + but will append to it UDEF_SHAPES to give it a uniqueness which should not + be duplicated: +

+
#define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_UDEF_SHAPES (BOOST_VMD_TYPE_UDEF_SHAPES)
+
+#define BOOST_VMD_DETECT_BOOST_VMD_TYPE_UDEF_SHAPES_BOOST_VMD_TYPE_UDEF_SHAPES
+
+

+ + Subtype + register all identifiers of the subtype +

+

+ The macro to register an identifier subset starts with BOOST_VMD_SUBTYPE_REGISTER_ + and you append to it each identifier in the subset. This is very much like + the way you use the BOOST_VMD_REGISTER_ macro. The difference is that unlike + the BOOST_VMD_REGISTER_ macro, which expands to a tuple whose single element + is the identifier, the BOOST_VMD_SUBTYPE_REGISTER_ expands to a tuple of two + elements where the first element is the subtype v-type and the second element + is the identifier. +

+

+ For our udef user-defined subtype this would be: +

+
#define BOOST_VMD_SUBTYPE_REGISTER_UDEF_CIRCLE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_CIRCLE)
+#define BOOST_VMD_SUBTYPE_REGISTER_UDEF_SQUARE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_SQUARE)
+#define BOOST_VMD_SUBTYPE_REGISTER_UDEF_TRIANGLE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_TRIANGLE)
+#define BOOST_VMD_SUBTYPE_REGISTER_UDEF_HEXAGON (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_HEXAGON)
+
+

+ + Subtype + register the v-type name for the subtype +

+

+ Doing a subset register of the actual udef v-type is fairly easy once we understand + how to register an identifier subset. The only particular thing to realize + is that the type of any v-type is the v-type BOOST_VMD_TYPE_TYPE. So our subset + register of our new v-type BOOST_VMD_TYPE_UDEF_SHAPES is: +

+
#define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_UDEF_SHAPES (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_UDEF_SHAPES)
+
+

+ + Using + our identifier subset +

+

+ Once we have added all of the above object-like macros for defining our user-defined + subtype to the udef_vmd_macros.hpp header file we have a new data type which + we can use generically just like we can use numbers or v-types generically. + It is important to include the header udef_vmd_macros.hpp in some translation + unit whenever we need the VMD functionality for our new data type. So in our + examples we will assume that an '#include udef_vmd_macros.hpp' precedes each + example. +

+
#include <boost/vmd/get_type.hpp>
+
+#define A_SEQUENCE UDEF_SQUARE
+#define A_SEQUENCE2 217
+#define A_SEQUENCE3 BOOST_VMD_TYPE_UDEF_SHAPES
+#define A_SEQUENCE4 BOOST_VMD_TYPE_NUMBER
+
+BOOST_VMD_GET_TYPE(A_SEQUENCE) will return 'BOOST_VMD_TYPE_UDEF_SHAPES'
+BOOST_VMD_GET_TYPE(A_SEQUENCE2) will return 'BOOST_VMD_TYPE_NUMBER'
+BOOST_VMD_GET_TYPE(A_SEQUENCE3) will return 'BOOST_VMD_TYPE_TYPE'
+BOOST_VMD_GET_TYPE(A_SEQUENCE4) will return 'BOOST_VMD_TYPE_TYPE'
+
+

+ Here we see that when we use our BOOST_VMD_GET_TYPE macro on a single-element + sequence which is one of our user-defined subtype values we correctly get back + our user-defined subtype's v-type, just like we do when we ask for the type + of a number. Also when we use our BOOST_VMD_GET_TYPE macro on our user-defined + subtype's v-type itself we correctly get back the type of all v-types, which + is BOOST_VMD_TYPE_TYPE, just like we do when we ask for the type of the v-type + of a number. +

+
#include <boost/vmd/elem.hpp>
+
+#define A_SEQUENCE5 (1,2) UDEF_TRIANGLE
+
+BOOST_VMD_ELEM(1,A_SEQUENCE5,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_TRIANGLE)'
+BOOST_VMD_ELEM(0,A_SEQUENCE5,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_TUPLE,(1,2))'
+
+

+ Here we see that we can use the return type modifier to get back both the type + and the value in a two-element tuple for our user-defined subtype just as we + so for any other type. +

+
#include <boost/vmd/equal.hpp>
+
+#define A_SEQUENCE6 UDEF_CIRCLE
+#define A_SEQUENCE7 168
+
+BOOST_VMD_EQUAL(A_SEQUENCE6,UDEF_CIRCLE,BOOST_VMD_TYPE_UDEF_SHAPES) will return '1'
+BOOST_VMD_EQUAL(A_SEQUENCE6,UDEF_CIRCLE,BOOST_VMD_TYPE_LIST) will return '0'
+BOOST_VMD_EQUAL(A_SEQUENCE7,168,BOOST_VMD_TYPE_NUMBER) will return '1'
+BOOST_VMD_EQUAL(A_SEQUENCE7,168,BOOST_VMD_TYPE_SEQ) will return '0'
+
+

+ Here we can see that we can use the filter modifier with our user-defined subtype's + v-type just as we can do with any other v-type, such as the number v-type. +

+

+ In all respects once we define our subtype and provide those definitions in + a header file, our user-defined subtype acts like any other v-type in our system. + Since VMD functionality is largely based on being able to recognize the type + of data in macro input being able to define another 'type', as an identifier + subtype, which VMD understands has value for the macro programmer. +

+

+ + Uniqueness + of identifier subtype values and v-type +

+

+ When we define a new identifier subtype we need to be careful that the values + of that subtype and its actual v-type are unique identifiers within any translation + unit. This is the main difference between just defining identifiers and defining + an identifier subtype. +

+

+ Recall that when we just register and pre-detect identifiers we will have no + problems if the same identifiers already have been registered and pre-detected + within the same translation unit. This is because we are just redefining the + exact same macro if this is the case. +

+

+ But with identifier subtypes, when we use the BOOST_VMD_SUBTYPE_REGISTER_ macro + to associate our subtype's v-type with our subtype identifiers, we will have + problems if someone else has also defined an identifier subtype using the same + identifiers as we use since we will be redefining the same object-like macro + name with a different expansion. Even if someone else has registered/pre-detected + an identifier we are using for out subtype without defining a subtype based + on that identifier we will be causing a problem defining our subtype because + VMD macros which generically return the type of a sequence or sequence element + will return our subtype as the type rather than just BOOST_VMD_TYPE_IDENTIFIER + which some programmer might expect. +

+

+ The gist of this is that if we define a user-defined subtype its identifiers + need to be unique within a given translation unit, and yet unique names make + it harder for an end-user to use macros more naturally. In our given example + with the mythical udef library we used identifiers such as 'UDEF_CIRCLE' etc. + instead of the more natural sounding CIRCLE. So with user-defined identifier + subtypes we have a tradeoff; we need unique identifier names both for our subtype + identifiers and the v-type for our subtype identifiers so as not to conflict + with others who might be using identifier subtypes, but those unique names + might make using macros less "natural" On the other hand, just registering/pre-detecting + identifiers has no such problem. This is an issue of which any user, looking + to create his own data type using VMD by defining user-defined subtypes, should + be aware. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_internal_macros.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_internal_macros.html new file mode 100644 index 0000000000000000000000000000000000000000..ba824cfab28608e847636cbfc600e82a4f903a97 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_internal_macros.html @@ -0,0 +1,64 @@ + + + +Controlling internal usage + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ VMD has a few object-like macros which the end-user of the library can use + to determine or change the way variadic macros are used in the library. +

+

+ The macro BOOST_PP_VARIADICS is part of the Boost PP library, not part of VMD. + It is used to denote whether variadic data support exists for the particular + compiler the end-user is using. VMD also uses this macro to determine whether + variadic data support exists. An end-user of VMD can use this macro in his + own design to determine whether or not variadic macros are supported. Furthermore + an end-user of VMD can set this macro to 0 or non-zero, before including a + VMD header file, to force VMD to treat the particular compiler being used as + not supporting or supporting variadic macros. If a compiler does not support + variadic macro none of the macros in VMD are defined. +

+

+ The macro BOOST_VMD_ASSERT_DATA controls whether or not an assert macro will + check its data. The default is that in compiler debug mode it will check the + data while in compiler release mode it will not check its data. The end-user + can change this by setting the macro to 0 to not check the data, or non-zero + to check the data, before including a VMD header file, or check the value if + necessary after including a VMD header file. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers.html new file mode 100644 index 0000000000000000000000000000000000000000..149a2b9e3bc3d7f9f324c5110cecf8073588246a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers.html @@ -0,0 +1,645 @@ + + + +Macros with modifiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ The basic functionality for VMD macros parsing data types has been given using + the required parameters of those macros. This basic functionality may be perfectly + adequate for macro programmers to use VMD effectively in their programming + efforts. +

+

+ A number of those macros take optional parameters, called in general "modifiers", + which enhance or change the functionality of those macros in various ways. + All modifiers are VMD identifiers. +

+

+ In all situations modifiers are optional parameters which are parsed by VMD + to provide enhanced functionality for some of its macros. They are never required + as part of the basic functionality of a macro. +

+

+ When modifiers are used as optional arguments to a macro they can be input + after the required parameters in any order and VMD will still handle the optional + parameters correctly. +

+

+ There are two general types of modifiers, 'specific modifiers' and 'user-defined + modifiers'. Specific modifers start with BOOST_VMD_ and are both registered + and pre-detected identifiers known to VMD. The specific modifiers change the + expansion of particular macros in various ways which will be subsequently explained. + User-defined modifiers are user-defined identifiers which the end-user of specific + macros must register and pre-detect for himself. They also change the expansion + of particular macros in various ways which will be subsequently explained. +

+

+ For any particular macro if a specific modifier is not appropriate it is just + ignored. This means that VMD never generates a preprocessing error or gives + an incorrect result just because a specific modifier does not apply for a particular + macro. Any modifier which is not recognized as a specific modifier is treated + as a user-defined modifier. In cases where a user-defined modifier is not appropriate + it is also just ignored. +

+

+ The situations where modifiers can be used to enhance the basic functionality + of VMD macros can be divided by particular types of specific modifiers. Each + particular type of a specific modifier has a name given to it, functionality, + and set of identifiers associated with that particular type. Each particular + type of a specific modifier may be used as optional parameters in one or more + designated macros depending on the specific modifier type. +

+

+ When more than one mutually exclusive specific modifier from a particular type + of modifier is specified as an optional parameter the last specified takes + effect. This allows the programmer to override a specific modifier by adding + the overridden identifier as an optional argument to the end of the macro's + invocation. +

+

+ Header files for specific modifiers are automatically included when the header + files for macros taking those specific modifiers are included. +

+

+ Header files for user-defined modifiers, which register and pre-detect those + user-defined modifiers, must be included as needed by the programmer using + those modifiers. +

+

+ The following topics will explain each particular type of modifier and where + it may be used. +

+
+ +

+ A number of macros are capable of returning the type of data as a v-type + rather than, or along with, the data itself. The most obvious of these is + BOOST_VMD_GET_TYPE which generically returns the type of the input. +

+

+ Return type modifiers turn on, turn off, or change the type of the data returned + in some way. +

+

+ These modifiers are: +

+
    +
  • + BOOST_VMD_RETURN_NO_TYPE, do not return the type of data. +
  • +
  • + BOOST_VMD_RETURN_TYPE, return the type of data parsing any tuple-like + syntactical construct as its most specific type. This means that any + tuple-like construct is parsed first as a possible list, next as a possible + array if it is not a list, and finally as a tuple if it is not a list + or an array. +
  • +
  • + BOOST_VMD_RETURN_TYPE_LIST, parse any tuple-like syntactical construct + first as a possible list and only then as a tuple if it is not a list. +
  • +
  • + BOOST_VMD_RETURN_TYPE_ARRAY, parse any tuple-like syntactical construct + first as a possible array and only then as a tuple if it is not an array. +
  • +
  • + BOOST_VMD_RETURN_TYPE_TUPLE, parse any tuple-like syntactical construct + only as a tuple. +
  • +
+

+ When VMD parses input generically it must determine the type of each data + element of the input. For nearly all of the VMD data types this is never + a problem. For the array or list data types this can be a problem, as explained + when discussing parsing arrays and lists respectively using the specific + macros BOOST_VMD_IS_ARRAY and BOOST_VMD_IS_LIST. The problem is that a valid + tuple can be an invalid list or an invalid array, whose parsing as the more + specific type will lead to UB. Because of this when VMD parses input generically, + and only the data of an element is needed to continue parsing correctly, + it parses all tuple-like data as a tuple and never as a list or an array. +

+

+ When VMD parses input generically, and the type of the data is required in + some way as part of the return of a macro, VMD by default parses for the + most specific type of each data element in order to return the most accurate + type. In this situation by default the BOOST_VMD_RETURN_TYPE modifier is + internally in effect without having to be specified. +

+

+ If more than one of the return type modifiers are specified as optional parameters + the last one specified is in effect. +

+
+ + Usage + with BOOST_VMD_GET_TYPE +
+

+ The only macro in which VMD without the use of modifiers is being asked to + return the type of data is BOOST_VMD_GET_TYPE. For this macro the BOOST_VMD_RETURN_TYPE + modifier is internally in effect so if no return type modifiers are input + as optional parameters BOOST_VMD_GET_TYPE looks for the most specific type. +

+

+ For the BOOST_VMD_GET_TYPE macro the optional return type modifier BOOST_VMD_RETURN_NO_TYPE, + if specified, is always ignored since the purpose of BOOST_VMD_GET_TYPE is + solely to return the v-type. +

+

+ Let's look at how this works with BOOST_VMD_GET_TYPE by specifying VMD sequences + that have tuples which may or may not be valid lists or arrays. +

+
#include <boost/vmd/get_type.hpp>
+
+#define TUPLE_IS_ARRAY (2,(3,4))
+#define TUPLE_IS_LIST (anydata,BOOST_PP_NIL)
+#define TUPLE_IS_LIST_OR_ARRAY (2,(3,BOOST_PP_NIL))
+#define TUPLE_BUT_INVALID_ARRAY (&2,(3,4))
+#define TUPLE_BUT_INVALID_LIST (anydata,^BOOST_PP_NIL)
+#define SEQUENCE_EMPTY
+#define SEQUENCE_MULTI TUPLE_BUT_INVALID_ARRAY TUPLE_BUT_INVALID_LIST
+
+BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY) will return BOOST_VMD_TYPE_ARRAY, the most specific type
+BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_ARRAY
+BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_TUPLE
+
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST) will return BOOST_VMD_TYPE_LIST, the most specific type
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_LIST
+
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY) will return BOOST_VMD_TYPE_LIST, the most specific type
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_ARRAY
+BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_LIST
+
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY) will give UB
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY) will give UB
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_TUPLE
+
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST) will give UB
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_LIST) will give UB
+
+BOOST_VMD_GET_TYPE(SEQUENCE_EMPTY)
+   will always return BOOST_VMD_TYPE_EMPTY even if we add any return type modifiers
+BOOST_VMD_GET_TYPE(SEQUENCE_MULTI)
+   will always return BOOST_VMD_TYPE_SEQUENCE even if we add any return type modifiers
+
+
+ + Usage + with sequence converting macros +
+

+ The sequence converting macros converts a sequence to a composite Boost PP + data type or to variadic data, where each element's data in the sequence + becomes an element in the destination composite type. The macros are: +

+
    +
  • + BOOST_VMD_TO_ARRAY, converts the sequence to an array +
  • +
  • + BOOST_VMD_TO_LIST, converts the sequence to a list +
  • +
  • + BOOST_VMD_TO_SEQ, converts the sequence to a seq +
  • +
  • + BOOST_VMD_TO_TUPLE, converts the sequence to a tuple +
  • +
  • + BOOST_VMD_ENUM, converts the sequence to variadic data +
  • +
+

+ When it does the conversion, using just the required parameter of the sequence + itself, it converts only the data value of each sequence element to the elements + of a composite Boost PP data type or variadic data. Because it needs only + the data value of each sequence element it determines the type of each sequence + element as the most general type that it can be. This means that all tuple-like + data are parsed as tuples rather than as possible lists or arrays. +

+

+ Using a return type modifier we can convert from a VMD sequence to a Boost + PP composite data type or variadic data and retain the type of data of each + element in the sequence as part of the conversion. When doing this each of + the converted elements of the composite data type becomes a two-element tuple + where the first element is the type of the data and the second element is + the data itself. +

+

+ For the sequence conversion macros the default return type modifier internally + set is BOOST_VMD_RETURN_NO_TYPE, which means that the type is not retained. + By specifying another optional return type modifier we tell the conversion + to preserve the type in the conversion output. +

+

+ If the sequence is empty, since there are no sequence elements, any return + type modifier we use accomplishes nothing but is fine to use. +

+

+ First we show how sequence conversion macros work with the BOOST_VMD_RETURN_TYPE + modifier, which always parses for the most specific type. +

+
#include <boost/vmd/enum.hpp>
+#include <boost/vmd/to_array.hpp>
+#include <boost/vmd/to_list.hpp>
+#include <boost/vmd/to_seq.hpp>
+#include <boost/vmd/to_tuple.hpp>
+
+#define BOOST_VMD_REGISTER_ANID (ANID)
+#define SEQUENCE_EMPTY_1
+#define SEQUENCE_SINGLE 35
+#define SEQUENCE_SINGLE_ID ANID
+#define SEQUENCE_SINGLE_ARRAY (3,(0,1,2))
+#define SEQUENCE_SINGLE_LIST (data,(more_data,BOOST_PP_NIL))
+#define SEQUENCE_MULTI_1 (0,1) (2)(3)(4)
+#define SEQUENCE_MULTI_2 BOOST_VMD_TYPE_SEQ (2,(5,6))
+
+BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY_1) will return an empty array '(0,())'
+BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY_1,BOOST_VMD_RETURN_TYPE) will return an empty array '(0,())'
+
+BOOST_VMD_TO_LIST(SEQUENCE_SINGLE) will return a one-element list '(35,BOOST_PP_NIL)'
+BOOST_VMD_TO_LIST(SEQUENCE_SINGLE,BOOST_VMD_RETURN_TYPE)
+   will return a one-element list '((BOOST_VMD_TYPE_NUMBER,35),BOOST_PP_NIL)'
+
+BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_ID) will return a one-element seq '(ANID)'
+BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_ID,BOOST_VMD_RETURN_TYPE)
+   will return a one-element seq '((BOOST_VMD_TYPE_IDENTIFIER,ANID))'
+
+BOOST_VMD_TO_TUPLE(SEQUENCE_SINGLE_ARRAY) will return a single element tuple '((3,(0,1,2)))'
+BOOST_VMD_TO_TUPLE(SEQUENCE_SINGLE_ARRAY,BOOST_VMD_RETURN_TYPE)
+   will return a single element tuple '((BOOST_VMD_TYPE_ARRAY,(3,(0,1,2))))'
+
+BOOST_VMD_ENUM(SEQUENCE_SINGLE_LIST) will return the single-element '(data,(more_data,BOOST_PP_NIL))'
+BOOST_VMD_ENUM(SEQUENCE_SINGLE_LIST,BOOST_VMD_RETURN_TYPE)
+   will return the single element '(BOOST_VMD_TYPE_LIST,(data,(more_data,BOOST_PP_NIL)))'
+
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_1) will return a multi-element tuple '((0,1),(2)(3)(4))'
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_1,BOOST_VMD_RETURN_TYPE)
+   will return a multi-element tuple '((BOOST_VMD_TYPE_TUPLE,(0,1)),(BOOST_VMD_TYPE_SEQ,(2)(3)(4)))'
+
+BOOST_VMD_ENUM(SEQUENCE_MULTI_2) will return multi-element variadic data 'BOOST_VMD_TYPE_SEQ,(2,(5,6))'
+BOOST_VMD_ENUM(SEQUENCE_MULTI_2,BOOST_VMD_RETURN_TYPE)
+   will return multi-element variadic data '(BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ),(BOOST_VMD_TYPE_ARRAY,(2,(5,6)))'
+
+

+ Lets look at how we might use other return type modifiers when doing conversions + to avoid UB if we want the type as part of the conversion but the type might + be a valid tuple while being an invalid list or array. +

+
#define TUPLE_IS_VALID_ARRAY (2,(3,4))
+#define TUPLE_IS_VALID_LIST (anydata,BOOST_PP_NIL)
+#define TUPLE_BUT_INVALID_ARRAY_2 (&2,(3,4))
+#define TUPLE_BUT_INVALID_LIST_2 (anydata,^BOOST_PP_NIL)
+
+#define SEQUENCE_MULTI_T1 TUPLE_IS_VALID_ARRAY TUPLE_IS_VALID_LIST
+#define SEQUENCE_MULTI_T2 TUPLE_BUT_INVALID_ARRAY_2 TUPLE_IS_VALID_LIST
+#define SEQUENCE_MULTI_T3 TUPLE_IS_VALID_ARRAY TUPLE_BUT_INVALID_LIST_2
+#define SEQUENCE_MULTI_T4 TUPLE_BUT_INVALID_ARRAY_2 TUPLE_BUT_INVALID_LIST_2
+
+

+ We present a number of uses of various sequence conversions with each of + our four different sequences, and show their results. +

+
#include <boost/vmd/to_seq.hpp>
+
+BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE)
+   will return the seq '((BOOST_VMD_TYPE_ARRAY,(2,(3,4)))) ((BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))'
+BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_ARRAY)
+   will return the seq '((BOOST_VMD_TYPE_ARRAY,(2,(3,4)))) ((BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))'
+BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_LIST)
+   will return the seq '((BOOST_VMD_TYPE_TUPLE,(2,(3,4)))) ((BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))'
+BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_TUPLE)
+   will return the seq '((BOOST_VMD_TYPE_TUPLE,(2,(3,4)))) ((BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))'
+
+

+ The SEQUENCE_MULTI_T1 is a valid array followed by a valid list. All return + type modifiers produce their results without any UBs. +

+
#include <boost/vmd/to_tuple.hpp>
+
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid array as an array
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_ARRAY)
+   will produce UB when attempting to parse the invalid array as an array
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_LIST)
+   will return the tuple '((BOOST_VMD_TYPE_TUPLE,(&2,(3,4))),(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))'
+BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_TUPLE)
+   will return the tuple '((BOOST_VMD_TYPE_TUPLE,(&2,(3,4))),(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))'
+
+

+ The SEQUENCE_MULTI_T2 is an invalid array, but valid tuple, followed by a + valid list. +

+

+ In sequence conversion we will get UB whenever we use a return type modifier + that parses the data type of the invalid array as an array. But if we use + the return type modifiers BOOST_VMD_RETURN_TYPE_LIST or BOOST_VMD_RETURN_TYPE_TUPLE + we are never parsing the invalid array as an array but as a tuple instead + and therefore we successfully return the type of the invalid array as a BOOST_VMD_TYPE_TUPLE. +

+
#include <boost/vmd/to_array.hpp>
+
+BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid list as a list
+BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_LIST)
+   will produce UB when attempting to parse the invalid list as a list
+BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_ARRAY)
+   will return the array '(2,((BOOST_VMD_TYPE_ARRAY,(2,(3,4))),(BOOST_VMD_TYPE_TUPLE,(anydata,^BOOST_PP_NIL))))'
+BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_TUPLE)
+   will return the array '(2,((BOOST_VMD_TYPE_TUPLE,(2,(3,4))),(BOOST_VMD_TYPE_TUPLE,(anydata,^BOOST_PP_NIL))))'
+
+

+ The SEQUENCE_MULTI_T3 is a valid array followed by an invalid list, but a + valid tuple. +

+

+ In sequence conversion we will get UBs whenever we use a return type modifier + that parses the data type of the invalid list as a list. But if we use the + return type modifiers BOOST_VMD_RETURN_TYPE_ARRAY or BOOST_VMD_RETURN_TYPE_TUPLE + we are never parsing the invalid list as a list but as a tuple instead and + therefore we successfully return the type of the invalid list as a BOOST_VMD_TYPE_TUPLE. +

+
#include <boost/vmd/to_list.hpp>
+
+BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid array or invalid list
+BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_ARRAY)
+   will produce UB when attempting to parse the invalid array
+BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_LIST)
+   will produce UB when attempting to parse the invalid list
+BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_TUPLE)
+   will return the list '((BOOST_VMD_TYPE_TUPLE,(&2,(3,4))),((BOOST_VMD_TYPE_TUPLE,(anydata,^BOOST_PP_NIL)),BOOST_PP_NIL))'
+
+

+ The SEQUENCE_MULTI_T4 is an invalid array, but valid tuple, followed by an + invalid list, but valid tuple. +

+

+ In sequence conversion we will get UBs whenever we use a return type modifier + that parses the sequence other than looking for only valid tuples. So here + we must use the return type modifier BOOST_VMD_RETURN_TYPE_TUPLE for a sequence + conversion without generating UBs. +

+
+ + Usage + with BOOST_VMD_ELEM +
+

+ The default functionality of BOOST_VMD_ELEM when the required parameters + are used is to return the particular element's data. When BOOST_VMD_ELEM + does this it parses all elements of the sequence by determining the most + general type of data for each element. The parsing algorithm stops when it + reaches the element number whose data is returned. This means that all tuple-like + data are parsed as tuples rather than as possible lists or arrays. +

+

+ Using return type modifiers as optional parameters we can tell BOOST_VMD_ELEM + to return the type of the element found, as well as its data, in the form + of a two element tuple. The first element of the tuple is the type of the + data and the second element of the tuple is the data itself. +

+

+ When we use a return type modifier with BOOST_VMD_ELEM, which tells us to + return the type of the data along with the data, the particular modifier + only tells BOOST_VMD_ELEM how to parse the type of data for the element found. + BOOST_VMD_ELEM will continue to parse elements in the sequence preceding + the element found by determining the most general type of the data since + this is the safest way of parsing the data itself. +

+

+ Using the return type modifier BOOST_VMD_RETURN_TYPE with BOOST_VMD_ELEM + is perfectly safe as long as the particular element found is not an invalid + list or array, but a valid tuple. It is when the element found may be an + invalid list or invalid array that we must use other return type modifiers + in order to parse the type of the element correctly. +

+
#include <boost/vmd/elem.hpp>
+
+#define BOOST_VMD_REGISTER_ANID_E (ANID_E)
+#define SEQUENCE_SINGLE_E 35
+#define SEQUENCE_SINGLE_E2 ANID_E
+#define SEQUENCE_MULTI_E (0,1) (2)(3)(4)
+#define SEQUENCE_MULTI_E_2 BOOST_VMD_TYPE_SEQ (2,(5,6))
+
+BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E) will return '35'
+BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_NUMBER,35)'
+
+BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E2) will return 'ANID_E'
+BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E2,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_IDENTIFIER,ANID_E)'
+
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E) will return '(2)(3)(4)'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_SEQ,(2)(3)(4))'
+
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E_2) will return 'BOOST_VMD_TYPE_SEQ'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E_2,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ)'
+
+

+ When we use the other return type modifiers with BOOST_VMD_ELEM we do so + because the element we want may be an invalid list or an invalid array but + a valid tuple and yet we still want its type returned as part of the result. +

+

+ Let's look at how this works with BOOST_VMD_ELEM by specifying VMD sequences + that have tuples which are in the form of arrays or lists which cannot be + parsed as such by VMD without generating UBs. +

+
#define TUPLE_IS_VALID_ARRAY_E (2,(3,4))
+#define TUPLE_IS_VALID_LIST_E (anydata,BOOST_PP_NIL)
+#define TUPLE_BUT_INVALID_ARRAY_E (&2,(3,4))
+#define TUPLE_BUT_INVALID_LIST_E (anydata,^BOOST_PP_NIL)
+
+#define SEQUENCE_MULTI_E1 TUPLE_IS_VALID_ARRAY_E TUPLE_IS_VALID_LIST_E
+#define SEQUENCE_MULTI_E2 TUPLE_BUT_INVALID_ARRAY_E TUPLE_IS_VALID_LIST_E
+#define SEQUENCE_MULTI_E3 TUPLE_IS_VALID_ARRAY_E TUPLE_BUT_INVALID_LIST_E
+#define SEQUENCE_MULTI_E4 TUPLE_BUT_INVALID_ARRAY_E TUPLE_BUT_INVALID_LIST_E
+
+

+ We present a number of uses of BOOST_VMD_ELEM with each of our four different + sequences, and show their results. +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+
+

+ The SEQUENCE_MULTI_E1 is a valid array followed by a valid list. All return + type modifiers produce their results without any UBs. +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid array as an array
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_ARRAY)
+   will produce UB when attempting to parse the invalid array as an array
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(&2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(&2,(3,4)))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+
+

+ The SEQUENCE_MULTI_E2 is an invalid array, but valid tuple, followed by a + valid list. +

+

+ When we access element 0 of our sequence, and use a return type modifier + that parses its data type as an array we will get UB. But if we use the return + type modifiers BOOST_VMD_RETURN_TYPE_LIST or BOOST_VMD_RETURN_TYPE_TUPLE + we are never parsing the invalid array as an array but as a tuple instead + and therefore we successfully return the type of the invalid array as a BOOST_VMD_TYPE_TUPLE. +

+

+ When we access element 1 of our sequence, which is both a valid list and + a valid tuple, we will never get UB. We will get the return type of the element + based on which return type modifier we use. +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid list as a list
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_LIST)
+   will produce UB when attempting to parse the invalid list as a list
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+
+

+ The SEQUENCE_MULTI_E3 is a valid array followed by an invalid list, but valid + tuple. +

+

+ When we access element 0 of our sequence, which is both a valid array and + a valid tuple, we will never get UB. We will get the return type of the element + based on which return type modifier we use. +

+

+ When we access element 1 of our sequence, and use a return type modifier + that parses its data type as a list we will get UB. But if we use the return + type modifiers BOOST_VMD_RETURN_TYPE_ARRAY or BOOST_VMD_RETURN_TYPE_TUPLE + we are never parsing the invalid list as a list but as a tuple instead and + therefore we successfully return the type of the invalid list as a BOOST_VMD_TYPE_TUPLE. +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid array
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_ARRAY)
+   will produce UB when attempting to parse the invalid array
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))'
+BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE)
+   will produce UB when attempting to parse the invalid list
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_LIST)
+   will produce UB when attempting to parse the invalid list
+BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))'
+
+

+ The SEQUENCE_MULTI_E4 is an invalid array, but valid tuple, followed by an + invalid list, but valid tuple. +

+

+ When we access element 0 of our sequence, which is an invalid array but a + valid tuple, we must use a return type modifier which does not parse element + 0 as an array, else we will get UB. This means we must use the return type + modifiers BOOST_VMD_RETURN_TYPE_LIST or BOOST_VMD_RETURN_TYPE_TUPLE so we + are never parsing the invalid array as an array but as a tuple instead and + therefore we successfully return the type of the invalid array as a BOOST_VMD_TYPE_TUPLE. +

+

+ When we access element 1 of our sequence, which is an invalid list but a + valid tuple, we must use a return type modifier which does not parse element + 1 as a list, else we will get UB. This means we must use the return type + modifiers BOOST_VMD_RETURN_TYPE_ARRAY or BOOST_VMD_RETURN_TYPE_TUPLE so we + are never parsing the invalid list as a list but as a tuple instead and therefore + we successfully return the type of the invalid list as a BOOST_VMD_TYPE_TUPLE. +

+
+ + Usage + with other modifiers of BOOST_VMD_ELEM +
+

+ We have not yet discussed the rest of the modifiers which may be used with + BOOST_VMD_ELEM, but return type modifiers are completely independent of any + of them. This means they can be combined with other modifiers and whenever + the element of the sequence is returned the return type modifiers determine + of what the value of that element consists; whether it be just the element + data or the element as a type/data tuple with the type parsed according to + our return type modifier. When we subsequently discuss the use of other modifiers + with BOOST_VMD_ELEM and refer to the element being returned, we are referring + to that element as it is determined by the return type modifiers, which by + default only returns the element's data. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_filter.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_filter.html new file mode 100644 index 0000000000000000000000000000000000000000..8d99311aef833385af910291df8b04d2a87f6fc2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_filter.html @@ -0,0 +1,183 @@ + + + +Filtering modifiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Filtering modifiers are optional modifiers which work with some generic macros + to specify a type of data to apply to the macro's functionality. The filtering + modifier itself is an optional parameter specified as a v-type. Any v-type, + specified as an optional parameter, may be used as a filtering modifier. +

+
+ + Usage + with equality macros +
+

+ The equality macros, BOOST_VMD_EQUAL and BOOST_VMD_NOT_EQUAL, tests generically + whether each of its two required inputs are equal or not equal to each other. +

+

+ Each of these macro takes a single optional parameter, a filtering modifier, + to narrow the focus of its equality testing to a particular v-type. +

+

+ For the macro BOOST_VMD_EQUAL this optional parameter when specified means + that equality is not only that the two required input parameters are equal + but also that they are of the type or of a subtype of the third optional + parameter. A number and a v-type are subtypes of identifiers while a non-empty + list and an array are subtypes of tuples. +

+

+ Conversely BOOST_VMD_NOT_EQUAL, with the optional third v-type parameter, + returns 1 if either the first two parameters are not equal or if the type + of the first two parameters is not the type or a subtype of the third parameter. + Otherwise it returns 0. It is implemented as the complement of BOOST_VMD_EQUAL + so that whenever BOOST_VMD_EQUAL returns 1, BOOST_VMD_NOT_EQUAL returns 0 + and vice versa. +

+

+ Here is an example of using BOOST_VMD_EQUAL with a filtering modifier. BOOST_VMD_NOT_EQUAL + is just the complement of the results in our example for each result, and + would be redundant to be specified each time below. +

+
#include <boost/vmd/equal.hpp>
+
+#define BOOST_VMD_REGISTER_AN_ID1 (AN_ID1)
+#define BOOST_VMD_REGISTER_AN_ID2 (AN_ID2)
+
+#define BOOST_VMD_DETECT_AN_ID1_AN_ID1
+#define BOOST_VMD_DETECT_AN_ID2_AN_ID2
+
+#define AN_IDENTIFIER1 AN_ID1
+#define AN_IDENTIFIER2 AN_ID2
+#define AN_IDENTIFIER3 AN_ID1 // same as AN_IDENTIFIER1 = AN_ID1
+
+#define A_NUMBER1 33
+#define A_NUMBER2 145
+#define A_NUMBER3 33 // same as A_NUMBER1 = 33
+
+#define A_TUPLE1 (AN_IDENTIFIER1,A_NUMBER1)
+#define A_TUPLE2 (AN_IDENTIFIER1,A_NUMBER2)
+#define A_TUPLE3 (AN_IDENTIFIER3,A_NUMBER3) // same as A_TUPLE1 = (AN_ID1,33)
+
+#define A_LIST1 (A_NUMBER1,(A_NUMBER3,BOOST_PP_NIL))
+#define A_LIST2 (A_NUMBER1,(A_NUMBER2,BOOST_PP_NIL))
+#define A_LIST3 (A_NUMBER1,(A_NUMBER3,BOOST_PP_NIL))
+#define A_LIST4 BOOST_PP_NIL // empty list
+#define A_LIST5 BOOST_PP_NIL // empty list
+
+BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER2,BOOST_VMD_TYPE_IDENTIFIER) will return 0
+BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3,BOOST_VMD_TYPE_IDENTIFIER) will return 1
+BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3,BOOST_VMD_TYPE_TYPE) will return 0 because the type does not match
+
+BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER2,BOOST_VMD_TYPE_NUMBER) will return 0
+BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_NUMBER) will return 1
+BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_IDENTIFIER) will return 1 because a number is an identifier
+BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_EMPTY) will return 0 because the type does not match
+
+BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2,BOOST_VMD_TYPE_TUPLE) will return 0
+BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3,BOOST_VMD_TYPE_TUPLE) will return 1
+BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3,BOOST_VMD_TYPE_ARRAY) will return 0 because the type does not match
+
+BOOST_VMD_EQUAL(A_LIST1,A_LIST2,BOOST_VMD_TYPE_LIST) will return 0
+BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_LIST) will return 1
+BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_IDENTIFIER) will return 0 because the type does not match
+BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_TUPLE) will return 1 because a non-empty list is also a tuple
+BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_LIST) will return 1
+BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_IDENTIFIER) will return 1 because an empty list is also an identifier
+BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_TUPLE) will return 0 because an empty list is not a tuple
+
+
+ + Usage + with BOOST_VMD_ELEM +
+

+ As with the equality macros BOOST_VMD_ELEM allows one to perform filtering + for the result. An optional parameter of a v-type can be used so that BOOST_VMD_ELEM + returns its result only if the sequence element is of the v-type specified, + else it fails to find the element in the same way that an element number + which is outside the bounds of the sequence fails. +

+
#include <boost/vmd/elem.hpp>
+
+#define BOOST_VMD_REGISTER_ANAME (ANAME) // an identifier must always be registered to be found by VMD
+#define A_SEQUENCE (1,2,3) 46 (list_data1,(list_data2,BOOST_PP_NIL)) BOOST_VMD_TYPE_SEQ ANAME
+
+BOOST_VMD_ELEM(0,A_SEQUENCE) will return (1,2,3)
+BOOST_VMD_ELEM(0,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE) will return (1,2,3)
+BOOST_VMD_ELEM(0,A_SEQUENCE,BOOST_VMD_TYPE_SEQ) will return emptiness
+
+BOOST_VMD_ELEM(1,A_SEQUENCE) will return 46
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_NUMBER) will return 46
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 46 since a number is also an identifier
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_LIST) will return emptiness
+
+BOOST_VMD_ELEM(2,A_SEQUENCE) will return (list_data1,(list_data2,BOOST_PP_NIL))
+BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_LIST) will return (list_data1,(list_data2,BOOST_PP_NIL))
+BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE) will return (list_data1,(list_data2,BOOST_PP_NIL)) since a list is also a tuple
+BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_TYPE) will return emptiness
+
+BOOST_VMD_ELEM(3,A_SEQUENCE) will return BOOST_VMD_TYPE_SEQ
+BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_TYPE) will return BOOST_VMD_TYPE_SEQ
+BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return BOOST_VMD_TYPE_SEQ since a type is also an identifier
+BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE) will return emptiness
+
+BOOST_VMD_ELEM(4,A_SEQUENCE) will return ANAME
+BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return ANAME
+BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_NUMBER) will return emptiness
+
+BOOST_VMD_ELEM(0,BOOST_PP_NIL) will return BOOST_PP_NIL
+BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_LIST) will return BOOST_PP_NIL since it is an empty list
+BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_IDENTIFIER) will return BOOST_PP_NIL since it a registered identifier
+BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_TUPLE) will return emptiness
+
+

+ If you specify more than one v-type as a filtering modifier to BOOST_VMD_ELEM + the last v-type becomes the filter. +

+

+ Filtering with BOOST_VMD_ELEM denotes the type of the data expected when + the particular element is found. Because filtering represents the type of + the data requested, filtering modifiers and return type modifiers are mutually + exclusive and any filtering modifier means that return type modifiers specified + are ignored. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_identifier.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_identifier.html new file mode 100644 index 0000000000000000000000000000000000000000..db5763c21c9f4581609aef7c35434215fe516f4e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_identifier.html @@ -0,0 +1,202 @@ + + + +Identifier modifiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Identifier modifiers are optional parameters which specify a set of identifiers + to search in order to look for a particular identifier match rather than + just any identifier. +

+
+ + Usage + with BOOST_VMD_IS_IDENTIFIER +
+

+ Once we have both registered and pre-detected an identifier we can test whether + an identifier is a particular identifier using BOOST_VMD_IS_IDENTIFER and + identifier modifiers. We do this by passing optional parameter(s) to BOOST_VMD_IS_IDENTIFER. + The optional parameter(s) are either a single tuple of possible identifiers + we are trying to match, or the individual identifiers themselves as separate + parameters. +

+

+ Using the optional parameter(s) with BOOST_VMD_IS_IDENTIFER we are asking + not only if our input is any of the registered identifiers but also if it + is one of a number of pre-detected identifiers. +

+

+ As an example: +

+
#include <boost/vmd/is_identifier.hpp>
+
+#define BOOST_VMD_REGISTER_yellow (yellow)
+#define BOOST_VMD_REGISTER_green (green)
+#define BOOST_VMD_REGISTER_blue (blue)
+#define BOOST_VMD_REGISTER_red (red)
+
+#define BOOST_VMD_DETECT_yellow_yellow
+#define BOOST_VMD_DETECT_green_green
+#define BOOST_VMD_DETECT_blue_blue
+
+BOOST_VMD_IS_IDENTIFIER(some_input,yellow) // returns 1 only if 'some_input is 'yellow', else returns 0
+BOOST_VMD_IS_IDENTIFIER(some_input,yellow,blue) // returns 1 only if 'some_input is 'yellow' or 'blue', else returns 0
+BOOST_VMD_IS_IDENTIFIER(some_input,(yellow,green)) // returns 1 if 'some_input' is 'yellow' or 'green', else returns 0
+
+BOOST_VMD_IS_IDENTIFIER(some_input,red)
+   // always returns 0, even if 'some_input' is 'red' since 'red' has not been pre-detected
+
+

+ whereas +

+
BOOST_VMD_IS_IDENTIFIER(some_input) // returns 1 if 'some_input' is 'red' since 'red' has been registered
+
+

+ If you invoke BOOST_VMD_IS_IDENTIFIER with the optional parameter(s), the + invocation will only return 1 if the input matches one the identifier(s) + of the optional parameters and the identifier it matches has been registered + and pre-detected. +

+

+ Both VMD numbers and v-types are identifier subtypes so you can also use + them as identifier modifiers. You do not have to register or pre-detect VMD + numbers or v-types since VMD has already done that for you. +

+

+ As an example of using VMD numbers or v-types as identifier modifiers with + BOOST_VMD_IS_IDENTIFIER: +

+
BOOST_VMD_IS_IDENTIFIER(some_input,1,3,5) // returns 1 only if 'some_input' is 1 or 3 or 5, else returns 0
+BOOST_VMD_IS_IDENTIFIER(some_input,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_TYPE_LIST,59)
+   // returns 1 only if 'some_input is the v-type BOOST_VMD_TYPE_TUPLE or the v-type BOOST_VMD_TYPE_LIST or 59, else returns 0
+
+
+ + Usage + with BOOST_VMD_ELEM +
+

+ When we use the specific filter modifier BOOST_VMD_TYPE_IDENTIFIER as an + optional parameter of BOOST_VMD_ELEM we are asking for a particular element + of a sequence as long as it is a VMD identifier. With that specific filter + modifier BOOST_VMD_TYPE_IDENTIFIER we can use identifier modifiers to ask + for a particular element of a sequence as long as it matches one of our identifier + modifiers. If the specific filter modifier BOOST_VMD_TYPE_IDENTIFIER is not + being used then all identifier modifiers are ignored. +

+

+ The syntax for specifying identifier modifiers using BOOST_VMD_ELEM is exactly + the same as the equivalent feature of the BOOST_VMD_IS_IDENTIFIER macro explained + just previously. Optional parameters in the form of identifiers can be specified + either singly any number of times or once as part of a tuple. For an identifier + found as a sequence element to match against one of these possible identifiers, + the possible identifiers must be both registered and pre-detected. +

+

+ Since filter modifiers, which are v-types, are also identifiers, if you want + to use v-types as identifier modifiers you must use the form which places + all identifier modifiers as part of a tuple. Otherwise any v-types specified + singly as optional parameters are seen as filter modifiers and never as identifier + modifiers. VMD numbers are also identifiers and may be used as identifier + modifiers, but in this case VMD numbers as identifier modifiers do not need + to be part of a tuple to be detected. +

+

+ Let's see how this works: +

+
#include <boost/vmd/elem.hpp>
+
+#define BOOST_VMD_REGISTER_ANAME (ANAME)
+#define BOOST_VMD_REGISTER_APLACE (APLACE)
+#define BOOST_VMD_REGISTER_ACOUNTRY (ACOUNTRY)
+
+#define BOOST_VMD_DETECT_ANAME_ANAME
+#define BOOST_VMD_DETECT_APLACE_APLACE
+
+#define A_SEQUENCE (1,2,3) ANAME 46 BOOST_VMD_TYPE_SEQ ACOUNTRY
+
+BOOST_VMD_ELEM(1,A_SEQUENCE) will return 'ANAME'
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 'ANAME'
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,APLACE,ACOUNTRY) will return emptiness
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,ANAME,APLACE,ACOUNTRY) will return 'ANAME'
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,(APLACE,ACOUNTRY,ANAME)) will return 'ANAME'
+
+BOOST_VMD_ELEM(4,A_SEQUENCE) will return 'ACOUNTRY'
+BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 'ACOUNTRY'
+BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,ACOUNTRY,ANAME)
+   will return emptiness since ACOUNTRY is not pre-detected
+
+

+ Let us illustrate the case where VMD identifiers can be represented as either + filter modifiers or identifier modifiers. +

+

+ Using the sequence above: +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(3,A_SEQUENCE) will return the BOOST_VMD_TYPE_SEQ type
+BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER)
+   will return the BOOST_VMD_TYPE_SEQ type since a type is an identifier
+BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TUPLE) will return emptiness
+
+

+ The last use of our macro returns emptiness because if there is more than + one type specified as an optional parameter the last type is chosen for filtering. + Since the last type for type filtering is BOOST_VMD_TYPE_TUPLE and our fourth + element is a v-type and not a tuple, emptiness is returned. The syntax does + not specifying filtering with identifiers as might be supposed since BOOST_VMD_TYPE_SEQ + and BOOST_VMD_TYPE_TUPLE are not treated as identifier modifiers but rather + as additional filter modifiers. +

+

+ In order to do filtering with an identifier and do it against various types + themselves, since v-types are identifiers, we must use the tuple form to + specify our identifier modifiers: +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,(BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TUPLE))
+   will return BOOST_VMD_TYPE_SEQ
+
+

+ Now BOOST_VMD_TYPE_SEQ and BOOST_VMD_TYPE_TUPLE are treated as identifiers + modifiers to match against. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_index.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_index.html new file mode 100644 index 0000000000000000000000000000000000000000..8eca6a5b19679cb142074092a37ee45780df2cdd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_index.html @@ -0,0 +1,119 @@ + + + +Index modifiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Index modifiers can be used with the BOOST_VMD_ELEM macro when identifier + modifiers are being used. Index modifiers take two values: +

+
    +
  • + BOOST_VMD_RETURN_INDEX, return an index as a number, starting with 0, + of the particular identifier modifier which matched, as part of the output + of the BOOST_VMD_ELEM macro. If no particular identifier modifier matches, + return emptiness as part of the output. The index number is determined + purely by the order in which identifier modifiers are specified as optional + parameters to BOOST_VMD_ELEM, whether singly as individual optional parameters + or as a tuple of identifier modifiers. +
  • +
  • + BOOST_VMD_RETURN_NO_INDEX, do not return an index as part of the output. + This is the default value and need only be used to override the BOOST_VMD_RETURN_INDEX + value if it is specified. +
  • +
+

+ The BOOST_VMD_RETURN_INDEX tells the programmer which one of the identifier + modifiers matched the element's data as an index. Some macro programmers + find this more useful for the purposes of macro branching logic than branching + using the actual name of the identifier itself. +

+

+ When the index modifier BOOST_VMD_RETURN_INDEX is specified, and identifier + modifiers are specified along with the BOOST_VMD_TYPE_IDENTIFIER filter modifier, + the output of BOOST_VMD_ELEM becomes a tuple of two elements. The first tuple + element is the element matched and the last tuple element is the index, starting + with 0, of the identifier modifier which matched. If an element is not matched + both tuple elements are empty. +

+

+ If the splitting modifier BOOST_VMD_RETURN_AFTER is also specified then the + output is a tuple of three elements. The first tuple element is the element + matched, the second tuple element is the rest of the sequence after the matching + element, and the last tuple element is the numeric index. If an element is + not matched then all three tuple elements are empty. +

+

+ If identifier modifiers and the BOOST_VMD_TYPE_IDENTIFIER filter modifier + are not specified as optional parameters, then if BOOST_VMD_RETURN_INDEX + is specified it is ignored. If the splitting modifier BOOST_VMD_RETURN_ONLY_AFTER + is specified, if BOOST_VMD_RETURN_INDEX is also specified it is ignored. +

+

+ Let's see how this works: +

+
#include <boost/vmd/elem.hpp>
+
+#define BOOST_VMD_REGISTER_ANAME (ANAME)
+#define BOOST_VMD_REGISTER_APLACE (APLACE)
+#define BOOST_VMD_REGISTER_ACOUNTRY (ACOUNTRY)
+
+#define BOOST_VMD_DETECT_ANAME_ANAME
+#define BOOST_VMD_DETECT_APLACE_APLACE
+
+#define A_SEQUENCE (1,2,3) ANAME (1)(2) 46
+
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 'ANAME'
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,APLACE,ACOUNTRY) will return emptiness
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,APLACE,ACOUNTRY) will return (,)
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,ANAME,APLACE,ACOUNTRY) will return '(ANAME,0)'
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME)) will return '(ANAME,2)'
+
+

+ Used with splitting modifiers: +

+
#include <boost/vmd/elem.hpp>
+
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,APLACE,ACOUNTRY,BOOST_VMD_RETURN_AFTER) will return (,,)
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,ANAME,APLACE,ACOUNTRY,BOOST_VMD_RETURN_AFTER) will return '(ANAME,(1)(2) 46,0)'
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME),BOOST_VMD_RETURN_AFTER) will return '(ANAME,(1)(2) 46,2)'
+
+BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME),BOOST_VMD_RETURN_ONLY_AFTER) will return '(1)(2) 46'
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_single.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_single.html new file mode 100644 index 0000000000000000000000000000000000000000..d81eee18491c30eb8f67b2fa16de29280ba1ce6a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_single.html @@ -0,0 +1,72 @@ + + + +Modifiers and the single-element sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ A single element sequence is what we normally think of when working with + macro data. It is a single type of macro data passed as an input parameter + to some macro and processed as such. +

+

+ In its basic form without modifiers BOOST_VMD_ELEM serves to just return + a particular element of a sequence. For a single element sequence BOOST_VMD_ELEM + with element number 0, just returns the single-element sequence itself. This + does not offer much functionality for our simple sequence. However with modifiers + we can do things generically with our single-element sequence which correspond + to working with a single type of data and extracting information about it. +

+

+ With the return type modifier we can get the type of the data along with + the data. Of course we can also use BOOST_VMD_GET_TYPE to retrieve just the + type of data. +

+

+ With our filter modifier we can retrieve the data only if it is a particular + type, else retrieve emptiness. +

+

+ With the identifier modifier we can retrieve an identifier only if it matches + one or more other identifiers, else retrieve emptiness. +

+

+ With our index modifier we can retrieve both our identifier and its numeric + index if it matches one or more other identifiers, else retrieve a tuple + of two empty elements if no match is found. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_splitting.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_splitting.html new file mode 100644 index 0000000000000000000000000000000000000000..4bf52811088f045d42a18827356f23e7200d9bff --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_modifiers/vmd_modifiers_splitting.html @@ -0,0 +1,111 @@ + + + +Splitting modifiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The BOOST_VMD_ELEM macro, which by default just returns an element of a sequence, + has a usage where you can have it return both the element and the remaining + part of the sequence after the element, or even just the remaining part of + the sequence after the element by itself. This offers a form of splitting + the sequence on a particular element. When used to return the remaining part + of a sequence the remaining data may subsequently be treated as a VMD sequence + again. +

+

+ To do this another set of optional modifiers are used which will be called + 'splitting modifers'. These modifiers are: +

+
    +
  • + BOOST_VMD_RETURN_AFTER, which returns both the element information and + the rest of the sequence after the element as a two-element tuple +
  • +
  • + BOOST_VMD_RETURN_ONLY_AFTER, which returns only the rest of the sequence + after the element specified +
  • +
  • + BOOST_VMD_RETURN_NO_AFTER, this is the internal default which only returns + the element itself. It need never be specified but may be used to override + a previous splitting modifier specified as an optional parameter. +
  • +
+

+ If more than one of the splitting modifiers are specified as optional parameters + to BOOST_VMD_ELEM the last one specified is in effect. +

+

+ The splitting modifiers BOOST_VMD_RETURN_NO_AFTER and BOOST_VMD_RETURN_AFTER + work with either return type modifiers or filtering modifiers if they are + used. The splitting modifier BOOST_VMD_RETURN_ONLY_AFTER works with filtering + modifiers if it is used and any return type modifiers will be ignored. Optional + modifiers may occur in any order after the required parameters to BOOST_VMD_ELEM. +

+

+ If BOOST_VMD_RETURN_AFTER is in effect and an element is not found, either + because the element number is out of range for the sequence or because filtering + does not match the element type, a tuple will still be returned but both + its elements will be empty. +

+
#include <boost/vmd/elem.hpp>
+
+#define BOOST_VMD_REGISTER_ANAME (ANAME) // an identifier must always be registered to be found by VMD
+#define A_SEQUENCE (1,2,3) 46 (list_data1,BOOST_PP_NIL) BOOST_VMD_TYPE_SEQ ANAME
+
+BOOST_VMD_ELEM(2,A_SEQUENCE) will return '(list_data1,BOOST_PP_NIL)'
+BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER) will return '(list_data1,BOOST_PP_NIL)'
+BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER) will return '((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME)'
+BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER) will return 'BOOST_VMD_TYPE_SEQ ANAME'
+
+BOOST_VMD_ELEM(5,A_SEQUENCE) will return emptiness
+BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER) will return emptiness
+BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_AFTER) will return '(,)'
+BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER) will return emptiness
+
+

+ Combining splitting modifiers with return type modifiers: +

+
BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_TYPE) will return '((BOOST_VMD_TYPE_LIST,(list_data1,BOOST_PP_NIL)),BOOST_VMD_TYPE_SEQ ANAME)'
+
+

+ Combining splitting modifiers with filtering modifiers: +

+
BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST) will return '((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME)'
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_naming.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_naming.html new file mode 100644 index 0000000000000000000000000000000000000000..85e7671337c28be9a4206a21cc684c2d32f980c6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_naming.html @@ -0,0 +1,107 @@ + + + +Naming conventions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ All of the macros in the library begin with the prefix BOOST_VMD_, where VMD + stands for 'Variadic Macro Data'. +

+

+ Following the prefix, certain names in the macros refer to data types in this + library or Boost PP. These names and their data types are: +

+
    +
  1. + TUPLE = Boost PP tuple data type. +
  2. +
  3. + ARRAY = Boost PP array data type. +
  4. +
  5. + LIST = Boost PP list data type. +
  6. +
  7. + SEQ = Boost PP seq data type. +
  8. +
  9. + IDENTIFIER = A VMD identifier +
  10. +
  11. + NUMBER = A VMD number +
  12. +
  13. + TYPE = A VMD type +
  14. +
+

+ I have used most of these names in order to mimic the naming of Boost PP as + closely as possible. Subsequent use of the words 'array', 'list', 'seq', and + 'tuple' refer to these Boost PP data types unless otherwise noted. See the + help for Boost PP for any explanation of these data types. +

+

+ The term 'sequence' refers to a sequence of VMD data types and is not the same + as a Boost PP sequence which is always referred to in this documentation as + a 'seq'. +

+

+ The term 'return' refers to the expansion of a macro. I use the terminology + of a macro "returning some data" rather than the terminology of a + macro "expanding to some data", even if the latter is more accurate, + because it more closely corresponds to the way I believe C++ programmers think + about macro programming. +

+

+ The term 'emptiness' refers to no preprocessor data being passed to or returned + from a macro. I have avoided the word 'nothing' because it has too vague a + meaning. +

+

+ The term 'data type' refers to the various preprocessor input types which VMD + can parse and which are listed above, also including emptiness. +

+

+ The term 'v-type' refers to a VMD type, the term 'number' returns to a VMD + number and the term 'identifier' refers to a VMD identifier. All these will + be explained in their proper place. +

+

+ The term "UB" stands for "undefined behavior" as it is + specified in the C++ standard. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_reentrant.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_reentrant.html new file mode 100644 index 0000000000000000000000000000000000000000..a951a4be9b13d306d2cc50dd2148e79cec10505f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_reentrant.html @@ -0,0 +1,161 @@ + + + +Boost PP re-entrant versions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Nearly all macros in VMD have equivalent reentrant versions which are meant + to be used in a BOOST_PP_WHILE loop. These are versions which have an underscore + D suffix, take the next available BOOST_PP_WHILE iteration as their first parameter, + and then have the exact same functionality as their unsuffixed equivalents. + They can be used in BOOST_PP_WHILE loops to provide slightly quicker preprocessing + but, as the documentation for BOOST_PP_WHILE and BOOST_PP_WHILE_##d explain, + they do not have to be used. +

+

+ These macros are: +

+

+ Arrays +

+
    +
  • + BOOST_VMD_IS_ARRAY_D +
  • +
  • + BOOST_VMD_IS_EMPTY_ARRAY_D +
  • +
  • + BOOST_VMD_ASSERT_IS_ARRAY_D +
  • +
+

+ Identifiers +

+
    +
  • + BOOST_VMD_IS_IDENTIFIER_D +
  • +
  • + BOOST_VMD_ASSERT_IS_IDENTIFIER_D +
  • +
+

+ Lists +

+
    +
  • + BOOST_VMD_IS_LIST_D +
  • +
  • + BOOST_VMD_IS_EMPTY_LIST_D +
  • +
  • + BOOST_VMD_ASSERT_IS_LIST_D +
  • +
+

+ Sequences +

+
    +
  • + BOOST_VMD_ELEM_D +
  • +
  • + BOOST_VMD_ENUM_D +
  • +
  • + BOOST_VMD_EQUAL_D +
  • +
  • + BOOST_VMD_GET_TYPE_D +
  • +
  • + BOOST_VMD_IS_MULTI_D +
  • +
  • + BOOST_VMD_IS_UNARY_D +
  • +
  • + BOOST_VMD_NOT_EQUAL_D +
  • +
  • + BOOST_VMD_SIZE_D +
  • +
  • + BOOST_VMD_TO_ARRAY_D +
  • +
  • + BOOST_VMD_TO_LIST_D +
  • +
  • + BOOST_VMD_TO_SEQ_D +
  • +
  • + BOOST_VMD_TO_TUPLE_D +
  • +
+

+ Seqs +

+
    +
  • + BOOST_VMD_IS_SEQ_D +
  • +
  • + BOOST_VMD_ASSERT_IS_SEQ_D +
  • +
+

+ Types +

+
    +
  • + BOOST_VMD_IS_TYPE_D +
  • +
  • + BOOST_VMD_ASSERT_IS_TYPE_D +
  • +
+

+ Other +

+
  • + BOOST_VMD_IS_PARENS_EMPTY_D +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific.html new file mode 100644 index 0000000000000000000000000000000000000000..1382380ebf03a87e8282eb5cb6ab7441efa3aadc --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific.html @@ -0,0 +1,470 @@ + + + +Specific macros for working with data types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ VMD has a number of specific macros for parsing data types. Each of these macros + asks if some input is a particular VMD data type. +

+
+ +
+ + Passing + empty arguments +
+

+ It is possible to pass an empty argument to a macro. The official terminology + for this in the C++ standard is an argument "consisting of no preprocessing + tokens". +

+

+ Let us consider a number of cases without worrying too much what the macro + output represents. +

+

+ Consider these two function-like macros: +

+
#define SMACRO() someoutput
+#define EMACRO(x) otheroutput x
+
+

+ The first macro takes no parameters so invoking it must always be done by +

+
SMACRO()
+
+

+ and passing any arguments to it would be invalid. +

+

+ The second macro takes a single parameter. it can be evoked as +

+
EMACRO(somedata)
+
+

+ but it also can be invoked as +

+
EMACRO()
+
+

+ In the second invocation of EMACRO we are passing an empty argument to the + macro. Similarly for any macro having 1 or more parameters, an empty argument + can be validly passed for any of the parameters, as in +

+
#define MMACRO(x,y,z) x y z
+
+MMACRO(1,,2)
+
+

+ An empty argument is an argument even if we are passing nothing. +

+

+ Because an empty argument can be passed for a given parameter of a macro + does not mean one should do so. Any given macro will specify what each argument + to a macro should represent, and it is has normally been very rare to encounter + a macro which specifies that an empty argument can logically be passed for + a given argument. But from the perspective of standard C++ it is perfectly + valid to pass an empty argument for a macro parameter. +

+

+ The notion of passing empty arguments can be extended to passing empty data + which "consists of no preprocessing tokens" in slightly more complicated + situations. It is possible to pass empty data as an argument to a variadic + macro in the form of variadic macro data, as in +

+
#define VMACRO(x,...) x __VA_ARGS__
+
+

+ invoked as +

+
VMACRO(somedata,)
+
+

+ Here one passes empty data as the variadic macro data and it is perfectly + valid C++. Please notice that this different from +

+
VMACRO(somedata)
+
+

+ which is not valid C++ since something must be passed for the variadic argument. + Similar one could invoke the macro as +

+
VMACRO(somedata,vdata1,,vdata3)
+
+

+ where one is passing variadic macro data but an element in the variadic macro + data is empty. +

+

+ Furthermore if we are invoking a macro which expects a Boost PP data type, + such as a tuple, we could also validly pass empty data for all or part of + the data in a tuple, as in +

+
#define TMACRO(x,atuple) x atuple
+
+TMACRO(somedata,())
+
+

+ In this case we are passing a 1 element tuple where the single element itself + is empty. +

+

+ or +

+
TMACRO(somedata,(telem1,,telem2,teleem3))
+
+

+ In this case we are passing a 4 element tuple where the second element is + empty. +

+

+ Again either invocation is valid C++ but it is not necessarily what the designed + of the macro has desired, even if in both cases the macro designer has specified + that the second parameter must be a tuple for the macro to work properly. +

+
+ + Returning + emptiness +
+

+ Similar to passing empty arguments in various ways to a macro, the data which + a macro returns ( or 'generates' may be a better term ) could be empty, in + various ways. Again I am not necessarily promoting this idea as a common + occurrence of macro design but merely pointing it out as valid C++ preprocessing. +

+
#define RMACRO(x,y,z)
+
+RMACRO(data1,data2,data3)
+
+

+ It is perfectly valid C++ to return "nothing" from a macro invocation. + In fact a number of macros in Boost PP do that based on the preprocessor + metaprogramming logic of the macro, and are documented as such. +

+

+ Similarly one could return nothing as part or all of a Boost PP data type + or even as part of variadic macro data. +

+
#define TRETMACRO(x,y,z) ()
+#define TRETMACRO1(x,y,z) (x,,y,,z)
+#define VRETMACRO(x,y,z) x,,y,,z
+
+

+ Here again we are returning something but in terms of a Boost PP tuple or + in terms of variadic data, we have elements which are empty. +

+
+ + Emptiness + in preprocessor metaprogramming +
+

+ In the examples given above where "emptiness" in one form of another + is passed as arguments to a macro or returned from a macro, the examples + I have given were created as simplified as possible to illustrate my points. + In actual preprocessor metaprogramming, using Boost PP, where complicated + logic is used to generate macro output based on the arguments to a macro, + it might be useful to allow and work with empty data if one were able to + test for the fact that data was indeed empty. +

+
+ + Testing + for empty data +
+

+ Currently Boost PP has an undocumented macro for testing whether a parameter + is empty of not, written without the use of variadic macros. The macro is + called BOOST_PP_IS_EMPTY. The macro is by its nature flawed, since there + is no generalized way of determining whether or not a parameter is empty + using the C++ preprocessor. But the macro will work given input limited in + various ways or if the input is actually empty. +

+

+ Paul Mensonides, the developer of Boost PP and the BOOST_PP_IS_EMPTY macro + in that library, also wrote a better macro using variadic macros, for determining + whether or not a parameter is empty or not, which he published on the Internet + in response to a discussion about emptiness. This macro is also not perfect, + since there is no perfect solution, but will work correctly with almost all + input. I have adapted his code for the VMD and developed my own very slightly + different code. +

+

+ The macro is called BOOST_VMD_IS_EMPTY + and will return 1 if its input is empty or 0 if its input is not empty. The + macro is a variadic macro which make take any input [1]. +

+
+ + Macro + Flaw with a standard C++ compiler +
+

+ The one situation where the macro always does not work properly is if its + input resolves to a function-like macro name or a sequence of preprocessor + tokens ending with a function-like macro name and the function-like macro + takes two or more parameters. +

+

+ Here is a simple example: +

+
#include <boost/vmd/is_empty.hpp>
+
+#define FMACRO(x,y) any_output
+
+BOOST_VMD_IS_EMPTY(FMACRO)
+BOOST_VMD_IS_EMPTY(some_input FMACRO)
+
+

+ In the first case the name of a function-like macro is being passed to BOOST_VMD_IS_EMPTY + while in the second case a sequence of preprocessing tokens is being passed + to BOOST_VMD_IS_EMPTY ending with the name of a function-like macro. The + function-like macro also has two ( or more ) parameters. In both the cases + above a compiler error will result from the use of BOOST_VMD_IS_EMPTY. +

+

+ Please note that these two problematical cases are not the same as passing + an invocation of a function-like macro name to BOOST_VMD_IS_EMPTY, as in +

+
#include <boost/vmd/is_empty.hpp>
+
+BOOST_VMD_IS_EMPTY(FMACRO(arg1,arg2))
+BOOST_VMD_IS_EMPTY(someinput FMACRO(arg1,arg2))
+
+

+ which always works correctly, unless of course a particular function-like + macro invocation resolves to either of our two previous situations. +

+

+ Another situation where the macro may not work properly is if the previously + mentioned function-like macro takes a single parameter but creates an error + when the argument passed is empty. An example of this would be: +

+
#define FMACRO(x) BOOST_PP_CAT(+,x C);
+
+

+ When nothing is passed to FMACRO undefined behavior will occur since attempting + to concatenate '+' to ' C' is UB in C++ preprocessor terms. +

+

+ So for a standard conforming compiler we have essentially a single corner + case where the BOOST_VMD_IS_EMPTY does not work and, when it does not work + it, produces a compiler error rather than an incorrect result. Essentially + what is desired for maximum safety is that we never pass input ending with + the name of a function-like macro name when testing for emptiness. +

+
+ + Macro + Flaw with Visual C++ +
+

+ The VC++ preprocessor is not a standard C++ conforming preprocessor in at + least two relevant situations to our discussion of emptiness. These situations + combine to create a single corner case which causes the BOOST_VMD_IS_EMPTY + macro to not work properly using VC++ when the input resolves to a function-like + macro name. +

+

+ The first situation, related to our discussion of emptiness, where the VC++ + preprocessor is not a standard C++ conforming preprocessor is that if a macro + taking 'n' number of parameters is invoked with 0 to 'n-1' parameters, the + compiler does not give an error, but only a warning. +

+
#define FMACRO(x,y) x + y
+
+FMACRO(1)
+
+

+ should give a compiler error, as it does when using a C++ standard-conforming + compiler, but when invoked using VC++ it only gives a warning and VC++ continues + macro substitution with 'y' as a placemarker preprocessing token. This non-standard + conforming action actually eliminates the case where BOOST_VMD_IS_EMPTY does + not work properly with a standard C++ conforming compiler. But of course + it has the potential of producing incorrect output in other macro processing + situations unrelated to the BOOST_VMD_IS_EMPTY invocation, where a compiler + error should occur. +

+

+ A second general situation, related to our discussion of emptiness, where + the VC++ preprocessor is not a standard C++ conforming preprocessor is that + the expansion of a macro works incorrectly when the expanded macro is a function-like + macro name followed by a function-like macro invocation, in which case the + macro re-expansion is erroneously done more than once. This latter case can + be seen by this example: +

+
#define FMACRO1(parameter) FMACRO3 parameter()
+#define FMACRO2() ()
+#define FMACRO3() 1
+
+FMACRO1(FMACRO2)
+
+should expand to:
+
+FMACRO3()
+
+but in VC++ it expands to:
+
+1
+
+

+ where after initially expanding the macro to: +

+
FMACRO3 FMACRO2()
+
+

+ VC++ erroneously rescans the sequence of preprocessing tokens more than once + rather than rescan just one more time for more macro names. +

+

+ What these two particular preprocessor flaws in the VC++ compiler mean is + that although BOOST_VMD_IS_EMPTY does not fail with a compiler error in the + same case as with a standard C++ conforming compiler given previously, it + fails by giving the wrong result in another situation. +

+

+ The failing situation is: +

+

+ when the input to BOOST_VMD_IS_EMPTY resolves to only a function-like macro + name, and the function-like macro, when passed a single empty argument, expands + to a Boost PP tuple, BOOST_VMD_IS_EMPTY will erroneously return 1 when using + the Visual C++ compiler rather than either give a preprocessing error or + return 0. +

+

+ Here is an example of the failure: +

+
#include <boost/vmd/is_empty.hpp>
+
+#define FMACRO4() ( any_number_of_tuple_elements )
+#define FMACRO5(param) ( any_number_of_tuple_elements )
+#define FMACRO6(param1,param2) ( any_number_of_tuple_elements )
+
+BOOST_VMD_IS_EMPTY(FMACRO4) // erroneously returns 1, instead of 0
+BOOST_VMD_IS_EMPTY(FMACRO5) // erroneously returns 1, instead of 0
+BOOST_VMD_IS_EMPTY(FMACRO6) // erroneously returns 1, instead of generating a preprocessing error
+
+

+ As with a standard C++ conforming compiler, we have a rare corner case where + the BOOST_VMD_IS_EMPTY will not work properly, but unfortunately in this + very similar but even rarer corner case with VC++, we will silently get an + incorrect result rather than a compiler error. +

+

+ I want to reiterate that there is no perfect solution in C++ to the detection + of emptiness even for a C++ compiler whose preprocessor is completely conformant, + which VC++ obviously is not. +

+
+ + Macro + Flaw conclusion +
+

+ With all of the above mentioned, the case(s) where BOOST_VMD_IS_EMPTY will + work incorrectly are very small, even with the erroneous VC++ preprocessor, + and I consider the macro worthwhile to use since it works correctly with + the vast majority of possible preprocessor input. +

+

+ The case where it will not work, with both a C++ standard conforming preprocessor + or with Visual C++, occurs when the name of a function-like macro is part + of the input to BOOST_VMD_IS_EMPTY. Obviously the macro should be used by + the preprocessor metaprogrammer when the possible input to it is constrained + to eliminate the erroneous case. +

+

+ Furthermore, since emptiness can correctly be tested for in nearly every + situation, the BOOST_VMD_IS_EMPTY macro can be used internally when the preprocessor + metaprogrammer wants to return data from a macro and all or part of that + data could be empty. +

+

+ Therefore I believe the BOOST_VMD_IS_EMPTY macro is quite useful, despite + the corner case flaw which makes it imperfect. Consequently I believe that + the preprocessor metaprogrammer can use the concept of empty preprocessor + data in the design of his own macros. +

+
+ + Using + the macro +
+

+ The macro BOOST_VMD_IS_EMPTY is used internally throughout VMD and macro + programmers may find this macro useful in their own programming efforts despite + the slight flaw in the way that it works. +

+

+ You can use the general header file: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or you can use the individual header file: +

+
#include <boost/vmd/is_empty.hpp>
+
+

+ for the BOOST_VMD_IS_EMPTY macro. +

+
+
+

+

[1] + For VC++ 8 the input is not variadic data but a single parameter +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_constraints.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_constraints.html new file mode 100644 index 0000000000000000000000000000000000000000..db5a9d514fca92f2966f334bc3682e3a791ded54 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_constraints.html @@ -0,0 +1,135 @@ + + + +Macro constraints + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ When discussing the BOOST_VMD_IS_EMPTY macro I mentioned constraining input + to the macro. Now I will discuss what this means in terms of preprocessor + metaprogramming and input to macros in general. +

+
+ + Constrained + input +
+

+ When a programmer designs any kinds of callables in C++ ( functions, member + functions etc. ), he specifies what the types of input and the return value + are. The C++ compiler enforces this specification at compile time. Similarly + at run-time a callable may check that its input falls within certain documented + and defined boundaries and react accordingly if it does not. This is all + part of the constraints for any callable in C++ and should be documented + by any good programmer. +

+

+ The C++ preprocessor is much "dumber" than the C++ compiler and + even with the preprocessor metaprogramming constructs which Paul Mensonides + has created in Boost PP there is far less the preprocessor metaprogrammer + can do at preprocessing time to constrain argument input to a macro than + a programmer can do at compile-time and/or at run-time to constrain argument + input to a C++ callable. Nevertheless it is perfectly valid to document what + a macro expects as its argument input and, if a programmer does not follow + the constraint, the macro will fail to work properly. In the ideal case in + preprocessor metaprogramming the macro could tell whether or not the constraint + was met and could issue some sort of intelligible preprocessing error when + this occurred, but even within the reality of preprocessor metaprogramming + with Boost PP this is not always possible to do. Nevertheless if the user + of a macro does not follow the constraints for a macro parameter, as specified + in the documentation of a particular macro being invoked, any error which + occurs is the fault of that user. I realize that this may go against the + strongly held concept that programming errors must always be met with some + sort of compile-time or run-time occurrence which allows the programmer to + correct the error, rather than a silent failure which masks the error. Because + the preprocessor is "dumber" and cannot provide this occurrence + in all cases the error could unfortunately be masked, despite the fact that + the documentation specifies the correct input constraint(s). In the case + of the already discussed macro BOOST_VMD_IS_EMPTY, this masking of the error + could only occur with a preprocessor ( Visual C++ ) which is not C++ standard + conformant. +

+

+ The Boost PP library does have a way of generating a preprocessing error, + without generating preprocessor output, but once again this way does not + work with the non-conformant preprocessor of Visual C++. The means to do + so using Boost PP is through the BOOST_PP_ASSERT macro. As will be seen and + discussed later VMD has an equivalent macro which will work with Visual C++ + by producing incorrect C++ output rather than a preprocessing error, but + even this is not a complete solution since the incorrect C++ output produced + could be hidden. +

+

+ Even the effort to produce a preprocessing error, or incorrect output inducing + a compile-time error, does not solve the problem of constrained input for + preprocessor metaprogramming. Often it is impossible to determine if the + input meets the constraints which the preprocessor metaprogrammer places + on it and documents. Certain preprocessing tokens cannot be checked reliably + for particular values, or a range of values, without the checking mechanism + itself creating a preprocessing error or undefined behavior. +

+

+ This does not mean that one should give up attempting to check macro input + constraints. If it can be done I see the value of such checks and a number + of VMD macros, discussed later, are designed as preprocessing input constraint + checking macros. But the most important thing when dealing with macro input + constraints is that they should be carefully documented, and that the programmer + should know that if the constraints are not met either preprocessing errors + or incorrect macro results could be the results. +

+

+ The VMD library, in order to present more preprocessor programming functionality + and flexibility, allows that erroneous results could occur if certain input + constraints are not met, whether the erroneous results are preprocessing + errors or incorrect output from a VMD macro. At the same time the VMD does + everything that the preprocessor is capable of doing to check the input constraints, + and carefully documents for each macro in the library what the input for + each could be in order to avoid erroneous output. +

+

+ Documented macro input constraints are just as valid in the preprocessor + as compile-time/run-time constraints are valid in C++, even if the detection + of such constraints and/or the handling of constraints that are not met are + far more difficult, if not impossible, in the preprocessor than in the compile-time/run-time + processing of C++. +

+

+ The VMD library uses constraints for most of it macros and the documentation + for those macros mentions the constraints that apply in order to use the + macro. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_identifier.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_identifier.html new file mode 100644 index 0000000000000000000000000000000000000000..13424d820b0eefc1a41740808eb1346bcc293b98 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_identifier.html @@ -0,0 +1,262 @@ + + + +Identifiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ An identifier in VMD is either of two lower-level preprocessor possibilities: +

+
    +
  • + a preprocessing token 'identifier', which is essentially a sequence of + alphanumeric characters and the underscore character with the first character + not being a numeric character. +
  • +
  • + a preprocessing token 'pp-number' that is an integral literal token. +
  • +
+

+ Here are some examples: +

+
SOME_NAME
+_SOME_NAME
+SOME_123_NAME
+some_123_name
+sOMe_123_NAmE
+2367
+43e11
+0
+22
+654792
+0x1256
+
+
+ + Problem + testing any identifier +
+

+ One of the difficulties with identifiers in preprocessor metaprogramming + is safely testing for a particular one. VMD has a means of doing this within + a particular constraint for the characters that serve as the input. +

+

+ The constraint is that the beginning input character, ignoring any whitespace, + passed as the input to test must be either: +

+
    +
  • + an identifier character, ie. an alphanumeric or an underscore +
  • +
  • + the left parenthesis of a tuple +
  • +
+

+ and if the first character is not the left parenthesis of a tuple the remaining + characters must be alphanumeric or an underscore until a space character + or end of input occurs. +

+

+ If this is not the case the behavior is undefined, and most likely a preprocessing + error will occur. +

+

+ Given the input: +

+
's_anything' : can be tested
+'S_anything' : can be tested
+'s_anYthiNg' : can be tested
+'_anything' : can be tested
+'_Anything' : can be tested
+'_anytHIng' : can be tested
+'24' : can be tested
+'245e2' : can be tested
+'(anything)' : can be tested, tuple
+'(anything) anything' : can be tested, tuple and further input
+'anything anything' : can be tested, identifier followed by space character
+
+'%_anything' : undefined behavior and most likely a preprocessing error due to the constraint
+'(_anything' : undefined behavior and most likely a preprocessing error due to the constraint, since a single '(' does not form a tuple
+'44.3' : undefined behavior and most likely a preprocessing error due to the constraint since '.' is not alphanumeric
+
+
+ + Identifying + an identifier +
+

+ In VMD the only way an identifier can be identified in preprocessor input + is by a process called registration. In order to 'register' an identifier + to be recognized by VMD the end-user must create, for every identifier to + be recognized, an object-like macro whose form is: +

+
#define BOOST_VMD_REGISTER_identifier (identifier)
+
+

+ where 'identifier' is a particular identifier we wish to identify. This is + called in VMD a registration macro. +

+

+ It is recommended that such registration macros be created in a header file + which can be included before the end-user uses the identifier macros of VMD. +

+

+ If a particular registration macro occurs more than once it is not a preprocessing + error, so duplicating a registration macro will not lead to any problems + since each registration macro of the same name will have the exact same object-like + macro expansion. +

+

+ Within a given translation unit it could potentially happen that registration + macros have been included by header files which a particular end-user of + VMD has not created. This should also not lead to particular problems since + registration is a process for adding identifiers for any particular translation + unit. As we shall see VMD has macros for not only finding any identifier + in preprocessor input but for also finding any particular identifier in preprocessor + input. +

+
+ + Testing + for an identifier macro +
+

+ The specific macro used to test for an identifier in VMD is called BOOST_VMD_IS_IDENTIFIER. + The macro takes one required parameter which is the input against which to + test. +

+

+ When we invoke BOOST_VMD_IS_IDENTIFIER it returns 1 if the input represents + any registered identifier, otherwise it returns 0. +

+

+ As an example: +

+
#include <boost/vmd/is_identifier.hpp>
+
+#define BOOST_VMD_REGISTER_yellow (yellow)
+#define BOOST_VMD_REGISTER_green  (green)
+#define BOOST_VMD_REGISTER_blue   (blue)
+
+BOOST_VMD_IS_IDENTIFIER(some_input) // returns 1 if 'some_input' is 'yellow','green', or 'blue'
+BOOST_VMD_IS_IDENTIFIER(some_input) // returns 0 if 'some_input' is 'purple'
+
+

+ Essentially only registered identifiers can be found in VMD as identifiers. +

+
+ + Detecting + a particular identifier +
+

+ Although registering an identifier allows VMD to recognize the string of + characters as a VMD identifier, the ability to detect a particular identifier + needs the end-user to define another macro: +

+
#define BOOST_VMD_DETECT_identifier_identifier
+
+

+ where 'identifier' is a particular identifier we wish to detect. This object-like + macro expands to no output. +

+

+ Like the registration macro multiple detection macros of the same identifier + in a translation unit does not cause a compiler problem since the exact same + object-like macro occurs. +

+

+ The term for creating this macro is that we have potentially 'pre-detected' + the identifier and I will use the term pre-detected as the process of creating + the BOOST_VMD_DETECT macro. +

+

+ The ability to detect that a VMD identifier is a particular identifier is + used in VMD macros when data is compared for equality/inequality as well + as when we want to match an identifier against a set of other identifiers. + These situations will be explained later in the documentation when the particular + macro functionality is discussed. If the programmer never uses the functionality + which these situations encompass there is no need to use pre-detection for + a registered identifier. +

+
+ + Parsing + identifiers and undefined behavior +
+

+ The technique for parsing identifiers, once it is determined that the input + being parsed does not begin with a set of parentheses, uses preprocessor + concatenation in its parsing. This technique involves the preprocessor '##' + operator to concatenate input, and examine the results of that concatenation. +

+

+ When preprocessor concatenation is used the result of the concatenation must + be a valid preprocessing token, else the behavior of the preprocessor is + undefined. In C++ 'undefined behavior' in general means that anything can + happen. In practical use when preprocessor concatenation does not produce + a valid preprocessing token, a compiler is most likely to generate a preprocessing + error. If the compiler chooses not to issue a preprocessing error the outcome + will always mean that parsing an identifier will fail. But because the outcome + is undefined behavior there is no absolute way that the programmer can determine + what the outcome will be when preprocessor concatenation is used and the + input being parsed contains preprocessor input which does not meet the constraints + for parsing an identifier mentioned at the beginning of this topic. +

+

+ In this documentation I will be using the abbreviation 'UB' as the shortened + form of 'undefined behavior' to denote the particular occurrence where VMD + attempts to parse preprocessor input using preprocessor concatenation and + undefined behavior will occur. +

+
+ + Usage +
+

+ To use the BOOST_VMD_IS_IDENTIFIER macro either include the general header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/is_identifier.hpp>
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_identifying.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_identifying.html new file mode 100644 index 0000000000000000000000000000000000000000..9227f838c7ec931272457cfe861e963529ee9d93 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_identifying.html @@ -0,0 +1,135 @@ + + + +Identifying data types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Identifying + macros and BOOST_VMD_IS_EMPTY +
+

+ The various macros for identifying VMD data types complement the ability + to identify emptiness using BOOST_VMD_IS_EMPTY. The general name I will use + in this documentation for these specific macros is "identifying macros." + The identifying macros also share with BOOST_VMD_IS_EMPTY the inherent flaw + mentioned when discussing BOOST_VMD_IS_EMPTY, since they themselves use BOOST_VMD_IS_EMPTY + to determine that the input has ended. +

+

+ To recapitulate the flaw with BOOST_VMD_IS_EMPTY: +

+
    +
  • + using a standard C++ compiler if the input ends with the name of a function-like + macro, and that macro takes two or more parameters, a preprocessing error + will occur. +
  • +
  • + using the VC++ compiler if the input consists of the name of a function-like + macro, and that macro when invoked with no parameters returns a tuple, + the macro erroneously returns 1, meaning that the input is empty. +
  • +
  • + even if the function-like macro takes one parameter, passing emptiness + to that macro could cause a preprocessing error. +
  • +
+

+ The obvious way to avoid the BOOST_VMD_IS_EMPTY problem with the identifying + macros is to design input so that the name of a function-like macro is never + passed as a parameter. This can be done, if one uses VMD and has situations + where the input could contain a function-like macro name, by having that + function-like macro name placed within a Boost PP data type, such as a tuple, + without attempting to identify the type of the tuple element using VMD. In + other word if the input is: +

+
( SOME_FUNCTION_MACRO_NAME )
+
+

+ and we have the macro definition: +

+
#define SOME_FUNCTION_MACRO_NAME(x,y) some_output
+
+

+ VMD can still parse the input as a tuple, if desired, using BOOST_VMD_IS_TUPLE + without encountering the BOOST_VMD_IS_EMPTY problem. However if the input + is: +

+
SOME_FUNCTION_MACRO_NAME
+
+

+ either directly or through accessing the above tuple's first element, and + the programmer attempts to use BOOST_VMD_IS_IDENTIFIER with this input, the + BOOST_VMD_IS_EMPTY problem will occur. +

+
+ + Identifying + macros and programming flexibility +
+

+ The VMD identifying macros give the preprocessor metaprogrammer a great amount + of flexibility when designing macros. It is not merely the flexibility of + allowing direct parameters to a macro to be different data types, and having + the macro work differently depending on the type of data passed to it, but + it is also the flexibility of allowing individual elements of the higher + level Boost PP data types to be different data types and have the macro work + correctly depending on the type of data type passed as part of those elements. +

+

+ With this flexibility also comes a greater amount of responsibility. For + the macro designer this responsibility is twofold: +

+
    +
  • + To carefully document the possible combinations of acceptable data and + what they mean. +
  • +
  • + To balance flexibility with ease of use so that the macro does not become + so hard to understand that the programmer invoking the macro gives up + using it entirely. +
  • +
+

+ For the programmer invoking a macro the responsibility is to understand the + documentation and not attempt to pass to the macro data which may cause incorrect + results or preprocessing errors. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_number.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_number.html new file mode 100644 index 0000000000000000000000000000000000000000..131e99001106a0938792f881d38d01a98dfe4ee6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_number.html @@ -0,0 +1,154 @@ + + + +Numbers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ A number in VMD is a preprocessing 'pp-number', limited to a Boost PP number. + This is an integral literal between 0 and 256. The form of the number does + not contain leading zeros. Acceptable as numbers are: +

+
0
+127
+33
+254
+18
+
+

+ but not: +

+
033
+06
+009
+00
+
+
+ + Problem + testing any number +
+

+ As can be seen from the explanation of an identifier, a number is merely + a small subset of all possible identifiers, for which VMD internally provides + registration macros for its use and pre-detection macros for its use. Therefore + the particular constraint on the input to test is exactly the same as for + identifiers. +

+

+ The constraint is that the beginning input character, ignoring any whitespace, + passed as the input to test must be either: +

+
    +
  • + an identifier character, ie. an alphanumeric or an underscore +
  • +
  • + the left parenthesis of a tuple +
  • +
+

+ and if the first character is not the left parenthesis of a tuple the remaining + characters must be alphanumeric or an underscore until a space character + or end of input occurs. +

+

+ If this is not the case the behavior is undefined, and most likely a preprocessing + error will occur. +

+
+ + Testing + for a number macro +
+

+ The macro used to test for any number in VMD is called BOOST_VMD_IS_NUMBER. + The macro takes a single parameter, the input to test against. +

+

+ The macro returns 1 if the parameter is a Boost PP number, otherwise the + macro returns 0. +

+

+ The Boost PP library has a great amount of functionality for working with + numbers, so once you use VMD to parse/test for a number you can use Boost + PP to work with that number in various ways. The VMD makes no attempt to + duplicate the functionality of numbers that in the Boost PP library. +

+

+ Any number is also an identifier, which has been registered and pre-detected, + so you can also use the VMD functionality which works with identifiers to + work with a number as an identifier if you like. +

+
+ + Example +
+

+ Let us look at an example of how to use BOOST_VMD_IS_NUMBER. +

+
#include <boost/vmd/is_number.hpp>
+
+BOOST_VMD_IS_NUMBER(input)
+
+returns:
+
+if input = 0, 1
+if input = 44, 1
+if input = SQUARE, 0
+if input = 44 DATA, 0 since there are tokens after the number
+if input = 044, 0 since no leading zeros are allowed for our Boost PP numbers
+if input = 256, 1
+if input = 257, 0 since it falls outside the Boost PP number range of 0-256
+if input = %44, does not meet the constraint therefore undefined behavior
+if input = 44.0, does not meet the constraint therefore undefined behavior
+if input = ( 44 ), 0 since the macro begins with a tuple and this can be tested for
+
+
+ + Usage +
+

+ To use the BOOST_VMD_IS_NUMBER macro either include the general header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/is_number.hpp>
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_pp_data_types.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_pp_data_types.html new file mode 100644 index 0000000000000000000000000000000000000000..454d27144c59a71ea50bd8d14ca91e664c256a4a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_pp_data_types.html @@ -0,0 +1,379 @@ + + + +VMD and Boost PP data types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ VMD is able to determine whether or not preprocessing input is a given Boost + PP data type. The VMD macros to do this are: +

+
    +
  • + BOOST_VMD_IS_ARRAY for an array +
  • +
  • + BOOST_VMD_IS_LIST for a list +
  • +
  • + BOOST_VMD_IS_SEQ for a seq +
  • +
  • + BOOST_VMD_IS_TUPLE for a tuple +
  • +
+

+ Each of these macros take a single parameter as input and return 1 if the + parameter is the appropriate data type and 0 if it is not. +

+
+ + Syntax + anomalies +
+

+ Both an array and a non-empty list are also a tuple. So if one has: +

+
#define ANARRAY (3,(a,b,c))
+#define ALIST (a,(b,(c,BOOST_PP_NIL)))
+#define ATUPLE (a,b,c)
+#define ASEQ (a)(b)(c)
+
+

+ then +

+
#include <boost/vmd/is_tuple.hpp>
+
+BOOST_VMD_IS_TUPLE(ANARRAY) returns 1
+BOOST_VMD_IS_TUPLE(ALIST) returns 1
+BOOST_VMD_IS_TUPLE(ATUPLE) returns 1
+BOOST_VMD_IS_TUPLE(ASEQ) returns 0
+
+

+ A list whose first element is the number 2 and whose second element is not + the end-of-list marker BOOST_PP_NIL is also an array. So if one has: +

+
#define ALIST (2,(3,BOOST_PP_NIL))
+#define ALIST2 (2,(3,(4,BOOST_PP_NIL)))
+#define ALIST3 (2,BOOST_PP_NIL)
+
+#include <boost/vmd/is_array.hpp>
+#include <boost/vmd/is_list.hpp>
+
+BOOST_VMD_IS_LIST(ALIST) returns 1
+BOOST_VMD_IS_LIST(ALIST2) returns 1
+BOOST_VMD_IS_LIST(ALIST3) returns 1
+BOOST_VMD_IS_ARRAY(ALIST) returns 1
+BOOST_VMD_IS_ARRAY(ALIST2) returns 1
+BOOST_VMD_IS_ARRAY(ALIST3) returns 0
+
+

+ A single element tuple is also a one element seq. So if one has: +

+
#define ASE_TUPLE (a)
+
+

+ then +

+
#include <boost/vmd/is_seq.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+BOOST_VMD_IS_TUPLE(ASE_TUPLE) returns 1
+BOOST_VMD_IS_SEQ(ASE_TUPLE) returns 1
+
+
+ + Problem + when testing an array +
+

+ The form of an array is a two element tuple, where the first element is a + number and the second element is a tuple. The number specifies the size of + the tuple. Since when using variadic macros it is never necessary to specify + the size of a tuple, an array is largely obsolete. However VMD still supports + it. +

+

+ The problem when testing for an array is that if the first element does not + obey the constraint on testing for a number, you will get UB. +

+
#include <boost/vmd/is_array.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+#define A_TUPLE (&anything,(1,2))
+
+BOOST_VMD_IS_ARRAY(A_TUPLE) will give UB due to the constraint
+BOOST_VMD_IS_TUPLE(A_TUPLE) will return 1
+
+

+ When VMD attempts to parse for an array, as it does when the BOOST_VMD_IS_ARRAY + is used, if first looks to see if the syntax represents a tuple with two + elements. Next it looks to see if the second element itself is a tuple. Finally + if it is satisfied that the previous checks are valid it tests whether the + first element is a number or not. It is in this final test, that the first + element is a valid number, where the UB could occur as explained in the topic + 'Numbers'. +

+
+ + Problem + when testing a list +
+

+ The form of a non-empty list is a two element tuple, where the first element + is the head of the list and can be anything and the second element is itself + a list or the end-of-list identifier BOOST_PP_NIL. +

+

+ The problem when testing for a list is that if the second element does not + obey the constraint on testing for an identifier, since BOOST_PP_NIL is an + identifier and is tested as such, you will get UB. +

+
#include <boost/vmd/is_list.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+#define A_TUPLE (element,&anything)
+
+BOOST_VMD_IS_LIST(A_TUPLE) will give UB due to the constraint
+BOOST_VMD_IS_TUPLE(A_TUPLE) will return 1
+
+

+ The form of an empty list is the identifier BOOST_PP_NIL. Therefore: +

+
#include <boost/vmd/is_identifier.hpp>
+#include <boost/vmd/is_list.hpp>
+
+#define A_BAD_EMPTY_LIST &BOOST_PP_NIL
+
+BOOST_VMD_IS_LIST(A_BAD_EMPTY_LIST) will give UB due to the constraint
+BOOST_VMD_IS_IDENTIFIER(A_BAD_EMPTY_LIST) will give UB due to the constraint
+
+

+ When VMD attempts to parse for a list, as it does when the BOOST_VMD_IS_LIST + is used, if first looks to see if the syntax represents a tuple with two + elements. If it is not a tuple with two elements it will check for the end-of-list. + If it is a tuple with two elements it looks to see if the second element + is a list. In both these paths it must always eventually check for the end-of-list + notation BOOST_PP_NIL, which is an identifier in VMD. It is in this final + test, that the end-of-list notation exists as a VMD identifier, where the + UB could occur as explained in the topic 'Identifiers'. +

+
+ + Distinguishing + a seq and a tuple +
+

+ As has previously been mentioned a single element tuple is also a one element + seq. +

+

+ However, as will be discussed later in the documentation, when VMD has to + determine the type of such data, it always returns it as a tuple ( BOOST_VMD_TYPE_TUPLE + ). +

+

+ If our data consists of more than one consecutive tuple of a single element + the data is a seq: +

+
#include <boost/vmd/is_seq.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+#define ST_DATA (somedata)(some_other_data)
+
+BOOST_VMD_IS_SEQ(ST_DATA) will return 1
+BOOST_VMD_IS_TUPLE(ST_DATA) will return 0
+
+

+ However if the data consists of a mixture we need to distinguish how VMD + parses the data. The rule is that VMD always parses a single element tuple + as a tuple unless it is followed by one or more single element tuples, in + which case it is a seq. +

+
#define ST_DATA (somedata)(element1,element2)
+
+

+ VMD parses the above data as 2 consecutive tuples. The first tuple is the + single element tuple '(somedata)' and the second tuple is the multi element + tuple '(element1,element2)'. +

+
#define ST_DATA (element1,element2)(somedata)
+
+

+ VMD parses the above data as 2 consecutive tuples. The first tuple is the + multi element tuple '(element1,element2)' and the second tuple is the single + element tuple '(somedata)'. +

+
#define ST_DATA (somedata)(some_other_data)(element1,element2)
+
+

+ VMD parses the above data as a seq followed by a tuple. The seq is '(somedata)(some_other_data)' + and the tuple is '(element1,element2)'. +

+
+ + Empty + Boost PP data types +
+

+ An array and a list can be empty. +

+

+ An empty array has the form '(0,())', and is a perfectly valid array. +

+

+ You can test for an empty array using the macro BOOST_VMD_IS_EMPTY_ARRAY. +

+
#include <boost/vmd/is_array.hpp>
+#include <boost/vmd/is_empty_array.hpp>
+
+#define AN_ARRAY (1,(1))
+#define AN_EMPTY_ARRAY (0,())
+
+BOOST_VMD_IS_ARRAY(AN_ARRAY) will return 1
+BOOST_VMD_IS_ARRAY(AN_EMPTY_ARRAY) will return 1
+
+BOOST_VMD_IS_EMPTY_ARRAY(AN_EMPTY_ARRAY) will return 1
+BOOST_VMD_IS_EMPTY_ARRAY() will return 0
+BOOST_VMD_IS_EMPTY_ARRAY(AN_ARRAY) will return 0
+
+

+ An empty list has the form 'BOOST_PP_NIL', and is a perfectly valid list. +

+

+ You can test for an empty list using the macro BOOST_VMD_IS_EMPTY_LIST. +

+
#include <boost/vmd/is_empty_list.hpp>
+#include <boost/vmd/is_list.hpp>
+
+#define A_LIST (1,BOOST_PP_NIL)
+#define AN_EMPTY_LIST BOOST_PP_NIL
+
+BOOST_VMD_IS_LIST(A_LIST) will return 1
+BOOST_VMD_IS_LIST(AN_EMPTY_LIST) will return 1
+
+BOOST_VMD_IS_EMPTY_LIST(AN_EMPTY_LIST) will return 1
+BOOST_VMD_IS_EMPTY_LIST() will return 0
+BOOST_VMD_IS_EMPTY_LIST(A_LIST) will return 0
+
+

+ Neither seqs or tuples can be empty when using Boost PP. Because of this + if you convert from an empty array or list to a seq or tuple using Boost + PP macros to do so you will get undefined behavior. +

+

+ The syntax '()', which is called an empty parenthesis, is neither a zero-element + seq or a tuple consisting of no elements. Rather it is either a one-element + seq whose content is emptiness or a single-element tuple whose content is + emptiness. +

+

+ VMD supports the syntax of an empty parenthesis. You can test for it using + the macro BOOST_VMD_IS_PARENS_EMPTY. +

+
#include <boost/vmd/is_parens_empty.hpp>
+#include <boost/vmd/is_seq.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+#define EMPTY_PARENS ()
+#define TUPLE (0)
+#define SEQ (0)(1)
+
+BOOST_VMD_IS_TUPLE(EMPTY_PARENS) will return 1
+BOOST_VMD_IS_SEQ(EMPTY_PARENS) will return 1
+
+BOOST_VMD_IS_PARENS_EMPTY(EMPTY_PARENS) will return 1
+BOOST_VMD_IS_PARENS_EMPTY() will return 0
+BOOST_VMD_IS_PARENS_EMPTY(TUPLE) will return 0
+BOOST_VMD_IS_PARENS_EMPTY(SEQ) will return 0
+
+

+ The VC++8 compiler ( Visual Studio 2005 ), which is the oldest VC++ version + which VMD supports, has trouble working with the empty parenthesis syntax. + Therefore if you have to use VC++8 avoid its use, otherwise you should be + fine using it if you desire. +

+
+ + Using + a tuple instead of an array +
+

+ When using variadic macros, the fact that an array can be empty is its only + advantage over a tuple. Otherwise using a tuple is always easier since the + syntax is simpler; you never have to notate the tuple's size. +

+

+ Since VMD fully supports passing and returning emptiness you could use a + tuple instead of an array in all situations and simply pass or return emptiness + to represent an "empty" tuple, and as an equivalent to an empty + array. +

+

+ This notion of using emptiness to represent an "empty" tuple can + also be extended to using emptiness to represent an "empty" seq. + However functionality in Boost PP will not recognize emptiness as an empty + tuple or seq, nor can you work with emptiness to represent an empty tuple + or empty seq using the Boost PP functionality for a tuple or a seq. For a + solution to using emptiness to represent an "empty" tuple or an + "empty" seq VMD has functionality which will be explained when + we look at our last area of functionality in VMD, useful variadic macros + not in Boost PP. +

+
+ + Usage +
+

+ You can use the general header file: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or you can use individual header files for each of these macros. The individual + header files are: +

+
#include <boost/vmd/is_array.hpp> //  for the BOOST_VMD_IS_ARRAY macro
+#include <boost/vmd/is_list.hpp> //  for the BOOST_VMD_IS_LIST macro
+#include <boost/vmd/is_seq.hpp> //  for the BOOST_VMD_IS_SEQ macro
+#include <boost/vmd/is_tuple.hpp> // for the BOOST_VMD_IS_TUPLE macro.
+
+#include <boost/vmd/is_empty_array.hpp> // for the BOOST_VMD_IS_EMPTY_ARRAY macro.
+#include <boost/vmd/is_empty_list.hpp> // for the BOOST_VMD_IS_EMPTY_LIST macro.
+#include <boost/vmd/is_parens_empty.hpp> // for the BOOST_VMD_IS_PARENS_EMPTY macro.
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_type.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_type.html new file mode 100644 index 0000000000000000000000000000000000000000..d2363365854845a2d3a2594075521b0f0182c7de --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_specific/vmd_type.html @@ -0,0 +1,153 @@ + + + +Types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Types +

+

+ A subset of identifiers is VMD types, called a 'v-type'. These are identifiers + which represent all of the preprocessor data types which VMD can parse. This + subset of identifiers is automatically registered and pre-detected by VMD. + Each identifier type begins with the unique prefix 'BOOST_VMD_TYPE_'. +

+

+ The actual types are: +

+
    +
  • + BOOST_VMD_TYPE_EMPTY, represents emptiness, ie. "empty data" +
  • +
  • + BOOST_VMD_TYPE_ARRAY, a Boost PP array +
  • +
  • + BOOST_VMD_TYPE_LIST, a Boost PP list +
  • +
  • + BOOST_VMD_TYPE_SEQ, a Boost PP seq +
  • +
  • + BOOST_VMD_TYPE_TUPLE, a Boost PP tuple +
  • +
  • + BOOST_VMD_TYPE_IDENTIFIER, identifier +
  • +
  • + BOOST_BMD_TYPE_NUMBER, a number +
  • +
  • + BOOST_VMD_TYPE_TYPE, a type itself +
  • +
  • + BOOST_VMD_TYPE_SEQUENCE, a sequence +
  • +
  • + BOOST_VMD_TYPE_UNKNOWN, an unknown type +
  • +
+

+ Since a v-type is itself an identifier the particular constraint on the input + to test is exactly the same as for identifiers. +

+

+ The constraint is that the beginning input character, ignoring any whitespace, + passed as the input to test must be either: +

+
    +
  • + an identifier character, ie. an alphanumeric or an underscore +
  • +
  • + the left parenthesis of a tuple +
  • +
+

+ and if the first character is not the left parenthesis of a tuple the remaining + characters must be alphanumeric or an underscore until a space character + or end of input occurs. +

+

+ If this is not the case the behavior is undefined, and most likely a preprocessing + error will occur. +

+

+ The macro used to test for a particular type in VMD is called BOOST_VMD_IS_TYPE. + The macro takes a single parameter, the input to test against. +

+

+ The macro returns 1 if the parameter is a v-type, otherwise the macro returns + 0. +

+

+ A v-type is also an identifier, which has been registered and pre-detected, + so you can also use the VMD functionality which works with identifiers to + work with a v-type as an identifier if you like. +

+
+ + Example +
+

+ Let us look at an example of how to use BOOST_VMD_IS_TYPE. +

+
#include <boost/vmd/is_type.hpp>
+
+BOOST_VMD_IS_TYPE(input)
+
+returns:
+
+if input = BOOST_VMD_TYPE_SEQ, 1
+if input = BOOST_VMD_TYPE_NUMBER, 1
+if input = SQUARE, 0
+if input = BOOST_VMD_TYPE_IDENTIFIER DATA, 0 since there are tokens after the type
+if input = %44, does not meet the constraint therefore undefined behavior
+if input = ( BOOST_VMD_TYPE_EMPTY ), 0 since the macro begins with a tuple and this can be tested for
+
+
+ + Usage +
+

+ To use the BOOST_VMD_IS_TYPE macro either include the general header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/is_type.hpp>
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful.html new file mode 100644 index 0000000000000000000000000000000000000000..20506735eb173a7b218d4cc6be73c8ccf945c75f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful.html @@ -0,0 +1,266 @@ + + + +Useful variadic macros not in Boost PP + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Previous sections of this documentation have explained how VMD can be used + to parse VMD data types, as well as recognize emptiness. +

+

+ Another area of functionality of VMD involves useful variadic macros, based + on the previous functionality, which expands on similar macros already in Boost + PP. These variadic macros can be divided into sections illustrating these areas + of behavior: +

+
    +
  1. + Expanded assertion macros +
  2. +
  3. + Expanded identity functionality +
  4. +
  5. + Expanded seq and tuple functionality for "empty" seqs and tuples +
  6. +
+

+ Sub-sections for each of these now follow in the documentation. +

+
+ +

+ The VMD macros for identifying data types work best when the macro logic + can take different paths depending on the type of data being passed for a + macro parameter. But occasionally the preprocessor metaprogrammer wants to + simply verify that the macro parameter data is of the correct data type, + else a preprocessing error should be generated to notify the programmer invoking + the macro that the data passed is the incorrect type. +

+
+ + Using + BOOST_VMD_ASSERT +
+

+ The Boost PP library has a macro which produces a preprocessing error when + the condition passed to it is 0. This macro is called BOOST_PP_ASSERT. The + macro produces a preprocessor error by forcing a call to an internal macro + with the wrong number of arguments. According to the C++ standard this should + always cause an immediate preprocessing error for conforming compilers. +

+

+ Unfortunately VC++ will only produce a warning when the wrong number of arguments + are passed to a macro. Therefore the BOOST_PP_ASSERT macro does not produce + a preprocessing error using VC++. Amazingly enough there appears to be no + other way in which VC++ can be forced to issue a preprocessing error by invoking + a macro ( if you find one please tell me about it ). However one can create + invalid C++ as the output from a macro invocation which causes VC++ to produce + a compiler error when the VC++ compiler later encounters the construct. +

+

+ This is what the macro BOOST_VMD_ASSERT does. It takes the same conditional + argument as BOOST_PP_ASSERT and it calls BOOST_PP_ASSERT when not used with + VC++, otherwise if the condition is 0 it generates a compiler error by generating + invalid C++ when used with VC++. The compiler error is generated by producing + invalid C++ whose form is: +

+
typedef char BOOST_VMD_ASSERT_ERROR[-1];
+
+

+ By passing a second optional argument, whose form is a preprocessing identifier, + to BOOST_VMD_ASSERT you can generate the invalid C++ for VC++, if the first + argument is 0, of the form: +

+
typedef char optional_argument[-1];
+
+

+ instead. This may give a little more clarity, if desired, to the C++ error + generated. +

+

+ If the first conditional argument is not 0, BOOST_VMD_ASSERT produces no + output. +

+
+ + BOOST_VMD_ASSERT + Usage +
+

+ To use the BOOST_VMD_ASSERT macro either include the general header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/assert.hpp>
+
+
+ + Assertions + for data types +
+

+ The data types have their own assertion macros. These are largely just shortcuts + for passing the result of the identifying macros to BOOST_VMD_ASSERT. These + assertion macros are: +

+
    +
  • + emptiness, BOOST_VMD_ASSERT_IS_EMPTY +
  • +
  • + identifier, BOOST_VMD_ASSERT_IS_IDENTIFIER +
  • +
  • + number, BOOST_VMD_ASSERT_IS_NUMBER +
  • +
  • + array, BOOST_VMD_ASSERT_IS_ARRAY +
  • +
  • + list, BOOST_VMD_ASSERT_IS_LIST +
  • +
  • + seq, BOOST_VMD_ASSERT_IS_SEQ +
  • +
  • + tuple, BOOST_VMD_ASSERT_IS_TUPLE +
  • +
  • + type, BOOST_VMD_ASSERT_IS_TYPE +
  • +
+

+ Each of these macros take as parameters the exact same argument as their + corresponding identifying macros. But instead of returning non-zero or 0, + each of these macros produce a compiler error if the type of the input is + not correct. +

+

+ Each of these macros only check for its assertion when the macro BOOST_VMD_ASSERT_DATA + is set to 1. By default BOOST_VMD_ASSERT_DATA is only set to 1 in compiler + debug mode. The programmer can manually set BOOST_VMD_ASSERT_DATA to 1 prior + to using one the data types assert macros if he wishes. +

+
+ + BOOST_VMD_ASSERT_... + Usage +
+

+ To use the individual BOOST_VMD_ASSERT_... macros either include the general + header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/assert_is_empty.hpp> // BOOST_VMD_ASSERT_IS_EMPTY
+#include <boost/vmd/assert_is_identifier.hpp> // BOOST_VMD_ASSERT_IS_IDENTIFIER
+#include <boost/vmd/assert_is_number.hpp> // BOOST_VMD_ASSERT_IS_NUMBER
+#include <boost/vmd/assert_is_array.hpp> // BOOST_VMD_ASSERT_IS_ARRAY
+#include <boost/vmd/assert_is_list.hpp> // BOOST_VMD_ASSERT_IS_LIST
+#include <boost/vmd/assert_is_seq.hpp> // BOOST_VMD_ASSERT_IS_SEQ
+#include <boost/vmd/assert_is_tuple.hpp> // BOOST_VMD_ASSERT_IS_TUPLE
+#include <boost/vmd/assert_is_type.hpp> // BOOST_VMD_ASSERT_IS_TYPE
+
+
+ + Assertions + and VC++ +
+

+ The VC++ compiler has a quirk when dealing with BOOST_VMD_ASSERT and the + data type assert macros. If you invoke one of the assert macros within another + macro which would normally generate output preprocessor tokens, it is necessary + when using VC++ to concatenate the result of the assert macro to whatever + other preprocessor data is being generated, even if the assert macro does + not generate an error. +

+

+ As a simple example let us suppose we have a macro expecting a tuple and + generating 1 if the tuple has more than 2 elements, otherwise it generates + 0. Ordinarily we could write: +

+
#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/size.hpp>
+#include <boost/vmd/assert_is_tuple.hpp>
+
+#define AMACRO(atuple) \
+    BOOST_VMD_ASSERT_IS_TUPLE(atuple) \
+    BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0)
+
+

+ but for VC++ we must write +

+
#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/size.hpp>
+#include <boost/vmd/assert_is_tuple.hpp>
+
+#define AMACRO(atuple) \
+    BOOST_PP_CAT \
+       ( \
+       BOOST_VMD_ASSERT_IS_TUPLE(atuple), \
+       BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) \
+       )
+
+

+ VC++ does not work correctly in the first instance, erroneously getting confused + as far as compiler output is concerned. But by using BOOST_PP_CAT in the + second condition VC++ will work correctly with VMD assertions. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful/vmd_empty_ppdata.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful/vmd_empty_ppdata.html new file mode 100644 index 0000000000000000000000000000000000000000..6a1279f759e00624bc7a3a275ae2dac89e5c6ad3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful/vmd_empty_ppdata.html @@ -0,0 +1,1062 @@ + + + +Functionality for "empty" seqs and tuples + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Boost PP arrays and lists can be empty but seqs and tuples cannot. The form + of an empty array is '(0,())' and the form of an empty list is 'BOOST_PP_NIL'. + But the form of '()' does not represent an empty seq or an empty tuple. Instead + for a seq it represents a one element seq whose data is empty, while for + a tuple it represents a tuple with a size of 1 whose single element is empty. +

+

+ Not having a way to represent an empty seq or tuple represents a small problem + for Boost PP users. For a tuple, especially, not being able to be "empty" + is the only reason, when variadic macros are supported, why an end-user might + prefer to use an array rather than a tuple as Boost PP preprocessor data. + Otherwise, when using variadic macros, using a tuple is easier to notate + and subsequently use than an array since no effort is needed to specify the + number of elements of a tuple. +

+

+ VMD as we have seen has functionality to tell when preprocessor data is "empty" + through its BOOST_VMD_IS_EMPTY macro. Because of this it is possible to treat + emptiness, when applied to a seq or tuple, as an empty seq or an empty tuple + respectively, thus allowing seqs and tuples to be empty, just as arrays and + lists are. +

+

+ However there is one large problem when treating emptiness as an empty seq + or empty tuple; Boost PP functionality for a seq or tuple knows nothing about + it. In other words if you passed emptiness to a Boost PP macro which expects + a seq or tuple, such as: +

+
BOOST_PP_SEQ_SIZE()
+
+

+ or +

+
BOOST_PP_TUPLE_PUSH_BACK(,1)
+
+

+ you would get UB, undefined behavior. +

+

+ In order to use seqs and tuples which can be empty VMD defines a number of + macros which mimic many of those in Boost PP, but begin with BOOST_VMD_ rather + than BOOST_PP_. The VMD macros work with what I will call a 'VMD seq' or + a 'VMD tuple', while the Boost PP equivalents work with the traditional seq + or tuple. A VMD seq is a seq which may be empty and a VMD tuple is a tuple + which may be empty. A VMD seq is therefore a superset of a normal seq and + a VMD tuple is therefore a superset of a normal tuple. The VMD functionality + therefore can accept a VMD seq or tuple or a normal seq or tuple whereas + the equivalent Boost PP functionality only accepts a normal seq or tuple. + To be more more precise the Boost PP functionality can accept a VMD seq or + a VMD tuple as long as it is not empty. In other words there is no difference + between a non-empty VMD seq or a Boost PP seq, or between a non-empty VMD + tuple and a Boost PP tuple. +

+

+ The particular macros which VMD supplies, supporting VMD seqs and VMD tuples, + are divided between array, list, seq, and tuple functionality. The actual + header files for these macros are in sub-directories of the VMD directory, + which start respectively with 'array','list','seq' and 'tuple'. The header + files are all also included in the general boost/vmd/vmd.hpp header file. +

+
+ + Array + macros +
+

+ The array macros provide conversions from an array to a VMD seq or a VMD + tuple. The array macros are: +

+
+

Table 1.2. Array macros

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Parameter +

+
+

+ Return +

+
+

+ Functionality +

+
+

+ Header +

+
+

+ BOOST_VMD_ARRAY_TO_SEQ +

+
+

+ array = a Boost PP array +

+
+

+ A VMD seq +

+
+

+ Converts an array to a VMD seq. If the array is empty the seq is + empty, otherwise the conversion is the same as BOOST_PP_ARRAY_TO_SEQ +

+
+

+ boost/vmd/array/to_seq.hpp +

+
+

+ BOOST_VMD_ARRAY_TO_TUPLE +

+
+

+ array = a Boost PP array +

+
+

+ A VMD tuple +

+
+

+ Converts an array to a VMD tuple. If the array is empty the tuple + is empty, otherwise the conversion is the same as BOOST_PP_ARRAY_TO_TUPLE +

+
+

+ boost/vmd/array/to_tuple.hpp +

+
+
+

+ The difference between the array conversion macros and their equivalent ones + in Boost PP is that if the array is empty the VMD macros return emptiness + whereas the Boost PP macros have UB. +

+

+ You can include the array macros either using their individual header files, + the general 'boost/vmd/array.hpp' header file for all array macros, or the + general header file 'boost/vmd/vmd.hpp' for all macros. +

+
+ + List + macros +
+

+ The list macros provide conversions from a list to a VMD seq or a VMD tuple. + The list macros are: +

+
+

Table 1.3. List macros

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Parameter +

+
+

+ Return +

+
+

+ Functionality +

+
+

+ Header +

+
+

+ BOOST_VMD_LIST_TO_SEQ +

+
+

+ list = a Boost PP list +

+
+

+ A VMD seq +

+
+

+ Converts a list to a VMD seq. If the list is empty the seq is empty, + otherwise the conversion is the same as BOOST_PP_LIST_TO_SEQ +

+
+

+ boost/vmd/list/to_seq.hpp +

+
+

+ BOOST_VMD_LIST_TO_TUPLE +

+
+

+ list = a Boost PP list +

+
+

+ A VMD tuple +

+
+

+ Converts a list to a VMD tuple. If the list is empty the tuple + is empty, otherwise the conversion is the same as BOOST_PP_LIST_TO_TUPLE +

+
+

+ boost/vmd/list/to_tuple.hpp +

+
+
+

+ The difference between the list conversion macros and their equivalent ones + in Boost PP is that if the list is empty the VMD macros return emptiness + whereas the Boost PP macros have UB. +

+

+ You can include the list macros either using their individual header files, + the general 'boost/vmd/list.hpp' header file for all list macros, or the + general header file 'boost/vmd/vmd.hpp' for all macros. +

+
+ + Seq + macros +
+

+ The seq macros either work with a VMD seq or return A VMD seq. The seq macros + are: +

+
+

Table 1.4. Seq macros

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Parameter +

+
+

+ Return +

+
+

+ Functionality +

+
+

+ Header +

+
+

+ BOOST_VMD_IS_VMD_SEQ +

+
+

+ sequence = a VMD sequence +

+
+

+ 1 if the VMD sequence is a VMD seq, else 0 +

+
+

+ Tests a sequence as a VMD seq. If the sequence is empty returns + 1, otherwise returns the same as BOOST_VMD_IS_SEQ +

+
+

+ boost/vmd/seq/is_vmd_seq.hpp +

+
+

+ BOOST_VMD_SEQ_POP_BACK +

+
+

+ seq = a Boost PP seq +

+
+

+ A VMD seq +

+
+

+ Pops an element from the end of a seq. If the seq has a single + element returns an empty seq, otherwise works exactly the same + as BOOST_PP_SEQ_POP_BACK +

+
+

+ boost/vmd/seq/pop_back.hpp +

+
+

+ BOOST_VMD_SEQ_POP_FRONT +

+
+

+ seq = a Boost PP seq +

+
+

+ A VMD seq +

+
+

+ Pops an element from the beginning of a seq. If the seq has a single + element returns an empty seq, otherwise works exactly the same + as BOOST_PP_SEQ_POP_FRONT +

+
+

+ boost/vmd/seq/pop_front.hpp +

+
+

+ BOOST_VMD_SEQ_PUSH_BACK +

+
+

+ seq = a VMD seq, elem = element to push onto the end of the VMD + seq +

+
+

+ A Boost PP seq +

+
+

+ Pushes an element onto the end of a VMD seq. If the VMD seq is + empty the returned seq consists of that element, otherwise works + exactly the same as BOOST_PP_SEQ_PUSH_BACK +

+
+

+ boost/vmd/seq/push_back.hpp +

+
+

+ BOOST_VMD_SEQ_PUSH_FRONT +

+
+

+ seq = a VMD seq, elem = element to push onto the beginning of the + VMD seq +

+
+

+ A Boost PP seq +

+
+

+ Pushes an element onto the beginning of a VMD seq. If the VMD seq + is empty the returned seq consists of that element, otherwise works + exactly the same as BOOST_PP_SEQ_PUSH_FRONT +

+
+

+ boost/vmd/seq/push_front.hpp +

+
+

+ BOOST_VMD_SEQ_REMOVE +

+
+

+ seq = a Boost PP seq, i = index of element to remove +

+
+

+ A VMD seq +

+
+

+ Removes an element from a Boost PP seq. If the seq has a single + element and the index to be removed is 0 returns an empty seq, + otherwise works exactly the same as BOOST_PP_SEQ_REMOVE +

+
+

+ boost/vmd/seq/remove.hpp +

+
+

+ BOOST_VMD_SEQ_SIZE +

+
+

+ seq = a VMD seq +

+
+

+ The number of elements in the VMD seq +

+
+

+ Returns the number of elements in the VMD seq. If the seq is empty + returns 0, otherwise works exactly the same as BOOST_PP_SEQ_SIZE +

+
+

+ boost/vmd/seq/size.hpp +

+
+

+ BOOST_VMD_SEQ_TO_ARRAY +

+
+

+ seq = a VMD seq +

+
+

+ A Boost PP array +

+
+

+ Converts a VMD seq to a Boost PP array. If the seq is empty returns + an empty array whose form is '(0,())', otherwise works exactly + the same as BOOST_PP_SEQ_TO_ARRAY +

+
+

+ boost/vmd/seq/to_array.hpp +

+
+

+ BOOST_VMD_SEQ_TO_LIST +

+
+

+ seq = a VMD seq +

+
+

+ A Boost PP list +

+
+

+ Converts a VMD seq to a Boost PP list. If the seq is empty returns + an empty list whose form is 'BOOST_PP_NIL', otherwise works exactly + the same as BOOST_PP_SEQ_TO_LIST +

+
+

+ boost/vmd/seq/to_list.hpp +

+
+

+ BOOST_VMD_SEQ_TO_TUPLE +

+
+

+ seq = a VMD seq +

+
+

+ A VMD tuple +

+
+

+ Converts a VMD seq to a VMD tuple. If the seq is empty returns + an empty tuple, otherwise works exactly the same as BOOST_PP_SEQ_TO_TUPLE +

+
+

+ boost/vmd/seq/to_tuple.hpp +

+
+
+

+ The difference between the seq macros and their equivalent ones in Boost + PP is that working with a VMD seq or returning a VMD seq is valid with the + seq macros but with the Boost PP equivalent macros working with an empty + seq causes UB and returning an empty seq can never occur. +

+

+ You can include the seq macros either using their individual header files, + the general 'boost/vmd/seq.hpp' header file for all seq macros, or the general + header file 'boost/vmd/vmd.hpp' for all macros. +

+
+ + Tuple + macros +
+

+ The tuple macros either work with a VMD tuple or return a VMD tuple. The + tuple macros are: +

+
+

Table 1.5. Tuple macros

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Parameter +

+
+

+ Return +

+
+

+ Functionality +

+
+

+ Header +

+
+

+ BOOST_VMD_IS_VMD_TUPLE +

+
+

+ sequence = a VMD sequence +

+
+

+ 1 if the VMD sequence is a VMD tuple, else 0 +

+
+

+ Tests a sequence as a VMD tuple. If the sequence is empty returns + 1, otherwise returns the same as BOOST_VMD_IS_TUPLE +

+
+

+ boost/vmd/tuple/is_vmd_tuple.hpp +

+
+

+ BOOST_VMD_TUPLE_POP_BACK +

+
+

+ tuple = a Boost PP tuple +

+
+

+ A VMD tuple +

+
+

+ Pops an element from the end of a tuple. If the tuple's size is + 1 returns an empty tuple, otherwise works exactly the same as BOOST_PP_TUPLE_POP_BACK +

+
+

+ boost/vmd/tuple/pop_back.hpp +

+
+

+ BOOST_VMD_TUPLE_POP_FRONT +

+
+

+ tuple = a Boost PP tuple +

+
+

+ A VMD tuple +

+
+

+ Pops an element from the beginning of a tuple. If the tuple's size + is 1 returns an empty tuple, otherwise works exactly the same as + BOOST_PP_TUPLE_POP_FRONT +

+
+

+ boost/vmd/tuple/pop_front.hpp +

+
+

+ BOOST_VMD_TUPLE_PUSH_BACK +

+
+

+ tuple = a VMD tuple, elem = element to push onto the end of the + VMD tuple +

+
+

+ A Boost PP tuple +

+
+

+ Pushes an element onto the end of a VMD tuple. If the VMD tuple + is empty the returned tuple consists of that element, otherwise + works exactly the same as BOOST_PP_TUPLE_PUSH_BACK +

+
+

+ boost/vmd/tuple/push_back.hpp +

+
+

+ BOOST_VMD_TUPLE_PUSH_FRONT +

+
+

+ tuple = a VMD tuple, elem = element to push onto the beginning + of the VMD tuple +

+
+

+ A Boost PP tuple +

+
+

+ Pushes an element onto the beginning of a VMD tuple. If the VMD + tuple is empty the returned tuple consists of that element, otherwise + works exactly the same as BOOST_PP_TUPLE_PUSH_FRONT +

+
+

+ boost/vmd/tuple/push_front.hpp +

+
+

+ BOOST_VMD_TUPLE_REMOVE +

+
+

+ tuple = a Boost PP tuple, i = index of element to remove +

+
+

+ A VMD tuple +

+
+

+ Removes an element from a Boost PP tuple. If the tuple has a single + element and the index to be removed is 0 returns an empty tuple, + otherwise works exactly the same as BOOST_PP_TUPLE_REMOVE +

+
+

+ boost/vmd/tuple/remove.hpp +

+
+

+ BOOST_VMD_TUPLE_SIZE +

+
+

+ tuple = a VMD tuple +

+
+

+ The number of elements in the VMD tuple +

+
+

+ Returns the number of elements in the VMD tuple. If the tuple is + empty returns 0, otherwise works exactly the same as BOOST_PP_TUPLE_SIZE +

+
+

+ boost/vmd/tuple/size.hpp +

+
+

+ BOOST_VMD_TUPLE_TO_ARRAY +

+
+

+ tuple = a VMD tuple +

+
+

+ A Boost PP array +

+
+

+ Converts a VMD tuple to a Boost PP array. If the tuple is empty + returns an empty array whose form is '(0,())', otherwise works + exactly the same as BOOST_PP_TUPLE_TO_ARRAY +

+
+

+ boost/vmd/tuple/to_array.hpp +

+
+

+ BOOST_VMD_TUPLE_TO_LIST +

+
+

+ tuple = a VMD tuple +

+
+

+ A Boost PP list +

+
+

+ Converts a VMD tuple to a Boost PP list. If the tuple is empty + returns an empty list whose form is 'BOOST_PP_NIL', otherwise works + exactly the same as BOOST_PP_TUPLE_TO_LIST +

+
+

+ boost/vmd/tuple/to_list.hpp +

+
+

+ BOOST_VMD_TUPLE_TO_SEQ +

+
+

+ tuple = a VMD tuple +

+
+

+ A VMD seq +

+
+

+ Converts a VMD tuple to a VMD seq. If the tuple is empty returns + an empty seq, otherwise works exactly the same as BOOST_PP_TUPLE_TO_SEQ +

+
+

+ boost/vmd/tuple/to_seq.hpp +

+
+
+

+ The difference between the tuple macros and their equivalent ones in Boost + PP is that working with a VMD tuple or returning a VMD tuple is valid with + the tuple macros but with the Boost PP equivalent macros working with an + empty tuple causes UB and returning an empty tuple can never occur. +

+

+ You can include the tuple macros either using their individual header files, + the general 'boost/vmd/tuple.hpp' header file for all tuple macros, or the + general header file 'boost/vmd/vmd.hpp' for all macros. +

+
+ + Seq + and tuple functionality +
+

+ The set of macros for seq and tuple functionality which work with VMD seqs + and VMD tuples are largely only a subset of the seq and tuple functionality + in Boost PP. This reflects the fact that a number of macros in Boost PP for + working with a seq or tuple make no sense when extended to work with a possible + empty seq or empty tuple. For instance BOOST_PP_SEQ_FIRST_N could not mean + anything when passed an empty seq and BOOST_PP_TUPLE_REM_CTOR could not mean + anything when passed an empty tuple. Likewise for other Boost PP seq and + tuple macros which do not have a VMD equivalent. +

+

+ The set of functionality in VMD for working with a possibly empty seq or + empty tuple makes it possible to add or remove elements in a seq or tuple + which could start out or end up empty, take the seq or tuple size even when + the seq or tuple is empty, convert between arrays, lists, seqs, or tuples + which could start out or end up empty, and test for a VMD seq or a VMD tuple. + This functionality should allow macro programmers the ability to work with + empty seqs and tuples while still using other Boost PP seq and tuple functuionality + to work with non-empty seqs and tuples. The easiest way to do this is to + use the VMD seq and VMD tuple equivalent functions when choosing between + VMD and Boost PP, and use the Boost PP seq and tuple functionality otherwise. + Just remember that Boost PP seq and tuple functionality can never work with + empty seqs or empty tuples. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful/vmd_identity.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful/vmd_identity.html new file mode 100644 index 0000000000000000000000000000000000000000..5341e37bfa4428a5b6a91a5f0a5a004d59b91226 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_useful/vmd_identity.html @@ -0,0 +1,313 @@ + + + +Generating emptiness and identity + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Using + BOOST_PP_EMPTY and BOOST_PP_IDENTITY +
+

+ Boost PP Has a macro called BOOST_PP_EMPTY() which expands to nothing. +

+

+ Ordinarily this would not seem that useful, but the macro can be used in + situations where one wants to return a specific value even though a further + macro call syntax is required taking no parameters. This sort of usefulness + occurs in Boost PP when there are two paths to take depending on the outcome + of a BOOST_PP_IF or BOOST_PP_IIF logic. Here is an artificial example: +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+
+#define MACRO_CHOICE(parameter) \
+    BOOST_PP_IIF(parameter) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1, \
+        SOME_FIXED_VALUE BOOST_PP_EMPTY \
+        ) \
+    ()
+
+#define MACRO_CALL_IF_PARAMETER_1() some_processing
+
+

+ In the general logic above is: if parameter is 1 another macro is invoked, + whereas if the parameter is 0 some fixed value is returned. The reason that + this is useful is that one may not want to code the MACRO_CHOICE macro in + this way: +

+
#include <boost/preprocessor/control/iif.hpp>
+
+#define MACRO_CHOICE(parameter) \
+    BOOST_PP_IIF(parameter) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1(), \
+        SOME_FIXED_VALUE \
+        )
+
+#define MACRO_CALL_IF_PARAMETER_1() some_processing
+
+

+ because it is inefficient. The invocation of MACRO_CALL_IF_PARAMETER_1 will + still be generated even when 'parameter' is 0. +

+

+ This idiom of returning a fixed value through the use of BOOST_PP_EMPTY is + so useful that Boost PP has an accompanying macro to BOOST_PP_EMPTY to work + with it. This accompanying macro is BOOST_PP_IDENTITY(value)(). Essentially + BOOST_PP_IDENTITY returns its value when it is invoked. Again, like BOOST_PP_EMPTY, + the final invocation must be done with no value. +

+

+ Our example from above, which originally used BOOST_PP_EMPTY to return a + fixed value, is now: +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
+
+#define MACRO_CHOICE(parameter) \
+    BOOST_PP_IIF(parameter) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1, \
+        BOOST_PP_IDENTITY(SOME_FIXED_VALUE) \
+        ) \
+    ()
+
+#define MACRO_CALL_IF_PARAMETER_1() some_processing
+
+

+ The macro BOOST_PP_IDENTITY is actually just: +

+
#define BOOST_PP_IDENTITY(value) value BOOST_PP_EMPTY
+
+

+ so you can see how it is essentially a shorthand for the common case originally + shown at the top of returning a value through the use of BOOST_PP_EMPTY. +

+
+ + Using + BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY +
+

+ The one problem when using BOOST_PP_EMPTY and BOOST_PP_IDENTITY is that the + final invocation must be with no parameters. This is very limiting. If the + final invocation must be with one or more parameters you cannot use BOOST_PP_EMPTY + or BOOST_PP_IDENTITY. In other words, making a change to either of our two + examples: +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+
+#define MACRO_CHOICE(parameter1,parameter2) \
+    BOOST_PP_IIF(parameter1) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1, \
+        SOME_FIXED_VALUE BOOST_PP_EMPTY \
+        ) \
+    (parameter2)
+
+#define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_a_parameter
+
+

+ or +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
+
+#define MACRO_CHOICE(parameter1,parameter2) \
+    BOOST_PP_IIF(parameter1) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1, \
+        BOOST_PP_IDENTITY(SOME_FIXED_VALUE) \
+        ) \
+    (parameter2)
+
+#define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_a_parameter
+
+

+ will produce a preprocessing error since the final invocation to either BOOST_PP_EMPTY + or BOOST_PP_IDENTITY can not be done with 1 or more parameters. +

+

+ It would be much more useful if the final invocation could be done with any + number of parameters. This is where using variadic macros solves the problem. + The BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY macros have the exact same functionality + as their Boost PP counterparts but the final invocation can be made with + any number of parameters, and those parameters are just ignored when BOOST_VMD_EMPTY + or BOOST_VMD_IDENTITY is the choice. +

+

+ Now for our two examples we can have: +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/vmd/empty.hpp>
+
+#define MACRO_CHOICE(parameter1,parameter2) \
+    BOOST_PP_IIF(parameter1) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1, \
+        SOME_FIXED_VALUE BOOST_VMD_EMPTY \
+        ) \
+    (parameter2)
+
+#define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_parameters
+
+

+ or +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/vmd/identity.hpp>
+
+#define MACRO_CHOICE(parameter1,parameter2) \
+    BOOST_PP_IIF(parameter1) \
+        ( \
+        MACRO_CALL_IF_PARAMETER_1, \
+        BOOST_VMD_IDENTITY(SOME_FIXED_VALUE) \
+        ) \
+    (parameter2)
+
+#define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_parameters
+
+

+ and our macros will compile without preprocessing errors and work as expected. + Both BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY will take any number of parameters + in their invocation, which makes them useful for a final invocation no matter + what is being passed. +

+
+ + Usage + for BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY +
+

+ To use the BOOST_VMD_EMPTY macro either include the general header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/empty.hpp>
+
+

+ To use the BOOST_VMD_IDENTITY macro either include the general header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/identity.hpp>
+
+
+ + Using + BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY with VC++ +
+

+ Unfortunately the Visual C++ preprocessor has a problem when a macro expands + to something followed by a variadic macro which expands to nothing. This + is the case when using BOOST_VMD_EMPTY following some non-empty expansion, + or the equivalent use of BOOST_VMD_IDENTITY. As strange as it sounds this + VC++ preprocessor problem is normally solved by concatenating the result + using BOOST_PP_CAT with an empty value. But then again the many non-standard + behaviors of VC++ are difficult to understand or even track. +

+

+ In order to make this technique transparent when used with a C++ standard + conforming preprocessor or VC++ non-standard preprocessor you can use the + BOOST_VMD_IDENTITY_RESULT macro passing to it a single parameter which is + a result returned from a macro which uses BOOST_VMD_IDENTITY ( or its equivalent + 'value BOOST_VMD_EMPTY' usage ). +

+

+ Given our MACRO_CHOICE example above, if you have another macro invoking + MACRO_CHOICE simply enclose that invocation within BOOST_VMD_IDENTITY_RESULT. + As in the very simple: +

+
#include <boost/vmd/identity.hpp>
+
+#define CALLING_MACRO_CHOICE(parameter1,parameter2) \
+    BOOST_VMD_IDENTITY_RESULT(MACRO_CHOICE(parameter1,parameter2))
+
+

+ Alternatively you can change MACRO_CHOICE so that its implementation and + usage is: +

+
#include <boost/preprocessor/control/iif.hpp>
+#include <boost/vmd/identity.hpp>
+
+#define MACRO_CHOICE(parameter1,parameter2) \
+    BOOST_VMD_IDENTITY_RESULT \
+        ( \
+        BOOST_PP_IIF(parameter1) \
+            ( \
+            MACRO_CALL_IF_PARAMETER_1, \
+            BOOST_VMD_IDENTITY(SOME_FIXED_VALUE) \
+            ) \
+        (parameter2) \
+        )
+
+#define CALLING_MACRO_CHOICE(parameter1,parameter2) \
+    MACRO_CHOICE(parameter1,parameter2)
+
+

+ Using BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY in this way will ensure they + can be used without preprocessing problems with either VC++ or any C++ standard + conforming preprocessor. +

+
+ + Usage + for BOOST_VMD_IDENTITY_RESULT +
+

+ The macro BOOST_VMD_IDENTITY_RESULT is in the same header file as BOOST_VMD_IDENTITY, + so to use the BOOST_VMD_IDENTITY_RESULT macro either include the general + header: +

+
#include <boost/vmd/vmd.hpp>
+
+

+ or include the specific header: +

+
#include <boost/vmd/identity.hpp>
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vc.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vc.html new file mode 100644 index 0000000000000000000000000000000000000000..0d59258e3e13c156153949fcab5d16edf9af7262 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vc.html @@ -0,0 +1,69 @@ + + + +Visual C++ define + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Microsoft's Visual C++ compiler, abbreviated VC++, is a very popular compiler + but does not implement the standard C++ preprocessor correctly in a number + of respects. Because of this the programmer using the VMD needs to occasionally + do things differently when VC++ is being used. These "quirks" of + VC++ have been smoothed over as much as possible in the VMD library, but are + mentioned in further topics and occasionally must be addressed by the programmer + using VMD. +

+

+ The VMD has a macro that indicates when VC++ is the compiler being used. The + macro is an object-like macro called BOOST_VMD_MSVC. It is set to 1 when VC++ + is being used and set to 0 when VC++ is not being used. You can use this macro + in your own macro code whenever you include a VMD header file to write code + which may need special processing for VC++ as outlined in this documentation. + Your macro processing may therefore occasional take the form of: +

+
#include <boost/vmd/some_header.hpp>
+
+#if BOOST_VMD_MSVC
+
+#define SOME_MACRO ... code for VC++
+
+#else
+
+#define SOME_MACRO ... code for all other compilers
+
+#endif
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vc_isms.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vc_isms.html new file mode 100644 index 0000000000000000000000000000000000000000..86f378a552395d974281cc262df3c76cd07abcb1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vc_isms.html @@ -0,0 +1,84 @@ + + + +Visual C++ gotchas in VMD + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ I have discussed throughout the documentation areas of VMD which need to be + considered when using Microsoft's Visual C++ compilers. The VMD library supports + VC++ versions 8 through the latest 14. These correspond to Visual Studio 2005 + through the current Visual Studio 2015. +

+

+ I will give here fairly briefly the VC++ quirks which should be taken into + account when using VMD. These quirks exist because the VC++ compiler does not + have a C++ standard conforming preprocessor. More specifically the VC++ compiler + does not follow all of the rules correctly for expanding a macro when a macro + is invoked. Here is a list for things to consider when using VMD with VC++: +

+
    +
  • + The BOOST_VMD_IS_EMPTY macro will expand erroneously to 1 if the input + resolves to a function-like macro name, which when it is called with an + empty parameter expands to a tuple. +
  • +
  • + The BOOST_VMD_ASSERT macro, and the corresponding individual VMD ASSERT + macros for the various data types, do not cause an immediate compiler error, + but instead generate invalid C++ if the ASSERT occurs. +
  • +
  • + When the BOOST_VMD_ASSERT macro, or one of the corresponding individual + VMD ASSERT macros for the various data types, does not generate an error, + and the macro in which it is being used does generate some output, it is + necessary to use BOOST_PP_CAT to concatenate the empty result of the VMD + ASSERT macro with the normally generated output to correctly generate the + final expansion of the macro in which the VMD ASSERT occurs. +
  • +
  • + When using BOOST_VMD_EMPTY following some non-empty expansion, or when + using BOOST_VMD_IDENTITY, the value returned needs to be concatenated using + BOOST_PP_CAT with an empty value. You can use BOOST_VMD_IDENTITY_RESULT + to accomplish this transparently. +
  • +
  • + Avoid using an empty parenthesis to pass no data as a tuple or seq if VC++8 + might be used as the compiler. +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vmacros.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vmacros.html new file mode 100644 index 0000000000000000000000000000000000000000..2f9bd6f377c3f883b4c5ff979d4c51ca8f00d1e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_vmacros.html @@ -0,0 +1,90 @@ + + + +Using variadic macros + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Variadic macros, as specified by C++11, is a feature taken from the C99 specification. + They are macros which take a final parameter denoted as '...' which represents + one or more final arguments to the macro as a series of comma-separated tokens. + In the macro expansion a special keyword of '__VA_ARGS__' represents the comma-separated + tokens. This information when passed to a variadic macro I call 'variadic macro + data', which gives its name to this library. The more general term 'variadic + data' is used in this documentation to specify data passed to a macro which + can contain any number of macro tokens as a single macro parameter, such as + is found in Boost PP data types. +

+

+ + Boost + support +

+

+ The Boost PP library has support for variadic macros and uses its own criteria + to determine if a particular compiler has that support. Boost PP defines or + uses the macro BOOST_PP_VARIADICS to denote whether the compiler being used + supports variadic macros. When BOOST_PP_VARIADICS is set to 1 the compiler + supports variadic macros, otherwise when BOOST_PP_VARIADICS is set to 0 the + compiler does not support variadic macros. If a user of Boost PP sets this + value, Boost PP uses the value the end-user sets, otherwise Boost PP defines + the value of BOOST_PP_VARIADICS based on its own analysis of the compiler being + used. This macro can also be checked to determine if a compiler has support + for variadic macros. +

+

+ + Determining + variadic macro support +

+

+ The VMD library automatically determines whether variadic macro support is + enabled for a particular compiler by also using the same BOOST_PP_VARIADICS + macro from Boost PP. The end-user of VMD can also manually set the macro BOOST_PP_VARIADICS + to turn on or off compiler support for variadic macros in the VMD library. + When BOOST_PP_VARIADICS is set to 0 variadic macros are not supported in the + VMD library, otherwise when BOOST_PP_VARIADICS is set to non-zero they are + supported in the VMD library. This same macro can be used to determine if VMD + supports variadic macros for a particular compiler. +

+

+ Since this library depends on variadic macro support, if BOOST_PP_VARIADICS + is set to 0, using any of the macros in VMD will lead to a compiler error since + the macro will not be defined. However just including any of the header files + in VMD, even with no variadic macro support for the compiler, will not lead + to any compiler errors. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_whyhow.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_whyhow.html new file mode 100644 index 0000000000000000000000000000000000000000..cb87b15208f6ad036eb43ca0c02bd7b264a1aa42 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data/vmd_whyhow.html @@ -0,0 +1,219 @@ + + + +Why and how to use + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The VMD library provides the ability to create a macro which takes different + types of parameters and can therefore generate different output depending on + the parameter types as well as their values. +

+

+ This is equivalent to the way that overloaded functions provide the ability + for a singularly named function to provide different functionality depending + on the parameter types. +

+

+ In the case of macros, where more than one macro of the same name but different + macro expansion is not allowed, a single macro name can create different expansions. +

+

+ As a simple example: +

+
#include <boost/vmd/is_seq.hpp>
+#include <boost/vmd/is_tuple.hpp>
+
+#define AMACRO(param)                 \
+  BOOST_PP_IIF                        \
+    (                                 \
+    BOOST_VMD_IS_SEQ(param),          \
+    Seq,                              \
+    BOOST_PP_IIF                      \
+      (                               \
+      BOOST_VMD_IS_TUPLE(param),      \
+      Tuple,                          \
+      Unknown                         \
+      )                               \
+    )
+
+

+ If the param passed is a seq the output of the macro is 'Seq'. If the param + passed is a tuple the output of the macro is 'Tuple'. Otherwise the output + of the macro is 'Unknown'. +

+

+ Obviously much more complicated cases can be created in which the types and + values of various parameters are parsed in order to produce variable macro + output depending on the input. Using variadic macros, macros with variable + numbers and types of arguments give the macro programmer even greater freedom + to design macros with flexibility. +

+

+ Another feature of the VMD library is the ability to parse identifiers. A system + of registering identifiers which VMD can recognize has been created. Once an + identifier is registered VMD can recognize it as part of macro input as an + identifier and return the identifier. Furthermore VMD can compare identifiers + for equality or inequality once an identifier has been pre-detected using VMD's + system for pre-detecting identifiers. +

+

+ As another simple example: +

+
#include <boost/vmd/is_identifier.hpp>
+
+#define BOOST_VMD_REGISTER_NAME (NAME)
+#define BOOST_VMD_REGISTER_ADDRESS (ADDRESS)
+
+#define AMACRO1(param)              \
+  BOOST_PP_IIF                      \
+    (                               \
+    BOOST_VMD_IS_IDENTIFIER(param), \
+    AMACRO1_IDENTIFIER,             \
+    AMACRO1_NO_IDENTIFIER           \
+    )                               \
+  (param)
+
+#define AMACRO1_IDENTIFIER(param) AMACRO1_ ## param
+#define AMACRO1_NO_IDENTIFIER(param) Parameter is not an identifier
+#define AMACRO1_NAME Identifier is a NAME
+#define AMACRO1_ADDRESS Identifier is an ADDRESS
+
+

+ Here we use VMD's identifier registration system to determine and handle a + particular identifier we may be expecting as a macro parameter. If the input + to 'AMACRO1' is 'NAME' the output is 'Identifier is a NAME'. If the input to + 'AMACRO1' is 'ADDRESS' the output is 'Identifier is an ADDRESS'. Otherwise + the output is 'Parameter is not an identifier'. +

+

+ Identifier pre-detection makes things clearer, allowing us to detect within + VMD whether macro input matches a particular identifier. Using the same setup + as our previous example, but with identifier pre-detection: +

+
#include <boost/vmd/is_identifier.hpp>
+
+#define BOOST_VMD_REGISTER_NAME (NAME)
+#define BOOST_VMD_DETECT_NAME_NAME
+
+#define BOOST_VMD_REGISTER_ADDRESS (ADDRESS)
+#define BOOST_VMD_DETECT_ADDRESS_ADDRESS
+
+#define AMACRO2(param)                        \
+  BOOST_PP_IIF                                \
+    (                                         \
+    BOOST_VMD_IS_IDENTIFIER(param,NAME),      \
+    AMACRO2_NAME,                             \
+    BOOST_PP_IIF                              \
+      (                                       \
+      BOOST_VMD_IS_IDENTIFIER(param,ADDRESS), \
+      AMACRO2_ADDRESS,                        \
+      AMACRO2_NO_IDENTIFIER                   \
+      )                                       \
+    )                                         \
+  (param)
+
+#define AMACRO2_NO_IDENTIFIER(param) Parameter is not a NAME or ADDRESS identifier
+#define AMACRO2_NAME(param) Identifier is a NAME
+#define AMACRO2_ADDRESS(param) Identifier is an ADDRESS
+
+

+ If the input to 'AMACRO2' is 'NAME' the output is 'Identifier is a NAME'. If + the input to 'AMACRO2' is 'ADDRESS' the output is 'Identifier is an ADDRESS'. + Otherwise the output is 'Parameter is not a NAME or ADDRESS identifier'. +

+

+ The VMD library also has 2 different subtypes of identifiers which can always + be recognized. The first are numbers, equivalent to the number in Boost PP, + numeric values with a range of 0-256. The second are v-types, which are identifiers + starting with BOOST_VMD_TYPE_ followed by a name for the type of data. As an + example, the v-type of a Boost PP tuple is BOOST_VMD_TYPE_TUPLE and the v-type + of a v-type itself is BOOST_VMD_TYPE_TYPE. All data types have their own v-type + identifier; types are recognized by the VMD macros and may be passed as input + data just like any other of the types of data VMD recognizes. +

+

+ The VMD identifier system even has a way, to be explained later, for the end-user + to create his own subtype identifiers. +

+

+ Another reason to use VMD is that VMD understands 'sequences' of the VMD data + types. You can have a sequence of data types and VMD can convert the sequence + to any of the Boost PP data types, or access any individual data type in a + sequence. +

+
#include <boost/vmd/elem.hpp>
+#include <boost/vmd/to_tuple.hpp>
+
+#define BOOST_VMD_REGISTER_NAME (NAME)
+#define ASEQUENCE (1,2) NAME 147 BOOST_VMD_TYPE_NUMBER (a)(b)
+
+BOOST_VMD_TO_TUPLE(ASEQUENCE)
+BOOST_VMD_ELEM(2,ASEQUENCE)
+
+

+ Our first expansion returns the tuple: +

+
((1,2),NAME,147,BOOST_VMD_TYPE_NUMBER,(a)(b))
+
+

+ Our second expansion returns the sequence element: +

+
147
+
+

+ Sequences give the macro programmer the ability to accept input data from the + user which may more closely mimic C++ constructs. +

+

+ Another reason to use VMD is that VMD understands data types. Besides specifically + asking if a particular input is a particular data type, you can use the macro + BOOST_VMD_GET_TYPE to retrieve the type of any VMD data. +

+
#include <boost/vmd/get_type.hpp>
+
+BOOST_VMD_GET_TYPE((1,2)) // expands to BOOST_VMD_TYPE_TUPLE
+BOOST_VMD_GET_TYPE(235)   // expands to BOOST_VMD_TYPE_NUMBER
+
+

+ etc. +

+

+ There is still much more of VMD functionality but hopefully this brief introduction + of what VMD can do will interest you so that you will read on to understand + VMD's functionality for the macro programmer. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data_reference.html b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data_reference.html new file mode 100644 index 0000000000000000000000000000000000000000..df2cabfc2e1167bd9a04599c880f96c5e0ec007c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/html/variadic_macro_data_reference.html @@ -0,0 +1,164 @@ + + + +Variadic Macro Data Reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Variadic Macro Data Reference

+
+
Header <boost/vmd/array/to_seq.hpp>
+
+
Header <boost/vmd/list/to_seq.hpp>
+
+
Header <boost/vmd/to_seq.hpp>
+
+
Header <boost/vmd/tuple/to_seq.hpp>
+
+
Header <boost/vmd/array/to_tuple.hpp>
+
+
Header <boost/vmd/list/to_tuple.hpp>
+
+
Header <boost/vmd/seq/to_tuple.hpp>
+
+
Header <boost/vmd/to_tuple.hpp>
+
+
Header <boost/vmd/assert.hpp>
+
+
Header <boost/vmd/assert_is_array.hpp>
+
+
Header <boost/vmd/assert_is_empty.hpp>
+
+
Header <boost/vmd/assert_is_identifier.hpp>
+
+
Header <boost/vmd/assert_is_list.hpp>
+
+
Header <boost/vmd/assert_is_number.hpp>
+
+
Header <boost/vmd/assert_is_seq.hpp>
+
+
Header <boost/vmd/assert_is_tuple.hpp>
+
+
Header <boost/vmd/assert_is_type.hpp>
+
+
Header <boost/vmd/elem.hpp>
+
+
Header <boost/vmd/empty.hpp>
+
+
Header <boost/vmd/enum.hpp>
+
+
Header <boost/vmd/equal.hpp>
+
+
Header <boost/vmd/get_type.hpp>
+
+
Header <boost/vmd/identity.hpp>
+
+
Header <boost/vmd/is_array.hpp>
+
+
Header <boost/vmd/is_empty.hpp>
+
+
Header <boost/vmd/is_empty_array.hpp>
+
+
Header <boost/vmd/is_empty_list.hpp>
+
+
Header <boost/vmd/is_identifier.hpp>
+
+
Header <boost/vmd/is_list.hpp>
+
+
Header <boost/vmd/is_multi.hpp>
+
+
Header <boost/vmd/is_number.hpp>
+
+
Header <boost/vmd/is_parens_empty.hpp>
+
+
Header <boost/vmd/is_seq.hpp>
+
+
Header <boost/vmd/is_tuple.hpp>
+
+
Header <boost/vmd/is_type.hpp>
+
+
Header <boost/vmd/is_unary.hpp>
+
+
Header <boost/vmd/not_equal.hpp>
+
+
Header <boost/vmd/seq/is_vmd_seq.hpp>
+
+
Header <boost/vmd/seq/pop_back.hpp>
+
+
Header <boost/vmd/tuple/pop_back.hpp>
+
+
Header <boost/vmd/seq/pop_front.hpp>
+
+
Header <boost/vmd/tuple/pop_front.hpp>
+
+
Header <boost/vmd/seq/push_back.hpp>
+
+
Header <boost/vmd/tuple/push_back.hpp>
+
+
Header <boost/vmd/seq/push_front.hpp>
+
+
Header <boost/vmd/tuple/push_front.hpp>
+
+
Header <boost/vmd/seq/remove.hpp>
+
+
Header <boost/vmd/tuple/remove.hpp>
+
+
Header <boost/vmd/seq/size.hpp>
+
+
Header <boost/vmd/size.hpp>
+
+
Header <boost/vmd/tuple/size.hpp>
+
+
Header <boost/vmd/seq/to_array.hpp>
+
+
Header <boost/vmd/to_array.hpp>
+
+
Header <boost/vmd/tuple/to_array.hpp>
+
+
Header <boost/vmd/seq/to_list.hpp>
+
+
Header <boost/vmd/to_list.hpp>
+
+
Header <boost/vmd/tuple/to_list.hpp>
+
+
Header <boost/vmd/tuple/is_vmd_tuple.hpp>
+
+
+ +
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/tools/boost_1_65_1/libs/vmd/doc/index.idx b/tools/boost_1_65_1/libs/vmd/doc/index.idx new file mode 100644 index 0000000000000000000000000000000000000000..74ea1ad4c5b347af765188629216c32fbf7b56f4 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/index.idx @@ -0,0 +1,58 @@ +!scan boost/vmd/array/to_seq.hpp +!scan boost/vmd/array/to_tuple.hpp +!scan boost/vmd/assert.hpp +!scan boost/vmd/assert_is_array.hpp +!scan boost/vmd/assert_is_empty.hpp +!scan boost/vmd/assert_is_identifier.hpp +!scan boost/vmd/assert_is_list.hpp +!scan boost/vmd/assert_is_number.hpp +!scan boost/vmd/assert_is_seq.hpp +!scan boost/vmd/assert_is_tuple.hpp +!scan boost/vmd/assert_is_type.hpp +!scan boost/vmd/elem.hpp +!scan boost/vmd/empty.hpp +!scan boost/vmd/enum.hpp +!scan boost/vmd/equal.hpp +!scan boost/vmd/get_type.hpp +!scan boost/vmd/identity.hpp +!scan boost/vmd/is_array.hpp +!scan boost/vmd/is_empty.hpp +!scan boost/vmd/is_empty_array.hpp +!scan boost/vmd/is_empty_list.hpp +!scan boost/vmd/is_identifier.hpp +!scan boost/vmd/is_list.hpp +!scan boost/vmd/is_multi.hpp +!scan boost/vmd/is_number.hpp +!scan boost/vmd/is_parens_empty.hpp +!scan boost/vmd/is_seq.hpp +!scan boost/vmd/is_tuple.hpp +!scan boost/vmd/is_type.hpp +!scan boost/vmd/is_unary.hpp +!scan boost/vmd/list/to_seq.hpp +!scan boost/vmd/list/to_tuple.hpp +!scan boost/vmd/not_equal.hpp +!scan boost/vmd/size.hpp +!scan boost/vmd/seq/is_vmd_seq.hpp +!scan boost/vmd/seq/pop_back.hpp +!scan boost/vmd/seq/pop_front.hpp +!scan boost/vmd/seq/push_back.hpp +!scan boost/vmd/seq/push_front.hpp +!scan boost/vmd/seq/remove.hpp +!scan boost/vmd/seq/size.hpp +!scan boost/vmd/seq/to_array.hpp +!scan boost/vmd/seq/to_list.hpp +!scan boost/vmd/seq/to_tuple.hpp +!scan boost/vmd/to_array.hpp +!scan boost/vmd/to_list.hpp +!scan boost/vmd/to_seq.hpp +!scan boost/vmd/to_tuple.hpp +!scan boost/vmd/tuple/is_vmd_tuple.hpp +!scan boost/vmd/tuple/pop_back.hpp +!scan boost/vmd/tuple/pop_front.hpp +!scan boost/vmd/tuple/push_back.hpp +!scan boost/vmd/tuple/push_front.hpp +!scan boost/vmd/tuple/remove.hpp +!scan boost/vmd/tuple/size.hpp +!scan boost/vmd/tuple/to_array.hpp +!scan boost/vmd/tuple/to_list.hpp +!scan boost/vmd/tuple/to_seq.hpp diff --git a/tools/boost_1_65_1/libs/vmd/doc/jamfile.v2 b/tools/boost_1_65_1/libs/vmd/doc/jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..c8e59b68bb68a91396828ca9824b8898cbe12be5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/jamfile.v2 @@ -0,0 +1,149 @@ +# (C) Copyright Edward Diener 2010-2015 +# Use, modification and distribution are subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt). +# +# VariadicMacroData documentation Jamfile +# + +using quickbook ; +using doxygen ; + +path-constant here : . ; # convenient to refer to files in the same directory as this jamfile.v2 +path-constant boost-images : $(BOOST_ROOT)/doc/src/images ; + +import modules ; + +ECHO "Building the variadic_macro_data docs with automatic index generation enabled." ; +using auto-index ; +project vmd_doc : requirements + on + index.idx + ../../../ + on + html:on + html:generate.index=0 + pdf:on + pdf:index.on.type=1 + enable_index ; + +doxygen vmd_reference + : + $(here)/../../../boost/vmd/array/to_seq.hpp + $(here)/../../../boost/vmd/array/to_tuple.hpp + $(here)/../../../boost/vmd/assert.hpp + $(here)/../../../boost/vmd/assert_is_array.hpp + $(here)/../../../boost/vmd/assert_is_empty.hpp + $(here)/../../../boost/vmd/assert_is_identifier.hpp + $(here)/../../../boost/vmd/assert_is_list.hpp + $(here)/../../../boost/vmd/assert_is_number.hpp + $(here)/../../../boost/vmd/assert_is_seq.hpp + $(here)/../../../boost/vmd/assert_is_tuple.hpp + $(here)/../../../boost/vmd/assert_is_type.hpp + $(here)/../../../boost/vmd/elem.hpp + $(here)/../../../boost/vmd/empty.hpp + $(here)/../../../boost/vmd/enum.hpp + $(here)/../../../boost/vmd/equal.hpp + $(here)/../../../boost/vmd/get_type.hpp + $(here)/../../../boost/vmd/identity.hpp + $(here)/../../../boost/vmd/is_array.hpp + $(here)/../../../boost/vmd/is_empty.hpp + $(here)/../../../boost/vmd/is_empty_array.hpp + $(here)/../../../boost/vmd/is_empty_list.hpp + $(here)/../../../boost/vmd/is_identifier.hpp + $(here)/../../../boost/vmd/is_list.hpp + $(here)/../../../boost/vmd/is_multi.hpp + $(here)/../../../boost/vmd/is_number.hpp + $(here)/../../../boost/vmd/is_parens_empty.hpp + $(here)/../../../boost/vmd/is_seq.hpp + $(here)/../../../boost/vmd/is_tuple.hpp + $(here)/../../../boost/vmd/is_type.hpp + $(here)/../../../boost/vmd/is_unary.hpp + $(here)/../../../boost/vmd/list/to_seq.hpp + $(here)/../../../boost/vmd/list/to_tuple.hpp + $(here)/../../../boost/vmd/not_equal.hpp + $(here)/../../../boost/vmd/seq/is_vmd_seq.hpp + $(here)/../../../boost/vmd/seq/pop_back.hpp + $(here)/../../../boost/vmd/seq/pop_front.hpp + $(here)/../../../boost/vmd/seq/push_back.hpp + $(here)/../../../boost/vmd/seq/push_front.hpp + $(here)/../../../boost/vmd/seq/remove.hpp + $(here)/../../../boost/vmd/seq/size.hpp + $(here)/../../../boost/vmd/seq/to_array.hpp + $(here)/../../../boost/vmd/seq/to_list.hpp + $(here)/../../../boost/vmd/seq/to_tuple.hpp + $(here)/../../../boost/vmd/size.hpp + $(here)/../../../boost/vmd/to_array.hpp + $(here)/../../../boost/vmd/to_list.hpp + $(here)/../../../boost/vmd/to_seq.hpp + $(here)/../../../boost/vmd/to_tuple.hpp + $(here)/../../../boost/vmd/tuple/is_vmd_tuple.hpp + $(here)/../../../boost/vmd/tuple/pop_back.hpp + $(here)/../../../boost/vmd/tuple/pop_front.hpp + $(here)/../../../boost/vmd/tuple/push_back.hpp + $(here)/../../../boost/vmd/tuple/push_front.hpp + $(here)/../../../boost/vmd/tuple/remove.hpp + $(here)/../../../boost/vmd/tuple/size.hpp + $(here)/../../../boost/vmd/tuple/to_array.hpp + $(here)/../../../boost/vmd/tuple/to_list.hpp + $(here)/../../../boost/vmd/tuple/to_seq.hpp + : + PROJECT_NAME="VMD" + PROJECT_NUMBER=1 + SORT_MEMBER_DOCS=NO + SHOW_INCLUDE_FILES=NO + MAX_INITIALIZER_LINES=0 + VERBATIM_HEADERS=NO + PREDEFINED=BOOST_PP_VARIADICS + "Variadic Macro Data Reference" +; + +xml vmd + : + vmd.qbk + : + vmd_reference +; + +boostbook standalone + : + vmd + : + boost.root="../../../.." + chunk.section.depth=8 # How far down we chunk nested sections, basically all of them. + toc.section.depth=8 # How far down sections get TOCs. + toc.max.depth=4 # Max depth in each TOC. + + # PDF Options: + # TOC Generation: this is needed for FOP-0.9 and later: + fop1.extensions=0 + xep.extensions=1 + # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9! + fop.extensions=0 + # No indent on body text: + body.start.indent=0pt + # Margin size: + page.margin.inner=0.5in + # Margin size: + page.margin.outer=0.5in + # Paper type = A4 + paper.type=A4 + # Yes, we want graphics for admonishments: + admon.graphics=1 + # Set this one for PDF generation *only*: + # default pnd graphics are awful in PDF form, + # better use SVG's instead: + pdf:admon.graphics.extension=".svg" + pdf:admon.graphics.path=$(boost-images)/ + ; + +install pdfinstall + : standalone + : .. PDF vmd.pdf + ; + +############################################################################### +alias boostdoc ; +explicit boostdoc ; +alias boostrelease : standalone ; +explicit boostrelease ; diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd.qbk new file mode 100644 index 0000000000000000000000000000000000000000..408a7264e73c9c3df46ce680c8507f6bd41da0dd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd.qbk @@ -0,0 +1,43 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[library The Variadic Macro Data Library + [quickbook 1.6] + [version 1.9] + [id variadic_macro_data] + [dirname vmd] + [copyright 2010-2017 Tropic Software East Inc] + [purpose Extension of Boost PP library functionality using variadic macros] + [category preprocessor] + [authors [Diener, Edward]] + [source-mode c++] +] + +[include vmd_introduction.qbk] +[include vmd_naming.qbk] +[include vmd_whyhow.qbk] +[include vmd_variadic_macros.qbk] +[include vmd_vc.qbk] +[include vmd_detail.qbk] +[include vmd_data_types.qbk] +[include vmd_specific.qbk] +[include vmd_generic.qbk] +[include vmd_modifiers.qbk] +[include vmd_identifier_subtyping.qbk] +[include vmd_useful.qbk] +[include vmd_internal.qbk] +[include vmd_reentrant.qbk] +[include vmd_dynamic_typing.qbk] +[include vmd_vc_isms.qbk] +[include vmd_conv17to18.qbk] +[include vmd_examples.qbk] +[include vmd_reference.qbk] +[include vmd_design.qbk] +[include vmd_compilers.qbk] +[include vmd_history.qbk] +[include vmd_acknowledgements.qbk] +[include vmd_index.qbk] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_acknowledgements.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_acknowledgements.qbk new file mode 100644 index 0000000000000000000000000000000000000000..a5939b9a455a555deba26399e952e531e772f428 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_acknowledgements.qbk @@ -0,0 +1,19 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_ack Acknowledgements] + +First and foremost I would like to thank Paul Mensonides for providing +advice, explanation and code for working with variadic macros and macros +in general. Secondly I would like to thank Steve Watanabe for his help, code, +and explanations. Finally I have to acknowledge that this library is an amalgam +of already known techniques for dealing with variadic macros themselves, +among which are techniques published online by Paul Mensonides. I have added +design and some cleverness in creating the library but I could not have done +it without the previous knowledge of others. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_assert.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_assert.qbk new file mode 100644 index 0000000000000000000000000000000000000000..7801ffc7861d8b07e365a132defd4e95ee9c6e83 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_assert.qbk @@ -0,0 +1,139 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_assert Asserting and data types] + +The VMD macros for identifying data types work best when the macro logic can take different +paths depending on the type of data being passed for a macro parameter. But occasionally +the preprocessor metaprogrammer wants to simply verify that the macro parameter data is of +the correct data type, else a preprocessing error should be generated to notify the programmer +invoking the macro that the data passed is the incorrect type. + +[heading Using BOOST_VMD_ASSERT] + +The Boost PP library has a macro which produces a preprocessing error when the condition +passed to it is 0. This macro is called BOOST_PP_ASSERT. The macro produces a preprocessor +error by forcing a call to an internal macro with the wrong number of arguments. According +to the C++ standard this should always cause an immediate preprocessing error for conforming +compilers. + +Unfortunately VC++ will only produce a warning when the wrong number of arguments are passed +to a macro. Therefore the BOOST_PP_ASSERT macro does not produce a preprocessing error using +VC++. Amazingly enough there appears to be no other way in which VC++ can be forced to +issue a preprocessing error by invoking a macro ( if you find one please tell me about it ). +However one can create invalid C++ as the output from a macro invocation which causes VC++ +to produce a compiler error when the VC++ compiler later encounters the construct. + +This is what the macro BOOST_VMD_ASSERT does. It takes the same conditional argument as +BOOST_PP_ASSERT and it calls BOOST_PP_ASSERT when not used with VC++, otherwise if the +condition is 0 it generates a compiler error by generating invalid C++ when used with VC++. +The compiler error is generated by producing invalid C++ whose form is: + + typedef char BOOST_VMD_ASSERT_ERROR[-1]; + +By passing a second optional argument, whose form is a preprocessing identifier, +to BOOST_VMD_ASSERT you can generate the invalid C++ for VC++, if the first +argument is 0, of the form: + + typedef char optional_argument[-1]; + +instead. This may give a little more clarity, if desired, to the C++ error generated. + +If the first conditional argument is not 0, BOOST_VMD_ASSERT produces no output. + +[heading BOOST_VMD_ASSERT Usage] + +To use the BOOST_VMD_ASSERT macro either include the general header: + + #include + +or include the specific header: + + #include + +[heading Assertions for data types ] + +The data types have their own assertion macros. These are largely just shortcuts for +passing the result of the identifying macros to BOOST_VMD_ASSERT. These assertion +macros are: + +* emptiness, BOOST_VMD_ASSERT_IS_EMPTY +* identifier, BOOST_VMD_ASSERT_IS_IDENTIFIER +* number, BOOST_VMD_ASSERT_IS_NUMBER +* array, BOOST_VMD_ASSERT_IS_ARRAY +* list, BOOST_VMD_ASSERT_IS_LIST +* seq, BOOST_VMD_ASSERT_IS_SEQ +* tuple, BOOST_VMD_ASSERT_IS_TUPLE +* type, BOOST_VMD_ASSERT_IS_TYPE + +Each of these macros take as parameters the exact same argument as their +corresponding identifying macros. But instead of returning non-zero or 0, each of these +macros produce a compiler error if the type of the input is not correct. + +Each of these macros only check for its assertion when the macro BOOST_VMD_ASSERT_DATA +is set to 1. By default BOOST_VMD_ASSERT_DATA is only set to 1 in compiler debug mode. +The programmer can manually set BOOST_VMD_ASSERT_DATA to 1 prior to using one +the data types assert macros if he wishes. + +[heading BOOST_VMD_ASSERT_... Usage] + +To use the individual BOOST_VMD_ASSERT_... macros either include the general header: + + #include + +or include the specific header: + + #include // BOOST_VMD_ASSERT_IS_EMPTY + #include // BOOST_VMD_ASSERT_IS_IDENTIFIER + #include // BOOST_VMD_ASSERT_IS_NUMBER + #include // BOOST_VMD_ASSERT_IS_ARRAY + #include // BOOST_VMD_ASSERT_IS_LIST + #include // BOOST_VMD_ASSERT_IS_SEQ + #include // BOOST_VMD_ASSERT_IS_TUPLE + #include // BOOST_VMD_ASSERT_IS_TYPE + +[heading Assertions and VC++ ] + +The VC++ compiler has a quirk when dealing with BOOST_VMD_ASSERT and the +data type assert macros. If you invoke one of the assert macros within another +macro which would normally generate output preprocessor tokens, it is necessary when using +VC++ to concatenate the result of the assert macro to whatever other preprocessor data +is being generated, even if the assert macro does not generate an error. + +As a simple example let us suppose we have a macro expecting a tuple and generating 1 +if the tuple has more than 2 elements, otherwise it generates 0. Ordinarily we could +write: + + #include + #include + #include + #include + + #define AMACRO(atuple) \ + BOOST_VMD_ASSERT_IS_TUPLE(atuple) \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) + +but for VC++ we must write + + #include + #include + #include + #include + #include + + #define AMACRO(atuple) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_ASSERT_IS_TUPLE(atuple), \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) \ + ) + +VC++ does not work correctly in the first instance, erroneously getting confused as far as +compiler output is concerned. But by using BOOST_PP_CAT in the second condition VC++ will +work correctly with VMD assertions. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_compilers.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_compilers.qbk new file mode 100644 index 0000000000000000000000000000000000000000..da8b8529f75ab415316a2b91138d2ece791cb085 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_compilers.qbk @@ -0,0 +1,27 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_compilers Compilers] + +On Windows I have tested this library using gcc/MingW, VC++, and clang targeting gcc. +The compilers tested are gcc 4.3.0, 4.4.0, 4.5.0-1, 4.5.2-1, 4.6.0, +4.6.1, 4.6.2, 4.7.0, 4.7.2, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.9.0, 4.9.1, 4.9.2, 4.9.3, +5.1.0, 5.2.0, VC++ 8.0, 9.0, 10.0, 11.0, 12.0, 14.0. and clang 3.4, 3.5, 3.6, 3.7, and the +latest clang build from source. + +On Linux I have tested this library using gcc 4.4.7, 4.6.4, 4.7.3, 4.8.2, 4.8.3, 4.9.1, +clang 3.3, 3.4, 3.5, and the latest clang build from source, and Intel C++ 12.1. 13.0, +14.0, 15.0, 16.0. + +For VC++ 8.0 the BOOST_VMD_IS_EMPTY and BOOST_VMD_ASSERT_IS_EMPTY macros +take a single parameter rather than variadic data because this +version of VC++ does not accept variadic data which may be empty. + +The compilers supported are those which are deemed to offer C99/C++11 +variadic macro support for Boost PP as represented by the BOOST_PP_VARIADICS macro. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_constraints.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_constraints.qbk new file mode 100644 index 0000000000000000000000000000000000000000..bcdeceaa1753ae396b91edbf2d3b507e7b9137f7 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_constraints.qbk @@ -0,0 +1,76 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_constraints Macro constraints] + +When discussing the BOOST_VMD_IS_EMPTY macro I mentioned constraining input to +the macro. Now I will discuss what this means in terms of preprocessor metaprogramming +and input to macros in general. + +[heading Constrained input] + +When a programmer designs any kinds of callables in C++ ( functions, member functions etc. ), +he specifies what the types of input and the return value are. The C++ compiler enforces this +specification at compile time. Similarly at run-time a callable may check that its +input falls within certain documented and defined boundaries and react accordingly +if it does not. This is all part of the constraints for any callable in C++ and should +be documented by any good programmer. + +The C++ preprocessor is much "dumber" than the C++ compiler and even with the preprocessor +metaprogramming constructs which Paul Mensonides has created in Boost PP there is far less +the preprocessor metaprogrammer can do at preprocessing time to constrain argument input +to a macro than a programmer can do at compile-time and/or at run-time to constrain argument +input to a C++ callable. Nevertheless it is perfectly valid to document what a macro expects +as its argument input and, if a programmer does not follow the constraint, the macro will fail +to work properly. In the ideal case in preprocessor metaprogramming the macro could tell whether +or not the constraint was met and could issue some sort of intelligible preprocessing error +when this occurred, but even within the reality of preprocessor metaprogramming with Boost PP +this is not always possible to do. Nevertheless if the user of a macro +does not follow the constraints for a macro parameter, as specified in the +documentation of a particular macro being invoked, any error which occurs is the +fault of that user. I realize that this may go against the strongly +held concept that programming errors must always be met with some sort of compile-time or +run-time occurrence which allows the programmer to correct the error, rather than a silent failure +which masks the error. Because the preprocessor is "dumber" and cannot provide this occurrence +in all cases the error could unfortunately be masked, despite the fact that the documentation +specifies the correct input constraint(s). In the case of the already discussed +macro BOOST_VMD_IS_EMPTY, this masking of the error could only occur with a preprocessor ( Visual C++ ) +which is not C++ standard conformant. + +The Boost PP library does have a way of generating a preprocessing error, without generating preprocessor +output, but once again this way does not work with the non-conformant preprocessor of Visual C++. The means +to do so using Boost PP is through the BOOST_PP_ASSERT macro. As will be seen and discussed later VMD has +an equivalent macro which will work with Visual C++ by producing incorrect C++ output rather than a preprocessing +error, but even this is not a complete solution since the incorrect C++ output produced could be hidden. + +Even the effort to produce a preprocessing error, or incorrect output inducing a compile-time error, +does not solve the problem of constrained input for preprocessor metaprogramming. Often it is impossible +to determine if the input meets the constraints which the preprocessor metaprogrammer places on it and +documents. Certain preprocessing tokens cannot be checked reliably for particular values, or a range of +values, without the checking mechanism itself creating a preprocessing error or undefined behavior. + +This does not mean that one should give up attempting to check macro input constraints. If it can be done +I see the value of such checks and a number of VMD macros, discussed later, are designed as preprocessing +input constraint checking macros. But the most important thing when dealing with macro input constraints is +that they should be carefully documented, and that the programmer should know that if the constraints are +not met either preprocessing errors or incorrect macro results could be the results. + +The VMD library, in order to present more preprocessor programming functionality and +flexibility, allows that erroneous results could occur if certain input constraints are not met, whether the +erroneous results are preprocessing errors or incorrect output from a VMD macro. At the same time the VMD does +everything that the preprocessor is capable of doing to check the input constraints, and carefully documents +for each macro in the library what the input for each could be in order to avoid erroneous output. + +Documented macro input constraints are just as valid in the preprocessor as +compile-time/run-time constraints are valid in C++, even if the detection of such constraints +and/or the handling of constraints that are not met are far more difficult, +if not impossible, in the preprocessor than in the compile-time/run-time processing of C++. + +The VMD library uses constraints for most of it macros and the documentation for those macros +mentions the constraints that apply in order to use the macro. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_conv17to18.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_conv17to18.qbk new file mode 100644 index 0000000000000000000000000000000000000000..4b6ee69471a42ebabe856ed7d23d84e1dfa84146 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_conv17to18.qbk @@ -0,0 +1,312 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_conv Version 1.7 to 1.8 conversion] + +Since the current version of VMD has been drastically changed +to make it easier to use VMD functionality this section +details equivalent functionality for previous version 1.7 +VMD macros. + +The changes in functionality involve the parsing of sequences. +The equivalent to all the V1.7 functionality, which looks for +various data types at the beginning of a sequence, is encompassed +by the V1.8 macro BOOST_VMD_ELEM(0,sequence,...), where '0' is the first +sequence element and 'sequence' is the sequence, with its optional +parameters. + +[heading Identifier] + +V1.7 + +BOOST_VMD_IDENTIFIER(sequence,keys,...) looked for an identifier at +the beginning of a sequence and returned a 2-element tuple, where the first +element is the matching index starting with 1, or 0 if no identifier is found, +and the second tuple element is the rest of the sequence or emptiness if no +identifier is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX) +returns a 3-element tuple where the identifier found is the first tuple element, +the rest of the sequence is the second tuple element, and the matching index, starting with +0, is the 3rd tuple element. If no identifier is found all elements of the returned tuple are empty. + +V1.7 + +BOOST_VMD_BEGIN_IDENTIFIER(sequence,keys,...) looked for an identifier at +the beginning of a sequence and returned the matching index starting with 1, or +0 if no identifier is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX) +returns a 2-element tuple where the identifier found is the first tuple element +and the matching index, starting with 0, is the 2nd tuple element. If no identifier +is found both elements of the returned tuple are empty. + +V1.7 + +BOOST_VMD_AFTER_IDENTIFIER(sequence,keys,...) looked for an identifier at the +beginning of a sequence and returned the rest of the sequence or emptiness if +no identifier is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_IS_BEGIN_IDENTIFIER(sequence,keys,...) returns 1 if input +begins with an identifier, else 0 if it does not. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER) returns the identifier found, +otherwise emptiness if not found. You can use +BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,identifiers,BOOST_VMD_TYPE_IDENTIFIER))) +as the exact equivalent. + +[heading Number] + +V1.7 + +BOOST_VMD_NUMBER(sequence,...) looked for a number at +the beginning of a sequence and returned a 2-element tuple, where the first +element is the number and the second tuple element is the rest of the sequence. +If no number is found both tuple elements are empty. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_BEGIN_NUMBER(sequence,...) looked for a number at +the beginning of a sequence and returned the number if found or emptiness +if no number is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_AFTER_NUMBER(sequence,...) looked for a number at the +beginning of a sequence and returned the rest of the sequence or emptiness if +no number is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_ONLY_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_IS_BEGIN_NUMBER(sequence,...) returns 1 if input +begins with a number, else 0 if it does not. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) returns the number found, +otherwise emptiness if not found. You can use +BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER))) +as the exact equivalent. + +[heading Array] + +V1.7 + +BOOST_VMD_ARRAY(sequence) looked for an array at +the beginning of a sequence and returned a 2-element tuple, where the first +element is the array and the second tuple element is the rest of the sequence. +If no array is found both tuple elements are empty. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_BEGIN_ARRAY(sequence) looked for an array at +the beginning of a sequence and returned the array if found or emptiness +if no array is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) +is the exact equivalent. + +V1.7 + +BOOST_VMD_AFTER_ARRAY(sequence) looked for an array at the +beginning of a sequence and returned the rest of the sequence or emptiness if +no array is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_ONLY_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_IS_BEGIN_ARRAY(sequence,...) returns 1 if input +begins with an array, else 0 if it does not. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) returns the array found, +otherwise emptiness if not found. You can use +BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY))) +as the exact equivalent. + +[heading List] + +V1.7 + +BOOST_VMD_LIST(sequence) looked for an list at +the beginning of a sequence and returned a 2-element tuple, where the first +element is the list and the second tuple element is the rest of the sequence. +If no list is found both tuple elements are empty. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_BEGIN_LIST(sequence) looked for a list at +the beginning of a sequence and returned the list if found or emptiness +if no list is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) is the exact equivalent. + +V1.7 + +BOOST_VMD_AFTER_LIST(sequence) looked for an list at the +beginning of a sequence and returned the rest of the sequence or emptiness if +no list is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_ONLY_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_IS_BEGIN_LIST(sequence,...) returns 1 if input +begins with an list, else 0 if it does not. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) returns the list found, +otherwise emptiness if not found. You can use +BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST))) +as the exact equivalent. + +[heading Seq] + +V1.7 + +BOOST_VMD_SEQ(sequence) looked for a seq at +the beginning of a sequence and returned a 2-element tuple, where the first +element is the seq and the second tuple element is the rest of the sequence. +If no seq is found both tuple elements are empty. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_BEGIN_SEQ(sequence) looked for a seq at +the beginning of a sequence and returned the seq if found or emptiness +if no seq is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) is the exact equivalent. + +V1.7 + +BOOST_VMD_AFTER_SEQ(sequence) looked for an seq at the +beginning of a sequence and returned the rest of the sequence or emptiness if +no seq is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_ONLY_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_IS_BEGIN_SEQ(sequence,...) returns 1 if input +begins with an seq, else 0 if it does not. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) returns the seq found, +otherwise emptiness if not found. You can use +BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ))) +as the exact equivalent. + +[heading Tuple] + +V1.7 + +BOOST_VMD_TUPLE(sequence) looked for an tuple at +the beginning of a sequence and returned a 2-element tuple, where the first +element is the tuple and the second tuple element is the rest of the sequence. +If no tuple is found both tuple elements are empty. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_BEGIN_TUPLE(sequence) looked for a tuple at +the beginning of a sequence and returned the tuple if found or emptiness +if no tuple is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) is the exact equivalent. + +V1.7 + +BOOST_VMD_AFTER_TUPLE(sequence) looked for an tuple at the +beginning of a sequence and returned the rest of the sequence or emptiness if +no tuple is found. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_ONLY_AFTER) +is the exact equivalent. + +V1.7 + +BOOST_VMD_IS_BEGIN_TUPLE(sequence,...) returns 1 if input +begins with an tuple, else 0 if it does not. + +V1.8 equivalent + +BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) returns the tuple found, +otherwise emptiness if not found. You can use +BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE))) +as the exact equivalent. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_data_types.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_data_types.qbk new file mode 100644 index 0000000000000000000000000000000000000000..783f1423d38c5014d52e1011fe069f7d6b8c71d2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_data_types.qbk @@ -0,0 +1,72 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_data_types Data types] + +The VMD library has functionality for testing and parsing preprocessor data. + +The C++ preprocessor defines preprocessor data as preprocessing tokens. +The types of preprocessing tokens can be seen in section 2.5 of the C++ standard document. + +The VMD library works with a subset of two of these types of preprocessor tokens +as "data types". These are the "identifier" and "pp-number" preprocessor tokens. +The preprocessor token types which VMD cannot parse are: + +* header-name +* character-literal +* user-defined-characteral-literal +* string-literal +* user-defined-string-literal +* preprocessing-op-or-punc + +Even though VMD cannot parse these preprocessor token types, it is still +a very useful library since a large part of macro programming works with +'identifier' and 'pp-number' tokens. + +VMD identifiers are preprocessing tokens consisting +of alphanumeric characters and the underscore ( _ ) character. This is very similar to a +preprocessor token "identifier" with the difference being that a VMD identifier can start with a +numeric character, allowing VMD identifiers to also be positive integral literals. VMD offers +functionality for parsing VMD identifiers both as a separate element or in a sequence of preprocessing +tokens. + +VMD numbers are Boost PP numbers, ie. preprocessing tokens of +whole numbers between 0 and 256 inclusive. These are a small subset of preprocessor token +"pp-number". VMD offers functionality for parsing numbers both as a separate element or +in a sequence of preprocessing tokens. A VMD number is really a subset of VMD identifiers +for which VMD offers specific functionality. The Boost PP library has it own extensive support +for numbers, which VMD does not duplicate. + +VMD v-types are, like numbers, a subset of VMD identifiers consisting of identifiers beginning with +BOOST_VMD_TYPE_ followed by a data type mnemonic. Each v-type can be recognized by VMD functionality +and therefore passed or returned by macros. Like any identifier a v-type can be parsed both as a +separate element or in a sequence of preprocessing tokens. + +VMD can also test for emptiness, or the absence of any preprocessing tokens when passed +as macro input. + +The Boost PP library supports four individual high-level data types. These are arrays, +lists, seqs, and tuples. When using variadic macros arrays are really +obsolete since tuples have all the functionality of arrays with a simpler syntax. +Nonetheless arrays are fully supported by VMD. A further data type supported by +Boost PP is variadic data, which is a comma separated grouping of preprocessor elements. +VMD has no special support for variadic data outside of what is already in Boost PP. + +VMD has functionality to work with the four Boost PP high-level data types. VMD can +test the Boost PP data types and parse them in a sequence of preprocessor tokens. + +VMD can also parse sequences. A sequence consists of zero or more other top-level +data types already mentioned represented consecutively. As such a sequence represents +any data type which VMD can parse since it can consist of emptiness, a single data type, +or multiple data types represented consecutively. + +Emptiness, the three identifier types, the four Boost PP composite data types, and +VMD sequences are the data types which VMD understands. Other low-level preprocessor +data types can of course be used in macro programming but VMD cannot parse such +preprocessor data. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_design.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_design.qbk new file mode 100644 index 0000000000000000000000000000000000000000..64e464891ed4985f3cf51dd238b4fb7e7da0ab13 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_design.qbk @@ -0,0 +1,53 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_design Design] + +The initial impetus for creating this library was entirely practical. I had been +working on another library of macro functionality, which used Boost PP +functionality, and I realized that if I could use variadic macros with +my other library, the end-user usability for that library would be easier. +Therefore the initial main design goal of this library was to interoperate variadic macro data +with Boost PP in the easiest and clearest way possible. + +This led to the original versions of the library as an impetus for +adding variadic macro data support to Boost PP. While this was being done, +but the variadic macro data support had not yet been finalized in Boost PP, +I still maintained the library in two modes, either its own variadic data +functionality or deferring to the implementation of variadic macros in the +Boost PP library. + +Once support for variadic data had been added to Boost PP I stripped +down the functionality of this library to only include variadic macro +support for functionality which was an adjunct to the support in Boost PP. +This functionality might be seen as experimental, since it largely relied on a macro +which tested for empty input which Paul Mensonides, the author of Boost PP, had +published on the Internet, and which by the very nature of the C++ preprocessor +is slightly flawed but which was the closest approximation of such functionality +which I believed could be made. I had to tweak this macro somewhat for the Visual C++ +preprocessor, whose conformance to the C++ standard for macro processing is notably +incorrect in a number of areas. But I still felt this functionality could be used +in select situations and might be useful to others. Using this functionality +I was able to build up some other macros which tested for the various Boost PP +data types. I also was able to add in functionality, based on Paul Mendsonides +excellent work, for handling tuples in preprocessing data. + +All of this particular functionality is impossible to do effectively +without the use of variadic macros. But I had kept these features at a +minimum because of the difficulty of using variadic macros with compilers, +most notably Visual C++, whose implementation of variadic macros is +substandard and therefore very difficult to get to work correctly when +variadic macros must be used. + +I then realized that if I am going to have a library which takes advantage +of variadic macros I should see what I could do in the area of parsing +preprocessor data. This has led to a reorganization of the library as +a set of macros largely for parsing preprocessor data. All of this is now built +on top of my use of the almost perfect checking for emptiness which Paul +Mensonides originally created. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_detail.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_detail.qbk new file mode 100644 index 0000000000000000000000000000000000000000..a4b48d9e5a9bc65400516168c3d66de34a30c696 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_detail.qbk @@ -0,0 +1,39 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_detail Functional groups] + +The particular constructs for which VMD has functionality +can be divided into these categories: + +# Emptiness +# Identifiers +# Numbers +# Types +# Boost PP data types ( array, list, seq, and tuple ) +# Sequences +# Additional helper variadic macros + +The first six categories delineate the data types which VMD can parse. +The last category presents additional macros which will prove helpful +for a macro programmer using variadic macros with VMD and Boost PP. + +A general explanation of each of these categories will follow in the +appropriate place in the documentation. + +Furthermore VMD macros for working with the above data types which VMD +understands can be divided into 'specific' and 'generic' macros. + +The specific macros ask whether some input data is a particular +data type. The generic macros work with input data as any data +type while allowing the programmer to separately query the type +of data. + +Both specific and generic macros have their place and the macro +programmer can decide which to use for any given situation. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_dynamic_typing.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_dynamic_typing.qbk new file mode 100644 index 0000000000000000000000000000000000000000..0f94bf615664683b7628007e58231187cb6082d0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_dynamic_typing.qbk @@ -0,0 +1,36 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_dynamic_typing Input as dynamic types] + +Within the constraints based on the top-level types which VMD can parse, +the libraries gives the end-user the ability to design macros with +dynamic data types. By this I mean that a macro could be designed to handle +different data types based on some documented agreement of different combinations +of macro input meaning slightly different things. Add to this the ability +to design such macros with variadic parameters and we have a preprocessor +system of macro creation which to a lesser extent rivals the DSELS of template +metaprogramming. Of course the preprocessor is not nearly as flexible as +C++ templates, but still the sort of preprocessor metaprogramming one could +do with VMD, and the underlying Boost PP, in creating flexible macros which +can handle different combinations of data types is very interesting. + +Of course macros need to be usable by an end-user so the syntactical ability +of sequences to represent different types of input data must +be balanced against ease of use and understanding when using a macro. But because +certain sequences can mimic C++ function calls to some extent it is possible +to represent macros as a language closer to C++ with VMD. + +What is important when designing a macro in which you parse input to decide which type +of data the invoker is passing to your macro is that you are aware of the constraints +when parsing a data type. As an example if you design a macro where some input can either +be a number, an identifier, or some other data type top-level input then attempting +to parse the data to see if it is a number or identifier could fail with a preprocessor +error and nullify your design if the data is not a VMD data type. So designing a macro with +data types in mind often means restricting data to parseable top-level types. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_empty.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_empty.qbk new file mode 100644 index 0000000000000000000000000000000000000000..f6f39a571f5c7c983e501719179c25ea51ba8a90 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_empty.qbk @@ -0,0 +1,326 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_test_empty Emptiness] + +[heading Passing empty arguments] + +It is possible to pass an empty argument to a macro. +The official terminology for this in the C++ standard is an argument +"consisting of no preprocessing tokens". + +Let us consider a number of cases without worrying too much +what the macro output represents. + +Consider these two function-like macros: + + #define SMACRO() someoutput + #define EMACRO(x) otheroutput x + +The first macro takes no parameters so invoking it must always be done by + + SMACRO() + +and passing any arguments to it would be invalid. + +The second macro takes a single parameter. it can be evoked as + + EMACRO(somedata) + +but it also can be invoked as + + EMACRO() + +In the second invocation of EMACRO we are passing an empty argument to the macro. +Similarly for any macro having 1 or more parameters, an empty argument +can be validly passed for any of the parameters, as in + + #define MMACRO(x,y,z) x y z + + MMACRO(1,,2) + +An empty argument is an argument even if we are passing nothing. + +Because an empty argument can be passed for a given parameter of +a macro does not mean one should do so. Any given macro will specify what each +argument to a macro should represent, and it is has normally been very rare to encounter +a macro which specifies that an empty argument can logically be passed for a given +argument. But from the perspective of standard C++ it is perfectly valid to +pass an empty argument for a macro parameter. + +The notion of passing empty arguments can be extended to passing empty data which +"consists of no preprocessing tokens" in slightly more complicated situations. +It is possible to pass empty data as an argument to a variadic macro in the form of +variadic macro data, as in + + #define VMACRO(x,...) x __VA_ARGS__ + +invoked as + + VMACRO(somedata,) + +Here one passes empty data as the variadic macro data and it is perfectly valid C++. +Please notice that this different from + + VMACRO(somedata) + +which is not valid C++ since something must be passed for the variadic argument. +Similar one could invoke the macro as + + VMACRO(somedata,vdata1,,vdata3) + +where one is passing variadic macro data but an element in the variadic macro data is empty. + +Furthermore if we are invoking a macro which expects a Boost PP data type, such as +a tuple, we could also validly pass empty data for all or part of the data in a tuple, +as in + + #define TMACRO(x,atuple) x atuple + + TMACRO(somedata,()) + +In this case we are passing a 1 element tuple +where the single element itself is empty. + +or + + TMACRO(somedata,(telem1,,telem2,teleem3)) + +In this case we are passing a 4 element tuple where +the second element is empty. + +Again either invocation is valid C++ but it is not necessarily what the +designed of the macro has desired, even if in both cases the macro designer +has specified that the second parameter must be a tuple for the macro +to work properly. + +[heading Returning emptiness] + +Similar to passing empty arguments in various ways to a macro, +the data which a macro returns ( or 'generates' may be a better term ) +could be empty, in various ways. Again I am not necessarily promoting +this idea as a common occurrence of macro design but merely pointing it +out as valid C++ preprocessing. + + #define RMACRO(x,y,z) + + RMACRO(data1,data2,data3) + +It is perfectly valid C++ to return "nothing" from a macro invocation. +In fact a number of macros in Boost PP do that based on the preprocessor +metaprogramming logic of the macro, and are documented as such. + +Similarly one could return nothing as part or all of a Boost PP +data type or even as part of variadic macro data. + + #define TRETMACRO(x,y,z) () + #define TRETMACRO1(x,y,z) (x,,y,,z) + #define VRETMACRO(x,y,z) x,,y,,z + +Here again we are returning something but in terms of a Boost PP +tuple or in terms of variadic data, we have elements which are empty. + +[heading Emptiness in preprocessor metaprogramming] + +In the examples given above where "emptiness" in one form of another +is passed as arguments to a macro or returned from a macro, the examples +I have given were created as simplified as possible to illustrate my points. +In actual preprocessor metaprogramming, using Boost PP, where complicated logic +is used to generate macro output based on the arguments to a macro, it might be +useful to allow and work with empty data if one were able to test for the fact +that data was indeed empty. + +[heading Testing for empty data] + +Currently Boost PP has an undocumented macro for testing whether +a parameter is empty of not, written without the use of variadic +macros. The macro is called BOOST_PP_IS_EMPTY. The macro is by its nature flawed, +since there is no generalized way of determining whether or not a +parameter is empty using the C++ preprocessor. But the macro will +work given input limited in various ways or if the input is actually empty. + +Paul Mensonides, the developer of Boost PP and the BOOST_PP_IS_EMPTY macro +in that library, also wrote a better macro using variadic +macros, for determining whether or not a parameter is empty or not, which +he published on the Internet in response to a discussion about emptiness. +This macro is also not perfect, since there is no perfect solution, +but will work correctly with almost all input. I have adapted his code +for the VMD and developed my own very slightly different code. + +The macro is called [macroref BOOST_VMD_IS_EMPTY] and will return 1 if its input +is empty or 0 if its input is not empty. The macro +is a variadic macro which make take any input +[footnote For VC++ 8 the input is not variadic data but a single parameter]. + +[heading Macro Flaw with a standard C++ compiler] + +The one situation where the macro always does not work properly is if its input resolves +to a function-like macro name or a sequence of preprocessor tokens ending with +a function-like macro name and the function-like macro takes two or more parameters. + +Here is a simple example: + + #include + + #define FMACRO(x,y) any_output + + BOOST_VMD_IS_EMPTY(FMACRO) + BOOST_VMD_IS_EMPTY(some_input FMACRO) + +In the first case the name of a function-like macro is being passed to +BOOST_VMD_IS_EMPTY while in the second case a sequence of preprocessing tokens is being +passed to BOOST_VMD_IS_EMPTY ending with the name of a function-like macro. +The function-like macro also has two ( or more ) parameters. In both the +cases above a compiler error will result from the use of BOOST_VMD_IS_EMPTY. + +Please note that these two problematical cases are not the same as passing +an invocation of a function-like macro name to BOOST_VMD_IS_EMPTY, as in + + #include + + BOOST_VMD_IS_EMPTY(FMACRO(arg1,arg2)) + BOOST_VMD_IS_EMPTY(someinput FMACRO(arg1,arg2)) + +which always works correctly, unless of course a particular function-like macro +invocation resolves to either of our two previous situations. + +Another situation where the macro may not work properly is if the previously mentioned +function-like macro takes a single parameter but creates an error when the argument +passed is empty. An example of this would be: + + #define FMACRO(x) BOOST_PP_CAT(+,x C); + +When nothing is passed to FMACRO undefined behavior will occur since attempting to concatenate +'+' to ' C' is UB in C++ preprocessor terms. + +So for a standard conforming compiler we have essentially a single corner case where +the BOOST_VMD_IS_EMPTY does not work and, when it does not work it, produces a +compiler error rather than an incorrect result. Essentially what is desired for maximum +safety is that we never pass input ending with the name of a function-like macro name when +testing for emptiness. + +[heading Macro Flaw with Visual C++] + +The VC++ preprocessor is not a standard C++ conforming preprocessor in at least two +relevant situations to our discussion of emptiness. These situations combine to create +a single corner case which causes the BOOST_VMD_IS_EMPTY macro to not work properly +using VC++ when the input resolves to a function-like macro name. + +The first situation, related to our discussion of emptiness, where the VC++ preprocessor +is not a standard C++ conforming preprocessor is that if a macro taking 'n' number of parameters is invoked +with 0 to 'n-1' parameters, the compiler does not give an error, but only a warning. + + #define FMACRO(x,y) x + y + + FMACRO(1) + +should give a compiler error, as it does when using a C++ standard-conforming +compiler, but when invoked using VC++ it only gives a warning +and VC++ continues macro substitution with 'y' as a placemarker preprocessing token. +This non-standard conforming action actually eliminates the case where BOOST_VMD_IS_EMPTY +does not work properly with a standard C++ conforming compiler. But of course it has the +potential of producing incorrect output in other macro processing situations unrelated +to the BOOST_VMD_IS_EMPTY invocation, where a compiler error should occur. + +A second general situation, related to our discussion of emptiness, where the VC++ preprocessor +is not a standard C++ conforming preprocessor is that the expansion of a macro works incorrectly +when the expanded macro is a function-like macro name followed by a function-like macro invocation, +in which case the macro re-expansion is erroneously done more than once. This latter case can be +seen by this example: + + #define FMACRO1(parameter) FMACRO3 parameter() + #define FMACRO2() () + #define FMACRO3() 1 + + FMACRO1(FMACRO2) + + should expand to: + + FMACRO3() + + but in VC++ it expands to: + + 1 + +where after initially expanding the macro to: + + FMACRO3 FMACRO2() + +VC++ erroneously rescans the sequence of preprocessing tokens more than once rather than +rescan just one more time for more macro names. + +What these two particular preprocessor flaws in the VC++ compiler mean is that although +BOOST_VMD_IS_EMPTY does not fail with a compiler error in the same case as with +a standard C++ conforming compiler given previously, it fails by giving +the wrong result in another situation. + +The failing situation is: + +when the input to BOOST_VMD_IS_EMPTY resolves to only a function-like macro +name, and the function-like macro, when passed a single empty argument, expands to +a Boost PP tuple, BOOST_VMD_IS_EMPTY will erroneously return 1 when using the Visual C++ +compiler rather than either give a preprocessing error or return 0. + +Here is an example of the failure: + + #include + + #define FMACRO4() ( any_number_of_tuple_elements ) + #define FMACRO5(param) ( any_number_of_tuple_elements ) + #define FMACRO6(param1,param2) ( any_number_of_tuple_elements ) + + BOOST_VMD_IS_EMPTY(FMACRO4) // erroneously returns 1, instead of 0 + BOOST_VMD_IS_EMPTY(FMACRO5) // erroneously returns 1, instead of 0 + BOOST_VMD_IS_EMPTY(FMACRO6) // erroneously returns 1, instead of generating a preprocessing error + +As with a standard C++ conforming compiler, we have a rare corner case where +the BOOST_VMD_IS_EMPTY will not work properly, but unfortunately in this very +similar but even rarer corner case with VC++, we will silently get an incorrect result +rather than a compiler error. + +I want to reiterate that there is no perfect solution in C++ to the detection of +emptiness even for a C++ compiler whose preprocessor is completely conformant, which +VC++ obviously is not. + +[heading Macro Flaw conclusion] + +With all of the above mentioned, the case(s) where BOOST_VMD_IS_EMPTY will work +incorrectly are very small, even with the erroneous VC++ preprocessor, +and I consider the macro worthwhile to use since it works correctly with the vast +majority of possible preprocessor input. + +The case where it will not work, with both a C++ standard conforming preprocessor or +with Visual C++, occurs when the name of a function-like macro is part of the input +to BOOST_VMD_IS_EMPTY. Obviously the macro should be used by the preprocessor +metaprogrammer when the possible input to it is constrained to eliminate the erroneous +case. + +Furthermore, since emptiness can correctly be tested for in nearly every situation, the +BOOST_VMD_IS_EMPTY macro can be used internally when the preprocessor metaprogrammer wants to return data +from a macro and all or part of that data could be empty. + +Therefore I believe the BOOST_VMD_IS_EMPTY macro is quite useful, despite the corner case flaw +which makes it imperfect. Consequently I believe that the preprocessor metaprogrammer +can use the concept of empty preprocessor data in the design of his own macros. + +[heading Using the macro] + +The macro BOOST_VMD_IS_EMPTY is used internally throughout VMD and macro programmers +may find this macro useful in their own programming efforts despite the slight flaw +in the way that it works. + +You can use the general header file: + + #include + +or you can use the individual header file: + + #include + +for the BOOST_VMD_IS_EMPTY macro. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_empty_ppdata.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_empty_ppdata.qbk new file mode 100644 index 0000000000000000000000000000000000000000..60a2c8f78e663cece53ff442da7cdef5e6472159 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_empty_ppdata.qbk @@ -0,0 +1,322 @@ +[/ + (C) Copyright Edward Diener 2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_empty_ppdata Functionality for "empty" seqs and tuples] + +Boost PP arrays and lists can be empty but seqs and tuples cannot. +The form of an empty array is '(0,())' and the form of an empty +list is 'BOOST_PP_NIL'. But the form of '()' does not represent +an empty seq or an empty tuple. Instead for a seq it represents +a one element seq whose data is empty, while for a tuple it +represents a tuple with a size of 1 whose single element is empty. + +Not having a way to represent an empty seq or tuple represents a +small problem for Boost PP users. For a tuple, especially, not being +able to be "empty" is the only reason, when variadic macros are supported, +why an end-user might prefer to use an array rather than a tuple as +Boost PP preprocessor data. Otherwise, when using variadic macros, using +a tuple is easier to notate and subsequently use than an array +since no effort is needed to specify the number of elements of a tuple. + +VMD as we have seen has functionality to tell when preprocessor data is "empty" +through its BOOST_VMD_IS_EMPTY macro. Because of this it is possible to treat +emptiness, when applied to a seq or tuple, as an empty seq or an empty tuple +respectively, thus allowing seqs and tuples to be empty, just as arrays and +lists are. + +However there is one large problem when treating emptiness as an empty seq or +empty tuple; Boost PP functionality for a seq or tuple knows nothing about it. +In other words if you passed emptiness to a Boost PP macro which expects a +seq or tuple, such as: + + BOOST_PP_SEQ_SIZE() + +or + + BOOST_PP_TUPLE_PUSH_BACK(,1) + +you would get UB, undefined behavior. + +In order to use seqs and tuples which can be empty VMD defines a number +of macros which mimic many of those in Boost PP, but begin with BOOST_VMD_ +rather than BOOST_PP_. The VMD macros work with what I will call a 'VMD seq' or +a 'VMD tuple', while the Boost PP equivalents work with the traditional seq +or tuple. A VMD seq is a seq which may be empty and a VMD tuple is a tuple +which may be empty. A VMD seq is therefore a superset of a normal seq and a +VMD tuple is therefore a superset of a normal tuple. The VMD functionality +therefore can accept a VMD seq or tuple or a normal seq or tuple whereas the +equivalent Boost PP functionality only accepts a normal seq or tuple. To be more +more precise the Boost PP functionality can accept a VMD seq or a VMD tuple as +long as it is not empty. In other words there is no difference between a +non-empty VMD seq or a Boost PP seq, or between a non-empty VMD tuple and +a Boost PP tuple. + +The particular macros which VMD supplies, supporting VMD seqs and VMD tuples, +are divided between array, list, seq, and tuple functionality. The actual header +files for these macros are in sub-directories of the VMD directory, which start +respectively with 'array','list','seq' and 'tuple'. The header files are all +also included in the general boost/vmd/vmd.hpp header file. + +[heading Array macros] + +The array macros provide conversions from an array to a VMD seq or a VMD tuple. +The array macros are: + +[table:vpp_array Array macros +[[Macro][Parameter][Return][Functionality][Header]] +[ +[BOOST_VMD_ARRAY_TO_SEQ] +[array = a Boost PP array] +[A VMD seq] +[Converts an array to a VMD seq. If the array is empty the seq is empty, otherwise the conversion is the same as BOOST_PP_ARRAY_TO_SEQ] +[boost/vmd/array/to_seq.hpp] +] +[ +[BOOST_VMD_ARRAY_TO_TUPLE] +[array = a Boost PP array] +[A VMD tuple] +[Converts an array to a VMD tuple. If the array is empty the tuple is empty, otherwise the conversion is the same as BOOST_PP_ARRAY_TO_TUPLE] +[boost/vmd/array/to_tuple.hpp] +] +] + +The difference between the array conversion macros and their equivalent ones +in Boost PP is that if the array is empty the VMD macros return emptiness +whereas the Boost PP macros have UB. + +You can include the array macros either using their individual header files, +the general 'boost/vmd/array.hpp' header file for all array macros, or the +general header file 'boost/vmd/vmd.hpp' for all macros. + +[heading List macros] + +The list macros provide conversions from a list to a VMD seq or a VMD tuple. +The list macros are: + +[table:vpp_list List macros +[[Macro][Parameter][Return][Functionality][Header]] +[ +[BOOST_VMD_LIST_TO_SEQ] +[list = a Boost PP list] +[A VMD seq] +[Converts a list to a VMD seq. If the list is empty the seq is empty, otherwise the conversion is the same as BOOST_PP_LIST_TO_SEQ] +[boost/vmd/list/to_seq.hpp] +] +[ +[BOOST_VMD_LIST_TO_TUPLE] +[list = a Boost PP list] +[A VMD tuple] +[Converts a list to a VMD tuple. If the list is empty the tuple is empty, otherwise the conversion is the same as BOOST_PP_LIST_TO_TUPLE] +[boost/vmd/list/to_tuple.hpp] +] +] + +The difference between the list conversion macros and their equivalent ones +in Boost PP is that if the list is empty the VMD macros return emptiness +whereas the Boost PP macros have UB. + +You can include the list macros either using their individual header files, +the general 'boost/vmd/list.hpp' header file for all list macros, or the +general header file 'boost/vmd/vmd.hpp' for all macros. + +[heading Seq macros] + +The seq macros either work with a VMD seq or return A VMD seq. The seq macros are: + +[table:vpp_seq Seq macros +[[Macro][Parameter][Return][Functionality][Header]] +[ +[BOOST_VMD_IS_VMD_SEQ] +[sequence = a VMD sequence] +[1 if the VMD sequence is a VMD seq, else 0] +[Tests a sequence as a VMD seq. If the sequence is empty returns 1, otherwise returns the same as BOOST_VMD_IS_SEQ] +[boost/vmd/seq/is_vmd_seq.hpp] +] +[ +[BOOST_VMD_SEQ_POP_BACK] +[seq = a Boost PP seq] +[A VMD seq] +[Pops an element from the end of a seq. If the seq has a single element returns an empty seq, otherwise works exactly the same as BOOST_PP_SEQ_POP_BACK] +[boost/vmd/seq/pop_back.hpp] +] +[ +[BOOST_VMD_SEQ_POP_FRONT] +[seq = a Boost PP seq] +[A VMD seq] +[Pops an element from the beginning of a seq. If the seq has a single element returns an empty seq, otherwise works exactly the same as BOOST_PP_SEQ_POP_FRONT] +[boost/vmd/seq/pop_front.hpp] +] +[ +[BOOST_VMD_SEQ_PUSH_BACK] +[seq = a VMD seq, elem = element to push onto the end of the VMD seq] +[A Boost PP seq] +[Pushes an element onto the end of a VMD seq. If the VMD seq is empty the returned seq consists of that element, otherwise works exactly the same as BOOST_PP_SEQ_PUSH_BACK] +[boost/vmd/seq/push_back.hpp] +] +[ +[BOOST_VMD_SEQ_PUSH_FRONT] +[seq = a VMD seq, elem = element to push onto the beginning of the VMD seq] +[A Boost PP seq] +[Pushes an element onto the beginning of a VMD seq. If the VMD seq is empty the returned seq consists of that element, otherwise works exactly the same as BOOST_PP_SEQ_PUSH_FRONT] +[boost/vmd/seq/push_front.hpp] +] +[ +[BOOST_VMD_SEQ_REMOVE] +[seq = a Boost PP seq, i = index of element to remove] +[A VMD seq] +[Removes an element from a Boost PP seq. If the seq has a single element and the index to be removed is 0 returns an empty seq, otherwise works exactly the same as BOOST_PP_SEQ_REMOVE] +[boost/vmd/seq/remove.hpp] +] +[ +[BOOST_VMD_SEQ_SIZE] +[seq = a VMD seq] +[The number of elements in the VMD seq] +[Returns the number of elements in the VMD seq. If the seq is empty returns 0, otherwise works exactly the same as BOOST_PP_SEQ_SIZE] +[boost/vmd/seq/size.hpp] +] +[ +[BOOST_VMD_SEQ_TO_ARRAY] +[seq = a VMD seq] +[A Boost PP array] +[Converts a VMD seq to a Boost PP array. If the seq is empty returns an empty array whose form is '(0,())', otherwise works exactly the same as BOOST_PP_SEQ_TO_ARRAY] +[boost/vmd/seq/to_array.hpp] +] +[ +[BOOST_VMD_SEQ_TO_LIST] +[seq = a VMD seq] +[A Boost PP list] +[Converts a VMD seq to a Boost PP list. If the seq is empty returns an empty list whose form is 'BOOST_PP_NIL', otherwise works exactly the same as BOOST_PP_SEQ_TO_LIST] +[boost/vmd/seq/to_list.hpp] +] +[ +[BOOST_VMD_SEQ_TO_TUPLE] +[seq = a VMD seq] +[A VMD tuple] +[Converts a VMD seq to a VMD tuple. If the seq is empty returns an empty tuple, otherwise works exactly the same as BOOST_PP_SEQ_TO_TUPLE] +[boost/vmd/seq/to_tuple.hpp] +] +] + +The difference between the seq macros and their equivalent ones in Boost PP is +that working with a VMD seq or returning a VMD seq is valid with the seq macros +but with the Boost PP equivalent macros working with an empty seq causes UB and +returning an empty seq can never occur. + +You can include the seq macros either using their individual header files, +the general 'boost/vmd/seq.hpp' header file for all seq macros, or the +general header file 'boost/vmd/vmd.hpp' for all macros. + +[heading Tuple macros] + +The tuple macros either work with a VMD tuple or return a VMD tuple. The tuple macros are: + +[table:vpp_tuple Tuple macros +[[Macro][Parameter][Return][Functionality][Header]] +[ +[BOOST_VMD_IS_VMD_TUPLE] +[sequence = a VMD sequence] +[1 if the VMD sequence is a VMD tuple, else 0] +[Tests a sequence as a VMD tuple. If the sequence is empty returns 1, otherwise returns the same as BOOST_VMD_IS_TUPLE] +[boost/vmd/tuple/is_vmd_tuple.hpp] +] +[ +[BOOST_VMD_TUPLE_POP_BACK] +[tuple = a Boost PP tuple] +[A VMD tuple] +[Pops an element from the end of a tuple. If the tuple's size is 1 returns an empty tuple, otherwise works exactly the same as BOOST_PP_TUPLE_POP_BACK] +[boost/vmd/tuple/pop_back.hpp] +] +[ +[BOOST_VMD_TUPLE_POP_FRONT] +[tuple = a Boost PP tuple] +[A VMD tuple] +[Pops an element from the beginning of a tuple. If the tuple's size is 1 returns an empty tuple, otherwise works exactly the same as BOOST_PP_TUPLE_POP_FRONT] +[boost/vmd/tuple/pop_front.hpp] +] +[ +[BOOST_VMD_TUPLE_PUSH_BACK] +[tuple = a VMD tuple, elem = element to push onto the end of the VMD tuple] +[A Boost PP tuple] +[Pushes an element onto the end of a VMD tuple. If the VMD tuple is empty the returned tuple consists of that element, otherwise works exactly the same as BOOST_PP_TUPLE_PUSH_BACK] +[boost/vmd/tuple/push_back.hpp] +] +[ +[BOOST_VMD_TUPLE_PUSH_FRONT] +[tuple = a VMD tuple, elem = element to push onto the beginning of the VMD tuple] +[A Boost PP tuple] +[Pushes an element onto the beginning of a VMD tuple. If the VMD tuple is empty the returned tuple consists of that element, otherwise works exactly the same as BOOST_PP_TUPLE_PUSH_FRONT] +[boost/vmd/tuple/push_front.hpp] +] +[ +[BOOST_VMD_TUPLE_REMOVE] +[tuple = a Boost PP tuple, i = index of element to remove] +[A VMD tuple] +[Removes an element from a Boost PP tuple. If the tuple has a single element and the index to be removed is 0 returns an empty tuple, otherwise works exactly the same as BOOST_PP_TUPLE_REMOVE] +[boost/vmd/tuple/remove.hpp] +] +[ +[BOOST_VMD_TUPLE_SIZE] +[tuple = a VMD tuple] +[The number of elements in the VMD tuple] +[Returns the number of elements in the VMD tuple. If the tuple is empty returns 0, otherwise works exactly the same as BOOST_PP_TUPLE_SIZE] +[boost/vmd/tuple/size.hpp] +] +[ +[BOOST_VMD_TUPLE_TO_ARRAY] +[tuple = a VMD tuple] +[A Boost PP array] +[Converts a VMD tuple to a Boost PP array. If the tuple is empty returns an empty array whose form is '(0,())', otherwise works exactly the same as BOOST_PP_TUPLE_TO_ARRAY] +[boost/vmd/tuple/to_array.hpp] +] +[ +[BOOST_VMD_TUPLE_TO_LIST] +[tuple = a VMD tuple] +[A Boost PP list] +[Converts a VMD tuple to a Boost PP list. If the tuple is empty returns an empty list whose form is 'BOOST_PP_NIL', otherwise works exactly the same as BOOST_PP_TUPLE_TO_LIST] +[boost/vmd/tuple/to_list.hpp] +] +[ +[BOOST_VMD_TUPLE_TO_SEQ] +[tuple = a VMD tuple] +[A VMD seq] +[Converts a VMD tuple to a VMD seq. If the tuple is empty returns an empty seq, otherwise works exactly the same as BOOST_PP_TUPLE_TO_SEQ] +[boost/vmd/tuple/to_seq.hpp] +] +] + +The difference between the tuple macros and their equivalent ones in Boost PP is +that working with a VMD tuple or returning a VMD tuple is valid with the tuple macros +but with the Boost PP equivalent macros working with an empty tuple causes UB and +returning an empty tuple can never occur. + +You can include the tuple macros either using their individual header files, +the general 'boost/vmd/tuple.hpp' header file for all tuple macros, or the +general header file 'boost/vmd/vmd.hpp' for all macros. + +[heading Seq and tuple functionality] + +The set of macros for seq and tuple functionality which work with VMD seqs and +VMD tuples are largely only a subset of the seq and tuple functionality in Boost PP. This reflects +the fact that a number of macros in Boost PP for working with a seq or tuple make no +sense when extended to work with a possible empty seq or empty tuple. For instance +BOOST_PP_SEQ_FIRST_N could not mean anything when passed an empty +seq and BOOST_PP_TUPLE_REM_CTOR could not mean anything when passed an empty tuple. +Likewise for other Boost PP seq and tuple macros which do not have a VMD equivalent. + +The set of functionality in VMD for working with a possibly empty seq or empty tuple makes +it possible to add or remove elements in a seq or tuple which could start out or +end up empty, take the seq or tuple size even when the seq or tuple is empty, +convert between arrays, lists, seqs, or tuples which could start out or end up +empty, and test for a VMD seq or a VMD tuple. This functionality should allow macro +programmers the ability to work with empty seqs and tuples while still using other +Boost PP seq and tuple functuionality to work with non-empty seqs and tuples. The +easiest way to do this is to use the VMD seq and VMD tuple equivalent functions +when choosing between VMD and Boost PP, and use the Boost PP seq and tuple +functionality otherwise. Just remember that Boost PP seq and tuple functionality +can never work with empty seqs or empty tuples. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_equality.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_equality.qbk new file mode 100644 index 0000000000000000000000000000000000000000..924754d567210f16e5dd75053d9714e206073f26 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_equality.qbk @@ -0,0 +1,197 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_assert Testing for equality and inequality] + +VMD allows the programmer to test generically for the equality or inequality +of any value which VMD can parse. This includes emptiness, identifiers, numbers, +types, arrays, lists, seqs, tuples, and multi-element sequences. + +The macro to test for equality is called BOOST_VMD_EQUAL and it has two required +parameters which are the two values against which to test. The values can be any +VMD data type. + +For the composite data types of array, list, seq, and tuple, or any of those types +in a multi-element sequence, the elements of those types must also be a data type +which VMD can parse. BOOST_VMD_EQUAL recursively parses the elements in a composite data type +for equality, up to a level of 16 inner types, to test that one composite type +equals another composite type. The requirement, that composite elements must also +be a data type which VMD can parse, is different from most other macros +in the VMD library, where only the top-level composite type need be parsed enough to +determine the type of the data. If BOOST_VMD_EQUAL encounters a data type which it +cannot parse the result will be UB. + +VMD identifiers used in equality testing must be registered and pre-detected. +All numbers and v-types are already registered/pre-detected for equality testing +so it is only user-defined identifiers which must be registered and pre-detected. +If an identifier has not been both registered and predetected it will never be +equal to the same identifier value, so it will always fail equality testing, +although it will not give a preprocessing error doing so. + +The BOOST_VMD_EQUAL macro returns 1 if both parameters are equal and 0 if the +parameters are not equal. + +Conversely to test for inequality, of the same values as are required in testing +for equality, the VMD library has the macro BOOST_VMD_NOT_EQUAL. This macro is simply +a complement of the BOOST_VMD_EQUAL macro. If BOOST_VMD_EQUAL returns 1 then +BOOST_VMD_NOT_EQUAL returns 0 and if BOOST_VMD_EQUAL returns 0 then +BOOST_VMD_NOT_EQUAL returns 1. + +The BOOST_VMD_EQUAL and BOOST_VMD_NOT_EQUAL macros are called "equality macros". + + #include + + #define BOOST_VMD_REGISTER_AN_ID1 (AN_ID1) + #define BOOST_VMD_REGISTER_AN_ID2 (AN_ID2) + + #define BOOST_VMD_DETECT_AN_ID1_AN_ID1 + #define BOOST_VMD_DETECT_AN_ID2_AN_ID2 + + #define AN_IDENTIFIER1 AN_ID1 + #define AN_IDENTIFIER2 AN_ID2 + #define AN_IDENTIFIER3 AN_ID1 // same as AN_IDENTIFIER1 = AN_ID1 + + #define A_NUMBER1 33 + #define A_NUMBER2 145 + #define A_NUMBER3 33 // same as A_NUMBER1 = 33 + + #define A_TUPLE1 (AN_IDENTIFIER1,A_NUMBER1) + #define A_TUPLE2 (AN_IDENTIFIER1,A_NUMBER2) + #define A_TUPLE3 (AN_IDENTIFIER3,A_NUMBER3) // same as A_TUPLE1 = (AN_ID1,33) + + #define A_SEQ1 (A_NUMBER1)(A_TUPLE1) + #define A_SEQ2 (A_NUMBER2)(A_TUPLE2) + #define A_SEQ3 (A_NUMBER3)(A_TUPLE3) // same as A_SEQ1 = (33)((AN_ID1,33)) + + BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER2) will return 0 + BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3) will return 1 + + BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER2) will return 0 + BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3) will return 1 + + BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2) will return 0 + BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3) will return 1 + + BOOST_VMD_EQUAL(A_SEQ1,A_SEQ2) will return 0 + BOOST_VMD_EQUAL(A_SEQ1,A_SEQ3) will return 1 + +When BOOST_VMD_EQUAL tests for equality it always parses data for their most +specific types. The reason for this is that a valid tuple, which is also an invalid +list or array, can never be compared completely because all elements of that tuple +are not data types which VMD can parse. Therefore VMD always tests equality based +on the most specific type for any value being tested, which speeds up testing for +the more specific tuple data types such as lists and arrays. + + #define TUPLE_IS_ARRAY1 (2,(3,4)) + #define TUPLE_IS_ARRAY2 (2,(4,5)) + #define TUPLE_IS_ARRAY3 (2,(3,4)) + + #define TUPLE_IS_LIST1 (55,BOOST_PP_NIL) + #define TUPLE_IS_LIST2 (135,BOOST_PP_NIL) + #define TUPLE_IS_LIST3 (55,BOOST_PP_NIL) + + #define TUPLE_IS_LIST_OR_ARRAY1 (2,(3,BOOST_PP_NIL)) + #define TUPLE_IS_LIST_OR_ARRAY2 (2,(4,BOOST_PP_NIL)) + #define TUPLE_IS_LIST_OR_ARRAY3 (2,(3,BOOST_PP_NIL)) + + #define TUPLE_BUT_INVALID_ARRAY1 (&2,(3,4)) + #define TUPLE_BUT_INVALID_ARRAY2 (&2,(4,4)) + #define TUPLE_BUT_INVALID_ARRAY3 (&2,(3,4)) + + #define TUPLE_BUT_INVALID_LIST1 (55,^BOOST_PP_NIL) + #define TUPLE_BUT_INVALID_LIST2 (135,^BOOST_PP_NIL) + #define TUPLE_BUT_INVALID_LIST3 (55,^BOOST_PP_NIL) + +All of the constructs above are valid tuples. + +The first three are valid arrays, so they will be parsed and compared +as arrays, so that they can be used as in: + + #include + + BOOST_VMD_EQUAL(TUPLE_IS_ARRAY1,TUPLE_IS_ARRAY2) will return 0 + BOOST_VMD_EQUAL(TUPLE_IS_ARRAY1,TUPLE_IS_ARRAY3) will return 1 + +The next three are valid lists, so they will be parsed and compared +as lists, so that they can be used as in: + + #include + + BOOST_VMD_EQUAL(TUPLE_IS_LIST1,TUPLE_IS_LIST2) will return 0 + BOOST_VMD_EQUAL(TUPLE_IS_LIST1,TUPLE_IS_LIST3) will return 1 + +The next three are valid lists or arrays but will be parsed as lists +because lists are more specific than arrays. They can be used as in: + + #include + + BOOST_VMD_EQUAL(TUPLE_IS_LIST_OR_ARRAY1,TUPLE_IS_LIST_OR_ARRAY2) will return 0 + BOOST_VMD_EQUAL(TUPLE_IS_LIST_OR_ARRAY1,TUPLE_IS_LIST_OR_ARRAY3) will return 1 + +The next three are valid tuples but invalid arrays. The BOOST_VMD_EQUAL +macro attempts to parse them as the most specific type they can be, which is an +array. But the attempt to parse them as arrays will lead to UB +because the number which signifies the size of the array is invalid as +a number. Now let us suppose we should parse them as the less specific type +of a tuple instead of as an array. This will still give UB +if we will attempt to compare the first tuple element against a corresponding +first tuple element of another tuple, and when we do will again encounter UB +because it is not a data type VMD can parse. + + #include + + BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_ARRAY1,TUPLE_BUT_INVALID_ARRAY1) will generate UB + BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_ARRAY1,TUPLE_BUT_INVALID_ARRAY1) will generate UB + +The next three are valid tuples but invalid lists. The BOOST_VMD_EQUAL +macro attempts to parse them as the most specific type they can be, which is +a list. But the attempt to parse them as lists will lead to UB +because the identifier which signifies the end-of-list is invalid as +an identifier. Now let us suppose we should parse them as the less specific type +of a tuple instead of as a list. This will still give UB +if we will attempt to compare the second tuple element against a corresponding +second tuple element of another tuple, and when we do will again encounter UB +because it is not a data type VMD can parse. + + #include + + BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_LIST1,TUPLE_BUT_INVALID_LIST2) will generate UB + BOOST_VMD_EQUAL(TUPLE_BUT_INVALID_LIST1,TUPLE_BUT_INVALID_LIST3) will generate UB + +It is possible that a composite data type which has an element which VMD cannot parse +will not give UB when compared for equality, but rather just the test for equality +will fail. This can occur if the algorithm which tests for equality tests false before parsing of +the particular element. Such a situation might be: + + #include + + #define A_TUPLE1 (3,4,"astring") + #define A_TUPLE2 (3,4) + + BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2) will return 0 rather than generate UB + +The reason the above correctly returns 0, rather than generate UB when +VMD attempts to parse '"astring"', which is not a data type VMD can parse, is because the +algorithm for testing equality tests whether or not the tuples have the same number of elements +before it tests for the equality of each element. This is just one example where testing for +equality may fail before UB is generated when BOOST_VMD_EQUAL attempts to +parse a data type which it cannot handle. Nevertheless the general rule should still be considered +that for BOOST_VMD_EQUAL/BOOT_VMD_NOT_EQUAL all data types, even an element of a composite data +type, must be a VMD data type if the macro is to work properly, else UB could occur. + +[heading Usage] + +You can use the general header file: + + #include + +or you can use the individual header files: + + #include for the BOOST_VMD_EQUAL macro + #include for the BOOST_VMD_NOT_EQUAL macro + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_examples.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_examples.qbk new file mode 100644 index 0000000000000000000000000000000000000000..5718a1669104a0fc0a907de39a974f975cf91c1d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_examples.qbk @@ -0,0 +1,361 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_examples Examples using VMD functionality] + +Examples of library use are always highly personal. Any given library +employing macro programming can decide what macro facilities are needed +based on the library itself and then decide if functionality in a macro +library like VMD makes macro programming in that library easier. To that end +the examples presented here are highly arbitrary and are just efforts to +illustrate possible use of functionality of VMD features without worrying +too much if those examples have any practical beneficial use in real +programming situations. In these examples I have endeavored, therefore, +to present macro programming "snippets" using VMD functionality rather than +complete solutions to a given practical problem. + +[heading Switch macro] + +[import ../test/test_doc_example_switch.hpp] +[import ../test/test_doc_example_switch.cxx] + +In C++ there is a 'switch' statement which we can emulate in macro programming +using VMD. For the macro emulation we will have as parameters to our macro: + +# A value, which can be any data type VMD can parse. +# A tuple of calling values. These will be used when calling the matching macro. +# Variadic parameters, each of which are tuples. +Each tuple consists of two elements, the name of +a value to match and the name of a macro to call. +For the 'default' case the tuple is a single element +which is the name of a macro to call. These are our +equivalents to the C++ switch 'case' statements. + +The macro looks like: + + BOOST_VMD_SWITCH(value,calling_values,...) + +We have to be careful not to parse the name of our macro to call +in any way since this is a failing condition for BOOST_VMD_IS_EMPTY +and subsequently for any parsing of input data we might want to do. +Instead we will just extract the calling macro name and just call +it, passing the calling values. + +Our processing is: + +# Convert our variadic parameters to a tuple since access to tuple +elements is easier. +# Use a BOOST_PP_WHILE loop to find the matching value and extract +the calling macro from it. We will use BOOST_VMD_EQUAL to find the +matching value. +# Call the calling macro with the calling values when we return from +our BOOST_PP_WHILE loop. + +Here is our code: + +[example_switch] + +The code is fairly involved but it is commented so that it can be +understood. There are a few workarounds for a VC++ preprocessor +problem, which I discovered, having to do with passing the name of a function-like +macro in a tuple. + +The BOOST_VMD_SWITCH macro can be used with either macros to call +or with fixed values to return. When specifying macros to call the +macro name is the second element of the corresponding value-macro +tuple, or in the 'default' case it is just the macro name itself. +When specifying fixed values to return the macro 'name' is +BOOST_VMD_SWITCH_IDENTITY(fixed_value), whether as the second +element of the corresponding value-macro tuple or as the macro +'name' of the 'default' case. In the variadic parameters the +user can mix macro names and fixed values as he likes. + +Some simple examples: + +[example_switch_defines] + +We will use these simple macros in our calls to BOOST_VMD_SWITCH. + +[example_switch_defines_t1] + +Here our macro will return 'test1_7'. + +Notice that 'cases' can be in any order. + +[example_switch_defines_t4] + +Here are macro uses the default case and returns 'test_default_7'. + +[example_switch_defines_t5] + +This shows how the matching case can be a fixed_value as the macro 'name'. + +[example_switch_defines_t6] + +This shows how the default value can be a fixed_value as the macro 'name'. + +[example_switch_defines_t7] + +This shows that the 'value' and each 'case' matching values can be different +data types just as long as the types are one which VMD can parse. + +There is more that can be done with the BOOST_VMD_SWITCH code but as it is +I believe it could be useful for programmers writing macro code. For instance +there is no checking that more than one 'case' value is the same. We could +generate a BOOST_VMD_ASSERT if that were the situation. There is no concept +of falling through to the next 'case' as their is when 'break' is not used +at the bottom of a particular C++ 'case' statement. Nonetheless the example +gives the macro programmer an idea of what can be done using the BOOST_VMD_EQUAL +macro in treating data types generically, using BOOST_VMD_IS_EMPTY to test for +emptiness and using BOOST_VMD_IDENTITY to generate a fixed value when a macro call +is made. + +[heading TTI inner template] + +As a more practical example, just to show the possible use of VMD functionality +in current Boost code, I will briefly illustrate a change that could be made to +the TTI library when using VMD functionality. + +The Boost TTI library, of which the current developer of VMD is also the developer, +specifies a way to introspect an inner class template of a class. The introspection +can occur for an inner class template of specific template parameters. + +In the library a macro is used to generate the metafunction which allows the introspection to work. +The macro used is called BOOST_TTI_TEMPLATE. The macro has both a variadic version and +a non-variadic version. + +In the non-variadic version the macro always takes two parameters for introspecting +for specific template parameters. The first parameter is the name of the template +and the second parameter is an array of the specific template parameters ( with or without +the parameter names themselves ). So for a class template of the form: + + template class MyTemplate { ... code }; + +the non-variadic macro would be: + + BOOST_TTI_TEMPLATE(MyTemplate,(2,(class,int))) // uses array + +I chose a Boost PP array rather than a Boost PP seq or a Boost PP list as I felt the notation +for specifying the template parameters was closer with the array than with the others. +Choosing a Boost PP tuple was not an option since for non-variadic macros there is no +way to automatically know the tuple size, so an array was preferred. + +For the variadic version variadic parameters are used so the notation would be: + + BOOST_TTI_TEMPLATE(MyTemplate,class,int) // uses variadic parameters + +since this is the most natural notation. + +But for compatibility with the non-variadic version the end-user +with variadic macro support could also choose the Boost PP array form above. + +Using VMD the variadic version could support any of the other Boost PP +composite types for the specific template parameters, even though I feel +that the variadic parameters form is easiest to use. In this scenario +a user could specify: + + BOOST_TTI_TEMPLATE(MyTemplate,(class,(int,BOOST_PP_NIL))) // use a list + +or + + BOOST_TTI_TEMPLATE(MyTemplate,(class)(int)) // use a seq + +or + + BOOST_TTI_TEMPLATE(MyTemplate,(class,int)) // use a tuple + +The only change needed would be in the code which takes the second parameter +and converts it to the final form used internally ( a Boost PP array ). +This occurs in the macro BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS in +the file. The code has two situations, one +for VC++8 or below and one for all other compilers. For our example we will concentrate +just on the one for all other compilers. You do not need to know what the code does +internally to complete the creation of the appropriate metafunction to follow this +example. The macro code in question looks like this: + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \ + BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \ + ( \ + ( BOOST_PP_ADD(BOOST_PP_ARRAY_SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ARRAY_ENUM(tpArray) ) ) \ + ) \ + /**/ + +In this code we are taking the name of the metafunction ( trait ), the name of the +template ( name ), and our specific template parameters ( tpArray ) and passing the +information in the form of a Boost PP array to another macro, which will eventually +create the metafunction which the end-user uses to test if such a class template +exists within some enclosing class. Even if tpArray were a list, seq, or tuple we +still want to pass the information internally to BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE +in the form you can see above, which is a Boost PP array. We don't need or want to +change that internal representation. + +The current code, used by both the non-variadic and variadic version of the +BOOST_TTI_TEMPLATE template, assumes the 'tpArray' parameter is a Boost PP array. +But if it could be a tuple, seq, or list in the variadic version the code could become, +with the appropriate Boost PP and VMD header files: + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #if BOOST_PP_VARIADICS + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \ + BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \ + ( \ + BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT \ + ( \ + trait,name,tpArray, \ + BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE(tpArray) \ + ) \ + ) \ + /**/ + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE(tpArray) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_ARRAY(tpArray), \ + BOOST_VMD_IDENTITY(ARRAY), \ + BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_LIST \ + ) \ + (tpArray) \ + ) \ + /**/ + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_LIST(tpArray) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_LIST(tpArray), \ + BOOST_VMD_IDENTITY(LIST), \ + BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_SEQ \ + ) \ + (tpArray) \ + ) \ + /**/ + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_SEQ(tpArray) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_SEQ(tpArray), \ + BOOST_VMD_IDENTITY(SEQ), \ + BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_TUPLE \ + ) \ + (tpArray) \ + ) \ + /**/ + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_TUPLE(tpArray) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(tpArray), \ + BOOST_VMD_IDENTITY(TUPLE) \ + ) \ + ) \ + /**/ + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT(trait,name,tpArray,name) \ + ( BOOST_PP_ADD(BOOST_PP_ ## name ## _SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ ## name ## _ENUM(tpArray) ) ) \ + /**/ + + #else + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \ + BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \ + ( \ + ( BOOST_PP_ADD(BOOST_PP_ARRAY_SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ARRAY_ENUM(tpArray) ) ) \ + ) \ + /**/ + + #endif + +This of course gets more elaborate, but could be shortened considerably if we chose to +use BOOST_VMD_GET_TYPE and the invented BOOST_VMD_SWITCH of our first example. We will +assume in this second version of the code above that our BOOST_VMD_SWITCH macro has +been #included from somewhere. + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #if BOOST_PP_VARIADICS + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \ + BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \ + ( \ + BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT \ + ( \ + trait,name,tpArray, \ + BOOST_VMD_SWITCH \ + ( \ + BOOST_VMD_GET_TYPE(tpArray), \ + (1), \ + (BOOST_VMD_TYPE_ARRAY,BOOST_VMD_SWITCH_IDENTITY(ARRAY)), \ + (BOOST_VMD_TYPE_LIST,BOOST_VMD_SWITCH_IDENTITY(LIST)), \ + (BOOST_VMD_TYPE_SEQ,BOOST_VMD_SWITCH_IDENTITY(SEQ)), \ + (BOOST_VMD_TYPE_TUPLE,BOOST_VMD_SWITCH_IDENTITY(TUPLE)) \ + ) \ + ) \ + ) \ + /**/ + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS_TYPE_CONCAT(trait,name,tpArray,name) \ + ( BOOST_PP_ADD(BOOST_PP_ ## name ## _SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ ## name ## _ENUM(tpArray) ) ) \ + /**/ + + #else + + #define BOOST_TTI_DETAIL_TRAIT_CALL_HAS_TEMPLATE_CHECK_PARAMS(trait,name,tpArray) \ + BOOST_TTI_DETAIL_HAS_MEMBER_WITH_TEMPLATE_SFINAE \ + ( \ + ( BOOST_PP_ADD(BOOST_PP_ARRAY_SIZE(tpArray),4), ( trait, name, 1, false, BOOST_PP_ARRAY_ENUM(tpArray) ) ) \ + ) \ + /**/ + + #endif + +This is shorter and easier to understand. The '(1)' passed as the calling +values to BOOST_VMD_SWITCH could just as well be '()' but VC8 has trouble +with empty parentheses so I avoid it here. + +In the case of the TTI, is such a change worth it to give more flexibility +to the end-user ? In reality, because the variadic version of passing the +specific template parameters as variadic data is syntactically easier to use than +any of the Boost PP composite forms, I am actually happy enough with that use +not to pursue the sort of functionality I presented in this example. But the +example nonetheless shows the power of the VMD functionality for creating +macros which add flexibility when the macro programmer feels he needs it +for his library. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_generic.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_generic.qbk new file mode 100644 index 0000000000000000000000000000000000000000..20ffa9586415e5e4168e32c44f071d3bcfdff139 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_generic.qbk @@ -0,0 +1,17 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_generic Generic macros for working with data types] + +Besides the specific macros for working with data types +VMD has a number of generic macros for parsing sequences. + +[include vmd_sequence.qbk] +[include vmd_get_type.qbk] +[include vmd_equality.qbk] + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_get_type.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_get_type.qbk new file mode 100644 index 0000000000000000000000000000000000000000..dda8ff024ee4e1e10473e143b2c50c5e45905fe7 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_get_type.qbk @@ -0,0 +1,61 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_convert_sequence Getting the type of data] + +VMD has the ability to retrieve the type of any data which it can +parse, which means any VMD sequence. The macro to do this is called +BOOST_VMD_GET_TYPE and it takes a single required parameter, which +is a VMD sequence. + +It returns one of the types previously discussed when introducing +v-types as an identifier subset. As explained previously in that +topic a v-type is fully recognized by VMD macros and can be part +of a sequence and passed as VMD data just like all the other data types +VMD recognizes. + +When BOOST_VMD_GET_TYPE returns the type of data it returns by default +the most specific type that the data can be. This means that non-empty +lists and arrays are returned as such, not as tuples, and numbers +and types and empty lists are returned as such, not as identifiers. + + #include + + #define BOOST_VMD_REGISTER_ANID (ANID) + #define SEQUENCE_EMPTY + #define SEQUENCE_MULTI (1,2,3) 88 + #define SEQUENCE1 (3,(1,2,3)) + #define SEQUENCE2 ANID + #define SEQUENCE3 (1,(2,(3,BOOST_PP_NIL))) + #define SEQUENCE4 1 + #define SEQUENCE5 (1)(2)(3) + #define SEQUENCE6 (1,2,3) + #define SEQUENCE7 BOOST_VMD_TYPE_NUMBER + + BOOST_VMD_GET_TYPE(SEQUENCE_EMPTY) will return BOOST_VMD_TYPE_EMPTY + BOOST_VMD_GET_TYPE(SEQUENCE_MULTI) will return BOOST_VMD_TYPE_SEQUENCE + BOOST_VMD_GET_TYPE(SEQUENCE1) will return BOOST_VMD_TYPE_ARRAY + BOOST_VMD_GET_TYPE(SEQUENCE2) will return BOOST_VMD_TYPE_IDENTIFIER + BOOST_VMD_GET_TYPE(SEQUENCE3) will return BOOST_VMD_TYPE_LIST + BOOST_VMD_GET_TYPE(SEQUENCE4) will return BOOST_VMD_TYPE_NUMBER + BOOST_VMD_GET_TYPE(SEQUENCE5) will return BOOST_VMD_TYPE_SEQ + BOOST_VMD_GET_TYPE(SEQUENCE6) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(SEQUENCE7) will return BOOST_VMD_TYPE_TYPE + +[heading Usage] + +You can use the general header file: + + #include + +or you can use the individual header file: + + #include + +for the BOOST_VMD_GET_TYPE macro. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_history.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_history.qbk new file mode 100644 index 0000000000000000000000000000000000000000..4dc04042971c4f2136103fc938a1470a10e96739 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_history.qbk @@ -0,0 +1,108 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_history History] + +[heading Version 1.9, Boost 1.60] +* Added support for "empty" seqs and tuples + +[heading Version 1.8] + +* After a review of VMD I have greatly simplified the main interfaces and added +optional functionality in the form of modifiers. The main changes are the addition +of the many generic macros for sequences and the expansions of types to include the +v-type. + * Added BOOST_VMD_ELEM macro. + * Added BOOST_VMD_EQUAL macro. + * Added BOOST_VMD_NOT_EQUAL macro. + * Added BOOST_VMD_IS_MULTI macro. + * Added BOOST_VMD_IS_TYPE macro. + * Added BOOST_VMD_ASSERT_IS_TYPE macro. + * Added BOOST_VMD_IS_UNARY macro. + * Added BOOST_VMD_SIZE macro. + * Replaced with the BOOST_VMD_ELEM macro, using modifiers, a number of macros which were eliminated. These are: + * BOOST_VMD_IDENTIFER + * BOOST_VMD_BEGIN_IDENTIFIER + * BOOST_VMD_AFTER_IDENTIFIER + * BOOST_VMD_IS_BEGIN_IDENTIFIER + * BOOST_VMD_NUMBER + * BOOST_VMD_BEGIN_NUMBER + * BOOST_VMD_AFTER_NUMBER + * BOOST_VMD_IS_BEGIN_NUMBER + * BOOST_VMD_ARRAY + * BOOST_VMD_BEGIN_ARRAY + * BOOST_VMD_AFTER_ARRAY + * BOOST_VMD_IS_BEGIN_ARRAY + * BOOST_VMD_LIST + * BOOST_VMD_BEGIN_LIST + * BOOST_VMD_AFTER_LIST + * BOOST_VMD_IS_BEGIN_LIST + * BOOST_VMD_SEQ + * BOOST_VMD_BEGIN_SEQ + * BOOST_VMD_AFTER_SEQ + * BOOST_VMD_IS_BEGIN_SEQ + * BOOST_VMD_TUPLE + * BOOST_VMD_BEGIN_TUPLE + * BOOST_VMD_AFTER_TUPLE + * BOOST_VMD_IS_BEGIN_TUPLE + * Every macro has its own header file. + +[heading Version 1.7] + +* The library has been reengineered to provide vastly added functionality. This includes: + * Adding functionality for parsing v-types. + * Adding functionality for parsing sequences of v-types. + * Adding improved ASSERT macros. + * Adding BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY. + +[heading Version 1.6] + +* Stripped off all functionality duplicated by the variadic macro functionality added to Boost PP. +* Removed the notion of 'native' and 'pplib' modes. +* Use the BOOST_PP_VARIADICS macro from the Boost PP library to determine variadic macro availability + and removed the native macro for determining this from this library. +* Updated documentation, especially to give fuller information of the use of the BOOST_VMD_EMPTY + macro and its flaw and use with Visual C++. +* Changed the directory structure to adhere to the Modular Boost structure. + +[heading Version 1.5] + +* Added macros for verifying Boost PP data types. +* Added macros for detecting and removing beginning parens. +* Added a macro for testing for the emptiness of a parameter. +* Added support for individual header files. +* Added support for 'native' and 'pplib' modes. +* Added control macros for controlling the variadic macro availability, mode, and data verification. + +[heading Version 1.4] + +* Removed internal dependency on BOOST_PP_CAT and BOOST_PP_ADD when using VC++. + +[heading Version 1.3] + +* Moved version information and history into the documentation. +* Separate files for build.txt in the doc sub-directory and readme.txt in the top-level directory. +* Breaking changes + * The name of the main header file is shortened to 'vmd.hpp'. + * The library follows the Boost conventions. + * Changed the filenames to lower case and underscores. + * The macros now start with BOOST\_VMD\_ rather than just VMD\_ as previously. + +[heading Version 1.2] + +* Added a readme.txt file. +* Updated all jamfiles so that the library may be tested and docs generated from its own local directory. + +[heading Version 1.1] + +* Added better documentation for using variadic data with Boost PP and VMD. + +[heading Version 1.0] + +Initial version of the library. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_identifier.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_identifier.qbk new file mode 100644 index 0000000000000000000000000000000000000000..3a55ad4c198df39fee2e11212c7c425c5be40cec --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_identifier.qbk @@ -0,0 +1,175 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_identifier Identifiers] + +An identifier in VMD is either of two lower-level preprocessor possibilities: + +* a preprocessing token 'identifier', which is essentially a sequence +of alphanumeric characters and the underscore +character with the first character not being a numeric character. +* a preprocessing token 'pp-number' that is an integral literal token. + +Here are some examples: + + SOME_NAME + _SOME_NAME + SOME_123_NAME + some_123_name + sOMe_123_NAmE + 2367 + 43e11 + 0 + 22 + 654792 + 0x1256 + +[heading Problem testing any identifier] + +One of the difficulties with identifiers in preprocessor metaprogramming +is safely testing for a particular one. VMD has a means of doing this within +a particular constraint for the characters that serve as the input. + +The constraint is that the beginning input character, ignoring any whitespace, passed +as the input to test must be either: + +* an identifier character, ie. an alphanumeric or an underscore +* the left parenthesis of a tuple + +and if the first character is not the left parenthesis of a tuple +the remaining characters must be alphanumeric or an underscore until a space character +or end of input occurs. + +If this is not the case the behavior is undefined, and most likely +a preprocessing error will occur. + +Given the input: + + 's_anything' : can be tested + 'S_anything' : can be tested + 's_anYthiNg' : can be tested + '_anything' : can be tested + '_Anything' : can be tested + '_anytHIng' : can be tested + '24' : can be tested + '245e2' : can be tested + '(anything)' : can be tested, tuple + '(anything) anything' : can be tested, tuple and further input + 'anything anything' : can be tested, identifier followed by space character + + '%_anything' : undefined behavior and most likely a preprocessing error due to the constraint + '(_anything' : undefined behavior and most likely a preprocessing error due to the constraint, since a single '(' does not form a tuple + '44.3' : undefined behavior and most likely a preprocessing error due to the constraint since '.' is not alphanumeric + +[heading Identifying an identifier] + +In VMD the only way an identifier can be identified in preprocessor input is by a process called +registration. In order to 'register' an identifier to be recognized by VMD the end-user must create, +for every identifier to be recognized, an object-like macro whose form is: + + #define BOOST_VMD_REGISTER_identifier (identifier) + +where 'identifier' is a particular identifier we wish to identify. This is called in +VMD a registration macro. + +It is recommended that such registration macros be created in a header file which +can be included before the end-user uses the identifier macros of VMD. + +If a particular registration macro occurs more than once it is +not a preprocessing error, so duplicating a registration macro will not lead to any problems +since each registration macro of the same name will have the exact same object-like macro +expansion. + +Within a given translation unit it could potentially happen +that registration macros have been included by header files which a particular end-user +of VMD has not created. This should also not lead to particular problems since registration +is a process for adding identifiers for any particular translation unit. As we shall see +VMD has macros for not only finding any identifier in preprocessor input but for also finding +any particular identifier in preprocessor input. + +[heading Testing for an identifier macro] + +The specific macro used to test for an identifier in VMD is called BOOST_VMD_IS_IDENTIFIER. +The macro takes one required parameter which is the input against which to test. + +When we invoke BOOST_VMD_IS_IDENTIFIER it returns 1 if the input represents any +registered identifier, otherwise it returns 0. + +As an example: + + #include + + #define BOOST_VMD_REGISTER_yellow (yellow) + #define BOOST_VMD_REGISTER_green (green) + #define BOOST_VMD_REGISTER_blue (blue) + + BOOST_VMD_IS_IDENTIFIER(some_input) // returns 1 if 'some_input' is 'yellow','green', or 'blue' + BOOST_VMD_IS_IDENTIFIER(some_input) // returns 0 if 'some_input' is 'purple' + +Essentially only registered identifiers can be found in VMD as identifiers. + +[heading Detecting a particular identifier] + +Although registering an identifier allows VMD to recognize the string of characters +as a VMD identifier, the ability to detect a particular identifier needs the end-user +to define another macro: + + #define BOOST_VMD_DETECT_identifier_identifier + +where 'identifier' is a particular identifier we wish to detect. This object-like +macro expands to no output. + +Like the registration macro multiple detection macros of the same identifier +in a translation unit does not cause a compiler problem since the exact same +object-like macro occurs. + +The term for creating this macro is that we have potentially 'pre-detected' +the identifier and I will use the term pre-detected as the process of creating +the BOOST_VMD_DETECT macro. + +The ability to detect that a VMD identifier is a particular identifier is used +in VMD macros when data is compared for equality/inequality as well as when we +want to match an identifier against a set of other identifiers. These situations +will be explained later in the documentation when the particular macro functionality +is discussed. If the programmer never uses the functionality which these situations +encompass there is no need to use pre-detection for a registered identifier. + +[heading Parsing identifiers and undefined behavior] + +The technique for parsing identifiers, once it is determined that the input +being parsed does not begin with a set of parentheses, uses preprocessor +concatenation in its parsing. This technique involves the preprocessor '##' +operator to concatenate input, and examine the results of that concatenation. + +When preprocessor concatenation is used the result of the concatenation must +be a valid preprocessing token, else the behavior of the preprocessor is undefined. +In C++ 'undefined behavior' in general means that anything can happen. In practical +use when preprocessor concatenation does not produce a valid preprocessing token, +a compiler is most likely to generate a preprocessing error. If the compiler chooses +not to issue a preprocessing error the outcome will always mean that parsing an +identifier will fail. But because the outcome is undefined behavior there is no +absolute way that the programmer can determine what the outcome will be when +preprocessor concatenation is used and the input being parsed contains +preprocessor input which does not meet the constraints for parsing an identifier +mentioned at the beginning of this topic. + +In this documentation I will be using the abbreviation 'UB' as the shortened form +of 'undefined behavior' to denote the particular occurrence where VMD attempts to +parse preprocessor input using preprocessor concatenation and undefined behavior +will occur. + +[heading Usage] + +To use the BOOST_VMD_IS_IDENTIFIER macro either include the general header: + + #include + +or include the specific header: + + #include + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_identifier_subtyping.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_identifier_subtyping.qbk new file mode 100644 index 0000000000000000000000000000000000000000..9505400784b6626fd5c6b1fb4bdc172dcac96f54 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_identifier_subtyping.qbk @@ -0,0 +1,206 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_identifier_subtype Identifier subtypes] + +Identifiers are the low-level data types which macro programmers +use to pass preprocessing data most often. As we have seen VMD +has a system for registering and detecting identifiers so that +they can be parsed as part of preprocessor data. This system also +includes comparing identifiers for equality or inequality using +BOOST_VMD_EQUAL/BOOST_VMD_NOT_EQUAL and matching identifiers +using identifier modifiers in BOOST_VMD_IS_IDENTIFIER and +BOOST_VMD_ELEM. Together these facilities provide a rich set +of functionality for handling identifiers in macros. + +Both numbers and v-types are subtypes of identifiers, and can +both be individually recognized as data types of their own or +worked with as identifiers using the identifier facilities +already mentioned. Numbers, in particular, also have a rich set +of functionality within the Boost PP library. As subtypes numbers +and v-types can be used as filter modifiers and can be returned +as specific types either when invoking BOOST_VMD_GET_TYPE +or when using return type modifiers. Furthermore VMD recognizes +their individual v-types, BOOST_VMD_TYPE_NUMBER and +BOOST_VMD_TYPE_TYPE, as VMD data when parsing sequences. + +It is possible for the end-user to define his own identifier subtype. +This is called a "user-defined subtype". Once a user-define subtype is +created all the generic type facilities of VMD which subtypes such as +a number or a v-type possess is automatically available for that +user-defined subtype. + +[heading Defining a subtype] + +In order to define a user-defined subtype a number of steps need to be followed. +These steps will be explained in detail further below: + +# Register and pre-detect all identifiers of that subtype. +# Register and pre-detect a v-type name for that subtype. +# Subset register all identifiers of the subtype. +# Subset register the v-type name for the subtype. + +When we do the above, it is best to put all the macros in a single +header file and always include that header file when we work generically +with our user-defined subtype. + +[heading Register and pre-detect all identifiers of that subtype] + +Registering and pre-detecting all of the identifiers of that subtype +is exactly the same as registering and pre-detecting any identifier. + +Let's create some identifiers based for use in the mythical "udef" library. +We will put all our macros in the header file udef_vmd_macros.hpp. + +We will need distinct names for the identifiers in our library, so we will +append UDEF_ to our identifier names to make them unique. Our udef library +deals in geometrical shapes so we will create a user-defined subtype which +consists of identifiers for the various shapes our udef library can +manipulate in their macros. So our identifier registrations and pre-detections +placed in our header file will be: + + #define BOOST_VMD_REGISTER_UDEF_CIRCLE (UDEF_CIRCLE) + #define BOOST_VMD_REGISTER_UDEF_SQUARE (UDEF_SQUARE) + #define BOOST_VMD_REGISTER_UDEF_TRIANGLE (UDEF_TRIANGLE) + #define BOOST_VMD_REGISTER_UDEF_HEXAGON (UDEF_HEXAGON) + + #define BOOST_VMD_DETECT_UDEF_CIRCLE_UDEF_CIRCLE + #define BOOST_VMD_DETECT_UDEF_SQUARE_UDEF_SQUARE + #define BOOST_VMD_DETECT_UDEF_TRIANGLE_UDEF_TRIANGLE + #define BOOST_VMD_DETECT_UDEF_HEXAGON_UDEF_HEXAGON + +[heading Register and pre-detect a v-type name for that subtype] + +We need to create a unique v-type name for our user-defined subtype. +The name does not have to begin with BOOST_VMD_TYPE_ but it should be +unique. Since BOOST_VMD_TYPE_ is the common beginning of all v-types +we will use it for consistency but will append to it UDEF_SHAPES to +give it a uniqueness which should not be duplicated: + + #define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_UDEF_SHAPES (BOOST_VMD_TYPE_UDEF_SHAPES) + + #define BOOST_VMD_DETECT_BOOST_VMD_TYPE_UDEF_SHAPES_BOOST_VMD_TYPE_UDEF_SHAPES + +[heading Subtype register all identifiers of the subtype] + +The macro to register an identifier subset starts with BOOST_VMD_SUBTYPE_REGISTER_ +and you append to it each identifier in the subset. This is very much like the +way you use the BOOST_VMD_REGISTER_ macro. The difference is that unlike the +BOOST_VMD_REGISTER_ macro, which expands to a tuple whose single element is the +identifier, the BOOST_VMD_SUBTYPE_REGISTER_ expands to a tuple of two elements +where the first element is the subtype v-type and the second element is the identifier. + +For our udef user-defined subtype this would be: + + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_CIRCLE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_CIRCLE) + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_SQUARE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_SQUARE) + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_TRIANGLE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_TRIANGLE) + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_HEXAGON (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_HEXAGON) + +[heading Subtype register the v-type name for the subtype] + +Doing a subset register of the actual udef v-type is fairly easy once we understand +how to register an identifier subset. The only particular thing to realize is +that the type of any v-type is the v-type BOOST_VMD_TYPE_TYPE. So our subset +register of our new v-type BOOST_VMD_TYPE_UDEF_SHAPES is: + + #define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_UDEF_SHAPES (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_UDEF_SHAPES) + +[heading Using our identifier subset] + +Once we have added all of the above object-like macros for defining our user-defined +subtype to the udef_vmd_macros.hpp header file we have a new data type which we can +use generically just like we can use numbers or v-types generically. It is important +to include the header udef_vmd_macros.hpp in some translation unit whenever we need +the VMD functionality for our new data type. So in our examples we will assume that +an '#include udef_vmd_macros.hpp' precedes each example. + + #include + + #define A_SEQUENCE UDEF_SQUARE + #define A_SEQUENCE2 217 + #define A_SEQUENCE3 BOOST_VMD_TYPE_UDEF_SHAPES + #define A_SEQUENCE4 BOOST_VMD_TYPE_NUMBER + + BOOST_VMD_GET_TYPE(A_SEQUENCE) will return 'BOOST_VMD_TYPE_UDEF_SHAPES' + BOOST_VMD_GET_TYPE(A_SEQUENCE2) will return 'BOOST_VMD_TYPE_NUMBER' + BOOST_VMD_GET_TYPE(A_SEQUENCE3) will return 'BOOST_VMD_TYPE_TYPE' + BOOST_VMD_GET_TYPE(A_SEQUENCE4) will return 'BOOST_VMD_TYPE_TYPE' + +Here we see that when we use our BOOST_VMD_GET_TYPE macro on a single-element +sequence which is one of our user-defined subtype values we correctly get back +our user-defined subtype's v-type, just like we do when we ask for the type of a number. Also +when we use our BOOST_VMD_GET_TYPE macro on our user-defined subtype's v-type itself we correctly +get back the type of all v-types, which is BOOST_VMD_TYPE_TYPE, just like we do +when we ask for the type of the v-type of a number. + + #include + + #define A_SEQUENCE5 (1,2) UDEF_TRIANGLE + + BOOST_VMD_ELEM(1,A_SEQUENCE5,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_TRIANGLE)' + BOOST_VMD_ELEM(0,A_SEQUENCE5,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_TUPLE,(1,2))' + +Here we see that we can use the return type modifier to get back both the type +and the value in a two-element tuple for our user-defined subtype just as we so +for any other type. + + #include + + #define A_SEQUENCE6 UDEF_CIRCLE + #define A_SEQUENCE7 168 + + BOOST_VMD_EQUAL(A_SEQUENCE6,UDEF_CIRCLE,BOOST_VMD_TYPE_UDEF_SHAPES) will return '1' + BOOST_VMD_EQUAL(A_SEQUENCE6,UDEF_CIRCLE,BOOST_VMD_TYPE_LIST) will return '0' + BOOST_VMD_EQUAL(A_SEQUENCE7,168,BOOST_VMD_TYPE_NUMBER) will return '1' + BOOST_VMD_EQUAL(A_SEQUENCE7,168,BOOST_VMD_TYPE_SEQ) will return '0' + +Here we can see that we can use the filter modifier with our user-defined subtype's v-type +just as we can do with any other v-type, such as the number v-type. + +In all respects once we define our subtype and provide those definitions in +a header file, our user-defined subtype acts like any other v-type in our system. +Since VMD functionality is largely based on being able to recognize the type of +data in macro input being able to define another 'type', as an identifier subtype, +which VMD understands has value for the macro programmer. + +[heading Uniqueness of identifier subtype values and v-type] + +When we define a new identifier subtype we need to be careful that +the values of that subtype and its actual v-type are unique identifiers +within any translation unit. This is the main difference between just +defining identifiers and defining an identifier subtype. + +Recall that when we just register and pre-detect identifiers we will have +no problems if the same identifiers already have been registered and pre-detected +within the same translation unit. This is because we are just redefining the +exact same macro if this is the case. + +But with identifier subtypes, when we use the BOOST_VMD_SUBTYPE_REGISTER_ macro +to associate our subtype's v-type with our subtype identifiers, we will have +problems if someone else has also defined an identifier subtype using the same +identifiers as we use since we will be redefining the same object-like macro name +with a different expansion. Even if someone else has registered/pre-detected an +identifier we are using for out subtype without defining a subtype based on that +identifier we will be causing a problem defining our subtype because VMD macros which +generically return the type of a sequence or sequence element will return our +subtype as the type rather than just BOOST_VMD_TYPE_IDENTIFIER which some programmer +might expect. + +The gist of this is that if we define a user-defined subtype its identifiers need +to be unique within a given translation unit, and yet unique names make it harder +for an end-user to use macros more naturally. In our given example with the mythical +udef library we used identifiers such as 'UDEF_CIRCLE' etc. instead of the more natural +sounding CIRCLE. So with user-defined identifier subtypes we have a tradeoff; we need +unique identifier names both for our subtype identifiers and the v-type for our +subtype identifiers so as not to conflict with others who might be using identifier +subtypes, but those unique names might make using macros less "natural" On the other +hand, just registering/pre-detecting identifiers has no such problem. This is an +issue of which any user, looking to create his own data type using VMD by defining +user-defined subtypes, should be aware. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_identifying.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_identifying.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c8f55fb46d7c252b0e9ec0d7d1d83c39e589cabd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_identifying.qbk @@ -0,0 +1,76 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_identifying Identifying data types] + +[heading Identifying macros and BOOST_VMD_IS_EMPTY ] + +The various macros for identifying VMD data types complement +the ability to identify emptiness using BOOST_VMD_IS_EMPTY. +The general name I will use in this documentation for these +specific macros is "identifying macros." The identifying macros +also share with BOOST_VMD_IS_EMPTY the inherent flaw +mentioned when discussing BOOST_VMD_IS_EMPTY, since they themselves +use BOOST_VMD_IS_EMPTY to determine that the input has ended. + +To recapitulate the flaw with BOOST_VMD_IS_EMPTY: + +* using a standard C++ compiler if the input ends with the +name of a function-like macro, and that macro takes two or +more parameters, a preprocessing error will occur. +* using the VC++ compiler if the input consists of the name +of a function-like macro, and that macro when invoked with no +parameters returns a tuple, the macro erroneously returns 1, +meaning that the input is empty. +* even if the function-like macro takes one parameter, passing +emptiness to that macro could cause a preprocessing error. + +The obvious way to avoid the BOOST_VMD_IS_EMPTY problem with the +identifying macros is to design input so that the name of a function-like +macro is never passed as a parameter. This can be done, if one uses +VMD and has situations where the input could contain +a function-like macro name, by having that function-like macro name placed +within a Boost PP data type, such as a tuple, without attempting to identify +the type of the tuple element using VMD. In other word if the input is: + + ( SOME_FUNCTION_MACRO_NAME ) + +and we have the macro definition: + + #define SOME_FUNCTION_MACRO_NAME(x,y) some_output + +VMD can still parse the input as a tuple, if desired, using BOOST_VMD_IS_TUPLE +without encountering the BOOST_VMD_IS_EMPTY problem. However if the input is: + + SOME_FUNCTION_MACRO_NAME + +either directly or through accessing the above tuple's first element, and the +programmer attempts to use BOOST_VMD_IS_IDENTIFIER with this input, the +BOOST_VMD_IS_EMPTY problem will occur. + +[heading Identifying macros and programming flexibility ] + +The VMD identifying macros give the preprocessor metaprogrammer a great amount +of flexibility when designing macros. It is not merely the flexibility of allowing +direct parameters to a macro to be different data types, and having the macro work +differently depending on the type of data passed to it, but it is also the flexibility +of allowing individual elements of the higher level Boost PP data types to be +different data types and have the macro work correctly depending on the type of data +type passed as part of those elements. + +With this flexibility also comes a greater amount of responsibility. For the macro +designer this responsibility is twofold: + +* To carefully document the possible combinations of acceptable data and what they mean. +* To balance flexibility with ease of use so that the macro does not become so hard to +understand that the programmer invoking the macro gives up using it entirely. + +For the programmer invoking a macro the responsibility is to understand the documentation +and not attempt to pass to the macro data which may cause incorrect results or preprocessing +errors. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_identity.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_identity.qbk new file mode 100644 index 0000000000000000000000000000000000000000..684a30d0468ca9022eb1392aec3429443b087818 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_identity.qbk @@ -0,0 +1,240 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_identity Generating emptiness and identity] + +[heading Using BOOST_PP_EMPTY and BOOST_PP_IDENTITY] + +Boost PP Has a macro called BOOST_PP_EMPTY() which expands to nothing. + +Ordinarily this would not seem that useful, but the macro can be used +in situations where one wants to return a specific value even though +a further macro call syntax is required taking no parameters. +This sort of usefulness occurs in Boost PP when there are two paths to take depending +on the outcome of a BOOST_PP_IF or BOOST_PP_IIF logic. Here is an artificial example: + + #include + #include + + #define MACRO_CHOICE(parameter) \ + BOOST_PP_IIF(parameter) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + SOME_FIXED_VALUE BOOST_PP_EMPTY \ + ) \ + () + + #define MACRO_CALL_IF_PARAMETER_1() some_processing + +In the general logic above is: if parameter is 1 another +macro is invoked, whereas if the parameter is 0 some +fixed value is returned. The reason that this is useful +is that one may not want to code the MACRO_CHOICE macro +in this way: + + #include + + #define MACRO_CHOICE(parameter) \ + BOOST_PP_IIF(parameter) \ + ( \ + MACRO_CALL_IF_PARAMETER_1(), \ + SOME_FIXED_VALUE \ + ) + + #define MACRO_CALL_IF_PARAMETER_1() some_processing + +because it is inefficient. The invocation of MACRO_CALL_IF_PARAMETER_1 will still +be generated even when 'parameter' is 0. + +This idiom of returning a fixed value through the use of BOOST_PP_EMPTY +is so useful that Boost PP has an accompanying macro to BOOST_PP_EMPTY to +work with it. This accompanying macro is BOOST_PP_IDENTITY(value)(). +Essentially BOOST_PP_IDENTITY returns its value when it is invoked. +Again, like BOOST_PP_EMPTY, the final invocation must be done with no value. + +Our example from above, which originally used BOOST_PP_EMPTY to return +a fixed value, is now: + + #include + #include + + #define MACRO_CHOICE(parameter) \ + BOOST_PP_IIF(parameter) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + BOOST_PP_IDENTITY(SOME_FIXED_VALUE) \ + ) \ + () + + #define MACRO_CALL_IF_PARAMETER_1() some_processing + +The macro BOOST_PP_IDENTITY is actually just: + + #define BOOST_PP_IDENTITY(value) value BOOST_PP_EMPTY + +so you can see how it is essentially a shorthand for the common +case originally shown at the top of returning a value through the +use of BOOST_PP_EMPTY. + +[heading Using BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY] + +The one problem when using BOOST_PP_EMPTY and BOOST_PP_IDENTITY +is that the final invocation must be with no parameters. This is +very limiting. If the final invocation must be with one or more parameters +you cannot use BOOST_PP_EMPTY or BOOST_PP_IDENTITY. In other words, +making a change to either of our two examples: + + #include + #include + + #define MACRO_CHOICE(parameter1,parameter2) \ + BOOST_PP_IIF(parameter1) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + SOME_FIXED_VALUE BOOST_PP_EMPTY \ + ) \ + (parameter2) + + #define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_a_parameter + +or + + #include + #include + + #define MACRO_CHOICE(parameter1,parameter2) \ + BOOST_PP_IIF(parameter1) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + BOOST_PP_IDENTITY(SOME_FIXED_VALUE) \ + ) \ + (parameter2) + + #define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_a_parameter + +will produce a preprocessing error since the final invocation to either +BOOST_PP_EMPTY or BOOST_PP_IDENTITY can not be done with 1 or more parameters. + +It would be much more useful if the final invocation could be done with +any number of parameters. This is where using variadic macros solves the problem. +The BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY macros have the exact same +functionality as their Boost PP counterparts but the final invocation can +be made with any number of parameters, and those parameters are just ignored +when BOOST_VMD_EMPTY or BOOST_VMD_IDENTITY is the choice. + +Now for our two examples we can have: + + #include + #include + + #define MACRO_CHOICE(parameter1,parameter2) \ + BOOST_PP_IIF(parameter1) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + SOME_FIXED_VALUE BOOST_VMD_EMPTY \ + ) \ + (parameter2) + + #define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_parameters + +or + + #include + #include + + #define MACRO_CHOICE(parameter1,parameter2) \ + BOOST_PP_IIF(parameter1) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + BOOST_VMD_IDENTITY(SOME_FIXED_VALUE) \ + ) \ + (parameter2) + + #define MACRO_CALL_IF_PARAMETER_1(parameter2) some_processing_using_parameters + +and our macros will compile without preprocessing errors and work as expected. +Both BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY will take any number of parameters +in their invocation, which makes them useful for a final invocation no matter +what is being passed. + +[heading Usage for BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY] + +To use the BOOST_VMD_EMPTY macro either include the general header: + + #include + +or include the specific header: + + #include + +To use the BOOST_VMD_IDENTITY macro either include the general header: + + #include + +or include the specific header: + + #include + +[heading Using BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY with VC++] + +Unfortunately the Visual C++ preprocessor has a problem when a macro +expands to something followed by a variadic macro which expands to nothing. +This is the case when using BOOST_VMD_EMPTY following some non-empty expansion, +or the equivalent use of BOOST_VMD_IDENTITY. As strange as it sounds this VC++ +preprocessor problem is normally solved by concatenating the result using BOOST_PP_CAT +with an empty value. But then again the many non-standard behaviors of VC++ +are difficult to understand or even track. + +In order to make this technique transparent when used with a C++ standard +conforming preprocessor or VC++ non-standard preprocessor you can use the +BOOST_VMD_IDENTITY_RESULT macro passing to it a single parameter which is a result +returned from a macro which uses BOOST_VMD_IDENTITY ( or its equivalent +'value BOOST_VMD_EMPTY' usage ). + +Given our MACRO_CHOICE example above, if you have another macro invoking MACRO_CHOICE +simply enclose that invocation within BOOST_VMD_IDENTITY_RESULT. As in the very simple: + + #include + + #define CALLING_MACRO_CHOICE(parameter1,parameter2) \ + BOOST_VMD_IDENTITY_RESULT(MACRO_CHOICE(parameter1,parameter2)) + +Alternatively you can change MACRO_CHOICE so that its implementation +and usage is: + + #include + #include + + #define MACRO_CHOICE(parameter1,parameter2) \ + BOOST_VMD_IDENTITY_RESULT \ + ( \ + BOOST_PP_IIF(parameter1) \ + ( \ + MACRO_CALL_IF_PARAMETER_1, \ + BOOST_VMD_IDENTITY(SOME_FIXED_VALUE) \ + ) \ + (parameter2) \ + ) + + #define CALLING_MACRO_CHOICE(parameter1,parameter2) \ + MACRO_CHOICE(parameter1,parameter2) + +Using BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY in this way will ensure they can be used +without preprocessing problems with either VC++ or any C++ standard conforming preprocessor. + +[heading Usage for BOOST_VMD_IDENTITY_RESULT] + +The macro BOOST_VMD_IDENTITY_RESULT is in the same header file as BOOST_VMD_IDENTITY, +so to use the BOOST_VMD_IDENTITY_RESULT macro either include the general header: + + #include + +or include the specific header: + + #include + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_index.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_index.qbk new file mode 100644 index 0000000000000000000000000000000000000000..a0aafa84c20e9a7335c69017c88929839b4e1af0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_index.qbk @@ -0,0 +1,8 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +'''''' diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_internal.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_internal.qbk new file mode 100644 index 0000000000000000000000000000000000000000..2efd4eec3fd5313e5f08a1fa21e0287e36b0c9fa --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_internal.qbk @@ -0,0 +1,30 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_internal_macros Controlling internal usage] + +VMD has a few object-like macros which the end-user of the library can use +to determine or change the way variadic macros are used in the library. + +The macro BOOST_PP_VARIADICS is part of the Boost PP library, not part of VMD. +It is used to denote whether variadic data support exists for the particular compiler +the end-user is using. VMD also uses this macro to determine whether variadic +data support exists. An end-user of VMD can use this macro in his own design +to determine whether or not variadic macros are supported. Furthermore +an end-user of VMD can set this macro to 0 or non-zero, before including +a VMD header file, to force VMD to treat the particular compiler being +used as not supporting or supporting variadic macros. If a compiler does +not support variadic macro none of the macros in VMD are defined. + +The macro BOOST_VMD_ASSERT_DATA controls whether or not an assert macro +will check its data. The default is that in compiler debug mode it will check the +data while in compiler release mode it will not check its data. The end-user can +change this by setting the macro to 0 to not check the data, or non-zero to check +the data, before including a VMD header file, or check the value if necessary after +including a VMD header file. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_introduction.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_introduction.qbk new file mode 100644 index 0000000000000000000000000000000000000000..6331433de567504d9c11cabc9e4cf4581e284480 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_introduction.qbk @@ -0,0 +1,100 @@ +[/ + (C) Copyright Edward Diener 2011-2017 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_intro Introduction] + +Welcome to the Variadic Macro Data library. + +The Variadic Macro Data library, referred to hereafter as VMD for +short, is a library of variadic macros which provide enhancements +to the functionality in the Boost preprocessor library ( Boost PP ), +especially as it relates to preprocessor data types. + +The preprocessor data types with which VMD has specific functionality +are emptiness, identifiers, numbers ( a subset of identifiers ), +types ( a subset of identifiers ), Boost PP arrays, +Boost PP lists, Boost PP seqs, Boost PP tuples, +and sequences. The first four are basic preprocessor data types +while the latter five are composite preprocessor data types. A +sequence is zero or more of the other preprocessor data types +following each other. + +[heading Data type examples] + +[table:dwe Data types with examples +[[Type] [Example]] +[[identifier] [anyname]] +[[number] [47]] +[[type] [BOOST_VMD_TYPE_NUMBER]] +[[array] [(4,(an_identifier,156,BOOST_VMD_TYPE_IDENTIFIER))]] +[[list] [(78,(some_identifier,(BOOST_VMD_TYPE_TYPE,BOOST_PP_NIL)))]] +[[seq] [(identifier)(89)(245)]] +[[tuple] [(any_id,175,BOOST_VMD_TYPE_LIST,happy,21)]] +[[sequence] [tree 59 (56,BOOST_VMD_TYPE_SEQ) (128)(fire)(clown) (47,(BOOST_VMD_TYPE_TUPLE,BOOST_PP_NIL))]] +] + +Emptiness is the lack of any preprocessing tokens. A macro which +expands to nothing, as in: + + #define RETURN_NOTHING(x) + +is said to return emptiness. Conversely a macro could accept +nothing when invoked, such as in: + + RETURN_NOTHING() + +Finally emptiness can be part of any composite data type as in: + + (45,,some_name) + +where the second tuple element is empty. + +[heading What is the advantage ?] + +VMD can identify any of the preprocessor data types previously mentioned, +and can parse sequences into their individual preprocessor data types. +You may well ask why that is important. + +In Boost PP macro programming a great deal of the control logic of +designing a macro is based on the support Boost PP has for numbers +and testing for the value of a number, in particular 0 and 1 to represent +boolean choices. Essentially Boost PP often uses the value of a number to +control the logic in a macro's design. + +VMD does not attempt, in any way, to duplicate Boost PP's support for +testing the value of numbers or of the boolean 0 or 1 values, but just +reuses that functionality. What VMD offers, which goes beyond Boost PP, +is a system for deciphering the preprocessor data types, as well as +comparing any of the preprocessor data types for equality to any given +value. This allows macro logic to be designed in a more flexible way, +relying on the type of data and/or the value of the data. If this intrigues +you, continue reading to understand how you can use VMD to do macro programming. + +[heading Functionality areas] + +The functionality of the library may be summed up as: + +# Provide a better way of testing for and using empty parameters and empty preprocessor data. +# Provide ways for testing/parsing for identifiers, numbers, types, tuples, arrays, lists, and seqs. +# Provide ways for testing/parsing sequences of identifiers, numbers, types, tuples, arrays, lists. and seqs. +# Provide some useful variadic macros not in Boost PP. + +The library is a header only library and all macros in the +library are included by a single header, whose name is 'vmd.hpp'. +Individual headers may be used for different functionality +in the library and will be denoted when that functionality is +explained. + +All the macros in the library begin with the sequence 'BOOST_VMD_' +to distinguish them from other macros the end-user might use. Therefore +the end-user should not use any C++ identifiers, whether in macros or +otherwise, which being with the sequence 'BOOST_VMD_'. + +Use of the library is only dependent on Boost PP. The library also +uses Boost detail lightweight_test.hpp for its own tests. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers.qbk new file mode 100644 index 0000000000000000000000000000000000000000..121997b18d21dc38b94cc00234441e63f21a0282 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers.qbk @@ -0,0 +1,79 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers Macros with modifiers] + +The basic functionality for VMD macros parsing data types +has been given using the required parameters of those +macros. This basic functionality may be perfectly adequate for +macro programmers to use VMD effectively in their programming efforts. + +A number of those macros take optional parameters, +called in general "modifiers", which enhance or change the +functionality of those macros in various ways. All modifiers +are VMD identifiers. + +In all situations modifiers are optional parameters which are parsed +by VMD to provide enhanced functionality for some of its macros. +They are never required as part of the basic functionality of a macro. + +When modifiers are used as optional arguments to a macro they +can be input after the required parameters in any order and +VMD will still handle the optional parameters correctly. + +There are two general types of modifiers, 'specific modifiers' and +'user-defined modifiers'. Specific modifers start with BOOST_VMD_ +and are both registered and pre-detected identifiers known to VMD. +The specific modifiers change the expansion of particular macros +in various ways which will be subsequently explained. User-defined +modifiers are user-defined identifiers which the end-user of +specific macros must register and pre-detect for himself. They also +change the expansion of particular macros in various ways which +will be subsequently explained. + +For any particular macro if a specific modifier +is not appropriate it is just ignored. This means that VMD never +generates a preprocessing error or gives an incorrect result +just because a specific modifier does not apply for a particular +macro. Any modifier which is not recognized as a specific modifier +is treated as a user-defined modifier. In cases where a user-defined +modifier is not appropriate it is also just ignored. + +The situations where modifiers can be used to enhance the basic +functionality of VMD macros can be divided by particular types +of specific modifiers. Each particular type of a specific modifier +has a name given to it, functionality, and set of identifiers +associated with that particular type. +Each particular type of a specific modifier may be used as optional +parameters in one or more designated macros depending on the specific +modifier type. + +When more than one mutually exclusive specific modifier from a particular type of modifier is +specified as an optional parameter the last specified takes effect. This +allows the programmer to override a specific modifier by adding the +overridden identifier as an optional argument to the end of the +macro's invocation. + +Header files for specific modifiers are automatically included when +the header files for macros taking those specific modifiers are +included. + +Header files for user-defined modifiers, which register and pre-detect +those user-defined modifiers, must be included as needed by the programmer +using those modifiers. + +The following topics will explain each particular type of modifier +and where it may be used. + +[include vmd_modifiers_return_type.qbk] +[include vmd_modifiers_filter.qbk] +[include vmd_modifiers_identifier.qbk] +[include vmd_modifiers_splitting.qbk] +[include vmd_modifiers_index.qbk] +[include vmd_modifiers_single_element.qbk] + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_filter.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_filter.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b53628fdeda4c2d3aade297210df58df57dc580c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_filter.qbk @@ -0,0 +1,142 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers_filter Filtering modifiers] + +Filtering modifiers are optional modifiers which work +with some generic macros to specify a type of +data to apply to the macro's functionality. The filtering +modifier itself is an optional parameter specified as a +v-type. Any v-type, specified as an optional parameter, +may be used as a filtering modifier. + +[heading Usage with equality macros] + +The equality macros, BOOST_VMD_EQUAL and BOOST_VMD_NOT_EQUAL, tests +generically whether each of its two required inputs are equal or +not equal to each other. + +Each of these macro takes a single optional parameter, a filtering +modifier, to narrow the focus of its equality testing to a particular +v-type. + +For the macro BOOST_VMD_EQUAL this optional parameter when specified means +that equality is not only that the two required input parameters are equal +but also that they are of the type or of a subtype of the third optional +parameter. A number and a v-type are subtypes of identifiers +while a non-empty list and an array are subtypes of tuples. + +Conversely BOOST_VMD_NOT_EQUAL, with the optional third v-type parameter, +returns 1 if either the first two parameters are not equal or if the type of +the first two parameters is not the type or a subtype of the third parameter. +Otherwise it returns 0. It is implemented as the complement of BOOST_VMD_EQUAL +so that whenever BOOST_VMD_EQUAL returns 1, BOOST_VMD_NOT_EQUAL returns 0 +and vice versa. + +Here is an example of using BOOST_VMD_EQUAL with a filtering modifier. +BOOST_VMD_NOT_EQUAL is just the complement of the results in our example +for each result, and would be redundant to be specified each time below. + + #include + + #define BOOST_VMD_REGISTER_AN_ID1 (AN_ID1) + #define BOOST_VMD_REGISTER_AN_ID2 (AN_ID2) + + #define BOOST_VMD_DETECT_AN_ID1_AN_ID1 + #define BOOST_VMD_DETECT_AN_ID2_AN_ID2 + + #define AN_IDENTIFIER1 AN_ID1 + #define AN_IDENTIFIER2 AN_ID2 + #define AN_IDENTIFIER3 AN_ID1 // same as AN_IDENTIFIER1 = AN_ID1 + + #define A_NUMBER1 33 + #define A_NUMBER2 145 + #define A_NUMBER3 33 // same as A_NUMBER1 = 33 + + #define A_TUPLE1 (AN_IDENTIFIER1,A_NUMBER1) + #define A_TUPLE2 (AN_IDENTIFIER1,A_NUMBER2) + #define A_TUPLE3 (AN_IDENTIFIER3,A_NUMBER3) // same as A_TUPLE1 = (AN_ID1,33) + + #define A_LIST1 (A_NUMBER1,(A_NUMBER3,BOOST_PP_NIL)) + #define A_LIST2 (A_NUMBER1,(A_NUMBER2,BOOST_PP_NIL)) + #define A_LIST3 (A_NUMBER1,(A_NUMBER3,BOOST_PP_NIL)) + #define A_LIST4 BOOST_PP_NIL // empty list + #define A_LIST5 BOOST_PP_NIL // empty list + + BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER2,BOOST_VMD_TYPE_IDENTIFIER) will return 0 + BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3,BOOST_VMD_TYPE_IDENTIFIER) will return 1 + BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3,BOOST_VMD_TYPE_TYPE) will return 0 because the type does not match + + BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER2,BOOST_VMD_TYPE_NUMBER) will return 0 + BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_NUMBER) will return 1 + BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_IDENTIFIER) will return 1 because a number is an identifier + BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_EMPTY) will return 0 because the type does not match + + BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2,BOOST_VMD_TYPE_TUPLE) will return 0 + BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3,BOOST_VMD_TYPE_TUPLE) will return 1 + BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3,BOOST_VMD_TYPE_ARRAY) will return 0 because the type does not match + + BOOST_VMD_EQUAL(A_LIST1,A_LIST2,BOOST_VMD_TYPE_LIST) will return 0 + BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_LIST) will return 1 + BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_IDENTIFIER) will return 0 because the type does not match + BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_TUPLE) will return 1 because a non-empty list is also a tuple + BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_LIST) will return 1 + BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_IDENTIFIER) will return 1 because an empty list is also an identifier + BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_TUPLE) will return 0 because an empty list is not a tuple + +[heading Usage with BOOST_VMD_ELEM] + +As with the equality macros BOOST_VMD_ELEM allows one to perform +filtering for the result. An optional parameter of a v-type can be +used so that BOOST_VMD_ELEM returns its result only if the sequence +element is of the v-type specified, else it fails to find the +element in the same way that an element number which is outside +the bounds of the sequence fails. + + #include + + #define BOOST_VMD_REGISTER_ANAME (ANAME) // an identifier must always be registered to be found by VMD + #define A_SEQUENCE (1,2,3) 46 (list_data1,(list_data2,BOOST_PP_NIL)) BOOST_VMD_TYPE_SEQ ANAME + + BOOST_VMD_ELEM(0,A_SEQUENCE) will return (1,2,3) + BOOST_VMD_ELEM(0,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE) will return (1,2,3) + BOOST_VMD_ELEM(0,A_SEQUENCE,BOOST_VMD_TYPE_SEQ) will return emptiness + + BOOST_VMD_ELEM(1,A_SEQUENCE) will return 46 + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_NUMBER) will return 46 + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 46 since a number is also an identifier + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_LIST) will return emptiness + + BOOST_VMD_ELEM(2,A_SEQUENCE) will return (list_data1,(list_data2,BOOST_PP_NIL)) + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_LIST) will return (list_data1,(list_data2,BOOST_PP_NIL)) + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE) will return (list_data1,(list_data2,BOOST_PP_NIL)) since a list is also a tuple + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_TYPE) will return emptiness + + BOOST_VMD_ELEM(3,A_SEQUENCE) will return BOOST_VMD_TYPE_SEQ + BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_TYPE) will return BOOST_VMD_TYPE_SEQ + BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return BOOST_VMD_TYPE_SEQ since a type is also an identifier + BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE) will return emptiness + + BOOST_VMD_ELEM(4,A_SEQUENCE) will return ANAME + BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return ANAME + BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_NUMBER) will return emptiness + + BOOST_VMD_ELEM(0,BOOST_PP_NIL) will return BOOST_PP_NIL + BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_LIST) will return BOOST_PP_NIL since it is an empty list + BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_IDENTIFIER) will return BOOST_PP_NIL since it a registered identifier + BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_TUPLE) will return emptiness + +If you specify more than one v-type as a filtering modifier to BOOST_VMD_ELEM +the last v-type becomes the filter. + +Filtering with BOOST_VMD_ELEM denotes the type of the data expected when +the particular element is found. Because filtering represents the type of +the data requested, filtering modifiers and return type modifiers are +mutually exclusive and any filtering modifier means that return +type modifiers specified are ignored. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_identifier.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_identifier.qbk new file mode 100644 index 0000000000000000000000000000000000000000..de402744c34047be68e111540e05b9de3052797a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_identifier.qbk @@ -0,0 +1,149 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers_identifier Identifier modifiers] + +Identifier modifiers are optional parameters which +specify a set of identifiers to search in order to look +for a particular identifier match rather than just any +identifier. + +[heading Usage with BOOST_VMD_IS_IDENTIFIER] + +Once we have both registered and pre-detected an identifier we can test whether +an identifier is a particular identifier using BOOST_VMD_IS_IDENTIFER and +identifier modifiers. We do this by passing optional parameter(s) to +BOOST_VMD_IS_IDENTIFER. The optional parameter(s) are either a single tuple of +possible identifiers we are trying to match, or the individual identifiers +themselves as separate parameters. + +Using the optional parameter(s) with BOOST_VMD_IS_IDENTIFER we are asking +not only if our input is any of the registered identifiers but also if it is one +of a number of pre-detected identifiers. + +As an example: + + #include + + #define BOOST_VMD_REGISTER_yellow (yellow) + #define BOOST_VMD_REGISTER_green (green) + #define BOOST_VMD_REGISTER_blue (blue) + #define BOOST_VMD_REGISTER_red (red) + + #define BOOST_VMD_DETECT_yellow_yellow + #define BOOST_VMD_DETECT_green_green + #define BOOST_VMD_DETECT_blue_blue + + BOOST_VMD_IS_IDENTIFIER(some_input,yellow) // returns 1 only if 'some_input is 'yellow', else returns 0 + BOOST_VMD_IS_IDENTIFIER(some_input,yellow,blue) // returns 1 only if 'some_input is 'yellow' or 'blue', else returns 0 + BOOST_VMD_IS_IDENTIFIER(some_input,(yellow,green)) // returns 1 if 'some_input' is 'yellow' or 'green', else returns 0 + + BOOST_VMD_IS_IDENTIFIER(some_input,red) + // always returns 0, even if 'some_input' is 'red' since 'red' has not been pre-detected + +whereas + + BOOST_VMD_IS_IDENTIFIER(some_input) // returns 1 if 'some_input' is 'red' since 'red' has been registered + +If you invoke BOOST_VMD_IS_IDENTIFIER with the optional parameter(s), the invocation will +only return 1 if the input matches one the identifier(s) of the optional parameters and the +identifier it matches has been registered and pre-detected. + +Both VMD numbers and v-types are identifier subtypes so you can also use them +as identifier modifiers. You do not have to register or pre-detect VMD numbers +or v-types since VMD has already done that for you. + +As an example of using VMD numbers or v-types as identifier modifiers with BOOST_VMD_IS_IDENTIFIER: + + BOOST_VMD_IS_IDENTIFIER(some_input,1,3,5) // returns 1 only if 'some_input' is 1 or 3 or 5, else returns 0 + BOOST_VMD_IS_IDENTIFIER(some_input,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_TYPE_LIST,59) + // returns 1 only if 'some_input is the v-type BOOST_VMD_TYPE_TUPLE or the v-type BOOST_VMD_TYPE_LIST or 59, else returns 0 + + +[heading Usage with BOOST_VMD_ELEM] + +When we use the specific filter modifier BOOST_VMD_TYPE_IDENTIFIER as an optional +parameter of BOOST_VMD_ELEM we are asking for a particular element of a sequence +as long as it is a VMD identifier. With that specific filter modifier +BOOST_VMD_TYPE_IDENTIFIER we can use identifier modifiers to ask for a particular +element of a sequence as long as it matches one of our identifier modifiers. If +the specific filter modifier BOOST_VMD_TYPE_IDENTIFIER is not being used then all +identifier modifiers are ignored. + +The syntax for specifying identifier modifiers using BOOST_VMD_ELEM is +exactly the same as the equivalent feature of the BOOST_VMD_IS_IDENTIFIER +macro explained just previously. Optional parameters in the form of +identifiers can be specified either singly any number of times or once +as part of a tuple. For an identifier found as a sequence element to +match against one of these possible identifiers, the possible +identifiers must be both registered and pre-detected. + +Since filter modifiers, which are v-types, are also identifiers, if +you want to use v-types as identifier modifiers you must use the form +which places all identifier modifiers as part of a tuple. Otherwise any +v-types specified singly as optional parameters are seen as filter +modifiers and never as identifier modifiers. VMD numbers are also identifiers +and may be used as identifier modifiers, but in this case VMD numbers as +identifier modifiers do not need to be part of a tuple to be detected. + +Let's see how this works: + + #include + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define BOOST_VMD_REGISTER_APLACE (APLACE) + #define BOOST_VMD_REGISTER_ACOUNTRY (ACOUNTRY) + + #define BOOST_VMD_DETECT_ANAME_ANAME + #define BOOST_VMD_DETECT_APLACE_APLACE + + #define A_SEQUENCE (1,2,3) ANAME 46 BOOST_VMD_TYPE_SEQ ACOUNTRY + + BOOST_VMD_ELEM(1,A_SEQUENCE) will return 'ANAME' + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 'ANAME' + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,APLACE,ACOUNTRY) will return emptiness + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,ANAME,APLACE,ACOUNTRY) will return 'ANAME' + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,(APLACE,ACOUNTRY,ANAME)) will return 'ANAME' + + BOOST_VMD_ELEM(4,A_SEQUENCE) will return 'ACOUNTRY' + BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 'ACOUNTRY' + BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,ACOUNTRY,ANAME) + will return emptiness since ACOUNTRY is not pre-detected + +Let us illustrate the case where VMD identifiers can be represented as either +filter modifiers or identifier modifiers. + +Using the sequence above: + + #include + + BOOST_VMD_ELEM(3,A_SEQUENCE) will return the BOOST_VMD_TYPE_SEQ type + BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) + will return the BOOST_VMD_TYPE_SEQ type since a type is an identifier + BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TUPLE) will return emptiness + +The last use of our macro returns emptiness because if there is more than one +type specified as an optional parameter the last type is chosen for filtering. +Since the last type for type filtering is BOOST_VMD_TYPE_TUPLE and our fourth +element is a v-type and not a tuple, emptiness is returned. The syntax does not +specifying filtering with identifiers as might be supposed since BOOST_VMD_TYPE_SEQ +and BOOST_VMD_TYPE_TUPLE are not treated as identifier modifiers but rather as +additional filter modifiers. + +In order to do filtering with an identifier and do it against +various types themselves, since v-types are identifiers, we must +use the tuple form to specify our identifier modifiers: + + #include + + BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,(BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TUPLE)) + will return BOOST_VMD_TYPE_SEQ + +Now BOOST_VMD_TYPE_SEQ and BOOST_VMD_TYPE_TUPLE are treated as identifiers +modifiers to match against. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_index.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_index.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c09e03508192d932804eeffc9e4115db86d8e441 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_index.qbk @@ -0,0 +1,77 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers_index Index modifiers] + +Index modifiers can be used with the BOOST_VMD_ELEM macro +when identifier modifiers are being used. Index modifiers +take two values: + +* BOOST_VMD_RETURN_INDEX, return an index as a number, starting with 0, +of the particular identifier modifier which matched, as part of the +output of the BOOST_VMD_ELEM macro. If no particular identifier modifier +matches, return emptiness as part of the output. The index number is +determined purely by the order in which identifier modifiers are +specified as optional parameters to BOOST_VMD_ELEM, whether singly as +individual optional parameters or as a tuple of identifier modifiers. +* BOOST_VMD_RETURN_NO_INDEX, do not return an index as part of the output. +This is the default value and need only be used to override the +BOOST_VMD_RETURN_INDEX value if it is specified. + +The BOOST_VMD_RETURN_INDEX tells the programmer which one of the identifier +modifiers matched the element's data as an index. Some macro programmers +find this more useful for the purposes of macro branching logic than +branching using the actual name of the identifier itself. + +When the index modifier BOOST_VMD_RETURN_INDEX is specified, and identifier +modifiers are specified along with the BOOST_VMD_TYPE_IDENTIFIER filter +modifier, the output of BOOST_VMD_ELEM becomes a tuple of two elements. +The first tuple element is the element matched and the last tuple element is the +index, starting with 0, of the identifier modifier which matched. If an element +is not matched both tuple elements are empty. + +If the splitting modifier BOOST_VMD_RETURN_AFTER is also specified then the +output is a tuple of three elements. The first tuple element is the element matched, +the second tuple element is the rest of the sequence after the matching element, +and the last tuple element is the numeric index. If an element is not matched +then all three tuple elements are empty. + +If identifier modifiers and the BOOST_VMD_TYPE_IDENTIFIER filter modifier +are not specified as optional parameters, then if BOOST_VMD_RETURN_INDEX is +specified it is ignored. If the splitting modifier BOOST_VMD_RETURN_ONLY_AFTER +is specified, if BOOST_VMD_RETURN_INDEX is also specified it is ignored. + +Let's see how this works: + + #include + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define BOOST_VMD_REGISTER_APLACE (APLACE) + #define BOOST_VMD_REGISTER_ACOUNTRY (ACOUNTRY) + + #define BOOST_VMD_DETECT_ANAME_ANAME + #define BOOST_VMD_DETECT_APLACE_APLACE + + #define A_SEQUENCE (1,2,3) ANAME (1)(2) 46 + + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER) will return 'ANAME' + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,APLACE,ACOUNTRY) will return emptiness + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,APLACE,ACOUNTRY) will return (,) + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,ANAME,APLACE,ACOUNTRY) will return '(ANAME,0)' + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME)) will return '(ANAME,2)' + +Used with splitting modifiers: + + #include + + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,APLACE,ACOUNTRY,BOOST_VMD_RETURN_AFTER) will return (,,) + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,ANAME,APLACE,ACOUNTRY,BOOST_VMD_RETURN_AFTER) will return '(ANAME,(1)(2) 46,0)' + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME),BOOST_VMD_RETURN_AFTER) will return '(ANAME,(1)(2) 46,2)' + + BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME),BOOST_VMD_RETURN_ONLY_AFTER) will return '(1)(2) 46' + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_return_type.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_return_type.qbk new file mode 100644 index 0000000000000000000000000000000000000000..7817807b7ca5bafadafd67ba069239b3840ba193 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_return_type.qbk @@ -0,0 +1,451 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers_return_type Return type modifiers] + +A number of macros are capable of returning the type of +data as a v-type rather than, or along with, the +data itself. The most obvious of these is BOOST_VMD_GET_TYPE +which generically returns the type of the input. + +Return type modifiers turn on, turn off, or change +the type of the data returned in some way. + +These modifiers are: + +* BOOST_VMD_RETURN_NO_TYPE, do not return the type of data. +* BOOST_VMD_RETURN_TYPE, return the type of data parsing any tuple-like +syntactical construct as its most specific type. This means that any +tuple-like construct is parsed first as a possible list, next as a +possible array if it is not a list, and finally as a tuple if it is not a +list or an array. +* BOOST_VMD_RETURN_TYPE_LIST, parse any tuple-like syntactical construct +first as a possible list and only then as a tuple if it is not a list. +* BOOST_VMD_RETURN_TYPE_ARRAY, parse any tuple-like syntactical construct +first as a possible array and only then as a tuple if it is not an array. +* BOOST_VMD_RETURN_TYPE_TUPLE, parse any tuple-like syntactical construct +only as a tuple. + +When VMD parses input generically it must determine the type of each data +element of the input. For nearly all of the VMD data types this is never +a problem. For the array or list data types this can be a problem, as +explained when discussing parsing arrays and lists respectively using the +specific macros BOOST_VMD_IS_ARRAY and BOOST_VMD_IS_LIST. The problem is +that a valid tuple can be an invalid list or an invalid array, whose +parsing as the more specific type will lead to UB. +Because of this when VMD parses input generically, +and only the data of an element is needed to continue parsing correctly, +it parses all tuple-like data as a tuple and never as a list or an array. + +When VMD parses input generically, and the type of the data is required +in some way as part of the return of a macro, VMD by default parses for +the most specific type of each data element in order to return the most +accurate type. In this situation by default the +BOOST_VMD_RETURN_TYPE modifier is internally in effect without having +to be specified. + +If more than one of the return type modifiers are specified as optional +parameters the last one specified is in effect. + +[heading Usage with BOOST_VMD_GET_TYPE] + +The only macro in which VMD without the use of modifiers is being asked +to return the type of data is BOOST_VMD_GET_TYPE. For this macro +the BOOST_VMD_RETURN_TYPE modifier is internally in effect so if +no return type modifiers are input as optional parameters BOOST_VMD_GET_TYPE +looks for the most specific type. + +For the BOOST_VMD_GET_TYPE macro the optional return type modifier +BOOST_VMD_RETURN_NO_TYPE, if specified, is always ignored since the purpose of +BOOST_VMD_GET_TYPE is solely to return the v-type. + +Let's look at how this works with BOOST_VMD_GET_TYPE by specifying VMD sequences +that have tuples which may or may not be valid lists or arrays. + + #include + + #define TUPLE_IS_ARRAY (2,(3,4)) + #define TUPLE_IS_LIST (anydata,BOOST_PP_NIL) + #define TUPLE_IS_LIST_OR_ARRAY (2,(3,BOOST_PP_NIL)) + #define TUPLE_BUT_INVALID_ARRAY (&2,(3,4)) + #define TUPLE_BUT_INVALID_LIST (anydata,^BOOST_PP_NIL) + #define SEQUENCE_EMPTY + #define SEQUENCE_MULTI TUPLE_BUT_INVALID_ARRAY TUPLE_BUT_INVALID_LIST + + BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY) will return BOOST_VMD_TYPE_ARRAY, the most specific type + BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_ARRAY + BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_TUPLE + + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST) will return BOOST_VMD_TYPE_LIST, the most specific type + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_LIST + + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY) will return BOOST_VMD_TYPE_LIST, the most specific type + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_ARRAY + BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_LIST + + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY) will give UB + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY) will give UB + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_LIST) will return BOOST_VMD_TYPE_TUPLE + + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST) will give UB + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_TUPLE) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_ARRAY) will return BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_LIST) will give UB + + BOOST_VMD_GET_TYPE(SEQUENCE_EMPTY) + will always return BOOST_VMD_TYPE_EMPTY even if we add any return type modifiers + BOOST_VMD_GET_TYPE(SEQUENCE_MULTI) + will always return BOOST_VMD_TYPE_SEQUENCE even if we add any return type modifiers + +[heading Usage with sequence converting macros] + +The sequence converting macros converts a sequence to a composite Boost PP data type +or to variadic data, where each element's data in the sequence becomes an element in the +destination composite type. The macros are: + +* BOOST_VMD_TO_ARRAY, converts the sequence to an array +* BOOST_VMD_TO_LIST, converts the sequence to a list +* BOOST_VMD_TO_SEQ, converts the sequence to a seq +* BOOST_VMD_TO_TUPLE, converts the sequence to a tuple +* BOOST_VMD_ENUM, converts the sequence to variadic data + +When it does the conversion, using just the required parameter of the sequence itself, +it converts only the data value of each sequence element to the +elements of a composite Boost PP data type or variadic data. Because it needs only the data +value of each sequence element it determines the type of each sequence element as +the most general type that it can be. This means that all tuple-like data are parsed as +tuples rather than as possible lists or arrays. + +Using a return type modifier we can convert from a VMD sequence to a +Boost PP composite data type or variadic data and retain the type of data of each +element in the sequence as part of the conversion. When doing this each of the +converted elements of the composite data type becomes a two-element tuple where +the first element is the type of the data and the second element is the data itself. + +For the sequence conversion macros the default return type modifier internally set is +BOOST_VMD_RETURN_NO_TYPE, which means that the type is not retained. +By specifying another optional return type modifier +we tell the conversion to preserve the type in the conversion output. + +If the sequence is empty, since there are no sequence elements, +any return type modifier we use accomplishes nothing but is fine to use. + +First we show how sequence conversion macros work with the BOOST_VMD_RETURN_TYPE +modifier, which always parses for the most specific type. + + #include + #include + #include + #include + #include + + #define BOOST_VMD_REGISTER_ANID (ANID) + #define SEQUENCE_EMPTY_1 + #define SEQUENCE_SINGLE 35 + #define SEQUENCE_SINGLE_ID ANID + #define SEQUENCE_SINGLE_ARRAY (3,(0,1,2)) + #define SEQUENCE_SINGLE_LIST (data,(more_data,BOOST_PP_NIL)) + #define SEQUENCE_MULTI_1 (0,1) (2)(3)(4) + #define SEQUENCE_MULTI_2 BOOST_VMD_TYPE_SEQ (2,(5,6)) + + BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY_1) will return an empty array '(0,())' + BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY_1,BOOST_VMD_RETURN_TYPE) will return an empty array '(0,())' + + BOOST_VMD_TO_LIST(SEQUENCE_SINGLE) will return a one-element list '(35,BOOST_PP_NIL)' + BOOST_VMD_TO_LIST(SEQUENCE_SINGLE,BOOST_VMD_RETURN_TYPE) + will return a one-element list '((BOOST_VMD_TYPE_NUMBER,35),BOOST_PP_NIL)' + + BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_ID) will return a one-element seq '(ANID)' + BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_ID,BOOST_VMD_RETURN_TYPE) + will return a one-element seq '((BOOST_VMD_TYPE_IDENTIFIER,ANID))' + + BOOST_VMD_TO_TUPLE(SEQUENCE_SINGLE_ARRAY) will return a single element tuple '((3,(0,1,2)))' + BOOST_VMD_TO_TUPLE(SEQUENCE_SINGLE_ARRAY,BOOST_VMD_RETURN_TYPE) + will return a single element tuple '((BOOST_VMD_TYPE_ARRAY,(3,(0,1,2))))' + + BOOST_VMD_ENUM(SEQUENCE_SINGLE_LIST) will return the single-element '(data,(more_data,BOOST_PP_NIL))' + BOOST_VMD_ENUM(SEQUENCE_SINGLE_LIST,BOOST_VMD_RETURN_TYPE) + will return the single element '(BOOST_VMD_TYPE_LIST,(data,(more_data,BOOST_PP_NIL)))' + + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_1) will return a multi-element tuple '((0,1),(2)(3)(4))' + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_1,BOOST_VMD_RETURN_TYPE) + will return a multi-element tuple '((BOOST_VMD_TYPE_TUPLE,(0,1)),(BOOST_VMD_TYPE_SEQ,(2)(3)(4)))' + + BOOST_VMD_ENUM(SEQUENCE_MULTI_2) will return multi-element variadic data 'BOOST_VMD_TYPE_SEQ,(2,(5,6))' + BOOST_VMD_ENUM(SEQUENCE_MULTI_2,BOOST_VMD_RETURN_TYPE) + will return multi-element variadic data '(BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ),(BOOST_VMD_TYPE_ARRAY,(2,(5,6)))' + +Lets look at how we might use other return type modifiers when doing conversions +to avoid UB if we want the type as part of the conversion but +the type might be a valid tuple while being an invalid list or array. + + #define TUPLE_IS_VALID_ARRAY (2,(3,4)) + #define TUPLE_IS_VALID_LIST (anydata,BOOST_PP_NIL) + #define TUPLE_BUT_INVALID_ARRAY_2 (&2,(3,4)) + #define TUPLE_BUT_INVALID_LIST_2 (anydata,^BOOST_PP_NIL) + + #define SEQUENCE_MULTI_T1 TUPLE_IS_VALID_ARRAY TUPLE_IS_VALID_LIST + #define SEQUENCE_MULTI_T2 TUPLE_BUT_INVALID_ARRAY_2 TUPLE_IS_VALID_LIST + #define SEQUENCE_MULTI_T3 TUPLE_IS_VALID_ARRAY TUPLE_BUT_INVALID_LIST_2 + #define SEQUENCE_MULTI_T4 TUPLE_BUT_INVALID_ARRAY_2 TUPLE_BUT_INVALID_LIST_2 + +We present a number of uses of various sequence conversions +with each of our four different sequences, and show their results. + + #include + + BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE) + will return the seq '((BOOST_VMD_TYPE_ARRAY,(2,(3,4)))) ((BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))' + BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_ARRAY) + will return the seq '((BOOST_VMD_TYPE_ARRAY,(2,(3,4)))) ((BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))' + BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_LIST) + will return the seq '((BOOST_VMD_TYPE_TUPLE,(2,(3,4)))) ((BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))' + BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_TUPLE) + will return the seq '((BOOST_VMD_TYPE_TUPLE,(2,(3,4)))) ((BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))' + +The SEQUENCE_MULTI_T1 is a valid array followed by a valid list. All return type +modifiers produce their results without any UBs. + + #include + + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid array as an array + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_ARRAY) + will produce UB when attempting to parse the invalid array as an array + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_LIST) + will return the tuple '((BOOST_VMD_TYPE_TUPLE,(&2,(3,4))),(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))' + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_TUPLE) + will return the tuple '((BOOST_VMD_TYPE_TUPLE,(&2,(3,4))),(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))' + +The SEQUENCE_MULTI_T2 is an invalid array, but valid tuple, followed by a valid list. + +In sequence conversion we will get UB whenever we use a return type +modifier that parses the data type of the invalid array as an array. But if we use +the return type modifiers BOOST_VMD_RETURN_TYPE_LIST or BOOST_VMD_RETURN_TYPE_TUPLE +we are never parsing the invalid array as an array but as a tuple instead and therefore +we successfully return the type of the invalid array as a BOOST_VMD_TYPE_TUPLE. + + #include + + BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid list as a list + BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_LIST) + will produce UB when attempting to parse the invalid list as a list + BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_ARRAY) + will return the array '(2,((BOOST_VMD_TYPE_ARRAY,(2,(3,4))),(BOOST_VMD_TYPE_TUPLE,(anydata,^BOOST_PP_NIL))))' + BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_TUPLE) + will return the array '(2,((BOOST_VMD_TYPE_TUPLE,(2,(3,4))),(BOOST_VMD_TYPE_TUPLE,(anydata,^BOOST_PP_NIL))))' + +The SEQUENCE_MULTI_T3 is a valid array followed by an invalid list, but a valid tuple. + +In sequence conversion we will get UBs whenever we use a return type +modifier that parses the data type of the invalid list as a list. But if we use +the return type modifiers BOOST_VMD_RETURN_TYPE_ARRAY or BOOST_VMD_RETURN_TYPE_TUPLE +we are never parsing the invalid list as a list but as a tuple instead and therefore +we successfully return the type of the invalid list as a BOOST_VMD_TYPE_TUPLE. + + #include + + BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid array or invalid list + BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_ARRAY) + will produce UB when attempting to parse the invalid array + BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_LIST) + will produce UB when attempting to parse the invalid list + BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_TUPLE) + will return the list '((BOOST_VMD_TYPE_TUPLE,(&2,(3,4))),((BOOST_VMD_TYPE_TUPLE,(anydata,^BOOST_PP_NIL)),BOOST_PP_NIL))' + +The SEQUENCE_MULTI_T4 is an invalid array, but valid tuple, followed by an invalid list, but valid tuple. + +In sequence conversion we will get UBs whenever we use a return type +modifier that parses the sequence other than looking for only valid tuples. So here we must use +the return type modifier BOOST_VMD_RETURN_TYPE_TUPLE for a sequence conversion without +generating UBs. + +[heading Usage with BOOST_VMD_ELEM] + +The default functionality of BOOST_VMD_ELEM when the required parameters are used +is to return the particular element's data. When BOOST_VMD_ELEM does this it parses +all elements of the sequence by determining the most general type of data for each +element. The parsing algorithm stops when it reaches the element number whose data +is returned. This means that all tuple-like data are parsed as tuples rather than +as possible lists or arrays. + +Using return type modifiers as optional parameters we can tell BOOST_VMD_ELEM to +return the type of the element found, as well as its data, in the form of a two +element tuple. The first element of the tuple is the type of the data and the +second element of the tuple is the data itself. + +When we use a return type modifier with BOOST_VMD_ELEM, which tells us to return +the type of the data along with the data, the particular modifier only tells +BOOST_VMD_ELEM how to parse the type of data for the element found. +BOOST_VMD_ELEM will continue to parse elements in the sequence preceding the +element found by determining the most general type of the data since this is +the safest way of parsing the data itself. + +Using the return type modifier BOOST_VMD_RETURN_TYPE with BOOST_VMD_ELEM is +perfectly safe as long as the particular element found is not an invalid list +or array, but a valid tuple. It is when the element found may be an invalid +list or invalid array that we must use other return type modifiers in order +to parse the type of the element correctly. + + #include + + #define BOOST_VMD_REGISTER_ANID_E (ANID_E) + #define SEQUENCE_SINGLE_E 35 + #define SEQUENCE_SINGLE_E2 ANID_E + #define SEQUENCE_MULTI_E (0,1) (2)(3)(4) + #define SEQUENCE_MULTI_E_2 BOOST_VMD_TYPE_SEQ (2,(5,6)) + + BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E) will return '35' + BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_NUMBER,35)' + + BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E2) will return 'ANID_E' + BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E2,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_IDENTIFIER,ANID_E)' + + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E) will return '(2)(3)(4)' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_SEQ,(2)(3)(4))' + + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E_2) will return 'BOOST_VMD_TYPE_SEQ' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E_2,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ)' + +When we use the other return type modifiers with BOOST_VMD_ELEM we do so +because the element we want may be an invalid list or an invalid array +but a valid tuple and yet we still want its type returned as part of the result. + +Let's look at how this works with BOOST_VMD_ELEM by specifying VMD sequences +that have tuples which are in the form of arrays or lists which cannot be +parsed as such by VMD without generating UBs. + + #define TUPLE_IS_VALID_ARRAY_E (2,(3,4)) + #define TUPLE_IS_VALID_LIST_E (anydata,BOOST_PP_NIL) + #define TUPLE_BUT_INVALID_ARRAY_E (&2,(3,4)) + #define TUPLE_BUT_INVALID_LIST_E (anydata,^BOOST_PP_NIL) + + #define SEQUENCE_MULTI_E1 TUPLE_IS_VALID_ARRAY_E TUPLE_IS_VALID_LIST_E + #define SEQUENCE_MULTI_E2 TUPLE_BUT_INVALID_ARRAY_E TUPLE_IS_VALID_LIST_E + #define SEQUENCE_MULTI_E3 TUPLE_IS_VALID_ARRAY_E TUPLE_BUT_INVALID_LIST_E + #define SEQUENCE_MULTI_E4 TUPLE_BUT_INVALID_ARRAY_E TUPLE_BUT_INVALID_LIST_E + +We present a number of uses of BOOST_VMD_ELEM with each of our four +different sequences, and show their results. + + #include + + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + +The SEQUENCE_MULTI_E1 is a valid array followed by a valid list. All return type +modifiers produce their results without any UBs. + + #include + + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid array as an array + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_ARRAY) + will produce UB when attempting to parse the invalid array as an array + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(&2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(&2,(3,4)))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + +The SEQUENCE_MULTI_E2 is an invalid array, but valid tuple, followed by a valid list. + +When we access element 0 of our sequence, and use a return type modifier that parses +its data type as an array we will get UB. But if we use the return +type modifiers BOOST_VMD_RETURN_TYPE_LIST or BOOST_VMD_RETURN_TYPE_TUPLE +we are never parsing the invalid array as an array but as a tuple instead and therefore +we successfully return the type of the invalid array as a BOOST_VMD_TYPE_TUPLE. + +When we access element 1 of our sequence, which is both a valid list and a valid tuple, +we will never get UB. We will get the return type of the element based +on which return type modifier we use. + + #include + + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_ARRAY,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid list as a list + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_LIST) + will produce UB when attempting to parse the invalid list as a list + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + +The SEQUENCE_MULTI_E3 is a valid array followed by an invalid list, but valid tuple. + +When we access element 0 of our sequence, which is both a valid array and a valid tuple, +we will never get UB. We will get the return type of the element based +on which return type modifier we use. + +When we access element 1 of our sequence, and use a return type modifier that parses +its data type as a list we will get UB. But if we use the return +type modifiers BOOST_VMD_RETURN_TYPE_ARRAY or BOOST_VMD_RETURN_TYPE_TUPLE +we are never parsing the invalid list as a list but as a tuple instead and therefore +we successfully return the type of the invalid list as a BOOST_VMD_TYPE_TUPLE. + + #include + + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid array + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_ARRAY) + will produce UB when attempting to parse the invalid array + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_LIST) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))' + BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(2,(3,4)))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE) + will produce UB when attempting to parse the invalid list + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_ARRAY) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_LIST) + will produce UB when attempting to parse the invalid list + BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_TUPLE) will return '(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))' + +The SEQUENCE_MULTI_E4 is an invalid array, but valid tuple, followed by an invalid list, but valid tuple. + +When we access element 0 of our sequence, which is an invalid array but a valid tuple, +we must use a return type modifier which does not parse element 0 as an array, else +we will get UB. This means we must use the return +type modifiers BOOST_VMD_RETURN_TYPE_LIST or BOOST_VMD_RETURN_TYPE_TUPLE so +we are never parsing the invalid array as an array but as a tuple instead and therefore +we successfully return the type of the invalid array as a BOOST_VMD_TYPE_TUPLE. + +When we access element 1 of our sequence, which is an invalid list but a valid tuple, +we must use a return type modifier which does not parse element 1 as a list, else +we will get UB. This means we must use the return +type modifiers BOOST_VMD_RETURN_TYPE_ARRAY or BOOST_VMD_RETURN_TYPE_TUPLE so +we are never parsing the invalid list as a list but as a tuple instead and therefore +we successfully return the type of the invalid list as a BOOST_VMD_TYPE_TUPLE. + +[heading Usage with other modifiers of BOOST_VMD_ELEM] + +We have not yet discussed the rest of the modifiers which may be +used with BOOST_VMD_ELEM, but return type modifiers are completely +independent of any of them. This means they can be combined with +other modifiers and whenever the element of the sequence is +returned the return type modifiers determine of what the value of that +element consists; whether it be just the element data or the element +as a type/data tuple with the type parsed according to our return type +modifier. When we subsequently discuss the use of other modifiers with +BOOST_VMD_ELEM and refer to the element being returned, we are referring +to that element as it is determined by the return type modifiers, which +by default only returns the element's data. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_single_element.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_single_element.qbk new file mode 100644 index 0000000000000000000000000000000000000000..4583542e1befc121d4dac8704cfe9fcf38ea1a6f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_single_element.qbk @@ -0,0 +1,39 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers_single Modifiers and the single-element sequence] + +A single element sequence is what we normally think of when +working with macro data. It is a single type of macro data +passed as an input parameter to some macro and processed as +such. + +In its basic form without modifiers BOOST_VMD_ELEM serves +to just return a particular element of a sequence. For +a single element sequence BOOST_VMD_ELEM with element +number 0, just returns the single-element sequence itself. This does not +offer much functionality for our simple sequence. However with +modifiers we can do things generically with our single-element +sequence which correspond to working with a single type of data +and extracting information about it. + +With the return type modifier we can get the type of the data +along with the data. Of course we can also use BOOST_VMD_GET_TYPE +to retrieve just the type of data. + +With our filter modifier we can retrieve the data only if it is a particular +type, else retrieve emptiness. + +With the identifier modifier we can retrieve an identifier only if it +matches one or more other identifiers, else retrieve emptiness. + +With our index modifier we can retrieve both our +identifier and its numeric index if it matches one or more +other identifiers, else retrieve a tuple of two empty elements +if no match is found. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_splitting.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_splitting.qbk new file mode 100644 index 0000000000000000000000000000000000000000..94a1663bfccac74043696b2e23cf46229fb795d9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_modifiers_splitting.qbk @@ -0,0 +1,67 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_modifiers_splitting Splitting modifiers] + +The BOOST_VMD_ELEM macro, which by default just returns an element of +a sequence, has a usage where you can have it return both the +element and the remaining part of the sequence after the element, +or even just the remaining part of the sequence after the element by itself. +This offers a form of splitting the sequence on a particular element. When +used to return the remaining part of a sequence the remaining data may +subsequently be treated as a VMD sequence again. + +To do this another set of optional modifiers are used which will +be called 'splitting modifers'. These modifiers are: + +* BOOST_VMD_RETURN_AFTER, which returns both the element information and the +rest of the sequence after the element as a two-element tuple +* BOOST_VMD_RETURN_ONLY_AFTER, which returns only the rest of the sequence +after the element specified +* BOOST_VMD_RETURN_NO_AFTER, this is the internal default which only returns +the element itself. It need never be specified but may be used to override +a previous splitting modifier specified as an optional parameter. + +If more than one of the splitting modifiers are specified as optional parameters +to BOOST_VMD_ELEM the last one specified is in effect. + +The splitting modifiers BOOST_VMD_RETURN_NO_AFTER and BOOST_VMD_RETURN_AFTER +work with either return type modifiers or filtering modifiers if they are +used. The splitting modifier BOOST_VMD_RETURN_ONLY_AFTER works with +filtering modifiers if it is used and any return type modifiers will be ignored. +Optional modifiers may occur in any order after the required parameters +to BOOST_VMD_ELEM. + +If BOOST_VMD_RETURN_AFTER is in effect and an element is not found, either +because the element number is out of range for the sequence or because +filtering does not match the element type, a tuple will still be returned +but both its elements will be empty. + + #include + + #define BOOST_VMD_REGISTER_ANAME (ANAME) // an identifier must always be registered to be found by VMD + #define A_SEQUENCE (1,2,3) 46 (list_data1,BOOST_PP_NIL) BOOST_VMD_TYPE_SEQ ANAME + + BOOST_VMD_ELEM(2,A_SEQUENCE) will return '(list_data1,BOOST_PP_NIL)' + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER) will return '(list_data1,BOOST_PP_NIL)' + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER) will return '((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME)' + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER) will return 'BOOST_VMD_TYPE_SEQ ANAME' + + BOOST_VMD_ELEM(5,A_SEQUENCE) will return emptiness + BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER) will return emptiness + BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_AFTER) will return '(,)' + BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER) will return emptiness + +Combining splitting modifiers with return type modifiers: + + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_TYPE) will return '((BOOST_VMD_TYPE_LIST,(list_data1,BOOST_PP_NIL)),BOOST_VMD_TYPE_SEQ ANAME)' + +Combining splitting modifiers with filtering modifiers: + + BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST) will return '((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME)' + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_naming.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_naming.qbk new file mode 100644 index 0000000000000000000000000000000000000000..5ef5a59458c6b9be29d2d22215c6d4d84cd8e573 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_naming.qbk @@ -0,0 +1,52 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_naming Naming conventions] + +All of the macros in the library begin with the prefix BOOST_VMD_, +where VMD stands for 'Variadic Macro Data'. + +Following the prefix, certain names in the macros refer to data types +in this library or Boost PP. These names and their data types are: + +# TUPLE = Boost PP tuple data type. +# ARRAY = Boost PP array data type. +# LIST = Boost PP list data type. +# SEQ = Boost PP seq data type. +# IDENTIFIER = A VMD identifier +# NUMBER = A VMD number +# TYPE = A VMD type + +I have used most of these names in order to mimic the naming of Boost PP +as closely as possible. Subsequent use of the words 'array', 'list', +'seq', and 'tuple' refer to these Boost PP data types unless otherwise +noted. See the help for Boost PP for any explanation of these +data types. + +The term 'sequence' refers to a sequence of VMD data types and is not the +same as a Boost PP sequence which is always referred to in this documentation +as a 'seq'. + +The term 'return' refers to the expansion of a macro. I use the terminology +of a macro "returning some data" rather than the terminology of a macro +"expanding to some data", even if the latter is more accurate, because it +more closely corresponds to the way I believe C++ programmers think about +macro programming. + +The term 'emptiness' refers to no preprocessor data being passed to or returned +from a macro. I have avoided the word 'nothing' because it has too vague a meaning. + +The term 'data type' refers to the various preprocessor input types +which VMD can parse and which are listed above, also including emptiness. + +The term 'v-type' refers to a VMD type, the term 'number' returns to a VMD number +and the term 'identifier' refers to a VMD identifier. All these will be explained +in their proper place. + +The term "UB" stands for "undefined behavior" as it is specified in the C++ standard. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_number.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_number.qbk new file mode 100644 index 0000000000000000000000000000000000000000..232f8797977fe884c28799d805bd69254ffc7f61 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_number.qbk @@ -0,0 +1,94 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_number Numbers] + +A number in VMD is a preprocessing 'pp-number', +limited to a Boost PP number. This is an integral literal between 0 and 256. +The form of the number does not contain leading zeros. Acceptable as numbers are: + + 0 + 127 + 33 + 254 + 18 + +but not: + + 033 + 06 + 009 + 00 + +[heading Problem testing any number] + +As can be seen from the explanation of an identifier, a number is merely +a small subset of all possible identifiers, for which VMD internally provides +registration macros for its use and pre-detection macros for its use. Therefore the particular +constraint on the input to test is exactly the same as for identifiers. + +The constraint is that the beginning input character, ignoring any whitespace, passed +as the input to test must be either: + +* an identifier character, ie. an alphanumeric or an underscore +* the left parenthesis of a tuple + +and if the first character is not the left parenthesis of a tuple +the remaining characters must be alphanumeric or an underscore until a space character +or end of input occurs. + +If this is not the case the behavior is undefined, and most likely +a preprocessing error will occur. + +[heading Testing for a number macro] + +The macro used to test for any number in VMD is called BOOST_VMD_IS_NUMBER. +The macro takes a single parameter, the input to test against. + +The macro returns 1 if the parameter is a Boost PP number, otherwise the macro returns 0. + +The Boost PP library has a great amount of functionality for working with numbers, +so once you use VMD to parse/test for a number you can use Boost PP to work with that +number in various ways. The VMD makes no attempt to duplicate the functionality +of numbers that in the Boost PP library. + +Any number is also an identifier, which has been registered and pre-detected, +so you can also use the VMD functionality which works with identifiers to work with +a number as an identifier if you like. + +[heading Example] + +Let us look at an example of how to use BOOST_VMD_IS_NUMBER. + + #include + + BOOST_VMD_IS_NUMBER(input) + + returns: + + if input = 0, 1 + if input = 44, 1 + if input = SQUARE, 0 + if input = 44 DATA, 0 since there are tokens after the number + if input = 044, 0 since no leading zeros are allowed for our Boost PP numbers + if input = 256, 1 + if input = 257, 0 since it falls outside the Boost PP number range of 0-256 + if input = %44, does not meet the constraint therefore undefined behavior + if input = 44.0, does not meet the constraint therefore undefined behavior + if input = ( 44 ), 0 since the macro begins with a tuple and this can be tested for + +[heading Usage] + +To use the BOOST_VMD_IS_NUMBER macro either include the general header: + + #include + +or include the specific header: + + #include + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_pp_data_types.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_pp_data_types.qbk new file mode 100644 index 0000000000000000000000000000000000000000..c5d15d1c95dfe8aad25c125f1f71892a6032c646 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_pp_data_types.qbk @@ -0,0 +1,285 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_pp_data_types VMD and Boost PP data types] + +VMD is able to determine whether or not preprocessing input +is a given Boost PP data type. The VMD macros to do this are: + +* BOOST_VMD_IS_ARRAY for an array +* BOOST_VMD_IS_LIST for a list +* BOOST_VMD_IS_SEQ for a seq +* BOOST_VMD_IS_TUPLE for a tuple + +Each of these macros take a single parameter as input and +return 1 if the parameter is the appropriate data type and +0 if it is not. + +[heading Syntax anomalies] + +Both an array and a non-empty list are also a tuple. So if +one has: + + #define ANARRAY (3,(a,b,c)) + #define ALIST (a,(b,(c,BOOST_PP_NIL))) + #define ATUPLE (a,b,c) + #define ASEQ (a)(b)(c) + +then + + #include + + BOOST_VMD_IS_TUPLE(ANARRAY) returns 1 + BOOST_VMD_IS_TUPLE(ALIST) returns 1 + BOOST_VMD_IS_TUPLE(ATUPLE) returns 1 + BOOST_VMD_IS_TUPLE(ASEQ) returns 0 + +A list whose first element is the number 2 and whose second +element is not the end-of-list marker BOOST_PP_NIL is also +an array. So if one has: + + #define ALIST (2,(3,BOOST_PP_NIL)) + #define ALIST2 (2,(3,(4,BOOST_PP_NIL))) + #define ALIST3 (2,BOOST_PP_NIL) + + #include + #include + + BOOST_VMD_IS_LIST(ALIST) returns 1 + BOOST_VMD_IS_LIST(ALIST2) returns 1 + BOOST_VMD_IS_LIST(ALIST3) returns 1 + BOOST_VMD_IS_ARRAY(ALIST) returns 1 + BOOST_VMD_IS_ARRAY(ALIST2) returns 1 + BOOST_VMD_IS_ARRAY(ALIST3) returns 0 + +A single element tuple is also a one element seq. So if one has: + + #define ASE_TUPLE (a) + +then + + #include + #include + + BOOST_VMD_IS_TUPLE(ASE_TUPLE) returns 1 + BOOST_VMD_IS_SEQ(ASE_TUPLE) returns 1 + +[heading Problem when testing an array] + +The form of an array is a two element tuple, where the first +element is a number and the second element is a tuple. The number +specifies the size of the tuple. Since when using variadic macros +it is never necessary to specify the size of a tuple, an array is +largely obsolete. However VMD still supports it. + +The problem when testing for an array is that if the first element +does not obey the constraint on testing for a number, you will get +UB. + + #include + #include + + #define A_TUPLE (&anything,(1,2)) + + BOOST_VMD_IS_ARRAY(A_TUPLE) will give UB due to the constraint + BOOST_VMD_IS_TUPLE(A_TUPLE) will return 1 + +When VMD attempts to parse for an array, as it does when the BOOST_VMD_IS_ARRAY +is used, if first looks to see if the syntax represents a tuple with two elements. +Next it looks to see if the second element itself is a tuple. Finally if it is +satisfied that the previous checks are valid it tests whether the first element +is a number or not. It is in this final test, that the first element is a valid +number, where the UB could occur as explained in the topic 'Numbers'. + +[heading Problem when testing a list] + +The form of a non-empty list is a two element tuple, where the first +element is the head of the list and can be anything and the +second element is itself a list or the end-of-list identifier +BOOST_PP_NIL. + +The problem when testing for a list is that if the second element +does not obey the constraint on testing for an identifier, since BOOST_PP_NIL +is an identifier and is tested as such, you will get UB. + + #include + #include + + #define A_TUPLE (element,&anything) + + BOOST_VMD_IS_LIST(A_TUPLE) will give UB due to the constraint + BOOST_VMD_IS_TUPLE(A_TUPLE) will return 1 + +The form of an empty list is the identifier BOOST_PP_NIL. Therefore: + + #include + #include + + #define A_BAD_EMPTY_LIST &BOOST_PP_NIL + + BOOST_VMD_IS_LIST(A_BAD_EMPTY_LIST) will give UB due to the constraint + BOOST_VMD_IS_IDENTIFIER(A_BAD_EMPTY_LIST) will give UB due to the constraint + +When VMD attempts to parse for a list, as it does when the BOOST_VMD_IS_LIST +is used, if first looks to see if the syntax represents a tuple with two elements. +If it is not a tuple with two elements it will check for the end-of-list. +If it is a tuple with two elements it looks to see if the second element is a list. +In both these paths it must always eventually check for the end-of-list notation +BOOST_PP_NIL, which is an identifier in VMD. It is in this final test, that the +end-of-list notation exists as a VMD identifier, where the UB +could occur as explained in the topic 'Identifiers'. + +[heading Distinguishing a seq and a tuple] + +As has previously been mentioned a single element tuple +is also a one element seq. + +However, as will be discussed later in the documentation, when VMD has to +determine the type of such data, it always returns it as a tuple ( BOOST_VMD_TYPE_TUPLE ). + +If our data consists of more than one consecutive tuple of a single +element the data is a seq: + + #include + #include + + #define ST_DATA (somedata)(some_other_data) + + BOOST_VMD_IS_SEQ(ST_DATA) will return 1 + BOOST_VMD_IS_TUPLE(ST_DATA) will return 0 + +However if the data consists of a mixture we need to distinguish +how VMD parses the data. The rule is that VMD always parses a single +element tuple as a tuple unless it is followed by one or more single +element tuples, in which case it is a seq. + + #define ST_DATA (somedata)(element1,element2) + +VMD parses the above data as 2 consecutive tuples. +The first tuple is the single element tuple '(somedata)' and the second tuple +is the multi element tuple '(element1,element2)'. + + #define ST_DATA (element1,element2)(somedata) + +VMD parses the above data as 2 consecutive tuples. +The first tuple is the multi element tuple '(element1,element2)' and the second tuple +is the single element tuple '(somedata)'. + + #define ST_DATA (somedata)(some_other_data)(element1,element2) + +VMD parses the above data as a seq followed by a tuple. +The seq is '(somedata)(some_other_data)' and the tuple is +'(element1,element2)'. + +[heading Empty Boost PP data types] + +An array and a list can be empty. + +An empty array has the form '(0,())', and is a perfectly valid array. + +You can test for an empty array using the macro BOOST_VMD_IS_EMPTY_ARRAY. + + #include + #include + + #define AN_ARRAY (1,(1)) + #define AN_EMPTY_ARRAY (0,()) + + BOOST_VMD_IS_ARRAY(AN_ARRAY) will return 1 + BOOST_VMD_IS_ARRAY(AN_EMPTY_ARRAY) will return 1 + + BOOST_VMD_IS_EMPTY_ARRAY(AN_EMPTY_ARRAY) will return 1 + BOOST_VMD_IS_EMPTY_ARRAY() will return 0 + BOOST_VMD_IS_EMPTY_ARRAY(AN_ARRAY) will return 0 + +An empty list has the form 'BOOST_PP_NIL', and is a perfectly valid list. + +You can test for an empty list using the macro BOOST_VMD_IS_EMPTY_LIST. + + #include + #include + + #define A_LIST (1,BOOST_PP_NIL) + #define AN_EMPTY_LIST BOOST_PP_NIL + + BOOST_VMD_IS_LIST(A_LIST) will return 1 + BOOST_VMD_IS_LIST(AN_EMPTY_LIST) will return 1 + + BOOST_VMD_IS_EMPTY_LIST(AN_EMPTY_LIST) will return 1 + BOOST_VMD_IS_EMPTY_LIST() will return 0 + BOOST_VMD_IS_EMPTY_LIST(A_LIST) will return 0 + +Neither seqs or tuples can be empty when using Boost PP. Because of this if you +convert from an empty array or list to a seq or tuple using +Boost PP macros to do so you will get undefined behavior. + +The syntax '()', which is called an empty parenthesis, is neither a +zero-element seq or a tuple consisting of no elements. Rather it is +either a one-element seq whose content is emptiness or a single-element +tuple whose content is emptiness. + +VMD supports the syntax of an empty parenthesis. You can test for it using +the macro BOOST_VMD_IS_PARENS_EMPTY. + + #include + #include + #include + + #define EMPTY_PARENS () + #define TUPLE (0) + #define SEQ (0)(1) + + BOOST_VMD_IS_TUPLE(EMPTY_PARENS) will return 1 + BOOST_VMD_IS_SEQ(EMPTY_PARENS) will return 1 + + BOOST_VMD_IS_PARENS_EMPTY(EMPTY_PARENS) will return 1 + BOOST_VMD_IS_PARENS_EMPTY() will return 0 + BOOST_VMD_IS_PARENS_EMPTY(TUPLE) will return 0 + BOOST_VMD_IS_PARENS_EMPTY(SEQ) will return 0 + +The VC++8 compiler ( Visual Studio 2005 ), which is the oldest +VC++ version which VMD supports, has trouble working with the empty +parenthesis syntax. Therefore if you have to use VC++8 avoid its use, +otherwise you should be fine using it if you desire. + +[heading Using a tuple instead of an array] + +When using variadic macros, the fact that an array can be empty is its only +advantage over a tuple. Otherwise using a tuple is always easier since +the syntax is simpler; you never have to notate the tuple's size. + +Since VMD fully supports passing and returning emptiness you could use a tuple +instead of an array in all situations and simply pass or return emptiness to +represent an "empty" tuple, and as an equivalent to an empty array. + +This notion of using emptiness to represent an "empty" tuple can also be extended +to using emptiness to represent an "empty" seq. However functionality in Boost PP +will not recognize emptiness as an empty tuple or seq, nor can you work with emptiness +to represent an empty tuple or empty seq using the Boost PP functionality for a tuple +or a seq. For a solution to using emptiness to represent an "empty" tuple or an +"empty" seq VMD has functionality which will be explained when we look at our last +area of functionality in VMD, useful variadic macros not in Boost PP. + +[heading Usage] + +You can use the general header file: + + #include + +or you can use individual header files for each of these macros. +The individual header files are: + + #include // for the BOOST_VMD_IS_ARRAY macro + #include // for the BOOST_VMD_IS_LIST macro + #include // for the BOOST_VMD_IS_SEQ macro + #include // for the BOOST_VMD_IS_TUPLE macro. + + #include // for the BOOST_VMD_IS_EMPTY_ARRAY macro. + #include // for the BOOST_VMD_IS_EMPTY_LIST macro. + #include // for the BOOST_VMD_IS_PARENS_EMPTY macro. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_reentrant.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_reentrant.qbk new file mode 100644 index 0000000000000000000000000000000000000000..3babeef814a1e33ba48ca624892d819ab5695420 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_reentrant.qbk @@ -0,0 +1,66 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_reentrant Boost PP re-entrant versions] + +Nearly all macros in VMD have equivalent reentrant versions which are +meant to be used in a BOOST_PP_WHILE loop. These are versions which have +an underscore D suffix, take the next available BOOST_PP_WHILE iteration +as their first parameter, and then have the exact same functionality as +their unsuffixed equivalents. They can be used in BOOST_PP_WHILE loops +to provide slightly quicker preprocessing but, as the documentation for +BOOST_PP_WHILE and BOOST_PP_WHILE_##d explain, they do not have to be used. + +These macros are: + +Arrays + +* BOOST_VMD_IS_ARRAY_D +* BOOST_VMD_IS_EMPTY_ARRAY_D +* BOOST_VMD_ASSERT_IS_ARRAY_D + +Identifiers + +* BOOST_VMD_IS_IDENTIFIER_D +* BOOST_VMD_ASSERT_IS_IDENTIFIER_D + +Lists + +* BOOST_VMD_IS_LIST_D +* BOOST_VMD_IS_EMPTY_LIST_D +* BOOST_VMD_ASSERT_IS_LIST_D + +Sequences + +* BOOST_VMD_ELEM_D +* BOOST_VMD_ENUM_D +* BOOST_VMD_EQUAL_D +* BOOST_VMD_GET_TYPE_D +* BOOST_VMD_IS_MULTI_D +* BOOST_VMD_IS_UNARY_D +* BOOST_VMD_NOT_EQUAL_D +* BOOST_VMD_SIZE_D +* BOOST_VMD_TO_ARRAY_D +* BOOST_VMD_TO_LIST_D +* BOOST_VMD_TO_SEQ_D +* BOOST_VMD_TO_TUPLE_D + +Seqs + +* BOOST_VMD_IS_SEQ_D +* BOOST_VMD_ASSERT_IS_SEQ_D + +Types + +* BOOST_VMD_IS_TYPE_D +* BOOST_VMD_ASSERT_IS_TYPE_D + +Other + +* BOOST_VMD_IS_PARENS_EMPTY_D + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_reference.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_reference.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b216ff7034df094b61ad3bc807153b252fd6a5a0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_reference.qbk @@ -0,0 +1,8 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[xinclude vmd_reference.xml] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_reference.xml b/tools/boost_1_65_1/libs/vmd/doc/vmd_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..a0b4668ee8d8aedd86b3396701dff14355ae0efc --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_reference.xml @@ -0,0 +1,358 @@ + +Variadic Macro Data Reference
+converts an array to a seq. array = array to be converted.If the array is an array of 0 elements it is converted to an empty seq. Otherwise the array is converted to a seq with the same number of elements as the array. +
+
+converts a list to a seq. list = list to be converted.If the list is an empty list (BOOST_PP_NIL) it is converted to an empty seq. Otherwise the list is converted to a seq with the same number of elements as the list. +
+
+Converts a sequence to a Boost PP seq whose elements are the elements of the sequence. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP seq. If the sequence is empty the return is emptiness since an empty seq does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the seq element. Otherwise just the data is returned as the seq element, which is the default. +Converts a sequence to a Boost PP seq whose elements are the elements of the sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP seq. If the sequence is empty the return is emptiness since an empty seq does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the seq element. Otherwise just the data is returned as the seq element, which is the default. +
+
+converts a tuple to a seq. tuple = tuple to be converted.If the tuple is an empty tuple it is converted to an empty seq. Otherwise the tuple is converted to a seq with the same number of elements as the tuple. +
+
+converts an array to a tuple. array = array to be converted.If the array is an array of 0 elements it is converted to an empty tuple. Otherwise the array is converted to a tuple with the same number of elements as the array. +
+
+converts a list to a tuple. list = list to be converted.If the list is an empty list (BOOST_PP_NIL) it is converted to an empty tuple. Otherwise the list is converted to a tuple with the same number of elements as the list. +
+
+converts a seq to a tuple. seq = seq to be converted.If the seq is an empty seq it is converted to an empty tuple. Otherwise the seq is converted to a tuple with the same number of elements as the seq. +
+
+Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP tuple. If the sequence is empty the return is emptiness since an empty tuple does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the tuple element. Otherwise just the data is returned as the tuple element, which is the default. +Converts a sequence to a Boost PP tuple whose elements are the elements of the sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP tuple. If the sequence is empty the return is emptiness since an empty tuple does not exist. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the tuple element. Otherwise just the data is returned as the tuple element, which is the default. +
+
+Conditionally causes an error to be generated. ... = variadic parameters, maximum of 2 will be considered. Any variadic parameters beyond the maximum of 2 are just ignored.The first variadic parameter is:cond = A condition that determines whether an assertion occurs. Valid values range from 0 to BOOST_PP_LIMIT_MAG.The second variadic parameter (optional) is:errstr = An error string for generating a compiler error when using the VC++ compiler. The VC++ compiler is incapable of producing a preprocessor error so when the 'cond' is 0, a compiler error is generated by outputting C++ code in the form of:typedef char errstr[-1];The errstr defaults to BOOST_VMD_ASSERT_ERROR if not supplied. It is only relevant for VC++.returns = If cond expands to 0, this macro causes an error. Otherwise, it expands to nothing. For all compilers other than Visual C++ the error is a preprocessing error. For Visual C++ the error is caused by output invalid C++: this error could be masked if the invalid output is ignored by a macro which invokes this macro. +
+
+Asserts that the sequence is a Boost PP array. The macro checks that the sequence is a Boost PP array. If it is not a Boost PP array, it forces a compiler error.The macro normally checks for a Boost PP array only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.sequence = a possible Boost PP array.returns = Normally the macro returns nothing. If the sequence is a Boost PP array, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP array the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP array. +Asserts that the sequence is a Boost PP array. Re-entrant version. The macro checks that the sequence is a Boost PP array. If it is not a Boost PP array, it forces a compiler error.The macro normally checks for a Boost PP array only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP sequence.returns = Normally the macro returns nothing. If the sequence is a Boost PP array, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP array the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP array. +
+
+Asserts that the input is empty. The macro checks to see if the input is empty or not. If it is not empty, it forces a compiler error.The macro is a variadic macro taking any input. For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check and not variadic data.The macro normally checks for emptiness only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively..... = variadic input, for VC++8 this must be a single parameter.returns = Normally the macro returns nothing. If the input is empty, nothing is output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the input is not empty the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the input is not empty. +It is recommended to append BOOST_PP_EMPTY() to whatever input is being tested in order to avoid possible warning messages from some compilers about no parameters being passed to the macro when the input is truly empty. +
+
+Asserts that the sequence is an identifier. The macro checks that the sequence is an identifier. If it is not an identifier, it forces a compiler error.The macro normally checks for an identifier only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.... = variadic parametersThe variadic parameters are:sequence = A sequence to test as an identifier. ids (optional) = The data may take one of two forms: it is either one or more single identifiers or a single Boost PP tuple of identifiers.returns = Normally the macro returns nothing. If the sequence is an identifier, nothing is + output. If optional ids are specified, for the + sequence to be an identifier it must be an + identifier that matches one of the optional + ids. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not an identifier the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not an + identifier. +Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +The identifier must be registered to be found.Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +If you specify optional ids and have not specified the detection of an optional id, that id will never match an identifier. +Asserts that the sequence is an identifier. Re-entrant version. The macro checks that the sequence is an identifier. If it is not an identifier, it forces a compiler error.The macro normally checks for an identifier only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.d = The next available BOOST_PP_WHILE iteration. ... = variadic parametersThe variadic parameters are:sequence = A sequence to test as an identifier. ids (optional) = The data may take one of two forms: it is either one or more single identifiers or a single Boost PP tuple of identifiers.returns = Normally the macro returns nothing. If the sequence is an identifier, nothing is + output. If optional ids are specified, for the + sequence to be an identifier it must be an + identifier that matches one of the optional + ids. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not an identifier the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not an + identifier. +Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +The identifier must be registered to be found.Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +If you specify optional ids and have not specified the detection of an optional id, that id will never match an identifier. +
+
+Asserts that the sequence is a Boost PP list. The macro checks that the sequence is a Boost PP list. If it is not a Boost PP list, it forces a compiler error.The macro normally checks for a Boost PP list only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.sequence = a possible Boost PP list.returns = Normally the macro returns nothing. If the sequence is a Boost PP list, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP list the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the parameter is not a + Boost PP list. +Asserts that the sequence is a Boost PP list. Re-entrant version. The macro checks that the sequence is a Boost PP list. If it is not a Boost PP list, it forces a compiler error.The macro normally checks for a Boost PP list only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP list.returns = Normally the macro returns nothing. If the sequence is a Boost PP list, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP list the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the parameter is not a + Boost PP list. +
+
+Asserts that the sequence is a number. The macro checks that the parameter is a number. If it is not a number, it forces a compiler error.The macro normally checks for a number only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.sequence = a possible number.returns = Normally the macro returns nothing. If the sequence is a number, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a number the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + number. +
+
+Asserts that the sequence is a Boost PP seq. The macro checks that the sequence is a Boost PP seq. If it is not a Boost PP seq, it forces a compiler error.The macro normally checks for a Boost PP seq only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.sequence = a possible Boost PP seq.returns = Normally the macro returns nothing. If the sequence is a Boost PP seq, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP seq the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP seq. +Asserts that the sequence is a Boost PP seq. Re-entrant version. The macro checks that the sequence is a Boost PP seq. If it is not a Boost PP seq, it forces a compiler error.The macro normally checks for a Boost PP seq only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP seq.returns = Normally the macro returns nothing. If the sequence is a Boost PP seq, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP seq the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP seq. +
+
+Asserts that the sequence is a Boost PP tuple. The macro checks that the sequence is a Boost PP tuple. If it is not a Boost PP tuple, it forces a compiler error.The macro normally checks for a Boost PP tuple only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.sequence = a possible Boost PP tuple.returns = Normally the macro returns nothing. If the sequence is a Boost PP tuple, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a Boost PP tuple the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + Boost PP tuple. +
+
+Asserts that the sequence is a VMD type. The macro checks that the sequence is a VMD type. If it is not a VMD type, it forces a compiler error.The macro normally checks for a VMD type only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.sequence = a possible VMD type.returns = Normally the macro returns nothing. If the sequence is a VMD type, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a VMD type the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + VMD type. +Asserts that the sequence is a VMD type. Re-entrant version. The macro checks that the sequence is a VMD type. If it is not a VMD type, it forces a compiler error.The macro normally checks for a VMD type only in debug mode. However an end-user can force the macro to check or not check by defining the macro BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.d = The next available BOOST_PP_WHILE iteration. sequence = a possible VMD type.returns = Normally the macro returns nothing. If the sequence is a VMD type, nothing is + output. + + For VC++, because there is no sure way of forcing + a compiler error from within a macro without producing + output, if the sequence is not a VMD type the + macro forces a compiler error by outputting invalid C++. + + For all other compilers a compiler error is forced + without producing output if the sequence is not a + VMD type. +
+
+Accesses an element of a sequence. elem = A sequence element number. From 0 to sequence size - 1. ... = Variadic parameters.The first variadic parameter is required and is the sequence to access. Further variadic parameters are all optional.With no further variadic parameters the macro returns the particular element in the sequence. If the element number is outside the bounds of the sequence macro access fails and the macro turns emptiness.Optional parameters determine what it means that an element is successfully accessed as well as what data is returned by the macro.Filters: specifying a VMD type tells the macro to return the element only if it is of the VMD type specified, else macro access fails. If more than one VMD type is specified as an optional parameter the last one specified is the filter.Matching Identifiers: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, optional parameters which are identifiers specify that the element accessed must match one of the identifiers else access fails. The identifiers may be specified multiple times as single optional parameters or once as a tuple of identifier parameters. If the identifiers are specified as single optional parameters they cannot be any of the specific BOOST_VMD_ optional parameters in order to be recognized as matching identifiers. Normally this should never be the case. The only situation where this could occur is if the VMD types, which are filters, are used as matching identifiers; in this case the matching identifiers need to be passed as a tuple of identifier parameters so they are not treated as filters.Filters and matching identifiers change what it means that an element is successfully accessed. They do not change what data is returned by the macro. The remaining optional parameters do not change what it means that an element is successfully accessed but they do change what data is returned by the macro.Splitting: Splitting allows the macro to return the rest of the sequence after the element accessed.If BOOST_VMD_RETURN_AFTER is specified the return is a tuple with the element accessed as the first tuple parameter and the rest of the sequence as the second tuple parameter. If element access fails both tuple parameters are empty.If BOOST_VMD_RETURN_ONLY_AFTER is specified the return is the rest of the sequence after the element accessed found. If the element access fails the return is emptiness.If BOOST_VMD_RETURN_NO_AFTER, the default, is specified no splitting occurs.If more than one of the splitting identifiers are specified the last one specified determines the splitting.Return Type: The element accessed can be changed to return both the type of the element as well as the element data with optional return type parameters. When a type is returned, the element accessed which is returned becomes a two-element tuple where the type of the element accessed is the first tuple element and the element data itself is the second tuple element. If the macro fails to access the element the element access returned is emptiness and not a tuple.If BOOST_VMD_RETURN_NO_TYPE, the default, is specified no type is returned as part of the element accessed.If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple.If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data.If more than one return type optional parameter is specified the last one specified determines the return type.If a filter is specified optional return type parameters are ignored and the default BOOST_VMD_RETURN_NO_TYPE is in effect.Index: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, and matching identifiers are specified, an index parameter specifies that the numeric index, starting with 0, of the matching identifier found, be returned as part of the result.If BOOST_VMD_RETURN_INDEX is specified an index is returned as part of the result.If BOOST_VMD_RETURN_NO_INDEX, the default, is specified no index is returned as part of the result.If both are specified the last one specified determines the index parameter.When an index is returned as part of the result, the result is a tuple where the element accessed is the first tuple parameter and the index is the last tuple parameter. If element access fails the index is empty. If there is no BOOST_VMD_TYPE_IDENTIFIER filter or if there are no matching identifiers the BOOST_VMD_RETURN_INDEX is ignored and no index is returned as part of the result.returns = With no optional parameters the element accessed is returned, or emptiness if element is outside the bounds of the sequence. Filters and matching identifiers can change the meaning of whether the element accessed is returned or failure occurs, but whenever failure occurs emptiness is returned as the element access part of that failure, else the element accessed is returned. Return type optional parameters, when filters are not used, return the element accessed as a two-element tuple where the first tuple element is the type and the second tuple element is the data; if the element is not accessed then emptiness is returned as the element access and not a tuple. Splitting with BOOST_VMD_RETURN_AFTER returns a tuple where the element accessed is the first tuple element and the rest of the sequence is the second tuple element. Splitting with BOOST_VMD_RETURN_ONLY_AFTER returns the rest of the sequence after the element accessed or emptiness if the element can not be accessed. Indexing returns the index as part of the output only if filtering with BOOST_VMD_TYPE_IDENTIFIER is specified and matching identifiers are specified. When the index is returned with BOOST_VMD_RETURN_AFTER it is the third element of the tuple returned, else it is the second element of a tuple where the element accessed is the first element of the tuple. +Accesses an element of a sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. elem = A sequence element number. From 0 to sequence size - 1. ... = Variadic parameters.The first variadic parameter is required and is the sequence to access. Further variadic parameters are all optional.With no further variadic parameters the macro returns the particular element in the sequence. If the element number is outside the bounds of the sequence macro access fails and the macro turns emptiness.Optional parameters determine what it means that an element is successfully accessed as well as what data is returned by the macro.Filters: specifying a VMD type tells the macro to return the element only if it is of the VMD type specified, else macro access fails. If more than one VMD type is specified as an optional parameter the last one specified is the filter.Matching Identifiers: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, optional parameters which are identifiers specify that the element accessed must match one of the identifiers else access fails. The identifiers may be specified multiple times as single optional parameters or once as a tuple of identifier parameters. If the identifiers are specified as single optional parameters they cannot be any of the specific BOOST_VMD_ optional parameters in order to be recognized as matching identifiers. Normally this should never be the case. The only situation where this could occur is if the VMD types, which are filters, are used as matching identifiers; in this case the matching identifiers need to be passed as a tuple of identifier parameters so they are not treated as filters.Filters and matching identifiers change what it means that an element is successfully accessed. They do not change what data is returned by the macro. The remaining optional parameters do not change what it means that an element is successfully accessed but they do change what data is returned by the macro.Splitting: Splitting allows the macro to return the rest of the sequence after the element accessed.If BOOST_VMD_RETURN_AFTER is specified the return is a tuple with the element accessed as the first tuple parameter and the rest of the sequence as the second tuple parameter. If element access fails both tuple parameters are empty.If BOOST_VMD_RETURN_ONLY_AFTER is specified the return is the rest of the sequence after the element accessed found. If the element access fails the return is emptiness.If BOOST_VMD_RETURN_NO_AFTER, the default, is specified no splitting occurs.If more than one of the splitting identifiers are specified the last one specified determines the splitting.Return Type: The element accessed can be changed to return both the type of the element as well as the element data with optional return type parameters. When a type is returned, the element accessed which is returned becomes a two-element tuple where the type of the element accessed is the first tuple element and the element data itself is the second tuple element. If the macro fails to access the element the element access returned is emptiness and not a tuple.If BOOST_VMD_RETURN_NO_TYPE, the default, is specified no type is returned as part of the element accessed.If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple.If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.If a filter is specified optional return type parameters are ignored and the default BOOST_VMD_RETURN_NO_TYPE is in effect.Index: If the filter is specified as the identifier type, BOOST_VMD_TYPE_IDENTIFIER, and matching identifiers are specified, an index parameter specifies that the numeric index, starting with 0, of the matching identifier found, be returned as part of the result.If BOOST_VMD_RETURN_INDEX is specified an index is returned as part of the result.If BOOST_VMD_RETURN_NO_INDEX, the default, is specified no index is returned as part of the result.If both are specified the last one specified determines the index parameter.When an index is returned as part of the result, the result is a tuple where the element accessed is the first tuple parameter and the index is the last tuple parameter. If element access fails the index is empty. If there is no BOOST_VMD_TYPE_IDENTIFIER filter or if there are no matching identifiers the BOOST_VMD_RETURN_INDEX is ignored and no index is returned as part of the result.returns = With no optional parameters the element accessed is returned, or emptiness if element is outside the bounds of the sequence. Filters and matching identifiers can change the meaning of whether the element accessed is returned or failure occurs, but whenever failure occurs emptiness is returned as the element access part of that failure, else the element accessed is returned. Return type optional parameters, when filters are not used, return the element accessed as a two-element tuple where the first tuple element is the type and the second tuple element is the data; if the element is not accessed then emptiness is returned as the element access and not a tuple. Splitting with BOOST_VMD_RETURN_AFTER returns a tuple where the element accessed is the first tuple element and the rest of the sequence is the second tuple element. Splitting with BOOST_VMD_RETURN_ONLY_AFTER returns the rest of the sequence after the element accessed or emptiness if the element can not be accessed. Indexing returns the index as part of the output only if filtering with BOOST_VMD_TYPE_IDENTIFIER is specified and matching identifiers are specified. When the index is returned with BOOST_VMD_RETURN_AFTER it is the third element of the tuple returned, else it is the second element of a tuple where the element accessed is the first element of the tuple. +
+
+Outputs emptiness. ... = any variadic parameters. The parameters are ignored.This macro is used to output emptiness ( nothing ) no matter what is passed to it.If you use this macro to return a result, as in 'result BOOST_VMD_EMPTY' subsequently invoked, you should surround the result with BOOST_VMD_IDENTITY_RESULT to smooth over a VC++ problem. +
+
+Converts a sequence to comma-separated elements which are the elements of the sequence. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = Comma-separated data, otherwise known as variadic data. If the sequence is empty the variadic data is empty. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as part of the variadic data. Otherwise just the data of each element is returned, which is the default. +Converts a sequence to comma-separated elements which are the elements of the sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = Comma-separated data, otherwise known as variadic data. If the sequence is empty the variadic data is empty. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as part of the variadic data. Otherwise just the data of each element is returned, which is the default. +
+
+Tests any two sequences for equality. sequence = First sequence. ... = variadic parameters, maximum of 2.The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.The macro tests any two sequences for equality. For sequences to be equal the VMD types of each sequence must be equal and the individual elements of the sequence must be equal. For Boost PP composite types the macro tests that the composite types have the same size and then tests that each element of the composite type is equal. This means that all elements of a composite type must be a VMD type in order to use this macro successfully.The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to succeed.returns = 1 upon success or 0 upon failure. Success means that both sequences are equal and, if the optional parameter is specified, that the sequences are of the optional VMD type. +Tests any two sequences for equality. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. sequence = First sequence. ... = variadic parameters, maximum of 2.The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.The macro tests any two sequences for equality. For sequences to be equal the VMD types of each sequence must be equal and the individual elements of the sequence must be equal. For Boost PP composite types the macro tests that the composite types have the same size and then tests that each element of the composite type is equal. This means that all elements of a composite type must be a VMD type in order to use this macro successfully.The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to succeed.returns = 1 upon success or 0 upon failure. Success means that both sequences are equal and, if the optional parameter is specified, that the sequences are of the optional VMD type. +
+
+Returns the type of a sequence as a VMD type. ... = variadic parameters.The first variadic parameter is required and is the sequence whose type we are getting.The optional variadic parameters are return type parameters.The macro returns the type of a sequence as a VMD type. The type of an empty sequence is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the type of that single element.The type returned can be modified by specifying an optional return type parameter.If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element is returned.If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro always returns the type of the sequence.If more than one return type optional parameter is specified the last one specified determines the return type.returns = the type of the sequence as a VMD type. +Returns the type of a sequence as a VMD type. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = variadic parameters.The first variadic parameter is required and is the sequence whose type we are getting.The optional variadic parameters are return type parameters.The macro returns the type of a sequence as a VMD type. The type of an empty sequence is always BOOST_VMD_TYPE_EMPTY and the type of a multi-element is always BOOST_VMD_TYPE_SEQUENCE. The type of a single-element sequence is the type of that single element.The type returned can be modified by specifying an optional return type parameter.If BOOST_VMD_RETURN_TYPE, the default, is specified the specific type of the element is returned.If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data.If BOOST_VMD_RETURN_NO_TYPE is specified it is ignored since the macro always returns the type of the sequence.If more than one return type optional parameter is specified the last one specified determines the return type.returns = the type of the sequence as a VMD type. +
+
+Macro which expands to its argument when invoked with any number of parameters. item = any single argumentWhen BOOST_VMD_IDENTITY(item) is subsequently invoked with any number of parameters it expands to 'item'. Subsequently invoking the macro is done as 'BOOST_VMD_IDENTITY(item)(zero_or_more_arguments)'.The macro is equivalent to the Boost PP macro BOOST_PP_IDENTITY(item) with the difference being that BOOST_PP_IDENTITY(item) is always invoked with no arguments, as in 'BOOST_VMD_IDENTITY(item)()' whereas BOOST_VMD_IDENTITY can be invoked with any number of arguments.The macro is meant to be used in BOOST_PP_IF and BOOST_PP_IIF statements when only one of the clauses needs to be invoked with calling another macro and the other is meant to return an 'item'.returns = the macro as 'BOOST_VMD_IDENTITY(item)', when invoked with any number of parameters as in '(zero_or_more_arguments)', returns 'item'. The macro itself returns 'item BOOST_VMD_EMPTY'. +Macro which wraps any result which can return its value using BOOST_VMD_IDENTITY or 'item BOOST_VMD_EMPTY'. result = any single result returned when BOOST_VMD_IDENTITY is used or 'item BOOST_VMD_EMPTY'.The reason for this macro is to smooth over a problem when using VC++ with BOOST_VMD_IDENTITY. If your BOOST_VMD_IDENTITY macro can be used where VC++ is the compiler then you need to surround your macro code which could return a result with this macro in order that VC++ handles BOOST_VMD_IDENTITY correctly.If you are not using VC++ you do not have to use this macro, but doing so does no harm. +
+
+Determines if a sequence is a Boost PP array. The macro checks that the sequence is a Boost PP array. It returns 1 if it is an array, else if returns 0.sequence = a possible Boost PP array.returns = 1 if it is an array, else returns 0.The macro will generate a preprocessing error if the input is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&2,(0,1))' which is a valid tuple but an invalid array. +Determines if a sequence is a Boost PP array. Re-entrant version. The macro checks that the sequence is a Boost PP array. It returns 1 if it is an array, else if returns 0.d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP array.returns = 1 if it is an array, else returns 0.The macro will generate a preprocessing error if the input is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&2,(0,1))' which is a valid tuple but an invalid array. +
+
+Tests whether its input is empty or not. The macro checks to see if the input is empty or not. It returns 1 if the input is empty, else returns 0.The macro is a variadic macro taking any input. For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check.The macro is not perfect, and can not be so. The problem area is if the input to be checked is a function-like macro name, in which case either a compiler error can result or a false result can occur.This macro is a replacement, using variadic macro support, for the undocumented macro BOOST_PP_IS_EMPTY in the Boost PP library. The code is taken from a posting by Paul Mensonides of a variadic version for BOOST_PP_IS_EMPTY, and changed in order to also support VC++..... = variadic input, for VC++8 this must be a single parameterreturns = 1 if the input is empty, 0 if it is notIt is recommended to append BOOST_PP_EMPTY() to whatever input is being tested in order to avoid possible warning messages from some compilers about no parameters being passed to the macro when the input is truly empty. +
+
+Tests whether a sequence is an empty Boost PP array. An empty Boost PP array is a two element tuple where the first size element is 0 and the second element is a tuple with a single empty element, ie. '(0,())'.sequence = a possible empty arrayreturns = 1 if the sequence is an empty Boost PP array 0 if it is not.The macro will generate a preprocessing error if the sequence is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&0,())' which is a valid tuple but an invalid array. +Tests whether a sequence is an empty Boost PP array. Re-entrant version. An empty Boost PP array is a two element tuple where the first size element is 0 and the second element is a tuple with a single empty element, ie. '(0,())'.d = The next available BOOST_PP_WHILE iteration. sequence = a possible empty arrayreturns = 1 if the sequence is an empty Boost PP array 0 if it is not.The macro will generate a preprocessing error if the sequence is in the form of an array but its first tuple element, instead of being a number, is a preprocessor token which VMD cannot parse, as in the example '(&0,())' which is a valid tuple but an invalid array. +
+
+Tests whether a sequence is an empty Boost PP list. An empty Boost PP list consists of the single identifier 'BOOST_PP_NIL'. This identifier also serves as a list terminator for a non-empty list.sequence = a preprocessor parameterreturns = 1 if the sequence is an empty Boost PP list 0 if it is not.The macro will generate a preprocessing error if the input as an empty list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '&BOOST_PP_NIL'. +Tests whether a sequence is an empty Boost PP list. Re-entrant version. An empty Boost PP list consists of the single identifier 'BOOST_PP_NIL'. This identifier also serves as a list terminator for a non-empty list.d = The next available BOOST_PP_WHILE iteration sequence = a preprocessor parameterreturns = 1 if the sequence is an empty Boost PP list 0 if it is not.The macro will generate a preprocessing error if the input as an empty list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '&BOOST_PP_NIL'. +
+
+Tests whether a parameter is an identifier. ... = variadic parametersThe first variadic parameter is required and it is the input to test.Further variadic parameters are optional and are identifiers to match. The data may take one of two forms; it is either one or more single identifiers or a single Boost PP tuple of identifiers.returns = 1 if the parameter is an identifier, otherwise 0. If the parameter is not an identifier, + or if optional identifiers are specified and the identifier + does not match any of the optional identifiers, the macro returns 0. +Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +The identifier must be registered to be found.Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +If you specify optional identifiers and have not specified the detection of an optional identifier, that optional identifier will never match the input.If the input is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the input is an identifier once it is determined that the input does not start with parenthesis. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error. +Tests whether a parameter is an identifier. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = variadic parametersThe first variadic parameter is required and it is the input to test.Further variadic parameters are optional and are identifiers to match. The data may take one of two forms; it is either one or more single identifiers or a single Boost PP tuple of identifiers.returns = 1 if the parameter is an identifier, otherwise 0. If the parameter is not an identifier, + or if optional identifiers are specified and the identifier + does not match any of the optional identifiers, the macro returns 0. +Identifiers are registered in VMD with: #define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier. +The identifier must be registered to be found.Identifiers are pre-detected in VMD with: #define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier. +If you specify optional identifiers and have not specified the detection of an optional identifier, that optional identifier will never match the input.If the input is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the input is an identifier once it is determined that the input does not start with parenthesis. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error. +
+
+Determines if a sequence is a Boost pplib list. The macro checks that the sequence is a pplib list. It returns 1 if it is a list, else if returns 0.sequence = input as a possible Boost PP list.returns = 1 if it a list, else returns 0.The macro will generate a preprocessing error if the input is in the form of a list but its end-of-list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but an invalid list. +Determines if a sequence is a Boost pplib list. Re-entrant version. The macro checks that the sequence is a pplib list. It returns 1 if it is a list, else if returns 0.d = The next available BOOST_PP_WHILE iteration. sequence = input as a possible Boost PP list.returns = 1 if it a list, else returns 0.The macro will generate a preprocessing error if the input is in the form of a list but its end-of-list marker, instead of being an identifier, is a preprocessor token which VMD cannot parse, as in the example '(anything,&BOOST_PP_NIL)' which is a valid tuple but an invalid list. +
+
+Determines if the sequence has more than one element, referred to as a multi-element sequence. sequence = a sequencereturns = 1 if the sequence is a multi-element sequence, else returns 0.If the size of a sequence is known it is faster comparing that size to be greater than one to find out if the sequence is multi-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is multi-element or not. +Determines if the sequence has more than one element, referred to as a multi-element sequence. d = The next available BOOST_PP_WHILE iteration. sequence = a sequencereturns = 1 if the sequence is a multi-element sequence, else returns 0.If the size of a sequence is known it is faster comparing that size to be greater than one to find out if the sequence is multi-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is multi-element or not. +
+
+Tests whether a sequence is a Boost PP number. The macro checks to see if a sequence is a Boost PP number. A Boost PP number is a value from 0 to 256.sequence = a possible numberreturns = 1 if the sequence is a Boost PP number, 0 if it is not.If the input is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the input is a number once it is determined that the input does not start with parenthesis. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error. +
+
+Determines if the sequence is a set of parens with no data. sequence = a VMD sequencereturns = 1 if the sequence is a set of parens with no data, else returns 0.A set of parens with no data may be:1) a tuple whose size is a single element which is empty or +2) a single element seq whose data is empty +Determines if the sequence is a set of parens with no data. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. sequence = a VMD sequencereturns = 1 if the sequence is a set of parens with no data, else returns 0.A set of parens with no data may be:1) a tuple whose size is a single element which is empty or +2) a single element seq whose data is empty +
+
+Determines if a sequence is a Boost PP seq. The macro checks that the sequence is a Boost PP seq. It returns 1 if it is a seq, else if returns 0.sequence = a possible Boost PP seqreturns = 1 if it a seq, else returns 0.A single set of parentheses, with a single element, is parsed as a tuple and not a seq. To be parsed as a seq the input needs to be more than one consecutive sets of parentheses, each with a single element of data. +Determines if a sequence is a Boost PP seq. Re-entrant version. The macro checks that the sequence is a Boost PP seq. It returns 1 if it is a seq, else if returns 0.d = The next available BOOST_PP_WHILE iteration. sequence = a possible Boost PP seqreturns = 1 if it a seq, else returns 0.A single set of parentheses, with a single element, is parsed as a tuple and not a seq. To be parsed as a seq the input needs to be more than one consecutive sets of parentheses, each with a single element of data. +
+
+Tests whether a sequence is a Boost PP tuple. The macro checks to see if a sequence is a Boost PP tuple. A Boost PP tuple is preprocessor tokens enclosed by a set of parentheses with no preprocessing tokens before or after the parentheses.sequence = a possible tuplereturns = 1 if the sequence is a Boost PP tuple. 0 if it is not. +
+
+Tests whether a sequence is a VMD type. sequence = a possible VMD typereturns = 1 if the sequence is a VMD type, 0 if it is not.If the sequence is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the sequence is an identifier once it is determined that the sequence does not start with parentheses. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error. +Tests whether a sequence is a VMD type. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. sequence = a possible VMD typereturns = 1 if the sequence is a VMD type, 0 if it is not.If the sequence is not a VMD data type this macro could lead to a preprocessor error. This is because the macro uses preprocessor concatenation to determine if the sequence is an identifier once it is determined that the sequence does not start with parentheses. If the data being concatenated would lead to an invalid preprocessor token the compiler can issue a preprocessor error. +
+
+Determines if the sequence has only a single element, referred to as a single-element sequence. sequence = a VMD sequencereturns = 1 if the sequence is a single-element sequence, else returns 0.If the size of a sequence is known it is faster comparing that size to be equal to one to find out if the sequence is single-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is single-element or not. +Determines if the sequence has only a single element, referred to as a single-element sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. sequence = a sequencereturns = 1 if the sequence is a single-element sequence, else returns 0.If the size of a sequence is known it is faster comparing that size to be equal to one to find out if the sequence is single-element. But if the size of the sequence is not known it is faster calling this macro than getting the size and doing the previously mentioned comparison in order to determine if the sequence is single-element or not. +
+
+Tests any two sequences for inequality. sequence = First sequence. ... = variadic parameters, maximum of 2.The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.The macro tests any two sequences for inequality. For sequences to be unequal either the VMD types of each sequence must be unequal or the individual elements of the sequence must be unequal.The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to fail, else it succeeds.returns = 1 upon success or 0 upon failure. Success means that the sequences are unequal or, if the optional parameter is specified, that the sequences are not of the optional VMD type; otherwise 0 is returned if the sequences are equal.The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL would return 0 the macro would return 1. +Tests any two sequences for inequality. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. sequence = First sequence. ... = variadic parameters, maximum of 2.The first variadic parameter is required and is the second sequence to test. The optional second variadic parameter is a VMD type as a filter.The macro tests any two sequences for inequality. For sequences to be unequal either the VMD types of each sequence must be unequal or the individual elements of the sequence must be unequal.The single optional parameter is a filter. The filter is a VMD type which specifies that both sequences to test must be of that VMD type, as well as being equal to each other, for the test to fail, else it succeeds.returns = 1 upon success or 0 upon failure. Success means that the sequences are unequal or, if the optional parameter is specified, that the sequences are not of the optional VMD type; otherwise 0 is returned if the sequences are equal.The macro is implemented as the complement of BOOST_VMD_EQUAL, so that whenever BOOST_VMD_EQUAL would return 1 the macro returns 0 and whenever BOOST_VMD_EQUAL would return 0 the macro would return 1. +
+
+Determines if a sequence is a VMD seq. The macro checks that the sequence is a VMD seq. A VMD seq, which may be a Boost PP seq or emptiness, is a superset of a Boost PP seq. It returns 1 if it is a VMD seq, else if returns 0.sequence = a possible Boost PP seqreturns = 1 if it a VMD seq, else returns 0. +
+
+pops an element from the end of a seq. seq = seq to pop an element from.If the seq is an empty seq the result is undefined. If the seq is a single element the result is an empty seq. Otherwise the result is a seq after removing the last element. +
+
+pops an element from the end of a tuple. tuple = tuple to pop an element from.If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the last element. +pops an element from the end of a tuple. It reenters BOOST_PP_REPEAT with maximum efficiency. z = the next available BOOST_PP_REPEAT dimension. tuple = tuple to pop an element from.If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the last element. +
+
+pops an element from the front of a seq. seq = seq to pop an element from.If the seq is an empty seq the result is undefined. If the seq is a single element the result is an empty seq. Otherwise the result is a seq after removing the first element. +
+
+pops an element from the front of a tuple. tuple = tuple to pop an element from.If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the first element. +pops an element from the front of a tuple. It reenters BOOST_PP_REPEAT with maximum efficiency. z = the next available BOOST_PP_REPEAT dimension. tuple = tuple to pop an element from.If the tuple is an empty tuple the result is undefined. If the tuple is a single element the result is an empty tuple. Otherwise the result is a tuple after removing the first element. +
+
+appends an element to the end of a seq. seq = seq to to append an element to. elem = element to append.If the seq is an empty seq the result is a seq with the single element. Otherwise the result is a seq after adding the element to the end. +
+
+appends an element to the end of a tuple. tuple = tuple to to append an element to. elem = element to append.If the tuple is an empty tuple the result is a tuple with the single element. Otherwise the result is a tuple after adding the element to the end. +
+
+inserts an element at the beginning of a seq. seq = seq to insert an element at. elem = element to insert.If the seq is an empty seq the result is a seq with the single element. Otherwise the result is a seq after inserting the element at the beginning. +
+
+inserts an element at the beginning of a tuple. tuple = tuple to insert an element at. elem = element to insert.If the tuple is an empty tuple the result is a tuple with the single element. Otherwise the result is a tuple after inserting the element at the beginning. +
+
+removes an element from a seq. seq = seq from which an element is to be removed. index = The zero-based position in seq of the element to be removed.If index is greater or equal to the seq size the result is undefined. If the seq is a single element and the index is 0 the result is an empty seq. Otherwise the result is a seq after removing the index element. +
+
+removes an element from a tuple. tuple = tuple from which an element is to be removed. index = The zero-based position in tuple of the element to be removed.If index is greater or equal to the tuple size the result is undefined. If the tuple is a single element and the index is 0 the result is an empty tuple. Otherwise the result is a tuple after removing the index element. +removes an element from a tuple. It reenters BOOST_PP_WHILE with maximum efficiency. d = The next available BOOST_PP_WHILE iteration. tuple = tuple from which an element is to be removed. index = The zero-based position in tuple of the element to be removed.If index is greater or equal to the tuple size the result is undefined. If the tuple is a single element and the index is 0 the result is an empty tuple. Otherwise the result is a tuple after removing the index element. +
+
+expands to the size of the seq passed to it. seq = seq whose size is to be extracted.If the seq is an empty seq its size is 0. Otherwise the result is the number of elements in the seq. +
+
+Returns the size of a sequence. sequence = A sequence to test.returns = If the sequence is empty returns 0, else returns the number of elements in the sequence. +Returns the size of a sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. sequence = A sequence to test.returns = If the sequence is empty returns 0, else returns the number of elements in the sequence. +
+
+expands to the size of the tuple passed to it. tuple = tuple whose size is to be extracted.If the tuple is an empty tuple its size is 0. Otherwise the result is the number of elements in the tuple. +
+
+converts a seq to an array. seq = seq to be converted.If the seq is an empty seq it is converted to an array with 0 elements. Otherwise the seq is converted to an array with the same number of elements as the seq. +
+
+Converts a sequence to a Boost PP array whose elements are the elements of the sequence. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP array. The sequence is empty the Boost PP array is an empty array. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the array element. Otherwise just the data is returned as the array element, which is the default. +Converts a sequence to a Boost PP array whose elements are the elements of the sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP array. The sequence is empty the Boost PP array is empty. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the array element. Otherwise just the data is returned as the array element, which is the default. +
+
+converts a tuple to an array. tuple = tuple to be converted.If the tuple is an empty tuple it is converted to an array with 0 elements. Otherwise the tuple is converted to an array with the same number of elements as the tuple. +
+
+converts a seq to a list. seq = seq to be converted.If the seq is an empty seq it is converted to an empty list (BOOST_PP_NIL). Otherwise the seq is converted to a list with the same number of elements as the seq. +
+
+Converts a sequence to a Boost PP list whose elements are the elements of the sequence. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP list. The sequence is empty the Boost PP list is an empty list. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the list element. Otherwise just the data is returned as the list element, which is the default. +Converts a sequence to a Boost PP list whose elements are the elements of the sequence. Re-entrant version. d = The next available BOOST_PP_WHILE iteration. ... = Variadic parameters.The first variadic parameter is required and is the sequence to convert.Further optional variadic parameters can be return type parameters. Return type parameters allow each element in the sequence to be converted to a two-element tuple where the first tuple element is the type and the second tuple element is the element data.The BOOST_VMD_RETURN_NO_TYPE, the default, does not return the type as part of each converted element but just the data. All of the rest return the type and data as the two-element tuple. If BOOST_VMD_RETURN_TYPE is specified the specific type of the element is returned in the tuple. If BOOST_VMD_RETURN_TYPE_ARRAY is specified an array type is returned if the element is an array, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_LIST is specified a list type is returned if the element is a list, else a tuple type is returned if the element is a tuple, else the actual type is returned for non-tuple data. If BOOST_VMD_RETURN_TYPE_TUPLE is specified a tuple type is returned for all tuple-like data, else the actual type is returned for non-tuple data. If more than one return type optional parameter is specified the last one specified determines the return type.returns = A Boost PP list. The sequence is empty the Boost PP list is an empty list. If an optional return type other than BOOST_VMD_RETURN_NO_TYPE is specified the type and the data of each element is returned as the list element. Otherwise just the data is returned as the list element, which is the default. +
+
+converts a tuple to a list. tuple = tuple to be converted.If the tuple is an empty tuple it is converted to an empty list (BOOST_PP_NIL). Otherwise the tuple is converted to a list with the same number of elements as the tuple. +
+
+Determines if a sequence is a VMD tuple. The macro checks that the sequence is a VMD tuple. A VMD tuple, which may be a Boost PP tuple or emptiness, is a superset of a Boost PP tuple. It returns 1 if it is a VMD tuple, else if returns 0.sequence = a possible Boost PP tuplereturns = 1 if it a VMD tuple, else returns 0. +
+
\ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence.qbk new file mode 100644 index 0000000000000000000000000000000000000000..f8ee304c12eaf2ae1509b5991b055576f0b6c525 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence.qbk @@ -0,0 +1,230 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_sequence Parsing sequences] + +In the normal use of Boost PP data is passed as arguments to a macro in +discrete units so that each parameter expects a single data type. A typical +macro might be: + + #define AMACRO(anumber,atuple,anidentifier) someoutput + +where the 'atuple', having the form of ( data1, data2, data3 ), itself may +contain different data types of elements. + +This is the standard macro design and internally it is the easiest way +to pass macro data back and forth. The Boost PP library has a rich set of +functionality to deal with all of its high-level data types, and variadic data, +with its own simpler functionality, also offers another alternative to +representing data. + +Occasionally designers of macros, especially for the use of others programmers within +a particular library, have expressed the need for a macro parameter to allow a more +C/C++ like syntax where a single parameter might mimic a C++ function-call or a +C-like type modification syntax, or some other more complicated construct. +Something along the lines of: + + areturn afunction ( aparameter1, aparameter2, aparameter3 ) + +or + + ( type ) data + +etc. etc. + +In other words, from a syntactical level when designing possible macro input, +is it possible to design parameter data to look more like C/C++ when macros +are used in a library and still do a certain amount of preprocessor metaprogramming +with such mixed token input ? + +VMD has functionality which allows more than one type of preprocessing token, +excluding an 'empty' token which always refers to some entire input, to be part of a +single parameter of input data. These preprocessing tokens as a single parameter are +syntactically a consecutive series of data. The single limitation of this consecutive +series of data is that each top-level part of the data of this series is of some VMD data type. +What this means is that if some input consists of a series of data types it is possible +to extract the data for each data type in that series. + +In practicality what this means is that, given the examples just above, if +'areturn', 'afunction', and 'data' are identifiers it would be possible to +parse either of the two inputs above so that one could identify the different +data types involved and do preprocessor metaprogramming based on those results. + +[heading Sequence definition] + +I will be calling such input data, which consists of all top-level data types in a series, +by the term of a 'sequence'. Each separate data type in the sequence is called an 'element'. +In this definition of a 'sequence' we can have 0 or more elements, so that a sequence +is a general name for any VMD input. A sequence is therefore +any input VMD can parse, whether it is emptiness, a single element, or more than one +element in a series. Therefore when we speak of VMD macros parsing input data we are +really speaking of VMD macros parsing a sequence. A sequence can therefore also be part of +a Boost PP composite data type, or variadic data, and VMD can still parse such an embedded +sequence if asked to do so. + +[heading Sequence parsing] + +Parsing a sequence means that VMD can step through each element of a sequence +sequentially, determine the type and data of each element, then move on to the +next element. Parsing is sequential and can only be done in a forward direction, +but it can be done any number of times. In C++ iterator terms parsing of a +sequence is a forward iterator. + +Working with a sequence is equivalent to using VMD macros 'generically'. + +Before I give an explanation of how to use a sequence using VMD generic +functionality I would like to make two points: + +* The possibility of working with a sequence which contains more than one +data type can be easily abused. In general +keeping things simple is usually better than making things overly complicated +when it comes to the syntactical side of things in a computer language. A macro +parameter syntactical possibility has to be understandable to be used. +* Using VMD to parse the individual data types of a sequence takes more +preprocessing time than functionality offered with Boost PP data types, +because it is based on forward access through each top-level type of the sequence. + +The one constraint in a sequence is that the top-level must +consist of VMD data types, in other words preprocessor tokens which VMD understands. +By top-level it is meant that a Boost PP composite data may have elements which +VMD cannot parse but as long as the input consists of the composite data types and +not the inner unparsable elements, VMD can parse the input. +Therefore if preprocessor data is one of the examples above, you will be successful +in using VMD. However if your preprocessor data takes the form of: + + &name identifier ( param ) + +or + + identifier "string literal" + +or + + identifier + number + +or + + identifier += 4.3 + +etc. etc. + +you will not be able to parse the data using VMD since '&', "string literal", +'+', '+=', and "4.3" are preprocessor tokens which are not VMD top-level data types and +therefore VMD cannot handle them at the parsing level. You can still of course +pass such data as preprocessing input to macros but you cannot use VMD to recognize +the parts of such data. + +This is similar to the fact that VMD cannot tell you what type preprocessor data +is as a whole, using any of the VMD identifying macros already discussed, if the +type is not one that VMD can handle. + +On the other hand you can still use VMD to parse such tokens in the input if you use +Boost PP data types as top-level data types to do so. Such as: + + ( &name ) identifier ( param ) + +or + + identifier ( "string literal" ) + +or + + identifier ( + ) number + +or + + identifier ( += ) 4 ( . ) 3 + +The succeeding topics explain the VMD functionality for parsing a sequence +for each individual VMD data type in that sequence. + +[heading Sequence types] + +A VMD sequence can be seen as one of either three general types: + +# An empty sequence +# A single element sequence +# A multi-element sequence + +An empty sequence is merely input that is empty, what VMD calls "emptiness". Use the previously +explained BOOST_VMD_IS_EMPTY macro to test for an empty sequence. + + #include + + #define AN_EMPTY_SEQUENCE + + BOOST_VMD_IS_EMPTY(AN_EMPTY_SEQUENCE) will return 1 + +The type of an empty sequence is BOOST_VMD_TYPE_EMPTY. + +A single element sequence is a single VMD data type. This is what +we have been previously discussing as data which VMD can parse in this +documentation with our identifying macros. You can use the +BOOST_VMD_IS_UNARY macro to test for a single element sequence. + + #include + + #define A_SINGLE_ELEMENT_SEQUENCE (1,2) + + BOOST_VMD_IS_UNARY(A_SINGLE_ELEMENT_SEQUENCE) will return 1 + +The type of a single element sequence is the type of the individual data type. +In our example above the type of A_SINGLE_ELEMENT_SEQUENCE is BOOST_VMD_TYPE_TUPLE. + +A multi-element sequence consists of more than one data type. This is the +"new" type which VMD can parse. You can use the BOOST_VMD_IS_MULTI macro +to test for a multi-element sequence. + + #define A_MULTI_ELEMENT_SEQUENCE (1,2) (1)(2) 45 + +The A_MULTI_ELEMENT_SEQUENCE consists of a tuple followed by a seq followed by a number. + + #include + + BOOST_VMD_IS_MULTI(A_MULTI_ELEMENT_SEQUENCE) will return 1 + +The type of a multi-element sequence is always BOOST_VMD_TYPE_SEQUENCE. + +The type of a sequence can be obtained generically with the BOOST_VMD_GET_TYPE +macro. We will be explaining this further in the documentation. + +[heading Sequence size] + +The size of any sequence can be accessed using the BOOST_VMD_SIZE macro. +For an empty sequence the size is always 0. For a single element sequence +the size is always 1. For a multi-element sequence the size is the number +of individual top-level data types in the sequence. + + #include + + BOOST_VMD_SIZE(AN_EMPTY_SEQUENCE) will return 0 + BOOST_VMD_SIZE(A_SINGLE_ELEMENT_SEQUENCE) will return 1 + BOOST_VMD_SIZE(A_MULTI_ELEMENT_SEQUENCE) will return 3 + +[heading Using VMD to parse sequence input] + +For a VMD sequence essentially two ways of parsing into individual data +types are offered by the VMD library: + +# The sequence can be converted to any of the Boost PP data types, or +to variadic data, where each individual data type in the sequence becomes +a separate element of the particular composite data type chosen. The +conversion to a particular Boost PP data type or variadic data is slow, +because it is based on forward access through each top-level type of the sequence, +but afterwards accessing any individual element is as fast as accessing +any element in the Boost PP data type or among variadic data. +# The sequence can be accessed directly through its individual elements. +This is slower than accessing an element of a Boost PP data type +or variadic data but offers conceptual access to the original sequence +as a series of elements. + +These two techniques will be discussed in succeeding topics. + +[include vmd_sequence_convert.qbk] +[include vmd_sequence_access.qbk] + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence_access.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence_access.qbk new file mode 100644 index 0000000000000000000000000000000000000000..86ea6ae6f3ed9c6a16dccdb8ee995aea0d2aa95a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence_access.qbk @@ -0,0 +1,54 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_sequence_access Accessing a sequence element] + +It is possible to access an individual element of a sequence. +The macro to do this is called BOOST_VMD_ELEM. The macro takes two +required parameters. The required parameters are the element number +to access and the sequence, in that order. The element number is a +0-based number and its maximum value should be one less than the size +of the sequence. + +The BOOST_VMD_ELEM macro returns the actual sequence element. If the +first required parameter is greater or equal to the size of the +sequence the macro returns emptiness. Because of this using +BOOST_VMD_ELEM on an empty sequence, whose size is 0, always returns +emptiness. + + #include + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define A_SEQUENCE (1,2,3) 46 (list_data1,(list_data2,BOOST_PP_NIL)) BOOST_VMD_TYPE_SEQ ANAME + #define AN_EMPTY_SEQUENCE + + BOOST_VMD_ELEM(0,A_SEQUENCE) will return (1,2,3) + BOOST_VMD_ELEM(1,A_SEQUENCE) will return 46 + BOOST_VMD_ELEM(2,A_SEQUENCE) will return (list_data1,(list_data2,BOOST_PP_NIL)) + BOOST_VMD_ELEM(3,A_SEQUENCE) will return BOOST_VMD_TYPE_SEQ + BOOST_VMD_ELEM(4,A_SEQUENCE) will return ANAME + + BOOST_VMD_ELEM(5,A_SEQUENCE) will return emptiness + BOOST_VMD_ELEM(0,AN_EMPTY_SEQUENCE) will return emptiness + +Accessing an element of a sequence directly is slower than accessing an element +of a Boost PP data type or even variadic data, since each access has to directly +cycle through each element of the sequence to get to the one being accessed. +The process of sequentially parsing each element again each time is slower than +accessing a Boost PP data type element. + +[heading Usage] + +You can use the general header file: + + #include + +or you can use the individual header file: + + #include + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence_convert.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence_convert.qbk new file mode 100644 index 0000000000000000000000000000000000000000..198fda3aa67aeca7c331a65a448d4d9e29f2500f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_sequence_convert.qbk @@ -0,0 +1,73 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_sequence_convert Converting sequences] + +The easiest way to work with a sequence is to convert it to a Boost PP +data type. Likewise you can also convert a sequence to variadic data even though the +Boost PP data types have much greater functionality than variadic data in Boost PP. + +To convert a sequence to a Boost PP data type or variadic data the macros to be used are: + +* BOOST_VMD_TO_ARRAY(sequence) to convert the sequence to an array +* BOOST_VMD_TO_LIST(sequence) to convert the sequence to a list +* BOOST_VMD_TO_SEQ(sequence) to convert the sequence to a seq +* BOOST_VMD_TO_TUPLE(sequence) to convert the sequence to a tuple +* BOOST_VMD_ENUM(sequence) to convert the sequence to variadic data + +After the conversion the elements of a sequence become the elements +of the corresponding composite data type. + +Once the elements of the sequence have been converted to the elements +of the composite data type the full power of that composite data type can be used +to process each element. Furthermore the programmer can use VMD to discover +the type of an individual element for further processing. + +For single element sequences the result is always a single element composite +data type. For multi-element sequences the result is always a composite data +type of more than one element. + +For a sequence that is empty the result is emptiness when converting to +a seq, tuple, or variadic data; the result is an empty array or list when +converting to each of those composite data types respectively. + + #include + #include + #include + #include + #include + + #define BOOST_VMD_REGISTER_ANID (ANID) + + #define SEQUENCE_EMPTY + #define SEQUENCE_SINGLE 35 + #define SEQUENCE_SINGLE_2 ANID + #define SEQUENCE_MULTI (0,1) (2)(3)(4) + #define SEQUENCE_MULTI_2 BOOST_VMD_TYPE_SEQ (2,(5,6)) + + BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY) will return an empty array '(0,())' + BOOST_VMD_TO_LIST(SEQUENCE_SINGLE) will return a one-element list '(35,BOOST_PP_NIL)' + BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_2) will return a one-element seq '(ANID)' + BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI) will return a multi-element tuple '((0,1),(2)(3)(4))' + BOOST_VMD_ENUM(SEQUENCE_MULTI_2) will return multi-element variadic data 'BOOST_VMD_TYPE_SEQ,(2,(5,6))' + +[heading Usage] + +You can use the general header file: + + #include + +or you can use individual header files for each of these macros. +The individual header files are: + + #include // for the BOOST_VMD_TO_ARRAY macro + #include // for the BOOST_VMD_TO_LIST macro + #include // for the BOOST_VMD_TO_SEQ macro + #include // for the BOOST_VMD_TO_TUPLE macro. + #include // for the BOOST_VMD_ENUM macro. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_specific.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_specific.qbk new file mode 100644 index 0000000000000000000000000000000000000000..b1d08d3e2d13dcf865c3df74850515a2edde4d3c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_specific.qbk @@ -0,0 +1,22 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_specific Specific macros for working with data types] + +VMD has a number of specific macros for parsing data types. +Each of these macros asks if some input is a particular +VMD data type. + +[include vmd_empty.qbk] +[include vmd_constraints.qbk] +[include vmd_identifier.qbk] +[include vmd_number.qbk] +[include vmd_type.qbk] +[include vmd_pp_data_types.qbk] +[include vmd_identifying.qbk] + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_specific_generic.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_specific_generic.qbk new file mode 100644 index 0000000000000000000000000000000000000000..423d5ce0944430e3b0ba33a522a500b96fb16296 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_specific_generic.qbk @@ -0,0 +1,21 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_specific_generic Macros for working with data types] + +VMD macros for working with data types which VMD understands can +be divided into specific and generic macros. + +The specific macros ask whether some input data is a particular +data type. The generic macros work with input data as any data +type while allowing the programmer to separately query the type +of data. + +Both specific and generic macros have their place and the macro +programmer can decide which to use for any given situation. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_type.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_type.qbk new file mode 100644 index 0000000000000000000000000000000000000000..5a25ca1a9cdac5fce5a7920ce3c763a22bb146d1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_type.qbk @@ -0,0 +1,80 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_type Types] + +A subset of identifiers is VMD types, called a 'v-type'. These are identifiers +which represent all of the preprocessor data types which VMD can parse. This subset of +identifiers is automatically registered and pre-detected by VMD. Each identifier +type begins with the unique prefix 'BOOST_VMD_TYPE_'. + +The actual types are: + +* BOOST_VMD_TYPE_EMPTY, represents emptiness, ie. "empty data" +* BOOST_VMD_TYPE_ARRAY, a Boost PP array +* BOOST_VMD_TYPE_LIST, a Boost PP list +* BOOST_VMD_TYPE_SEQ, a Boost PP seq +* BOOST_VMD_TYPE_TUPLE, a Boost PP tuple +* BOOST_VMD_TYPE_IDENTIFIER, identifier +* BOOST_BMD_TYPE_NUMBER, a number +* BOOST_VMD_TYPE_TYPE, a type itself +* BOOST_VMD_TYPE_SEQUENCE, a sequence +* BOOST_VMD_TYPE_UNKNOWN, an unknown type + +Since a v-type is itself an identifier the particular constraint on the input +to test is exactly the same as for identifiers. + +The constraint is that the beginning input character, ignoring any whitespace, passed +as the input to test must be either: + +* an identifier character, ie. an alphanumeric or an underscore +* the left parenthesis of a tuple + +and if the first character is not the left parenthesis of a tuple +the remaining characters must be alphanumeric or an underscore until a space character +or end of input occurs. + +If this is not the case the behavior is undefined, and most likely +a preprocessing error will occur. + +The macro used to test for a particular type in VMD is called BOOST_VMD_IS_TYPE. +The macro takes a single parameter, the input to test against. + +The macro returns 1 if the parameter is a v-type, otherwise the macro returns 0. + +A v-type is also an identifier, which has been registered and pre-detected, +so you can also use the VMD functionality which works with identifiers to work with +a v-type as an identifier if you like. + +[heading Example] + +Let us look at an example of how to use BOOST_VMD_IS_TYPE. + + #include + + BOOST_VMD_IS_TYPE(input) + + returns: + + if input = BOOST_VMD_TYPE_SEQ, 1 + if input = BOOST_VMD_TYPE_NUMBER, 1 + if input = SQUARE, 0 + if input = BOOST_VMD_TYPE_IDENTIFIER DATA, 0 since there are tokens after the type + if input = %44, does not meet the constraint therefore undefined behavior + if input = ( BOOST_VMD_TYPE_EMPTY ), 0 since the macro begins with a tuple and this can be tested for + +[heading Usage] + +To use the BOOST_VMD_IS_TYPE macro either include the general header: + + #include + +or include the specific header: + + #include + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_useful.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_useful.qbk new file mode 100644 index 0000000000000000000000000000000000000000..13d3d516096f4c70554579715e83359b2ab262e0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_useful.qbk @@ -0,0 +1,28 @@ +[/ + (C) Copyright Edward Diener 2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_useful Useful variadic macros not in Boost PP] + +Previous sections of this documentation have explained how VMD +can be used to parse VMD data types, as well as recognize emptiness. + +Another area of functionality of VMD involves useful variadic macros, based +on the previous functionality, which expands on similar macros +already in Boost PP. These variadic macros can be divided into sections +illustrating these areas of behavior: + +# Expanded assertion macros +# Expanded identity functionality +# Expanded seq and tuple functionality for "empty" seqs and tuples + +Sub-sections for each of these now follow in the documentation. + +[include vmd_assert.qbk] +[include vmd_identity.qbk] +[include vmd_empty_ppdata.qbk] + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_variadic_macros.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_variadic_macros.qbk new file mode 100644 index 0000000000000000000000000000000000000000..53d9fb88ee9dc52eecb1799e935f8203e5c9d8a2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_variadic_macros.qbk @@ -0,0 +1,52 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_vmacros Using variadic macros] + +Variadic macros, as specified by C++11, is a feature taken from the C99 +specification. They are macros which take a final parameter denoted as +'...' which represents one or more final arguments to the macro as a +series of comma-separated tokens. In the macro expansion a special +keyword of '\_\_VA\_ARGS\_\_' represents the comma-separated tokens. This +information when passed to a variadic macro I call 'variadic macro data', +which gives its name to this library. The more general term 'variadic data' +is used in this documentation to specify data passed to a macro which can +contain any number of macro tokens as a single macro parameter, such as is +found in Boost PP data types. + +[heading Boost support] + +The Boost PP library has support for variadic macros and uses its +own criteria to determine if a particular compiler has that support. +Boost PP defines or uses the macro BOOST_PP_VARIADICS to denote whether +the compiler being used supports variadic macros. When BOOST_PP_VARIADICS +is set to 1 the compiler supports variadic macros, otherwise when +BOOST_PP_VARIADICS is set to 0 the compiler does not support variadic macros. +If a user of Boost PP sets this value, Boost PP uses the value the end-user +sets, otherwise Boost PP defines the value of BOOST_PP_VARIADICS based on its +own analysis of the compiler being used. This macro can also be checked to +determine if a compiler has support for variadic macros. + +[heading Determining variadic macro support] + +The VMD library automatically determines whether variadic macro support +is enabled for a particular compiler by also using the same BOOST_PP_VARIADICS +macro from Boost PP. The end-user of VMD can also manually +set the macro BOOST_PP_VARIADICS to turn on or off compiler support for +variadic macros in the VMD library. When BOOST_PP_VARIADICS is set to 0 +variadic macros are not supported in the VMD library, otherwise when +BOOST_PP_VARIADICS is set to non-zero they are supported in the VMD library. +This same macro can be used to determine if VMD supports variadic macros for a +particular compiler. + +Since this library depends on variadic macro support, if BOOST_PP_VARIADICS +is set to 0, using any of the macros in VMD will lead to a compiler error +since the macro will not be defined. However just including any of the header +files in VMD, even with no variadic macro support for the compiler, will not +lead to any compiler errors. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_vc.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_vc.qbk new file mode 100644 index 0000000000000000000000000000000000000000..2720f2d7d0c8fd0ec274fbd90bca2c3b5464556a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_vc.qbk @@ -0,0 +1,36 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_vc Visual C++ define] + +Microsoft's Visual C++ compiler, abbreviated VC++, is a very popular compiler +but does not implement the standard C++ preprocessor correctly in a number of respects. +Because of this the programmer using the VMD needs to occasionally do things +differently when VC++ is being used. These "quirks" of VC++ have been smoothed over +as much as possible in the VMD library, but are mentioned in further topics and +occasionally must be addressed by the programmer using VMD. + +The VMD has a macro that indicates when VC++ is the compiler being used. The +macro is an object-like macro called BOOST_VMD_MSVC. It is set to 1 when VC++ +is being used and set to 0 when VC++ is not being used. You can use this macro +in your own macro code whenever you include a VMD header file to write code +which may need special processing for VC++ as outlined in this documentation. +Your macro processing may therefore occasional take the form of: + + #include + + #if BOOST_VMD_MSVC + + #define SOME_MACRO ... code for VC++ + + #else + + #define SOME_MACRO ... code for all other compilers + + #endif + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_vc_isms.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_vc_isms.qbk new file mode 100644 index 0000000000000000000000000000000000000000..decdc70f1ef282c6ca02fd2abee8565476d6ea65 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_vc_isms.qbk @@ -0,0 +1,44 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_vc_isms Visual C++ gotchas in VMD] + +I have discussed throughout the documentation areas of VMD which need to be +considered when using Microsoft's Visual C++ compilers. The VMD library +supports VC++ versions 8 through the latest 14. These correspond to +Visual Studio 2005 through the current Visual Studio 2015. + +I will give here fairly briefly the VC++ quirks which should be taken +into account when using VMD. These quirks exist because the VC++ compiler +does not have a C++ standard conforming preprocessor. More specifically +the VC++ compiler does not follow all of the rules correctly for expanding +a macro when a macro is invoked. Here is a list for things to consider +when using VMD with VC++: + +* The BOOST_VMD_IS_EMPTY macro will expand erroneously to 1 if the input resolves +to a function-like macro name, which when it is called with an empty parameter +expands to a tuple. + +* The BOOST_VMD_ASSERT macro, and the corresponding individual VMD ASSERT macros +for the various data types, do not cause an immediate compiler error, but instead +generate invalid C++ if the ASSERT occurs. + +* When the BOOST_VMD_ASSERT macro, or one of the corresponding individual VMD ASSERT macros +for the various data types, does not generate an error, and the macro in which it is +being used does generate some output, it is necessary to use BOOST_PP_CAT to +concatenate the empty result of the VMD ASSERT macro with the normally generated output +to correctly generate the final expansion of the macro in which the VMD ASSERT occurs. + +* When using BOOST_VMD_EMPTY following some non-empty expansion, or when using +BOOST_VMD_IDENTITY, the value returned needs to be concatenated using BOOST_PP_CAT +with an empty value. You can use BOOST_VMD_IDENTITY_RESULT to accomplish this +transparently. + +* Avoid using an empty parenthesis to pass no data as a tuple or seq if VC++8 might +be used as the compiler. + +[endsect] diff --git a/tools/boost_1_65_1/libs/vmd/doc/vmd_whyhow.qbk b/tools/boost_1_65_1/libs/vmd/doc/vmd_whyhow.qbk new file mode 100644 index 0000000000000000000000000000000000000000..f0374c1ffebf060f09e0b7003513953a26c77508 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/doc/vmd_whyhow.qbk @@ -0,0 +1,175 @@ +[/ + (C) Copyright Edward Diener 2011-2015 + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:vmd_whyhow Why and how to use] + +The VMD library provides the ability to create a macro which takes +different types of parameters and can therefore generate different output +depending on the parameter types as well as their values. + +This is equivalent to the way that overloaded +functions provide the ability for a singularly named function +to provide different functionality depending on the parameter +types. + +In the case of macros, where more than one macro of the same +name but different macro expansion is not allowed, a single macro name +can create different expansions. + +As a simple example: + + #include + #include + + #define AMACRO(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_SEQ(param), \ + Seq, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(param), \ + Tuple, \ + Unknown \ + ) \ + ) + +If the param passed is a seq the output of +the macro is 'Seq'. If the param passed is +a tuple the output of the macro is 'Tuple'. +Otherwise the output of the macro is 'Unknown'. + +Obviously much more complicated cases can be created +in which the types and values of various parameters +are parsed in order to produce variable macro output +depending on the input. Using variadic macros, +macros with variable numbers and types of arguments +give the macro programmer even greater freedom to +design macros with flexibility. + +Another feature of the VMD library is the ability to parse +identifiers. A system of registering identifiers which VMD +can recognize has been created. Once an identifier is registered +VMD can recognize it as part of macro input as an identifier and +return the identifier. Furthermore VMD can compare identifiers +for equality or inequality once an identifier has been pre-detected +using VMD's system for pre-detecting identifiers. + +As another simple example: + + #include + + #define BOOST_VMD_REGISTER_NAME (NAME) + #define BOOST_VMD_REGISTER_ADDRESS (ADDRESS) + + #define AMACRO1(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_IDENTIFIER(param), \ + AMACRO1_IDENTIFIER, \ + AMACRO1_NO_IDENTIFIER \ + ) \ + (param) + + #define AMACRO1_IDENTIFIER(param) AMACRO1_ ## param + #define AMACRO1_NO_IDENTIFIER(param) Parameter is not an identifier + #define AMACRO1_NAME Identifier is a NAME + #define AMACRO1_ADDRESS Identifier is an ADDRESS + +Here we use VMD's identifier registration system to determine and +handle a particular identifier we may be expecting as a macro parameter. +If the input to 'AMACRO1' is 'NAME' the output is 'Identifier is a NAME'. +If the input to 'AMACRO1' is 'ADDRESS' the output is 'Identifier is an ADDRESS'. +Otherwise the output is 'Parameter is not an identifier'. + +Identifier pre-detection makes things clearer, allowing us to +detect within VMD whether macro input matches a particular identifier. +Using the same setup as our previous example, but with identifier pre-detection: + + #include + + #define BOOST_VMD_REGISTER_NAME (NAME) + #define BOOST_VMD_DETECT_NAME_NAME + + #define BOOST_VMD_REGISTER_ADDRESS (ADDRESS) + #define BOOST_VMD_DETECT_ADDRESS_ADDRESS + + #define AMACRO2(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_IDENTIFIER(param,NAME), \ + AMACRO2_NAME, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_IDENTIFIER(param,ADDRESS), \ + AMACRO2_ADDRESS, \ + AMACRO2_NO_IDENTIFIER \ + ) \ + ) \ + (param) + + #define AMACRO2_NO_IDENTIFIER(param) Parameter is not a NAME or ADDRESS identifier + #define AMACRO2_NAME(param) Identifier is a NAME + #define AMACRO2_ADDRESS(param) Identifier is an ADDRESS + +If the input to 'AMACRO2' is 'NAME' the output is 'Identifier is a NAME'. +If the input to 'AMACRO2' is 'ADDRESS' the output is 'Identifier is an ADDRESS'. +Otherwise the output is 'Parameter is not a NAME or ADDRESS identifier'. + +The VMD library also has 2 different subtypes of identifiers which can always be +recognized. The first are numbers, equivalent to the number in Boost PP, numeric +values with a range of 0-256. The second are v-types, which are identifiers starting +with BOOST_VMD_TYPE_ followed by a name for the type of data. As an example, the v-type +of a Boost PP tuple is BOOST_VMD_TYPE_TUPLE and the v-type of a v-type itself is +BOOST_VMD_TYPE_TYPE. All data types have their own v-type identifier; types are +recognized by the VMD macros and may be passed as input data just like any other of +the types of data VMD recognizes. + +The VMD identifier system even has a way, to be explained later, for the end-user to +create his own subtype identifiers. + +Another reason to use VMD is that VMD understands 'sequences' of the VMD data types. You +can have a sequence of data types and VMD can convert the sequence to any of the Boost +PP data types, or access any individual data type in a sequence. + + #include + #include + + #define BOOST_VMD_REGISTER_NAME (NAME) + #define ASEQUENCE (1,2) NAME 147 BOOST_VMD_TYPE_NUMBER (a)(b) + + BOOST_VMD_TO_TUPLE(ASEQUENCE) + BOOST_VMD_ELEM(2,ASEQUENCE) + +Our first expansion returns the tuple: + + ((1,2),NAME,147,BOOST_VMD_TYPE_NUMBER,(a)(b)) + +Our second expansion returns the sequence element: + + 147 + +Sequences give the macro programmer the ability to accept input +data from the user which may more closely mimic C++ constructs. + +Another reason to use VMD is that VMD understands data types. +Besides specifically asking if a particular input is a particular +data type, you can use the macro BOOST_VMD_GET_TYPE to retrieve +the type of any VMD data. + + #include + + BOOST_VMD_GET_TYPE((1,2)) // expands to BOOST_VMD_TYPE_TUPLE + BOOST_VMD_GET_TYPE(235) // expands to BOOST_VMD_TYPE_NUMBER + +etc. + +There is still much more of VMD functionality but hopefully this brief +introduction of what VMD can do will interest you so that you will read on +to understand VMD's functionality for the macro programmer. + +[endsect] \ No newline at end of file diff --git a/tools/boost_1_65_1/libs/vmd/index.html b/tools/boost_1_65_1/libs/vmd/index.html new file mode 100644 index 0000000000000000000000000000000000000000..acb80a9d43ef151eefc9018cfa156ed1c9ba32e5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/index.html @@ -0,0 +1,11 @@ + + + + + + +

Automatic redirection failed, please go to + doc/html/index.html.

+

Copyright Edward Diener 2013

+ + diff --git a/tools/boost_1_65_1/libs/vmd/meta/libraries.json b/tools/boost_1_65_1/libs/vmd/meta/libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..ca8830955f0782987551d21097455fac8cb64bd6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/meta/libraries.json @@ -0,0 +1,14 @@ +{ + "key": "vmd", + "name": "VMD", + "authors": [ + "Edward Diener" + ], + "description": "Variadic Macro Data library.", + "category": [ + "Preprocessor" + ], + "maintainers": [ + "Edward Diener " + ] +} diff --git a/tools/boost_1_65_1/libs/vmd/test/Jamfile.v2 b/tools/boost_1_65_1/libs/vmd/test/Jamfile.v2 new file mode 100644 index 0000000000000000000000000000000000000000..1d9a77f53ec6b921b65d489d4703f59b39676fff --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/Jamfile.v2 @@ -0,0 +1,230 @@ +# (C) Copyright Edward Diener 2010-2015 +# Use, modification and distribution are subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt). +# +# VariadicMacroData testing Jamfile +# + +import testing ; +import ../../predef/check/predef + : check require + : predef-check predef-require ; + +project variadic_macro_data_tests : requirements on + always_show_run_output + msvc:all + msvc:-wd4003 + intel-linux:-std=c++11 + clang-linux:-std=c++11 + clang-linux:-pedantic-errors + gcc:all + gcc:-pedantic-errors + [ predef-check "BOOST_COMP_GNUC >= 4.7.4" : : -ftrack-macro-expansion=0 ] + [ predef-check "BOOST_COMP_GNUC >= 4.3.0" : : -Wno-variadic-macros ] + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.5.0:"-Wl,--enable-auto-import" + android:-std=c++0x + ; + +local l_gcc_c11 = [ predef-check "BOOST_COMP_GNUC >= 4.3" "BOOST_OS_QNX == 0" : : -std=c++0x ] ; + +alias variadic_macro_data + : + [ run test_after_array_elem.cpp : : : $(l_gcc_c11) ] + [ run test_after_identifier_elem.cpp : : : $(l_gcc_c11) ] + [ run test_after_list_elem.cpp : : : $(l_gcc_c11) ] + [ run test_after_number_elem.cpp : : : $(l_gcc_c11) ] + [ run test_after_seq_elem.cpp : : : $(l_gcc_c11) ] + [ run test_android.cpp : : : [ predef-check "BOOST_OS_QNX == 0" : : -std=c++0x ] ] + [ run test_after_tuple_elem.cpp : : : $(l_gcc_c11) ] + [ run test_after_type_elem.cpp : : : $(l_gcc_c11) ] + [ run test_array_elem.cpp : : : $(l_gcc_c11) ] + [ run test_array_empty.cpp : : : $(l_gcc_c11) ] + [ run test_array_equal.cpp : : : $(l_gcc_c11) ] + [ run test_array_to_seq.cpp : : : $(l_gcc_c11) ] + [ run test_array_to_tuple.cpp : : : $(l_gcc_c11) ] + [ run test_ary.cpp : : : $(l_gcc_c11) ] + [ compile test_assert.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_array.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_identifier.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_is_empty.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_is_identifier.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_is_number.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_list.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_number.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_seq.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_tuple.cpp : $(l_gcc_c11) ] + [ compile-fail test_assert_fail_vcstring.cpp : $(l_gcc_c11) ] + [ compile test_assert_is_array.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_array_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_array_fail2.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_array_fail3.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_array_fail4.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_empty.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_empty_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_empty_fail2.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_empty_fail3.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_identifier.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_identifier_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_list.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_list_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_list_fail2.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_list_fail3.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_list_fail4.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_number.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_number_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_seq.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_seq_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_seq_fail2.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_seq_fail3.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_seq_fail4.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_tuple.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_tuple_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_tuple_fail2.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_tuple_fail3.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_tuple_fail4.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_assert_is_type.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_assert_is_type_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile test_doc_assert.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ compile-fail test_doc_assert_fail.cpp : + BOOST_VMD_ASSERT_DATA=1 $(l_gcc_c11) ] + [ run test_doc_empty.cpp : : : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail.cpp : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail2.cpp : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail3.cpp : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail4.cpp : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail6.cpp : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail7.cpp : $(l_gcc_c11) ] + [ compile-fail test_doc_empty_fail8.cpp : $(l_gcc_c11) ] + [ run test_doc_equality.cpp : : : $(l_gcc_c11) ] + [ run test_doc_example_switch.cpp : : : $(l_gcc_c11) ] + [ run test_doc_get_type.cpp : : : $(l_gcc_c11) ] + [ run test_doc_identifier.cpp : : : $(l_gcc_c11) ] + [ run test_doc_identifier_subtyping.cpp : : : $(l_gcc_c11) ] + [ run test_doc_modifiers_filter.cpp : : : $(l_gcc_c11) ] + [ run test_doc_modifiers_identifier.cpp : : : $(l_gcc_c11) ] + [ run test_doc_modifiers_index.cpp : : : $(l_gcc_c11) ] + [ run test_doc_modifiers_return_type.cpp : : : $(l_gcc_c11) ] + [ run test_doc_modifiers_splitting.cpp : : : $(l_gcc_c11) ] + [ run test_doc_number.cpp : : : $(l_gcc_c11) ] + [ run test_doc_type.cpp : : : $(l_gcc_c11) ] + [ run test_doc_pp_data_types.cpp : : : $(l_gcc_c11) ] + [ run test_doc_sequence.cpp : : : $(l_gcc_c11) ] + [ run test_doc_sequence_access.cpp : : : $(l_gcc_c11) ] + [ run test_doc_sequence_convert.cpp : : : $(l_gcc_c11) ] + [ run test_doc_whyhow.cpp : : : $(l_gcc_c11) ] + [ run test_equal.cpp : : : $(l_gcc_c11) ] + [ run test_equal_array.cpp : : : $(l_gcc_c11) ] + [ run test_equal_identifier.cpp : : : $(l_gcc_c11) ] + [ run test_equal_list.cpp : : : $(l_gcc_c11) ] + [ run test_equal_multi.cpp : : : $(l_gcc_c11) ] + [ run test_equal_number.cpp : : : $(l_gcc_c11) ] + [ run test_equal_seq.cpp : : : $(l_gcc_c11) ] + [ run test_equal_tuple.cpp : : : $(l_gcc_c11) ] + [ run test_equal_type.cpp : : : $(l_gcc_c11) ] + [ run test_identifier_elem.cpp : : : $(l_gcc_c11) ] + [ run test_identifier_equal.cpp : : : $(l_gcc_c11) ] + [ run test_is_array.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_array_fail.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_array_fail2.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_array_fail3.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_array_fail4.cpp : : : $(l_gcc_c11) ] + [ run test_is_empty.cpp : : : $(l_gcc_c11) ] + [ compile-fail test_is_empty_fail.cpp : $(l_gcc_c11) ] + [ run test_is_identifier.cpp : : : $(l_gcc_c11) ] + [ run test_is_list.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_list_fail.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_list_fail2.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_list_fail3.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_list_fail4.cpp : : : $(l_gcc_c11) ] + [ run test_is_number.cpp : : : $(l_gcc_c11) ] + [ run test_is_parens_empty.cpp : : : $(l_gcc_c11) ] + [ run test_is_seq.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_seq_fail.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_seq_fail2.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_seq_fail3.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_seq_fail4.cpp : : : $(l_gcc_c11) ] + [ run test_is_tuple.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_tuple_fail.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_tuple_fail2.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_tuple_fail3.cpp : : : $(l_gcc_c11) ] + [ run-fail test_is_tuple_fail4.cpp : : : $(l_gcc_c11) ] + [ run test_is_type.cpp : : : $(l_gcc_c11) ] + [ run test_is_vmd_seq.cpp : : : $(l_gcc_c11) ] + [ run test_is_vmd_tuple.cpp : : : $(l_gcc_c11) ] + [ run test_list_elem.cpp : : : $(l_gcc_c11) ] + [ run test_list_empty.cpp : : : $(l_gcc_c11) ] + [ run test_list_equal.cpp : : : $(l_gcc_c11) ] + [ run test_list_to_seq.cpp : : : $(l_gcc_c11) ] + [ run test_list_to_tuple.cpp : : : $(l_gcc_c11) ] + [ run test_number_elem.cpp : : : $(l_gcc_c11) ] + [ run test_number_equal.cpp : : : $(l_gcc_c11) ] + [ run test_seq_elem.cpp : : : $(l_gcc_c11) ] + [ run test_seq_equal.cpp : : : $(l_gcc_c11) ] + [ run test_seq_pop_back.cpp : : : $(l_gcc_c11) ] + [ run test_seq_pop_front.cpp : : : $(l_gcc_c11) ] + [ run test_seq_push_back.cpp : : : $(l_gcc_c11) ] + [ run test_seq_push_front.cpp : : : $(l_gcc_c11) ] + [ run test_seq_remove.cpp : : : $(l_gcc_c11) ] + [ run test_seq_size.cpp : : : $(l_gcc_c11) ] + [ run test_seq_to_array.cpp : : : $(l_gcc_c11) ] + [ run test_seq_to_list.cpp : : : $(l_gcc_c11) ] + [ run test_seq_to_tuple.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_after_elem.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_elem.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_enum.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_size.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_to_array.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_to_list.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_to_seq.cpp : : : $(l_gcc_c11) ] + [ run test_sequence_to_tuple.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_elem.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_equal.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_pop_back.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_pop_front.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_push_back.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_push_front.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_remove.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_size.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_to_array.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_to_list.cpp : : : $(l_gcc_c11) ] + [ run test_tuple_to_seq.cpp : : : $(l_gcc_c11) ] + [ run test_type.cpp : : : $(l_gcc_c11) ] + [ run test_type_elem.cpp : : : $(l_gcc_c11) ] + [ run test_type_equal.cpp : : : $(l_gcc_c11) ] + [ run test_variadic_macro.cpp ] + ; diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_array_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_array_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f1beb56b3301b9c48243c9c703df3aaaebc44eb6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_array_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_array_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_array_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1b9d861525b7a7931ac134b0b6962192fa3e1069 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_array_elem.cxx @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 456 + #define PLUS_ANARRAY yyt (2,(j,ii%)) + #define JDATA ggh + #define KDATA (2,(a,b)) name + #define A_SEQ ((1,(25)) 7)((1,(26)) 8)((1,(27)) 9) + +#if !BOOST_VMD_MSVC_V8 + #define ANARRAY_EMPTY (0,()) + #define AN_EMPTY_ARRAY_PLUS (0,()) 46 + #define ASEQUENCE5 ASEQ ANUMBER ANARRAY_EMPTY ATUPLE +#endif + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY)),25); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,AN_ARRAY_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ANARRAY,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(1,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY),8); + +#if !BOOST_VMD_MSVC_V8 + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY)),1); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,AN_EMPTY_ARRAY_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY),46); +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_identifier_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_identifier_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8007633b036c7542295a5f955e45a567a138e29b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_identifier_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_identifier_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_identifier_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d8ac26ebbc12ef8dbb07be072ccd863b88f19000 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_identifier_elem.cxx @@ -0,0 +1,135 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_aname (aname) + + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_aname_aname + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + #define BOOST_VMD_REGISTER_num (num) + #define BOOST_VMD_DETECT_num_num + #define BOOST_VMD_REGISTER_eeb (eeb) + #define BOOST_VMD_DETECT_eeb_eeb + #define BOOST_VMD_REGISTER_grist (grist) + #define BOOST_VMD_DETECT_grist_grist + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANIDENTIFIER3 ccc + #define ANIDENTIFIER5 aname + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ANIDENTIFIER3 ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ANUMBER ATUPLE ANIDENTIFIER5 + + #define A_TUPLE (*,#,zzz ()) + #define JDATA somevalue + #define A_SEQ (num (split) clear)(%)(#) + #define A_LIST (eeb (5),(grist,(&,BOOST_PP_NIL))) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ATUPLE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,dvd,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER)),1); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST + ( + BOOST_PP_IS_BEGIN_PARENS + ( + BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),zzz,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,JDATA,somevalue,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_PP_IS_BEGIN_PARENS + ( + BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST_EQ + ( + BOOST_PP_TUPLE_ELEM + ( + 0, + BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,0),(eeb),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ), + 5 + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),grist,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,JDATA,babble,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),eeb,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_list_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_list_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..09d498cc74f70af1bea6500a3a221e0be74bf800 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_list_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_list_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_list_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7df3f19454242a32220b2a23bfdd7765b93cde4e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_list_elem.cxx @@ -0,0 +1,64 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST2 (10,(11,(12,(13,BOOST_PP_NIL)))) + #define ALIST3 (100,(101,(102,(103,BOOST_PP_NIL)))) + #define ALIST5 (200,(201,(202,(203,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST2 ATUPLE + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATUPLE ALIST3 + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST5 ASEQ ATUPLE ANIDENTIFIER + + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 456 + #define PLUS_ALIST yyt (j,(ii%,BOOST_PP_NIL)) + #define JDATA ggh + #define KDATA (a,(b,BOOST_PP_NIL)) name + #define ELISTP BOOST_PP_NIL 231 + #define A_SEQ ((25,BOOST_PP_NIL) 3)((26,BOOST_PP_NIL) 4)((27,BOOST_PP_NIL) 5) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_LIST_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ALIST,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ELISTP,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST),3); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_number_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_number_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f552416fef9e99d5de3c72e886d0f443bbd9b8a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_number_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_number_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_number_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ddf282c11dc9a233c6b874f62c3270b127e60103 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_number_elem.cxx @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ANUMBER2 25 + #define ANUMBER3 158 + #define ANUMBER5 73 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST ANUMBER2 ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER3 ANIDENTIFIER ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ANUMBER5 ATUPLE ANIDENTIFIER + + #define A_TUPLE (27,251,145 ()) + #define JDATA 43 + #define A_SEQ (73 (split) clear)(red)(green 44) + #define A_LIST (17 (5),(grist,(yellow,BOOST_PP_NIL))) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,0),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER)),5); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(2,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,253 num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,17 181 201 somevalue num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_seq_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_seq_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..505cd488d7161c44b4e5d56f36abfb6ae38df169 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_seq_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_seq_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_seq_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4ccfc6437fab0526eba63fdc6cc3e53f2c100684 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_seq_elem.cxx @@ -0,0 +1,64 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ASEQ2 (75)(76)(77) + #define ASEQ3 (147)(148)(149) + #define ASEQ5 (221)(222)(223) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ2 ATUPLE + #define ASEQUENCE3 ASEQ3 ANIDENTIFIER ATUPLE ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ5 ATUPLE ANIDENTIFIER + + #define A_SEQ_PLUS (mmf)(34)(^^)(!) 456 + #define PLUS_ASEQ yyt (j)(ii%) + #define JDATA ggh + #define KDATA (a)(b) name + #define A_SEQ (25)(26)(27) 33 + #define ATUPLE2 (0,1,2,3,((VMD_TEST_88_,VMD_TEST_1_))((VMD_TEST_99_,VMD_TEST_3_))((VMD_TEST_2_))((VMD_TEST_99_,VMD_TEST_100_,VMD_TEST_101_)) gene) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(5,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_SEQ_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ASEQ,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_SEQ,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ),33); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(4,ATUPLE2),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_tuple_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_tuple_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e67decc5d7a62d18fb019462ad3538e4fa162a4b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_tuple_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_tuple_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_tuple_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c2b02202d0c86a5f4ae5701f7dcebd5987da7202 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_tuple_elem.cxx @@ -0,0 +1,76 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ATUPLE2 (10,11,12,13) + #define ATUPLE3 (100,101,102,103) + #define ATUPLE5 (200,201,202,203) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ ATUPLE2 + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATUPLE3 ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ ATUPLE5 ANIDENTIFIER + + #define A_TUPLE_PLUS (mmf,34,^^,!) 456 + #define PLUS_ATUPLE yyt (j,ii%) + #define JDATA ggh + #define KDATA (a,b) name + #define A_SEQ (25)(26)(27) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_TUPLE_PLUS () 83 + +#endif + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE),3),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_TUPLE_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ATUPLE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,A_SEQ,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,AN_EMPTY_TUPLE_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE),83); + +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_type_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_after_type_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4c8eafa0a18ce16151a1b831ac5c06554a97486b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_type_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_after_type_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_after_type_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2b2ca2c28a6a6073d5b71ff348fe7f7a1e1122a6 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_after_type_elem.cxx @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ATYPE BOOST_VMD_TYPE_UNKNOWN + #define ATYPE2 BOOST_VMD_TYPE_SEQUENCE + #define ATYPE3 BOOST_VMD_TYPE_SEQ + #define ATYPE5 BOOST_VMD_TYPE_NUMBER + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ATYPE ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST ATYPE2 ATUPLE + #define ASEQUENCE3 ASEQ ATYPE3 ANIDENTIFIER ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ATYPE5 ATUPLE ANIDENTIFIER + + #define A_TUPLE (27,251,BOOST_VMD_TYPE_TUPLE ()) + #define JDATA BOOST_VMD_TYPE_EMPTY + #define A_SEQ (BOOST_VMD_TYPE_LIST (split) clear)(red)(green 44) + #define A_LIST (BOOST_VMD_TYPE_ARRAY (5),(grist,(yellow,BOOST_PP_NIL))) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,0),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE)),5); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(2,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_VMD_TYPE_TYPE num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_VMD_TYPE_TUPLE 181 201 somevalue num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_android.cpp b/tools/boost_1_65_1/libs/vmd/test/test_android.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eaf61a04d2b87d615caccc9ab17220138474804b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_android.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_android.cxx b/tools/boost_1_65_1/libs/vmd/test/test_android.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d8c8dc50319373c71e05a2fa0b24c18b5fc44d0d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_android.cxx @@ -0,0 +1,56 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if !BOOST_PP_VARIADICS + +# if defined __GCCXML__ +BOOST_ERROR("No variadic macro support: __GCCXML__ defined."); +# elif defined __CUDACC__ +BOOST_ERROR("No variadic macro support: __CUDACC__ defined."); +# elif defined __PATHSCALE__ +BOOST_ERROR("No variadic macro support: __PATHSCALE__ defined."); +# elif defined __DMC__ +BOOST_ERROR("No variadic macro support: __DMC__ defined."); +# elif defined __CODEGEARC__ +BOOST_ERROR("No variadic macro support: __CODEGEARC__ defined."); +# elif defined __BORLANDC__ +BOOST_ERROR("No variadic macro support: __BORLANDC__ defined."); +# elif defined __MWERKS__ +BOOST_ERROR("No variadic macro support: __MWERKS__ defined."); +# elif (defined __SUNPRO_CC && __SUNPRO_CC < 0x5130) +BOOST_ERROR("No variadic macro support: __SUNPRO_CC defined below version 12.3."); +# elif defined __HP_aCC && !defined __EDG__ +BOOST_ERROR("No variadic macro support: __HP_aCC defined and __EDG__ not defined."); +# elif defined __MRC__ +BOOST_ERROR("No variadic macro support: __MRC__ defined."); +# elif defined __SC__ +BOOST_ERROR("No variadic macro support: __SC__ defined."); +# elif defined __IBMCPP__ +BOOST_ERROR("No variadic macro support: __IBMCPP__ defined."); +# elif defined __PGI +BOOST_ERROR("No variadic macro support: __PGI defined."); +# /* VC++ (C/C++) */ +# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__)) && !defined __clang__ +# /* Wave (C/C++), GCC (C++) */ +# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__ +# /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */ +# elif !defined __cplusplus && __STDC_VERSION__ < 199901L +BOOST_ERROR("No variadic macro support: __STDC_VERSION__ is less than 199901L."); +# elif defined __cplusplus && __cplusplus < 201103L +BOOST_ERROR("No variadic macro support: __cplusplus is less than 201103L."); +# endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_elem.cpp b/tools/boost_1_65_1/libs/vmd/test/test_array_elem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8e94540960b0af435069f21a48d377300c5b513b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_elem.cxx b/tools/boost_1_65_1/libs/vmd/test/test_array_elem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..460542756eef5018b09e71f923cb8d234c732b68 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_elem.cxx @@ -0,0 +1,74 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) +#if !BOOST_VMD_MSVC_V8 + #define ANARRAY_EMPTY (0,()) +#endif + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 +#if !BOOST_VMD_MSVC_V8 + #define ASEQUENCE5 ASEQ ANUMBER ANARRAY_EMPTY ATUPLE +#endif + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_TYPE_ARRAY))); + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY))),27); + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY))),38); + BOOST_TEST_EQ(BOOST_PP_ARRAY_SIZE(BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_TYPE_ARRAY)),3); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(3,BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_TYPE_ARRAY)),22); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_TYPE_ARRAY))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_ARRAY))); + +#if !BOOST_VMD_MSVC_V8 + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY))),2); + BOOST_TEST_EQ(BOOST_PP_ARRAY_SIZE(BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_TYPE_ARRAY)),0); +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_empty.cpp b/tools/boost_1_65_1/libs/vmd/test/test_array_empty.cpp new file mode 100644 index 0000000000000000000000000000000000000000..230ce39c0bc0387a0ae740f6bfa6292ff603489c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_empty.cxx b/tools/boost_1_65_1/libs/vmd/test/test_array_empty.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5f1f94d64d46c79f61d5da40d4dab27220b272d8 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_empty.cxx @@ -0,0 +1,42 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 456 + #define PLUS_ANARRAY yyt (2,(j,ii%)) + #define JDATA ggh + #define KDATA (2,(a,b)) name + #define A_SEQ ((1,(25)))((1,(26)))((1,(27))) + #define AN_EMPTY_ARRAY_PLUS (0,()) 46 + #define EMPTY_ARRAY_INVALID ("string",() xx) + #define EMPTY_ARRAY (0,()) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(anything)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(AN_ARRAY_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(PLUS_ANARRAY)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(JDATA)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(KDATA)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(A_SEQ)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(AN_EMPTY_ARRAY_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(EMPTY_ARRAY_INVALID)); + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(EMPTY_ARRAY)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_equal.cpp b/tools/boost_1_65_1/libs/vmd/test/test_array_equal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0bdf0432725adf56775cb3a5b9f020ce208e1906 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_equal.cxx b/tools/boost_1_65_1/libs/vmd/test/test_array_equal.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7f0c36a1debb9b1f5b7f0d75ec49bbb9ceda075e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_equal.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + + #define ANARRAY (3,(aaa,bbb,38)) + #define ANARRAY2 (3,(bbb,aaa,38)) + #define ANARRAY3 (3,(bbb,aaa,38)) + #define ANARRAY4 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) + #define ANARRAY5 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) + #define ANARRAY6 (4,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2),37))) + #define ATUPLE (aaa) + #define ATUPLE2 (aaa) + + BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY4,ANARRAY5,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY2,ANARRAY3,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ANARRAY2,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY5,ANARRAY6,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE,ATUPLE2,BOOST_VMD_TYPE_ARRAY)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_to_seq.cpp b/tools/boost_1_65_1/libs/vmd/test/test_array_to_seq.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4d6d3bc41131a1e49368b0154e6db75c9ad965b8 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_to_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_to_seq.cxx b/tools/boost_1_65_1/libs/vmd/test/test_array_to_seq.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ff9cac67c331cd1c447c8c20adc3aa15f244fd38 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_to_seq.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (4,(1,2,3,4)) + #define AN_EMPTY_ARRAY (0,()) + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_VMD_ARRAY_TO_SEQ(AN_ARRAY)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ARRAY_TO_SEQ(AN_EMPTY_ARRAY))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_to_tuple.cpp b/tools/boost_1_65_1/libs/vmd/test/test_array_to_tuple.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b8804e0149c0fa9c748f2f1097219bfa94b36046 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_to_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_array_to_tuple.cxx b/tools/boost_1_65_1/libs/vmd/test/test_array_to_tuple.cxx new file mode 100644 index 0000000000000000000000000000000000000000..494f6df6573093ff15db8ae6d2b88b3d8e4429c3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_array_to_tuple.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (4,(1,2,3,4)) + #define AN_EMPTY_ARRAY (0,()) + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ARRAY_TO_TUPLE(AN_ARRAY)),2); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ARRAY_TO_TUPLE(AN_EMPTY_ARRAY))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_ary.cpp b/tools/boost_1_65_1/libs/vmd/test/test_ary.cpp new file mode 100644 index 0000000000000000000000000000000000000000..19f762e2a8b0cf8606b8da98392ec535e2280583 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_ary.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_ary.cxx b/tools/boost_1_65_1/libs/vmd/test/test_ary.cxx new file mode 100644 index 0000000000000000000000000000000000000000..af9692034b2b8889822a8eeb6ae08a0031059965 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_ary.cxx @@ -0,0 +1,61 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ASEQ2 (1)(2)(3) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ATYPE BOOST_VMD_TYPE_TUPLE + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ATYPE ASEQ ALIST + + BOOST_TEST(BOOST_VMD_IS_UNARY((3))); + BOOST_TEST(BOOST_VMD_IS_UNARY((3)(4))); + BOOST_TEST(BOOST_VMD_IS_UNARY((4,(a,b,c,d)))); + BOOST_TEST(BOOST_VMD_IS_UNARY((4,(5,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_IS_UNARY(ANIDENTIFIER)); + BOOST_TEST(BOOST_VMD_IS_UNARY(ANUMBER)); + BOOST_TEST(!BOOST_VMD_IS_UNARY(ASEQUENCE)); + BOOST_TEST(!BOOST_VMD_IS_UNARY(ASEQUENCE4)); + BOOST_TEST(!BOOST_VMD_IS_UNARY(ASEQUENCE5)); + + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE)); + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE2)); + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE3)); + BOOST_TEST(!BOOST_VMD_IS_MULTI(ASEQUENCE4)); + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE5)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert.cpp new file mode 100644 index 0000000000000000000000000000000000000000..351a5c4050bb64842f2bf64b2a0b87829b83bbe1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert.cxx new file mode 100644 index 0000000000000000000000000000000000000000..72e978706985f0f227453c4ba1cba98f0e5b53bc --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert.cxx @@ -0,0 +1,89 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_PTUPLE (*,#,44) + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 156 + #define A_TUPLE (*,#,zzz ()) + #define DATA + #define JDATA somevalue + #define KDATA (a,b) name + #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 56 + #define A_SEQ (73 (split) clear)(red)(green 44) + #define A_SEQ2 (73 (split) clear)(BOOST_VMD_TYPE_LIST)(green 44) + #define A_SEQ_PLUS (mmf)(34)(^^)(!) 456 + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + + BOOST_VMD_ASSERT(25) + BOOST_VMD_ASSERT(BOOST_PP_DEC(2)) + BOOST_VMD_ASSERT(BOOST_PP_INC(255)) + BOOST_VMD_ASSERT + ( + BOOST_PP_EQUAL + ( + BOOST_PP_TUPLE_ELEM(2,A_PTUPLE), + 44 + ) + ) + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,AN_ARRAY_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)),156)) + BOOST_VMD_ASSERT + ( + BOOST_PP_EQUAL + ( + BOOST_PP_TUPLE_ELEM + ( + 2, + BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),(dummy1,zzz),BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX,BOOST_VMD_TYPE_IDENTIFIER) + ), + 1 + ) + ) + + BOOST_VMD_ASSERT(BOOST_VMD_IS_EMPTY(DATA BOOST_PP_EMPTY())) + BOOST_VMD_ASSERT(BOOST_VMD_IS_IDENTIFIER(JDATA,somevalue)) + BOOST_VMD_ASSERT(BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,2))) + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,A_LIST_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)),56)) + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)),73)) + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_SEQ_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,A_SEQ_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),34)) + BOOST_VMD_ASSERT(BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE))))) + + BOOST_VMD_ASSERT(BOOST_VMD_IS_TYPE(BOOST_PP_SEQ_ELEM(1,A_SEQ2))) + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..af7f1bf95c5d85cca082a8907bec81ded92ad8d0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..40b7ec0fcbc565110504b6707544c06733f7aefd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail.cxx @@ -0,0 +1,23 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_VMD_ASSERT(0) + +#else + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_array.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_array.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dc09c53c36ffbf6916fcd2c5d0ef4577bd35a941 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_array.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_array.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1a8f17481c89cebb1c08c9f5fd921b24c209b36d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_array.cxx @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 156 + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,AN_ARRAY_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)),256),BOOST_VMD_TEST_FAIL_ARRAY) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_identifier.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_identifier.cpp new file mode 100644 index 0000000000000000000000000000000000000000..86487b4642e9028d5043a3b089fca94683dbe0d4 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_identifier.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_identifier.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1f20d8911165b161aeb56d1afa8c2a4607085c70 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_identifier.cxx @@ -0,0 +1,41 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zzz ()) + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + + BOOST_VMD_ASSERT + ( + BOOST_PP_EQUAL + ( + BOOST_PP_TUPLE_ELEM + ( + 2, + BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),(dummy1,zzz),BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX,BOOST_VMD_TYPE_IDENTIFIER) + ), + 0 + ), + BOOST_VMD_TEST_FAIL_IDENTIFIER + ) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_empty.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_empty.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a04e35de01952ac6084c547beabfb021e601276a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_empty.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_empty.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ad16eda302fc31087886107c0cd4743eef093cc3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_empty.cxx @@ -0,0 +1,25 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define DATA x + + BOOST_VMD_ASSERT(BOOST_VMD_IS_EMPTY(DATA BOOST_PP_EMPTY()),BOOST_VMD_TEST_FAIL_IS_EMPTY) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_identifier.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_identifier.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49cb1819228743cccb1ab4c25260ba22695f30f5 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_identifier.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_identifier.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b7ffe1c9f869c98f28656ae912faba06350a7706 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_identifier.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define JDATA somevalue + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + + BOOST_VMD_ASSERT(BOOST_VMD_IS_IDENTIFIER(JDATA,zzz),BOOST_VMD_TEST_FAIL_IS_IDENTIFIER) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_number.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..45641ac46ce6b6a952bd82cf26245351db61e448 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_number.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_number.cxx new file mode 100644 index 0000000000000000000000000000000000000000..40c190fb01b75eec6228aa43d5c1dd1c084c5aca --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_is_number.cxx @@ -0,0 +1,25 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT(BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,1)),BOOST_VMD_TEST_FAIL_IS_NUMBER) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_list.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_list.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e5aa707dba66234cbf0cb76732a746e2cdb29c6e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_list.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_list.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8d4d92f311c50d979672c438eff6379f271c19e9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_list.cxx @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 56 + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,A_LIST_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)),36),BOOST_VMD_TEST_FAIL_LIST) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d5b4938168d546887fbc74b00765b4100c6c6c60 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c82f3d068228f2abbc877630cfd69d8afc99f4bd --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number.cxx @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (73 (split) clear)(red)(green 44) + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)),72),BOOST_VMD_TEST_FAIL_NUMBER) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number2.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d5fa6e76437d85d40eb88bbc28e431c5efcef70c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number2.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..66166d11e6880783cce1b1fc9efc3f57f46e7593 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_number2.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (73 (split) clear)(red)(green 44) + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_NUMBER(BOOST_PP_SEQ_ELEM(0,A_SEQ))),72),BOOST_VMD_TEST_FAIL_NUMBER) + +#else + + typedef char BOOST_VMD_TEST_FAIL_NUMBER[-1]; + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_seq.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_seq.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f4b4c41199252c4d511ee8b7b530c0647194cd25 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_seq.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_seq.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c2ed1388f6e72579a26139f15dca04023e17178f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_seq.cxx @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ_PLUS (mmf)(34)(^^)(!) 456 + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_SEQ_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,A_SEQ_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),456),BOOST_VMD_TEST_FAIL_SEQ) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_tuple.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_tuple.cpp new file mode 100644 index 0000000000000000000000000000000000000000..74234e0b2c828e24ec844e1f24dda0946e6d2f0b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_tuple.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_tuple.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0c9b4edd703c55da50ae67c9c5fe8c45a47992d2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_tuple.cxx @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define KDATA (a,b) name + + BOOST_VMD_ASSERT(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE))),BOOST_VMD_TEST_FAIL_TUPLE) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_vcstring.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_vcstring.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4244af6b23deb7f5987859a09bcd7e11d708930c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_vcstring.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_vcstring.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_vcstring.cxx new file mode 100644 index 0000000000000000000000000000000000000000..500d4e7f11704a4218ab4bc45040710dd68ea175 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_fail_vcstring.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_VMD_ASSERT(0,BOOST_VMD_VC_FAILURE) + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c8731ad6f839f8d2626e15cb4de8a5d33c6bf676 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7ed562ba408b95ea03094755b5c8814fdd8f064d --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array.cxx @@ -0,0 +1,35 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (7,(5,7,f,x,%,#,U)) +#if !BOOST_VMD_MSVC_V8 + #define AN_EMPTY_ARRAY (0,()) +#endif + + BOOST_VMD_ASSERT_IS_ARRAY((4,(x,3,e,2))) + BOOST_VMD_ASSERT_IS_ARRAY((6,(x,3,e,2,(4,(x,3,e,2)),%))) + BOOST_VMD_ASSERT_IS_ARRAY(AN_ARRAY) +#if !BOOST_VMD_MSVC_V8 + BOOST_VMD_ASSERT_IS_ARRAY(AN_EMPTY_ARRAY) +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8301c323303ba2e84a04f3640a21dfe92e509a41 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2381355239cd86a8c5b5b7f6afa92fd086afb97a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail.cxx @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY((y,(x,3,e,2))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail2.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0652bfb31883f629b06846df66c8ad3c193f8f32 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail2.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8b73545738c5bf90e73ea2301086b2b148235461 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY((3,(x,3,e,2))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail3.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a4b00bbaec02dd3ce399ed7faf5e12f9d360205b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail3.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..074fad2a7b9d6842e5923e5a8ed927431258dcc9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY(tree) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail4.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b712e2deae6dfab4ecc16958360b7160d216cddc --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail4.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b057d06dd9781d1fdb9c7efbd229948f61e6c8c1 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_array_fail4.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY((3,(3,5,6) xc)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty.cpp new file mode 100644 index 0000000000000000000000000000000000000000..261b24842816c8bd2719474a21a3238fd8e78c16 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ac4380973a68053582456255122fdf472668b90e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty.cxx @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define DATA + #define OBJECT OBJECT2 + #define OBJECT2 + #define FUNC(x) FUNC2(x) + #define FUNC2(x) + + BOOST_VMD_ASSERT_IS_EMPTY(BOOST_PP_EMPTY()) + BOOST_VMD_ASSERT_IS_EMPTY(DATA BOOST_PP_EMPTY()) + BOOST_VMD_ASSERT_IS_EMPTY(OBJECT BOOST_PP_EMPTY()) + BOOST_VMD_ASSERT_IS_EMPTY(FUNC(z) BOOST_PP_EMPTY()) + +#if BOOST_VMD_MSVC + + #define FUNC_GEN() () + #define FUNC_GEN2(x) () + #define FUNC_GEN3(x,y) () + + /* This shows that VC++ does not work correctly in these cases. */ + + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN) /* This incorrectly does not assert */ + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN2) /* This incorrectly does not assert */ + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN3) /* This should produce a compiler error but does not and does not assert */ + +#endif /* BOOST_VMD_MSVC */ + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f28ce18cac8b9a26f5b7baed3bcdd7b190115d57 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b4a63cb740ffacb6bb469d52670400c098557816 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA && !BOOST_VMD_MSVC + + #define FUNC_GEN(x,y) anything + + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN)) + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail2.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fa4973c9ebfc8007fb665780cdd61894b2ff95e2 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail2.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cae149922c0430f4621a95cd5fd87f9f51aaec80 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail2.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + #define FUNC_GEN() anything + + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN)) + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail3.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c6abaa1947c3a0f4d88748765e39d241727d106 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail3.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..97ae47368b40fc8da6134cccd466ba073b858bed --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_empty_fail3.cxx @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_EMPTY(x BOOST_PP_EMPTY()) + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aa765da5286104af1c7cef6b2c07877e6f936667 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier.cxx new file mode 100644 index 0000000000000000000000000000000000000000..94e2d6da60597524d94abbc6f9b145541061fba4 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zzz) + #define JDATA somevalue + #define A_SEQ (num)(%)(#) + #define A_LIST (eeb,(grist,(&,BOOST_PP_NIL))) + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + #define BOOST_VMD_REGISTER_num (num) + #define BOOST_VMD_DETECT_num_num + #define BOOST_VMD_REGISTER_eeb (eeb) + #define BOOST_VMD_DETECT_eeb_eeb + #define BOOST_VMD_REGISTER_grist (grist) + #define BOOST_VMD_DETECT_grist_grist + + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_TUPLE_ELEM(2,A_TUPLE),zzz) + BOOST_VMD_ASSERT_IS_IDENTIFIER(JDATA,somevalue) + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_SEQ_ELEM(0,A_SEQ),num) + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,0),eeb) + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,1),grist) + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9a3c717c8691b759bd0fecd65ad83150f1ac3e86 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5eb5199fff87e181805b2adf4f042a7710853a78 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_identifier_fail.cxx @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + + BOOST_VMD_ASSERT_IS_IDENTIFIER(zzz,somevalue) + +#else + + typedef char BOOST_VMD_IS_IDENTIFIER_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ede28f183349138a6163174f8baae9157f64de8b --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1d08acf9319855e92574161e6e5079fd1c5c329a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list.cxx @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (e,(g,(&,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT_IS_LIST((4,(x,BOOST_PP_NIL))) + BOOST_VMD_ASSERT_IS_LIST(((3,6m,irj),(x,BOOST_PP_NIL))) + BOOST_VMD_ASSERT_IS_LIST(A_LIST) + BOOST_VMD_ASSERT_IS_LIST(BOOST_PP_NIL) + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..00684c8f3459d770685f6562ef91863b27bf5e85 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f1babad530a98c6c7600d1b74c7378dc7a0ef311 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST((4,(x))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail2.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b1fbd6761d5cc36a19a2497d3c7734540abe44c --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail2.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..64c725ad1bcac9c8a35747ae72b434e4b0a7ffd9 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST((4,(5,BOOST_PP_NIL),6)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail3.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d6c979740d87731e4fe26b1bd9e0b41e5effb0f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail3.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..90857e6bcaefd4dbc2fe6095401e7d36a6829e88 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST(4,(5,BOOST_PP_NIL),6) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail4.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..907744ae5238708943e59a479d0e94fe2161ef1f --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail4.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4866f6ae65e38decd15d04c14819d3fc6bd09e14 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_list_fail4.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST((tt,(5,(uu,BOOST_PP_NIL yy)))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3d1886599a9a26231907e3e9d9e207135087f143 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f03873ddeb844f9508dcf07de7a88e0ed84206d0 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number.cxx @@ -0,0 +1,36 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include + +int main() + { + + #if BOOST_PP_VARIADICS + + #define A_TUPLE (4,241,zzz) + #define KDATA 213 + #define A_SEQ (num)(78)(42) + #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT_IS_NUMBER(BOOST_PP_TUPLE_ELEM(1,A_TUPLE)) + BOOST_VMD_ASSERT_IS_NUMBER(KDATA) + BOOST_VMD_ASSERT_IS_NUMBER(BOOST_PP_SEQ_ELEM(2,A_SEQ)) + BOOST_VMD_ASSERT_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,2)) + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cf112a1950392eebc59874b69e948effd9f74e5a --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ff4c3efa61c01b0f5cb4952178b9d72fd69747f7 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_number_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_NUMBER(data) + +#else + + typedef char BOOST_VMD_ASSERT_IS_NUMBER_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq.cpp new file mode 100644 index 0000000000000000000000000000000000000000..00c14c7c72a77ff4e30f223ccbba9f8d10a8ea93 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4afb1d96241d88aaa93f9bbe7f8800dee9aef102 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq.cxx @@ -0,0 +1,47 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ATUPLE (0,1,2,3,((VMD_TEST_88_,VMD_TEST_1_))((VMD_TEST_99_,VMD_TEST_3_))((VMD_TEST_2_))((VMD_TEST_99_,VMD_TEST_100_,VMD_TEST_101_))) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_SEQ () + +#endif + + BOOST_VMD_ASSERT_IS_SEQ((x)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)(z)(2)(3)(4)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)(4)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)((4,(x,BOOST_PP_NIL)))) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)((x)(y)(z)(2)(3)(4))((1,2))(3)((4,(x,BOOST_PP_NIL)))) + BOOST_VMD_ASSERT_IS_SEQ(BOOST_PP_TUPLE_ELEM(4,ATUPLE)) + +#if !BOOST_VMD_MSVC_V8 + + BOOST_VMD_ASSERT_IS_SEQ(()) + BOOST_VMD_ASSERT_IS_SEQ(AN_EMPTY_SEQ) + +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail.cpp new file mode 100644 index 0000000000000000000000000000000000000000..964e3ccd109c44b4c3368d38bdd26bf36a87eb33 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a47dcc33bd36c72a19e87cc24635685c6f15bb49 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ((y,(x,3,e,2))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail2.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d76981a4d65dea0f5bfc5ec1c7f7d914b11141f4 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail2.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ff21c6c16194c2b9151f58abf3965ae68ecae061 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ((y)2(x)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail3.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ffc9851bc5e4c9b255844618374bf96bc0db4ca3 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail3.cxx b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9f3117e77eb7961b41ddc1eafee91705e6df0c2e --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include +#include + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ(y(z)(x)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail4.cpp b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..541ae3b04e4ab5a1f373c0f6bef2d24389f1af35 --- /dev/null +++ b/tools/boost_1_65_1/libs/vmd/test/test_assert_is_seq_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include diff --git a/tools/boost_1_65_1/libs/wave/ChangeLog b/tools/boost_1_65_1/libs/wave/ChangeLog new file mode 100644 index 0000000000000000000000000000000000000000..8442bb0a4a67c91e6ffdd8191379342c23c15c41 --- /dev/null +++ b/tools/boost_1_65_1/libs/wave/ChangeLog @@ -0,0 +1,1961 @@ +Boost.Wave: A Standard compliant C++ preprocessor library +http://www.boost.org/ + +Copyright (c) 2001-2013 Hartmut Kaiser. Distributed under the Boost +Software License, Version 1.0. (See accompanying file +LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +------------------------------------------------------------------------------- + +TODO (known issues): +- Fix expansion of macros, which replacement-list terminates in a partial + macro expansion. +- Fix the re2c lexer for iterators others then string::iterator (or more + generally for iterators, which aren't random access iterators) +- Try to remove the second parameter from the pp_iterator<>::force_include + function. +- Fix the trigraph backslash problem in the re2c (C/C++ and IDL) scanners, if + there is the end of the (internal) buffer just in between a '??/' and a '\n'. + +------------------------------------------------------------------------------- + +CHANGELOG + +Boost V1.55: + - Fixed #8848: Wave driver improperly processes 0xFFFFui64 token + - Fixed #9098: Wave driver option --c++0x invalid + +Boost V1.54: + - Fixed #8478: Make Boost.wave compatible with Clang's -Wimplicit-fallthrough + diagnostic. + +Boost V1.53: + - Fixed a problem with context<>::add_macro_definition which sometimes + appended a superfluous T_EOF to the macro replacement list. + +Boost V1.52.0: + - Added util::create_directories() wrapper to account for new behavior of + boost::filesystem::create_directories(). + - Fixed an obscure problem when preprocessing directives wouldn't be recognized + if the previous line contained nothing but an empty macro invocation + (see new test case t_9_023.cpp) + - Added a new command line option --license= to the Wave driver tool + which allows to pre-pend the content of a (license) file to every newly + created file. This option simplifies the implementation of partial + preprocessing as done on Phoenix, Fusion, etc. + - Changed the effect of the -N command line option to simply not expand + the macro by pretending it was not defined. Earlier the whole invocation + sequence was skipped, now we skip only the macro itself, which still expands + the arguments for the macro invocation. + - Fixed a couple of compilation warnings + +Boost V1.51.0 + - Fixed #7050: Invalid memory write bug in lexing_exception + - Fixed #7159: Text-lines are processed as if they were preprocessing directives + - Changed --c++0x command line option to --c++11. + +Boost V1.50.0 + - V2.3.2 + - Fixed #6758: not all members are initialized by base_iteration_context + constructor. + - Fixed #6838: Adding include file with force_include makes Wave fail to emit + #line directive + - Added support for test of --forceinclude option to testwave executable, + added test case verifying #6838 is fixed. + - Fixed #6870: build wave driver failed + +Boost V1.48.0 + - V2.3.1 + - Added the flag support_option_emit_contnewlines allowing to control whether + backslash newline sequences are emitted by the Wave library. The default is + as before: these tokens will be silently ignored (after the token positions + have been properly updated). Note: this option is supported by the SLex lexer + module only. + - Fixed #5887: flex_string.hpp needs to include + +Boost V1.47.0 +- V2.3.0 +- After preprocessing the body of any #pragma wave option() the wave tool now + concatenates all adjacent string literals into a single string literal. +- Fixed whitespace handling, added a corresponding set of test cases + (t_9_020.cpp) +- Added a new preprocessing hook: locate_include_file allowing to customize the + way include files are located. +- Added new command line option --noexpand/-N to the Wave driver allowing to + suppress macro expansion for a given macro name (works for both, object like + and function like macros). This option has to be used very carefully as it + not only leaves the whole macro invocation untouched in the generated output + but also removes this macro from consideration for Wave itself. This can + cause unexpected results if the suppressed macro would influence #ifdef's + later on. +- Fixed Wave driver to retain all macros defined on the command line in + interactive mode. +- Fixed problem #5554: wave slex parser eof without eol skips the last line. +- Added the compile time configuartion option BOOST_WAVE_WCHAR_T_SIGNEDNESS, + which can be set to BOOST_WAVE_WCHAR_T_AUTOSELECT, BOOST_WAVE_WCHAR_T_FORCE_SIGNED, + or BOOST_WAVE_WCHAR_T_FORCE_UNSIGNED), it defaults to autoßselect. +- Fixed a problem in teh wave driver tool related to #pragma option(output). + If wave was invoked in rapid succession this erroneously appended to an + existing file instead of overwriting that file. +- Fixed #5569: slex CONTLINE token works only for LF line endings + +Boost V1.46.0 +- V2.2.0 +- Added recognition of C++0x keywords to Re2C lexers. +- Added --c++0x command line option to Wave to enabling the recognition of + C++0x keywords, converting those to C++0x tokens. +- Adapted all of the library to play well with Boost.Filesystem V3 (which is + the default from now on). +- Added support for extended character and string literals, added test case + (which required to add C++0x support to the test application). +- Added proper predefined macros fro --c++0x mode. __cplusplus is currently + defined to 201101L, but this will change when the Standard is finalized. +- Fixed a problem with object like macros, which when being adjacent to a + parenthesis, caused the parenthesis to disappear when the macro expansion + was suppressed by the expanding_object_like_macro() hook function. +- Fixed a bug in pragma option(preserve), missing to set to preserve=1 if + after the previous value was preserve=2. +- Changed the --preserve option of the wave tool to interprete the integer + argument in a slightly different way: + 0: no whitespace is preserved, + 1: only begin of line whitespace is preserved, + 2: only begin of line whitespace and comments are preserved, + 3: all whitespace is preserved + The #pragma wave option(preserve) now supports these arguments: + [0|1|2|3|push|pop]. + +Boost V1.45.0 +- V2.1.0 +- Token pasting is well formed only as long as the formed token(s) are + pp_tokens as defined by the C++0x Standard. Until now, Wave allowed for + non-pp_tokens to be formed in --variadics mode. +- Fixed a problem, which prevented reporting /##/ in a macro definition as + invalid token pasting. +- Fixed problem preventing the skipped_token hook to be called for 'inactive' + conditional preprocessing directive tokens. Improved overall consistency in + reporting skipped tokens to the hooks function when processing conditional + preprocessing directives. Added a new test case verifying the skipped_token + hook gets called reproducibly (t_2_020.cpp). +- Fixed a problem with the pp hooks 'expanding_object_like_macro' and + 'expanding_function_like_macro', which when returning true were stopping all + preprocessing instead of just inhibiting the expansion of the macro. +- Fixed a duplicated call to the pp hook skipped_token for preprocessing + directives inside inactive conditional branches. +- Changing exception handling to fix clang++ regression errors. +- Replaced assert() with BOOST_ASSERT to pacify the Boost inspect tool. + +Boost V1.44.0 +- V2.0.6 +- Added information about the file type to iteration context. This can be + either main_file, system_header, or user_header depending whether the handled + file is the main file to preprocess, a include file opened from `#include <>`, + or a include file opened from `#include ""`. +- Added support for new Boost visibility macros. Properly exported all + exceptions, etc. + +Boost V1.43.0 +- V2.0.5 +- Fixed the wave driver application to strip leading and trailing whitespace + from macro names specified on the command line using -U. +- Fixed line number counting for lines containing nothing but whitespace + followed by a C++ comment if the next line is a pp directive. +- Fixed emitting of a #line directive after returned from an include file. +- A couple of fixes allowing to properly report the current line number in + #line directives for different whitespace preserve modes (see --preserve/-p). +- Added new preprocessing hook: emit_line_directive, allowing to customize the + format of the generated #line directive. +- Changed --line/-l command line option of the wave driver application to + accept 0, 1, and 2 as options. The option values 0 and 1 behave as before + (disable/enable the generation of #line directives), while the option value 2 + will generate the #line directive using the relative filename (instead of the + absolute filename emitted from option 1). The default option is value 1. +- Added new example: emit_custom_line_directives, demonstrating the use of the + new preprocessing hook. +- Added new preprocessing hook: found_unknown_directive, which is being invoked + whenever an unknown preprocessor directive (i.e. '#' followed by some + identifier) is detected. It allows to interpret the directive and to provide + some replacement text. +- Added new example: custom_directives demonstrating the usage of the new + preprocessing hook. +- Fixed #4113: cpp_lexer does not handle qualified backslashes correctly. +- Fixed #3106: wave on VS2010 beta compiler generates error. + +Boost V1.42.0 +- V2.0.4 +- Fixed Wave for latest changes in multi_pass iterator. + +Boost V1.41.0 +- V2.0.3 +- Switched to Re2C V0.13.5 +- Fixed --list_includes/-l command line option of the wave driver tool to + correctly indent the generated list of included files. +- Finally fixed all remaining examples. Everything seems to work fine now. +- Specifying a custom token type now works as expected. The new lexer interface + introduced in V2.0 broke this part. +- Removed old code related to pre Boost V1.31 (related to V1 of iterator + library). +- Added a new commandline option --macrocounts/-c to the Wave driver application + which lists all macro invocation counts to an optionally specified file + (default is cout). +- Fixed compilation problems caused by recent changes to the multi_pass iterator + from Spirit V2.1. +- Added the new preprocessing hooks detected_pragma_once() and + detected_include_guard() which are getting called whenever either a #pragma + once has been detected or if the include guard heuristics detected an + include guard for a particular include file. +- Added a new command line option to the wave driver tool: --listguards/-g + allowing to trace all include files which are either contain a #pragma once + or contain include guards. +- Started to elminate g++ struct aliasing warnings (more to fix, mostly in + flex_string). + +Boost V1.40.0 +- V2.0.2 +- Fixed a long standing race condition inhibiting to use Wave in multi threaded + environments. +- Incorporated the changes from latest version of the flex_string class (#2946). +- Fixed another race condition triggering problems using Wave in multi-threaded + environments. + +Boost V1.39.0 +- V2.0.1 +- Fixed Wave to compile with BOOST_FILESYSTEM_NO_DEPRECATED defined (i.e. the + library doesn't use the deprecated filesystem interface anymore). + +Boost V1.37.0 +- Updated examples to reflect the recent changes in the used multi_pass + iterator. +- Fixed documentation links still pointing to the old Boost CVS (thanks to + Jürgen Hunold for providing the patch). + +Boost V1.36.0 +- Wave Version 2.0 is a new major release introducing some breaking API changes, + preventing it to be used with Boost versions earlier than V1.36.0. The API + and hook interface have been streamlined for more consistency. See the + documentation for more details. + +- Added an additional template parameter to the context object, allowing to + specify any possibly derived type. This change propagates to the preprocessing + hooks, which now get passed the most derived context type as its first + argument allowing to access protected members in the original context type. + This fixes ticket #1752. +- Fixed a problem during parsing of #pragma wave directive, where the value + sequence contained a closing parenthesis. This caused a premature end of the + pragma value parsing. +- Fixed handling of support_option_single_line, which was ignored under certain + circumstances. +- Fixed ticket #1766: Wrong evaluation of conditional preprocessor directives + with predefined macros __FILE__, __LINE__ and __INCLUDE_LEVEL__. This bug + triggered an error in constructs like #ifndef __FILE__. Thanks to Daniel + Wadehn for reporting and supplying a patch. Added corresponding regression + test: t_2_018.cpp. +- Fixed a bug which reported a valid macro redefinition as invalid if the macro + replacement text referred to a second or higher parameter of this macro. +- Fixed a problem in the wave tool to allow two errors to occur while + preprocessing two consecutive tokens. +- Adjusted Spirit header includes to point to conform to the new directory + structure, removed support for Spirit versions earlier than V1.7. +- Started to migrate to new multi_pass iterators from Spirit V2.0. + +Boost V1.35.0 +- Wave Version 1.3 +- Changed the return value of the 'evaluated_conditional_expression()' pp hook + to 'bool' allowing to force Wave to re-evaluate the current conditional + expression. This was suggested by Felipe Magno de Almeida. +- Added a wave::context object as first parameter to all pp hook functions. + This is an interface compatibility breaking change. The new pp-hooks can be + disabled by defining the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS + compile time constant to something not equal to zero. By default this + constant will be defined to zero for Boost V1.35.0 and newer, switching to + the new interface by default. +- Added optional support for the import keyword (needed for the C++ module + proposal). The identifier import will be recognized as a keyword, if + the compile time constant BOOST_WAVE_SUPPORT_IMPORT_KEYWORD is defined to + something not equal zero. +- Added new preprocessing hook functions: found_error_directive() and + found_warning_directive() to be called when #error/#warning directives are + encountered. This was suggested by Andreas Sæbjørnsen. +- Added a new sample to Wave: hannibal, a partial C++ parser implementation + initially written by Danny Havenith (http://havenith-verlinden.nl/hannibal/) + who agreed to add this here. Thanks! +- Added new preprocessing hook function: found_line_directive() to be called + when a #line directive is encountered. This was suggested by Andreas + Sæbjørnsen. +- Improved command line handling for the wave applet. +- Incorporated latest bug fixes for the Hannibal sample provided by Danny + Havenith. +- Added loading of a wave.cfg file from anywhere up the filesystem hierarchy + starting from the main input file for the wave driver applet up to the + root of the file system. +- Added support_option_emit_pragma_directive to allow to control at runtime, + whether unknown #pragma directives should be emitted or not. To maintain + compatibility with earlier versions this option is by default on if the + compile time constant BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES was defined to + be not equal to zero and it is off otherwise. +- Enabled XML serialization support. +- Added the throw_exception preprocessing hook, which gets called for every + occurring error (whenever an exception would have been thrown). The default + of this new hook function is to throw the corresponding exception, which + reproduces the old behavior. +- Implemented a new preprocessing hook: generated_token(), which get's called + whenever a token is about to be returned form the library. This function may + be used to alter the token before it gets returned to the calling + application. +- Added a new sample 'real_positions' demonstrating the new generated_token() + preprocessing hook and showing how to use Wave with a new token type without + using a new lexer type. +- Factored out the pure lex_input_interface to simplify writing different lexer + types for Wave. +- Added the token_statistics sample showing how to use Xpressive to build a + lexer for Wave. +- Changed the list_includes sample to use a lexer which is based on the lexertl + library written by Ben Hanson (http://www.benhanson.net/lexertl.html). +- Added a new support_option: insert_whitespace, allowing to switch off + whitespace insertion which is normally (by default) in place to disambiugate + C++ tokens, which would otherwise form different tokens in the output. +- Added a new commandline option to the Wave applet: --disambiguate, allowing + to control whitespace insertion. The default value for this option is + --disambiguate=1, resembling the previous behaviour. Specifying the option + --disambiguate=0 allows to suppress whitespace insertion alltogether. +- Added pragma option values push and pop to the line, preserve and output + options allowing to store and restore the current option. The syntax is: + #pragma wave options(
+PrevUpHomeNext +