Compare commits

...

29 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
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
71790af7f6 Changed name of "bind" to "select" to avoid problems with MSVC.
[SVN r11338]
2001-10-04 19:56:07 +00:00
59099cadf6 fix parameter name
[SVN r11281]
2001-09-26 18:34:57 +00:00
695b3059bd More fixes resulting from the new config
[SVN r11182]
2001-09-21 11:35:54 +00:00
3a4ed6ef7c Fixed misplaced std:: prefix (typo from last checkin)
[SVN r11166]
2001-09-20 11:46:26 +00:00
63b5e51676 First round of config fixes
[SVN r11146]
2001-09-19 11:48:51 +00:00
8c6c8f9604 commit of split-config, including any changes required to existing libraries (mainly regex).
[SVN r11138]
2001-09-18 11:13:39 +00:00
865bc7d803 fixed inheritance
[SVN r11067]
2001-09-07 20:11:41 +00:00
0ea958903a workaround for Solaris Forte 6
[SVN r11060]
2001-09-07 16:29:29 +00:00
e027048eb6 Added workarounds for MPW C++.
[SVN r10799]
2001-08-07 17:11:24 +00:00
75fb29a3b7 fix duplicate typedef
[SVN r10597]
2001-07-12 17:40:38 +00:00
8f9b1e35bd Make report_exception() inline (John Maddock, Jesse Jones)
[SVN r10322]
2001-06-13 14:41:10 +00:00
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
1ee4d8ac0d add HP aCC workaround
[SVN r10019]
2001-05-05 19:57:09 +00:00
69dccc47b5 rolled back changes, value_type can not be an abstract base class
[SVN r9583]
2001-03-19 16:56:32 +00:00
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
66f30e813e changed to use pointer with is_convertible
[SVN r9570]
2001-03-17 21:54:04 +00:00
8 changed files with 589 additions and 85 deletions

View File

@ -0,0 +1,280 @@
/*
*
* Copyright (c) 2001
* Dr John Maddock
*
* 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. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
#ifndef BOOST_DETAIL_ALLOCATOR_HPP
#define BOOST_DETAIL_ALLOCATOR_HPP
#include <boost/config.hpp>
#include <cstdlib>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::ptrdiff_t;
using ::size_t;
}
#endif
// see if we have SGI alloc class:
#if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H))
# define BOOST_HAVE_SGI_ALLOCATOR
# include <memory>
# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
namespace boost{ namespace detail{
typedef std::__sgi_alloc alloc_type;
}}
# else
namespace boost{ namespace detail{
typedef std::alloc alloc_type;
}}
# endif
#endif
namespace boost{ namespace detail{
template <class T>
void allocator_construct(T* p, const T& t)
{ new (p) T(t); }
template <class T>
void allocator_destroy(T* p)
{ p->~T(); }
} }
#if !defined(BOOST_NO_STD_ALLOCATOR)
#include <memory>
#define BOOST_DEFAULT_ALLOCATOR(T) std::allocator<T>
namespace boost{ namespace detail{
template <class T, class A>
struct rebind_allocator
{
typedef typename A::template rebind<T> binder;
typedef typename binder::other type;
};
} // namespace detail
} // namespace boost
#elif !defined(BOOST_NO_MEMBER_TEMPLATES)
// no std::allocator, but the compiler supports the necessary syntax,
// write our own allocator instead:
#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator<T>
namespace boost{ namespace detail{
template <class T>
class allocator
{
public:
typedef T value_type;
typedef value_type * pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
template <class U>
struct rebind
{
typedef allocator<U> other;
};
allocator(){}
template <class U>
allocator(const allocator<U>&){}
allocator(const allocator&){}
template <class U>
allocator& operator=(const allocator<U>&)
{ return *this; }
~allocator(){}
pointer address(reference x) { return &x; }
const_pointer address(const_reference x) const { return &x; }
pointer allocate(size_type n, const void* = 0)
{
#ifdef BOOST_HAVE_SGI_ALLOCATOR
return n != 0 ?
reinterpret_cast<pointer>(alloc_type::allocate(n * sizeof(value_type)))
: 0;
#else
return n != 0 ?
reinterpret_cast<pointer>(::operator new(n * sizeof(value_type)))
: 0;
#endif
}
void deallocate(pointer p, size_type n)
{
#ifdef BOOST_HAVE_SGI_ALLOCATOR
assert( (p == 0) == (n == 0) );
if (p != 0)
alloc_type::deallocate((void*)p, n);
#else
assert( (p == 0) == (n == 0) );
if (p != 0)
::operator delete((void*)p);
#endif
}
size_type max_size() const
{ return size_t(-1) / sizeof(value_type); }
void construct(pointer p, const T& val) const
{ allocator_construct(p, val); }
void destroy(pointer p) const
{ allocator_destroy(p); }
};
template <class T, class A>
struct rebind_allocator
{
typedef typename A::template rebind<T> binder;
typedef typename binder::other type;
};
} // namespace detail
} // namespace boost
#else
// no std::allocator, use workaround version instead,
// each allocator class must derive from a base class
// that allocates blocks of bytes:
#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter<T, ::boost::detail::simple_alloc>
namespace boost{ namespace detail{
class simple_alloc
{
public:
typedef void value_type;
typedef value_type * pointer;
typedef const void* const_pointer;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
simple_alloc(){}
simple_alloc(const simple_alloc&){}
~simple_alloc(){}
pointer allocate(size_type n, const void* = 0)
{
#ifdef BOOST_HAVE_SGI_ALLOCATOR
return n != 0 ?
reinterpret_cast<pointer>(alloc_type::allocate(n))
: 0;
#else
return n != 0 ?
reinterpret_cast<pointer>(::operator new(n))
: 0;
#endif
}
void deallocate(pointer p, size_type n)
{
#ifdef BOOST_HAVE_SGI_ALLOCATOR
assert( (p == 0) == (n == 0) );
if (p != 0)
alloc_type::deallocate((void*)p, n);
#else
assert( (p == 0) == (n == 0) );
if (p != 0)
::operator delete((void*)p);
#endif
}
};
template <class T, class Base>
class allocator_adapter : public Base
{
public:
typedef T value_type;
typedef value_type * pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef Base base_type;
allocator_adapter(){}
allocator_adapter(const base_type& x) : Base(x){}
allocator_adapter& operator=(const base_type& x)
{
*(static_cast<base_type*>(this)) = x;
return *this;
}
~allocator_adapter(){}
pointer address(reference x) { return &x; }
const_pointer address(const_reference x) const { return &x; }
pointer allocate(size_type n, const void* = 0)
{
return n != 0 ?
reinterpret_cast<pointer>(base_type::allocate(n * sizeof(value_type)))
: 0;
}
void deallocate(pointer p, size_type n)
{
assert( (p == 0) == (n == 0) );
if (p != 0)
static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
}
size_type max_size() const
{ return size_t(-1) / sizeof(value_type); }
void construct(pointer p, const T& val) const
{ allocator_construct(p, val); }
void destroy(pointer p) const
{ allocator_destroy(p); }
};
template <class T, class A>
struct rebind_allocator
{
typedef allocator_adapter<T, typename A::base_type> type;
};
} // namespace detail
} // namespace boost
#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

@ -8,6 +8,7 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
// Revision History // Revision History
// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones)
// 26 Feb 01 Numerous changes suggested during formal review. (Beman) // 26 Feb 01 Numerous changes suggested during formal review. (Beman)
// 25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp. // 25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp.
// 22 Jan 01 Remove test_tools dependencies to reduce coupling. // 22 Jan 01 Remove test_tools dependencies to reduce coupling.
@ -24,12 +25,20 @@
#include <exception> // for exception, bad_exception #include <exception> // for exception, bad_exception
#include <stdexcept> // for std exception hierarchy #include <stdexcept> // for std exception hierarchy
#include <boost/cstdlib.hpp> // for exit codes #include <boost/cstdlib.hpp> // for exit codes
# if __GNUC__ != 2 || __GNUC_MINOR__ > 95 # if __GNUC__ != 2 || __GNUC_MINOR__ > 96
# include <ostream> // for ostream # include <ostream> // for ostream
# else # else
# include <iostream> // workaround GNU missing ostream header # include <iostream> // workaround GNU missing ostream header
# endif # endif
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
# endif
#if defined(MPW_CPLUS) && (MPW_CPLUS <= 0x890)
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
namespace std { class bad_typeid { }; }
# endif
namespace boost namespace boost
{ {
@ -37,8 +46,8 @@ namespace boost
namespace detail namespace detail
{ {
// A separate reporting function was requested during formal review. // A separate reporting function was requested during formal review.
void report_exception( std::ostream & os, inline void report_exception( std::ostream & os,
const char * name, const char * info ) const char * name, const char * info )
{ os << "\n** uncaught exception: " << name << " " << info << std::endl; } { os << "\n** uncaught exception: " << name << " " << info << std::endl; }
} }
@ -51,10 +60,13 @@ namespace boost
int result = 0; // quiet compiler warnings int result = 0; // quiet compiler warnings
bool exception_thrown = true; // avoid setting result for each excptn type bool exception_thrown = true; // avoid setting result for each excptn type
#ifndef BOOST_NO_EXCEPTIONS
try try
{ {
#endif
result = function_object(); result = function_object();
exception_thrown = false; exception_thrown = false;
#ifndef BOOST_NO_EXCEPTIONS
} }
// As a result of hard experience with strangely interleaved output // As a result of hard experience with strangely interleaved output
@ -74,15 +86,15 @@ namespace boost
catch ( const std::bad_alloc & ex ) catch ( const std::bad_alloc & ex )
{ detail::report_exception( out, "std::bad_alloc:", ex.what() ); } { detail::report_exception( out, "std::bad_alloc:", ex.what() ); }
# if !defined(__BORLANDC__) || __BORLANDC__ > 0x0551 # ifndef BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
catch ( const std::bad_cast & ex ) catch ( const std::bad_cast & ex )
{ detail::report_exception( out, "std::bad_cast:", ex.what() ); } { detail::report_exception( out, "std::bad_cast:", ex.what() ); }
catch ( const std::bad_typeid & ex ) catch ( const std::bad_typeid & ex )
{ detail::report_exception( out, "std::bad_typeid:", ex.what() ); } { detail::report_exception( out, "std::bad_typeid:", ex.what() ); }
# else # else
catch ( const std::bad_cast & ex ) catch ( const std::bad_cast & )
{ detail::report_exception( out, "std::bad_cast", "" ); } { detail::report_exception( out, "std::bad_cast", "" ); }
catch ( const std::bad_typeid & ex ) catch ( const std::bad_typeid & )
{ detail::report_exception( out, "std::bad_typeid", "" ); } { detail::report_exception( out, "std::bad_typeid", "" ); }
# endif # endif
@ -111,6 +123,7 @@ namespace boost
catch ( ... ) catch ( ... )
{ detail::report_exception( out, "unknown exception", "" ); } { detail::report_exception( out, "unknown exception", "" ); }
#endif // BOOST_NO_EXCEPTIONS
if ( exception_thrown ) result = boost::exit_exception_failure; if ( exception_thrown ) result = boost::exit_exception_failure;
@ -122,8 +135,9 @@ namespace boost
<< "********** errors detected; see stdout for details ***********" << "********** errors detected; see stdout for details ***********"
<< std::endl; << std::endl;
} }
#if !defined(BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE)
else { out << std::flush << "no errors detected" << std::endl; } else { out << std::flush << "no errors detected" << std::endl; }
#endif
return result; return result;
} // catch_exceptions } // catch_exceptions

View File

@ -62,14 +62,10 @@
# include <iterator> # include <iterator>
# include <cstddef> # include <cstddef>
# if defined(BOOST_MSVC_STD_ITERATOR) # if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
# include <xtree> # include <xtree>
# include <deque> # include <deque>
# include <list> # 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 # endif
@ -110,7 +106,7 @@ template <> struct iterator_traits_select<true>
typedef std::ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
typedef Ptr pointer; typedef Ptr pointer;
#ifdef BOOST_MSVC #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
// Keeps MSVC happy under certain circumstances. It seems class template default // Keeps MSVC happy under certain circumstances. It seems class template default
// arguments are partly instantiated even when not used when the class template // arguments are partly instantiated even when not used when the class template
// is the return type of a function template. // is the return type of a function template.
@ -183,7 +179,7 @@ struct bad_output_iterator_select<false>
}; };
# endif # 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 // We'll sort iterator types into one of these classifications, from which we
// can determine the difference_type, pointer, reference, and value_type // 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> template <class V, class D, class C>
yes_type is_std_iterator_helper(const volatile std::iterator<V,D,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? // Is the iterator derived from boost::iterator?
template <class C, class T, class D, class P, class R> 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>*); 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>*); yes_type is_ostream_iterator_helper(const volatile std::ostream_iterator<T,CharT,Traits>*);
no_type is_ostream_iterator_helper(...); 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> template <class T>
struct msvc_iterator_classification { struct msvc_iterator_classification {
BOOST_STATIC_CONSTANT(unsigned, BOOST_STATIC_CONSTANT(unsigned,
@ -336,7 +287,7 @@ template <> struct iterator_traits_select<false>
template <class Iterator> template <class Iterator>
struct traits struct traits
{ {
# if defined(BOOST_MSVC_STD_ITERATOR) # if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
typedef msvc_traits_select<( typedef msvc_traits_select<(
msvc_iterator_classification<Iterator>::value msvc_iterator_classification<Iterator>::value
)>::template traits_<Iterator> inner_traits; )>::template traits_<Iterator> inner_traits;
@ -348,7 +299,6 @@ template <> struct iterator_traits_select<false>
# elif !defined(BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION) # elif !defined(BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION)
typedef typename Iterator::difference_type difference_type; typedef typename Iterator::difference_type difference_type;
typedef typename Iterator::value_type value_type; typedef typename Iterator::value_type value_type;
typedef typename Iterator::difference_type difference_type;
typedef typename Iterator::pointer pointer; typedef typename Iterator::pointer pointer;
typedef typename Iterator::reference reference; typedef typename Iterator::reference reference;
# else # else

View File

@ -4,10 +4,16 @@
// "as is" without express or implied warranty, and with no claim as // "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose. // to its suitability for any purpose.
// Revision History:
// 04 Oct 2001 David Abrahams
// Changed name of "bind" to "select" to avoid problems with MSVC.
#ifndef BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP #ifndef BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
#define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP #define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
#include <boost/type_traits/conversion_traits.hpp> #include <boost/type_traits/conversion_traits.hpp>
#include <boost/type_traits/composite_traits.hpp> // for is_reference
#if defined(__BORLANDC__) #if defined(__BORLANDC__)
#include <boost/type_traits/ice.hpp> #include <boost/type_traits/ice.hpp>
#endif #endif
@ -19,7 +25,7 @@ namespace boost {
struct dummy_default_gen { struct dummy_default_gen {
template <class Base, class Traits> template <class Base, class Traits>
struct bind { struct select {
typedef default_argument type; typedef default_argument type;
}; };
}; };
@ -40,14 +46,14 @@ namespace boost {
struct choose_default { struct choose_default {
template <class Arg, class DefaultGen, class Base, class Traits> template <class Arg, class DefaultGen, class Base, class Traits>
struct bind { struct select {
typedef typename default_generator<DefaultGen>::type Gen; typedef typename default_generator<DefaultGen>::type Gen;
typedef typename Gen::template bind<Base,Traits>::type type; typedef typename Gen::template select<Base,Traits>::type type;
}; };
}; };
struct choose_arg { struct choose_arg {
template <class Arg, class DefaultGen, class Base, class Traits> template <class Arg, class DefaultGen, class Base, class Traits>
struct bind { struct select {
typedef Arg type; typedef Arg type;
}; };
}; };
@ -80,7 +86,7 @@ namespace boost {
#endif #endif
public: public:
typedef typename Selector typedef typename Selector
::template bind<Arg, DefaultGen, Base, Traits>::type type; ::template select<Arg, DefaultGen, Base, Traits>::type type;
}; };
// To differentiate an unnamed parameter from a traits generator // To differentiate an unnamed parameter from a traits generator
@ -89,40 +95,42 @@ namespace boost {
template <class X> template <class X>
struct is_named_param_list { struct is_named_param_list {
enum { value = is_convertible<X, named_template_param_base>::value }; enum { value = is_convertible<X, named_template_param_base>::value };
}; };
struct choose_named_params { struct choose_named_params {
template <class Prev> struct bind { typedef Prev type; }; template <class Prev> struct select { typedef Prev type; };
}; };
struct choose_default_arg { struct choose_default_arg {
template <class Prev> struct bind { template <class Prev> struct select {
typedef detail::default_argument type; typedef detail::default_argument type;
}; };
}; };
template <bool Named> struct choose_default_dispatch { }; template <bool Named> struct choose_default_dispatch_;
template <> struct choose_default_dispatch<true> { template <> struct choose_default_dispatch_<true> {
typedef choose_named_params type; typedef choose_named_params type;
}; };
template <> struct choose_default_dispatch<false> { template <> struct choose_default_dispatch_<false> {
typedef choose_default_arg type; typedef choose_default_arg type;
}; };
// The use of inheritance here is a Solaris Forte 6 workaround.
template <bool Named> struct choose_default_dispatch
: public choose_default_dispatch_<Named> { };
template <class PreviousArg> template <class PreviousArg>
struct choose_default_argument { struct choose_default_argument {
enum { is_named = is_named_param_list<PreviousArg>::value }; enum { is_named = is_named_param_list<PreviousArg>::value };
typedef typename choose_default_dispatch<is_named>::type Selector; typedef typename choose_default_dispatch<is_named>::type Selector;
typedef typename Selector::template bind<PreviousArg>::type type; typedef typename Selector::template select<PreviousArg>::type type;
}; };
// This macro assumes that there is a class named default_##TYPE // This macro assumes that there is a class named default_##TYPE
// defined before the application of the macro. This class should // defined before the application of the macro. This class should
// have a single member class template named "bind" with two // have a single member class template named "select" with two
// template parameters: the type of the class being created (e.g., // template parameters: the type of the class being created (e.g.,
// the iterator_adaptor type when creating iterator adaptors) and // the iterator_adaptor type when creating iterator adaptors) and
// a traits class. The bind class should have a single typedef // a traits class. The select class should have a single typedef
// named "type" that produces the default for TYPE. See // named "type" that produces the default for TYPE. See
// boost/iterator_adaptors.hpp for an example usage. Also, // boost/iterator_adaptors.hpp for an example usage. Also,
// applications of this macro must be placed in namespace // applications of this macro must be placed in namespace
@ -131,7 +139,7 @@ namespace boost {
#define BOOST_NAMED_TEMPLATE_PARAM(TYPE) \ #define BOOST_NAMED_TEMPLATE_PARAM(TYPE) \
struct get_##TYPE##_from_named { \ struct get_##TYPE##_from_named { \
template <class Base, class NamedParams, class Traits> \ template <class Base, class NamedParams, class Traits> \
struct bind { \ struct select { \
typedef typename NamedParams::traits NamedTraits; \ typedef typename NamedParams::traits NamedTraits; \
typedef typename NamedTraits::TYPE TYPE; \ typedef typename NamedTraits::TYPE TYPE; \
typedef typename resolve_default<TYPE, \ typedef typename resolve_default<TYPE, \
@ -139,7 +147,7 @@ namespace boost {
}; \ }; \
}; \ }; \
struct pass_thru_##TYPE { \ struct pass_thru_##TYPE { \
template <class Base, class Arg, class Traits> struct bind { \ template <class Base, class Arg, class Traits> struct select { \
typedef typename resolve_default<Arg, \ typedef typename resolve_default<Arg, \
default_##TYPE, Base, Traits>::type type; \ default_##TYPE, Base, Traits>::type type; \
};\ };\
@ -157,7 +165,7 @@ namespace boost {
enum { is_named = is_named_param_list<X>::value }; \ enum { is_named = is_named_param_list<X>::value }; \
typedef typename get_##TYPE##_dispatch<is_named>::type Selector; \ typedef typename get_##TYPE##_dispatch<is_named>::type Selector; \
public: \ public: \
typedef typename Selector::template bind<Base, X, Traits>::type type; \ typedef typename Selector::template select<Base, X, Traits>::type type; \
}; \ }; \
template <> struct default_generator<default_##TYPE> { \ template <> struct default_generator<default_##TYPE> { \
typedef default_##TYPE type; \ typedef default_##TYPE type; \

View File

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

View File

@ -19,7 +19,9 @@ namespace boost { namespace detail {
// Template class if_true -- select among 2 types based on a bool constant expression // Template class if_true -- select among 2 types based on a bool constant expression
// Usage: // Usage:
// typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type // typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
template <bool> struct if_true
// HP aCC cannot deal with missing names for template value parameters
template <bool b> struct if_true
{ {
template <class T, class F> template <class T, class F>
struct then { typedef T type; }; struct then { typedef T type; };

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