mirror of
https://github.com/boostorg/detail.git
synced 2025-06-28 05:21:08 +02:00
Compare commits
1 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
2ed4dafddc |
@ -1,106 +0,0 @@
|
|||||||
//-----------------------------------------------------------------------------
|
|
||||||
// boost blank.hpp header file
|
|
||||||
// See http://www.boost.org for updates, documentation, and revision history.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) 2003
|
|
||||||
// Eric Friedman
|
|
||||||
//
|
|
||||||
// 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_BLANK_HPP
|
|
||||||
#define BOOST_BLANK_HPP
|
|
||||||
|
|
||||||
#include "boost/blank_fwd.hpp"
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_IOSTREAM)
|
|
||||||
#include <iosfwd> // for std::basic_ostream forward declare
|
|
||||||
#include "boost/detail/templated_streams.hpp"
|
|
||||||
#endif // BOOST_NO_IOSTREAM
|
|
||||||
|
|
||||||
#include "boost/mpl/bool.hpp"
|
|
||||||
#include "boost/type_traits/is_empty.hpp"
|
|
||||||
#include "boost/type_traits/is_pod.hpp"
|
|
||||||
#include "boost/type_traits/is_stateless.hpp"
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
struct blank
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// type traits specializations
|
|
||||||
//
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_pod< blank >
|
|
||||||
: mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_empty< blank >
|
|
||||||
: mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_stateless< blank >
|
|
||||||
: mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// relational operators
|
|
||||||
//
|
|
||||||
|
|
||||||
inline bool operator==(const blank&, const blank&)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool operator<=(const blank&, const blank&)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool operator>=(const blank&, const blank&)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool operator!=(const blank&, const blank&)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool operator<(const blank&, const blank&)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool operator>(const blank&, const blank&)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// streaming support
|
|
||||||
//
|
|
||||||
#if !defined(BOOST_NO_IOSTREAM)
|
|
||||||
|
|
||||||
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
|
||||||
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
|
||||||
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
|
|
||||||
, const blank&
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// (output nothing)
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_NO_IOSTREAM
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_BLANK_HPP
|
|
@ -1,22 +0,0 @@
|
|||||||
//-----------------------------------------------------------------------------
|
|
||||||
// boost blank_fwd.hpp header file
|
|
||||||
// See http://www.boost.org for updates, documentation, and revision history.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) 2003
|
|
||||||
// Eric Friedman
|
|
||||||
//
|
|
||||||
// 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_BLANK_FWD_HPP
|
|
||||||
#define BOOST_BLANK_FWD_HPP
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
struct blank;
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_BLANK_FWD_HPP
|
|
@ -1,10 +1,11 @@
|
|||||||
// boost/cstdlib.hpp header ------------------------------------------------//
|
// boost/cstdlib.hpp header ------------------------------------------------//
|
||||||
|
|
||||||
// Copyright Beman Dawes 2001. Distributed under the Boost
|
// (C) Copyright Beman Dawes 2001. Permission to copy, use, modify, sell
|
||||||
// Software License, Version 1.0. (See accompanying file
|
// and distribute this software is granted provided this copyright notice
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// appears in all copies. This software is provided "as is" without express or
|
||||||
|
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||||
|
|
||||||
// See http://www.boost.org/libs/utility/cstdlib.html for documentation.
|
// See http://www.boost.org for updates and documentation.
|
||||||
|
|
||||||
// Revision History
|
// Revision History
|
||||||
// 26 Feb 01 Initial version (Beman Dawes)
|
// 26 Feb 01 Initial version (Beman Dawes)
|
||||||
|
280
include/boost/detail/allocator.hpp
Normal file
280
include/boost/detail/allocator.hpp
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright (c) 2001
|
||||||
|
* Dr John Maddock
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, distribute and sell this software
|
||||||
|
* and its documentation for any purpose is hereby granted without fee,
|
||||||
|
* provided that the above copyright notice appear in all copies and
|
||||||
|
* that both that copyright notice and this permission notice appear
|
||||||
|
* in supporting documentation. Dr John Maddock makes no representations
|
||||||
|
* about the suitability of this software for any purpose.
|
||||||
|
* It is provided "as is" without express or implied warranty.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_ALLOCATOR_HPP
|
||||||
|
#define BOOST_DETAIL_ALLOCATOR_HPP
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <cstdlib>
|
||||||
|
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
|
namespace std{
|
||||||
|
using ::ptrdiff_t;
|
||||||
|
using ::size_t;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// see if we have SGI alloc class:
|
||||||
|
#if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H))
|
||||||
|
# define BOOST_HAVE_SGI_ALLOCATOR
|
||||||
|
# include <memory>
|
||||||
|
# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||||
|
namespace boost{ namespace detail{
|
||||||
|
typedef std::__sgi_alloc alloc_type;
|
||||||
|
}}
|
||||||
|
# else
|
||||||
|
namespace boost{ namespace detail{
|
||||||
|
typedef std::alloc alloc_type;
|
||||||
|
}}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost{ namespace detail{
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void allocator_construct(T* p, const T& t)
|
||||||
|
{ new (p) T(t); }
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void allocator_destroy(T* p)
|
||||||
|
{ p->~T(); }
|
||||||
|
|
||||||
|
} }
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_STD_ALLOCATOR)
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#define BOOST_DEFAULT_ALLOCATOR(T) std::allocator<T>
|
||||||
|
|
||||||
|
namespace boost{ namespace detail{
|
||||||
|
|
||||||
|
template <class T, class A>
|
||||||
|
struct rebind_allocator
|
||||||
|
{
|
||||||
|
typedef typename A::template rebind<T> binder;
|
||||||
|
typedef typename binder::other type;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#elif !defined(BOOST_NO_MEMBER_TEMPLATES)
|
||||||
|
|
||||||
|
// no std::allocator, but the compiler supports the necessary syntax,
|
||||||
|
// write our own allocator instead:
|
||||||
|
|
||||||
|
#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator<T>
|
||||||
|
|
||||||
|
namespace boost{ namespace detail{
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class allocator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef T value_type;
|
||||||
|
typedef value_type * pointer;
|
||||||
|
typedef const T* const_pointer;
|
||||||
|
typedef T& reference;
|
||||||
|
typedef const T& const_reference;
|
||||||
|
typedef std::size_t size_type;
|
||||||
|
typedef std::ptrdiff_t difference_type;
|
||||||
|
|
||||||
|
template <class U>
|
||||||
|
struct rebind
|
||||||
|
{
|
||||||
|
typedef allocator<U> other;
|
||||||
|
};
|
||||||
|
|
||||||
|
allocator(){}
|
||||||
|
|
||||||
|
template <class U>
|
||||||
|
allocator(const allocator<U>&){}
|
||||||
|
|
||||||
|
allocator(const allocator&){}
|
||||||
|
|
||||||
|
template <class U>
|
||||||
|
allocator& operator=(const allocator<U>&)
|
||||||
|
{ return *this; }
|
||||||
|
|
||||||
|
~allocator(){}
|
||||||
|
|
||||||
|
pointer address(reference x) { return &x; }
|
||||||
|
|
||||||
|
const_pointer address(const_reference x) const { return &x; }
|
||||||
|
|
||||||
|
pointer allocate(size_type n, const void* = 0)
|
||||||
|
{
|
||||||
|
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
||||||
|
return n != 0 ?
|
||||||
|
reinterpret_cast<pointer>(alloc_type::allocate(n * sizeof(value_type)))
|
||||||
|
: 0;
|
||||||
|
#else
|
||||||
|
return n != 0 ?
|
||||||
|
reinterpret_cast<pointer>(::operator new(n * sizeof(value_type)))
|
||||||
|
: 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void deallocate(pointer p, size_type n)
|
||||||
|
{
|
||||||
|
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
||||||
|
assert( (p == 0) == (n == 0) );
|
||||||
|
if (p != 0)
|
||||||
|
alloc_type::deallocate((void*)p, n);
|
||||||
|
#else
|
||||||
|
assert( (p == 0) == (n == 0) );
|
||||||
|
if (p != 0)
|
||||||
|
::operator delete((void*)p);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
size_type max_size() const
|
||||||
|
{ return size_t(-1) / sizeof(value_type); }
|
||||||
|
|
||||||
|
void construct(pointer p, const T& val) const
|
||||||
|
{ allocator_construct(p, val); }
|
||||||
|
|
||||||
|
void destroy(pointer p) const
|
||||||
|
{ allocator_destroy(p); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T, class A>
|
||||||
|
struct rebind_allocator
|
||||||
|
{
|
||||||
|
typedef typename A::template rebind<T> binder;
|
||||||
|
typedef typename binder::other type;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// no std::allocator, use workaround version instead,
|
||||||
|
// each allocator class must derive from a base class
|
||||||
|
// that allocates blocks of bytes:
|
||||||
|
|
||||||
|
#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter<T, ::boost::detail::simple_alloc>
|
||||||
|
|
||||||
|
namespace boost{ namespace detail{
|
||||||
|
|
||||||
|
class simple_alloc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef void value_type;
|
||||||
|
typedef value_type * pointer;
|
||||||
|
typedef const void* const_pointer;
|
||||||
|
typedef std::size_t size_type;
|
||||||
|
typedef std::ptrdiff_t difference_type;
|
||||||
|
|
||||||
|
simple_alloc(){}
|
||||||
|
simple_alloc(const simple_alloc&){}
|
||||||
|
|
||||||
|
~simple_alloc(){}
|
||||||
|
|
||||||
|
pointer allocate(size_type n, const void* = 0)
|
||||||
|
{
|
||||||
|
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
||||||
|
return n != 0 ?
|
||||||
|
reinterpret_cast<pointer>(alloc_type::allocate(n))
|
||||||
|
: 0;
|
||||||
|
#else
|
||||||
|
return n != 0 ?
|
||||||
|
reinterpret_cast<pointer>(::operator new(n))
|
||||||
|
: 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void deallocate(pointer p, size_type n)
|
||||||
|
{
|
||||||
|
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
||||||
|
assert( (p == 0) == (n == 0) );
|
||||||
|
if (p != 0)
|
||||||
|
alloc_type::deallocate((void*)p, n);
|
||||||
|
#else
|
||||||
|
assert( (p == 0) == (n == 0) );
|
||||||
|
if (p != 0)
|
||||||
|
::operator delete((void*)p);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T, class Base>
|
||||||
|
class allocator_adapter : public Base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef T value_type;
|
||||||
|
typedef value_type * pointer;
|
||||||
|
typedef const T* const_pointer;
|
||||||
|
typedef T& reference;
|
||||||
|
typedef const T& const_reference;
|
||||||
|
typedef size_t size_type;
|
||||||
|
typedef std::ptrdiff_t difference_type;
|
||||||
|
typedef Base base_type;
|
||||||
|
|
||||||
|
allocator_adapter(){}
|
||||||
|
allocator_adapter(const base_type& x) : Base(x){}
|
||||||
|
allocator_adapter& operator=(const base_type& x)
|
||||||
|
{
|
||||||
|
*(static_cast<base_type*>(this)) = x;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
~allocator_adapter(){}
|
||||||
|
|
||||||
|
pointer address(reference x) { return &x; }
|
||||||
|
|
||||||
|
const_pointer address(const_reference x) const { return &x; }
|
||||||
|
|
||||||
|
pointer allocate(size_type n, const void* = 0)
|
||||||
|
{
|
||||||
|
return n != 0 ?
|
||||||
|
reinterpret_cast<pointer>(base_type::allocate(n * sizeof(value_type)))
|
||||||
|
: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void deallocate(pointer p, size_type n)
|
||||||
|
{
|
||||||
|
assert( (p == 0) == (n == 0) );
|
||||||
|
if (p != 0)
|
||||||
|
static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
size_type max_size() const
|
||||||
|
{ return size_t(-1) / sizeof(value_type); }
|
||||||
|
|
||||||
|
void construct(pointer p, const T& val) const
|
||||||
|
{ allocator_construct(p, val); }
|
||||||
|
|
||||||
|
void destroy(pointer p) const
|
||||||
|
{ allocator_destroy(p); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T, class A>
|
||||||
|
struct rebind_allocator
|
||||||
|
{
|
||||||
|
typedef allocator_adapter<T, typename A::base_type> type;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // include guard
|
@ -1,212 +0,0 @@
|
|||||||
/* Copyright 2003-2009 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)
|
|
||||||
*
|
|
||||||
* See Boost website at http://www.boost.org/
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
|
|
||||||
#define BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
|
|
||||||
|
|
||||||
#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>
|
|
||||||
#include <memory>
|
|
||||||
#include <new>
|
|
||||||
|
|
||||||
namespace boost{
|
|
||||||
|
|
||||||
namespace detail{
|
|
||||||
|
|
||||||
/* Allocator adaption layer. Some stdlibs provide allocators without rebind
|
|
||||||
* and template ctors. These facilities are simulated with the external
|
|
||||||
* template class rebind_to and the aid of partial_std_allocator_wrapper.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace allocator{
|
|
||||||
|
|
||||||
/* partial_std_allocator_wrapper inherits the functionality of a std
|
|
||||||
* allocator while providing a templatized ctor and other bits missing
|
|
||||||
* in some stdlib implementation or another.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
class partial_std_allocator_wrapper:public std::allocator<Type>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/* Oddly enough, STLport does not define std::allocator<void>::value_type
|
|
||||||
* when configured to work without partial template specialization.
|
|
||||||
* No harm in supplying the definition here unconditionally.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef Type value_type;
|
|
||||||
|
|
||||||
partial_std_allocator_wrapper(){};
|
|
||||||
|
|
||||||
template<typename Other>
|
|
||||||
partial_std_allocator_wrapper(const partial_std_allocator_wrapper<Other>&){}
|
|
||||||
|
|
||||||
partial_std_allocator_wrapper(const std::allocator<Type>& x):
|
|
||||||
std::allocator<Type>(x)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(BOOST_DINKUMWARE_STDLIB)
|
|
||||||
/* Dinkumware guys didn't provide a means to call allocate() without
|
|
||||||
* supplying a hint, in disagreement with the standard.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Type* allocate(std::size_t n,const void* hint=0)
|
|
||||||
{
|
|
||||||
std::allocator<Type>& a=*this;
|
|
||||||
return a.allocate(n,hint);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Detects whether a given allocator belongs to a defective stdlib not
|
|
||||||
* having the required member templates.
|
|
||||||
* Note that it does not suffice to check the Boost.Config stdlib
|
|
||||||
* macros, as the user might have passed a custom, compliant allocator.
|
|
||||||
* The checks also considers partial_std_allocator_wrapper to be
|
|
||||||
* a standard defective allocator.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(BOOST_NO_STD_ALLOCATOR)&&\
|
|
||||||
(defined(BOOST_HAS_PARTIAL_STD_ALLOCATOR)||defined(BOOST_DINKUMWARE_STDLIB))
|
|
||||||
|
|
||||||
template<typename Allocator>
|
|
||||||
struct is_partial_std_allocator
|
|
||||||
{
|
|
||||||
BOOST_STATIC_CONSTANT(bool,
|
|
||||||
value=
|
|
||||||
(is_same<
|
|
||||||
std::allocator<BOOST_DEDUCED_TYPENAME Allocator::value_type>,
|
|
||||||
Allocator
|
|
||||||
>::value)||
|
|
||||||
(is_same<
|
|
||||||
partial_std_allocator_wrapper<
|
|
||||||
BOOST_DEDUCED_TYPENAME Allocator::value_type>,
|
|
||||||
Allocator
|
|
||||||
>::value));
|
|
||||||
};
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<typename Allocator>
|
|
||||||
struct is_partial_std_allocator
|
|
||||||
{
|
|
||||||
BOOST_STATIC_CONSTANT(bool,value=false);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* rebind operations for defective std allocators */
|
|
||||||
|
|
||||||
template<typename Allocator,typename Type>
|
|
||||||
struct partial_std_allocator_rebind_to
|
|
||||||
{
|
|
||||||
typedef partial_std_allocator_wrapper<Type> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
{
|
|
||||||
template<typename Type>
|
|
||||||
struct result
|
|
||||||
{
|
|
||||||
typedef typename Allocator::BOOST_NESTED_TEMPLATE
|
|
||||||
rebind<Type>::other other;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename Allocator,typename Type>
|
|
||||||
struct compliant_allocator_rebind_to
|
|
||||||
{
|
|
||||||
typedef typename rebinder<Allocator>::
|
|
||||||
BOOST_NESTED_TEMPLATE result<Type>::other type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* rebind front-end */
|
|
||||||
|
|
||||||
template<typename Allocator,typename Type>
|
|
||||||
struct rebind_to:
|
|
||||||
mpl::eval_if_c<
|
|
||||||
is_partial_std_allocator<Allocator>::value,
|
|
||||||
partial_std_allocator_rebind_to<Allocator,Type>,
|
|
||||||
compliant_allocator_rebind_to<Allocator,Type>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
/* allocator-independent versions of construct and destroy */
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
void construct(void* p,const Type& t)
|
|
||||||
{
|
|
||||||
new (p) Type(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
|
|
||||||
/* MSVC++ issues spurious warnings about unreferencend formal parameters
|
|
||||||
* in destroy<Type> when Type is a class with trivial dtor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable:4100)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
void destroy(const Type* p)
|
|
||||||
{
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
|
|
||||||
const_cast<Type*>(p)->~Type();
|
|
||||||
#else
|
|
||||||
p->~Type();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
|
|
||||||
#pragma warning(pop)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} /* namespace boost::detail::allocator */
|
|
||||||
|
|
||||||
} /* namespace boost::detail */
|
|
||||||
|
|
||||||
} /* namespace boost */
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,7 +1,8 @@
|
|||||||
// Copyright (c) 2000 David Abrahams.
|
// Copyright (c) 2000 David Abrahams. Permission to copy, use, modify,
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// sell and distribute this software is granted provided this
|
||||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
// copyright notice appears in all copies. This software is provided
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
// Copyright (c) 1994
|
// Copyright (c) 1994
|
||||||
// Hewlett-Packard Company
|
// Hewlett-Packard Company
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
// boost/detail/bitmask.hpp ------------------------------------------------//
|
|
||||||
|
|
||||||
// Copyright Beman Dawes 2006
|
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
// Usage: enum foo { a=1, b=2, c=4 };
|
|
||||||
// BOOST_BITMASK( foo );
|
|
||||||
//
|
|
||||||
// void f( foo arg );
|
|
||||||
// ...
|
|
||||||
// f( a | c );
|
|
||||||
|
|
||||||
#ifndef BOOST_BITMASK_HPP
|
|
||||||
#define BOOST_BITMASK_HPP
|
|
||||||
|
|
||||||
#include <boost/cstdint.hpp>
|
|
||||||
|
|
||||||
#define BOOST_BITMASK(Bitmask) \
|
|
||||||
\
|
|
||||||
inline Bitmask operator| (Bitmask x , Bitmask y ) \
|
|
||||||
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
|
||||||
| static_cast<boost::int_least32_t>(y)); } \
|
|
||||||
\
|
|
||||||
inline Bitmask operator& (Bitmask x , Bitmask y ) \
|
|
||||||
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
|
||||||
& static_cast<boost::int_least32_t>(y)); } \
|
|
||||||
\
|
|
||||||
inline Bitmask operator^ (Bitmask x , Bitmask y ) \
|
|
||||||
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
|
||||||
^ static_cast<boost::int_least32_t>(y)); } \
|
|
||||||
\
|
|
||||||
inline Bitmask operator~ (Bitmask x ) \
|
|
||||||
{ return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
|
|
||||||
\
|
|
||||||
inline Bitmask & operator&=(Bitmask & x , Bitmask y) \
|
|
||||||
{ x = x & y ; return x ; } \
|
|
||||||
\
|
|
||||||
inline Bitmask & operator|=(Bitmask & x , Bitmask y) \
|
|
||||||
{ x = x | y ; return x ; } \
|
|
||||||
\
|
|
||||||
inline Bitmask & operator^=(Bitmask & x , Bitmask y) \
|
|
||||||
{ x = x ^ y ; return x ; }
|
|
||||||
|
|
||||||
#endif // BOOST_BITMASK_HPP
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
|||||||
// boost/catch_exceptions.hpp -----------------------------------------------//
|
// boost/catch_exceptions.hpp -----------------------------------------------//
|
||||||
|
|
||||||
// Copyright Beman Dawes 1995-2001. Distributed under the Boost
|
// (C) Copyright Beman Dawes 1995-2001. Permission to copy, use, modify, sell
|
||||||
// Software License, Version 1.0. (See accompanying file
|
// and distribute this software is granted provided this copyright notice
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// appears in all copies. This software is provided "as is" without express or
|
||||||
|
// implied warranty, and with no claim as to its suitability for any purpose.
|
||||||
|
|
||||||
// See http://www.boost.org/libs/test for documentation.
|
// See http://www.boost.org for updates, documentation, and revision history.
|
||||||
|
|
||||||
// Revision History
|
// Revision History
|
||||||
// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones)
|
// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones)
|
||||||
|
@ -1,162 +0,0 @@
|
|||||||
|
|
||||||
// Copyright 2005-2011 Daniel James.
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// Note: if you change this include guard, you also need to change
|
|
||||||
// container_fwd_compile_fail.cpp
|
|
||||||
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
|
|
||||||
#define BOOST_DETAIL_CONTAINER_FWD_HPP
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) && \
|
|
||||||
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#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(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__)
|
|
||||||
// Comeau STL:
|
|
||||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
|
||||||
# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
|
|
||||||
// Rogue Wave library:
|
|
||||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
|
||||||
# elif defined(_LIBCPP_VERSION)
|
|
||||||
// libc++
|
|
||||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
|
||||||
# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
|
||||||
// GNU libstdc++ 3
|
|
||||||
//
|
|
||||||
// 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 couple of odd
|
|
||||||
// implementations.
|
|
||||||
# define BOOST_CONTAINER_FWD_BAD_BITSET
|
|
||||||
# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
|
|
||||||
# define BOOST_CONTAINER_FWD_BAD_DEQUE
|
|
||||||
# endif
|
|
||||||
# elif defined(__MSL_CPP__)
|
|
||||||
// MSL standard lib:
|
|
||||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
|
||||||
# elif defined(__IBMCPP__)
|
|
||||||
// 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)
|
|
||||||
# else
|
|
||||||
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
|
||||||
|
|
||||||
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
|
|
||||||
!defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
|
|
||||||
|
|
||||||
#include <deque>
|
|
||||||
#include <list>
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
#include <set>
|
|
||||||
#include <bitset>
|
|
||||||
#include <string>
|
|
||||||
#include <complex>
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
|
|
||||||
#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
|
||||||
#include <deque>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
|
|
||||||
#include <bitset>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
template <class T> class allocator;
|
|
||||||
template <class charT, class traits, class Allocator> class basic_string;
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
|
||||||
|
|
||||||
template <class charT> struct string_char_traits;
|
|
||||||
#else
|
|
||||||
template <class charT> struct char_traits;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#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;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class T, class Allocator> class list;
|
|
||||||
template <class T, class Allocator> class vector;
|
|
||||||
template <class Key, class T, class Compare, class Allocator> class map;
|
|
||||||
template <class Key, class T, class Compare, class Allocator>
|
|
||||||
class multimap;
|
|
||||||
template <class Key, class Compare, class Allocator> class set;
|
|
||||||
template <class Key, class Compare, class Allocator> class multiset;
|
|
||||||
|
|
||||||
#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
|
|
||||||
template <size_t N> class bitset;
|
|
||||||
#endif
|
|
||||||
template <class T1, class T2> struct pair;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
|
||||||
#pragma warning(pop)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_NO_CONTAINER_FWD &&
|
|
||||||
// !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_TEST_CONFIG_ONLY
|
|
||||||
|
|
||||||
#endif
|
|
@ -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
|
|
@ -1,74 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
Copyright (c) 2010 Bryce Lelbach
|
|
||||||
|
|
||||||
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_NO_FENV_H)
|
|
||||||
#error This platform does not have a floating point environment
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(BOOST_DETAIL_FENV_HPP)
|
|
||||||
#define BOOST_DETAIL_FENV_HPP
|
|
||||||
|
|
||||||
/* 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 */ \
|
|
||||||
defined(__GLIBC__) && /* version 6 + */ \
|
|
||||||
!defined(_FENV_H)
|
|
||||||
#define _FENV_H
|
|
||||||
|
|
||||||
#include <features.h>
|
|
||||||
#include <bits/fenv.h>
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
extern int fegetexceptflag (fexcept_t*, int) __THROW;
|
|
||||||
extern int fesetexceptflag (__const fexcept_t*, int) __THROW;
|
|
||||||
extern int feclearexcept (int) __THROW;
|
|
||||||
extern int feraiseexcept (int) __THROW;
|
|
||||||
extern int fetestexcept (int) __THROW;
|
|
||||||
extern int fegetround (void) __THROW;
|
|
||||||
extern int fesetround (int) __THROW;
|
|
||||||
extern int fegetenv (fenv_t*) __THROW;
|
|
||||||
extern int fesetenv (__const fenv_t*) __THROW;
|
|
||||||
extern int feupdateenv (__const fenv_t*) __THROW;
|
|
||||||
extern int feholdexcept (fenv_t*) __THROW;
|
|
||||||
|
|
||||||
#ifdef __USE_GNU
|
|
||||||
extern int feenableexcept (int) __THROW;
|
|
||||||
extern int fedisableexcept (int) __THROW;
|
|
||||||
extern int fegetexcept (void) __THROW;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace std { namespace tr1 {
|
|
||||||
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 */
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
// (C) Copyright Matthias Troyerk 2006.
|
|
||||||
// Use, modification and distribution are subject to the Boost Software License,
|
|
||||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt).
|
|
||||||
//
|
|
||||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
|
|
||||||
|
|
||||||
#include <boost/type_traits/has_trivial_constructor.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
/// type trait to check for a default constructor
|
|
||||||
///
|
|
||||||
/// The default implementation just checks for a trivial constructor.
|
|
||||||
/// Using some compiler magic it might be possible to provide a better default
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct has_default_constructor
|
|
||||||
: public has_trivial_constructor<T>
|
|
||||||
{};
|
|
||||||
|
|
||||||
} } // namespace boost::detail
|
|
||||||
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
|
|
@ -1,89 +0,0 @@
|
|||||||
// boost/identifier.hpp ----------------------------------------------------//
|
|
||||||
|
|
||||||
// Copyright Beman Dawes 2006
|
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// See documentation at http://www.boost.org/libs/utility
|
|
||||||
|
|
||||||
#ifndef BOOST_IDENTIFIER_HPP
|
|
||||||
#define BOOST_IDENTIFIER_HPP
|
|
||||||
|
|
||||||
#include <boost/utility/enable_if.hpp>
|
|
||||||
#include <boost/type_traits/is_base_of.hpp>
|
|
||||||
#include <iosfwd>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
// class template identifier ---------------------------------------------//
|
|
||||||
|
|
||||||
// Always used as a base class so that different instantiations result in
|
|
||||||
// different class types even if instantiated with the same value type T.
|
|
||||||
|
|
||||||
// Expected usage is that T is often an integer type, best passed by
|
|
||||||
// value. There is no reason why T can't be a possibly larger class such as
|
|
||||||
// std::string, best passed by const reference.
|
|
||||||
|
|
||||||
// This implementation uses pass by value, based on expected common uses.
|
|
||||||
|
|
||||||
template <typename T, typename D>
|
|
||||||
class identifier
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef T value_type;
|
|
||||||
|
|
||||||
const value_type value() const { return m_value; }
|
|
||||||
void assign( value_type v ) { m_value = v; }
|
|
||||||
|
|
||||||
bool operator==( const D & rhs ) const { return m_value == rhs.m_value; }
|
|
||||||
bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; }
|
|
||||||
bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; }
|
|
||||||
bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; }
|
|
||||||
bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; }
|
|
||||||
bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; }
|
|
||||||
|
|
||||||
typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type
|
|
||||||
static void unspecified_bool_true(D){} // conversion allows relational operators
|
|
||||||
// between different identifier types
|
|
||||||
|
|
||||||
operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; }
|
|
||||||
bool operator!() const { return m_value == value_type(); }
|
|
||||||
|
|
||||||
// constructors are protected so that class can only be used as a base class
|
|
||||||
protected:
|
|
||||||
identifier() {}
|
|
||||||
explicit identifier( value_type v ) : m_value(v) {}
|
|
||||||
|
|
||||||
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround
|
|
||||||
private:
|
|
||||||
#endif
|
|
||||||
T m_value;
|
|
||||||
};
|
|
||||||
|
|
||||||
//#ifndef BOOST_NO_SFINAE
|
|
||||||
|
|
||||||
// template <class Ostream, class Id>
|
|
||||||
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
|
|
||||||
// Ostream & >::type operator<<( Ostream & os, const Id & id )
|
|
||||||
// {
|
|
||||||
// return os << id.value();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// template <class Istream, class Id>
|
|
||||||
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
|
|
||||||
// Istream & >::type operator>>( Istream & is, Id & id )
|
|
||||||
// {
|
|
||||||
// typename Id::value_type v;
|
|
||||||
// is >> v;
|
|
||||||
// id.value( v );
|
|
||||||
// return is;
|
|
||||||
// }
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_IDENTIFIER_HPP
|
|
@ -1,487 +0,0 @@
|
|||||||
// 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)
|
|
||||||
#ifndef INDIRECT_TRAITS_DWA2002131_HPP
|
|
||||||
# define INDIRECT_TRAITS_DWA2002131_HPP
|
|
||||||
# include <boost/type_traits/is_function.hpp>
|
|
||||||
# include <boost/type_traits/is_reference.hpp>
|
|
||||||
# include <boost/type_traits/is_pointer.hpp>
|
|
||||||
# include <boost/type_traits/is_class.hpp>
|
|
||||||
# include <boost/type_traits/is_const.hpp>
|
|
||||||
# include <boost/type_traits/is_volatile.hpp>
|
|
||||||
# include <boost/type_traits/is_member_function_pointer.hpp>
|
|
||||||
# include <boost/type_traits/is_member_pointer.hpp>
|
|
||||||
# include <boost/type_traits/remove_cv.hpp>
|
|
||||||
# include <boost/type_traits/remove_reference.hpp>
|
|
||||||
# include <boost/type_traits/remove_pointer.hpp>
|
|
||||||
|
|
||||||
# include <boost/type_traits/detail/ice_and.hpp>
|
|
||||||
# include <boost/detail/workaround.hpp>
|
|
||||||
|
|
||||||
# include <boost/mpl/eval_if.hpp>
|
|
||||||
# include <boost/mpl/if.hpp>
|
|
||||||
# include <boost/mpl/bool.hpp>
|
|
||||||
# include <boost/mpl/and.hpp>
|
|
||||||
# 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_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_const<T const&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
|
|
||||||
template<class T>
|
|
||||||
struct is_reference_to_const<T const volatile&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
# endif
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function : mpl::false_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function<T&> : is_function<T>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_function : mpl::false_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// There's no such thing as a pointer-to-cv-function, so we don't need
|
|
||||||
// specializations for those
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_function<T*> : is_function<T>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_member_function_pointer_impl : mpl::false_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_member_function_pointer_impl<T&>
|
|
||||||
: is_member_function_pointer<typename remove_cv<T>::type>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_member_function_pointer
|
|
||||||
: is_reference_to_member_function_pointer_impl<T>
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function_pointer_aux
|
|
||||||
: mpl::and_<
|
|
||||||
is_reference<T>
|
|
||||||
, is_pointer_to_function<
|
|
||||||
typename remove_cv<
|
|
||||||
typename remove_reference<T>::type
|
|
||||||
>::type
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
// There's no such thing as a pointer-to-cv-function, so we don't need specializations for those
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function_pointer
|
|
||||||
: mpl::if_<
|
|
||||||
is_reference_to_function<T>
|
|
||||||
, mpl::false_
|
|
||||||
, is_reference_to_function_pointer_aux<T>
|
|
||||||
>::type
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_non_const
|
|
||||||
: mpl::and_<
|
|
||||||
is_reference<T>
|
|
||||||
, mpl::not_<
|
|
||||||
is_reference_to_const<T>
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_volatile : mpl::false_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_volatile<T volatile&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_volatile<T const volatile&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
# endif
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_pointer : mpl::false_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_pointer<T*&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_pointer<T* const&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_pointer<T* volatile&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_pointer<T* const volatile&> : mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_class
|
|
||||||
: mpl::and_<
|
|
||||||
is_reference<T>
|
|
||||||
, is_class<
|
|
||||||
typename remove_cv<
|
|
||||||
typename remove_reference<T>::type
|
|
||||||
>::type
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_class
|
|
||||||
: mpl::and_<
|
|
||||||
is_pointer<T>
|
|
||||||
, is_class<
|
|
||||||
typename remove_cv<
|
|
||||||
typename remove_pointer<T>::type
|
|
||||||
>::type
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace indirect_traits;
|
|
||||||
|
|
||||||
}} // namespace boost::python::detail
|
|
||||||
|
|
||||||
#endif // INDIRECT_TRAITS_DWA2002131_HPP
|
|
@ -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
|
|
@ -1,134 +0,0 @@
|
|||||||
// 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)
|
|
||||||
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
|
||||||
# define IS_INCREMENTABLE_DWA200415_HPP
|
|
||||||
|
|
||||||
# include <boost/type_traits/detail/template_arity_spec.hpp>
|
|
||||||
# include <boost/type_traits/remove_cv.hpp>
|
|
||||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
|
||||||
# include <boost/mpl/bool.hpp>
|
|
||||||
# include <boost/detail/workaround.hpp>
|
|
||||||
|
|
||||||
// Must be the last include
|
|
||||||
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
// is_incrementable<T> metafunction
|
|
||||||
//
|
|
||||||
// Requires: Given x of type T&, if the expression ++x is well-formed
|
|
||||||
// it must have complete type; otherwise, it must neither be ambiguous
|
|
||||||
// nor violate access.
|
|
||||||
|
|
||||||
// This namespace ensures that ADL doesn't mess things up.
|
|
||||||
namespace is_incrementable_
|
|
||||||
{
|
|
||||||
// a type returned from operator++ when no increment is found in the
|
|
||||||
// type's own namespace
|
|
||||||
struct tag {};
|
|
||||||
|
|
||||||
// any soaks up implicit conversions and makes the following
|
|
||||||
// operator++ less-preferred than any other such operator that
|
|
||||||
// might be found via ADL.
|
|
||||||
struct any { template <class T> any(T const&); };
|
|
||||||
|
|
||||||
// This is a last-resort operator++ for when none other is found
|
|
||||||
# if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace is_incrementable_2
|
|
||||||
{
|
|
||||||
is_incrementable_::tag operator++(is_incrementable_::any const&);
|
|
||||||
is_incrementable_::tag operator++(is_incrementable_::any const&,int);
|
|
||||||
}
|
|
||||||
using namespace is_incrementable_2;
|
|
||||||
|
|
||||||
namespace is_incrementable_
|
|
||||||
{
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
tag operator++(any const&);
|
|
||||||
tag operator++(any const&,int);
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
|
||||||
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
|
||||||
# define BOOST_comma(a,b) (a)
|
|
||||||
# else
|
|
||||||
// In case an operator++ is found that returns void, we'll use ++x,0
|
|
||||||
tag operator,(tag,int);
|
|
||||||
# define BOOST_comma(a,b) (a,b)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined(BOOST_MSVC)
|
|
||||||
# pragma warning(push)
|
|
||||||
# pragma warning(disable:4913) // Warning about operator,
|
|
||||||
# endif
|
|
||||||
|
|
||||||
// two check overloads help us identify which operator++ was picked
|
|
||||||
char (& check_(tag) )[2];
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
char check_(T const&);
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct impl
|
|
||||||
{
|
|
||||||
static typename boost::remove_cv<T>::type& x;
|
|
||||||
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool
|
|
||||||
, value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct postfix_impl
|
|
||||||
{
|
|
||||||
static typename boost::remove_cv<T>::type& x;
|
|
||||||
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool
|
|
||||||
, value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
# if defined(BOOST_MSVC)
|
|
||||||
# pragma warning(pop)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# undef BOOST_comma
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
struct is_incrementable
|
|
||||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
|
||||||
{
|
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::impl<T>::value)
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
struct is_postfix_incrementable
|
|
||||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
|
||||||
{
|
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl<T>::value)
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_incrementable)
|
|
||||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
# include <boost/type_traits/detail/bool_trait_undef.hpp>
|
|
||||||
|
|
||||||
#endif // IS_INCREMENTABLE_DWA200415_HPP
|
|
@ -1,56 +0,0 @@
|
|||||||
/*==============================================================================
|
|
||||||
Copyright (c) 2010-2011 Bryce Lelbach
|
|
||||||
|
|
||||||
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_DETAIL_SORTED_HPP
|
|
||||||
#define BOOST_DETAIL_SORTED_HPP
|
|
||||||
|
|
||||||
#include <boost/detail/iterator.hpp>
|
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
template<class Iterator, class Comp>
|
|
||||||
inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) {
|
|
||||||
if (first == last)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
Iterator it = first; ++it;
|
|
||||||
|
|
||||||
for (; it != last; first = it, ++it)
|
|
||||||
if (c(*it, *first))
|
|
||||||
return it;
|
|
||||||
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Iterator>
|
|
||||||
inline Iterator is_sorted_until (Iterator first, Iterator last) {
|
|
||||||
typedef typename boost::detail::iterator_traits<Iterator>::value_type
|
|
||||||
value_type;
|
|
||||||
|
|
||||||
typedef std::less<value_type> c;
|
|
||||||
|
|
||||||
return ::boost::detail::is_sorted_until(first, last, c());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Iterator, class Comp>
|
|
||||||
inline bool is_sorted (Iterator first, Iterator last, Comp c) {
|
|
||||||
return ::boost::detail::is_sorted_until(first, last, c) == last;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Iterator>
|
|
||||||
inline bool is_sorted (Iterator first, Iterator last) {
|
|
||||||
return ::boost::detail::is_sorted_until(first, last) == last;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // detail
|
|
||||||
} // boost
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_SORTED_HPP
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
|||||||
// Copyright David Abrahams 2005. 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_DETAIL_IS_XXX_DWA20051011_HPP
|
|
||||||
# define BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
|
||||||
|
|
||||||
# include <boost/config.hpp>
|
|
||||||
# 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> \
|
|
||||||
struct is_##name : mpl::false_ \
|
|
||||||
{ \
|
|
||||||
}; \
|
|
||||||
\
|
|
||||||
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
|
|
||||||
struct is_##name< \
|
|
||||||
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
|
|
||||||
> \
|
|
||||||
: mpl::true_ \
|
|
||||||
{ \
|
|
||||||
};
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
|
@ -1,7 +1,8 @@
|
|||||||
// (C) Copyright David Abrahams 2002.
|
// (C) Copyright David Abrahams 2001. Permission to copy, use, modify,
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// sell and distribute this software is granted provided this
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// copyright notice appears in all copies. This software is provided
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
|
|
||||||
// Boost versions of
|
// Boost versions of
|
||||||
//
|
//
|
||||||
@ -19,6 +20,11 @@
|
|||||||
// std::iterator_traits<X>::pointer
|
// std::iterator_traits<X>::pointer
|
||||||
// std::iterator_traits<X>::reference
|
// std::iterator_traits<X>::reference
|
||||||
//
|
//
|
||||||
|
// CAVEAT: When using the VC6 standard library, an iterator derived from
|
||||||
|
// std::iterator but not boost::iterator or from one supplied by the standard
|
||||||
|
// will always have pointer == const value_type* and reference == const
|
||||||
|
// value_type&, whether that's correct or not.
|
||||||
|
|
||||||
// See http://www.boost.org for most recent version including documentation.
|
// See http://www.boost.org for most recent version including documentation.
|
||||||
|
|
||||||
// Revision History
|
// Revision History
|
||||||
@ -51,7 +57,17 @@
|
|||||||
# define ITERATOR_DWA122600_HPP_
|
# define ITERATOR_DWA122600_HPP_
|
||||||
|
|
||||||
# include <boost/config.hpp>
|
# include <boost/config.hpp>
|
||||||
|
# include <boost/type_traits.hpp>
|
||||||
|
# include <boost/iterator.hpp>
|
||||||
# include <iterator>
|
# include <iterator>
|
||||||
|
# include <cstddef>
|
||||||
|
|
||||||
|
# if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
|
||||||
|
# include <xtree>
|
||||||
|
# include <deque>
|
||||||
|
# include <list>
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
// STLPort 4.0 and betas have a bug when debugging is enabled and there is no
|
// 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
|
// partial specialization: instead of an iterator_category typedef, the standard
|
||||||
@ -60,9 +76,9 @@
|
|||||||
// Also, whether debugging is enabled or not, there is a broken specialization
|
// 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
|
// of std::iterator<output_iterator_tag,void,void,void,void> which has no
|
||||||
// typedefs but iterator_category.
|
// typedefs but iterator_category.
|
||||||
# if defined(__SGI_STL_PORT)
|
# if defined(__SGI_STL_PORT) && (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
|
||||||
|
|
||||||
# if (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && defined(__STL_DEBUG)
|
# ifdef __STL_DEBUG
|
||||||
# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -70,423 +86,298 @@
|
|||||||
|
|
||||||
# endif // STLPort <= 4.1b4 && no partial 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 {
|
namespace boost { namespace detail {
|
||||||
|
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
|
||||||
// Define a new template so it can be specialized
|
using std::iterator_traits;
|
||||||
template <class Iterator>
|
|
||||||
struct iterator_traits
|
|
||||||
: std::iterator_traits<Iterator>
|
|
||||||
{};
|
|
||||||
using std::distance;
|
using std::distance;
|
||||||
|
|
||||||
}} // namespace boost::detail
|
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
|
||||||
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
namespace iterator_traits_ {
|
||||||
&& !defined(BOOST_MSVC_STD_ITERATOR)
|
|
||||||
|
|
||||||
// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS
|
// Workarounds for less-capable implementations
|
||||||
|
template <bool is_ptr> struct iterator_traits_select;
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
template <class T> struct undefined;
|
||||||
|
template <> struct iterator_traits_select<true>
|
||||||
|
{
|
||||||
|
template <class Ptr>
|
||||||
|
struct traits
|
||||||
|
{
|
||||||
|
typedef std::ptrdiff_t difference_type;
|
||||||
|
typedef std::random_access_iterator_tag iterator_category;
|
||||||
|
typedef Ptr pointer;
|
||||||
|
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||||
|
// Keeps MSVC happy under certain circumstances. It seems class template default
|
||||||
|
// arguments are partly instantiated even when not used when the class template
|
||||||
|
// is the return type of a function template.
|
||||||
|
typedef undefined<void> value_type;
|
||||||
|
typedef undefined<void> reference;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef char yes_type;
|
||||||
|
typedef double no_type;
|
||||||
|
|
||||||
|
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||||
|
|
||||||
|
no_type bad_category_helper(...);
|
||||||
|
template <class C, class T> yes_type bad_category_helper(std::_DBG_iter<C,T>*);
|
||||||
|
|
||||||
|
template <bool has_bad_category_typedef> struct bad_category_select;
|
||||||
|
template <>
|
||||||
|
struct bad_category_select<true>
|
||||||
|
{
|
||||||
|
template <class Iterator>
|
||||||
|
struct category { typedef typename Iterator::_Iterator_category type; };
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct bad_category_select<false>
|
||||||
|
{
|
||||||
|
template <class Iterator>
|
||||||
|
struct category { typedef typename Iterator::iterator_category type; };
|
||||||
|
};
|
||||||
|
|
||||||
// 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>
|
template <class Iterator>
|
||||||
struct iterator_traits
|
struct iterator_category_select
|
||||||
{
|
{
|
||||||
typedef typename Iterator::value_type value_type;
|
private:
|
||||||
typedef typename Iterator::reference reference;
|
static Iterator p;
|
||||||
typedef typename Iterator::pointer pointer;
|
enum { has_bad_category
|
||||||
typedef typename Iterator::difference_type difference_type;
|
= sizeof(bad_category_helper(&p)) == sizeof(yes_type) };
|
||||||
typedef typename Iterator::iterator_category iterator_category;
|
typedef bad_category_select<has_bad_category> category_select;
|
||||||
|
public:
|
||||||
|
typedef typename category_select::template category<Iterator>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
# endif
|
||||||
|
|
||||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||||
# include <boost/type_traits/is_base_and_derived.hpp>
|
template <bool is_bad_output_iterator> struct bad_output_iterator_select;
|
||||||
|
template <>
|
||||||
|
struct bad_output_iterator_select<true>
|
||||||
|
{
|
||||||
|
template <class Iterator>
|
||||||
|
struct non_category_traits {
|
||||||
|
typedef void value_type;
|
||||||
|
typedef void difference_type;
|
||||||
|
typedef void pointer;
|
||||||
|
typedef void reference;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
template <>
|
||||||
|
struct bad_output_iterator_select<false>
|
||||||
|
{
|
||||||
|
template <class Iterator>
|
||||||
|
struct non_category_traits {
|
||||||
|
typedef typename Iterator::value_type value_type;
|
||||||
|
typedef typename Iterator::difference_type difference_type;
|
||||||
|
typedef typename Iterator::pointer pointer;
|
||||||
|
typedef typename Iterator::reference reference;
|
||||||
|
};
|
||||||
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# include <boost/mpl/if.hpp>
|
# if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
|
||||||
# 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
|
// We'll sort iterator types into one of these classifications, from which we
|
||||||
// can determine the difference_type, pointer, reference, and value_type
|
// can determine the difference_type, pointer, reference, and value_type
|
||||||
template <class Iterator>
|
enum {
|
||||||
struct standard_iterator_traits
|
not_msvc_stdlib_iterator,
|
||||||
|
msvc_stdlib_const_iterator,
|
||||||
|
msvc_stdlib_mutable_iterator,
|
||||||
|
msvc_stdlib_ostream_iterator
|
||||||
|
};
|
||||||
|
|
||||||
|
template <unsigned> struct msvc_traits_select;
|
||||||
|
|
||||||
|
template <> struct msvc_traits_select<not_msvc_stdlib_iterator>
|
||||||
{
|
{
|
||||||
typedef typename Iterator::difference_type difference_type;
|
template <class Iterator>
|
||||||
typedef typename Iterator::value_type value_type;
|
struct traits_ // calling this "traits" will confuse VC.
|
||||||
typedef typename Iterator::pointer pointer;
|
{
|
||||||
typedef typename Iterator::reference reference;
|
typedef typename Iterator::difference_type difference_type;
|
||||||
typedef typename Iterator::iterator_category iterator_category;
|
typedef typename Iterator::value_type value_type;
|
||||||
|
typedef typename Iterator::pointer pointer;
|
||||||
|
typedef typename Iterator::reference reference;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Iterator>
|
template <> struct msvc_traits_select<msvc_stdlib_mutable_iterator>
|
||||||
struct msvc_stdlib_mutable_traits
|
|
||||||
: std::iterator_traits<Iterator>
|
|
||||||
{
|
{
|
||||||
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
|
template <class Iterator>
|
||||||
typedef typename std::iterator_traits<Iterator>::value_type* pointer;
|
struct traits_
|
||||||
typedef typename std::iterator_traits<Iterator>::value_type& reference;
|
{
|
||||||
|
typedef typename Iterator::distance_type difference_type;
|
||||||
|
typedef typename Iterator::value_type value_type;
|
||||||
|
typedef value_type* pointer;
|
||||||
|
typedef value_type& reference;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Iterator>
|
template <> struct msvc_traits_select<msvc_stdlib_const_iterator>
|
||||||
struct msvc_stdlib_const_traits
|
|
||||||
: std::iterator_traits<Iterator>
|
|
||||||
{
|
{
|
||||||
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
|
template <class Iterator>
|
||||||
typedef const typename std::iterator_traits<Iterator>::value_type* pointer;
|
struct traits_
|
||||||
typedef const typename std::iterator_traits<Iterator>::value_type& reference;
|
{
|
||||||
|
typedef typename Iterator::distance_type difference_type;
|
||||||
|
typedef typename Iterator::value_type value_type;
|
||||||
|
typedef const value_type* pointer;
|
||||||
|
typedef const value_type& reference;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
template <> struct msvc_traits_select<msvc_stdlib_ostream_iterator>
|
||||||
template <class Iterator>
|
|
||||||
struct is_bad_output_iterator
|
|
||||||
: is_base_and_derived<
|
|
||||||
std::iterator<std::output_iterator_tag,void,void,void,void>
|
|
||||||
, Iterator>
|
|
||||||
{
|
{
|
||||||
|
template <class Iterator>
|
||||||
|
struct traits_
|
||||||
|
{
|
||||||
|
typedef typename Iterator::distance_type difference_type;
|
||||||
|
typedef typename Iterator::value_type value_type;
|
||||||
|
typedef void pointer;
|
||||||
|
typedef void reference;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bad_output_iterator_traits
|
// These functions allow us to detect which classification a given iterator type
|
||||||
{
|
// falls into.
|
||||||
typedef void value_type;
|
|
||||||
typedef void difference_type;
|
// Is the iterator derived from std::iterator?
|
||||||
typedef std::output_iterator_tag iterator_category;
|
no_type is_std_iterator_helper(...);
|
||||||
typedef void pointer;
|
template <class V, class D, class C>
|
||||||
typedef void reference;
|
yes_type is_std_iterator_helper(const volatile std::iterator<V,D,C>*);
|
||||||
|
|
||||||
|
// Is the iterator derived from boost::iterator?
|
||||||
|
template <class C, class T, class D, class P, class R>
|
||||||
|
yes_type is_boost_iterator_helper(const volatile boost::iterator<C,T,D,P,R>*);
|
||||||
|
no_type is_boost_iterator_helper(...);
|
||||||
|
|
||||||
|
// Is the iterator one of the known mutable container iterators?
|
||||||
|
template<class K, class Ty, class Kfn, class Pr, class A>
|
||||||
|
yes_type is_mutable_iterator_helper(const volatile typename std::_Tree<K,Ty,Kfn,Pr,A>::iterator*);
|
||||||
|
template<class Ty, class A>
|
||||||
|
yes_type is_mutable_iterator_helper(const volatile typename std::list<Ty,A>::iterator*);
|
||||||
|
template<class Ty, class A>
|
||||||
|
yes_type is_mutable_iterator_helper(const volatile typename std::deque<Ty,A>::iterator*);
|
||||||
|
no_type is_mutable_iterator_helper(...);
|
||||||
|
|
||||||
|
// Is the iterator an ostream_iterator?
|
||||||
|
template<class T, class CharT, class Traits>
|
||||||
|
yes_type is_ostream_iterator_helper(const volatile std::ostream_iterator<T,CharT,Traits>*);
|
||||||
|
no_type is_ostream_iterator_helper(...);
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct msvc_iterator_classification {
|
||||||
|
BOOST_STATIC_CONSTANT(unsigned,
|
||||||
|
value = (sizeof(is_ostream_iterator_helper((T*)0)) == sizeof(yes_type))
|
||||||
|
? msvc_stdlib_ostream_iterator
|
||||||
|
: (sizeof(is_mutable_iterator_helper((T*)0)) == sizeof(yes_type))
|
||||||
|
? msvc_stdlib_mutable_iterator
|
||||||
|
: (sizeof(is_std_iterator_helper((T*)0)) == sizeof(yes_type)
|
||||||
|
&& sizeof(is_boost_iterator_helper((T*)0)) == sizeof(no_type))
|
||||||
|
? msvc_stdlib_const_iterator
|
||||||
|
: not_msvc_stdlib_iterator
|
||||||
|
);
|
||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// If we're looking at an MSVC6 (old Dinkumware) ``standard''
|
template <> struct iterator_traits_select<false>
|
||||||
// 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 traits
|
||||||
template <class Iterator>
|
{
|
||||||
struct iterator_traits_aux
|
# if defined(BOOST_MSVC_STD_ITERATOR) && !defined(__SGI_STL_PORT)
|
||||||
: mpl::if_<
|
typedef msvc_traits_select<(
|
||||||
is_pointer<Iterator>
|
msvc_iterator_classification<Iterator>::value
|
||||||
, pointer_iterator_traits<Iterator>
|
)>::template traits_<Iterator> inner_traits;
|
||||||
, non_pointer_iterator_traits<Iterator>
|
|
||||||
>::type
|
typedef typename inner_traits::difference_type difference_type;
|
||||||
{
|
typedef typename inner_traits::value_type value_type;
|
||||||
};
|
typedef typename inner_traits::pointer pointer;
|
||||||
|
typedef typename inner_traits::reference reference;
|
||||||
template <class Iterator>
|
# elif !defined(BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION)
|
||||||
struct iterator_traits
|
typedef typename Iterator::difference_type difference_type;
|
||||||
{
|
typedef typename Iterator::value_type value_type;
|
||||||
// Explicit forwarding from base class needed to keep MSVC6 happy
|
typedef typename Iterator::pointer pointer;
|
||||||
// under some circumstances.
|
typedef typename Iterator::reference reference;
|
||||||
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
|
# else
|
||||||
typedef iterator_traits_aux<Iterator> base;
|
typedef bad_output_iterator_select<
|
||||||
|
is_convertible<const volatile Iterator*,
|
||||||
|
const volatile std::iterator<std::output_iterator_tag,void,void,void,void>*
|
||||||
|
>::value> non_category_traits_select;
|
||||||
|
typedef non_category_traits_select::template non_category_traits<Iterator> non_category_traits;
|
||||||
|
public:
|
||||||
|
typedef typename non_category_traits::value_type value_type;
|
||||||
|
typedef typename non_category_traits::difference_type difference_type;
|
||||||
|
typedef typename non_category_traits::pointer pointer;
|
||||||
|
typedef typename non_category_traits::reference reference;
|
||||||
# endif
|
# endif
|
||||||
public:
|
|
||||||
typedef typename base::value_type value_type;
|
# if !defined(BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF)
|
||||||
typedef typename base::pointer pointer;
|
typedef typename Iterator::iterator_category iterator_category;
|
||||||
typedef typename base::reference reference;
|
# else
|
||||||
typedef typename base::difference_type difference_type;
|
typedef typename iterator_category_select<Iterator>::type iterator_category;
|
||||||
typedef typename base::iterator_category iterator_category;
|
# endif
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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_
|
} // namespace boost::detail::iterator_traits_
|
||||||
|
|
||||||
template <class Iterator>
|
template <class Iterator>
|
||||||
inline typename iterator_traits<Iterator>::difference_type
|
struct iterator_traits
|
||||||
distance(Iterator first, Iterator last)
|
: iterator_traits_::iterator_traits_select<is_pointer<Iterator>::value>::template traits<Iterator>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
typedef typename iterator_traits_::iterator_traits_select<
|
||||||
|
is_pointer<remove_cv<Iterator>::type>::value>::template traits<Iterator> traits;
|
||||||
|
public:
|
||||||
|
// Why do I need to define these typedefs? It keeps MSVC happy somehow.
|
||||||
|
// Why don't I need to define the other typedefs? Who knows?!?
|
||||||
|
typedef typename traits::difference_type difference_type;
|
||||||
|
typedef typename traits::iterator_category iterator_category;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace iterator_traits_ {
|
||||||
|
|
||||||
|
template <class Category>
|
||||||
|
struct distance_select {
|
||||||
|
template <class Iterator>
|
||||||
|
static typename ::boost::detail::iterator_traits<Iterator>::difference_type
|
||||||
|
distance(Iterator i1, const Iterator i2)
|
||||||
|
{
|
||||||
|
typename ::boost::detail::iterator_traits<Iterator>::difference_type result = 0;
|
||||||
|
while (i1 != i2)
|
||||||
|
{
|
||||||
|
++i1;
|
||||||
|
++result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct distance_select<std::random_access_iterator_tag> {
|
||||||
|
template <class Iterator>
|
||||||
|
static typename ::boost::detail::iterator_traits<Iterator>::difference_type
|
||||||
|
distance(const Iterator i1, const Iterator i2)
|
||||||
|
{
|
||||||
|
return i2 - i1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace boost::detail::iterator_traits_
|
||||||
|
|
||||||
|
template <class Iterator>
|
||||||
|
inline typename ::boost::detail::iterator_traits<Iterator>::difference_type
|
||||||
|
distance(const Iterator& first, const Iterator& last)
|
||||||
{
|
{
|
||||||
typedef typename iterator_traits<Iterator>::difference_type diff_t;
|
|
||||||
typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category;
|
typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category;
|
||||||
|
return iterator_traits_::distance_select<iterator_category>::distance(first, last);
|
||||||
return iterator_traits_::distance_select<Iterator,diff_t>::execute(
|
|
||||||
first, last, (iterator_category*)0);
|
|
||||||
}
|
}
|
||||||
|
# endif // workarounds
|
||||||
|
|
||||||
}}
|
}} // namespace boost::detail
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
|
|
||||||
# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
||||||
# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
// boost/detail/lightweight_main.hpp -------------------------------------------------//
|
|
||||||
|
|
||||||
// Copyright Beman Dawes 2010
|
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
|
||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------//
|
|
||||||
// //
|
|
||||||
// exception reporting main() that calls cpp_main() //
|
|
||||||
// //
|
|
||||||
//--------------------------------------------------------------------------------------//
|
|
||||||
|
|
||||||
int cpp_main(int argc, char* argv[]);
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return cpp_main(argc, argv);
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (const std::exception& ex)
|
|
||||||
{
|
|
||||||
std::cout
|
|
||||||
<< "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n"
|
|
||||||
<< "\n****************************** std::exception *****************************\n"
|
|
||||||
<< ex.what()
|
|
||||||
<< "\n***************************************************************************\n"
|
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
@ -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,7 +1,8 @@
|
|||||||
// (C) Copyright Jeremy Siek 2001.
|
// (C) Copyright Jeremy Siek 2001. Permission to copy, use, modify,
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// sell and distribute this software is granted provided this
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// copyright notice appears in all copies. This software is provided
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
|
|
||||||
// Revision History:
|
// Revision History:
|
||||||
|
|
||||||
|
@ -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
|
|
@ -1,8 +1,15 @@
|
|||||||
// (C) Copyright David Abrahams 2001, Howard Hinnant 2001.
|
// (C) Copyright David Abrahams 2001. Permission to copy, use, modify,
|
||||||
|
// sell and distribute this software is granted provided this
|
||||||
|
// copyright notice appears in all copies. This software is provided
|
||||||
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Template class is_signed and its documentation is:
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// (C) Copyright Howard Hinnant 2001. Permission to copy, use, modify,
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// sell and distribute this software is granted provided this
|
||||||
|
// copyright notice appears in all copies. This software is provided
|
||||||
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
// Template class numeric_traits<Number> --
|
// Template class numeric_traits<Number> --
|
||||||
//
|
//
|
||||||
|
@ -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
|
|
@ -1,141 +0,0 @@
|
|||||||
//-----------------------------------------------------------------------------
|
|
||||||
// boost detail/reference_content.hpp header file
|
|
||||||
// See http://www.boost.org for updates, documentation, and revision history.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) 2003
|
|
||||||
// Eric Friedman
|
|
||||||
//
|
|
||||||
// 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_DETAIL_REFERENCE_CONTENT_HPP
|
|
||||||
#define BOOST_DETAIL_REFERENCE_CONTENT_HPP
|
|
||||||
|
|
||||||
#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"
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// (detail) class template reference_content
|
|
||||||
//
|
|
||||||
// Non-Assignable wrapper for references.
|
|
||||||
//
|
|
||||||
template <typename RefT>
|
|
||||||
class reference_content
|
|
||||||
{
|
|
||||||
private: // representation
|
|
||||||
|
|
||||||
RefT content_;
|
|
||||||
|
|
||||||
public: // structors
|
|
||||||
|
|
||||||
~reference_content()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
reference_content(RefT r)
|
|
||||||
: content_( r )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
reference_content(const reference_content& operand)
|
|
||||||
: content_( operand.content_ )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private: // non-Assignable
|
|
||||||
|
|
||||||
reference_content& operator=(const reference_content&);
|
|
||||||
|
|
||||||
public: // queries
|
|
||||||
|
|
||||||
RefT get() const
|
|
||||||
{
|
|
||||||
return content_;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// (detail) metafunction make_reference_content
|
|
||||||
//
|
|
||||||
// Wraps with reference_content if specified type is reference.
|
|
||||||
//
|
|
||||||
|
|
||||||
template <typename T = mpl::void_> struct make_reference_content;
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
struct make_reference_content
|
|
||||||
{
|
|
||||||
typedef T type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
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_ >
|
|
||||||
{
|
|
||||||
template <typename T>
|
|
||||||
struct apply
|
|
||||||
: make_reference_content<T>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef mpl::void_ type;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// reference_content<T&> type traits specializations
|
|
||||||
//
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
struct has_nothrow_copy<
|
|
||||||
::boost::detail::reference_content< T& >
|
|
||||||
>
|
|
||||||
: mpl::true_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP
|
|
@ -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
|
|
@ -1,7 +1,8 @@
|
|||||||
// (C) Copyright David Abrahams 2001.
|
// (C) Copyright David Abrahams 2001. Permission to copy, use, modify,
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// sell and distribute this software is granted provided this
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// copyright notice appears in all copies. This software is provided
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
// See http://www.boost.org for most recent version including documentation.
|
// See http://www.boost.org for most recent version including documentation.
|
||||||
|
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
//-----------------------------------------------------------------------------
|
|
||||||
// boost detail/templated_streams.hpp header file
|
|
||||||
// See http://www.boost.org for updates, documentation, and revision history.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) 2003
|
|
||||||
// Eric Friedman
|
|
||||||
//
|
|
||||||
// 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_DETAIL_TEMPLATED_STREAMS_HPP
|
|
||||||
#define BOOST_DETAIL_TEMPLATED_STREAMS_HPP
|
|
||||||
|
|
||||||
#include "boost/config.hpp"
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// (detail) BOOST_TEMPLATED_STREAM_* macros
|
|
||||||
//
|
|
||||||
// Provides workaround platforms without stream class templates.
|
|
||||||
//
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_STD_LOCALE)
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \
|
|
||||||
template < typename E , typename T >
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \
|
|
||||||
template < typename E , typename T , typename A >
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ARGS(E,T) \
|
|
||||||
typename E , typename T
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \
|
|
||||||
typename E , typename T , typename A
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_COMMA ,
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ELEM(E) E
|
|
||||||
#define BOOST_TEMPLATED_STREAM_TRAITS(T) T
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ALLOC(A) A
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM(X,E,T) \
|
|
||||||
BOOST_JOIN(std::basic_,X)< E , T >
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
|
|
||||||
BOOST_JOIN(std::basic_,X)< E , T , A >
|
|
||||||
|
|
||||||
#else // defined(BOOST_NO_STD_LOCALE)
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ARGS(E,T) /**/
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_COMMA /**/
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ELEM(E) char
|
|
||||||
#define BOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits<char>
|
|
||||||
#define BOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator<char>
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM(X,E,T) \
|
|
||||||
std::X
|
|
||||||
|
|
||||||
#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
|
|
||||||
std::X
|
|
||||||
|
|
||||||
#endif // BOOST_NO_STD_LOCALE
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_TEMPLATED_STREAMS_HPP
|
|
@ -1,191 +0,0 @@
|
|||||||
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
|
||||||
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#ifndef BOOST_UTF8_CODECVT_FACET_HPP
|
|
||||||
#define BOOST_UTF8_CODECVT_FACET_HPP
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
|
||||||
// utf8_codecvt_facet.hpp
|
|
||||||
|
|
||||||
// This header defines class utf8_codecvt_facet, derived fro
|
|
||||||
// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in
|
|
||||||
// files into wchar_t strings in the application.
|
|
||||||
//
|
|
||||||
// The header is NOT STANDALONE, and is not to be included by the USER.
|
|
||||||
// There are at least two libraries which want to use this functionality, and
|
|
||||||
// we want to avoid code duplication. It would be possible to create utf8
|
|
||||||
// library, but:
|
|
||||||
// - this requires review process first
|
|
||||||
// - in the case, when linking the a library which uses utf8
|
|
||||||
// (say 'program_options'), user should also link to the utf8 library.
|
|
||||||
// This seems inconvenient, and asking a user to link to an unrevieved
|
|
||||||
// library is strange.
|
|
||||||
// Until the above points are fixed, a library which wants to use utf8 must:
|
|
||||||
// - include this header from one of it's headers or sources
|
|
||||||
// - include the corresponding .cpp file from one of the sources
|
|
||||||
// - before including either file, the library must define
|
|
||||||
// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used
|
|
||||||
// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace
|
|
||||||
// - declaration.
|
|
||||||
// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable'
|
|
||||||
// symbols.
|
|
||||||
//
|
|
||||||
// For example, program_options library might contain:
|
|
||||||
// #define BOOST_UTF8_BEGIN_NAMESPACE <backslash character>
|
|
||||||
// namespace boost { namespace program_options {
|
|
||||||
// #define BOOST_UTF8_END_NAMESPACE }}
|
|
||||||
// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL
|
|
||||||
// #include "../../detail/utf8/utf8_codecvt.cpp"
|
|
||||||
//
|
|
||||||
// Essentially, each library will have its own copy of utf8 code, in
|
|
||||||
// different namespaces.
|
|
||||||
|
|
||||||
// Note:(Robert Ramey). I have made the following alterations in the original
|
|
||||||
// code.
|
|
||||||
// a) Rendered utf8_codecvt<wchar_t, char> with using templates
|
|
||||||
// b) Move longer functions outside class definition to prevent inlining
|
|
||||||
// and make code smaller
|
|
||||||
// c) added on a derived class to permit translation to/from current
|
|
||||||
// locale to utf8
|
|
||||||
|
|
||||||
// See http://www.boost.org for updates, documentation, and revision history.
|
|
||||||
|
|
||||||
// archives stored as text - note these ar templated on the basic
|
|
||||||
// stream templates to accommodate wide (and other?) kind of characters
|
|
||||||
//
|
|
||||||
// note the fact that on libraries without wide characters, ostream is
|
|
||||||
// is not a specialization of basic_ostream which in fact is not defined
|
|
||||||
// in such cases. So we can't use basic_ostream<OStream::char_type> but rather
|
|
||||||
// use two template parameters
|
|
||||||
//
|
|
||||||
// utf8_codecvt_facet
|
|
||||||
// This is an implementation of a std::codecvt facet for translating
|
|
||||||
// from UTF-8 externally to UCS-4. Note that this is not tied to
|
|
||||||
// any specific types in order to allow customization on platforms
|
|
||||||
// where wchar_t is not big enough.
|
|
||||||
//
|
|
||||||
// NOTES: The current implementation jumps through some unpleasant hoops in
|
|
||||||
// order to deal with signed character types. As a std::codecvt_base::result,
|
|
||||||
// it is necessary for the ExternType to be convertible to unsigned char.
|
|
||||||
// I chose not to tie the extern_type explicitly to char. But if any combination
|
|
||||||
// of types other than <wchar_t,char_t> is used, then std::codecvt must be
|
|
||||||
// specialized on those types for this to work.
|
|
||||||
|
|
||||||
#include <locale>
|
|
||||||
#include <cwchar> // for mbstate_t
|
|
||||||
#include <cstddef> // for std::size_t
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/detail/workaround.hpp>
|
|
||||||
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
|
||||||
namespace std {
|
|
||||||
using ::mbstate_t;
|
|
||||||
using ::size_t;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) \
|
|
||||||
&& !defined(_LIBCPP_VERSION)
|
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
|
||||||
#else
|
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// maximum lenght of a multibyte string
|
|
||||||
#define MB_LENGTH_MAX 8
|
|
||||||
|
|
||||||
BOOST_UTF8_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
struct BOOST_UTF8_DECL utf8_codecvt_facet :
|
|
||||||
public std::codecvt<wchar_t, char, std::mbstate_t>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit utf8_codecvt_facet(std::size_t no_locale_manage=0)
|
|
||||||
: std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
|
|
||||||
{}
|
|
||||||
protected:
|
|
||||||
virtual std::codecvt_base::result do_in(
|
|
||||||
std::mbstate_t& state,
|
|
||||||
const char * from,
|
|
||||||
const char * from_end,
|
|
||||||
const char * & from_next,
|
|
||||||
wchar_t * to,
|
|
||||||
wchar_t * to_end,
|
|
||||||
wchar_t*& to_next
|
|
||||||
) 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
|
|
||||||
) const;
|
|
||||||
|
|
||||||
bool invalid_continuing_octet(unsigned char octet_1) const {
|
|
||||||
return (octet_1 < 0x80|| 0xbf< octet_1);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool invalid_leading_octet(unsigned char octet_1) const {
|
|
||||||
return (0x7f < octet_1 && octet_1 < 0xc0) ||
|
|
||||||
(octet_1 > 0xfd);
|
|
||||||
}
|
|
||||||
|
|
||||||
// continuing octets = octets except for the leading 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);
|
|
||||||
|
|
||||||
// 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; }
|
|
||||||
|
|
||||||
// UTF-8 isn't really stateful since we rewind on partial conversions
|
|
||||||
virtual std::codecvt_base::result do_unshift(
|
|
||||||
std::mbstate_t&,
|
|
||||||
char * from,
|
|
||||||
char * /*to*/,
|
|
||||||
char * & next
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
next = from;
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual int do_encoding() const throw() {
|
|
||||||
const int variable_byte_external_encoding=0;
|
|
||||||
return variable_byte_external_encoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
// How many char objects can I process to get <= max_limit
|
|
||||||
// wchar_t objects?
|
|
||||||
virtual int do_length(
|
|
||||||
BOOST_CODECVT_DO_LENGTH_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;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Largest possible value do_length(state,from,from_end,1) could return.
|
|
||||||
virtual int do_max_length() const throw () {
|
|
||||||
return 6; // largest UTF-8 encoding of a UCS-4 character
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
BOOST_UTF8_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // BOOST_UTF8_CODECVT_FACET_HPP
|
|
@ -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,8 +1,4 @@
|
|||||||
// -*- C++ -*- forwarding header.
|
// -*- 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
|
#ifndef BOOST_CSTDDEF_HPP
|
||||||
#define BOOST_CSTDDEF_HPP
|
#define BOOST_CSTDDEF_HPP
|
||||||
|
101
include/boost/pending/ct_if.hpp
Normal file
101
include/boost/pending/ct_if.hpp
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, sell and
|
||||||
|
// distribute this software is granted provided this copyright notice appears
|
||||||
|
// in all copies. This software is provided "as is" without express or implied
|
||||||
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
|
|
||||||
|
// The ct_if implementation that avoids partial specialization is
|
||||||
|
// based on the IF class by Ulrich W. Eisenecker and Krzysztof
|
||||||
|
// Czarnecki.
|
||||||
|
|
||||||
|
#ifndef BOOST_CT_IF_HPP
|
||||||
|
#define BOOST_CT_IF_HPP
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
/*
|
||||||
|
There is a bug in the Borland compiler with regards to using
|
||||||
|
integers to specialize templates. This made it hard to use ct_if in
|
||||||
|
the graph library. Changing from 'ct_if' to 'ct_if_t' fixed the
|
||||||
|
problem.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
|
||||||
|
struct ct_if_error { };
|
||||||
|
|
||||||
|
struct true_type { enum { value = true }; };
|
||||||
|
struct false_type { enum { value = false }; };
|
||||||
|
|
||||||
|
template <class A, class B>
|
||||||
|
struct ct_and { typedef false_type type; };
|
||||||
|
template <> struct ct_and<true_type,true_type> { typedef true_type type; };
|
||||||
|
|
||||||
|
template <class A> struct ct_not { typedef ct_if_error type; };
|
||||||
|
template <> struct ct_not<true_type> { typedef false_type type; };
|
||||||
|
template <> struct ct_not<false_type> { typedef true_type type; };
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
|
|
||||||
|
template <int cond, class A, class B>
|
||||||
|
struct ct_if { typedef ct_if_error type; };
|
||||||
|
template <class A, class B>
|
||||||
|
struct ct_if<1, A, B> { typedef A type; };
|
||||||
|
template <class A, class B>
|
||||||
|
struct ct_if<0, A, B> { typedef B type; };
|
||||||
|
|
||||||
|
template <class cond, class A, class B>
|
||||||
|
struct ct_if_t { typedef ct_if_error type; };
|
||||||
|
template <class A, class B>
|
||||||
|
struct ct_if_t<true_type, A, B> { typedef A type; };
|
||||||
|
template <class A, class B>
|
||||||
|
struct ct_if_t<false_type, A, B> { typedef B type; };
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
|
||||||
|
template <int condition, class A, class B> struct IF;
|
||||||
|
template <int condition> struct SlectSelector;
|
||||||
|
struct SelectFirstType;
|
||||||
|
struct SelectSecondType;
|
||||||
|
|
||||||
|
struct SelectFirstType {
|
||||||
|
template<class A, class B>
|
||||||
|
struct Template { typedef A type; };
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SelectSecondType {
|
||||||
|
template<class A, class B>
|
||||||
|
struct Template { typedef B type; };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int condition>
|
||||||
|
struct SlectSelector {
|
||||||
|
typedef SelectFirstType type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct SlectSelector<0> {
|
||||||
|
typedef SelectSecondType type;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
template<int condition, class A, class B>
|
||||||
|
struct ct_if
|
||||||
|
{
|
||||||
|
typedef typename detail::SlectSelector<condition>::type Selector;
|
||||||
|
typedef typename Selector::template Template<A, B>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class cond, class A, class B>
|
||||||
|
struct ct_if_t {
|
||||||
|
typedef typename ct_if<cond::value, A, B>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // BOOST_CT_IF_HPP
|
||||||
|
|
@ -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,7 +1,8 @@
|
|||||||
// (C) Copyright David Abrahams 2001.
|
// (C) Copyright David Abrahams 2001. Permission to copy, use,
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// modify, sell and distribute this software is granted provided this
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// copyright notice appears in all copies. This software is provided
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// "as is" without express or implied warranty, and with no claim as
|
||||||
|
// to its suitability for any purpose.
|
||||||
|
|
||||||
#ifndef BOOST_TYPE_DWA20010120_HPP
|
#ifndef BOOST_TYPE_DWA20010120_HPP
|
||||||
# define BOOST_TYPE_DWA20010120_HPP
|
# define BOOST_TYPE_DWA20010120_HPP
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
// Boost.Signals library
|
// Boost.Signals library
|
||||||
|
//
|
||||||
// Copyright Douglas Gregor 2001-2003. Use, modification and
|
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||||
// distribution is subject to the Boost Software License, Version
|
//
|
||||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
// Permission to copy, use, sell and distribute this software is granted
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// provided this copyright notice appears in all copies.
|
||||||
|
// Permission to modify the code and to distribute modified code is granted
|
||||||
// For more information, see http://www.boost.org/libs/signals
|
// provided this copyright notice appears in all copies, and a notice
|
||||||
|
// that the code was modified is included with the copyright notice.
|
||||||
|
//
|
||||||
|
// This software is provided "as is" without express or implied warranty,
|
||||||
|
// and with no claim as to its suitability for any purpose.
|
||||||
|
|
||||||
|
// For more information, see http://www.boost.org
|
||||||
|
|
||||||
#ifndef BOOST_VISIT_EACH_HPP
|
#ifndef BOOST_VISIT_EACH_HPP
|
||||||
#define BOOST_VISIT_EACH_HPP
|
#define BOOST_VISIT_EACH_HPP
|
||||||
|
23
test/Jamfile
23
test/Jamfile
@ -1,23 +0,0 @@
|
|||||||
################################################################*# Jam #*#######
|
|
||||||
# Copyright (C) 2010 Bryce Lelbach
|
|
||||||
#
|
|
||||||
# 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)
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
build-project container_fwd ;
|
|
||||||
|
|
||||||
project detail/test
|
|
||||||
: requirements
|
|
||||||
<toolset>clang:<cxxflags>-Wno-unused
|
|
||||||
<toolset>clang:<cxxflags>-Wno-tautological-compare
|
|
||||||
<toolset>clang:<cxxflags>-ftemplate-depth-300
|
|
||||||
<toolset>gcc:<cxxflags>-ftemplate-depth-300
|
|
||||||
<toolset>darwin:<cxxflags>-ftemplate-depth-300
|
|
||||||
;
|
|
||||||
|
|
||||||
for tests in [ glob *.cpp ] {
|
|
||||||
run $(tests) : : : : $(tests:B) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
# Copyright 2011 Daniel James.
|
|
||||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
import testing ;
|
|
||||||
|
|
||||||
project detail/test/container_fwd
|
|
||||||
: requirements
|
|
||||||
<warnings>all
|
|
||||||
<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
|
|
||||||
;
|
|
||||||
|
|
||||||
run container_no_fwd_test.cpp ;
|
|
||||||
run container_fwd_test.cpp : : : : container_fwd ;
|
|
||||||
run container_fwd_test.cpp : :
|
|
||||||
: <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
|
||||||
: container_fwd_debug ;
|
|
||||||
|
|
||||||
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 ;
|
|
@ -1,112 +0,0 @@
|
|||||||
|
|
||||||
// Copyright 2005-2009 Daniel James.
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/functional/detail/container_fwd.hpp>
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__GNUC__, < 3) && \
|
|
||||||
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
|
||||||
template <class charT, class Allocator>
|
|
||||||
static void test(
|
|
||||||
std::basic_string<charT, std::string_char_traits<charT>, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
template <class charT, class Allocator>
|
|
||||||
static void test(
|
|
||||||
std::basic_string<charT, std::char_traits<charT>, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class T, class Allocator>
|
|
||||||
static void test(std::deque<T, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class Allocator>
|
|
||||||
static void test(std::list<T, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, class Allocator>
|
|
||||||
static void test(std::vector<T, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Key, class T, class Compare, class Allocator>
|
|
||||||
static void test(std::map<Key, T, Compare, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Key, class T, class Compare, class Allocator>
|
|
||||||
static void test(std::multimap<Key, T, Compare, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Key, class Compare, class Allocator>
|
|
||||||
static void test(std::set<Key, Compare, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Key, class Compare, class Allocator>
|
|
||||||
static void test(std::multiset<Key, Compare, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <std::size_t N>
|
|
||||||
static void test(std::bitset<N> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
static void test(std::complex<T> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class X, class Y>
|
|
||||||
static void test(std::pair<X, Y> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <deque>
|
|
||||||
#include <list>
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
#include <set>
|
|
||||||
#include <bitset>
|
|
||||||
#include <string>
|
|
||||||
#include <complex>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::deque<int> x1;
|
|
||||||
std::list<std::string> x2;
|
|
||||||
std::vector<float> x3;
|
|
||||||
std::vector<bool> x4;
|
|
||||||
std::map<int, int> x5;
|
|
||||||
std::multimap<float, int*> x6;
|
|
||||||
std::set<std::string> x7;
|
|
||||||
std::multiset<std::vector<int> > x8;
|
|
||||||
std::bitset<10> x9;
|
|
||||||
std::string x10;
|
|
||||||
std::complex<double> x11;
|
|
||||||
std::pair<std::list<int>, char***> x12;
|
|
||||||
|
|
||||||
test(x1);
|
|
||||||
test(x2);
|
|
||||||
test(x3);
|
|
||||||
test(x4);
|
|
||||||
test(x5);
|
|
||||||
test(x6);
|
|
||||||
test(x7);
|
|
||||||
test(x8);
|
|
||||||
test(x9);
|
|
||||||
test(x10);
|
|
||||||
test(x11);
|
|
||||||
test(x12);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
// Copyright 2010 Daniel James.
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#define BOOST_DETAIL_NO_CONTAINER_FWD
|
|
||||||
|
|
||||||
#include <boost/detail/container_fwd.hpp>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::set<int> x;
|
|
||||||
std::vector<std::string> y;
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
|
|
||||||
// Copyright 2011 Daniel James.
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// This tests if container forwarding is correctly disabled. If it isn't
|
|
||||||
// disabled it causes a compile error (which causes the test to pass).
|
|
||||||
// If it is disabled it tries container forwarding. If it doesn't work
|
|
||||||
// then there will be a compile error, indicating that it is correctly
|
|
||||||
// disabled. But if there isn't a compile error that indicates that
|
|
||||||
// container forwarding might work.
|
|
||||||
//
|
|
||||||
// Since this test only tries std::vector, it might get it wrong but I didn't
|
|
||||||
// want it to fail because of some incompatibility with a trickier class.
|
|
||||||
|
|
||||||
#define BOOST_DETAIL_TEST_CONFIG_ONLY
|
|
||||||
#include <boost/detail/container_fwd.hpp>
|
|
||||||
|
|
||||||
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
|
|
||||||
#error "Failing in order to pass test"
|
|
||||||
#else
|
|
||||||
#define BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD
|
|
||||||
|
|
||||||
#undef BOOST_DETAIL_CONTAINER_FWD_HPP
|
|
||||||
#undef BOOST_DETAIL_TEST_CONFIG_ONLY
|
|
||||||
|
|
||||||
#include <boost/detail/container_fwd.hpp>
|
|
||||||
|
|
||||||
template <class T, class Allocator>
|
|
||||||
void test(std::vector<T, Allocator> const&)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
int main ()
|
|
||||||
{
|
|
||||||
std::vector<int> x;
|
|
||||||
test(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,130 +0,0 @@
|
|||||||
/*==============================================================================
|
|
||||||
Copyright (c) 2010-2011 Bryce Lelbach
|
|
||||||
|
|
||||||
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 <ios>
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/array.hpp>
|
|
||||||
#include <boost/detail/is_sorted.hpp>
|
|
||||||
#include <boost/detail/lightweight_test.hpp>
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct tracking_less: std::binary_function <T, T, bool> {
|
|
||||||
typedef bool result_type;
|
|
||||||
|
|
||||||
#if defined(__PATHSCALE__)
|
|
||||||
tracking_less (void) { }
|
|
||||||
~tracking_less (void) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool operator() (T const& x, T const& y) const {
|
|
||||||
std::cout << x << " < " << y << " == " << (x < y) << "\n";
|
|
||||||
return x < y;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct tracking_less_equal: std::binary_function <T, T, bool> {
|
|
||||||
typedef bool result_type;
|
|
||||||
|
|
||||||
#if defined(__PATHSCALE__)
|
|
||||||
tracking_less_equal (void) { }
|
|
||||||
~tracking_less_equal (void) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool operator() (T const& x, T const& y) const {
|
|
||||||
std::cout << x << " <= " << y << " == " << (x <= y) << "\n";
|
|
||||||
return x <= y;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct tracking_greater: std::binary_function <T, T, bool> {
|
|
||||||
typedef bool result_type;
|
|
||||||
|
|
||||||
#if defined(__PATHSCALE__)
|
|
||||||
tracking_greater (void) { }
|
|
||||||
~tracking_greater (void) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool operator() (T const& x, T const& y) const {
|
|
||||||
std::cout << x << " > " << y << " == " << (x > y) << "\n";
|
|
||||||
return x > y;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct tracking_greater_equal: std::binary_function <T, T, bool> {
|
|
||||||
typedef bool result_type;
|
|
||||||
|
|
||||||
#if defined(__PATHSCALE__)
|
|
||||||
tracking_greater_equal (void) { }
|
|
||||||
~tracking_greater_equal (void) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool operator() (T const& x, T const& y) const {
|
|
||||||
std::cout << x << " >= " << y << " == " << (x >= y) << "\n";
|
|
||||||
return x >= y;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int main (void) {
|
|
||||||
#define IS_SORTED ::boost::detail::is_sorted
|
|
||||||
#define IS_SORTED_UNTIL ::boost::detail::is_sorted_until
|
|
||||||
using boost::array;
|
|
||||||
using boost::report_errors;
|
|
||||||
|
|
||||||
std::cout << std::boolalpha;
|
|
||||||
|
|
||||||
array<int, 10> a = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } };
|
|
||||||
array<int, 10> b = { { 0, 1, 1, 2, 5, 8, 13, 34, 55, 89 } };
|
|
||||||
array<int, 10> c = { { 0, 1, -1, 2, -3, 5, -8, 13, -21, 34 } };
|
|
||||||
|
|
||||||
tracking_less<int> lt;
|
|
||||||
tracking_less_equal<int> lte;
|
|
||||||
tracking_greater<int> gt;
|
|
||||||
tracking_greater_equal<int> gte;
|
|
||||||
|
|
||||||
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(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);
|
|
||||||
BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gt), true);
|
|
||||||
BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gte), true);
|
|
||||||
|
|
||||||
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(b.rbegin(), b.rend(), gt), true);
|
|
||||||
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(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);
|
|
||||||
BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gt), false);
|
|
||||||
BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gte), false);
|
|
||||||
|
|
||||||
return report_errors();
|
|
||||||
}
|
|
||||||
|
|
@ -1,285 +0,0 @@
|
|||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
|
||||||
// utf8_codecvt_facet.cpp
|
|
||||||
|
|
||||||
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
|
||||||
// Use, modification and distribution is subject to the Boost Software
|
|
||||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// Please see the comments in <boost/detail/utf8_codecvt_facet.hpp> to
|
|
||||||
// learn how this file should be used.
|
|
||||||
|
|
||||||
#include <boost/detail/utf8_codecvt_facet.hpp>
|
|
||||||
|
|
||||||
#include <cstdlib> // for multi-byte converson routines
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
#include <boost/limits.hpp>
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
// If we don't have wstring, then Unicode support
|
|
||||||
// is not available anyway, so we don't need to even
|
|
||||||
// compiler this file. This also fixes the problem
|
|
||||||
// with mingw, which can compile this file, but will
|
|
||||||
// generate link error when building DLL.
|
|
||||||
#ifndef BOOST_NO_STD_WSTRING
|
|
||||||
|
|
||||||
BOOST_UTF8_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
|
||||||
// implementation for wchar_t
|
|
||||||
|
|
||||||
// Translate incoming UTF-8 into UCS-4
|
|
||||||
std::codecvt_base::result utf8_codecvt_facet::do_in(
|
|
||||||
std::mbstate_t& /*state*/,
|
|
||||||
const char * from,
|
|
||||||
const char * from_end,
|
|
||||||
const char * & from_next,
|
|
||||||
wchar_t * to,
|
|
||||||
wchar_t * to_end,
|
|
||||||
wchar_t * & to_next
|
|
||||||
) const {
|
|
||||||
// Basic algorithm: The first octet determines how many
|
|
||||||
// octets total make up the UCS-4 character. The remaining
|
|
||||||
// "continuing octets" all begin with "10". To convert, subtract
|
|
||||||
// the amount that specifies the number of octets from the first
|
|
||||||
// octet. Subtract 0x80 (1000 0000) from each continuing octet,
|
|
||||||
// then mash the whole lot together. Note that each continuing
|
|
||||||
// octet only uses 6 bits as unique values, so only shift by
|
|
||||||
// multiples of 6 to combine.
|
|
||||||
while (from != from_end && to != to_end) {
|
|
||||||
|
|
||||||
// Error checking on the first octet
|
|
||||||
if (invalid_leading_octet(*from)){
|
|
||||||
from_next = from;
|
|
||||||
to_next = to;
|
|
||||||
return std::codecvt_base::error;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The first octet is adjusted by a value dependent upon
|
|
||||||
// the number of "continuing octets" encoding the character
|
|
||||||
const int cont_octet_count = get_cont_octet_count(*from);
|
|
||||||
const wchar_t octet1_modifier_table[] = {
|
|
||||||
0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
|
|
||||||
};
|
|
||||||
|
|
||||||
// The unsigned char conversion is necessary in case char is
|
|
||||||
// signed (I learned this the hard way)
|
|
||||||
wchar_t ucs_result =
|
|
||||||
(unsigned char)(*from++) - octet1_modifier_table[cont_octet_count];
|
|
||||||
|
|
||||||
// Invariants :
|
|
||||||
// 1) At the start of the loop, 'i' continuing characters have been
|
|
||||||
// processed
|
|
||||||
// 2) *from points to the next continuing character to be processed.
|
|
||||||
int i = 0;
|
|
||||||
while(i != cont_octet_count && from != from_end) {
|
|
||||||
|
|
||||||
// Error checking on continuing characters
|
|
||||||
if (invalid_continuing_octet(*from)) {
|
|
||||||
from_next = from;
|
|
||||||
to_next = to;
|
|
||||||
return std::codecvt_base::error;
|
|
||||||
}
|
|
||||||
|
|
||||||
ucs_result *= (1 << 6);
|
|
||||||
|
|
||||||
// each continuing character has an extra (10xxxxxx)b attached to
|
|
||||||
// it that must be removed.
|
|
||||||
ucs_result += (unsigned char)(*from++) - 0x80;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the buffer ends with an incomplete unicode character...
|
|
||||||
if (from == from_end && i != cont_octet_count) {
|
|
||||||
// rewind "from" to before the current character translation
|
|
||||||
from_next = from - (i+1);
|
|
||||||
to_next = to;
|
|
||||||
return std::codecvt_base::partial;
|
|
||||||
}
|
|
||||||
*to++ = ucs_result;
|
|
||||||
}
|
|
||||||
from_next = from;
|
|
||||||
to_next = to;
|
|
||||||
|
|
||||||
// Were we done converting or did we run out of destination space?
|
|
||||||
if(from == from_end) return std::codecvt_base::ok;
|
|
||||||
else return std::codecvt_base::partial;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::codecvt_base::result utf8_codecvt_facet::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
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// RG - consider merging this table with the other one
|
|
||||||
const wchar_t octet1_modifier_table[] = {
|
|
||||||
0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
|
|
||||||
};
|
|
||||||
|
|
||||||
wchar_t max_wchar = (std::numeric_limits<wchar_t>::max)();
|
|
||||||
while (from != from_end && to != to_end) {
|
|
||||||
|
|
||||||
// Check for invalid UCS-4 character
|
|
||||||
if (*from > max_wchar) {
|
|
||||||
from_next = from;
|
|
||||||
to_next = to;
|
|
||||||
return std::codecvt_base::error;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cont_octet_count = get_cont_octet_out_count(*from);
|
|
||||||
|
|
||||||
// RG - comment this formula better
|
|
||||||
int shift_exponent = (cont_octet_count) * 6;
|
|
||||||
|
|
||||||
// Process the first character
|
|
||||||
*to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
|
|
||||||
(unsigned char)(*from / (1 << shift_exponent)));
|
|
||||||
|
|
||||||
// Process the continuation characters
|
|
||||||
// Invariants: At the start of the loop:
|
|
||||||
// 1) 'i' continuing octets have been generated
|
|
||||||
// 2) '*to' points to the next location to place an octet
|
|
||||||
// 3) shift_exponent is 6 more than needed for the next octet
|
|
||||||
int i = 0;
|
|
||||||
while (i != cont_octet_count && to != to_end) {
|
|
||||||
shift_exponent -= 6;
|
|
||||||
*to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
// If we filled up the out buffer before encoding the character
|
|
||||||
if(to == to_end && i != cont_octet_count) {
|
|
||||||
from_next = from;
|
|
||||||
to_next = to - (i+1);
|
|
||||||
return std::codecvt_base::partial;
|
|
||||||
}
|
|
||||||
++from;
|
|
||||||
}
|
|
||||||
from_next = from;
|
|
||||||
to_next = to;
|
|
||||||
// Were we done or did we run out of destination space
|
|
||||||
if(from == from_end) return std::codecvt_base::ok;
|
|
||||||
else return std::codecvt_base::partial;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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 char * from,
|
|
||||||
const char * from_end,
|
|
||||||
std::size_t max_limit
|
|
||||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
|
||||||
) const throw()
|
|
||||||
#else
|
|
||||||
) const
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
// RG - this code is confusing! I need a better way to express it.
|
|
||||||
// and test cases.
|
|
||||||
|
|
||||||
// Invariants:
|
|
||||||
// 1) last_octet_count has the size of the last measured character
|
|
||||||
// 2) char_count holds the number of characters shown to fit
|
|
||||||
// within the bounds so far (no greater than max_limit)
|
|
||||||
// 3) from_next points to the octet 'last_octet_count' before the
|
|
||||||
// last measured character.
|
|
||||||
int last_octet_count=0;
|
|
||||||
std::size_t char_count = 0;
|
|
||||||
const char* from_next = from;
|
|
||||||
// Use "<" because the buffer may represent incomplete characters
|
|
||||||
while (from_next+last_octet_count <= from_end && char_count <= max_limit) {
|
|
||||||
from_next += last_octet_count;
|
|
||||||
last_octet_count = (get_octet_count(*from_next));
|
|
||||||
++char_count;
|
|
||||||
}
|
|
||||||
return static_cast<int>(from_next-from_end);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int utf8_codecvt_facet::get_octet_count(
|
|
||||||
unsigned char lead_octet
|
|
||||||
){
|
|
||||||
// if the 0-bit (MSB) is 0, then 1 character
|
|
||||||
if (lead_octet <= 0x7f) return 1;
|
|
||||||
|
|
||||||
// Otherwise the count number of consecutive 1 bits starting at MSB
|
|
||||||
// assert(0xc0 <= lead_octet && lead_octet <= 0xfd);
|
|
||||||
|
|
||||||
if (0xc0 <= lead_octet && lead_octet <= 0xdf) return 2;
|
|
||||||
else if (0xe0 <= lead_octet && lead_octet <= 0xef) return 3;
|
|
||||||
else if (0xf0 <= lead_octet && lead_octet <= 0xf7) return 4;
|
|
||||||
else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
|
|
||||||
else return 6;
|
|
||||||
}
|
|
||||||
BOOST_UTF8_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<std::size_t s>
|
|
||||||
int get_cont_octet_out_count_impl(wchar_t word){
|
|
||||||
if (word < 0x80) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (word < 0x800) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
int get_cont_octet_out_count_impl<4>(wchar_t word){
|
|
||||||
if (word < 0x80) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (word < 0x800) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note that the following code will generate warnings on some platforms
|
|
||||||
// where wchar_t is defined as UCS2. The warnings are superfluous as the
|
|
||||||
// specialization is never instantitiated with such compilers, but this
|
|
||||||
// can cause problems if warnings are being treated as errors, so we guard
|
|
||||||
// against that. Including <boost/detail/utf8_codecvt_facet.hpp> as we do
|
|
||||||
// should be enough to get WCHAR_MAX defined.
|
|
||||||
#if !defined(WCHAR_MAX)
|
|
||||||
# error WCHAR_MAX not defined!
|
|
||||||
#endif
|
|
||||||
// cope with VC++ 7.1 or earlier having invalid WCHAR_MAX
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier
|
|
||||||
return 2;
|
|
||||||
#elif WCHAR_MAX > 0x10000
|
|
||||||
|
|
||||||
if (word < 0x10000) {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
if (word < 0x200000) {
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
if (word < 0x4000000) {
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
return 5;
|
|
||||||
|
|
||||||
#else
|
|
||||||
return 2;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace anonymous
|
|
||||||
|
|
||||||
BOOST_UTF8_BEGIN_NAMESPACE
|
|
||||||
// How many "continuing octets" will be needed for this word
|
|
||||||
// == total octets - 1.
|
|
||||||
int utf8_codecvt_facet::get_cont_octet_out_count(
|
|
||||||
wchar_t word
|
|
||||||
) const {
|
|
||||||
return get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
|
|
||||||
}
|
|
||||||
BOOST_UTF8_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif
|
|
Reference in New Issue
Block a user