Compare commits

..

12 Commits

Author SHA1 Message Date
2ed4dafddc This commit was manufactured by cvs2svn to create branch
'python-v2-dev'.

[SVN r14785]
2002-08-12 13:35:54 +00:00
28432648e0 Fix unversioned VC++ checks
[SVN r14436]
2002-07-13 12:26:19 +00:00
e69140d3f3 Workaround BOOST_MSVC_STD_ITERATOR misconfiguration; add MSVC6 specificity
[SVN r14047]
2002-05-28 20:25:51 +00:00
00f6a9751a Fixed buggy variable usage.
[SVN r14019]
2002-05-23 11:41:44 +00:00
9663499093 Added Boost.Signals library
[SVN r13964]
2002-05-17 15:28:22 +00:00
d9d6a970cf add BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE
[SVN r13721]
2002-05-07 15:15:30 +00:00
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
01448d3373 Added missing include guards.
[SVN r13335]
2002-04-01 11:47:54 +00:00
15a5375b14 Added support for compilers with no exception handling support.
[SVN r12758]
2002-02-08 12:44:43 +00:00
09e0b2e072 inserted: missing typename (EDG 245 diagnostics)
[SVN r12410]
2002-01-22 00:35:37 +00:00
08e37c5ccc initial checkin
[SVN r12388]
2002-01-21 00:49:14 +00:00
19201a4bb9 Cleared out bogus flotsam
[SVN r12350]
2002-01-19 02:21:24 +00:00
6 changed files with 270 additions and 60 deletions

View File

@ -13,6 +13,9 @@
*
*/
#ifndef BOOST_DETAIL_ALLOCATOR_HPP
#define BOOST_DETAIL_ALLOCATOR_HPP
#include <boost/config.hpp>
#include <cstdlib>
#if defined(BOOST_NO_STDC_NAMESPACE)
@ -259,7 +262,7 @@ public:
void construct(pointer p, const T& val) const
{ allocator_construct(p, val); }
void destroy(pointer __p) const
void destroy(pointer p) const
{ allocator_destroy(p); }
};
@ -274,3 +277,4 @@ struct rebind_allocator
#endif
#endif // include guard

View File

@ -0,0 +1,217 @@
// Copyright (c) 2000 David Abrahams. 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.
//
// Copyright (c) 1994
// Hewlett-Packard Company
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Hewlett-Packard Company makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
// Copyright (c) 1996
// Silicon Graphics Computer Systems, Inc.
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Silicon Graphics makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
#ifndef BINARY_SEARCH_DWA_122600_H_
# define BINARY_SEARCH_DWA_122600_H_
# include <boost/detail/iterator.hpp>
# include <utility>
namespace boost { namespace detail {
template <class ForwardIter, class Tp>
ForwardIter lower_bound(ForwardIter first, ForwardIter last,
const Tp& val)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (*middle < val) {
first = middle;
++first;
len = len - half - 1;
}
else
len = half;
}
return first;
}
template <class ForwardIter, class Tp, class Compare>
ForwardIter lower_bound(ForwardIter first, ForwardIter last,
const Tp& val, Compare comp)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (comp(*middle, val)) {
first = middle;
++first;
len = len - half - 1;
}
else
len = half;
}
return first;
}
template <class ForwardIter, class Tp>
ForwardIter upper_bound(ForwardIter first, ForwardIter last,
const Tp& val)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (val < *middle)
len = half;
else {
first = middle;
++first;
len = len - half - 1;
}
}
return first;
}
template <class ForwardIter, class Tp, class Compare>
ForwardIter upper_bound(ForwardIter first, ForwardIter last,
const Tp& val, Compare comp)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (comp(val, *middle))
len = half;
else {
first = middle;
++first;
len = len - half - 1;
}
}
return first;
}
template <class ForwardIter, class Tp>
std::pair<ForwardIter, ForwardIter>
equal_range(ForwardIter first, ForwardIter last, const Tp& val)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle, left, right;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (*middle < val) {
first = middle;
++first;
len = len - half - 1;
}
else if (val < *middle)
len = half;
else {
left = boost::detail::lower_bound(first, middle, val);
std::advance(first, len);
right = boost::detail::upper_bound(++middle, first, val);
return std::pair<ForwardIter, ForwardIter>(left, right);
}
}
return std::pair<ForwardIter, ForwardIter>(first, first);
}
template <class ForwardIter, class Tp, class Compare>
std::pair<ForwardIter, ForwardIter>
equal_range(ForwardIter first, ForwardIter last, const Tp& val,
Compare comp)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle, left, right;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (comp(*middle, val)) {
first = middle;
++first;
len = len - half - 1;
}
else if (comp(val, *middle))
len = half;
else {
left = boost::detail::lower_bound(first, middle, val, comp);
std::advance(first, len);
right = boost::detail::upper_bound(++middle, first, val, comp);
return std::pair<ForwardIter, ForwardIter>(left, right);
}
}
return std::pair<ForwardIter, ForwardIter>(first, first);
}
template <class ForwardIter, class Tp>
bool binary_search(ForwardIter first, ForwardIter last,
const Tp& val) {
ForwardIter i = boost::detail::lower_bound(first, last, val);
return i != last && !(val < *i);
}
template <class ForwardIter, class Tp, class Compare>
bool binary_search(ForwardIter first, ForwardIter last,
const Tp& val,
Compare comp) {
ForwardIter i = boost::detail::lower_bound(first, last, val, comp);
return i != last && !comp(val, *i);
}
}} // namespace boost::detail
#endif // BINARY_SEARCH_DWA_122600_H_

View File

@ -60,10 +60,13 @@ namespace boost
int result = 0; // quiet compiler warnings
bool exception_thrown = true; // avoid setting result for each excptn type
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
result = function_object();
exception_thrown = false;
#ifndef BOOST_NO_EXCEPTIONS
}
// As a result of hard experience with strangely interleaved output
@ -120,6 +123,7 @@ namespace boost
catch ( ... )
{ detail::report_exception( out, "unknown exception", "" ); }
#endif // BOOST_NO_EXCEPTIONS
if ( exception_thrown ) result = boost::exit_exception_failure;
@ -131,8 +135,9 @@ namespace boost
<< "********** errors detected; see stdout for details ***********"
<< std::endl;
}
#if !defined(BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE)
else { out << std::flush << "no errors detected" << std::endl; }
#endif
return result;
} // catch_exceptions

View File

@ -62,14 +62,10 @@
# include <iterator>
# include <cstddef>
# if defined(BOOST_MSVC_STD_ITERATOR)
# if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
# include <xtree>
# include <deque>
# include <list>
# if 0 && defined(__ICL) // Re-enable this to pick up the Intel fixes where they left off
# include <iosfwd>
# include <memory>
# endif
# endif
@ -110,7 +106,7 @@ template <> struct iterator_traits_select<true>
typedef std::ptrdiff_t difference_type;
typedef std::random_access_iterator_tag iterator_category;
typedef Ptr pointer;
#ifdef BOOST_MSVC
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
// Keeps MSVC happy under certain circumstances. It seems class template default
// arguments are partly instantiated even when not used when the class template
// is the return type of a function template.
@ -183,7 +179,7 @@ struct bad_output_iterator_select<false>
};
# endif
# if defined(BOOST_MSVC_STD_ITERATOR)
# if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
// We'll sort iterator types into one of these classifications, from which we
// can determine the difference_type, pointer, reference, and value_type
@ -252,42 +248,6 @@ no_type is_std_iterator_helper(...);
template <class V, class D, class C>
yes_type is_std_iterator_helper(const volatile std::iterator<V,D,C>*);
#if 0 && defined(__ICL) // re-enable this to pick up with the Intel C++ fixes where they left off
// for some reason, it's unable to make the deduction of derivation :(
template<class K, class Ty, class Kfn, class Pr, class A>
yes_type is_std_iterator_helper(const volatile typename std::_Tree<K,Ty,Kfn,Pr,A>::iterator*);
template<class Ty, class A>
yes_type is_std_iterator_helper(const volatile typename std::list<Ty,A>::iterator*);
template<class Ty, class A>
yes_type is_std_iterator_helper(const volatile typename std::deque<Ty,A>::iterator*);
template<class K, class Ty, class Kfn, class Pr, class A>
yes_type is_std_iterator_helper(const volatile typename std::_Tree<K,Ty,Kfn,Pr,A>::const_iterator*);
template<class Ty, class A>
yes_type is_std_iterator_helper(const volatile typename std::list<Ty,A>::const_iterator*);
template<class Ty, class A>
yes_type is_std_iterator_helper(const volatile typename std::deque<Ty,A>::const_iterator*);
template<class RI, class Ty, class Rt, class Pt, class D>
yes_type is_std_iterator_helper(const volatile std::reverse_iterator<RI,Ty,Rt,Pt,D>*);
template<class BI, class Ty, class Rt, class Pt, class D>
yes_type is_std_iterator_helper(const volatile std::reverse_bidirectional_iterator<BI,Ty,Rt,Pt,D>*);
template<class C>
yes_type is_std_iterator_helper(const volatile std::back_insert_iterator<C>*);
template<class C>
yes_type is_std_iterator_helper(const volatile std::front_insert_iterator<C>*);
template<class C>
yes_type is_std_iterator_helper(const volatile std::insert_iterator<C>*);
template<class U, class E, class Tr>
yes_type is_std_iterator_helper(const volatile std::istream_iterator<U,E,Tr>*);
template<class E, class Tr>
yes_type is_std_iterator_helper(const volatile std::istreambuf_iterator<E,Tr>*);
template<class E, class Tr>
yes_type is_std_iterator_helper(const volatile std::ostreambuf_iterator<E,Tr>*);
template<class Oi, class Ty>
yes_type is_std_iterator_helper(const volatile std::raw_storage_iterator<Oi,Ty>*);
#endif
// Is the iterator derived from boost::iterator?
template <class C, class T, class D, class P, class R>
yes_type is_boost_iterator_helper(const volatile boost::iterator<C,T,D,P,R>*);
@ -307,15 +267,6 @@ template<class T, class CharT, class Traits>
yes_type is_ostream_iterator_helper(const volatile std::ostream_iterator<T,CharT,Traits>*);
no_type is_ostream_iterator_helper(...);
#if 0 && defined(__ICL)
// this static assertion highlights the first of a few problems getting this to
// work with the Intel compiler. We can get past it with the many definitions
// for is_std_iterator_helper above, but there are other failures.
template <bool> struct check;
template <> struct check<true> {};
check<(sizeof(is_std_iterator_helper((std::istream_iterator<int>*)0)) == sizeof(yes_type))> assertion;
#endif
template <class T>
struct msvc_iterator_classification {
BOOST_STATIC_CONSTANT(unsigned,
@ -336,7 +287,7 @@ template <> struct iterator_traits_select<false>
template <class Iterator>
struct traits
{
# if defined(BOOST_MSVC_STD_ITERATOR)
# if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
typedef msvc_traits_select<(
msvc_iterator_classification<Iterator>::value
)>::template traits_<Iterator> inner_traits;

View File

@ -70,9 +70,7 @@
# include <boost/static_assert.hpp>
# include <boost/type_traits.hpp>
# include <boost/detail/select_type.hpp>
# ifndef BOOST_NO_LIMITS
# include <limits>
# endif
# include <boost/limits.hpp>
namespace boost { namespace detail {
@ -83,7 +81,7 @@ namespace boost { namespace detail {
template <class Number>
struct is_signed
{
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC)
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300
BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
#else
BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
@ -137,7 +135,7 @@ namespace boost { namespace detail {
private:
typedef Integer integer_type;
typedef std::numeric_limits<integer_type> x;
# ifdef BOOST_MSVC
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
// for some reason, MSVC asserts when it shouldn't unless we make these
// local definitions
BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer);

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
#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