Compare commits

...

77 Commits

Author SHA1 Message Date
nobody
8f3f021132 This commit was manufactured by cvs2svn to create branch 'mpl_v2_2'.
[SVN r18675]
2003-06-05 05:15:05 +00:00
Gennaro Prota
ab34b61206 removed superfluous spaces
[SVN r18271]
2003-04-16 22:55:23 +00:00
Gennaro Prota
b0b37ef724 "envelope" for non-type template parameters (useful to workaround compiler bugs)
[SVN r18270]
2003-04-16 22:51:39 +00:00
Dave Abrahams
69c7068028 Small changes to support new iterator adaptors in sandbox
[SVN r18212]
2003-04-09 11:57:59 +00:00
Peter Dimov
124be84389 Fixes for Comeau with Borland as backend.
[SVN r17588]
2003-02-22 13:40:23 +00:00
Peter Dimov
0caf4bb53e Made the default page size 512 (g++ 2.96 on Red Hat 7.2 dislikes 496.)
[SVN r17272]
2003-02-07 19:06:28 +00:00
Peter Dimov
7f668adbcd Added BOOST_QA_PAGE_SIZE.
[SVN r17270]
2003-02-07 18:43:48 +00:00
Peter Dimov
d6fbac9ba7 Quick_allocator updates.
[SVN r17267]
2003-02-07 15:08:52 +00:00
Peter Dimov
8f71074339 Dave's quick_allocator added, #define BOOST_SP_USE_QUICK_ALLOCATOR to make shared_ptr use it.
[SVN r17087]
2003-01-30 14:20:22 +00:00
John Maddock
1f52127735 Fixed macro usage
[SVN r16752]
2003-01-05 12:12:39 +00:00
Beman Dawes
48507564a9 add or update See www.boost.org comments
[SVN r16708]
2002-12-27 16:51:53 +00:00
Dave Abrahams
8d549f45fd Workarounds for broken RogueWave lib that comes with Sun
[SVN r16509]
2002-12-04 15:52:33 +00:00
Peter Dimov
c1f144e5d4 Major changes to shared_ptr and weak_ptr
[SVN r16314]
2002-11-18 14:37:02 +00:00
Dave Abrahams
53ba30e0c9 add missing #include
[SVN r16171]
2002-11-09 02:39:38 +00:00
Dave Abrahams
9aead1823b More fixes, better error messages, etc.
[SVN r16170]
2002-11-09 02:37:54 +00:00
Dave Abrahams
c14ee17601 Final patches for MSVC6
[SVN r16166]
2002-11-08 17:23:06 +00:00
Dave Abrahams
2bca71488b Works with MSVC and Intel5 now. Thanks, Aleksey!!
[SVN r16165]
2002-11-08 17:08:17 +00:00
Dave Abrahams
1f335d30ba Cleanups on boost::iterator_traits<>
Broke MSVC though :(


[SVN r16157]
2002-11-08 06:57:31 +00:00
Aleksey Gurtovoy
a38297a6cc Borland fix
[SVN r15360]
2002-09-16 04:10:29 +00:00
Peter Dimov
72ca3d7d9f Switched to <boost/detail/lightweight_test.hpp> for testing.
[SVN r14932]
2002-08-16 16:41:16 +00:00
Dave Abrahams
28432648e0 Fix unversioned VC++ checks
[SVN r14436]
2002-07-13 12:26:19 +00:00
Dave Abrahams
e69140d3f3 Workaround BOOST_MSVC_STD_ITERATOR misconfiguration; add MSVC6 specificity
[SVN r14047]
2002-05-28 20:25:51 +00:00
John Maddock
00f6a9751a Fixed buggy variable usage.
[SVN r14019]
2002-05-23 11:41:44 +00:00
Douglas Gregor
9663499093 Added Boost.Signals library
[SVN r13964]
2002-05-17 15:28:22 +00:00
Beman Dawes
d9d6a970cf add BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE
[SVN r13721]
2002-05-07 15:15:30 +00:00
Jens Maurer
5efbcbea28 BOOST_NO_LIMITS should not be used by user code; use <boost/limits.hpp> instead
BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS should not be defined when
BOOST_NO_LIMITS is defined


[SVN r13340]
2002-04-01 18:57:43 +00:00
John Maddock
01448d3373 Added missing include guards.
[SVN r13335]
2002-04-01 11:47:54 +00:00
John Maddock
15a5375b14 Added support for compilers with no exception handling support.
[SVN r12758]
2002-02-08 12:44:43 +00:00
Ralf W. Grosse-Kunstleve
09e0b2e072 inserted: missing typename (EDG 245 diagnostics)
[SVN r12410]
2002-01-22 00:35:37 +00:00
Dave Abrahams
08e37c5ccc initial checkin
[SVN r12388]
2002-01-21 00:49:14 +00:00
Dave Abrahams
19201a4bb9 Cleared out bogus flotsam
[SVN r12350]
2002-01-19 02:21:24 +00:00
John Maddock
528fb22617 * Changed BOOST_RE_THREADS to BOOST_HAS_THREADS,
* Updated allocator code to use SGI node based allocator when available.


[SVN r11829]
2001-11-30 11:58:04 +00:00
Dave Abrahams
71790af7f6 Changed name of "bind" to "select" to avoid problems with MSVC.
[SVN r11338]
2001-10-04 19:56:07 +00:00
Jens Maurer
59099cadf6 fix parameter name
[SVN r11281]
2001-09-26 18:34:57 +00:00
John Maddock
695b3059bd More fixes resulting from the new config
[SVN r11182]
2001-09-21 11:35:54 +00:00
John Maddock
3a4ed6ef7c Fixed misplaced std:: prefix (typo from last checkin)
[SVN r11166]
2001-09-20 11:46:26 +00:00
John Maddock
63b5e51676 First round of config fixes
[SVN r11146]
2001-09-19 11:48:51 +00:00
John Maddock
8c6c8f9604 commit of split-config, including any changes required to existing libraries (mainly regex).
[SVN r11138]
2001-09-18 11:13:39 +00:00
Jeremy Siek
865bc7d803 fixed inheritance
[SVN r11067]
2001-09-07 20:11:41 +00:00
Jeremy Siek
0ea958903a workaround for Solaris Forte 6
[SVN r11060]
2001-09-07 16:29:29 +00:00
Darin Adler
e027048eb6 Added workarounds for MPW C++.
[SVN r10799]
2001-08-07 17:11:24 +00:00
Jens Maurer
75fb29a3b7 fix duplicate typedef
[SVN r10597]
2001-07-12 17:40:38 +00:00
Beman Dawes
8f9b1e35bd Make report_exception() inline (John Maddock, Jesse Jones)
[SVN r10322]
2001-06-13 14:41:10 +00:00
Jeremy Siek
c21dc776d1 changed include guard for missing ostream to include g++ 2.96 (had been
set for 2.95 and lower)


[SVN r10298]
2001-06-08 17:47:29 +00:00
Jens Maurer
1ee4d8ac0d add HP aCC workaround
[SVN r10019]
2001-05-05 19:57:09 +00:00
Jeremy Siek
69dccc47b5 rolled back changes, value_type can not be an abstract base class
[SVN r9583]
2001-03-19 16:56:32 +00:00
Jeremy Siek
cf8fe4f2b1 fixed is_named_param_list to handle case when X is a reference type
[SVN r9572]
2001-03-18 02:17:22 +00:00
Jeremy Siek
66f30e813e changed to use pointer with is_convertible
[SVN r9570]
2001-03-17 21:54:04 +00:00
Dave Abrahams
863361ded0 untabified
[SVN r9514]
2001-03-09 02:37:01 +00:00
Jeremy Siek
fe148355a2 fixed for borland
[SVN r9508]
2001-03-08 21:12:30 +00:00
Jeremy Siek
be12189340 removed use of yes_type/no_type, not needed for borland workaround
[SVN r9507]
2001-03-08 20:58:51 +00:00
Jeremy Siek
01426d35f3 fixed bug in named template parameters, params following a named
template must get their values from the named template


[SVN r9495]
2001-03-08 19:03:08 +00:00
Jeremy Siek
a8ae9d9941 new file
[SVN r9488]
2001-03-08 16:33:40 +00:00
Dave Abrahams
1b51ce460c More attempted fixes for Intel C++
[SVN r9406]
2001-03-04 15:08:17 +00:00
Dave Abrahams
aab735c64e Put all implementation into namespace boost::detail::iterator_traits_. Some
progress made on fixes for Intel compiler.


[SVN r9389]
2001-03-03 05:11:06 +00:00
Jeremy Siek
83b8fcefc7 Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few places.
[SVN r9383]
2001-03-02 23:45:03 +00:00
Beman Dawes
6b15777c8f Initial commit
[SVN r9370]
2001-03-01 15:45:41 +00:00
Beman Dawes
7c91125060 Boost Test Library initial commit
[SVN r9364]
2001-02-28 21:39:56 +00:00
Dave Abrahams
03b1bb7a1e Updated documentation
[SVN r9283]
2001-02-19 22:58:12 +00:00
Dave Abrahams
58bff4af87 Improved workarounds for stock MSVC6; use yes_type and no_type from type_traits.hpp; stopped trying to remove_cv before detecting is_pointer, in honor of the new type_traits semantics.
[SVN r9282]
2001-02-19 22:51:32 +00:00
John Maddock
5044712ff6 type_traits: regression failure fixes from type traits changes...
[SVN r9249]
2001-02-18 11:43:01 +00:00
Dave Abrahams
2f6f7af430 Make it work with standard conforming iterators under raw VC6.
[SVN r9197]
2001-02-13 23:30:25 +00:00
Dave Abrahams
1e0e965f07 Clean away code which can never be used
[SVN r9134]
2001-02-11 19:44:54 +00:00
Dave Abrahams
7523daa905 Use BOOST_STATIC_CONSTANT
[SVN r9133]
2001-02-11 19:39:11 +00:00
Dave Abrahams
3cb4fe87a9 Rolled unspecialized template back in
[SVN r9116]
2001-02-11 16:12:13 +00:00
Dave Abrahams
dc1186e73f Rolled back ineffective Borland-specific code
[SVN r9115]
2001-02-11 16:11:24 +00:00
Dave Abrahams
d0f656c4da Rolled in supposed Borland fixes from John Maddock, but not seeing any
improvement yet


[SVN r9091]
2001-02-10 20:14:20 +00:00
Dave Abrahams
08a2ab3fe6 Always have a definition for each traits member, even if it can't be properly
deduced. These will be incomplete types in some cases (undefined<void>), but it
helps suppress MSVC errors elsewhere


[SVN r9064]
2001-02-10 00:05:17 +00:00
Dave Abrahams
2947fb7051 Applied John Maddock's Borland patch Moving <true> specialization to unspecialized template
[SVN r9058]
2001-02-09 15:23:55 +00:00
Dave Abrahams
cd1eecd245 Add parens to appease Borland
[SVN r9043]
2001-02-09 03:30:12 +00:00
Dave Abrahams
9ac4d90d82 *** empty log message ***
[SVN r9029]
2001-02-08 04:44:19 +00:00
Dave Abrahams
a7ae27dc5b Added support for more of the traits members where possible, making this useful
as a replacement for std::iterator_traits<T> when used as a default template
parameter.


[SVN r9002]
2001-02-07 16:43:57 +00:00
Dave Abrahams
ddccb755f4 Removed useless #includes of standard library headers
[SVN r8993]
2001-02-07 04:52:58 +00:00
Dave Abrahams
8ffb174556 Initial Checkin
[SVN r8992]
2001-02-07 04:51:12 +00:00
Dave Abrahams
8b60ca8d0a Factored if_true out into boost/detail/select_type.hpp
[SVN r8991]
2001-02-07 04:49:32 +00:00
Jens Maurer
3cbecf5ddd fix bool logic bug introduced by Jeremy's compilation fixes
[SVN r8988]
2001-02-06 22:56:37 +00:00
Jeremy Siek
82af891892 ported to KAI C++
[SVN r8955]
2001-02-06 01:21:11 +00:00
7 changed files with 101 additions and 527 deletions

42
include/boost/cstdlib.hpp Normal file
View File

@@ -0,0 +1,42 @@
// boost/cstdlib.hpp header ------------------------------------------------//
// (C) Copyright Beman Dawes 2001. 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.
// See http://www.boost.org/libs/utility/cstdlib.html for documentation.
// Revision History
// 26 Feb 01 Initial version (Beman Dawes)
#ifndef BOOST_CSTDLIB_HPP
#define BOOST_CSTDLIB_HPP
#include <cstdlib>
namespace boost
{
// The intent is to propose the following for addition to namespace std
// in the C++ Standard Library, and to then deprecate EXIT_SUCCESS and
// EXIT_FAILURE. As an implementation detail, this header defines the
// new constants in terms of EXIT_SUCCESS and EXIT_FAILURE. In a new
// standard, the constants would be implementation-defined, although it
// might be worthwhile to "suggest" (which a standard is allowed to do)
// values of 0 and 1 respectively.
// Rationale for having multiple failure values: some environments may
// wish to distinguish between different classes of errors.
// Rationale for choice of values: programs often use values < 100 for
// their own error reporting. Values > 255 are sometimes reserved for
// system detected errors. 200/201 were suggested to minimize conflict.
const int exit_success = EXIT_SUCCESS; // implementation-defined value
const int exit_failure = EXIT_FAILURE; // implementation-defined value
const int exit_exception_failure = 200; // otherwise uncaught exception
const int exit_test_failure = 201; // report_error or
// report_critical_error called.
}
#endif

View File

@@ -1,206 +0,0 @@
// (C) Copyright David Abrahams 2001. 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.
// Boost versions of
//
// std::iterator_traits<>::iterator_category
// std::iterator_traits<>::difference_type
// std::distance()
//
// ...for all compilers and iterators
#ifndef ITERATOR_DWA122600_HPP_
# define ITERATOR_DWA122600_HPP_
# include <boost/config.hpp>
# include <boost/type_traits.hpp>
# include <iterator>
# include <cstddef>
// STLPort 4.0 and betas have a bug when debugging is enabled and there is no
// partial specialization: instead of an iterator_category typedef, the standard
// container iterators have _Iterator_category.
//
// Also, whether debugging is enabled or not, there is a broken specialization
// of std::iterator<output_iterator_tag,void,void,void,void> which has no
// typedefs but iterator_category.
# if defined(__SGI_STL_PORT) && (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
# ifdef __STL_DEBUG
# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
# endif
# define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
# endif // STLPort <= 4.1b4 && no partial specialization
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
# include <vector>
# include <list>
# include <set>
# include <map>
# include <deque>
# include <slist>
# include <hash_map>
# include <hash_set>
# include <string>
# endif
namespace boost { namespace detail {
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
using std::iterator_traits;
using std::distance;
# else
// Workarounds for less-capable implementations
template <bool is_ptr> struct iterator_traits_select;
template <> struct iterator_traits_select<true>
{
template <class Ptr>
struct traits
{
typedef std::ptrdiff_t difference_type;
typedef std::random_access_iterator_tag iterator_category;
};
};
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
no_result bad_category_helper(...);
template <class C, class T> yes_result bad_category_helper(std::_DBG_iter<C,T>*);
template <bool has_bad_category_typedef> struct bad_category_select;
template <>
struct bad_category_select<true>
{
template <class Iterator>
struct category { typedef typename Iterator::_Iterator_category type; };
};
template <>
struct bad_category_select<false>
{
template <class Iterator>
struct category { typedef typename Iterator::iterator_category type; };
};
template <class Iterator>
struct iterator_category_select
{
private:
static Iterator p;
enum { has_bad_category
= sizeof(bad_category_helper(&p)) == sizeof(yes_result) };
typedef bad_category_select<has_bad_category> category_select;
public:
typedef typename category_select::template category<Iterator>::type type;
};
# endif
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
template <bool is_bad_output_iterator> struct bad_difference_select;
template <>
struct bad_difference_select<true>
{
template <class Iterator>
struct difference { typedef void type; };
};
template <>
struct bad_difference_select<false>
{
template <class Iterator>
struct difference { typedef typename Iterator::difference_type type; };
};
yes_result bad_output_iterator_helper(std::iterator<std::output_iterator_tag,void,void,void,void>*);
no_result bad_output_iterator_helper(...);
# endif
template <> struct iterator_traits_select<false>
{
template <class Iterator>
struct traits
# if defined(BOOST_NO_STD_ITERATOR_TRAITS)
{
# if defined(BOOST_MSVC) && !defined(__SGI_STL_PORT)
typedef typename Iterator::distance_type difference_type;
# elif !defined(BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION)
typedef typename Iterator::difference_type difference_type;
# else
private:
// static Iterator *p;
typedef bad_difference_select<
is_convertible<const volatile Iterator*,
const volatile std::iterator<std::output_iterator_tag,void,void,void,void>*
>::value> difference_type_select;
public:
typedef typename difference_type_select::template difference<Iterator>::type difference_type;
# endif
# if !defined(BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF)
typedef typename Iterator::iterator_category iterator_category;
# else
typedef typename iterator_category_select<Iterator>::type iterator_category;
# endif
};
# else
{
typedef typename std::iterator_traits<Iterator>::difference_type difference_type;
typedef typename std::iterator_traits<Iterator>::iterator_category iterator_category;
};
# endif
};
template <class Iterator>
struct iterator_traits
{
private:
typedef iterator_traits_select<is_pointer<remove_cv<Iterator>::type>::value> select;
typedef typename select::template traits<Iterator> traits;
public:
typedef typename traits::difference_type difference_type;
typedef typename traits::iterator_category iterator_category;
};
template <class Category>
struct distance_select {
template <class Iterator>
static typename ::boost::detail::iterator_traits<Iterator>::difference_type
distance(Iterator i1, const Iterator i2)
{
typename ::boost::detail::iterator_traits<Iterator>::difference_type result = 0;
while (i1 != i2)
{
++i1;
++result;
}
return result;
}
};
template <>
struct distance_select<std::random_access_iterator_tag> {
template <class Iterator>
static typename ::boost::detail::iterator_traits<Iterator>::difference_type
distance(const Iterator i1, const Iterator i2)
{
return i2 - i1;
}
};
template <class Iterator>
inline typename ::boost::detail::iterator_traits<Iterator>::difference_type
distance(const Iterator& first, const Iterator& last)
{
typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category;
return distance_select<iterator_category>::distance(first, last);
}
# endif // workarounds
}}
# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
#endif // ITERATOR_DWA122600_HPP_

View File

@@ -1,208 +0,0 @@
// (C) Copyright David Abrahams 2001. 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.
//
// Template class is_signed and its documentation is:
// (C) Copyright Howard Hinnant 2001. 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.
//
// Template class numeric_traits<Number> --
//
// Supplies:
//
// typedef difference_type -- a type used to represent the difference
// between any two values of Number.
//
// Support:
// 1. Not all specializations are supplied
//
// 2. Use of specializations that are not supplied will cause a
// compile-time error
//
// 3. Users are free to specialize numeric_traits for any type.
//
// 4. Right now, specializations are only supplied for integer types.
//
// 5. On implementations which do not supply compile-time constants in
// std::numeric_limits<>, only specializations for built-in integer types
// are supplied.
//
// 6. Handling of numbers whose range of representation is at least as
// great as boost::intmax_t can cause some differences to be
// unrepresentable in difference_type:
//
// Number difference_type
// ------ ---------------
// signed Number
// unsigned intmax_t
//
// template <class Number> typename numeric_traits<Number>::difference_type
// numeric_distance(Number x, Number y)
// computes (y - x), attempting to avoid overflows.
//
// See http://www.boost.org for most recent version including documentation.
// Revision History
// 23 Jan 2001 - Fixed logic of difference_type selection, which was
// completely wack. In the process, added digit_traits<>
// to compute the number of digits in intmax_t even when
// not supplied by numeric_limits<>.
// 21 Jan 2001 - Created
#ifndef BOOST_NUMERIC_TRAITS_HPP_DWA20001901
# define BOOST_NUMERIC_TRAITS_HPP_DWA20001901
# include <boost/config.hpp>
# include <boost/cstdint.hpp>
# include <boost/static_assert.hpp>
# include <boost/type_traits.hpp>
# ifndef BOOST_NO_LIMITS
# include <limits>
# endif
namespace boost { namespace detail {
// Template class if_true -- select among 2 types based on a bool constant expression
// Usage:
// typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
template <bool> struct if_true;
template <>
struct if_true<true>
{
template <class T1, class T2>
struct then { typedef T1 type; };
};
template <>
struct if_true<false>
{
template <class T1, class T2>
struct then { typedef T2 type; };
};
// Template class is_signed -- determine whether a numeric type is signed
// Requires that T is constructable from the literals -1 and 0. Compile-time
// error results if that requirement is not met (and thus signedness is not
// likely to have meaning for that type).
template <class Number>
struct is_signed
{
enum { value = (Number(-1) < Number(0)) };
};
# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// digit_traits - compute the number of digits in a built-in integer
// type. Needed for implementations on which numeric_limits is not specialized
// for intmax_t (e.g. VC6).
template <bool is_specialized> struct digit_traits_select;
// numeric_limits is specialized; just select that version of digits
template <> struct digit_traits_select<true>
{
template <class T> struct traits
{
enum { digits = std::numeric_limits<T>::digits };
};
};
// numeric_limits is not specialized; compute digits from sizeof(T)
template <> struct digit_traits_select<false>
{
template <class T> struct traits
{
enum { digits = sizeof(T) * std::numeric_limits<unsigned char>::digits
- (is_signed<T>::value ? 1 : 0)
};
};
};
// here's the "usable" template
template <class T> struct digit_traits
{
enum {
digits = digit_traits_select<
std::numeric_limits<T>::is_specialized
>::template traits<T>::digits
};
};
#endif
// Template class integer_traits<Integer> -- traits of various integer types
// This should probably be rolled into boost::integer_traits one day, but I
// need it to work without <limits>
template <class Integer>
struct integer_traits
{
# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
private:
typedef Integer integer_type;
typedef std::numeric_limits<integer_type> x;
# ifdef BOOST_MSVC
// for some reason, MSVC asserts when it shouldn't unless we make these
// local definitions
enum {
is_integer = x::is_integer,
is_specialized = x::is_specialized
};
BOOST_STATIC_ASSERT(is_integer);
BOOST_STATIC_ASSERT(is_specialized);
# endif
public:
typedef typename
if_true<(x::is_signed
&& (!x::is_bounded
// digits is the number of no-sign bits
|| (x::digits + 1 >= digit_traits<boost::intmax_t>::digits)))>::template then<
Integer,
typename if_true<(x::digits + 1 < digit_traits<signed int>::digits)>::template then<
signed int,
typename if_true<(x::digits + 1 < digit_traits<signed long>::digits)>::template then<
signed long,
// else
intmax_t
>::type>::type>::type difference_type;
# else
BOOST_STATIC_ASSERT(boost::is_integral<Integer>::value);
typedef typename
if_true<(sizeof(Integer) >= sizeof(intmax_t))>::template then<
typename if_true<is_signed<Integer>::value>::template then<
Integer,
intmax_t
>::type,
typename if_true<(sizeof(Integer) < sizeof(std::ptrdiff_t))>::template then<
std::ptrdiff_t,
intmax_t
>::type
>::type difference_type;
# endif
};
// Right now, only supports integers, but should be expanded.
template <class Number>
struct numeric_traits
{
typedef typename integer_traits<Number>::difference_type difference_type;
};
template <class Number>
typename numeric_traits<Number>::difference_type numeric_distance(Number x, Number y)
{
typedef typename numeric_traits<Number>::difference_type difference_type;
return difference_type(y) - difference_type(x);
}
}}
#endif // BOOST_NUMERIC_TRAITS_HPP_DWA20001901

View File

@@ -0,0 +1,24 @@
// (C) Copyright Gennaro Prota 2003. 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.
#ifndef BOOST_NON_TYPE_HPP_GP_20030417
#define BOOST_NON_TYPE_HPP_GP_20030417
namespace boost {
// Just a simple "envelope" for non-type template parameters. Useful
// to work around some MSVC deficiencies.
template <typename T, T n>
struct non_type { };
}
#endif // include guard

View File

@@ -1,12 +0,0 @@
// -*- C++ -*- forwarding header.
#ifndef BOOST_CSTDDEF_HPP
#define BOOST_CSTDDEF_HPP
#if defined(__sgi) && !defined(__GNUC__)
# include <stddef.h>
#else
# include <cstddef>
#endif
#endif

View File

@@ -1,101 +0,0 @@
// (C) Copyright Jeremy Siek 2000. 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.
// The ct_if implementation that avoids partial specialization is
// based on the IF class by Ulrich W. Eisenecker and Krzysztof
// Czarnecki.
#ifndef BOOST_CT_IF_HPP
#define BOOST_CT_IF_HPP
#include <boost/config.hpp>
/*
There is a bug in the Borland compiler with regards to using
integers to specialize templates. This made it hard to use ct_if in
the graph library. Changing from 'ct_if' to 'ct_if_t' fixed the
problem.
*/
namespace boost {
struct ct_if_error { };
struct true_type { enum { value = true }; };
struct false_type { enum { value = false }; };
template <class A, class B>
struct ct_and { typedef false_type type; };
template <> struct ct_and<true_type,true_type> { typedef true_type type; };
template <class A> struct ct_not { typedef ct_if_error type; };
template <> struct ct_not<true_type> { typedef false_type type; };
template <> struct ct_not<false_type> { typedef true_type type; };
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <int cond, class A, class B>
struct ct_if { typedef ct_if_error type; };
template <class A, class B>
struct ct_if<1, A, B> { typedef A type; };
template <class A, class B>
struct ct_if<0, A, B> { typedef B type; };
template <class cond, class A, class B>
struct ct_if_t { typedef ct_if_error type; };
template <class A, class B>
struct ct_if_t<true_type, A, B> { typedef A type; };
template <class A, class B>
struct ct_if_t<false_type, A, B> { typedef B type; };
#else
namespace detail {
template <int condition, class A, class B> struct IF;
template <int condition> struct SlectSelector;
struct SelectFirstType;
struct SelectSecondType;
struct SelectFirstType {
template<class A, class B>
struct Template { typedef A type; };
};
struct SelectSecondType {
template<class A, class B>
struct Template { typedef B type; };
};
template<int condition>
struct SlectSelector {
typedef SelectFirstType type;
};
template <>
struct SlectSelector<0> {
typedef SelectSecondType type;
};
} // namespace detail
template<int condition, class A, class B>
struct ct_if
{
typedef typename detail::SlectSelector<condition>::type Selector;
typedef typename Selector::template Template<A, B>::type type;
};
template <class cond, class A, class B>
struct ct_if_t {
typedef typename ct_if<cond::value, A, B>::type type;
};
#endif
} // namespace boost
#endif // BOOST_CT_IF_HPP

View File

@@ -0,0 +1,35 @@
// Boost.Signals library
//
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
//
// Permission to copy, use, sell and distribute this software is granted
// provided this copyright notice appears in all copies.
// Permission to modify the code and to distribute modified code is granted
// provided this copyright notice appears in all copies, and a notice
// that the code was modified is included with the copyright notice.
//
// This software is provided "as is" without express or implied warranty,
// and with no claim as to its suitability for any purpose.
// For more information, see http://www.boost.org/libs/signals
#ifndef BOOST_VISIT_EACH_HPP
#define BOOST_VISIT_EACH_HPP
#include <boost/config.hpp>
namespace boost {
template<typename Visitor, typename T>
inline void visit_each(Visitor& visitor, const T& t, long)
{
visitor(t);
}
template<typename Visitor, typename T>
inline void visit_each(Visitor& visitor, const T& t)
{
visit_each(visitor, t, 0);
}
}
#endif // BOOST_VISIT_EACH_HPP