mirror of
https://github.com/boostorg/detail.git
synced 2025-06-28 13:31:05 +02:00
Compare commits
171 Commits
svn-branch
...
boost-1.56
Author | SHA1 | Date | |
---|---|---|---|
275643c97b | |||
509c2421e3 | |||
1318e4a728 | |||
e87cff715b | |||
80d39bd695 | |||
3e560e9927 | |||
fb36ac293c | |||
1dc95cb4cb | |||
a1a7d328bb | |||
efc21f5bf4 | |||
d9d6e09ca9 | |||
05fecc6e3e | |||
ec72ca9b03 | |||
5cdcab8b51 | |||
231ba60b50 | |||
9663320036 | |||
c9cceb0ce9 | |||
a9cc3926de | |||
678063ef3a | |||
83be62c6c1 | |||
676d007618 | |||
38fc0a4352 | |||
b4e608fcf2 | |||
2644ef67ac | |||
099854dece | |||
9063b1d1fd | |||
9288a7df75 | |||
c75e59f0e1 | |||
78b061c1e1 | |||
a46db5a32e | |||
d436bcd121 | |||
7312799cc0 | |||
3194681a02 | |||
16ee7725f4 | |||
3d6fdcfda4 | |||
345b3a3b50 | |||
094070e5e4 | |||
33bc52789a | |||
3dd2674052 | |||
d5699c31c9 | |||
c1b71a6f12 | |||
55f85a4d1f | |||
8c689a1533 | |||
f362e5e72f | |||
4a5de13017 | |||
3220177536 | |||
1e84644646 | |||
84da532b39 | |||
54822d775b | |||
bae1bebd28 | |||
59ce745040 | |||
8e3280c8ee | |||
3319b4ac54 | |||
3dafb197cc | |||
0e75aca4dd | |||
d32882cc08 | |||
6395ed2f25 | |||
a747594bdd | |||
684ee20edb | |||
5e28401195 | |||
2114a3d026 | |||
0f9b39df3f | |||
933b2c596b | |||
4dc7897c9f | |||
41f09db5d6 | |||
c8ca7d9788 | |||
1de858a76f | |||
275fe9d73b | |||
8ca67eedb4 | |||
1ec40ed29c | |||
589631a886 | |||
41e2470d21 | |||
eb60febe83 | |||
73c18922d1 | |||
ce5864b47e | |||
8590e40965 | |||
e1e8b05e02 | |||
79bce0a5f2 | |||
2b05049c56 | |||
6a98633c6c | |||
06aac2f311 | |||
81cbc142ac | |||
8bfa4e2836 | |||
bd58c2d229 | |||
610e913595 | |||
19ca421f24 | |||
538f8f7b3b | |||
ae93c52b75 | |||
d50a20412b | |||
eb6208f69a | |||
d5aa8a952a | |||
dc1a439ec0 | |||
c77e8e89cf | |||
2ea55870e4 | |||
436afec8b3 | |||
112b2471b7 | |||
2cbdcde368 | |||
689df8ea62 | |||
67f78550e5 | |||
5973a2bcef | |||
d8159674fa | |||
0c7444b84f | |||
804546aacf | |||
02d2fb38e3 | |||
c11c0ef97b | |||
b39e23464b | |||
0e2bc0d9f4 | |||
9378f3d4f7 | |||
20332e24e5 | |||
6caa4f2698 | |||
2a116b4ea4 | |||
a017040e81 | |||
de25ca2c03 | |||
06c06ee09c | |||
9436535318 | |||
469b547c88 | |||
32b452486f | |||
b95901a068 | |||
3b2a3d1cfc | |||
be8f3b19eb | |||
799953dd55 | |||
e2ed5892c2 | |||
860576c740 | |||
07227dd61d | |||
1d3205b456 | |||
94dcc475a1 | |||
bb233de354 | |||
455d56887e | |||
17d5ed080b | |||
7ce0af2bba | |||
e4ac9a7c8e | |||
d8dc59f6cb | |||
c5eac8e96c | |||
134c915cbf | |||
3c935aaf8f | |||
726c4a7182 | |||
1ede593bc2 | |||
debb7ae2de | |||
4a28e5d5a1 | |||
fc561bdc77 | |||
2438dc56f1 | |||
fbc029e131 | |||
ca7ccbfa77 | |||
65a58553fb | |||
0d006f2718 | |||
1df6d3e0e2 | |||
9d2dd3f219 | |||
c0fb2515b0 | |||
f8ffc48c7e | |||
20c35502cb | |||
4ae97fa5cb | |||
b328080dbb | |||
a6af6ca66f | |||
df8aaff6da | |||
680e819cf3 | |||
22520394e4 | |||
9469ab6c88 | |||
8da5b03c03 | |||
49858c1ac4 | |||
ec6dfefa6e | |||
1df1d181c0 | |||
dc34adabef | |||
8aebcc4fbd | |||
2551c9baf0 | |||
71ec49242e | |||
0dc54e7b18 | |||
4039b44fce | |||
2f7218cdc4 | |||
37cd3c6dd2 | |||
71a268689d | |||
4dda81e93a |
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2009 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* 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)
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/mpl/aux_/msvc_never_true.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <cstddef>
|
||||
@ -116,29 +115,6 @@ struct partial_std_allocator_rebind_to
|
||||
|
||||
/* rebind operation in all other cases */
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
/* Workaround for a problem in MSVC with dependent template typedefs
|
||||
* when doing rebinding of allocators.
|
||||
* Modeled after <boost/mpl/aux_/msvc_dtw.hpp> (thanks, Aleksey!)
|
||||
*/
|
||||
|
||||
template<typename Allocator>
|
||||
struct rebinder
|
||||
{
|
||||
template<bool> struct fake_allocator:Allocator{};
|
||||
template<> struct fake_allocator<true>
|
||||
{
|
||||
template<typename Type> struct rebind{};
|
||||
};
|
||||
|
||||
template<typename Type>
|
||||
struct result:
|
||||
fake_allocator<mpl::aux::msvc_never_true<Allocator>::value>::
|
||||
template rebind<Type>
|
||||
{
|
||||
};
|
||||
};
|
||||
#else
|
||||
template<typename Allocator>
|
||||
struct rebinder
|
||||
{
|
||||
@ -149,7 +125,6 @@ struct rebinder
|
||||
rebind<Type>::other other;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename Allocator,typename Type>
|
||||
struct compliant_allocator_rebind_to
|
||||
|
@ -24,11 +24,7 @@
|
||||
#include <exception> // for exception, bad_exception
|
||||
#include <stdexcept> // for std exception hierarchy
|
||||
#include <boost/cstdlib.hpp> // for exit codes
|
||||
# if __GNUC__ != 2 || __GNUC_MINOR__ > 96
|
||||
# include <ostream> // for ostream
|
||||
# else
|
||||
# include <iostream> // workaround GNU missing ostream header
|
||||
# endif
|
||||
#include <ostream> // for ostream
|
||||
|
||||
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
|
||||
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
|
||||
|
@ -8,7 +8,7 @@
|
||||
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
|
||||
#define BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) && \
|
||||
#if defined(_MSC_VER) && \
|
||||
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
||||
# pragma once
|
||||
#endif
|
||||
@ -119,12 +119,7 @@ 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
|
||||
|
||||
#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
|
||||
template <class T> struct complex;
|
||||
|
@ -1,78 +0,0 @@
|
||||
// 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
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright notice reproduced from <boost/detail/limits.hpp>, from
|
||||
* which this code was originally taken.
|
||||
*
|
||||
* Modified by Caleb Epstein to use <endian.h> with GNU libc and to
|
||||
* defined the BOOST_ENDIAN macro.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_ENDIAN_HPP
|
||||
#define BOOST_DETAIL_ENDIAN_HPP
|
||||
|
||||
// GNU libc offers the helpful header <endian.h> which defines
|
||||
// __BYTE_ORDER
|
||||
|
||||
#if defined (__GLIBC__)
|
||||
# include <endian.h>
|
||||
# if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
# define BOOST_LITTLE_ENDIAN
|
||||
# elif (__BYTE_ORDER == __BIG_ENDIAN)
|
||||
# define BOOST_BIG_ENDIAN
|
||||
# elif (__BYTE_ORDER == __PDP_ENDIAN)
|
||||
# define BOOST_PDP_ENDIAN
|
||||
# else
|
||||
# error Unknown machine endianness detected.
|
||||
# endif
|
||||
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
||||
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \
|
||||
defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \
|
||||
defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN)
|
||||
# define BOOST_BIG_ENDIAN
|
||||
# define BOOST_BYTE_ORDER 4321
|
||||
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \
|
||||
defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \
|
||||
defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN)
|
||||
# define BOOST_LITTLE_ENDIAN
|
||||
# define BOOST_BYTE_ORDER 1234
|
||||
#elif defined(__sparc) || defined(__sparc__) \
|
||||
|| defined(_POWER) || defined(__powerpc__) \
|
||||
|| defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|
||||
|| defined(_MIPSEB) || defined(_POWER) \
|
||||
|| defined(__s390__)
|
||||
# define BOOST_BIG_ENDIAN
|
||||
# define BOOST_BYTE_ORDER 4321
|
||||
#elif defined(__i386__) || defined(__alpha__) \
|
||||
|| defined(__ia64) || defined(__ia64__) \
|
||||
|| defined(_M_IX86) || defined(_M_IA64) \
|
||||
|| 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_BYTE_ORDER 1234
|
||||
#else
|
||||
# error The file boost/detail/endian.hpp needs to be set up for your CPU type.
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -14,7 +14,7 @@
|
||||
#if !defined(BOOST_DETAIL_FENV_HPP)
|
||||
#define BOOST_DETAIL_FENV_HPP
|
||||
|
||||
/* If we're using clang + glibc, we have to get hacky.
|
||||
/* If we're using clang + glibc, we have to get hacky.
|
||||
* See http://llvm.org/bugs/show_bug.cgi?id=6907 */
|
||||
#if defined(__clang__) && (__clang_major__ < 3) && \
|
||||
defined(__GNU_LIBRARY__) && /* up to version 5 */ \
|
||||
@ -61,14 +61,41 @@
|
||||
using ::feholdexcept;
|
||||
} }
|
||||
|
||||
#elif defined(__MINGW32__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
|
||||
|
||||
// MinGW (32-bit) has a bug in mingw32/bits/c++config.h, it does not define _GLIBCXX_HAVE_FENV_H,
|
||||
// which prevents the C fenv.h header contents to be included in the C++ wrapper header fenv.h. This is at least
|
||||
// the case with gcc 4.8.1 packages tested so far, up to 4.8.1-4. Note that there is no issue with
|
||||
// MinGW-w64.
|
||||
// To work around the bug we avoid including the C++ wrapper header and include the C header directly
|
||||
// and import all relevant symbols into std:: ourselves.
|
||||
|
||||
#include <../include/fenv.h>
|
||||
|
||||
namespace std {
|
||||
using ::fenv_t;
|
||||
using ::fexcept_t;
|
||||
using ::fegetexceptflag;
|
||||
using ::fesetexceptflag;
|
||||
using ::feclearexcept;
|
||||
using ::feraiseexcept;
|
||||
using ::fetestexcept;
|
||||
using ::fegetround;
|
||||
using ::fesetround;
|
||||
using ::fegetenv;
|
||||
using ::fesetenv;
|
||||
using ::feupdateenv;
|
||||
using ::feholdexcept;
|
||||
}
|
||||
|
||||
#else /* if we're not using GNU's C stdlib, fenv.h should work with clang */
|
||||
|
||||
#if defined(__SUNPRO_CC) /* lol suncc */
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* BOOST_DETAIL_FENV_HPP */
|
||||
|
||||
|
@ -57,9 +57,7 @@ namespace boost
|
||||
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;
|
||||
};
|
||||
|
||||
|
282
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
282
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
@ -26,15 +26,11 @@
|
||||
# include <boost/mpl/not.hpp>
|
||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||
|
||||
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# include <boost/detail/is_function_ref_tester.hpp>
|
||||
# endif
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
namespace indirect_traits {
|
||||
|
||||
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template <class T>
|
||||
struct is_reference_to_const : mpl::false_
|
||||
{
|
||||
@ -199,284 +195,6 @@ struct is_pointer_to_class
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
|
||||
};
|
||||
|
||||
# else
|
||||
|
||||
using namespace boost::detail::is_function_ref_tester_;
|
||||
|
||||
typedef char (&inner_yes_type)[3];
|
||||
typedef char (&inner_no_type)[2];
|
||||
typedef char (&outer_no_type)[1];
|
||||
|
||||
template <typename V>
|
||||
struct is_const_help
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
is_const<V>
|
||||
, inner_yes_type
|
||||
, inner_no_type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
struct is_volatile_help
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
is_volatile<V>
|
||||
, inner_yes_type
|
||||
, inner_no_type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
struct is_pointer_help
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
is_pointer<V>
|
||||
, inner_yes_type
|
||||
, inner_no_type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
struct is_class_help
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
is_class<V>
|
||||
, inner_yes_type
|
||||
, inner_no_type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_function_aux
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::boost::type_traits::yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_function
|
||||
: mpl::if_<is_reference<T>, is_reference_to_function_aux<T>, mpl::bool_<false> >::type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_pointer_to_function_aux
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_pointer_to_function
|
||||
: mpl::if_<is_pointer<T>, is_pointer_to_function_aux<T>, mpl::bool_<false> >::type
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T))
|
||||
};
|
||||
|
||||
struct false_helper1
|
||||
{
|
||||
template <class T>
|
||||
struct apply : mpl::false_
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
typename is_const_help<V>::type reference_to_const_helper(V&);
|
||||
outer_no_type
|
||||
reference_to_const_helper(...);
|
||||
|
||||
struct true_helper1
|
||||
{
|
||||
template <class T>
|
||||
struct apply
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_const_helper(t)) == sizeof(inner_yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
template <bool ref = true>
|
||||
struct is_reference_to_const_helper1 : true_helper1
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_reference_to_const_helper1<false> : false_helper1
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_const
|
||||
: is_reference_to_const_helper1<is_reference<T>::value>::template apply<T>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
template <bool ref = true>
|
||||
struct is_reference_to_non_const_helper1
|
||||
{
|
||||
template <class T>
|
||||
struct apply
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
|
||||
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_reference_to_non_const_helper1<false> : false_helper1
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_non_const
|
||||
: is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_non_const,(T))
|
||||
};
|
||||
|
||||
|
||||
template <typename V>
|
||||
typename is_volatile_help<V>::type reference_to_volatile_helper(V&);
|
||||
outer_no_type
|
||||
reference_to_volatile_helper(...);
|
||||
|
||||
template <bool ref = true>
|
||||
struct is_reference_to_volatile_helper1
|
||||
{
|
||||
template <class T>
|
||||
struct apply
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_reference_to_volatile_helper1<false> : false_helper1
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_volatile
|
||||
: is_reference_to_volatile_helper1<is_reference<T>::value>::template apply<T>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
|
||||
outer_no_type reference_to_pointer_helper(...);
|
||||
|
||||
template <class T>
|
||||
struct reference_to_pointer_impl
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= (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::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))
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
struct is_member_function_pointer_help
|
||||
: mpl::if_<is_member_function_pointer<T>, inner_yes_type, inner_no_type>
|
||||
{};
|
||||
|
||||
template <typename V>
|
||||
typename is_member_function_pointer_help<V>::type member_function_pointer_helper(V&);
|
||||
outer_no_type member_function_pointer_helper(...);
|
||||
|
||||
template <class T>
|
||||
struct is_pointer_to_member_function_aux
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof((member_function_pointer_helper)(t)) == sizeof(inner_yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_member_function_pointer
|
||||
: mpl::if_<
|
||||
is_reference<T>
|
||||
, is_pointer_to_member_function_aux<T>
|
||||
, mpl::bool_<false>
|
||||
>::type
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
typename is_class_help<V>::type reference_to_class_helper(V const volatile&);
|
||||
outer_no_type reference_to_class_helper(...);
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_class
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= (is_reference<T>::value
|
||||
& (sizeof(reference_to_class_helper(t)) == sizeof(inner_yes_type)))
|
||||
);
|
||||
typedef mpl::bool_<value> type;
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
typename is_class_help<V>::type pointer_to_class_helper(V const volatile*);
|
||||
outer_no_type pointer_to_class_helper(...);
|
||||
|
||||
template <class T>
|
||||
struct is_pointer_to_class
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= (is_pointer<T>::value
|
||||
&& sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
|
||||
);
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,163 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/interlocked.hpp
|
||||
//
|
||||
// Copyright 2005 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>
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
# include <windows.h>
|
||||
|
||||
# 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 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 )
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1600
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
#elif 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 _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 );
|
||||
|
||||
#endif
|
||||
|
||||
# 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__ ) || defined( __CYGWIN__ )
|
||||
|
||||
#if defined(__MINGW64__)
|
||||
#define BOOST_INTERLOCKED_IMPORT
|
||||
#else
|
||||
#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long );
|
||||
|
||||
# if defined(_M_IA64) || defined(_M_AMD64)
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
|
||||
extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
|
||||
# endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement
|
||||
# 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
|
||||
|
||||
# if defined(_M_IA64) || defined(_M_AMD64)
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer
|
||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::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
|
||||
|
||||
#else
|
||||
|
||||
# error "Interlocked intrinsics not available"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
@ -1,135 +0,0 @@
|
||||
|
||||
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
|
||||
// Aleksey Gurtovoy, Howard Hinnant & John Maddock 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)
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
///// header body
|
||||
|
||||
#ifndef BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
|
||||
|
||||
#include "boost/type_traits/detail/yes_no_type.hpp"
|
||||
#include "boost/type_traits/config.hpp"
|
||||
|
||||
#if defined(BOOST_TT_PREPROCESSING_MODE)
|
||||
# include "boost/preprocessor/iterate.hpp"
|
||||
# include "boost/preprocessor/enum_params.hpp"
|
||||
# include "boost/preprocessor/comma_if.hpp"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace is_function_ref_tester_ {
|
||||
|
||||
template <class T>
|
||||
boost::type_traits::no_type BOOST_TT_DECL is_function_ref_tester(T& ...);
|
||||
|
||||
#if !defined(BOOST_TT_PREPROCESSING_MODE)
|
||||
// preprocessor-generated part, don't edit by hand!
|
||||
|
||||
template <class R>
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(), int);
|
||||
|
||||
template <class R,class T0 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0), int);
|
||||
|
||||
template <class R,class T0,class T1 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23), int);
|
||||
|
||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23,class T24 >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24), int);
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, 25, "boost/type_traits/detail/is_function_ref_tester.hpp"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif // BOOST_TT_PREPROCESSING_MODE
|
||||
|
||||
} // namespace detail
|
||||
} // namespace python
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
|
||||
|
||||
///// iteration
|
||||
|
||||
#else
|
||||
#define i BOOST_PP_FRAME_ITERATION(1)
|
||||
|
||||
template <class R BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T) >
|
||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(BOOST_PP_ENUM_PARAMS(i,T)), int);
|
||||
|
||||
#undef i
|
||||
#endif // BOOST_PP_IS_ITERATING
|
@ -55,8 +55,7 @@ namespace is_incrementable_
|
||||
|
||||
# endif
|
||||
|
||||
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
|
||||
# define BOOST_comma(a,b) (a)
|
||||
# else
|
||||
// In case an operator++ is found that returns void, we'll use ++x,0
|
||||
|
34
include/boost/detail/is_xxx.hpp
Executable file → Normal file
34
include/boost/detail/is_xxx.hpp
Executable file → Normal file
@ -8,39 +8,6 @@
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/preprocessor/enum_params.hpp>
|
||||
|
||||
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
# include <boost/type_traits/is_reference.hpp>
|
||||
# include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
||||
template <class X_> \
|
||||
struct is_##name \
|
||||
{ \
|
||||
typedef char yes; \
|
||||
typedef char (&no)[2]; \
|
||||
\
|
||||
static typename add_reference<X_>::type dummy; \
|
||||
\
|
||||
struct helpers \
|
||||
{ \
|
||||
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
|
||||
static yes test( \
|
||||
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
|
||||
); \
|
||||
\
|
||||
template <class U> \
|
||||
static no test(U&, ...); \
|
||||
}; \
|
||||
\
|
||||
BOOST_STATIC_CONSTANT( \
|
||||
bool, value \
|
||||
= !is_reference<X_>::value \
|
||||
& (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
|
||||
\
|
||||
typedef mpl::bool_<value> type; \
|
||||
};
|
||||
|
||||
# else
|
||||
|
||||
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
||||
template <class T> \
|
||||
@ -56,6 +23,5 @@ struct is_##name< \
|
||||
{ \
|
||||
};
|
||||
|
||||
# endif
|
||||
|
||||
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
||||
|
@ -1,494 +0,0 @@
|
||||
// (C) Copyright David Abrahams 2002.
|
||||
// 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)
|
||||
|
||||
// Boost versions of
|
||||
//
|
||||
// std::iterator_traits<>::iterator_category
|
||||
// std::iterator_traits<>::difference_type
|
||||
// std::distance()
|
||||
//
|
||||
// ...for all compilers and iterators
|
||||
//
|
||||
// Additionally, if X is a pointer
|
||||
// std::iterator_traits<X>::pointer
|
||||
|
||||
// Otherwise, if partial specialization is supported or X is not a pointer
|
||||
// std::iterator_traits<X>::value_type
|
||||
// std::iterator_traits<X>::pointer
|
||||
// std::iterator_traits<X>::reference
|
||||
//
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
// Revision History
|
||||
// 04 Mar 2001 - More attempted fixes for Intel C++ (David Abrahams)
|
||||
// 03 Mar 2001 - Put all implementation into namespace
|
||||
// boost::detail::iterator_traits_. Some progress made on fixes
|
||||
// for Intel compiler. (David Abrahams)
|
||||
// 02 Mar 2001 - Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few
|
||||
// places. (Jeremy Siek)
|
||||
// 19 Feb 2001 - Improved workarounds for stock MSVC6; use yes_type and
|
||||
// no_type from type_traits.hpp; stopped trying to remove_cv
|
||||
// before detecting is_pointer, in honor of the new type_traits
|
||||
// semantics. (David Abrahams)
|
||||
// 13 Feb 2001 - Make it work with nearly all standard-conforming iterators
|
||||
// under raw VC6. The one category remaining which will fail is
|
||||
// that of iterators derived from std::iterator but not
|
||||
// boost::iterator and which redefine difference_type.
|
||||
// 11 Feb 2001 - Clean away code which can never be used (David Abrahams)
|
||||
// 09 Feb 2001 - Always have a definition for each traits member, even if it
|
||||
// can't be properly deduced. These will be incomplete types in
|
||||
// some cases (undefined<void>), but it helps suppress MSVC errors
|
||||
// elsewhere (David Abrahams)
|
||||
// 07 Feb 2001 - Support for more of the traits members where possible, making
|
||||
// this useful as a replacement for std::iterator_traits<T> when
|
||||
// used as a default template parameter.
|
||||
// 06 Feb 2001 - Removed useless #includes of standard library headers
|
||||
// (David Abrahams)
|
||||
|
||||
#ifndef ITERATOR_DWA122600_HPP_
|
||||
# define ITERATOR_DWA122600_HPP_
|
||||
|
||||
# include <boost/config.hpp>
|
||||
# include <iterator>
|
||||
|
||||
// STLPort 4.0 and betas have a bug when debugging is enabled and there is no
|
||||
// partial specialization: instead of an iterator_category typedef, the standard
|
||||
// container iterators have _Iterator_category.
|
||||
//
|
||||
// Also, whether debugging is enabled or not, there is a broken specialization
|
||||
// of std::iterator<output_iterator_tag,void,void,void,void> which has no
|
||||
// typedefs but iterator_category.
|
||||
# if defined(__SGI_STL_PORT)
|
||||
|
||||
# if (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && defined(__STL_DEBUG)
|
||||
# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||
# endif
|
||||
|
||||
# define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||
|
||||
# endif // STLPort <= 4.1b4 && no partial specialization
|
||||
|
||||
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \
|
||||
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !defined(BOOST_MSVC_STD_ITERATOR)
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
// Define a new template so it can be specialized
|
||||
template <class Iterator>
|
||||
struct iterator_traits
|
||||
: std::iterator_traits<Iterator>
|
||||
{};
|
||||
using std::distance;
|
||||
|
||||
}} // namespace boost::detail
|
||||
|
||||
# else
|
||||
|
||||
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !defined(BOOST_MSVC_STD_ITERATOR)
|
||||
|
||||
// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
// Rogue Wave Standard Library fools itself into thinking partial
|
||||
// specialization is missing on some platforms (e.g. Sun), so fails to
|
||||
// supply iterator_traits!
|
||||
template <class Iterator>
|
||||
struct iterator_traits
|
||||
{
|
||||
typedef typename Iterator::value_type value_type;
|
||||
typedef typename Iterator::reference reference;
|
||||
typedef typename Iterator::pointer pointer;
|
||||
typedef typename Iterator::difference_type difference_type;
|
||||
typedef typename Iterator::iterator_category iterator_category;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct iterator_traits<T*>
|
||||
{
|
||||
typedef T value_type;
|
||||
typedef T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct iterator_traits<T const*>
|
||||
{
|
||||
typedef T value_type;
|
||||
typedef T const& reference;
|
||||
typedef T const* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
}} // namespace boost::detail
|
||||
|
||||
# else
|
||||
|
||||
# include <boost/type_traits/remove_const.hpp>
|
||||
# include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
# include <boost/type_traits/is_pointer.hpp>
|
||||
|
||||
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# include <boost/type_traits/remove_pointer.hpp>
|
||||
# endif
|
||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||
# include <boost/type_traits/is_base_and_derived.hpp>
|
||||
# endif
|
||||
|
||||
# include <boost/mpl/if.hpp>
|
||||
# include <boost/mpl/has_xxx.hpp>
|
||||
# include <cstddef>
|
||||
|
||||
// should be the last #include
|
||||
# include "boost/type_traits/detail/bool_trait_def.hpp"
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
|
||||
|
||||
// is_mutable_iterator --
|
||||
//
|
||||
// A metafunction returning true iff T is a mutable iterator type
|
||||
// with a nested value_type. Will only work portably with iterators
|
||||
// whose operator* returns a reference, but that seems to be OK for
|
||||
// the iterators supplied by Dinkumware. Some input iterators may
|
||||
// compile-time if they arrive here, and if the compiler is strict
|
||||
// about not taking the address of an rvalue.
|
||||
|
||||
// This one detects ordinary mutable iterators - the result of
|
||||
// operator* is convertible to the value_type.
|
||||
template <class T>
|
||||
type_traits::yes_type is_mutable_iterator_helper(T const*, BOOST_DEDUCED_TYPENAME T::value_type*);
|
||||
|
||||
// Since you can't take the address of an rvalue, the guts of
|
||||
// is_mutable_iterator_impl will fail if we use &*t directly. This
|
||||
// makes sure we can still work with non-lvalue iterators.
|
||||
template <class T> T* mutable_iterator_lvalue_helper(T& x);
|
||||
int mutable_iterator_lvalue_helper(...);
|
||||
|
||||
|
||||
// This one detects output iterators such as ostream_iterator which
|
||||
// return references to themselves.
|
||||
template <class T>
|
||||
type_traits::yes_type is_mutable_iterator_helper(T const*, T const*);
|
||||
|
||||
type_traits::no_type is_mutable_iterator_helper(...);
|
||||
|
||||
template <class T>
|
||||
struct is_mutable_iterator_impl
|
||||
{
|
||||
static T t;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = sizeof(
|
||||
detail::is_mutable_iterator_helper(
|
||||
(T*)0
|
||||
, mutable_iterator_lvalue_helper(*t) // like &*t
|
||||
))
|
||||
== sizeof(type_traits::yes_type)
|
||||
);
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
|
||||
is_mutable_iterator,T,::boost::detail::is_mutable_iterator_impl<T>::value)
|
||||
|
||||
|
||||
// is_full_iterator_traits --
|
||||
//
|
||||
// A metafunction returning true iff T has all the requisite nested
|
||||
// types to satisfy the requirements for a fully-conforming
|
||||
// iterator_traits implementation.
|
||||
template <class T>
|
||||
struct is_full_iterator_traits_impl
|
||||
{
|
||||
enum { value =
|
||||
has_value_type<T>::value
|
||||
& has_reference<T>::value
|
||||
& has_pointer<T>::value
|
||||
& has_difference_type<T>::value
|
||||
& has_iterator_category<T>::value
|
||||
};
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
|
||||
is_full_iterator_traits,T,::boost::detail::is_full_iterator_traits_impl<T>::value)
|
||||
|
||||
|
||||
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(_Iterator_category)
|
||||
|
||||
// is_stlport_40_debug_iterator --
|
||||
//
|
||||
// A metafunction returning true iff T has all the requisite nested
|
||||
// types to satisfy the requirements of an STLPort 4.0 debug iterator
|
||||
// iterator_traits implementation.
|
||||
template <class T>
|
||||
struct is_stlport_40_debug_iterator_impl
|
||||
{
|
||||
enum { value =
|
||||
has_value_type<T>::value
|
||||
& has_reference<T>::value
|
||||
& has_pointer<T>::value
|
||||
& has_difference_type<T>::value
|
||||
& has__Iterator_category<T>::value
|
||||
};
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
|
||||
is_stlport_40_debug_iterator,T,::boost::detail::is_stlport_40_debug_iterator_impl<T>::value)
|
||||
|
||||
template <class T>
|
||||
struct stlport_40_debug_iterator_traits
|
||||
{
|
||||
typedef typename T::value_type value_type;
|
||||
typedef typename T::reference reference;
|
||||
typedef typename T::pointer pointer;
|
||||
typedef typename T::difference_type difference_type;
|
||||
typedef typename T::_Iterator_category iterator_category;
|
||||
};
|
||||
# endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||
|
||||
template <class T> struct pointer_iterator_traits;
|
||||
|
||||
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template <class T>
|
||||
struct pointer_iterator_traits<T*>
|
||||
{
|
||||
typedef typename remove_const<T>::type value_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
};
|
||||
# else
|
||||
|
||||
// In case of no template partial specialization, and if T is a
|
||||
// pointer, iterator_traits<T>::value_type can still be computed. For
|
||||
// some basic types, remove_pointer is manually defined in
|
||||
// type_traits/broken_compiler_spec.hpp. For others, do it yourself.
|
||||
|
||||
template<class P> class please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee;
|
||||
|
||||
template<class P>
|
||||
struct pointer_value_type
|
||||
: mpl::if_<
|
||||
is_same<P, typename remove_pointer<P>::type>
|
||||
, please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
|
||||
, typename remove_const<
|
||||
typename remove_pointer<P>::type
|
||||
>::type
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
template<class P>
|
||||
struct pointer_reference
|
||||
: mpl::if_<
|
||||
is_same<P, typename remove_pointer<P>::type>
|
||||
, please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
|
||||
, typename remove_pointer<P>::type&
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct pointer_iterator_traits
|
||||
{
|
||||
typedef T pointer;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
typedef typename pointer_value_type<T>::type value_type;
|
||||
typedef typename pointer_reference<T>::type reference;
|
||||
};
|
||||
|
||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
// We'll sort iterator types into one of these classifications, from which we
|
||||
// can determine the difference_type, pointer, reference, and value_type
|
||||
template <class Iterator>
|
||||
struct standard_iterator_traits
|
||||
{
|
||||
typedef typename Iterator::difference_type difference_type;
|
||||
typedef typename Iterator::value_type value_type;
|
||||
typedef typename Iterator::pointer pointer;
|
||||
typedef typename Iterator::reference reference;
|
||||
typedef typename Iterator::iterator_category iterator_category;
|
||||
};
|
||||
|
||||
template <class Iterator>
|
||||
struct msvc_stdlib_mutable_traits
|
||||
: std::iterator_traits<Iterator>
|
||||
{
|
||||
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
|
||||
typedef typename std::iterator_traits<Iterator>::value_type* pointer;
|
||||
typedef typename std::iterator_traits<Iterator>::value_type& reference;
|
||||
};
|
||||
|
||||
template <class Iterator>
|
||||
struct msvc_stdlib_const_traits
|
||||
: std::iterator_traits<Iterator>
|
||||
{
|
||||
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
|
||||
typedef const typename std::iterator_traits<Iterator>::value_type* pointer;
|
||||
typedef const typename std::iterator_traits<Iterator>::value_type& reference;
|
||||
};
|
||||
|
||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||
template <class Iterator>
|
||||
struct is_bad_output_iterator
|
||||
: is_base_and_derived<
|
||||
std::iterator<std::output_iterator_tag,void,void,void,void>
|
||||
, Iterator>
|
||||
{
|
||||
};
|
||||
|
||||
struct bad_output_iterator_traits
|
||||
{
|
||||
typedef void value_type;
|
||||
typedef void difference_type;
|
||||
typedef std::output_iterator_tag iterator_category;
|
||||
typedef void pointer;
|
||||
typedef void reference;
|
||||
};
|
||||
# endif
|
||||
|
||||
// If we're looking at an MSVC6 (old Dinkumware) ``standard''
|
||||
// iterator, this will generate an appropriate traits class.
|
||||
template <class Iterator>
|
||||
struct msvc_stdlib_iterator_traits
|
||||
: mpl::if_<
|
||||
is_mutable_iterator<Iterator>
|
||||
, msvc_stdlib_mutable_traits<Iterator>
|
||||
, msvc_stdlib_const_traits<Iterator>
|
||||
>::type
|
||||
{};
|
||||
|
||||
template <class Iterator>
|
||||
struct non_pointer_iterator_traits
|
||||
: mpl::if_<
|
||||
// if the iterator contains all the right nested types...
|
||||
is_full_iterator_traits<Iterator>
|
||||
// Use a standard iterator_traits implementation
|
||||
, standard_iterator_traits<Iterator>
|
||||
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||
// Check for STLPort 4.0 broken _Iterator_category type
|
||||
, mpl::if_<
|
||||
is_stlport_40_debug_iterator<Iterator>
|
||||
, stlport_40_debug_iterator_traits<Iterator>
|
||||
# endif
|
||||
// Otherwise, assume it's a Dinkum iterator
|
||||
, msvc_stdlib_iterator_traits<Iterator>
|
||||
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||
>::type
|
||||
# endif
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
template <class Iterator>
|
||||
struct iterator_traits_aux
|
||||
: mpl::if_<
|
||||
is_pointer<Iterator>
|
||||
, pointer_iterator_traits<Iterator>
|
||||
, non_pointer_iterator_traits<Iterator>
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
template <class Iterator>
|
||||
struct iterator_traits
|
||||
{
|
||||
// Explicit forwarding from base class needed to keep MSVC6 happy
|
||||
// under some circumstances.
|
||||
private:
|
||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||
typedef
|
||||
typename mpl::if_<
|
||||
is_bad_output_iterator<Iterator>
|
||||
, bad_output_iterator_traits
|
||||
, iterator_traits_aux<Iterator>
|
||||
>::type base;
|
||||
# else
|
||||
typedef iterator_traits_aux<Iterator> base;
|
||||
# endif
|
||||
public:
|
||||
typedef typename base::value_type value_type;
|
||||
typedef typename base::pointer pointer;
|
||||
typedef typename base::reference reference;
|
||||
typedef typename base::difference_type difference_type;
|
||||
typedef typename base::iterator_category iterator_category;
|
||||
};
|
||||
|
||||
// This specialization cuts off ETI (Early Template Instantiation) for MSVC.
|
||||
template <> struct iterator_traits<int>
|
||||
{
|
||||
typedef int value_type;
|
||||
typedef int pointer;
|
||||
typedef int reference;
|
||||
typedef int difference_type;
|
||||
typedef int iterator_category;
|
||||
};
|
||||
|
||||
}} // namespace boost::detail
|
||||
|
||||
# endif // workarounds
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
namespace iterator_traits_
|
||||
{
|
||||
template <class Iterator, class Difference>
|
||||
struct distance_select
|
||||
{
|
||||
static Difference execute(Iterator i1, const Iterator i2, ...)
|
||||
{
|
||||
Difference result = 0;
|
||||
while (i1 != i2)
|
||||
{
|
||||
++i1;
|
||||
++result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static Difference execute(Iterator i1, const Iterator i2, std::random_access_iterator_tag*)
|
||||
{
|
||||
return i2 - i1;
|
||||
}
|
||||
};
|
||||
} // namespace boost::detail::iterator_traits_
|
||||
|
||||
template <class Iterator>
|
||||
inline typename iterator_traits<Iterator>::difference_type
|
||||
distance(Iterator first, Iterator last)
|
||||
{
|
||||
typedef typename iterator_traits<Iterator>::difference_type diff_t;
|
||||
typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category;
|
||||
|
||||
return iterator_traits_::distance_select<Iterator,diff_t>::execute(
|
||||
first, last, (iterator_category*)0);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||
# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||
|
||||
#endif // ITERATOR_DWA122600_HPP_
|
@ -1,143 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/lightweight_test.hpp - lightweight test library
|
||||
//
|
||||
// Copyright (c) 2002, 2009 Peter Dimov
|
||||
// Copyright (2) Beman Dawes 2010, 2011
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// BOOST_TEST(expression)
|
||||
// BOOST_ERROR(message)
|
||||
// BOOST_TEST_EQ(expr1, expr2)
|
||||
//
|
||||
// int boost::report_errors()
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
// IDE's like Visual Studio perform better if output goes to std::cout or
|
||||
// some other stream, so allow user to configure output stream:
|
||||
#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
struct report_errors_reminder
|
||||
{
|
||||
bool called_report_errors_function;
|
||||
report_errors_reminder() : called_report_errors_function(false) {}
|
||||
~report_errors_reminder()
|
||||
{
|
||||
BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called
|
||||
}
|
||||
};
|
||||
|
||||
inline report_errors_reminder& report_errors_remind()
|
||||
{
|
||||
static report_errors_reminder r;
|
||||
return r;
|
||||
}
|
||||
|
||||
inline int & test_errors()
|
||||
{
|
||||
static int x = 0;
|
||||
report_errors_remind();
|
||||
return x;
|
||||
}
|
||||
|
||||
inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr << "' failed in function '"
|
||||
<< function << "'" << std::endl;
|
||||
++test_errors();
|
||||
}
|
||||
|
||||
inline void error_impl(char const * msg, char const * file, int line, char const * function)
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): " << msg << " in function '"
|
||||
<< function << "'" << std::endl;
|
||||
++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
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " == " << expr2
|
||||
<< "' failed in function '" << function << "': "
|
||||
<< "'" << t << "' != '" << u << "'" << std::endl;
|
||||
++test_errors();
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, class U> inline void test_ne_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
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " != " << expr2
|
||||
<< "' failed in function '" << function << "': "
|
||||
<< "'" << t << "' == '" << u << "'" << std::endl;
|
||||
++test_errors();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
inline int report_errors()
|
||||
{
|
||||
detail::report_errors_remind().called_report_errors_function = true;
|
||||
|
||||
int errors = detail::test_errors();
|
||||
|
||||
if( errors == 0 )
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< "No errors detected." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#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_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
@ -1,135 +0,0 @@
|
||||
#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
|
@ -1,87 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
||||
#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
||||
|
||||
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// (C) Copyright 2004 Pavel Vozenilek.
|
||||
// Use, modification and distribution is 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)
|
||||
//
|
||||
//
|
||||
// This file contains helper macros used when exception support may be
|
||||
// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
|
||||
//
|
||||
// Before picking up these macros you may consider using RAII techniques
|
||||
// to deal with exceptions - their syntax can be always the same with
|
||||
// or without exception support enabled.
|
||||
//
|
||||
|
||||
/* Example of use:
|
||||
|
||||
void foo() {
|
||||
BOOST_TRY {
|
||||
...
|
||||
} BOOST_CATCH(const std::bad_alloc&) {
|
||||
...
|
||||
BOOST_RETHROW
|
||||
} BOOST_CATCH(const std::exception& e) {
|
||||
...
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
}
|
||||
|
||||
With exception support enabled it will expand into:
|
||||
|
||||
void foo() {
|
||||
{ try {
|
||||
...
|
||||
} catch (const std::bad_alloc&) {
|
||||
...
|
||||
throw;
|
||||
} catch (const std::exception& e) {
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
With exception support disabled it will expand into:
|
||||
|
||||
void foo() {
|
||||
{ if(true) {
|
||||
...
|
||||
} else if (false) {
|
||||
...
|
||||
} else if (false) {
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if !(defined BOOST_NO_EXCEPTIONS)
|
||||
# define BOOST_TRY { try
|
||||
# define BOOST_CATCH(x) catch(x)
|
||||
# define BOOST_RETHROW throw;
|
||||
# define BOOST_CATCH_END }
|
||||
#else
|
||||
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
# define BOOST_TRY { if ("")
|
||||
# define BOOST_CATCH(x) else if (!"")
|
||||
# else
|
||||
# define BOOST_TRY { if (true)
|
||||
# define BOOST_CATCH(x) else if (false)
|
||||
# endif
|
||||
# define BOOST_RETHROW
|
||||
# define BOOST_CATCH_END }
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -74,7 +74,7 @@ namespace boost { namespace detail {
|
||||
template <class Number>
|
||||
struct is_signed
|
||||
{
|
||||
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
|
||||
BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
|
||||
@ -128,15 +128,6 @@ namespace boost { namespace detail {
|
||||
private:
|
||||
typedef Integer integer_type;
|
||||
typedef std::numeric_limits<integer_type> x;
|
||||
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||
// for some reason, MSVC asserts when it shouldn't unless we make these
|
||||
// local definitions
|
||||
BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer);
|
||||
BOOST_STATIC_CONSTANT(bool, is_specialized = x::is_specialized);
|
||||
|
||||
BOOST_STATIC_ASSERT(is_integer);
|
||||
BOOST_STATIC_ASSERT(is_specialized);
|
||||
# endif
|
||||
public:
|
||||
typedef typename
|
||||
if_true<(int(x::is_signed)
|
||||
|
@ -1,23 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/quick_allocator.hpp
|
||||
//
|
||||
// Copyright (c) 2003 David Abrahams
|
||||
// Copyright (c) 2003 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/smart_ptr/detail/quick_allocator.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
@ -15,13 +15,8 @@
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
# include "boost/mpl/bool.hpp"
|
||||
# include "boost/type_traits/has_nothrow_copy.hpp"
|
||||
#else
|
||||
# include "boost/mpl/if.hpp"
|
||||
# include "boost/type_traits/is_reference.hpp"
|
||||
#endif
|
||||
|
||||
#include "boost/mpl/void.hpp"
|
||||
|
||||
@ -78,7 +73,6 @@ public: // queries
|
||||
|
||||
template <typename T = mpl::void_> struct make_reference_content;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
template <typename T>
|
||||
struct make_reference_content
|
||||
@ -92,19 +86,6 @@ struct make_reference_content< T& >
|
||||
typedef reference_content<T&> type;
|
||||
};
|
||||
|
||||
#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
template <typename T>
|
||||
struct make_reference_content
|
||||
: mpl::if_<
|
||||
is_reference<T>
|
||||
, reference_content<T>
|
||||
, T
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
|
||||
|
||||
template <>
|
||||
struct make_reference_content< mpl::void_ >
|
||||
@ -124,7 +105,6 @@ struct make_reference_content< mpl::void_ >
|
||||
// reference_content<T&> type traits specializations
|
||||
//
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
template <typename T>
|
||||
struct has_nothrow_copy<
|
||||
@ -134,7 +114,6 @@ struct has_nothrow_copy<
|
||||
{
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
// 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
|
@ -92,8 +92,7 @@ namespace std {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) \
|
||||
&& !defined(_LIBCPP_VERSION)
|
||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
||||
#else
|
||||
#define BOOST_CODECVT_DO_LENGTH_CONST
|
||||
@ -123,9 +122,13 @@ protected:
|
||||
) const;
|
||||
|
||||
virtual std::codecvt_base::result do_out(
|
||||
std::mbstate_t & state, const wchar_t * from,
|
||||
const wchar_t * from_end, const wchar_t* & from_next,
|
||||
char * to, char * to_end, char * & to_next
|
||||
std::mbstate_t & state,
|
||||
const wchar_t * from,
|
||||
const wchar_t * from_end,
|
||||
const wchar_t* & from_next,
|
||||
char * to,
|
||||
char * to_end,
|
||||
char * & to_next
|
||||
) const;
|
||||
|
||||
bool invalid_continuing_octet(unsigned char octet_1) const {
|
||||
@ -138,17 +141,19 @@ protected:
|
||||
}
|
||||
|
||||
// continuing octets = octets except for the leading octet
|
||||
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
|
||||
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
|
||||
return get_octet_count(lead_octet) - 1;
|
||||
}
|
||||
|
||||
static unsigned int get_octet_count(unsigned char lead_octet);
|
||||
static unsigned int get_octet_count(unsigned char lead_octet);
|
||||
|
||||
// How many "continuing octets" will be needed for this word
|
||||
// == total octets - 1.
|
||||
int get_cont_octet_out_count(wchar_t word) const ;
|
||||
|
||||
virtual bool do_always_noconv() const throw() { return false; }
|
||||
virtual bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||
return false;
|
||||
}
|
||||
|
||||
// UTF-8 isn't really stateful since we rewind on partial conversions
|
||||
virtual std::codecvt_base::result do_unshift(
|
||||
@ -156,13 +161,12 @@ protected:
|
||||
char * from,
|
||||
char * /*to*/,
|
||||
char * & next
|
||||
) const
|
||||
{
|
||||
) const {
|
||||
next = from;
|
||||
return ok;
|
||||
}
|
||||
|
||||
virtual int do_encoding() const throw() {
|
||||
virtual int do_encoding() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||
const int variable_byte_external_encoding=0;
|
||||
return variable_byte_external_encoding;
|
||||
}
|
||||
@ -174,14 +178,10 @@ protected:
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
std::size_t max_limit
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||
) const throw();
|
||||
#else
|
||||
) const;
|
||||
#endif
|
||||
) const;
|
||||
|
||||
// Largest possible value do_length(state,from,from_end,1) could return.
|
||||
virtual int do_max_length() const throw () {
|
||||
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||
return 6; // largest UTF-8 encoding of a UCS-4 character
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// utf8_codecvt_facet.cpp
|
||||
// utf8_codecvt_facet.ipp
|
||||
|
||||
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
||||
@ -171,14 +171,13 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||
// How many char objects can I process to get <= max_limit
|
||||
// wchar_t objects?
|
||||
int utf8_codecvt_facet::do_length(
|
||||
BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
|
||||
const std::mbstate_t &,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
std::size_t max_limit
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||
) const throw()
|
||||
#else
|
||||
) const
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||
throw()
|
||||
#endif
|
||||
{
|
||||
// RG - this code is confusing! I need a better way to express it.
|
@ -1,25 +0,0 @@
|
||||
// GetCurrentProcess.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP
|
||||
#define BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentProcess;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentProcess();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
@ -1,34 +0,0 @@
|
||||
// GetCurrentThread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP
|
||||
#define BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( UNDER_CE )
|
||||
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
||||
inline HANDLE_ GetCurrentThread()
|
||||
{
|
||||
return ::GetCurrentThread();
|
||||
}
|
||||
#else
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentThread;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
@ -1,27 +0,0 @@
|
||||
// GetLastError.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_GETLASTERROR_HPP
|
||||
#define BOOST_DETAIL_WIN_GETLASTERROR_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetLastError;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) DWORD_ WINAPI
|
||||
GetLastError();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
@ -1,35 +0,0 @@
|
||||
// GetProcessTimes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
||||
#define BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
||||
|
||||
#include <boost/detail/win/time.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetProcessTimes;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) BOOL_ WINAPI
|
||||
GetProcessTimes(
|
||||
HANDLE_ hProcess,
|
||||
LPFILETIME_ lpCreationTime,
|
||||
LPFILETIME_ lpExitTime,
|
||||
LPFILETIME_ lpKernelTime,
|
||||
LPFILETIME_ lpUserTime
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
@ -1,33 +0,0 @@
|
||||
// GetThreadTimes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
||||
#define BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
||||
|
||||
#include <boost/detail/win/time.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetThreadTimes;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) BOOL_ WINAPI
|
||||
GetThreadTimes(
|
||||
HANDLE_ hThread,
|
||||
LPFILETIME_ lpCreationTime,
|
||||
LPFILETIME_ lpExitTime,
|
||||
LPFILETIME_ lpKernelTime,
|
||||
LPFILETIME_ lpUserTime
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
@ -1,29 +0,0 @@
|
||||
// LocalFree.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_LOCALFREE_HPP
|
||||
#define BOOST_DETAIL_WIN_LOCALFREE_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef HANDLE_ HLOCAL_;
|
||||
|
||||
using ::LocalFree;
|
||||
#else
|
||||
extern "C" typedef HANDLE_ HLOCAL_;
|
||||
extern "C" __declspec(dllimport) HLOCAL_ WINAPI
|
||||
LocalFree(HLOCAL_ hMem);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WIN_LOCALFREE_HPP
|
@ -1,111 +0,0 @@
|
||||
// basic_types.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_BASIC_TYPES_HPP
|
||||
#define BOOST_DETAIL_WIN_BASIC_TYPES_HPP
|
||||
#include <boost/config.hpp>
|
||||
#include <cstdarg>
|
||||
#include <boost/cstdint.hpp>
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
# include <windows.h>
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
||||
# include <WinError.h>
|
||||
// @FIXME Which condition must be tested
|
||||
# ifdef UNDER_CE
|
||||
# ifndef WINAPI
|
||||
# ifndef _WIN32_WCE_EMULATION
|
||||
# define WINAPI __cdecl // Note this doesn't match the desktop definition
|
||||
# else
|
||||
# define WINAPI __stdcall
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# ifndef WINAPI
|
||||
# define WINAPI __stdcall
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# error "Win32 functions not available"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::BOOL BOOL_;
|
||||
typedef ::WORD WORD_;
|
||||
typedef ::DWORD DWORD_;
|
||||
typedef ::HANDLE HANDLE_;
|
||||
typedef ::LONG LONG_;
|
||||
typedef ::LONGLONG LONGLONG_;
|
||||
typedef ::ULONG_PTR ULONG_PTR_;
|
||||
typedef ::LARGE_INTEGER LARGE_INTEGER_;
|
||||
typedef ::PLARGE_INTEGER PLARGE_INTEGER_;
|
||||
typedef ::PVOID PVOID_;
|
||||
typedef ::LPVOID LPVOID_;
|
||||
typedef ::CHAR CHAR_;
|
||||
typedef ::LPSTR LPSTR_;
|
||||
typedef ::LPCSTR LPCSTR_;
|
||||
typedef ::WCHAR WCHAR_;
|
||||
typedef ::LPWSTR LPWSTR_;
|
||||
typedef ::LPCWSTR LPCWSTR_;
|
||||
#else
|
||||
extern "C" {
|
||||
typedef int BOOL_;
|
||||
typedef unsigned short WORD_;
|
||||
typedef unsigned long DWORD_;
|
||||
typedef void* HANDLE_;
|
||||
|
||||
typedef long LONG_;
|
||||
|
||||
// @FIXME Which condition must be tested
|
||||
//~ #if !defined(_M_IX86)
|
||||
//~ #if defined(BOOST_NO_INT64_T)
|
||||
//~ typedef double LONGLONG_;
|
||||
//~ #else
|
||||
//~ typedef __int64 LONGLONG_;
|
||||
//~ #endif
|
||||
//~ #else
|
||||
//~ typedef double LONGLONG_;
|
||||
//~ #endif
|
||||
typedef boost::int64_t LONGLONG_;
|
||||
|
||||
// @FIXME Which condition must be tested
|
||||
# ifdef _WIN64
|
||||
#if defined(__CYGWIN__)
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
#else
|
||||
typedef unsigned __int64 ULONG_PTR_;
|
||||
#endif
|
||||
# else
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
# endif
|
||||
|
||||
typedef struct _LARGE_INTEGER {
|
||||
LONGLONG_ QuadPart;
|
||||
} LARGE_INTEGER_;
|
||||
typedef LARGE_INTEGER_ *PLARGE_INTEGER_;
|
||||
|
||||
typedef void *PVOID_;
|
||||
typedef void *LPVOID_;
|
||||
typedef const void *LPCVOID_;
|
||||
|
||||
typedef char CHAR_;
|
||||
typedef CHAR_ *LPSTR_;
|
||||
typedef const CHAR_ *LPCSTR_;
|
||||
|
||||
typedef wchar_t WCHAR_;
|
||||
typedef WCHAR_ *LPWSTR_;
|
||||
typedef const WCHAR_ *LPCWSTR_;
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
@ -1,43 +0,0 @@
|
||||
// directory_management.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP
|
||||
#define BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/security.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CreateDirectory;
|
||||
using ::CreateDirectoryA;
|
||||
using ::GetTempPathA;
|
||||
using ::RemoveDirectoryA;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) int __stdcall
|
||||
CreateDirectory(LPCTSTR_, LPSECURITY_ATTRIBUTES_*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
CreateDirectoryA(LPCTSTR_, interprocess_security_attributes*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
GetTempPathA(unsigned long length, char *buffer);
|
||||
__declspec(dllimport) int __stdcall
|
||||
RemoveDirectoryA(LPCTSTR_);
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
@ -1,52 +0,0 @@
|
||||
// dll.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_DLL_HPP
|
||||
#define BOOST_DETAIL_WIN_DLL_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/security.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::LoadLibrary;
|
||||
using ::FreeLibrary;
|
||||
using ::GetProcAddress;
|
||||
using ::GetModuleHandleA;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) HMODULE_ __stdcall
|
||||
LoadLibrary(
|
||||
LPCTSTR_ lpFileName
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
FreeLibrary(
|
||||
HMODULE_ hModule
|
||||
);
|
||||
__declspec(dllimport) FARPROC_ __stdcall
|
||||
GetProcAddress(
|
||||
HMODULE_ hModule,
|
||||
LPCSTR_ lpProcName
|
||||
);
|
||||
__declspec(dllimport) FARPROC_ __stdcall
|
||||
GetModuleHandleA(
|
||||
LPCSTR_ lpProcName
|
||||
);
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
@ -1,88 +0,0 @@
|
||||
// error_handling.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
||||
#define BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/GetCurrentThread.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::FormatMessageA;
|
||||
using ::FormatMessageW;
|
||||
|
||||
const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER;
|
||||
const int FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS;
|
||||
const int FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING;
|
||||
const int FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE;
|
||||
const int FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM;
|
||||
const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY;
|
||||
const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK;
|
||||
|
||||
const char LANG_NEUTRAL_= LANG_NEUTRAL;
|
||||
const char LANG_INVARIANT_= LANG_INVARIANT;
|
||||
|
||||
const char SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default
|
||||
inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) {
|
||||
return MAKELANGID(p,s);
|
||||
}
|
||||
#else
|
||||
extern "C" {
|
||||
// using ::FormatMessageA;
|
||||
__declspec(dllimport)
|
||||
DWORD_
|
||||
WINAPI
|
||||
FormatMessageA(
|
||||
DWORD_ dwFlags,
|
||||
LPCVOID_ lpSource,
|
||||
DWORD_ dwMessageId,
|
||||
DWORD_ dwLanguageId,
|
||||
LPSTR_ lpBuffer,
|
||||
DWORD_ nSize,
|
||||
va_list *Arguments
|
||||
);
|
||||
|
||||
// using ::FormatMessageW;
|
||||
__declspec(dllimport)
|
||||
DWORD_
|
||||
WINAPI
|
||||
FormatMessageW(
|
||||
DWORD_ dwFlags,
|
||||
LPCVOID_ lpSource,
|
||||
DWORD_ dwMessageId,
|
||||
DWORD_ dwLanguageId,
|
||||
LPWSTR_ lpBuffer,
|
||||
DWORD_ nSize,
|
||||
va_list *Arguments
|
||||
);
|
||||
|
||||
const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100;
|
||||
const int FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200;
|
||||
const int FORMAT_MESSAGE_FROM_STRING_= 0x00000400;
|
||||
const int FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800;
|
||||
const int FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000;
|
||||
const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000;
|
||||
const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF;
|
||||
|
||||
const char LANG_NEUTRAL_= 0x00;
|
||||
const char LANG_INVARIANT_= 0x7f;
|
||||
|
||||
const char SUBLANG_DEFAULT_= 0x01; // user default
|
||||
inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) {
|
||||
return ((((WORD_ )(s)) << 10) | (WORD_ )(p));
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
@ -1,126 +0,0 @@
|
||||
// thread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP
|
||||
#define BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/security.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CreateFileA;
|
||||
using ::DeleteFileA;
|
||||
using ::FindFirstFileA;
|
||||
using ::FindNextFileA;
|
||||
using ::FindClose;
|
||||
using ::GetFileSizeEx;
|
||||
using ::MoveFileExA;
|
||||
using ::SetFileValidData;
|
||||
#else
|
||||
extern "C" {
|
||||
typedef struct _OVERLAPPED {
|
||||
ULONG_PTR Internal;
|
||||
ULONG_PTR InternalHigh;
|
||||
union {
|
||||
struct {
|
||||
DWORD Offset;
|
||||
DWORD OffsetHigh;
|
||||
} ;
|
||||
PVOID Pointer;
|
||||
} ;
|
||||
HANDLE hEvent;
|
||||
} OVERLAPPED, *LPOVERLAPPED;
|
||||
|
||||
|
||||
__declspec(dllimport) void * __stdcall
|
||||
CreateFileA (const char *, unsigned long, unsigned long, struct SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, void *);
|
||||
__declspec(dllimport) int __stdcall
|
||||
DeleteFileA (const char *);
|
||||
__declspec(dllimport) void *__stdcall
|
||||
FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData);
|
||||
__declspec(dllimport) int __stdcall
|
||||
FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData);
|
||||
__declspec(dllimport) int __stdcall
|
||||
FindClose(void *hFindFile);
|
||||
__declspec(dllimport) BOOL __stdcall
|
||||
GetFileSizeEx(
|
||||
HANDLE_ hFile,
|
||||
PLARGE_INTEGER_ lpFileSize
|
||||
);
|
||||
__declspec(dllimport) int __stdcall
|
||||
MoveFileExA (const char *, const char *, unsigned long);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetFileValidData(
|
||||
HANDLE_ hFile,
|
||||
LONGLONG_ ValidDataLength
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetEndOfFile(
|
||||
HANDLE_ hFile
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetFilePointerEx(
|
||||
HANDLE_ hFile,
|
||||
LARGE_INTEGER_ liDistanceToMove,
|
||||
PLARGE_INTEGER_ lpNewFilePointer,
|
||||
DWORD_ dwMoveMethod
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
LockFile(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFileOffsetLow,
|
||||
DWORD_ dwFileOffsetHigh,
|
||||
DWORD_ nNumberOfBytesToLockLow,
|
||||
DWORD_ nNumberOfBytesToLockHigh
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
UnlockFile(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFileOffsetLow,
|
||||
DWORD_ dwFileOffsetHigh,
|
||||
DWORD_ nNumberOfBytesToUnlockLow,
|
||||
DWORD_ nNumberOfBytesToUnlockHigh
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
LockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToLockLow,
|
||||
DWORD_ nNumberOfBytesToLockHigh,
|
||||
LPOVERLAPPED_ lpOverlapped
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
UnlockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToUnlockLow,
|
||||
DWORD_ nNumberOfBytesToUnlockHigh,
|
||||
LPOVERLAPPED_ lpOverlapped
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
WriteFile(
|
||||
HANDLE_ hFile,
|
||||
LPCVOID_ lpBuffer,
|
||||
DWORD_ nNumberOfBytesToWrite,
|
||||
LPDWORD_ lpNumberOfBytesWritten,
|
||||
LPOVERLAPPED_ lpOverlapped
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
@ -1,37 +0,0 @@
|
||||
// memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_HANDLES_HPP
|
||||
#define BOOST_DETAIL_WIN_HANDLES_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CloseHandle;
|
||||
using ::DuplicateHandle;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) int __stdcall
|
||||
CloseHandle(void*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_HANDLES_HPP
|
@ -1,59 +0,0 @@
|
||||
// memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_MEMORY_HPP
|
||||
#define BOOST_DETAIL_WIN_MEMORY_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/security.hpp>
|
||||
#include <boost/detail/win/LocalFree.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CreateFileMappingA;
|
||||
using ::FlushViewOfFile;
|
||||
using ::GetProcessHeap;
|
||||
using ::HeapAlloc;
|
||||
using ::HeapFree;
|
||||
using ::MapViewOfFileEx;
|
||||
using ::OpenFileMappingA;
|
||||
using ::UnmapViewOfFile;
|
||||
#else
|
||||
# ifdef HeapAlloc
|
||||
# undef HeapAlloc
|
||||
# endif
|
||||
extern "C" {
|
||||
__declspec(dllimport) void * __stdcall
|
||||
CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *);
|
||||
__declspec(dllimport) int __stdcall
|
||||
FlushViewOfFile (void *, std::size_t);
|
||||
__declspec(dllimport) HANDLE_ __stdcall
|
||||
GetProcessHeap();
|
||||
__declspec(dllimport) void* __stdcall
|
||||
HeapAlloc(HANDLE_,DWORD_,SIZE_T_);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
HeapFree(HANDLE_,DWORD_,LPVOID_);
|
||||
__declspec(dllimport) void * __stdcall
|
||||
MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*);
|
||||
__declspec(dllimport) void * __stdcall
|
||||
OpenFileMappingA (unsigned long, int, const char *);
|
||||
__declspec(dllimport) int __stdcall
|
||||
UnmapViewOfFile(void *);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
@ -1,33 +0,0 @@
|
||||
// process.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_PROCESS_HPP
|
||||
#define BOOST_DETAIL_WIN_PROCESS_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/GetCurrentProcess.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentProcessId;
|
||||
#else
|
||||
# ifndef UNDER_CE
|
||||
extern "C" {
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
GetCurrentProcessId(void);
|
||||
}
|
||||
# else
|
||||
using ::GetCurrentProcessId;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WIN_PROCESS_HPP
|
@ -1,62 +0,0 @@
|
||||
// security.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_SECURITY_HPP
|
||||
#define BOOST_DETAIL_WIN_SECURITY_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_;
|
||||
typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_;
|
||||
typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_;
|
||||
|
||||
#else
|
||||
extern "C" {
|
||||
struct SECURITY_DESCRIPTOR_;
|
||||
typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_;
|
||||
typedef struct _ACL {
|
||||
BYTE_ AclRevision;
|
||||
BYTE_ Sbz1;
|
||||
WORD_ AclSize;
|
||||
WORD_ AceCount;
|
||||
WORD_ Sbz2;
|
||||
} ACL_, *PACL_;
|
||||
|
||||
typedef struct _SECURITY_ATTRIBUTES {
|
||||
DWORD_ nLength;
|
||||
LPVOID_ lpSecurityDescriptor;
|
||||
BOOL_ bInheritHandle;
|
||||
} SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
|
||||
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
InitializeSecurityDescriptor(
|
||||
PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
|
||||
DWORD_ dwRevision
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetSecurityDescriptorDacl(
|
||||
PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
|
||||
BOOL_ bDaclPresent,
|
||||
PACL_ pDacl,
|
||||
BOOL_ bDaclDefaulted
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_SECURITY_HPP
|
@ -1,125 +0,0 @@
|
||||
// synchronizaion.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
||||
#define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
|
||||
typedef ::PAPCFUNC PAPCFUNC_;
|
||||
|
||||
using ::InitializeCriticalSection;
|
||||
using ::EnterCriticalSection;
|
||||
using ::TryEnterCriticalSection;
|
||||
using ::LeaveCriticalSection;
|
||||
using ::DeleteCriticalSection;
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
using ::CreateMutexW;
|
||||
using ::CreateEventW;
|
||||
using ::OpenEventW;
|
||||
using ::CreateSemaphoreW;
|
||||
# else
|
||||
using ::CreateMutexA;
|
||||
using ::CreateEventA;
|
||||
using ::OpenEventA;
|
||||
using ::CreateSemaphoreA;
|
||||
# endif
|
||||
using ::ReleaseMutex;
|
||||
using ::ReleaseSemaphore;
|
||||
using ::SetEvent;
|
||||
using ::ResetEvent;
|
||||
using ::WaitForMultipleObjects;
|
||||
using ::WaitForSingleObject;
|
||||
using ::QueueUserAPC;
|
||||
#else
|
||||
extern "C" {
|
||||
struct CRITICAL_SECTION_
|
||||
{
|
||||
struct critical_section_debug * DebugInfo;
|
||||
long LockCount;
|
||||
long RecursionCount;
|
||||
void * OwningThread;
|
||||
void * LockSemaphore;
|
||||
#if defined(_WIN64)
|
||||
unsigned __int64 SpinCount;
|
||||
#else
|
||||
unsigned long SpinCount;
|
||||
#endif
|
||||
};
|
||||
|
||||
__declspec(dllimport) void __stdcall
|
||||
InitializeCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) void __stdcall
|
||||
EnterCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) bool __stdcall
|
||||
TryEnterCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) void __stdcall
|
||||
LeaveCriticalSection(CRITICAL_SECTION_ *);
|
||||
__declspec(dllimport) void __stdcall
|
||||
DeleteCriticalSection(CRITICAL_SECTION_ *);
|
||||
|
||||
struct _SECURITY_ATTRIBUTES;
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
OpenEventW(unsigned long,int,wchar_t const*);
|
||||
# else
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
|
||||
__declspec(dllimport) void* __stdcall
|
||||
OpenEventA(unsigned long,int,char const*);
|
||||
# endif
|
||||
__declspec(dllimport) int __stdcall
|
||||
ReleaseMutex(void*);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
WaitForSingleObject(void*,unsigned long);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
WaitForMultipleObjects(unsigned long nCount,
|
||||
void* const * lpHandles,
|
||||
int bWaitAll,
|
||||
unsigned long dwMilliseconds);
|
||||
__declspec(dllimport) int __stdcall
|
||||
ReleaseSemaphore(void*,long,long*);
|
||||
typedef void (__stdcall *PAPCFUNC8)(ulong_ptr);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
QueueUserAPC(PAPCFUNC8,void*,ulong_ptr);
|
||||
# ifndef UNDER_CE
|
||||
__declspec(dllimport) int __stdcall
|
||||
SetEvent(void*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
ResetEvent(void*);
|
||||
# else
|
||||
using ::SetEvent;
|
||||
using ::ResetEvent;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
@ -1,50 +0,0 @@
|
||||
// system.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_SYSTEM_HPP
|
||||
#define BOOST_DETAIL_WIN_SYSTEM_HPP
|
||||
#include <boost/config.hpp>
|
||||
#include <cstdarg>
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *);
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::SYSTEM_INFO SYSTEM_INFO_;
|
||||
#else
|
||||
extern "C" {
|
||||
typedef struct _SYSTEM_INFO {
|
||||
union {
|
||||
DWORD_ dwOemId;
|
||||
struct {
|
||||
WORD_ wProcessorArchitecture;
|
||||
WORD_ wReserved;
|
||||
} dummy;
|
||||
} ;
|
||||
DWORD_ dwPageSize;
|
||||
LPVOID_ lpMinimumApplicationAddress;
|
||||
LPVOID_ lpMaximumApplicationAddress;
|
||||
DWORD_PTR_ dwActiveProcessorMask;
|
||||
DWORD_ dwNumberOfProcessors;
|
||||
DWORD_ dwProcessorType;
|
||||
DWORD_ dwAllocationGranularity;
|
||||
WORD_ wProcessorLevel;
|
||||
WORD_ wProcessorRevision;
|
||||
} SYSTEM_INFO_;
|
||||
|
||||
__declspec(dllimport) void __stdcall
|
||||
GetSystemInfo (struct system_info *);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
@ -1,45 +0,0 @@
|
||||
// thread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_THREAD_HPP
|
||||
#define BOOST_DETAIL_WIN_THREAD_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
#include <boost/detail/win/GetCurrentThread.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentThreadId;
|
||||
using ::SleepEx;
|
||||
using ::Sleep;
|
||||
#else
|
||||
extern "C" {
|
||||
# ifndef UNDER_CE
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
GetCurrentThreadId(void);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
SleepEx(unsigned long,int);
|
||||
__declspec(dllimport) void __stdcall
|
||||
Sleep(unsigned long);
|
||||
#else
|
||||
using ::GetCurrentThreadId;
|
||||
using ::SleepEx;
|
||||
using ::Sleep;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
@ -1,72 +0,0 @@
|
||||
// time.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_TIME_HPP
|
||||
#define BOOST_DETAIL_WIN_TIME_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef FILETIME FILETIME_;
|
||||
typedef PFILETIME PFILETIME_;
|
||||
typedef LPFILETIME LPFILETIME_;
|
||||
|
||||
typedef SYSTEMTIME SYSTEMTIME_;
|
||||
typedef SYSTEMTIME* PSYSTEMTIME_;
|
||||
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
using ::GetSystemTimeAsFileTime;
|
||||
#endif
|
||||
using ::FileTimeToLocalFileTime;
|
||||
using ::GetSystemTime;
|
||||
using ::SystemTimeToFileTime;
|
||||
using ::GetTickCount;
|
||||
|
||||
#else
|
||||
extern "C" {
|
||||
typedef struct _FILETIME {
|
||||
DWORD_ dwLowDateTime;
|
||||
DWORD_ dwHighDateTime;
|
||||
} FILETIME_, *PFILETIME_, *LPFILETIME_;
|
||||
|
||||
typedef struct _SYSTEMTIME {
|
||||
WORD_ wYear;
|
||||
WORD_ wMonth;
|
||||
WORD_ wDayOfWeek;
|
||||
WORD_ wDay;
|
||||
WORD_ wHour;
|
||||
WORD_ wMinute;
|
||||
WORD_ wSecond;
|
||||
WORD_ wMilliseconds;
|
||||
} SYSTEMTIME_, *PSYSTEMTIME_;
|
||||
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
__declspec(dllimport) void WINAPI
|
||||
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
||||
#endif
|
||||
__declspec(dllimport) int WINAPI
|
||||
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
||||
FILETIME_* lpLocalFileTime);
|
||||
__declspec(dllimport) void WINAPI
|
||||
GetSystemTime(SYSTEMTIME_* lpSystemTime);
|
||||
__declspec(dllimport) int WINAPI
|
||||
SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime,
|
||||
FILETIME_* lpFileTime);
|
||||
__declspec(dllimport) unsigned long __stdcall
|
||||
GetTickCount();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
@ -1,41 +0,0 @@
|
||||
// timers.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WIN_TIMERS_HPP
|
||||
#define BOOST_DETAIL_WIN_TIMERS_HPP
|
||||
|
||||
#include <boost/detail/win/basic_types.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace win32
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::QueryPerformanceCounter;
|
||||
using ::QueryPerformanceFrequency;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
QueryPerformanceCounter(
|
||||
LARGE_INTEGER_ *lpPerformanceCount
|
||||
);
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
QueryPerformanceFrequency(
|
||||
LARGE_INTEGER_ *lpFrequency
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WIN_TIMERS_HPP
|
@ -1,43 +0,0 @@
|
||||
#ifndef INDIRECT_REFERENCE_DWA200415_HPP
|
||||
# define INDIRECT_REFERENCE_DWA200415_HPP
|
||||
|
||||
//
|
||||
// Copyright David Abrahams 2004. Use, modification and distribution is
|
||||
// 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)
|
||||
//
|
||||
// typename indirect_reference<P>::type provides the type of *p.
|
||||
//
|
||||
// http://www.boost.org/libs/iterator/doc/pointee.html
|
||||
//
|
||||
|
||||
# include <boost/detail/is_incrementable.hpp>
|
||||
# include <boost/iterator/iterator_traits.hpp>
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
# include <boost/mpl/eval_if.hpp>
|
||||
# include <boost/pointee.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <class P>
|
||||
struct smart_ptr_reference
|
||||
{
|
||||
typedef typename boost::pointee<P>::type& type;
|
||||
};
|
||||
}
|
||||
|
||||
template <class P>
|
||||
struct indirect_reference
|
||||
: mpl::eval_if<
|
||||
detail::is_incrementable<P>
|
||||
, iterator_reference<P>
|
||||
, detail::smart_ptr_reference<P>
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // INDIRECT_REFERENCE_DWA200415_HPP
|
@ -1,27 +0,0 @@
|
||||
// -------------------------------------
|
||||
//
|
||||
// (C) Copyright Gennaro Prota 2003.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// ------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_NON_TYPE_HPP_GP_20030417
|
||||
#define BOOST_NON_TYPE_HPP_GP_20030417
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
// Just a simple "envelope" for non-type template parameters. Useful
|
||||
// to work around some MSVC deficiencies.
|
||||
|
||||
template <typename T, T n>
|
||||
struct non_type { };
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
@ -1,16 +0,0 @@
|
||||
// -*- C++ -*- forwarding header.
|
||||
// (C) Copyright Jeremy Siek 2004
|
||||
// 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)
|
||||
|
||||
#ifndef BOOST_CSTDDEF_HPP
|
||||
#define BOOST_CSTDDEF_HPP
|
||||
|
||||
#if defined(__sgi) && !defined(__GNUC__)
|
||||
# include <stddef.h>
|
||||
#else
|
||||
# include <cstddef>
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,112 +0,0 @@
|
||||
// -----------------------------------------------------------
|
||||
// integer_log2.hpp
|
||||
//
|
||||
// Gives the integer part of the logarithm, in base 2, of a
|
||||
// given number. Behavior is undefined if the argument is <= 0.
|
||||
//
|
||||
// Copyright (c) 2003-2004, 2008 Gennaro Prota
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
|
||||
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
|
||||
|
||||
#include <assert.h>
|
||||
#ifdef __BORLANDC__
|
||||
#include <climits>
|
||||
#endif
|
||||
#include "boost/limits.hpp"
|
||||
#include "boost/config.hpp"
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
template <typename T>
|
||||
int integer_log2_impl(T x, int n) {
|
||||
|
||||
int result = 0;
|
||||
|
||||
while (x != 1) {
|
||||
|
||||
const T t = static_cast<T>(x >> n);
|
||||
if (t) {
|
||||
result += n;
|
||||
x = t;
|
||||
}
|
||||
n /= 2;
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// helper to find the maximum power of two
|
||||
// less than p (more involved than necessary,
|
||||
// to avoid PTS)
|
||||
//
|
||||
template <int p, int n>
|
||||
struct max_pow2_less {
|
||||
|
||||
enum { c = 2*n < p };
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, value =
|
||||
c ? (max_pow2_less< c*p, 2*c*n>::value) : n);
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct max_pow2_less<0, 0> {
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
|
||||
// this template is here just for Borland :(
|
||||
// we could simply rely on numeric_limits but sometimes
|
||||
// Borland tries to use numeric_limits<const T>, because
|
||||
// of its usual const-related problems in argument deduction
|
||||
// - gps
|
||||
template <typename T>
|
||||
struct width {
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
BOOST_STATIC_CONSTANT(int, value = sizeof(T) * CHAR_BIT);
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(int, value = (std::numeric_limits<T>::digits));
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
|
||||
// ---------
|
||||
// integer_log2
|
||||
// ---------------
|
||||
//
|
||||
template <typename T>
|
||||
int integer_log2(T x) {
|
||||
|
||||
assert(x > 0);
|
||||
|
||||
const int n = detail::max_pow2_less<
|
||||
detail::width<T> :: value, 4
|
||||
> :: value;
|
||||
|
||||
return detail::integer_log2_impl(x, n);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // include guard
|
@ -1,18 +0,0 @@
|
||||
// (C) Copyright David Abrahams 2001.
|
||||
// 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)
|
||||
|
||||
#ifndef BOOST_TYPE_DWA20010120_HPP
|
||||
# define BOOST_TYPE_DWA20010120_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
// Just a simple "type envelope". Useful in various contexts, mostly to work
|
||||
// around some MSVC deficiencies.
|
||||
template <class T>
|
||||
struct type {};
|
||||
|
||||
}
|
||||
|
||||
#endif // BOOST_TYPE_DWA20010120_HPP
|
@ -1,29 +0,0 @@
|
||||
// Boost.Signals library
|
||||
|
||||
// Copyright Douglas Gregor 2001-2003. Use, modification and
|
||||
// distribution is 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)
|
||||
|
||||
// For more information, see http://www.boost.org/libs/signals
|
||||
|
||||
#ifndef BOOST_VISIT_EACH_HPP
|
||||
#define BOOST_VISIT_EACH_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
template<typename Visitor, typename T>
|
||||
inline void visit_each(Visitor& visitor, const T& t, long)
|
||||
{
|
||||
visitor(t);
|
||||
}
|
||||
|
||||
template<typename Visitor, typename T>
|
||||
inline void visit_each(Visitor& visitor, const T& t)
|
||||
{
|
||||
visit_each(visitor, t, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_VISIT_EACH_HPP
|
258
test/binary_search_test.cpp
Normal file
258
test/binary_search_test.cpp
Normal file
@ -0,0 +1,258 @@
|
||||
// (C) Copyright David Abrahams 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)
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <climits>
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <stdlib.h> // for rand(). Would use cstdlib but VC6.4 doesn't put it in std::
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
#include <boost/detail/binary_search.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(__SGI_STL_PORT) ? defined(__SGI_STL_OWN_IOSTREAMS) : (!defined(__GNUC__) || __GNUC__ > 2)
|
||||
# define USE_SSTREAM
|
||||
#endif
|
||||
|
||||
#ifdef USE_SSTREAM
|
||||
# include <sstream>
|
||||
#else
|
||||
# include <strstream>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// In order to get ADL to find the comparison operators defined below, they have
|
||||
struct mystring : std::string
|
||||
{
|
||||
typedef std::string base;
|
||||
|
||||
mystring(std::string const& x)
|
||||
: base(x) {}
|
||||
};
|
||||
|
||||
typedef std::vector<mystring> string_vector;
|
||||
|
||||
const std::size_t sequence_length = 1000;
|
||||
|
||||
unsigned random_number()
|
||||
{
|
||||
return static_cast<unsigned>(::rand()) % sequence_length;
|
||||
}
|
||||
|
||||
# ifndef USE_SSTREAM
|
||||
class unfreezer {
|
||||
public:
|
||||
unfreezer(std::ostrstream& s) : m_stream(s) {}
|
||||
~unfreezer() { m_stream.freeze(false); }
|
||||
private:
|
||||
std::ostrstream& m_stream;
|
||||
};
|
||||
# endif
|
||||
|
||||
template <class T>
|
||||
void push_back_random_number_string(T& seq)
|
||||
{
|
||||
unsigned value = random_number();
|
||||
# if defined(__SGI_STL_PORT) ? defined(__SGI_STL_OWN_IOSTREAMS) : (!defined(__GNUC__) || __GNUC__ > 2)
|
||||
std::ostringstream s;
|
||||
s << value;
|
||||
seq.push_back(s.str());
|
||||
# else
|
||||
std::ostrstream s;
|
||||
auto unfreezer unfreeze(s);
|
||||
s << value << char(0);
|
||||
seq.push_back(std::string(s.str()));
|
||||
# endif
|
||||
}
|
||||
|
||||
inline unsigned to_int(unsigned x) { return x; }
|
||||
inline unsigned to_int(const std::string& x) { return atoi(x.c_str()); }
|
||||
|
||||
struct cmp
|
||||
{
|
||||
template <class A1, class A2>
|
||||
inline bool operator()(const A1& a1, const A2& a2) const
|
||||
{
|
||||
return to_int(a1) < to_int(a2);
|
||||
}
|
||||
};
|
||||
|
||||
inline bool operator<(const mystring& x, const unsigned y)
|
||||
{
|
||||
return to_int(x) < y;
|
||||
}
|
||||
|
||||
inline bool operator<(const unsigned y, const mystring& x)
|
||||
{
|
||||
return y < to_int(x);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void sort_by_value(T& x);
|
||||
|
||||
template <class T>
|
||||
void sort_by_value_(T& v, long)
|
||||
{
|
||||
std::sort(v.begin(), v.end(), cmp());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void random_sorted_sequence(T& seq)
|
||||
{
|
||||
seq.clear();
|
||||
for (std::size_t i = 0; i < sequence_length; ++i)
|
||||
{
|
||||
push_back_random_number_string(seq);
|
||||
}
|
||||
sort_by_value(seq);
|
||||
}
|
||||
|
||||
template <class T, class A>
|
||||
void sort_by_value_(std::list<T,A>& l, int)
|
||||
{
|
||||
# if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) && !defined(__SGI_STL_PORT)
|
||||
// VC6's standard lib doesn't have a template member function for list::sort()
|
||||
std::vector<T> seq;
|
||||
seq.reserve(sequence_length);
|
||||
std::copy(l.begin(), l.end(), std::back_inserter(seq));
|
||||
sort_by_value(seq);
|
||||
std::copy(seq.begin(), seq.end(), l.begin());
|
||||
# else
|
||||
l.sort(cmp());
|
||||
# endif
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void sort_by_value(T& x)
|
||||
{
|
||||
(sort_by_value_)(x, 1);
|
||||
}
|
||||
|
||||
// A way to select the comparisons with/without a Compare parameter for testing.
|
||||
template <class Compare> struct searches
|
||||
{
|
||||
template <class Iterator, class Key>
|
||||
static Iterator lower_bound(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||
{ return boost::detail::lower_bound(start, finish, key, cmp); }
|
||||
|
||||
template <class Iterator, class Key>
|
||||
static Iterator upper_bound(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||
{ return boost::detail::upper_bound(start, finish, key, cmp); }
|
||||
|
||||
template <class Iterator, class Key>
|
||||
static std::pair<Iterator, Iterator> equal_range(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||
{ return boost::detail::equal_range(start, finish, key, cmp); }
|
||||
|
||||
template <class Iterator, class Key>
|
||||
static bool binary_search(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||
{ return boost::detail::binary_search(start, finish, key, cmp); }
|
||||
};
|
||||
|
||||
struct no_compare {};
|
||||
|
||||
template <> struct searches<no_compare>
|
||||
{
|
||||
template <class Iterator, class Key>
|
||||
static Iterator lower_bound(Iterator start, Iterator finish, Key key, no_compare)
|
||||
{ return boost::detail::lower_bound(start, finish, key); }
|
||||
|
||||
template <class Iterator, class Key>
|
||||
static Iterator upper_bound(Iterator start, Iterator finish, Key key, no_compare)
|
||||
{ return boost::detail::upper_bound(start, finish, key); }
|
||||
|
||||
template <class Iterator, class Key>
|
||||
static std::pair<Iterator, Iterator> equal_range(Iterator start, Iterator finish, Key key, no_compare)
|
||||
{ return boost::detail::equal_range(start, finish, key); }
|
||||
|
||||
template <class Iterator, class Key>
|
||||
static bool binary_search(Iterator start, Iterator finish, Key key, no_compare)
|
||||
{ return boost::detail::binary_search(start, finish, key); }
|
||||
};
|
||||
|
||||
template <class Sequence, class Compare>
|
||||
void test_loop(Sequence& x, Compare cmp, unsigned long test_count)
|
||||
{
|
||||
typedef typename Sequence::const_iterator const_iterator;
|
||||
|
||||
for (unsigned long i = 0; i < test_count; ++i)
|
||||
{
|
||||
random_sorted_sequence(x);
|
||||
const const_iterator start = x.begin();
|
||||
const const_iterator finish = x.end();
|
||||
|
||||
unsigned key = random_number();
|
||||
const const_iterator l = searches<Compare>::lower_bound(start, finish, key, cmp);
|
||||
const const_iterator u = searches<Compare>::upper_bound(start, finish, key, cmp);
|
||||
|
||||
bool found_l = false;
|
||||
bool found_u = false;
|
||||
std::size_t index = 0;
|
||||
std::size_t count = 0;
|
||||
unsigned last_value = 0;
|
||||
for (const_iterator p = start; p != finish; ++p)
|
||||
{
|
||||
if (p == l)
|
||||
found_l = true;
|
||||
|
||||
if (p == u)
|
||||
{
|
||||
assert(found_l);
|
||||
found_u = true;
|
||||
}
|
||||
|
||||
unsigned value = to_int(*p);
|
||||
assert(value >= last_value);
|
||||
last_value = value;
|
||||
|
||||
if (!found_l)
|
||||
{
|
||||
++index;
|
||||
assert(to_int(*p) < key);
|
||||
}
|
||||
else if (!found_u)
|
||||
{
|
||||
++count;
|
||||
assert(to_int(*p) == key);
|
||||
}
|
||||
else
|
||||
assert(to_int(*p) > key);
|
||||
}
|
||||
assert(found_l || l == finish);
|
||||
assert(found_u || u == finish);
|
||||
|
||||
std::pair<const_iterator, const_iterator>
|
||||
range = searches<Compare>::equal_range(start, finish, key, cmp);
|
||||
assert(range.first == l);
|
||||
assert(range.second == u);
|
||||
|
||||
bool found = searches<Compare>::binary_search(start, finish, key, cmp);
|
||||
assert(found == (u != l));
|
||||
std::cout << "found " << count << " copies of " << key << " at index " << index << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
string_vector x;
|
||||
std::cout << "=== testing random-access iterators with <: ===\n";
|
||||
test_loop(x, no_compare(), 25);
|
||||
std::cout << "=== testing random-access iterators with compare: ===\n";
|
||||
test_loop(x, cmp(), 25);
|
||||
|
||||
std::list<mystring> y;
|
||||
std::cout << "=== testing bidirectional iterators with <: ===\n";
|
||||
test_loop(y, no_compare(), 25);
|
||||
std::cout << "=== testing bidirectional iterators with compare: ===\n";
|
||||
test_loop(y, cmp(), 25);
|
||||
std::cerr << "******TEST PASSED******\n";
|
||||
return 0;
|
||||
}
|
@ -21,9 +21,19 @@ run container_fwd_test.cpp : :
|
||||
: <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||
: container_fwd_debug ;
|
||||
|
||||
# The 'correctly_disable' tests fail if forward declaring standard types
|
||||
# could work, but is currently not being done. Unfortunately, this if often
|
||||
# the case - but we can't detect it, so the tests fail and there's not much
|
||||
# we can do. There are also problems because some compilers don't support
|
||||
# the debug version of their libraries. So I felt it was best to stop these
|
||||
# tests from running in a normal test run..
|
||||
|
||||
compile-fail correctly_disable_fail.cpp
|
||||
: <warnings-as-errors>off
|
||||
: correctly_disable ;
|
||||
compile-fail correctly_disable_fail.cpp
|
||||
: <warnings-as-errors>off <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||
: correctly_disable_debug ;
|
||||
|
||||
explicit correctly_disable ;
|
||||
explicit correctly_disable_debug ;
|
||||
|
@ -3,7 +3,7 @@
|
||||
// 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/functional/detail/container_fwd.hpp>
|
||||
#include <boost/detail/container_fwd.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, < 3) && \
|
||||
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||
|
@ -92,9 +92,9 @@ int main (void) {
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end()), a.end());
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lt), a.end());
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lte), a.end());
|
||||
BOOST_TEST_EQ(*IS_SORTED_UNTIL(a.rbegin(), a.rend(), gt), *a.rend());
|
||||
BOOST_TEST_EQ(*IS_SORTED_UNTIL(a.rbegin(), a.rend(), gte), *a.rend());
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.rbegin(), a.rend(), gt).base(), a.rend().base());
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.rbegin(), a.rend(), gte).base(), a.rend().base());
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end()), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lt), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lte), true);
|
||||
@ -104,21 +104,21 @@ int main (void) {
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end()), b.end());
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lt), b.end());
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lte), &b[2]);
|
||||
BOOST_TEST_EQ(*IS_SORTED_UNTIL(b.rbegin(), b.rend(), gt), *b.rend());
|
||||
BOOST_TEST_EQ(*IS_SORTED_UNTIL(b.rbegin(), b.rend(), gte), b[2]);
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end()), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lt), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lte), false);
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.rbegin(), b.rend(), gt).base(), b.rend().base());
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.rbegin(), b.rend(), gte).base(), &b[2]);
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end()), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lt), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lte), false);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gt), true);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gte), false);
|
||||
BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gte), false);
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end()), &c[2]);
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lt), &c[2]);
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lte), &c[2]);
|
||||
BOOST_TEST_EQ(*IS_SORTED_UNTIL(c.rbegin(), c.rend(), gt), c[7]);
|
||||
BOOST_TEST_EQ(*IS_SORTED_UNTIL(c.rbegin(), c.rend(), gte), c[7]);
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.rbegin(), c.rend(), gt).base(), &c[8]);
|
||||
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.rbegin(), c.rend(), gte).base(), &c[8]);
|
||||
|
||||
BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end()), false);
|
||||
BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lt), false);
|
||||
BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lte), false);
|
||||
|
Reference in New Issue
Block a user