mirror of
https://github.com/boostorg/detail.git
synced 2025-06-28 13:31:05 +02:00
Compare commits
66 Commits
svn-branch
...
boost-1.52
Author | SHA1 | Date | |
---|---|---|---|
b29b1b764c | |||
436afec8b3 | |||
689df8ea62 | |||
02d2fb38e3 | |||
c11c0ef97b | |||
6caa4f2698 | |||
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 |
@ -16,8 +16,22 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
|
||||
// forward declare standard containers. //
|
||||
// //
|
||||
// BOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it //
|
||||
// normally doesn't. //
|
||||
// //
|
||||
// BOOST_DETAIL_NO_CONTAINER_FWD overrides BOOST_DETAIL_CONTAINER_FWD. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
|
||||
# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||
# if defined(BOOST_DETAIL_CONTAINER_FWD)
|
||||
// Force forward declarations.
|
||||
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||
// STLport
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(__LIBCOMO__)
|
||||
@ -31,13 +45,23 @@
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||
// GNU libstdc++ 3
|
||||
# if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
|
||||
//
|
||||
// Disable forwarding for all recent versions, as the library has a
|
||||
// versioned namespace mode, and I don't know how to detect it.
|
||||
# if __GLIBCXX__ >= 20070513 \
|
||||
|| defined(_GLIBCXX_DEBUG) \
|
||||
|| defined(_GLIBCXX_PARALLEL) \
|
||||
|| defined(_GLIBCXX_PROFILE)
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# else
|
||||
# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530
|
||||
# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT
|
||||
# endif
|
||||
# endif
|
||||
# elif defined(__STL_CONFIG_H)
|
||||
// generic SGI STL
|
||||
//
|
||||
// Forward declaration seems to be okay, but it has a copule of odd
|
||||
// Forward declaration seems to be okay, but it has a couple of odd
|
||||
// implementations.
|
||||
# define BOOST_CONTAINER_FWD_BAD_BITSET
|
||||
# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
|
||||
@ -47,26 +71,18 @@
|
||||
// MSL standard lib:
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif defined(__IBMCPP__)
|
||||
// take the default VACPP std lib
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
// The default VACPP std lib, forward declaration seems to be fine.
|
||||
# elif defined(MSIPL_COMPILE_H)
|
||||
// Modena C++ standard library
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
|
||||
// Dinkumware Library (this has to appear after any possible replacement
|
||||
// libraries)
|
||||
//
|
||||
// Works fine.
|
||||
# else
|
||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// BOOST_DETAIL_TEST_* macros are for testing only
|
||||
// and shouldn't be relied upon. But you can use
|
||||
// BOOST_DETAIL_NO_CONTAINER_FWD to prevent forward
|
||||
// declaration of containers.
|
||||
|
||||
#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
||||
|
||||
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
|
||||
@ -104,16 +120,17 @@ namespace std
|
||||
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 BOOST_CLANG
|
||||
template <class T> struct complex;
|
||||
#else
|
||||
template <class T> class complex;
|
||||
#endif
|
||||
#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
|
||||
template <class T> struct complex;
|
||||
#else
|
||||
template <class T> class complex;
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||
template <class T, class Allocator> class deque;
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
/* If we're using clang + glibc, we have to get hacky.
|
||||
* See http://llvm.org/bugs/show_bug.cgi?id=6907 */
|
||||
#if defined(__clang__) && \
|
||||
#if defined(__clang__) && (__clang_major__ < 3) && \
|
||||
defined(__GNU_LIBRARY__) && /* up to version 5 */ \
|
||||
defined(__GLIBC__) /* version 6 + */
|
||||
defined(__GLIBC__) && /* version 6 + */ \
|
||||
!defined(_FENV_H)
|
||||
#define _FENV_H
|
||||
|
||||
#include <features.h>
|
||||
|
0
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
0
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
@ -33,6 +33,21 @@
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
|
||||
#if _WIN32_WCE >= 0x600
|
||||
|
||||
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 );
|
||||
|
||||
# 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
|
||||
|
||||
#else
|
||||
// under Windows CE we still have old-style Interlocked* functions
|
||||
|
||||
extern "C" long __cdecl InterlockedIncrement( long* );
|
||||
@ -47,6 +62,8 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
||||
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
||||
|
||||
#endif
|
||||
|
||||
# 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) \
|
||||
@ -54,7 +71,11 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
||||
|
||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||
|
||||
#if defined( __CLRCALL_PURE_OR_CDECL )
|
||||
#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 * );
|
||||
@ -119,15 +140,15 @@ 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 );
|
||||
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* );
|
||||
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
|
||||
|
0
include/boost/detail/is_function_ref_tester.hpp
Executable file → Normal file
0
include/boost/detail/is_function_ref_tester.hpp
Executable file → Normal file
0
include/boost/detail/is_xxx.hpp
Executable file → Normal file
0
include/boost/detail/is_xxx.hpp
Executable file → Normal file
@ -1,56 +1,337 @@
|
||||
// scoped_enum_emulation.hpp ---------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes, 2009
|
||||
// Copyright (C) 2011-2012 Vicente J. Botet Escriba
|
||||
// Copyright (C) 2012 Anthony Williams
|
||||
|
||||
// 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 );
|
||||
/*
|
||||
[section:scoped_enums Scoped Enums]
|
||||
|
||||
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.
|
||||
|
||||
Some of the enumerations defined in the standard library are scoped enums.
|
||||
|
||||
enum class future_errc
|
||||
{
|
||||
broken_promise,
|
||||
future_already_retrieved,
|
||||
promise_already_satisfied,
|
||||
no_state
|
||||
};
|
||||
|
||||
On compilers that don't support them, the library provides two emulations:
|
||||
|
||||
[heading Strict]
|
||||
|
||||
* Able to specify the underlying type.
|
||||
* explicit conversion to/from underlying type.
|
||||
* The wrapper is not a C++03 enum type.
|
||||
|
||||
The user can declare declare these types as
|
||||
|
||||
BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
|
||||
{
|
||||
broken_promise,
|
||||
future_already_retrieved,
|
||||
promise_already_satisfied,
|
||||
no_state
|
||||
}
|
||||
BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
|
||||
|
||||
These macros allows to use 'future_errc' in almost all the cases as an scoped enum.
|
||||
|
||||
future_errc err = future_errc::no_state;
|
||||
|
||||
There are however some limitations:
|
||||
|
||||
* The type is not a C++ enum, so 'is_enum<future_errc>' will be false_type.
|
||||
* The emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some macros.
|
||||
|
||||
Instead of
|
||||
|
||||
switch (ev)
|
||||
{
|
||||
case future_errc::broken_promise:
|
||||
// ...
|
||||
|
||||
use
|
||||
|
||||
switch (boost::native_value(ev))
|
||||
{
|
||||
case future_errc::broken_promise:
|
||||
|
||||
And instead of
|
||||
|
||||
#ifdef BOOST_NO_SCOPED_ENUMS
|
||||
template <>
|
||||
struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type { };
|
||||
#endif
|
||||
|
||||
use
|
||||
|
||||
#ifdef BOOST_NO_SCOPED_ENUMS
|
||||
template <>
|
||||
struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc::enum_type > : public true_type { };
|
||||
#endif
|
||||
|
||||
|
||||
Sample usage:
|
||||
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char) { green, red, cyan }; BOOST_SCOPED_ENUM_DECLARE_END(algae)
|
||||
...
|
||||
algae sample( algae::red );
|
||||
void foo( algae color );
|
||||
...
|
||||
sample = algae::green;
|
||||
foo( algae::cyan );
|
||||
|
||||
Light
|
||||
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 literal scoped emulation is via struct rather than namespace to allow use within classes.
|
||||
Thanks to Andrey Semashev for pointing that out.
|
||||
However the type is an real C++03 enum and so convertible implicitly to an int.
|
||||
|
||||
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 );
|
||||
|
||||
Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
|
||||
Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vicente
|
||||
Botet, and Daniel James.
|
||||
|
||||
[endsect]
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||
#define BOOST_SCOPED_ENUM_EMULATION_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#ifdef BOOST_NO_SCOPED_ENUMS
|
||||
/**
|
||||
* Meta-function to get the underlying type of a scoped enum.
|
||||
*
|
||||
* Requires EnumType must be an enum type or the emulation of a scoped enum
|
||||
*/
|
||||
template <typename EnumType>
|
||||
struct underlying_type
|
||||
{
|
||||
/**
|
||||
* The member typedef type names the underlying type of EnumType. It is EnumType::underlying_type when the EnumType is an emulated scoped enum,
|
||||
* std::underlying_type<EnumType>::type when the standard library std::underlying_type is provided.
|
||||
*
|
||||
* The user will need to specialize it when the compiler supports scoped enums but don't provides std::underlying_type.
|
||||
*/
|
||||
typedef typename EnumType::underlying_type type;
|
||||
};
|
||||
|
||||
/**
|
||||
* Meta-function to get the native enum type associated to an enum class or its emulation.
|
||||
*/
|
||||
template <typename EnumType>
|
||||
struct native_type
|
||||
{
|
||||
/**
|
||||
* The member typedef type names the native enum type associated to the scoped enum,
|
||||
* which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
|
||||
*/
|
||||
typedef typename EnumType::enum_type type;
|
||||
};
|
||||
|
||||
/**
|
||||
* Casts a scoped enum to its underlying type.
|
||||
*
|
||||
* This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
|
||||
* @param v A scoped enum.
|
||||
* @returns The underlying type.
|
||||
* @throws No-throws.
|
||||
*/
|
||||
template <typename UnderlyingType, typename EnumType>
|
||||
UnderlyingType underlying_cast(EnumType v)
|
||||
{
|
||||
return v.get_underlying_value_();
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts a scoped enum to its native enum type.
|
||||
*
|
||||
* This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
|
||||
*
|
||||
* EnumType the scoped enum type
|
||||
*
|
||||
* @param v A scoped enum.
|
||||
* @returns The native enum value.
|
||||
* @throws No-throws.
|
||||
*/
|
||||
template <typename EnumType>
|
||||
inline
|
||||
typename EnumType::enum_type native_value(EnumType e)
|
||||
{
|
||||
return e.native_value_();
|
||||
}
|
||||
|
||||
#else // BOOST_NO_SCOPED_ENUMS
|
||||
|
||||
template <typename EnumType>
|
||||
struct underlying_type
|
||||
{
|
||||
//typedef typename std::underlying_type<EnumType>::type type;
|
||||
};
|
||||
|
||||
template <typename EnumType>
|
||||
struct native_type
|
||||
{
|
||||
typedef EnumType type;
|
||||
};
|
||||
|
||||
template <typename UnderlyingType, typename EnumType>
|
||||
UnderlyingType underlying_cast(EnumType v)
|
||||
{
|
||||
return static_cast<UnderlyingType>(v);
|
||||
}
|
||||
|
||||
template <typename EnumType>
|
||||
inline
|
||||
EnumType native_value(EnumType e)
|
||||
{
|
||||
return e;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#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
|
||||
#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
|
||||
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
|
||||
explicit operator underlying_type() const { return get_underlying_value_(); }
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_SCOPED_ENUM_START(name) enum class name
|
||||
# define BOOST_SCOPED_ENUM_END
|
||||
# define BOOST_SCOPED_ENUM(name) name
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Start a declaration of a scoped enum.
|
||||
*
|
||||
* @param EnumType The new scoped enum.
|
||||
* @param UnderlyingType The underlying type.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
|
||||
struct EnumType { \
|
||||
typedef UnderlyingType underlying_type; \
|
||||
EnumType() BOOST_NOEXCEPT {} \
|
||||
explicit EnumType(underlying_type v) : v_(v) {} \
|
||||
underlying_type get_underlying_value_() const { return v_; } \
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
|
||||
private: \
|
||||
underlying_type v_; \
|
||||
typedef EnumType self_type; \
|
||||
public: \
|
||||
enum enum_type
|
||||
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END2() \
|
||||
enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
|
||||
operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); } \
|
||||
friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
|
||||
friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
|
||||
friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
|
||||
friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
|
||||
friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
|
||||
friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
|
||||
friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<enum_type(rhs.v_); } \
|
||||
friend bool operator <(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<rhs; } \
|
||||
friend bool operator <(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<enum_type(rhs.v_); } \
|
||||
friend bool operator <=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=enum_type(rhs.v_); } \
|
||||
friend bool operator <=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=rhs; } \
|
||||
friend bool operator <=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<=enum_type(rhs.v_); } \
|
||||
friend bool operator >(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \
|
||||
friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
|
||||
friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
|
||||
friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
|
||||
friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
|
||||
friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
|
||||
};
|
||||
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
|
||||
; \
|
||||
EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
|
||||
BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||
|
||||
/**
|
||||
* Starts a declaration of a scoped enum with the default int underlying type.
|
||||
*
|
||||
* @param EnumType The new scoped enum.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
|
||||
|
||||
/**
|
||||
* Name of the native enum type.
|
||||
*
|
||||
* @param NT The new scoped enum.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
|
||||
/**
|
||||
* Forward declares an scoped enum.
|
||||
*
|
||||
* @param NT The scoped enum.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
|
||||
|
||||
#else // BOOST_NO_SCOPED_ENUMS
|
||||
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType:UnderlyingType
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
|
||||
|
||||
#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
|
||||
#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
|
||||
|
||||
#endif // BOOST_NO_SCOPED_ENUMS
|
||||
|
||||
#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
|
||||
#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||
#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
|
||||
|
||||
//#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
|
||||
|
@ -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).
|
@ -18,7 +18,7 @@ namespace win32 {
|
||||
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
||||
inline HANDLE_ GetCurrentThread()
|
||||
{
|
||||
return ::GetCurrentThread();
|
||||
return ::GetCurrentThread();
|
||||
}
|
||||
#else
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
@ -14,7 +14,7 @@
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace win32 {
|
||||
#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes
|
||||
#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetProcessTimes;
|
||||
#else
|
||||
|
@ -23,9 +23,9 @@ namespace win32 {
|
||||
typedef SYSTEMTIME SYSTEMTIME_;
|
||||
typedef SYSTEMTIME* PSYSTEMTIME_;
|
||||
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
using ::GetSystemTimeAsFileTime;
|
||||
#endif
|
||||
#endif
|
||||
using ::FileTimeToLocalFileTime;
|
||||
using ::GetSystemTime;
|
||||
using ::SystemTimeToFileTime;
|
||||
@ -49,10 +49,10 @@ extern "C" {
|
||||
WORD_ wMilliseconds;
|
||||
} SYSTEMTIME_, *PSYSTEMTIME_;
|
||||
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
#ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime
|
||||
__declspec(dllimport) void WINAPI
|
||||
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
||||
#endif
|
||||
#endif
|
||||
__declspec(dllimport) int WINAPI
|
||||
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
||||
FILETIME_* lpLocalFileTime);
|
||||
|
0
include/boost/indirect_reference.hpp
Executable file → Normal file
0
include/boost/indirect_reference.hpp
Executable file → Normal file
@ -11,6 +11,7 @@ project detail/test/container_fwd
|
||||
<toolset>intel:<warnings>on
|
||||
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>clang:<cxxflags>"-pedantic -Wextra -Wmismatched-tags"
|
||||
<warnings-as-errors>on
|
||||
;
|
||||
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user