Compare commits

...

45 Commits

Author SHA1 Message Date
a0fa548ce7 Release 1.45.0
[SVN r66646]
2010-11-19 15:17:53 +00:00
e4ac9a7c8e Rename 'check' in detail/is_incrementable.
Merged [63763] and mark other merged changes.


[SVN r64868]
2010-08-17 19:19:59 +00:00
d8dc59f6cb Merge fix for #2762 from trunk.
[SVN r62260]
2010-05-27 14:12:42 +00:00
c5eac8e96c Merge some detail changes.
- [53670] Avoid C style casts.
 - [55604] Fix #3346 boost/detail/scoped_enum_emulation.hpp enum_t conflict
   with Unix rpc/types.h
 - Don't foward declare containers when using gcc's parallel library and add a
   macro to disable forward declaration. Fixes #3866.


[SVN r59679]
2010-02-14 16:31:21 +00:00
134c915cbf Merged changes from trunk that are going into 1.42.0
[SVN r58554]
2009-12-29 03:50:53 +00:00
3c935aaf8f Merge [57958] to release. Fixes #3378.
[SVN r58069]
2009-11-30 20:38:31 +00:00
726c4a7182 Merge to release, fix for fix in r35591:
sometimes __hppa is on PA-RISC but __hpux isn't
(e.g. on linux)

Fixes ticket #3537





[SVN r57049]
2009-10-21 18:07:45 +00:00
1ede593bc2 rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
debb7ae2de Merge from trunk
[SVN r55125]
2009-07-23 15:20:53 +00:00
4a28e5d5a1 Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
fc561bdc77 Merge latest hash developments:
* Avoid float to int warning.
 * Work around 'using namespace' bug in Visual C++.
 * Make `<boost/functional/hash/extensions.hpp> self contained.
 * Move some of the extension implementation from the main hash header
   into the exensions header.
 * Remove BOOST_HASH_CHAR_TRAITS from `container_fwd.hpp`.
 * Other minor changes.

Merged revisions 53828,53924,54024-54025,54033-54034,54139-54145,54399 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r53828 | danieljames | 2009-06-12 19:24:47 +0100 (Fri, 12 Jun 2009) | 1 line
  
  Try to avoid float to int warning when a float function doesn't exist.
........
  r53924 | danieljames | 2009-06-15 08:37:42 +0100 (Mon, 15 Jun 2009) | 4 lines
  
  Remove hash_complex_test's dependency on Boost.Random.
  
  Only test for a few values, but that should be okay as there isn't much
  to test.
........
  r54024 | danieljames | 2009-06-17 22:22:49 +0100 (Wed, 17 Jun 2009) | 1 line
  
  Put the minimum amount of implementation in the same namespace as the 'using namespace' directives in order to avoid Visual C++ 8 bug.
........
  r54025 | danieljames | 2009-06-17 22:23:42 +0100 (Wed, 17 Jun 2009) | 1 line
  
  Try to avoid using special macro handling code.
........
  r54033 | danieljames | 2009-06-18 00:24:28 +0100 (Thu, 18 Jun 2009) | 1 line
  
  Add copyright to namespace_fail_test.cpp
........
  r54034 | danieljames | 2009-06-18 00:25:12 +0100 (Thu, 18 Jun 2009) | 1 line
  
  A couple of missing newlines.
........
  r54139 | danieljames | 2009-06-21 10:41:11 +0100 (Sun, 21 Jun 2009) | 1 line
  
  A few more comments in boost::hash.
........
  r54140 | danieljames | 2009-06-21 10:41:30 +0100 (Sun, 21 Jun 2009) | 1 line
  
  Move includes to the header which they're used in.
........
  r54141 | danieljames | 2009-06-21 10:41:46 +0100 (Sun, 21 Jun 2009) | 1 line
  
  Revert [54025] "Try to avoid using special macro handling code."
........
  r54142 | danieljames | 2009-06-21 10:42:05 +0100 (Sun, 21 Jun 2009) | 1 line
  
  Get <boost/functional/hash/extensions.hpp> to work.
........
  r54143 | danieljames | 2009-06-21 10:42:20 +0100 (Sun, 21 Jun 2009) | 1 line
  
  Move BOOST_HASH_CHAR_TRAITS from container_fwd into the hash headers, and undefine it.
........
  r54144 | danieljames | 2009-06-21 10:42:40 +0100 (Sun, 21 Jun 2009) | 1 line
  
  Move the support for hashing containers into the extension header, and improve the standard tests.
........
  r54145 | danieljames | 2009-06-21 10:51:59 +0100 (Sun, 21 Jun 2009) | 1 line
  
  I didn't mean to comment this out.
........
  r54399 | danieljames | 2009-06-27 08:39:12 +0100 (Sat, 27 Jun 2009) | 1 line
  
  Add am implementation note about the Visual C++ problems.
........


[SVN r54402]
2009-06-27 08:12:20 +00:00
2438dc56f1 Support BOOST_NO_TYPEID and BOOST_NO_IOSTREAM in Boost.Variant. Fixes #3051.
Merged revisions 53682 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r53682 | danieljames | 2009-06-06 12:46:24 +0100 (Sat, 06 Jun 2009) | 1 line
  
  Support BOOST_NO_TYPEID and BOOST_NO_IOSTREAM in Boost.Variant. Fixes #3051.
........


[SVN r54398]
2009-06-27 07:34:42 +00:00
fbc029e131 merged [49289] and [52371] from trunk
[SVN r52944]
2009-05-12 20:01:46 +00:00
ca7ccbfa77 Merge from trunk
[SVN r52935]
2009-05-12 11:27:19 +00:00
65a58553fb Merge quickbook and hash changelogs. Tweak gcc detection in container_fwd.hpp
Merged revisions 52084,52245-52246,52304,52320,52323 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r52084 | danieljames | 2009-03-31 20:43:58 +0100 (Tue, 31 Mar 2009) | 1 line
  
  Changelog for unordered and hash.
........
  r52245 | danieljames | 2009-04-08 06:51:31 +0100 (Wed, 08 Apr 2009) | 5 lines
  
  Detect gcc stdlib for gcc 4.0.1.
  
  For some reason the normal macros aren't defined for the standard
  library that comes with gcc 4.0.1 (although maybe just on BSDs?). So try
  to detect the library for that compiler.
........
  r52246 | danieljames | 2009-04-08 11:56:22 +0100 (Wed, 08 Apr 2009) | 7 lines
  
  Include <utility> for some versions of gcc's library.
  
  Sometimes gcc's <cstddef> doesn't define the C++ macros, so check for it
  and include <utility> in that case. Also remove a workaround from
  container_fwd.hpp
  
  Fixes #2924.
........
  r52304 | danieljames | 2009-04-10 20:25:32 +0100 (Fri, 10 Apr 2009) | 4 lines
  
  Don't use debug containers on darwin.
  
  I'm getting errors from the darwin 4.2 debug containers which appear to
  a problem with its implementation.
........
  r52320 | danieljames | 2009-04-11 08:53:59 +0100 (Sat, 11 Apr 2009) | 1 line
  
  Don't need to include utility now that select_stdlib has been fixed.
........
  r52323 | danieljames | 2009-04-11 09:26:20 +0100 (Sat, 11 Apr 2009) | 1 line
  
  Also don't need to check for _GLIBCXX_CSTDDEF.
........


[SVN r52324]
2009-04-11 08:49:33 +00:00
0d006f2718 Merge [51976] to release.
[SVN r52015]
2009-03-27 13:04:22 +00:00
1df6d3e0e2 Merge [51509], [51519] to release. Closes #2239.
[SVN r51531]
2009-03-02 16:22:16 +00:00
9d2dd3f219 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
c0fb2515b0 Merge from trunk
[SVN r50676]
2009-01-19 18:56:42 +00:00
f8ffc48c7e Merged revisions 49661-49662,49666,49669,49735,49756,49770,49811 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r49661 | danieljames | 2008-11-09 12:03:45 +0000 (Sun, 09 Nov 2008) | 1 line
  
  Move hash detail headers out of boost/functional/detail.
........
  r49662 | danieljames | 2008-11-09 12:11:50 +0000 (Sun, 09 Nov 2008) | 1 line
  
  Add a forwarding header for container_fwd.hpp
........
  r49666 | danieljames | 2008-11-09 19:12:05 +0000 (Sun, 09 Nov 2008) | 1 line
  
  Avoid comparing default initialised iterators in position_iterator.
........
  r49669 | danieljames | 2008-11-09 21:57:38 +0000 (Sun, 09 Nov 2008) | 2 lines
  
  Add link to the header to the synopsis in reference documentation.
  Refs #2214
........
  r49735 | danieljames | 2008-11-14 12:51:00 +0000 (Fri, 14 Nov 2008) | 1 line
  
  Explicitly specify the template parameters in the unordered container friend, in order to avoid some warnings.
........
  r49756 | danieljames | 2008-11-14 16:11:16 +0000 (Fri, 14 Nov 2008) | 1 line
  
  Use pragmas to suppress a Visual C++ warning.
........
  r49770 | danieljames | 2008-11-15 13:07:29 +0000 (Sat, 15 Nov 2008) | 1 line
  
  Use the new swap library.
........
  r49811 | danieljames | 2008-11-16 23:10:00 +0000 (Sun, 16 Nov 2008) | 1 line
  
  Fix a typo.
........


[SVN r49855]
2008-11-20 22:53:20 +00:00
20c35502cb Merged revisions 43283,43992,44388 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43283 | bemandawes | 2008-02-16 18:01:32 -0800 (Sat, 16 Feb 2008) | 1 line
  
  Show output of example program
........
  r43992 | marshall | 2008-04-01 18:42:32 -0700 (Tue, 01 Apr 2008) | 1 line
  
  Replaced all occurrences of non-ASCII copyright symbol with '(c)' for people using non-ASCII code pages
........
  r44388 | grafik | 2008-04-13 16:55:58 -0700 (Sun, 13 Apr 2008) | 1 line
  
  Move tokenizer tests into canonical test subdir structure.
........


[SVN r49216]
2008-10-09 18:05:35 +00:00
4ae97fa5cb boost/pending/: ported revision 48251 ("integer_log2.hpp and lowest_bit.hpp, in boost/pending/: little comment cleanup (svn anchors, etc.); added a static_cast<> to silence (harmless) MSVC++ warnings") from trunk
[SVN r48353]
2008-08-24 18:16:24 +00:00
b328080dbb Merged 44595, 44638, 44707, 44711, 44728 from trunk to release
[SVN r47341]
2008-07-12 10:41:24 +00:00
a6af6ca66f Merged 43316, 43317, 43318, 43733, 43782, 43873, 43888, 43916, 43950, 44055, 44056, 44058, 44073, 44074, 44132, 44137, 44138, 44140, 44344 from trunk to release
[SVN r47339]
2008-07-12 09:55:08 +00:00
df8aaff6da merged up to rev. 47041 from trunk
[SVN r47045]
2008-07-03 16:51:53 +00:00
680e819cf3 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
22520394e4 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
9469ab6c88 config, detail, filesystem, system, tools, at 41278.
[SVN r41316]
2007-11-23 17:03:14 +00:00
8da5b03c03 Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
49858c1ac4 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
ec6dfefa6e Corrected wrong order in copyright notices.
[SVN r36240]
2006-12-02 10:04:37 +00:00
1df1d181c0 Merged a copyright addition from trunk to branch.
[SVN r36231]
2006-12-01 14:28:43 +00:00
dc34adabef Merged L & C issue fixes from trunk to branch.
[SVN r36225]
2006-12-01 11:34:43 +00:00
8aebcc4fbd Updated patch from Boris Gubenko.
[SVN r35672]
2006-10-20 10:08:21 +00:00
2551c9baf0 Fix for HP-UX on Itanium.
[SVN r35591]
2006-10-13 17:08:47 +00:00
71ec49242e Added 64-bit Intel processor support.
[SVN r35587]
2006-10-13 12:40:40 +00:00
0dc54e7b18 Kill off stray 'y' character.
[SVN r35530]
2006-10-09 12:29:34 +00:00
4039b44fce Fix typos.
[SVN r35503]
2006-10-06 15:22:30 +00:00
2f7218cdc4 Make is_reference_to_pointer work properly with an abstract class
[SVN r35498]
2006-10-05 13:51:07 +00:00
37cd3c6dd2 Windows CE patch by Michael Fink
[SVN r33986]
2006-05-17 22:33:47 +00:00
71a268689d merged from trunk
[SVN r33868]
2006-04-30 03:05:01 +00:00
4dda81e93a This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +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
20 changed files with 616 additions and 358 deletions

View File

@ -15,9 +15,11 @@
#include "boost/blank_fwd.hpp" #include "boost/blank_fwd.hpp"
#if !defined(BOOST_NO_IOSTREAM)
#include <iosfwd> // for std::basic_ostream forward declare #include <iosfwd> // for std::basic_ostream forward declare
#include "boost/detail/templated_streams.hpp" #include "boost/detail/templated_streams.hpp"
#endif // BOOST_NO_IOSTREAM
#include "boost/mpl/bool.hpp" #include "boost/mpl/bool.hpp"
#include "boost/type_traits/is_empty.hpp" #include "boost/type_traits/is_empty.hpp"
#include "boost/type_traits/is_pod.hpp" #include "boost/type_traits/is_pod.hpp"
@ -85,6 +87,8 @@ inline bool operator>(const blank&, const blank&)
// streaming support // streaming support
// //
#if !defined(BOOST_NO_IOSTREAM)
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<( inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
BOOST_TEMPLATED_STREAM(ostream, E,T)& out BOOST_TEMPLATED_STREAM(ostream, E,T)& out
@ -95,6 +99,8 @@ inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
return out; return out;
} }
#endif // BOOST_NO_IOSTREAM
} // namespace boost } // namespace boost
#endif // BOOST_BLANK_HPP #endif // BOOST_BLANK_HPP

View File

@ -1,4 +1,4 @@
/* Copyright 2003-2005 Joaqu<EFBFBD>n M L<EFBFBD>pez Mu<EFBFBD>oz. /* Copyright 2003-2009 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
@ -30,13 +30,21 @@ namespace detail{
namespace allocator{ namespace allocator{
/* partial_std_allocator_wrapper inherits the functionality of a std /* 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> template<typename Type>
class partial_std_allocator_wrapper:public std::allocator<Type> class partial_std_allocator_wrapper:public std::allocator<Type>
{ {
public: 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(){}; partial_std_allocator_wrapper(){};
template<typename Other> template<typename Other>
@ -170,12 +178,31 @@ void construct(void* p,const Type& t)
new (p) Type(t); new (p) Type(t);
} }
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC++ issues spurious warnings about unreferencend formal parameters
* in destroy<Type> when Type is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename Type> template<typename Type>
void destroy(const Type* p) void destroy(const Type* p)
{ {
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
const_cast<Type*>(p)->~Type();
#else
p->~Type(); p->~Type();
#endif
} }
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
} /* namespace boost::detail::allocator */ } /* namespace boost::detail::allocator */
} /* namespace boost::detail */ } /* namespace boost::detail */

View File

@ -0,0 +1,101 @@
// Copyright 2005-2008 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
#define BOOST_DETAIL_CONTAINER_FWD_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \
|| ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
&& (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \
|| BOOST_WORKAROUND(__BORLANDC__, > 0x551) \
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \
|| (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
#include <deque>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <complex>
#else
#include <cstddef>
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \
defined(__STL_CONFIG_H)
#define BOOST_CONTAINER_FWD_BAD_BITSET
#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
#define BOOST_CONTAINER_FWD_BAD_DEQUE
#endif
#endif
#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
#include <deque>
#endif
#if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
#include <bitset>
#endif
#if defined(BOOST_MSVC)
#pragma warning(push)
#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
#endif
namespace std
{
template <class T> class allocator;
template <class charT, class traits, class Allocator> class basic_string;
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
template <class charT> struct string_char_traits;
#else
template <class charT> struct char_traits;
#endif
template <class T> class complex;
}
// gcc 3.4 and greater
namespace std
{
#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
template <class T, class Allocator> class deque;
#endif
template <class T, class Allocator> class list;
template <class T, class Allocator> class vector;
template <class Key, class T, class Compare, class Allocator> class map;
template <class Key, class T, class Compare, class Allocator>
class multimap;
template <class Key, class Compare, class Allocator> class set;
template <class Key, class Compare, class Allocator> class multiset;
#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
template <size_t N> class bitset;
#endif
template <class T1, class T2> struct pair;
}
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
#endif
#endif

View File

@ -1,3 +1,9 @@
// Copyright 2005 Caleb Epstein
// Copyright 2006 John Maddock
// Copyright 2010 Rene Rivera
// 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 * Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc. * Silicon Graphics Computer Systems, Inc.
@ -37,9 +43,17 @@
# error Unknown machine endianness detected. # error Unknown machine endianness detected.
# endif # endif
# define BOOST_BYTE_ORDER __BYTE_ORDER # define BOOST_BYTE_ORDER __BYTE_ORDER
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \
defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
# define BOOST_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \
defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \ #elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \ || defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hppa) \ || defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|| defined(_MIPSEB) || defined(_POWER) \ || defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__) || defined(__s390__)
# define BOOST_BIG_ENDIAN # define BOOST_BIG_ENDIAN
@ -47,7 +61,11 @@
#elif defined(__i386__) || defined(__alpha__) \ #elif defined(__i386__) || defined(__alpha__) \
|| defined(__ia64) || defined(__ia64__) \ || defined(__ia64) || defined(__ia64__) \
|| defined(_M_IX86) || defined(_M_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) || defined(__bfin__)
# define BOOST_LITTLE_ENDIAN # define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234 # define BOOST_BYTE_ORDER 1234
#else #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(...); outer_no_type reference_to_pointer_helper(...);
template <class T> template <class T>
struct is_reference_to_pointer struct reference_to_pointer_impl
{ {
static T t; static T t;
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
bool, value 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; 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)) BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
}; };
template <class T> template <class T>
struct is_reference_to_function_pointer struct is_reference_to_function_pointer
: mpl::if_< : mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type
is_reference<T>
, is_pointer_to_function_aux<T>
, mpl::bool_<false>
>::type
{ {
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T)) BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
}; };

View File

@ -27,40 +27,84 @@
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer # 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 ) #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
#if defined( __CLRCALL_PURE_OR_CDECL )
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long );
extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long );
#else
extern "C" long __cdecl _InterlockedIncrement( long volatile * ); extern "C" long __cdecl _InterlockedIncrement( long volatile * );
extern "C" long __cdecl _InterlockedDecrement( long volatile * ); extern "C" long __cdecl _InterlockedDecrement( long volatile * );
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long __cdecl _InterlockedExchange( long volatile *, long); extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
#endif
# pragma intrinsic( _InterlockedIncrement ) # pragma intrinsic( _InterlockedIncrement )
# pragma intrinsic( _InterlockedDecrement ) # pragma intrinsic( _InterlockedDecrement )
# pragma intrinsic( _InterlockedCompareExchange ) # pragma intrinsic( _InterlockedCompareExchange )
# pragma intrinsic( _InterlockedExchange ) # pragma intrinsic( _InterlockedExchange )
# pragma intrinsic( _InterlockedExchangeAdd )
# if defined(_M_IA64) || defined(_M_AMD64) # if defined(_M_IA64) || defined(_M_AMD64)
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* ); extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
# pragma intrinsic( _InterlockedCompareExchangePointer ) # pragma intrinsic( _InterlockedCompareExchangePointer )
# pragma intrinsic( _InterlockedExchangePointer ) # pragma intrinsic( _InterlockedExchangePointer )
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer # define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
# else # else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ # define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif # endif
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement # define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement # define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange # define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange # 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 namespace boost
{ {
@ -72,6 +116,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 InterlockedDecrement( long volatile * );
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long ); 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 InterlockedExchange( long volatile *, long );
extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
} // namespace detail } // namespace detail
} // namespace boost } // namespace boost
@ -80,6 +126,8 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volati
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement # define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange # define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ # define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \

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

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

@ -4,13 +4,15 @@
#ifndef IS_INCREMENTABLE_DWA200415_HPP #ifndef IS_INCREMENTABLE_DWA200415_HPP
# define 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/detail/template_arity_spec.hpp>
# include <boost/type_traits/remove_cv.hpp> # include <boost/type_traits/remove_cv.hpp>
# include <boost/mpl/aux_/lambda_support.hpp> # include <boost/mpl/aux_/lambda_support.hpp>
# include <boost/mpl/bool.hpp> # include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp> # include <boost/detail/workaround.hpp>
// Must be the last include
# include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost { namespace detail { namespace boost { namespace detail {
// is_incrementable<T> metafunction // is_incrementable<T> metafunction
@ -61,12 +63,17 @@ namespace is_incrementable_
tag operator,(tag,int); tag operator,(tag,int);
# define BOOST_comma(a,b) (a,b) # define BOOST_comma(a,b) (a,b)
# endif # 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 // two check overloads help us identify which operator++ was picked
char (& check(tag) )[2]; char (& check_(tag) )[2];
template <class T> template <class T>
char check(T const&); char check_(T const&);
template <class T> template <class T>
@ -76,7 +83,7 @@ namespace is_incrementable_
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
bool bool
, value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1 , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
); );
}; };
@ -87,9 +94,14 @@ namespace is_incrementable_
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
bool bool
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
); );
}; };
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
} }
# undef BOOST_comma # undef BOOST_comma
@ -117,5 +129,6 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
} // namespace boost } // namespace boost
# include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // IS_INCREMENTABLE_DWA200415_HPP #endif // IS_INCREMENTABLE_DWA200415_HPP

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

View File

@ -10,14 +10,15 @@
// //
// boost/detail/lightweight_test.hpp - lightweight test library // boost/detail/lightweight_test.hpp - lightweight test library
// //
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002, 2009 Peter Dimov
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt
// //
// BOOST_TEST(expression) // BOOST_TEST(expression)
// BOOST_ERROR(message) // BOOST_ERROR(message)
// BOOST_TEST_EQ(expr1, expr2)
// //
// int boost::report_errors() // int boost::report_errors()
// //
@ -49,13 +50,27 @@ inline void error_impl(char const * msg, char const * file, int line, char const
++test_errors(); ++test_errors();
} }
template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2, char const * file, int line, char const * function, T const & t, U const & u )
{
if( t == u )
{
}
else
{
std::cerr << file << "(" << line << "): test '" << expr1 << " == " << expr2
<< "' failed in function '" << function << "': "
<< "'" << t << "' != '" << u << "'" << std::endl;
++test_errors();
}
}
} // namespace detail } // namespace detail
inline int report_errors() inline int report_errors()
{ {
int errors = detail::test_errors(); int errors = detail::test_errors();
if(errors == 0) if( errors == 0 )
{ {
std::cerr << "No errors detected." << std::endl; std::cerr << "No errors detected." << std::endl;
return 0; return 0;
@ -71,5 +86,6 @@ inline int report_errors()
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
#define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) #define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
#define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED

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

@ -13,186 +13,11 @@
// Copyright (c) 2003 David Abrahams // Copyright (c) 2003 David Abrahams
// Copyright (c) 2003 Peter Dimov // Copyright (c) 2003 Peter Dimov
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt
// //
#include <boost/config.hpp> #include <boost/smart_ptr/detail/quick_allocator.hpp>
#include <boost/detail/lightweight_mutex.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <new> // ::operator new, ::operator delete
#include <cstddef> // std::size_t
namespace boost
{
namespace detail
{
template<unsigned size, unsigned align_> union freeblock
{
typedef typename boost::type_with_alignment<align_>::type aligner_type;
aligner_type aligner;
char bytes[size];
freeblock * next;
};
template<unsigned size, unsigned align_> struct allocator_impl
{
typedef freeblock<size, align_> block;
// It may seem odd to use such small pages.
//
// However, on a typical Windows implementation that uses
// the OS allocator, "normal size" pages interact with the
// "ordinary" operator new, slowing it down dramatically.
//
// 512 byte pages are handled by the small object allocator,
// and don't interfere with ::new.
//
// The other alternative is to use much bigger pages (1M.)
//
// It is surprisingly easy to hit pathological behavior by
// varying the page size. g++ 2.96 on Red Hat Linux 7.2,
// for example, passionately dislikes 496. 512 seems OK.
#if defined(BOOST_QA_PAGE_SIZE)
enum { items_per_page = BOOST_QA_PAGE_SIZE / size };
#else
enum { items_per_page = 512 / size }; // 1048560 / size
#endif
#ifdef BOOST_HAS_THREADS
static lightweight_mutex & mutex()
{
static lightweight_mutex m;
return m;
}
static lightweight_mutex * mutex_init;
#endif
static block * free;
static block * page;
static unsigned last;
static inline void * alloc()
{
#ifdef BOOST_HAS_THREADS
lightweight_mutex::scoped_lock lock( mutex() );
#endif
if(block * x = free)
{
free = x->next;
return x;
}
else
{
if(last == items_per_page)
{
// "Listen to me carefully: there is no memory leak"
// -- Scott Meyers, Eff C++ 2nd Ed Item 10
page = ::new block[items_per_page];
last = 0;
}
return &page[last++];
}
}
static inline void * alloc(std::size_t n)
{
if(n != size) // class-specific new called for a derived object
{
return ::operator new(n);
}
else
{
#ifdef BOOST_HAS_THREADS
lightweight_mutex::scoped_lock lock( mutex() );
#endif
if(block * x = free)
{
free = x->next;
return x;
}
else
{
if(last == items_per_page)
{
page = ::new block[items_per_page];
last = 0;
}
return &page[last++];
}
}
}
static inline void dealloc(void * pv)
{
if(pv != 0) // 18.4.1.1/13
{
#ifdef BOOST_HAS_THREADS
lightweight_mutex::scoped_lock lock( mutex() );
#endif
block * pb = static_cast<block *>(pv);
pb->next = free;
free = pb;
}
}
static inline void dealloc(void * pv, std::size_t n)
{
if(n != size) // class-specific delete called for a derived object
{
::operator delete(pv);
}
else if(pv != 0) // 18.4.1.1/13
{
#ifdef BOOST_HAS_THREADS
lightweight_mutex::scoped_lock lock( mutex() );
#endif
block * pb = static_cast<block *>(pv);
pb->next = free;
free = pb;
}
}
};
#ifdef BOOST_HAS_THREADS
template<unsigned size, unsigned align_>
lightweight_mutex * allocator_impl<size, align_>::mutex_init = &allocator_impl<size, align_>::mutex();
#endif
template<unsigned size, unsigned align_>
freeblock<size, align_> * allocator_impl<size, align_>::free = 0;
template<unsigned size, unsigned align_>
freeblock<size, align_> * allocator_impl<size, align_>::page = 0;
template<unsigned size, unsigned align_>
unsigned allocator_impl<size, align_>::last = allocator_impl<size, align_>::items_per_page;
template<class T>
struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of<T>::value >
{
};
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED #endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED

View File

@ -0,0 +1,56 @@
// scoped_enum_emulation.hpp ---------------------------------------------------------//
// Copyright Beman Dawes, 2009
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
// scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
// macro is used to detect feature support.
//
// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
// description of the scoped enum feature. Note that the committee changed the name
// from strongly typed enum to scoped enum.
//
// Caution: only the syntax is emulated; the semantics are not emulated and
// the syntax emulation doesn't include being able to specify the underlying
// representation type.
//
// The emulation is via struct rather than namespace to allow use within classes.
// Thanks to Andrey Semashev for pointing that out.
//
// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente
// Botet, and Daniel James.
//
// Sample usage:
//
// BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
// ...
// BOOST_SCOPED_ENUM(algae) sample( algae::red );
// void foo( BOOST_SCOPED_ENUM(algae) color );
// ...
// sample = algae::green;
// foo( algae::cyan );
#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP
#define BOOST_SCOPED_ENUM_EMULATION_HPP
#include <boost/config.hpp>
#ifdef BOOST_NO_SCOPED_ENUMS
# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
# define BOOST_SCOPED_ENUM_END };
# define BOOST_SCOPED_ENUM(name) name::enum_type
#else
# define BOOST_SCOPED_ENUM_START(name) enum class name
# define BOOST_SCOPED_ENUM_END
# define BOOST_SCOPED_ENUM(name) name
#endif
#endif // BOOST_SCOPED_ENUM_EMULATION_HPP

View File

@ -1,9 +1,7 @@
// 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). Permission to copy, // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// use, modify, sell and distribute this software is granted provided this // Distributed under the Boost Software License, Version 1.0. (See accompany-
// copyright notice appears in all copies. This software is provided "as is" // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// without express or implied warranty, and with no claim as to its suitability
// for any purpose.
#ifndef BOOST_UTF8_CODECVT_FACET_HPP #ifndef BOOST_UTF8_CODECVT_FACET_HPP
#define BOOST_UTF8_CODECVT_FACET_HPP #define BOOST_UTF8_CODECVT_FACET_HPP
@ -81,25 +79,18 @@
// specialized on those types for this to work. // specialized on those types for this to work.
#include <locale> #include <locale>
// for mbstate_t #include <cwchar> // for mbstate_t
#include <wchar.h> #include <cstddef> // for std::size_t
// for std::size_t
#include <cstddef>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std { namespace std {
#if defined(__LIBCOMO__) using ::mbstate_t;
using ::mbstate_t; using ::size_t;
#elif defined(BOOST_DINKUMWARE_STDLIB) }
using ::mbstate_t; #endif
#elif defined(__SGI_STL_PORT)
#elif defined(BOOST_NO_STDC_NAMESPACE)
using ::mbstate_t;
using ::codecvt;
#endif
} // namespace std
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
#define BOOST_CODECVT_DO_LENGTH_CONST const #define BOOST_CODECVT_DO_LENGTH_CONST const
@ -162,7 +153,7 @@ protected:
virtual std::codecvt_base::result do_unshift( virtual std::codecvt_base::result do_unshift(
std::mbstate_t&, std::mbstate_t&,
char * from, char * from,
char * to, char * /*to*/,
char * & next char * & next
) const ) const
{ {

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

View File

@ -1,111 +0,0 @@
// (C) Copyright Jeremy Siek 2000.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// The 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.
*/
#include <boost/type_traits/integral_constant.hpp> // true_type and false_type
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; };
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
// 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
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

@ -1,25 +1,24 @@
// ------------------------------------- // -----------------------------------------------------------
// integer_log2.hpp // integer_log2.hpp
// //
// Gives the integer part of the logarithm, in base 2, of a // Gives the integer part of the logarithm, in base 2, of a
// given number. Behavior is undefined if the argument is <= 0. // given number. Behavior is undefined if the argument is <= 0.
// //
// // Copyright (c) 2003-2004, 2008 Gennaro Prota
// (C) Copyright Gennaro Prota 2003 - 2004.
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// ------------------------------------------------------ // -----------------------------------------------------------
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
#define BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301
#include <cassert> #include <assert.h>
#include <climits> // actually used for Borland only #ifdef __BORLANDC__
#include <climits>
#endif
#include "boost/limits.hpp" #include "boost/limits.hpp"
#include "boost/config.hpp" #include "boost/config.hpp"
@ -34,7 +33,7 @@ namespace boost {
while (x != 1) { while (x != 1) {
const T t = x >> n; const T t = static_cast<T>(x >> n);
if (t) { if (t) {
result += n; result += n;
x = t; x = t;

View File

@ -1,7 +1,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// utf8_codecvt_facet.cpp // 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). // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // 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 // Translate incoming UTF-8 into UCS-4
std::codecvt_base::result utf8_codecvt_facet::do_in( std::codecvt_base::result utf8_codecvt_facet::do_in(
std::mbstate_t& state, std::mbstate_t& /*state*/,
const char * from, const char * from,
const char * from_end, const char * from_end,
const char * & from_next, 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::codecvt_base::result utf8_codecvt_facet::do_out(
std::mbstate_t& state, std::mbstate_t& /*state*/,
const wchar_t * from, const wchar_t * from,
const wchar_t * from_end, const wchar_t * from_end,
const wchar_t * & from_next, 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; int shift_exponent = (cont_octet_count) * 6;
// Process the first character // Process the first character
*to++ = octet1_modifier_table[cont_octet_count] + *to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
(unsigned char)(*from / (1 << shift_exponent)); (unsigned char)(*from / (1 << shift_exponent)));
// Process the continuation characters // Process the continuation characters
// Invariants: At the start of the loop: // Invariants: At the start of the loop:
@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
int i = 0; int i = 0;
while (i != cont_octet_count && to != to_end) { while (i != cont_octet_count && to != to_end) {
shift_exponent -= 6; shift_exponent -= 6;
*to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)); *to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
++i; ++i;
} }
// If we filled up the out buffer before encoding the character // If we filled up the out buffer before encoding the character
@ -159,7 +159,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
to_next = to - (i+1); to_next = to - (i+1);
return std::codecvt_base::partial; return std::codecvt_base::partial;
} }
*from++; ++from;
} }
from_next = from; from_next = from;
to_next = to; to_next = to;
@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length(
last_octet_count = (get_octet_count(*from_next)); last_octet_count = (get_octet_count(*from_next));
++char_count; ++char_count;
} }
return from_next-from_end; return static_cast<int>(from_next-from_end);
} }
unsigned int utf8_codecvt_facet::get_octet_count( unsigned int utf8_codecvt_facet::get_octet_count(
@ -231,9 +231,6 @@ int get_cont_octet_out_count_impl(wchar_t word){
return 2; return 2;
} }
// note the following code will generate on some platforms where
// wchar_t is defined as UCS2. The warnings are superfluous as
// the specialization is never instantitiated with such compilers.
template<> template<>
int get_cont_octet_out_count_impl<4>(wchar_t word){ int get_cont_octet_out_count_impl<4>(wchar_t word){
if (word < 0x80) { if (word < 0x80) {
@ -242,7 +239,22 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
if (word < 0x800) { if (word < 0x800) {
return 1; return 1;
} }
if (word < 0x10000) {
// Note that the following code will generate warnings on some platforms
// where wchar_t is defined as UCS2. The warnings are superfluous as the
// specialization is never instantitiated with such compilers, but this
// can cause problems if warnings are being treated as errors, so we guard
// against that. Including <boost/detail/utf8_codecvt_facet.hpp> as we do
// should be enough to get WCHAR_MAX defined.
#if !defined(WCHAR_MAX)
# error WCHAR_MAX not defined!
#endif
// cope with VC++ 7.1 or earlier having invalid WCHAR_MAX
#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier
return 2;
#elif WCHAR_MAX > 0x10000
if (word < 0x10000) {
return 2; return 2;
} }
if (word < 0x200000) { if (word < 0x200000) {
@ -252,6 +264,10 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
return 4; return 4;
} }
return 5; return 5;
#else
return 2;
#endif
} }
} // namespace anonymous } // namespace anonymous