Compare commits

...

30 Commits

Author SHA1 Message Date
5e54c37940 Branch at revision 46530
[SVN r46531]
2008-06-19 18:57:10 +00:00
3c2c779258 simplified namespace issue with mbstate_t
[SVN r46408]
2008-06-15 17:01:43 +00:00
7c911e570f modification to correct error detected on stdxxx tests
[SVN r46392]
2008-06-14 17:46:41 +00:00
96b53f28a8 silenced warning about comma operator (C4913) for VC 8-9 with warning level 4
[SVN r45754]
2008-05-25 23:36:55 +00:00
7e259580c1 Apply NetBSD fix from issue #1922.
[SVN r45608]
2008-05-21 15:39:41 +00:00
3d539b76df Factored out boost/detail/lightweight_thread.hpp.
[SVN r44638]
2008-04-20 15:37:08 +00:00
e4054d843a spinlock_nt.hpp added, Cygwin fixes.
[SVN r44055]
2008-04-05 15:06:31 +00:00
9dcdea9efc Replaced all occurrences of non-ASCII copyright symbol with '(c)' for people using non-ASCII code pages
[SVN r43992]
2008-04-02 01:42:32 +00:00
715c05005f Added changes from David Deakins to enable compilation on Windows CE
[SVN r40679]
2007-11-02 09:17:02 +00:00
6443246b4b Boost 1.35 version of Boost.MultiIndex
allocator_utilities.hpp: added partial_std_allocator_wrapper::value_type
composite_key.hpp: used hash_fwd.hpp
auto_space.hpp: added support for non-standard allocators
bidir_node_iterator.hpp: moved friend-injected operators out of class
copy_map.hpp: added support for non-standard allocators
hash_index_args.hpp: removed deprecated use of <boost/functional/hash/hash.hpp>
hash_index_iterator.hpp: moved friend-injected operators our of class
hash_index_node.hpp: added support for non-standard allocators
header_holder.hpp:added support for non-standard allocators
index_base.hpp: added support for non-standard allocators, added modify_rollback, added small improvement to modify
index_loader.hpp: added support for non-standard allocators
index_matcher.hpp: added support for non-standard allocators
index_node_base.hpp: added support for non-standard allocators
iter_adaptor.hpp: added some out-of-class operators to alleviate a MSVC++ 6.0 problem
modify_key_adaptor.hpp: renamed some vars to accomudate broader usage scope
node_type.hpp: added support for non-standard allocators
ord_index_node.hpp: added support for non-standard allocators
ord_index_ops.hpp: implemented a more efficient equal_range
rnd_index_loader.hpp: added support for non-standard allocators
rnd_index_node.hpp: added support for non-standard allocators
rnd_index_ops.hpp: added support for non-standard allocators
rnd_index_ptr_array.hpp: added support for non-standard allocators
rnd_node_iterator.hpp: moved friend-injected operators out of class
seq_index_node.hpp: added support for non-standard allocators
seq_index_ops.hpp: added support for non-standard allocators
uintptr_type.hpp: added support for __int64
unbounded.hpp: fixed ODR problem
value_compare.hpp: fixed a small unefficiency
global_fun: initial commit
hashed_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, [local_]iterator_to, rollback modify
identity_fwd.hpp: fixed wrong include guard name
key_extractors.hpp: added global_fun
mem_fun.hpp: removed superfluous =0's
ordered_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, improved equal_range and range, added conformance to DR 233
random_access_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, added conformance to 23.1.1/9
sequenced_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, added conformance to 23.1.1/9, improved resize
multi_index_container.hpp: added support for non-standard allocators, improved ctor_args_list, rollback modify
acknowledgements.html: added entry for Boost 1.35
examples.html: renamed example 2, added B.IP example/composite_keys.cpp
future_work.html: removed entry on bimap
hash_indices.html: added c[r]{begin|end}, [local_]iterator_to, rollback modify
reference/index.html: added global_fun
reference/key_extraction.html: added global_fun, added technical correction
multi_index_container.html: added support for non-standard allocators
ord_indices.html: added c[r]{begin|end}, iterator_to, rollback modify
rnd_indices.html: added c[r]{begin|end}, iterator_to, rollback modify
seq_indices.html: added c[r]{begin|end}, iterator_to, rollback modify
release_notes.html: added entry for Boost 1.35
tests.html: added new serialization test file
basics.html: added rollback modify
creation.html: added support for non-standard allocators
tutorial/indices.html: added iterator_to
tutorial/key_extraction.html: added global_fun
composite_keys.cpp: fixed technicality
fun_key.cpp: was memfun_key.cpp, added global_fun
ip_allocator.cpp: initial commit
example/Jamfile.v2: renamed memfun_key, added ip_allocator
test_perf.cpp: fixed technicality
employee.hpp: used a non-standard allocator
test/Jamfile.v2: added new test file
non_std_allocator.hpp: initial commit
pair_of_ints.hpp: added decrement facilities
test_capacity.cpp: added extra check on resize
test_copy_assignment.cpp: added test for 23.1.1/9
test_iterators.cpp: added tests for c[r]{begin|end} and [local_]iterator_to, fixed technicality
test_key_extractors.cpp: added tests for global_fun
test_modifiers.cpp: added tests dor DR 233, fixed technicality
test_range.cpp: added extra checks to secure range refactoring
test_rearrange.cpp: fixed technicality
test_serialization.cpp: added new test file
test_serialization1.cpp: corrected include, used a non-standard allocator
test_serialization2.cpp: corrected include, used a non-standard allocator, split some stuff ro test_serialization3.cpp
test_serialization3.cpp: initial commit
test_serialization3.hpp: initial commit
test_serialization_template.hpp: removed some reliance on ADL
test_update.cpp: addes tests for rollback modify, fixed technicality

[SVN r39922]
2007-10-11 10:57:30 +00:00
82bda71faa Clear compiler warnings
[SVN r39520]
2007-09-25 13:45:52 +00:00
1da5dd89a8 Corrected wrong order in copyright notices.
[SVN r36240]
2006-12-02 10:04:37 +00:00
57fd51f8f4 Added Caleb as copyright owner.
[SVN r36230]
2006-12-01 14:27:03 +00:00
60e5d575c0 Fixed license & copyright issues.
[SVN r36224]
2006-12-01 10:29:49 +00:00
87ff652a07 move to namespace detail
[SVN r36027]
2006-11-13 22:10:57 +00:00
a548ecc968 Replaced the implementation of ct_if with a facade implementation that
defers to Boost.MPL.


[SVN r36022]
2006-11-13 15:35:54 +00:00
4e009de1ec Bring into compliance with N2066, TR2 Diagnostics Enhancements. Tests passing on Win32, Linux, on most modern compilers.
[SVN r35823]
2006-11-03 16:57:30 +00:00
751e863564 Updated patch from Boris Gubenko.
[SVN r35672]
2006-10-20 10:08:21 +00:00
62b7d277f2 Fix for HP-UX on Itanium.
[SVN r35591]
2006-10-13 17:08:47 +00:00
7106b3c8b1 Added 64-bit Intel processor support.
[SVN r35587]
2006-10-13 12:40:40 +00:00
cd03e4d537 Fix typos.
[SVN r35505]
2006-10-06 15:45:41 +00:00
afbb75b3cb Make is_reference_to_pointer work properly with an abstract class
[SVN r35498]
2006-10-05 13:51:07 +00:00
e2bea194a3 use <assert.h>; include <climits> for Borland only
[SVN r34906]
2006-08-19 11:05:56 +00:00
72a38b9137 identification
[SVN r34905]
2006-08-19 11:04:25 +00:00
e71cca99a6 Windows CE patch by Michael Fink
[SVN r33986]
2006-05-17 22:33:47 +00:00
d2e2b59111 *** empty log message ***
[SVN r33878]
2006-04-30 23:56:35 +00:00
7d61e78d56 Keep bool_trait_def.hpp as the last #include; add bool_trait_undef.hpp at the end.
[SVN r33867]
2006-04-30 03:04:18 +00:00
c749e63ff2 Win32 implementation of boost::timed_mutex
[SVN r33272]
2006-03-08 22:24:52 +00:00
bbd4cb3de1 Patch for Borland 2006 compiler, using Dinkumware libraries
[SVN r33094]
2006-02-23 21:04:21 +00:00
3417f92b35 trivial adjustments to enable warning-free compilation with gcc -Wall -W -Werror
[SVN r32364]
2006-01-20 16:53:30 +00:00
15 changed files with 382 additions and 133 deletions

View File

@ -1,4 +1,4 @@
/* Copyright 2003-2005 Joaqu<71>n M L<>pez Mu<4D>oz.
/* Copyright 2003-2007 Joaqu<71>n M L<>pez Mu<4D>oz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -30,13 +30,21 @@ namespace detail{
namespace allocator{
/* partial_std_allocator_wrapper inherits the functionality of a std
* allocator while providing a templatized ctor.
* allocator while providing a templatized ctor and other bits missing
* in some stdlib implementation or another.
*/
template<typename Type>
class partial_std_allocator_wrapper:public std::allocator<Type>
{
public:
/* Oddly enough, STLport does not define std::allocator<void>::value_type
* when configured to work without partial template specialization.
* No harm in supplying the definition here unconditionally.
*/
typedef Type value_type;
partial_std_allocator_wrapper(){};
template<typename Other>

View File

@ -1,3 +1,8 @@
// Copyright 2005 Caleb Epstein
// Copyright 2006 John Maddock
// 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)
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
@ -37,9 +42,15 @@
# error Unknown machine endianness detected.
# endif
# define BOOST_BYTE_ORDER __BYTE_ORDER
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
# define BOOST_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hppa) \
|| defined(__ppc__) || defined(__hpux) \
|| defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__)
# define BOOST_BIG_ENDIAN
@ -47,7 +58,11 @@
#elif defined(__i386__) || defined(__alpha__) \
|| defined(__ia64) || defined(__ia64__) \
|| defined(_M_IX86) || defined(_M_IA64) \
|| defined(_M_ALPHA)
|| defined(_M_ALPHA) || defined(__amd64) \
|| defined(__amd64__) || defined(_M_AMD64) \
|| defined(__x86_64) || defined(__x86_64__) \
|| defined(_M_X64)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#else

View File

@ -0,0 +1,29 @@
// (C) Copyright Matthias Troyerk 2006.
// 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/type_traits for most recent version including documentation.
#ifndef BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
#include <boost/type_traits/has_trivial_constructor.hpp>
namespace boost { namespace detail {
/// type trait to check for a default constructor
///
/// The default implementation just checks for a trivial constructor.
/// Using some compiler magic it might be possible to provide a better default
template <class T>
struct has_default_constructor
: public has_trivial_constructor<T>
{};
} } // namespace boost::detail
#endif // BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED

View File

@ -0,0 +1,89 @@
// boost/identifier.hpp ----------------------------------------------------//
// Copyright Beman Dawes 2006
// Distributed under the 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 documentation at http://www.boost.org/libs/utility
#ifndef BOOST_IDENTIFIER_HPP
#define BOOST_IDENTIFIER_HPP
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <iosfwd>
namespace boost
{
namespace detail
{
// class template identifier ---------------------------------------------//
// Always used as a base class so that different instantiations result in
// different class types even if instantiated with the same value type T.
// Expected usage is that T is often an integer type, best passed by
// value. There is no reason why T can't be a possibly larger class such as
// std::string, best passed by const reference.
// This implementation uses pass by value, based on expected common uses.
template <typename T, typename D>
class identifier
{
public:
typedef T value_type;
const value_type value() const { return m_value; }
void assign( value_type v ) { m_value = v; }
bool operator==( const D & rhs ) const { return m_value == rhs.m_value; }
bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; }
bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; }
bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; }
bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; }
bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; }
typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type
static void unspecified_bool_true(D){} // conversion allows relational operators
// between different identifier types
operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; }
bool operator!() const { return m_value == value_type(); }
// constructors are protected so that class can only be used as a base class
protected:
identifier() {}
explicit identifier( value_type v ) : m_value(v) {}
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround
private:
#endif
T m_value;
};
//#ifndef BOOST_NO_SFINAE
// template <class Ostream, class Id>
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
// Ostream & >::type operator<<( Ostream & os, const Id & id )
// {
// return os << id.value();
// }
// template <class Istream, class Id>
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
// Istream & >::type operator>>( Istream & is, Id & id )
// {
// typename Id::value_type v;
// is >> v;
// id.value( v );
// return is;
// }
//#endif
} // namespace detail
} // namespace boost
#endif // BOOST_IDENTIFIER_HPP

16
include/boost/detail/indirect_traits.hpp Executable file → Normal file
View File

@ -388,27 +388,27 @@ typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
outer_no_type reference_to_pointer_helper(...);
template <class T>
struct is_reference_to_pointer
struct reference_to_pointer_impl
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= (is_reference<T>::value
&& sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
= (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
);
typedef mpl::bool_<value> type;
};
template <class T>
struct is_reference_to_pointer
: mpl::eval_if<is_reference<T>, reference_to_pointer_impl<T>, mpl::false_>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
};
template <class T>
struct is_reference_to_function_pointer
: mpl::if_<
is_reference<T>
, is_pointer_to_function_aux<T>
, mpl::bool_<false>
>::type
: mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
};

View File

@ -27,40 +27,72 @@
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer
#elif defined(_WIN32_WCE)
// under Windows CE we still have old-style Interlocked* functions
extern "C" long __cdecl InterlockedIncrement( long* );
extern "C" long __cdecl InterlockedDecrement( long* );
extern "C" long __cdecl InterlockedCompareExchange( long*, long, long );
extern "C" long __cdecl InterlockedExchange( long*, long );
extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange)))
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long __cdecl _InterlockedExchange( long volatile *, long);
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long);
# pragma intrinsic( _InterlockedIncrement )
# pragma intrinsic( _InterlockedDecrement )
# pragma intrinsic( _InterlockedCompareExchange )
# pragma intrinsic( _InterlockedExchange )
# pragma intrinsic( _InterlockedExchangeAdd )
# if defined(_M_IA64) || defined(_M_AMD64)
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
# pragma intrinsic( _InterlockedCompareExchangePointer )
# pragma intrinsic( _InterlockedExchangePointer )
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
namespace boost
{
@ -72,6 +104,8 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volat
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
} // namespace detail
} // namespace boost
@ -80,6 +114,8 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volati
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \

0
include/boost/detail/is_function_ref_tester.hpp Executable file → Normal file
View File

17
include/boost/detail/is_incrementable.hpp Executable file → Normal file
View File

@ -4,13 +4,15 @@
#ifndef IS_INCREMENTABLE_DWA200415_HPP
# define IS_INCREMENTABLE_DWA200415_HPP
# include <boost/type_traits/detail/bool_trait_def.hpp>
# include <boost/type_traits/detail/template_arity_spec.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
// Must be the last include
# include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost { namespace detail {
// is_incrementable<T> metafunction
@ -61,7 +63,12 @@ namespace is_incrementable_
tag operator,(tag,int);
# define BOOST_comma(a,b) (a,b)
# endif
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4913) // Warning about operator,
# endif
// two check overloads help us identify which operator++ was picked
char (& check(tag) )[2];
@ -90,6 +97,11 @@ namespace is_incrementable_
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
);
};
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
}
# undef BOOST_comma
@ -117,5 +129,6 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
} // namespace boost
# include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // IS_INCREMENTABLE_DWA200415_HPP

0
include/boost/detail/is_xxx.hpp Executable file → Normal file
View File

View File

@ -0,0 +1,135 @@
#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// boost/detail/lightweight_thread.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008 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 <boost/config.hpp>
#include <memory>
#include <cerrno>
// pthread_create, pthread_join
#if defined( BOOST_HAS_PTHREADS )
#include <pthread.h>
#else
#include <windows.h>
#include <process.h>
typedef HANDLE pthread_t;
int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg )
{
HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 );
if( h != 0 )
{
*thread = h;
return 0;
}
else
{
return EAGAIN;
}
}
int pthread_join( pthread_t thread, void ** /*value_ptr*/ )
{
::WaitForSingleObject( thread, INFINITE );
::CloseHandle( thread );
return 0;
}
#endif
// template<class F> int lw_thread_create( pthread_t & pt, F f );
namespace boost
{
namespace detail
{
class lw_abstract_thread
{
public:
virtual ~lw_abstract_thread() {}
virtual void run() = 0;
};
#if defined( BOOST_HAS_PTHREADS )
extern "C" void * lw_thread_routine( void * pv )
{
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
pt->run();
return 0;
}
#else
unsigned __stdcall lw_thread_routine( void * pv )
{
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
pt->run();
return 0;
}
#endif
template<class F> class lw_thread_impl: public lw_abstract_thread
{
public:
explicit lw_thread_impl( F f ): f_( f )
{
}
void run()
{
f_();
}
private:
F f_;
};
template<class F> int lw_thread_create( pthread_t & pt, F f )
{
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
if( r == 0 )
{
p.release();
}
return r;
}
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED

View File

@ -1,9 +1,7 @@
// Copyright <EFBFBD> 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). 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) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// 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)
#ifndef BOOST_UTF8_CODECVT_FACET_HPP
#define BOOST_UTF8_CODECVT_FACET_HPP
@ -81,25 +79,16 @@
// specialized on those types for this to work.
#include <locale>
// for mbstate_t
#include <wchar.h>
// for std::size_t
#include <cstddef>
#include <cwchar> // for mbstate_t
#include <cstddef> // for std::size_t
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
namespace std {
#if defined(__LIBCOMO__)
using ::mbstate_t;
#elif defined(BOOST_DINKUMWARE_STDLIB)
using ::mbstate_t;
#elif defined(__SGI_STL_PORT)
#elif defined(BOOST_NO_STDC_NAMESPACE)
using ::mbstate_t;
using ::codecvt;
#endif
} // namespace std
#if defined(BOOST_NO_STDC_NAMESPACE)
using ::codecvt;
using ::mbstate_t;
#endif
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
#define BOOST_CODECVT_DO_LENGTH_CONST const
@ -162,7 +151,7 @@ protected:
virtual std::codecvt_base::result do_unshift(
std::mbstate_t&,
char * from,
char * to,
char * /*to*/,
char * & next
) const
{

0
include/boost/indirect_reference.hpp Executable file → Normal file
View File

View File

@ -3,107 +3,39 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// The ct_if implementation that avoids partial specialization is
// based on the IF class by Ulrich W. Eisenecker and Krzysztof
// Czarnecki.
// This header replaces the implementation of ct_if that preceded the
// introduction of Boost.MPL with a facade that defers to that reviewed and
// accepted library.
// Author: Ronald Garcia
// Date: 20 October, 2006
#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.
*/
// A stub implementation in terms of Boost.MPL
#include <boost/type_traits/integral_constant.hpp> // true_type and false_type
#include <boost/mpl/if.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/and.hpp>
// true_type and false_type are used by applications of ct_if
#include <boost/type_traits/integral_constant.hpp>
namespace boost {
struct ct_if_error { };
template <class A, class B>
struct ct_and { typedef false_type type; };
template <> struct ct_and<true_type,true_type> { typedef true_type type; };
struct ct_and : boost::mpl::and_<A,B> {};
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; };
template <class A>
struct ct_not : mpl::not_<A> {};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// agurt, 15/sep/02: in certain cases Borland has problems with
// choosing the right 'ct_if' specialization even though 'cond'
// _does_ equal '1'; the easiest way to fix it is to make first
// 'ct_if' non-type template parameter boolean.
#if !defined(__BORLANDC__)
template <bool cond, class A, class B>
struct ct_if { typedef ct_if_error type; };
template <class A, class B>
struct ct_if<true, A, B> { typedef A type; };
template <class A, class B>
struct ct_if<false, A, B> { typedef B type; };
#else
template <bool cond, class A, class B>
struct ct_if { typedef A type; };
template <class A, class B>
struct ct_if<false, A, B> { typedef B type; };
#endif
struct ct_if : mpl::if_c<cond,A,B> {};
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
struct ct_if_t : mpl::if_<cond,A,B> {};
} // namespace boost

View File

@ -12,14 +12,17 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// ------------------------------------------------------
//
// $Id$
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
#include <cassert>
#include <climits> // actually used for Borland only
#include <assert.h>
#ifdef __BORLANDC__
#include <climits>
#endif
#include "boost/limits.hpp"
#include "boost/config.hpp"

View File

@ -1,7 +1,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// utf8_codecvt_facet.cpp
// Copyright <EFBFBD> 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -32,7 +32,7 @@ BOOST_UTF8_BEGIN_NAMESPACE
// Translate incoming UTF-8 into UCS-4
std::codecvt_base::result utf8_codecvt_facet::do_in(
std::mbstate_t& state,
std::mbstate_t& /*state*/,
const char * from,
const char * from_end,
const char * & from_next,
@ -109,7 +109,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_in(
}
std::codecvt_base::result utf8_codecvt_facet::do_out(
std::mbstate_t& state,
std::mbstate_t& /*state*/,
const wchar_t * from,
const wchar_t * from_end,
const wchar_t * & from_next,
@ -139,8 +139,8 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
int shift_exponent = (cont_octet_count) * 6;
// Process the first character
*to++ = octet1_modifier_table[cont_octet_count] +
(unsigned char)(*from / (1 << shift_exponent));
*to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
(unsigned char)(*from / (1 << shift_exponent)));
// Process the continuation characters
// Invariants: At the start of the loop:
@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
int i = 0;
while (i != cont_octet_count && to != to_end) {
shift_exponent -= 6;
*to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6));
*to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
++i;
}
// If we filled up the out buffer before encoding the character
@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length(
last_octet_count = (get_octet_count(*from_next));
++char_count;
}
return from_next-from_end;
return static_cast<int>(from_next-from_end);
}
unsigned int utf8_codecvt_facet::get_octet_count(