mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
Update in-tree boost to latest from boost 1.34 cvs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14895 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8a83ea44bd
commit
d64a07a784
@ -121,7 +121,7 @@ public: // accessors
|
||||
return this;
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
|
||||
const void* address() const
|
||||
{
|
||||
@ -136,7 +136,7 @@ public: // accessors
|
||||
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
|
||||
// MSVC6 seems not to like inline functions with const void* returns, so we
|
||||
// declare the following here:
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
// Handles broken standard libraries better than <iterator>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
// FIXES for broken compilers
|
||||
@ -52,7 +53,7 @@ namespace boost {
|
||||
typedef const T& const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return elems; }
|
||||
const_iterator begin() const { return elems; }
|
||||
@ -135,6 +136,7 @@ namespace boost {
|
||||
|
||||
// direct access to data (read-only)
|
||||
const T* data() const { return elems; }
|
||||
T* data() { return elems; }
|
||||
|
||||
// use array as C array (direct read/write access to data)
|
||||
T* c_array() { return elems; }
|
||||
@ -154,13 +156,134 @@ namespace boost {
|
||||
|
||||
// check range (may be private because it is static)
|
||||
static void rangecheck (size_type i) {
|
||||
if (i >= size()) {
|
||||
if (i >= size()) {
|
||||
throw std::range_error("array<>: index out of range");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
template< class T >
|
||||
class array< T, 0 > {
|
||||
|
||||
public:
|
||||
// type definitions
|
||||
typedef T value_type;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
|
||||
const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
|
||||
iterator end() { return begin(); }
|
||||
const_iterator end() const { return begin(); }
|
||||
|
||||
// reverse iterator support
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
|
||||
// workaround for broken reverse_iterator in VC7
|
||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
|
||||
reference, iterator, reference> > reverse_iterator;
|
||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
|
||||
const_reference, iterator, reference> > const_reverse_iterator;
|
||||
#else
|
||||
// workaround for broken reverse_iterator implementations
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
|
||||
#endif
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
// operator[]
|
||||
reference operator[](size_type i)
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
const_reference operator[](size_type i) const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
// at() with range check
|
||||
reference at(size_type i) { return failed_rangecheck(); }
|
||||
const_reference at(size_type i) const { return failed_rangecheck(); }
|
||||
|
||||
// front() and back()
|
||||
reference front()
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
const_reference front() const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
const_reference back() const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
// size is constant
|
||||
static size_type size() { return 0; }
|
||||
static bool empty() { return true; }
|
||||
static size_type max_size() { return 0; }
|
||||
enum { static_size = 0 };
|
||||
|
||||
void swap (array<T,0>& y) {
|
||||
}
|
||||
|
||||
// direct access to data (read-only)
|
||||
const T* data() const { return 0; }
|
||||
T* data() { return 0; }
|
||||
|
||||
// use array as C array (direct read/write access to data)
|
||||
T* c_array() { return 0; }
|
||||
|
||||
// assignment with type conversion
|
||||
template <typename T2>
|
||||
array<T,0>& operator= (const array<T2,0>& ) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assign one value to all elements
|
||||
void assign (const T& ) { }
|
||||
|
||||
// check range (may be private because it is static)
|
||||
static reference failed_rangecheck () {
|
||||
std::range_error e("attempt to access element of an empty array");
|
||||
boost::throw_exception(e);
|
||||
//
|
||||
// We need to return something here to keep
|
||||
// some compilers happy: however we will never
|
||||
// actually get here....
|
||||
//
|
||||
static T placeholder;
|
||||
return placeholder;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
// comparisons
|
||||
template<class T, std::size_t N>
|
||||
bool operator== (const array<T,N>& x, const array<T,N>& y) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -38,6 +38,23 @@
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
|
||||
&& !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
|
||||
|
||||
template<class A1> result_type operator()(A1 const & a1)
|
||||
{
|
||||
list1<A1 const &> a(a1);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
template<class A1> result_type operator()(A1 const & a1) const
|
||||
{
|
||||
list1<A1 const &> a(a1);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
|
||||
{
|
||||
list2<A1 &, A2 &> a(a1, a2);
|
||||
@ -50,6 +67,49 @@
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
|
||||
&& !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
|
||||
{
|
||||
list2<A1 const &, A2 &> a(a1, a2);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
|
||||
{
|
||||
list2<A1 const &, A2 &> a(a1, a2);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
|
||||
{
|
||||
list2<A1 &, A2 const &> a(a1, a2);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
|
||||
{
|
||||
list2<A1 &, A2 const &> a(a1, a2);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
|
||||
{
|
||||
list2<A1 const &, A2 const &> a(a1, a2);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
|
||||
{
|
||||
list2<A1 const &, A2 const &> a(a1, a2);
|
||||
BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
|
||||
{
|
||||
list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
|
||||
@ -146,6 +206,11 @@
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ )
|
||||
|
||||
using boost::visit_each;
|
||||
|
||||
#endif
|
||||
BOOST_BIND_VISIT_EACH(v, f_, 0);
|
||||
l_.accept(v);
|
||||
}
|
||||
|
@ -12,6 +12,10 @@
|
||||
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
|
||||
//
|
||||
|
||||
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
|
||||
# define BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
#endif
|
||||
|
||||
// mf0
|
||||
|
||||
template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf0)
|
||||
@ -50,6 +54,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)();
|
||||
@ -154,6 +167,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1);
|
||||
@ -257,6 +279,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
|
||||
@ -358,6 +389,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2, A3 a3) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
|
||||
@ -459,6 +499,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
|
||||
@ -560,6 +609,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
|
||||
@ -661,6 +719,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
|
||||
@ -762,6 +829,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
|
||||
@ -863,6 +939,15 @@ public:
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
}
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
||||
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
|
||||
{
|
||||
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
@ -932,3 +1017,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#undef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS
|
||||
|
@ -25,7 +25,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#if defined(__BORLANDC__) || defined(__GNUC__)
|
||||
|
||||
static inline boost::arg<1> _1() { return boost::arg<1>(); }
|
||||
static inline boost::arg<2> _2() { return boost::arg<2>(); }
|
||||
|
475
boost/boost/bind/storage.hpp
Normal file
475
boost/boost/bind/storage.hpp
Normal file
@ -0,0 +1,475 @@
|
||||
#ifndef BOOST_BIND_STORAGE_HPP_INCLUDED
|
||||
#define BOOST_BIND_STORAGE_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// bind/storage.hpp
|
||||
//
|
||||
// boost/bind.hpp support header, optimized storage
|
||||
//
|
||||
// Copyright (c) 2006 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
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4512) // assignment operator could not be generated
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
// 1
|
||||
|
||||
template<class A1> struct storage1
|
||||
{
|
||||
explicit storage1( A1 a1 ): a1_( a1 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
BOOST_BIND_VISIT_EACH(v, a1_, 0);
|
||||
}
|
||||
|
||||
A1 a1_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( __BORLANDC__ )
|
||||
|
||||
template<int I> struct storage1< boost::arg<I> >
|
||||
{
|
||||
explicit storage1( boost::arg<I> ) {}
|
||||
|
||||
template<class V> void accept(V &) const { }
|
||||
|
||||
static boost::arg<I> a1_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<int I> struct storage1< boost::arg<I> (*) () >
|
||||
{
|
||||
explicit storage1( boost::arg<I> (*) () ) {}
|
||||
|
||||
template<class V> void accept(V &) const { }
|
||||
|
||||
static boost::arg<I> a1_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 2
|
||||
|
||||
template<class A1, class A2> struct storage2: public storage1<A1>
|
||||
{
|
||||
typedef storage1<A1> inherited;
|
||||
|
||||
storage2( A1 a1, A2 a2 ): storage1<A1>( a1 ), a2_( a2 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a2_, 0);
|
||||
}
|
||||
|
||||
A2 a2_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, int I> struct storage2< A1, boost::arg<I> >: public storage1<A1>
|
||||
{
|
||||
typedef storage1<A1> inherited;
|
||||
|
||||
storage2( A1 a1, boost::arg<I> ): storage1<A1>( a1 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a2_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, int I> struct storage2< A1, boost::arg<I> (*) () >: public storage1<A1>
|
||||
{
|
||||
typedef storage1<A1> inherited;
|
||||
|
||||
storage2( A1 a1, boost::arg<I> (*) () ): storage1<A1>( a1 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a2_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 3
|
||||
|
||||
template<class A1, class A2, class A3> struct storage3: public storage2< A1, A2 >
|
||||
{
|
||||
typedef storage2<A1, A2> inherited;
|
||||
|
||||
storage3( A1 a1, A2 a2, A3 a3 ): storage2<A1, A2>( a1, a2 ), a3_( a3 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a3_, 0);
|
||||
}
|
||||
|
||||
A3 a3_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, int I> struct storage3< A1, A2, boost::arg<I> >: public storage2< A1, A2 >
|
||||
{
|
||||
typedef storage2<A1, A2> inherited;
|
||||
|
||||
storage3( A1 a1, A2 a2, boost::arg<I> ): storage2<A1, A2>( a1, a2 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a3_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, int I> struct storage3< A1, A2, boost::arg<I> (*) () >: public storage2< A1, A2 >
|
||||
{
|
||||
typedef storage2<A1, A2> inherited;
|
||||
|
||||
storage3( A1 a1, A2 a2, boost::arg<I> (*) () ): storage2<A1, A2>( a1, a2 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a3_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 4
|
||||
|
||||
template<class A1, class A2, class A3, class A4> struct storage4: public storage3< A1, A2, A3 >
|
||||
{
|
||||
typedef storage3<A1, A2, A3> inherited;
|
||||
|
||||
storage4( A1 a1, A2 a2, A3 a3, A4 a4 ): storage3<A1, A2, A3>( a1, a2, a3 ), a4_( a4 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a4_, 0);
|
||||
}
|
||||
|
||||
A4 a4_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, boost::arg<I> >: public storage3< A1, A2, A3 >
|
||||
{
|
||||
typedef storage3<A1, A2, A3> inherited;
|
||||
|
||||
storage4( A1 a1, A2 a2, A3 a3, boost::arg<I> ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a4_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, boost::arg<I> (*) () >: public storage3< A1, A2, A3 >
|
||||
{
|
||||
typedef storage3<A1, A2, A3> inherited;
|
||||
|
||||
storage4( A1 a1, A2 a2, A3 a3, boost::arg<I> (*) () ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a4_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 5
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5> struct storage5: public storage4< A1, A2, A3, A4 >
|
||||
{
|
||||
typedef storage4<A1, A2, A3, A4> inherited;
|
||||
|
||||
storage5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ), a5_( a5 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a5_, 0);
|
||||
}
|
||||
|
||||
A5 a5_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, boost::arg<I> >: public storage4< A1, A2, A3, A4 >
|
||||
{
|
||||
typedef storage4<A1, A2, A3, A4> inherited;
|
||||
|
||||
storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg<I> ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a5_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, boost::arg<I> (*) () >: public storage4< A1, A2, A3, A4 >
|
||||
{
|
||||
typedef storage4<A1, A2, A3, A4> inherited;
|
||||
|
||||
storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg<I> (*) () ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a5_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 6
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6> struct storage6: public storage5< A1, A2, A3, A4, A5 >
|
||||
{
|
||||
typedef storage5<A1, A2, A3, A4, A5> inherited;
|
||||
|
||||
storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ), a6_( a6 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a6_, 0);
|
||||
}
|
||||
|
||||
A6 a6_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, boost::arg<I> >: public storage5< A1, A2, A3, A4, A5 >
|
||||
{
|
||||
typedef storage5<A1, A2, A3, A4, A5> inherited;
|
||||
|
||||
storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg<I> ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a6_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, boost::arg<I> (*) () >: public storage5< A1, A2, A3, A4, A5 >
|
||||
{
|
||||
typedef storage5<A1, A2, A3, A4, A5> inherited;
|
||||
|
||||
storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg<I> (*) () ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a6_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 7
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct storage7: public storage6< A1, A2, A3, A4, A5, A6 >
|
||||
{
|
||||
typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
|
||||
|
||||
storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ), a7_( a7 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a7_, 0);
|
||||
}
|
||||
|
||||
A7 a7_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, boost::arg<I> >: public storage6< A1, A2, A3, A4, A5, A6 >
|
||||
{
|
||||
typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
|
||||
|
||||
storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg<I> ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a7_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, boost::arg<I> (*) () >: public storage6< A1, A2, A3, A4, A5, A6 >
|
||||
{
|
||||
typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
|
||||
|
||||
storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg<I> (*) () ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a7_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 8
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct storage8: public storage7< A1, A2, A3, A4, A5, A6, A7 >
|
||||
{
|
||||
typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
|
||||
|
||||
storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ), a8_( a8 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a8_, 0);
|
||||
}
|
||||
|
||||
A8 a8_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg<I> >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
|
||||
{
|
||||
typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
|
||||
|
||||
storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg<I> ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a8_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg<I> (*) () >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
|
||||
{
|
||||
typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
|
||||
|
||||
storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg<I> (*) () ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a8_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// 9
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct storage9: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
|
||||
{
|
||||
typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
|
||||
|
||||
storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ), a9_( a9 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
BOOST_BIND_VISIT_EACH(v, a9_, 0);
|
||||
}
|
||||
|
||||
A9 a9_;
|
||||
};
|
||||
|
||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg<I> >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
|
||||
{
|
||||
typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
|
||||
|
||||
storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg<I> ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a9_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg<I> (*) () >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
|
||||
{
|
||||
typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
|
||||
|
||||
storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg<I> (*) () ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
|
||||
|
||||
template<class V> void accept(V & v) const
|
||||
{
|
||||
inherited::accept(v);
|
||||
}
|
||||
|
||||
static boost::arg<I> a9_() { return boost::arg<I>(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(default: 4512) // assignment operator could not be generated
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_STORAGE_HPP_INCLUDED
|
@ -44,7 +44,7 @@
|
||||
#define BOOST_CAST_HPP
|
||||
|
||||
# include <boost/config.hpp>
|
||||
# include <cassert>
|
||||
# include <boost/assert.hpp>
|
||||
# include <typeinfo>
|
||||
# include <boost/type.hpp>
|
||||
# include <boost/limits.hpp>
|
||||
@ -55,7 +55,7 @@
|
||||
// appear in the function's argument list.
|
||||
//
|
||||
// TODO: Add this to config.hpp?
|
||||
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 // 1200 = VC6
|
||||
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
|
||||
# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
|
||||
# else
|
||||
# define BOOST_EXPLICIT_DEFAULT_TARGET
|
||||
@ -82,17 +82,19 @@ namespace boost
|
||||
|
||||
// polymorphic_downcast ----------------------------------------------------//
|
||||
|
||||
// assert() checked polymorphic downcast. Crosscasts prohibited.
|
||||
// BOOST_ASSERT() checked polymorphic downcast. Crosscasts prohibited.
|
||||
|
||||
// WARNING: Because this cast uses assert(), it violates the One Definition
|
||||
// Rule if NDEBUG is inconsistently defined across translation units.
|
||||
// WARNING: Because this cast uses BOOST_ASSERT(), it violates
|
||||
// the One Definition Rule if used in multiple translation units
|
||||
// where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
|
||||
// NDEBUG are defined inconsistently.
|
||||
|
||||
// Contributed by Dave Abrahams
|
||||
|
||||
template <class Target, class Source>
|
||||
inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
|
||||
{
|
||||
assert( dynamic_cast<Target>(x) == x ); // detect logic error
|
||||
BOOST_ASSERT( dynamic_cast<Target>(x) == x ); // detect logic error
|
||||
return static_cast<Target>(x);
|
||||
}
|
||||
|
||||
|
@ -109,10 +109,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
// select toolset if not defined already:
|
||||
//
|
||||
#ifndef BOOST_LIB_TOOLSET
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
|
||||
// Note: no compilers before 1200 are supported
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
|
||||
|
||||
// vc6:
|
||||
# define BOOST_LIB_TOOLSET "vc6"
|
||||
# ifdef UNDER_CE
|
||||
// vc6:
|
||||
# define BOOST_LIB_TOOLSET "evc4"
|
||||
# else
|
||||
// vc6:
|
||||
# define BOOST_LIB_TOOLSET "vc6"
|
||||
# endif
|
||||
|
||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
|
||||
|
||||
|
@ -9,6 +9,37 @@
|
||||
|
||||
// Borland C++ compiler setup:
|
||||
|
||||
//
|
||||
// versions check:
|
||||
// we don't support Borland prior to version 5.4:
|
||||
#if __BORLANDC__ < 0x540
|
||||
# error "Compiler not supported or configured - please reconfigure"
|
||||
#elif __BORLANDC__ < 0x581
|
||||
# pragma message( "Support for Borland compilers older than BCB2006 is deprecated in Boost 1.34" )
|
||||
#endif
|
||||
|
||||
// last known and checked version is 0x600 (Builder X preview)
|
||||
// Or 0x582 (Borland C++ Builder 2006 Update 1):
|
||||
#if (__BORLANDC__ > 0x582) && (__BORLANDC__ != 0x600)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# pragma message( "Unknown compiler version - please run the configure tests and report the results")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Support macros to help with standard library detection
|
||||
#if (__BORLANDC__ < 0x560) || defined(_USE_OLD_RW_STL)
|
||||
# define BOOST_BCB_WITH_ROGUE_WAVE
|
||||
#elif __BORLANDC__ < 0x570
|
||||
# define BOOST_BCB_WITH_STLPORT
|
||||
#else
|
||||
# define BOOST_BCB_WITH_DINKUMWARE
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Version 5.0 and below:
|
||||
# if __BORLANDC__ <= 0x0550
|
||||
// Borland C++Builder 4 and 5:
|
||||
@ -36,8 +67,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Version 7.0 (Kylix) and below:
|
||||
#if (__BORLANDC__ <= 0x570)
|
||||
// Borland C++ Builder 2006 Update 2 and below:
|
||||
#if (__BORLANDC__ <= 0x582)
|
||||
# define BOOST_NO_SFINAE
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
|
||||
@ -52,15 +83,21 @@
|
||||
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
|
||||
# ifdef NDEBUG
|
||||
// fix broken <cstring> so that Boost.test works:
|
||||
# include <cstring>
|
||||
# undef strcmp
|
||||
# endif
|
||||
// fix broken errno declaration:
|
||||
# include <errno.h>
|
||||
# ifndef errno
|
||||
# define errno errno
|
||||
# endif
|
||||
|
||||
//
|
||||
// new bug in 5.61:
|
||||
#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x570)
|
||||
#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x580)
|
||||
// this seems to be needed by the command line compiler, but not the IDE:
|
||||
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
|
||||
#endif
|
||||
@ -91,7 +128,7 @@
|
||||
// Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is
|
||||
// defined, then we have 0x560 or greater with the Rogue Wave implementation
|
||||
// which presumably has the std::DBL_MAX bug.
|
||||
#if ((__BORLANDC__ >= 0x550) && (__BORLANDC__ < 0x560)) || defined(_USE_OLD_RW_STL)
|
||||
#if defined( BOOST_BCB_WITH_ROGUE_WAVE )
|
||||
// <climits> is partly broken, some macros define symbols that are really in
|
||||
// namespace std, so you end up having to use illegal constructs like
|
||||
// std::DBL_MAX, as a fix we'll just include float.h and have done with:
|
||||
@ -142,6 +179,7 @@
|
||||
#endif
|
||||
//
|
||||
// MSVC compatibility mode does some nasty things:
|
||||
// TODO: look up if this doesn't apply to the whole 12xx range
|
||||
//
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1200)
|
||||
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
@ -150,26 +188,3 @@
|
||||
|
||||
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
|
||||
|
||||
//
|
||||
// versions check:
|
||||
// we don't support Borland prior to version 5.4:
|
||||
#if __BORLANDC__ < 0x540
|
||||
# error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 1536 (Builder X preview):
|
||||
#if (__BORLANDC__ > 1536)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# pragma message( "Unknown compiler version - please run the configure tests and report the results")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -24,8 +24,8 @@
|
||||
# endif
|
||||
|
||||
// Void returns don't work when emulating VC 6 (Peter Dimov)
|
||||
|
||||
# if defined(_MSC_VER) && (_MSC_VER == 1200)
|
||||
// TODO: look up if this doesn't apply to the whole 12xx range
|
||||
# if defined(_MSC_VER) && (_MSC_VER < 1300)
|
||||
# define BOOST_NO_VOID_RETURNS
|
||||
# endif
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
// (C) Copyright John Maddock 2001.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// (C) Copyright David Abrahams 2002 - 2003.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
|
||||
// (C) Copyright Guillaume Melquiond 2002 - 2003.
|
||||
// (C) Copyright Beman Dawes 2003.
|
||||
// (C) Copyright Martin Wille 2003.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// (C) Copyright John Maddock 2001.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// (C) Copyright David Abrahams 2002 - 2003.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
|
||||
// (C) Copyright Guillaume Melquiond 2002 - 2003.
|
||||
// (C) Copyright Beman Dawes 2003.
|
||||
// (C) Copyright Martin Wille 2003.
|
||||
// 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 for most recent version.
|
||||
@ -79,9 +79,9 @@
|
||||
// supports wchar_t natively. *BUT* there is a problem here: the standard
|
||||
// headers define this macro if they typedef wchar_t. Anyway, we're lucky
|
||||
// because they define it without a value, while Intel C++ defines it
|
||||
// to 1. So we can check its value to see if the macro was defined natively
|
||||
// or not.
|
||||
// Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
|
||||
// to 1. So we can check its value to see if the macro was defined natively
|
||||
// or not.
|
||||
// Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
|
||||
// is used instead.
|
||||
# if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0)
|
||||
# define BOOST_NO_INTRINSIC_WCHAR_T
|
||||
@ -90,9 +90,12 @@
|
||||
|
||||
#if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
|
||||
//
|
||||
// Figure out when Intel is emulating this gcc bug:
|
||||
// Figure out when Intel is emulating this gcc bug
|
||||
// (All Intel versions prior to 9.0.26, and versions
|
||||
// later than that if they are set up to emulate gcc 3.2
|
||||
// or earlier):
|
||||
//
|
||||
# if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL <= 900)
|
||||
# if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912)
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# endif
|
||||
#endif
|
||||
@ -141,7 +144,7 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
|
||||
#endif
|
||||
//
|
||||
// last known and checked version:
|
||||
#if (BOOST_INTEL_CXX_VERSION > 900)
|
||||
#if (BOOST_INTEL_CXX_VERSION > 910)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# elif defined(_MSC_VER)
|
||||
|
@ -64,6 +64,8 @@
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
# define BOOST_NO_SFINAE
|
||||
# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
|
||||
# endif
|
||||
# if (__SUNPRO_CC <= 0x580)
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# endif
|
||||
|
||||
@ -77,7 +79,7 @@
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 0x570:
|
||||
#if (__SUNPRO_CC > 0x570)
|
||||
#if (__SUNPRO_CC > 0x580)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# endif
|
||||
|
@ -63,7 +63,9 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1310 // 1310 == VC++ 7.1
|
||||
#if _MSC_VER < 1400
|
||||
// although a conforming signature for swprint exists in VC7.1
|
||||
// it appears not to actually work:
|
||||
# define BOOST_NO_SWPRINTF
|
||||
#endif
|
||||
|
||||
@ -82,7 +84,7 @@
|
||||
|
||||
//
|
||||
// check for exception handling support:
|
||||
#ifndef _CPPUNWIND
|
||||
#ifndef _CPPUNWIND
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
@ -95,6 +97,9 @@
|
||||
#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS)
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
#if (_MSC_VER >= 1400) && !defined(_DEBUG)
|
||||
# define BOOST_HAS_NRVO
|
||||
#endif
|
||||
//
|
||||
// disable Win32 API's if compiler extentions are
|
||||
// turned off:
|
||||
@ -128,9 +133,14 @@
|
||||
// Note: these are so far off, they are not really supported
|
||||
# elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202
|
||||
# define BOOST_COMPILER_VERSION evc4.0
|
||||
# error unknown CE compiler
|
||||
# elif _MSC_VER == 1400
|
||||
# define BOOST_COMPILER_VERSION evc8
|
||||
# else
|
||||
# error unknown CE compiler
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# if _MSC_VER < 1200
|
||||
|
28
boost/boost/config/no_tr1/utility.hpp
Normal file
28
boost/boost/config/no_tr1/utility.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// 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)
|
||||
//
|
||||
// The aim of this header is just to include <utility> but to do
|
||||
// so in a way that does not result in recursive inclusion of
|
||||
// the Boost TR1 components if boost/tr1/tr1/utility is in the
|
||||
// include search path. We have to do this to avoid circular
|
||||
// dependencies:
|
||||
//
|
||||
|
||||
#ifndef BOOST_CONFIG_UTILITY
|
||||
# define BOOST_CONFIG_UTILITY
|
||||
|
||||
# ifndef BOOST_TR1_NO_RECURSION
|
||||
# define BOOST_TR1_NO_RECURSION
|
||||
# define BOOST_CONFIG_NO_UTILITY_RECURSION
|
||||
# endif
|
||||
|
||||
# include <utility>
|
||||
|
||||
# ifdef BOOST_CONFIG_NO_UTILITY_RECURSION
|
||||
# undef BOOST_TR1_NO_RECURSION
|
||||
# undef BOOST_CONFIG_NO_UTILITY_RECURSION
|
||||
# endif
|
||||
|
||||
#endif
|
@ -36,7 +36,7 @@
|
||||
// FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in <pthread.h>
|
||||
// and not in <unistd.h>
|
||||
//
|
||||
#if defined(__FreeBSD__) && (__FreeBSD__ <= 3)
|
||||
#if (defined(__FreeBSD__) && (__FreeBSD__ <= 3)) || defined(__OpenBSD__)
|
||||
# define BOOST_HAS_PTHREADS
|
||||
#endif
|
||||
|
||||
|
@ -74,14 +74,22 @@
|
||||
// BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
|
||||
// These are predicated on _XOPEN_VERSION, and appears to be first released
|
||||
// in issue 4, version 2 (_XOPEN_VERSION > 500).
|
||||
// Likewise for the functions log1p and expm1.
|
||||
# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
|
||||
# define BOOST_HAS_GETTIMEOFDAY
|
||||
# if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500)
|
||||
# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
|
||||
# endif
|
||||
# ifndef BOOST_HAS_LOG1P
|
||||
# define BOOST_HAS_LOG1P
|
||||
# endif
|
||||
# ifndef BOOST_HAS_EXPM1
|
||||
# define BOOST_HAS_EXPM1
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -12,7 +12,11 @@
|
||||
// locate which compiler we are using and define
|
||||
// BOOST_COMPILER_CONFIG as needed:
|
||||
|
||||
# if defined __COMO__
|
||||
#if defined(__GCCXML__)
|
||||
// GCC-XML emulates other compilers, it has to appear first here!
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp"
|
||||
|
||||
#elif defined __COMO__
|
||||
// Comeau C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
|
||||
|
||||
|
@ -57,6 +57,10 @@
|
||||
// AmigaOS
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/amigaos.hpp"
|
||||
|
||||
#elif defined(__QNXNTO__)
|
||||
// QNX:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/qnxnto.hpp"
|
||||
|
||||
#else
|
||||
|
||||
# if defined(unix) \
|
||||
|
@ -17,7 +17,7 @@
|
||||
// users can short-circuit this header if they know whose std lib
|
||||
// they are using.
|
||||
|
||||
#include <utility>
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
|
||||
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||
// STLPort library; this _must_ come first, otherwise since
|
||||
|
@ -12,7 +12,7 @@
|
||||
// Dinkumware standard library config:
|
||||
|
||||
#if !defined(_YVALS) && !defined(_CPPLIB_VER)
|
||||
#include <utility>
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
#if !defined(_YVALS) && !defined(_CPPLIB_VER)
|
||||
#error This is not the Dinkumware lib!
|
||||
#endif
|
||||
|
@ -10,7 +10,7 @@
|
||||
// Comeau STL:
|
||||
|
||||
#if !defined(__LIBCOMO__)
|
||||
# include <utility>
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__LIBCOMO__)
|
||||
# error "This is not the Comeau STL!"
|
||||
# endif
|
||||
|
@ -62,3 +62,12 @@
|
||||
// support is useless.
|
||||
# undef BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
|
||||
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
|
||||
# define BOOST_HAS_SLIST
|
||||
# define BOOST_HAS_HASH
|
||||
# define BOOST_SLIST_HEADER <ext/slist>
|
||||
# define BOOST_HASH_SET_HEADER <ext/hash_set>
|
||||
# define BOOST_HASH_MAP_HEADER <ext/hash_map>
|
||||
#endif
|
||||
|
@ -8,7 +8,7 @@
|
||||
// Modena C++ standard library (comes with KAI C++)
|
||||
|
||||
#if !defined(MSIPL_COMPILE_H)
|
||||
# include <utility>
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__MSIPL_COMPILE_H)
|
||||
# error "This is not the Modena C++ library!"
|
||||
# endif
|
||||
|
@ -9,7 +9,7 @@
|
||||
// Metrowerks standard library:
|
||||
|
||||
#ifndef __MSL_CPP__
|
||||
# include <utility>
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# ifndef __MSL_CPP__
|
||||
# error This is not the MSL standard library!
|
||||
# endif
|
||||
|
@ -10,7 +10,7 @@
|
||||
// Rogue Wave std lib:
|
||||
|
||||
#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
# include <utility>
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
# error This is not the Rogue Wave standard library
|
||||
# endif
|
||||
|
@ -10,7 +10,7 @@
|
||||
// generic SGI STL:
|
||||
|
||||
#if !defined(__STL_CONFIG_H)
|
||||
# include <utility>
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__STL_CONFIG_H)
|
||||
# error "This is not the SGI STL!"
|
||||
# endif
|
||||
|
@ -10,7 +10,7 @@
|
||||
// STLPort standard library config:
|
||||
|
||||
#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||
# include <utility>
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||
# error "This is not STLPort!"
|
||||
# endif
|
||||
|
@ -30,18 +30,12 @@
|
||||
// remember that since these just declare a bunch of macros, there should be
|
||||
// no namespace issues from this.
|
||||
//
|
||||
#include <limits.h>
|
||||
# if !defined(BOOST_HAS_LONG_LONG) \
|
||||
&& !defined(BOOST_MSVC) && !defined(__BORLANDC__) \
|
||||
&& (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
|
||||
// TODO: Remove the following lines after the 1.33 release because the presence
|
||||
// of an integral 64 bit type has nothing to do with support for long long.
|
||||
|
||||
#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(__DECCXX_VER)
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
#if !defined(BOOST_HAS_LONG_LONG) \
|
||||
&& !defined(BOOST_MSVC) && !defined(__BORLANDC__)
|
||||
# include <limits.h>
|
||||
# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// GCC 3.x will clean up all of those nasty macro definitions that
|
||||
@ -250,6 +244,12 @@
|
||||
//
|
||||
# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
||||
# define BOOST_HAS_STDINT_H
|
||||
# ifndef BOOST_HAS_LOG1P
|
||||
# define BOOST_HAS_LOG1P
|
||||
# endif
|
||||
# ifndef BOOST_HAS_EXPM1
|
||||
# define BOOST_HAS_EXPM1
|
||||
# endif
|
||||
# endif
|
||||
|
||||
//
|
||||
@ -264,6 +264,27 @@
|
||||
# define BOOST_NO_HASH
|
||||
# endif
|
||||
|
||||
//
|
||||
// Set BOOST_SLIST_HEADER if not set already:
|
||||
//
|
||||
#if defined(BOOST_HAS_SLIST) && !defined(BOOST_SLIST_HEADER)
|
||||
# define BOOST_SLIST_HEADER <slist>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set BOOST_HASH_SET_HEADER if not set already:
|
||||
//
|
||||
#if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_SET_HEADER)
|
||||
# define BOOST_HASH_SET_HEADER <hash_set>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set BOOST_HASH_MAP_HEADER if not set already:
|
||||
//
|
||||
#if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_MAP_HEADER)
|
||||
# define BOOST_HASH_MAP_HEADER <hash_map>
|
||||
#endif
|
||||
|
||||
// BOOST_HAS_ABI_HEADERS
|
||||
// This macro gets set if we have headers that fix the ABI,
|
||||
// and prevent ODR violations when linking to external libraries:
|
||||
@ -545,3 +566,4 @@ namespace boost{
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -173,6 +173,7 @@ namespace boost {
|
||||
#else // BOOST_HAS_STDINT_H
|
||||
|
||||
# include <boost/limits.hpp> // implementation artifact; not part of interface
|
||||
# include <limits.h> // needed for limits macros
|
||||
|
||||
|
||||
namespace boost
|
||||
|
@ -58,7 +58,7 @@ struct ct_imp<T, isp, true>
|
||||
template <typename T, bool b1>
|
||||
struct ct_imp<T, true, b1>
|
||||
{
|
||||
typedef T const param_type;
|
||||
typedef const T param_type;
|
||||
};
|
||||
|
||||
}
|
||||
@ -76,7 +76,7 @@ public:
|
||||
// however compiler bugs prevent this - instead pass three bool's to
|
||||
// ct_imp<T,bool,bool,bool> and add an extra partial specialisation
|
||||
// of ct_imp to handle the logic. (JM)
|
||||
typedef typename detail::ct_imp<
|
||||
typedef typename boost::detail::ct_imp<
|
||||
T,
|
||||
::boost::is_pointer<T>::value,
|
||||
::boost::is_arithmetic<T>::value
|
||||
@ -92,7 +92,7 @@ struct call_traits<T&>
|
||||
typedef T& param_type; // hh removed const
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x570 ) )
|
||||
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x581 ) )
|
||||
// these are illegal specialisations; cv-qualifies applied to
|
||||
// references have no effect according to [8.3.2p1],
|
||||
// C++ Builder requires them though as it treats cv-qualified
|
||||
@ -121,6 +121,15 @@ struct call_traits<T&const volatile>
|
||||
typedef const T& const_reference;
|
||||
typedef T& param_type; // hh removed const
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct call_traits< T * >
|
||||
{
|
||||
typedef T * value_type;
|
||||
typedef T * & reference;
|
||||
typedef T * const & const_reference;
|
||||
typedef T * const param_type; // hh removed const
|
||||
};
|
||||
#endif
|
||||
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
||||
template <typename T, std::size_t N>
|
||||
|
@ -27,6 +27,10 @@
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/call_traits.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4512)
|
||||
#endif
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@ -132,7 +136,7 @@ namespace details
|
||||
|
||||
template <class T1, class T2>
|
||||
class compressed_pair_imp<T1, T2, 1>
|
||||
: private ::boost::remove_cv<T1>::type
|
||||
: protected ::boost::remove_cv<T1>::type
|
||||
{
|
||||
public:
|
||||
typedef T1 first_type;
|
||||
@ -174,7 +178,7 @@ namespace details
|
||||
|
||||
template <class T1, class T2>
|
||||
class compressed_pair_imp<T1, T2, 2>
|
||||
: private ::boost::remove_cv<T2>::type
|
||||
: protected ::boost::remove_cv<T2>::type
|
||||
{
|
||||
public:
|
||||
typedef T1 first_type;
|
||||
@ -217,8 +221,8 @@ namespace details
|
||||
|
||||
template <class T1, class T2>
|
||||
class compressed_pair_imp<T1, T2, 3>
|
||||
: private ::boost::remove_cv<T1>::type,
|
||||
private ::boost::remove_cv<T2>::type
|
||||
: protected ::boost::remove_cv<T1>::type,
|
||||
protected ::boost::remove_cv<T2>::type
|
||||
{
|
||||
public:
|
||||
typedef T1 first_type;
|
||||
@ -253,11 +257,14 @@ namespace details
|
||||
|
||||
// JM
|
||||
// 4 T1 == T2, T1 and T2 both empty
|
||||
// Note does not actually store an instance of T2 at all -
|
||||
// but reuses T1 base class for both first() and second().
|
||||
// Originally this did not store an instance of T2 at all
|
||||
// but that led to problems beause it meant &x.first() == &x.second()
|
||||
// which is not true for any other kind of pair, so now we store an instance
|
||||
// of T2 just in case the user is relying on first() and second() returning
|
||||
// different objects (albeit both empty).
|
||||
template <class T1, class T2>
|
||||
class compressed_pair_imp<T1, T2, 4>
|
||||
: private ::boost::remove_cv<T1>::type
|
||||
: protected ::boost::remove_cv<T1>::type
|
||||
{
|
||||
public:
|
||||
typedef T1 first_type;
|
||||
@ -428,5 +435,9 @@ swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
|
||||
|
||||
} // boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP
|
||||
|
||||
|
@ -26,20 +26,66 @@
|
||||
# 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
|
||||
|
||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||
|
||||
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
||||
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
|
||||
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" long __cdecl _InterlockedExchange( long volatile *, long);
|
||||
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long);
|
||||
|
||||
# pragma intrinsic( _InterlockedIncrement )
|
||||
# pragma intrinsic( _InterlockedDecrement )
|
||||
# pragma intrinsic( _InterlockedCompareExchange )
|
||||
# pragma intrinsic( _InterlockedExchange )
|
||||
# pragma intrinsic( _InterlockedExchangeAdd )
|
||||
|
||||
# if defined(_M_IA64) || defined(_M_AMD64)
|
||||
|
||||
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
|
||||
extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
|
||||
|
||||
# pragma intrinsic( _InterlockedCompareExchangePointer )
|
||||
# pragma intrinsic( _InterlockedExchangePointer )
|
||||
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
|
||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
|
||||
|
||||
# else
|
||||
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
||||
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
|
||||
|
||||
# endif
|
||||
|
||||
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
|
||||
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
|
||||
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
||||
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||
|
||||
@ -52,14 +98,23 @@ namespace detail
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
||||
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
||||
# 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
|
||||
|
||||
# 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)))
|
||||
|
||||
#else
|
||||
|
||||
|
@ -4,13 +4,15 @@
|
||||
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
||||
# define IS_INCREMENTABLE_DWA200415_HPP
|
||||
|
||||
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||
# include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
// Must be the last include
|
||||
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||
|
||||
namespace boost { namespace detail {
|
||||
|
||||
// is_incrementable<T> metafunction
|
||||
@ -117,5 +119,6 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
# include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
#endif // IS_INCREMENTABLE_DWA200415_HPP
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <boost/detail/sp_counted_base.hpp>
|
||||
#include <boost/detail/sp_counted_impl.hpp>
|
||||
|
||||
#include <memory> // std::auto_ptr, std::allocator
|
||||
#include <memory> // std::auto_ptr
|
||||
#include <functional> // std::less
|
||||
#include <new> // std::bad_alloc
|
||||
#include <typeinfo> // std::type_info in get_deleter
|
||||
@ -127,6 +127,52 @@ public:
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class P, class D, class A> shared_count( P p, D d, A a ): pi_( 0 )
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
, id_(shared_count_id)
|
||||
#endif
|
||||
{
|
||||
typedef sp_counted_impl_pda<P, D, A> impl_type;
|
||||
typedef typename A::template rebind< impl_type >::other A2;
|
||||
|
||||
A2 a2( a );
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
|
||||
try
|
||||
{
|
||||
pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
|
||||
new( static_cast< void* >( pi_ ) ) impl_type( p, d, a );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
d( p );
|
||||
|
||||
if( pi_ != 0 )
|
||||
{
|
||||
a2.deallocate( static_cast< impl_type* >( pi_ ), 1 );
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
|
||||
|
||||
if( pi_ != 0 )
|
||||
{
|
||||
new( static_cast< void* >( pi_ ) ) impl_type( p, d, a );
|
||||
}
|
||||
else
|
||||
{
|
||||
d( p );
|
||||
boost::throw_exception( std::bad_alloc() );
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ inline void atomic_increment( int * pw )
|
||||
"bne- 0b":
|
||||
|
||||
"=m"( *pw ), "=&b"( tmp ):
|
||||
"r"( pw ):
|
||||
"r"( pw ), "m"( *pw ):
|
||||
"cc"
|
||||
);
|
||||
}
|
||||
@ -69,7 +69,7 @@ inline int atomic_decrement( int * pw )
|
||||
"isync":
|
||||
|
||||
"=m"( *pw ), "=&b"( rv ):
|
||||
"r"( pw ):
|
||||
"r"( pw ), "m"( *pw ):
|
||||
"memory", "cc"
|
||||
);
|
||||
|
||||
@ -95,7 +95,7 @@ inline int atomic_conditional_increment( int * pw )
|
||||
"bne- 0b":
|
||||
|
||||
"=m"( *pw ), "=&b"( rv ):
|
||||
"r"( pw ):
|
||||
"r"( pw ), "m"( *pw ):
|
||||
"cc"
|
||||
);
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
//
|
||||
|
||||
#include <boost/detail/interlocked.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
@ -78,7 +79,19 @@ public:
|
||||
{
|
||||
long tmp = static_cast< long const volatile& >( use_count_ );
|
||||
if( tmp == 0 ) return false;
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1200 )
|
||||
|
||||
// work around a code generation bug
|
||||
|
||||
long tmp2 = tmp + 1;
|
||||
if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp2, tmp ) == tmp2 - 1 ) return true;
|
||||
|
||||
#else
|
||||
|
||||
if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true;
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,10 @@
|
||||
#include <boost/detail/quick_allocator.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SP_USE_STD_ALLOCATOR)
|
||||
#include <memory> // std::allocator
|
||||
#endif
|
||||
|
||||
#include <typeinfo> // std::type_info in get_deleter
|
||||
#include <cstddef> // std::size_t
|
||||
|
||||
@ -176,6 +179,48 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
template<class P, class D, class A> class sp_counted_impl_pda: public sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
P p_; // copy constructor must not throw
|
||||
D d_; // copy constructor must not throw
|
||||
A a_; // copy constructor must not throw
|
||||
|
||||
sp_counted_impl_pda( sp_counted_impl_pda const & );
|
||||
sp_counted_impl_pda & operator= ( sp_counted_impl_pda const & );
|
||||
|
||||
typedef sp_counted_impl_pda<P, D, A> this_type;
|
||||
|
||||
public:
|
||||
|
||||
// pre: d( p ) must not throw
|
||||
|
||||
sp_counted_impl_pda( P p, D d, A a ): p_( p ), d_( d ), a_( a )
|
||||
{
|
||||
}
|
||||
|
||||
virtual void dispose() // nothrow
|
||||
{
|
||||
d_( p_ );
|
||||
}
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
typedef typename A::template rebind< this_type >::other A2;
|
||||
|
||||
A2 a2( a_ );
|
||||
|
||||
this->~this_type();
|
||||
a2.deallocate( this, 1 );
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti )
|
||||
{
|
||||
return ti == typeid( D )? &d_: 0;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __CODEGUARD__
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
@ -9,7 +9,8 @@
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// #if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
// #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// // workaround for eVC4 and VC6
|
||||
// ... // workaround code here
|
||||
// #endif
|
||||
//
|
||||
@ -17,7 +18,7 @@
|
||||
// first argument must be undefined or expand to a numeric
|
||||
// value. The above expands to:
|
||||
//
|
||||
// (BOOST_MSVC) != 0 && (BOOST_MSVC) <= 1200
|
||||
// (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
|
||||
//
|
||||
// When used for workarounds that apply to the latest known version
|
||||
// and all earlier versions of a compiler, the following convention
|
||||
|
@ -58,6 +58,12 @@ public:
|
||||
return p;
|
||||
}
|
||||
|
||||
// Note: No, you don't need to initialize _internal_weak_this
|
||||
//
|
||||
// Please read the documentation, not the code
|
||||
//
|
||||
// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
|
||||
|
||||
typedef T _internal_element_type; // for bcc 5.5.1
|
||||
mutable weak_ptr<_internal_element_type> _internal_weak_this;
|
||||
};
|
||||
|
23
boost/boost/filesystem/cerrno.hpp
Normal file
23
boost/boost/filesystem/cerrno.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// Boost Filesystem cerrno.hpp header --------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2005.
|
||||
// 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)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/filesystem
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_CERRNO_HPP
|
||||
#define BOOST_FILESYSTEM_CERRNO_HPP
|
||||
|
||||
#include <cerrno>
|
||||
|
||||
#if defined __BORLANDC__
|
||||
#define ENOSYS 9997
|
||||
#endif
|
||||
|
||||
#define EBADHANDLE 9998 // bad handle
|
||||
#define EOTHER 9999 // Other error not translatable
|
||||
// to a POSIX errno value
|
||||
|
||||
#endif // include guard
|
@ -1,6 +1,6 @@
|
||||
// boost/filesystem/config.hpp ---------------------------------------------//
|
||||
|
||||
// © Copyright Beman Dawes 2003
|
||||
// Copyright Beman Dawes 2003
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -12,11 +12,57 @@
|
||||
#ifndef BOOST_FILESYSTEM_CONFIG_HPP
|
||||
#define BOOST_FILESYSTEM_CONFIG_HPP
|
||||
|
||||
#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
|
||||
|
||||
// ability to change namespace aids path_table.cpp ------------------------//
|
||||
#ifndef BOOST_FILESYSTEM_NAMESPACE
|
||||
# define BOOST_FILESYSTEM_NAMESPACE filesystem
|
||||
#endif
|
||||
|
||||
// This header implements separate compilation features as described in
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// determine platform ------------------------------------------------------//
|
||||
|
||||
// BOOST_CYGWIN_PATH implies BOOST_WINDOWS_PATH and BOOST_POSIX_API
|
||||
|
||||
# if defined(BOOST_CYGWIN_PATH)
|
||||
# if defined(BOOST_POSIX_PATH)
|
||||
# error BOOST_POSIX_PATH is invalid when BOOST_CYGWIN_PATH is defined
|
||||
# endif
|
||||
# if defined(BOOST_WINDOWS_API)
|
||||
# error BOOST_WINDOWS_API is invalid when BOOST_CYGWIN_PATH is defined
|
||||
# endif
|
||||
# define BOOST_WINDOWS_PATH
|
||||
# define BOOST_POSIX_API
|
||||
# endif
|
||||
|
||||
// BOOST_POSIX_API or BOOST_WINDOWS_API specify which API to use
|
||||
|
||||
# if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
|
||||
# error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
|
||||
# elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )
|
||||
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
|
||||
# define BOOST_WINDOWS_API
|
||||
# else
|
||||
# define BOOST_POSIX_API
|
||||
# endif
|
||||
# endif
|
||||
|
||||
// BOOST_WINDOWS_PATH enables Windows path syntax recognition
|
||||
|
||||
# if !defined(BOOST_POSIX_PATH) && (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
|
||||
# define BOOST_WINDOWS_PATH
|
||||
# endif
|
||||
|
||||
// narrow support only for badly broken compilers or libraries -------------//
|
||||
|
||||
# if defined(BOOST_NO_STD_WSTRING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STD_LOCALE)
|
||||
# define BOOST_FILESYSTEM_NARROW_ONLY
|
||||
# endif
|
||||
|
||||
// enable dynamic linking on Windows ---------------------------------------//
|
||||
|
||||
# if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)) && defined(__BORLANDC__) && defined(__WIN32__)
|
||||
|
@ -1,7 +1,7 @@
|
||||
// boost/filesystem/convenience.hpp ----------------------------------------//
|
||||
|
||||
// © Copyright Beman Dawes, 2002
|
||||
// © Copyright Vladimir Prus, 2002
|
||||
// Copyright Beman Dawes, 2002-2005
|
||||
// Copyright Vladimir Prus, 2002
|
||||
// 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)
|
||||
@ -13,27 +13,319 @@
|
||||
#ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
#define BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
|
||||
#include <boost/filesystem/path.hpp> // includes <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <vector>
|
||||
#include <stack>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last header
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last #include
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
# define BOOST_FS_FUNC(BOOST_FS_TYPE) \
|
||||
template<class Path> typename boost::enable_if<is_basic_path<Path>, \
|
||||
BOOST_FS_TYPE>::type
|
||||
# define BOOST_FS_FUNC_STRING BOOST_FS_FUNC(typename Path::string_type)
|
||||
# define BOOST_FS_TYPENAME typename
|
||||
# else
|
||||
# define BOOST_FS_FUNC(BOOST_FS_TYPE) inline BOOST_FS_TYPE
|
||||
typedef boost::filesystem::path Path;
|
||||
# define BOOST_FS_FUNC_STRING std::string
|
||||
# define BOOST_FS_TYPENAME
|
||||
# endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace filesystem
|
||||
{
|
||||
|
||||
BOOST_FILESYSTEM_DECL bool create_directories(const path& ph);
|
||||
BOOST_FS_FUNC(bool) create_directories(const Path& ph)
|
||||
{
|
||||
if (ph.empty() || exists(ph))
|
||||
{
|
||||
if ( !ph.empty() && !is_directory(ph) )
|
||||
boost::throw_exception( basic_filesystem_error<Path>(
|
||||
"boost::filesystem::create_directories", ph, -1 ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL std::string extension(const path& ph);
|
||||
// First create branch, by calling ourself recursively
|
||||
create_directories(ph.branch_path());
|
||||
// Now that parent's path exists, create the directory
|
||||
create_directory(ph);
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL std::string basename(const path& ph);
|
||||
BOOST_FS_FUNC_STRING extension(const Path& ph)
|
||||
{
|
||||
typedef BOOST_FS_TYPENAME Path::string_type string_type;
|
||||
string_type leaf = ph.leaf();
|
||||
|
||||
BOOST_FILESYSTEM_DECL path change_extension(const path& ph,
|
||||
const std::string& new_extension);
|
||||
BOOST_FS_TYPENAME string_type::size_type n = leaf.rfind('.');
|
||||
if (n != string_type::npos)
|
||||
return leaf.substr(n);
|
||||
else
|
||||
return string_type();
|
||||
}
|
||||
|
||||
BOOST_FS_FUNC_STRING basename(const Path& ph)
|
||||
{
|
||||
typedef BOOST_FS_TYPENAME Path::string_type string_type;
|
||||
string_type leaf = ph.leaf();
|
||||
BOOST_FS_TYPENAME string_type::size_type n = leaf.rfind('.');
|
||||
return leaf.substr(0, n);
|
||||
}
|
||||
|
||||
BOOST_FS_FUNC(Path) change_extension( const Path & ph,
|
||||
const BOOST_FS_TYPENAME Path::string_type & new_extension )
|
||||
{ return ph.branch_path() / (basename(ph) + new_extension); }
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
|
||||
// "do-the-right-thing" overloads ---------------------------------------//
|
||||
|
||||
inline bool create_directories(const path& ph)
|
||||
{ return create_directories<path>(ph); }
|
||||
inline bool create_directories(const wpath& ph)
|
||||
{ return create_directories<wpath>(ph); }
|
||||
|
||||
inline std::string extension(const path& ph)
|
||||
{ return extension<path>(ph); }
|
||||
inline std::wstring extension(const wpath& ph)
|
||||
{ return extension<wpath>(ph); }
|
||||
|
||||
inline std::string basename(const path& ph)
|
||||
{ return basename<path>( ph ); }
|
||||
inline std::wstring basename(const wpath& ph)
|
||||
{ return basename<wpath>( ph ); }
|
||||
|
||||
inline path change_extension( const path & ph, const std::string& new_ex )
|
||||
{ return change_extension<path>( ph, new_ex ); }
|
||||
inline wpath change_extension( const wpath & ph, const std::wstring& new_ex )
|
||||
{ return change_extension<wpath>( ph, new_ex ); }
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
// basic_recursive_directory_iterator helpers --------------------------//
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template< class Path >
|
||||
struct recur_dir_itr_imp
|
||||
{
|
||||
typedef basic_directory_iterator< Path > element_type;
|
||||
std::stack< element_type, std::vector< element_type > > m_stack;
|
||||
int m_level;
|
||||
bool m_no_push;
|
||||
bool m_no_throw;
|
||||
|
||||
recur_dir_itr_imp() : m_level(0), m_no_push(false), m_no_throw(false) {}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// basic_recursive_directory_iterator ----------------------------------//
|
||||
|
||||
template< class Path >
|
||||
class basic_recursive_directory_iterator
|
||||
: public boost::iterator_facade<
|
||||
basic_recursive_directory_iterator<Path>,
|
||||
basic_directory_entry<Path>,
|
||||
boost::single_pass_traversal_tag >
|
||||
{
|
||||
public:
|
||||
typedef Path path_type;
|
||||
|
||||
basic_recursive_directory_iterator(){} // creates the "end" iterator
|
||||
|
||||
explicit basic_recursive_directory_iterator( const Path & dir_path );
|
||||
basic_recursive_directory_iterator( const Path & dir_path, system_error_type & ec );
|
||||
|
||||
int level() const { return m_imp->m_level; }
|
||||
|
||||
void pop();
|
||||
void no_push()
|
||||
{
|
||||
BOOST_ASSERT( m_imp.get() && "attempt to no_push() on end iterator" );
|
||||
m_imp->m_no_push = true;
|
||||
}
|
||||
|
||||
file_status status() const
|
||||
{
|
||||
BOOST_ASSERT( m_imp.get()
|
||||
&& "attempt to call status() on end recursive_iterator" );
|
||||
return m_imp->m_stack.top()->status();
|
||||
}
|
||||
|
||||
file_status symlink_status() const
|
||||
{
|
||||
BOOST_ASSERT( m_imp.get()
|
||||
&& "attempt to call symlink_status() on end recursive_iterator" );
|
||||
return m_imp->m_stack.top()->symlink_status();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// shared_ptr provides shallow-copy semantics required for InputIterators.
|
||||
// m_imp.get()==0 indicates the end iterator.
|
||||
boost::shared_ptr< detail::recur_dir_itr_imp< Path > > m_imp;
|
||||
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
typename boost::iterator_facade<
|
||||
basic_recursive_directory_iterator<Path>,
|
||||
basic_directory_entry<Path>,
|
||||
boost::single_pass_traversal_tag >::reference
|
||||
dereference() const
|
||||
{
|
||||
BOOST_ASSERT( m_imp.get() && "attempt to dereference end iterator" );
|
||||
return *m_imp->m_stack.top();
|
||||
}
|
||||
|
||||
void increment();
|
||||
|
||||
bool equal( const basic_recursive_directory_iterator & rhs ) const
|
||||
{ return m_imp == rhs.m_imp; }
|
||||
};
|
||||
|
||||
typedef basic_recursive_directory_iterator<path> recursive_directory_iterator;
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
typedef basic_recursive_directory_iterator<wpath> wrecursive_directory_iterator;
|
||||
# endif
|
||||
|
||||
// basic_recursive_directory_iterator implementation -------------------//
|
||||
|
||||
// constructors
|
||||
template<class Path>
|
||||
basic_recursive_directory_iterator<Path>::
|
||||
basic_recursive_directory_iterator( const Path & dir_path )
|
||||
: m_imp( new detail::recur_dir_itr_imp<Path> )
|
||||
{
|
||||
m_imp->m_stack.push( basic_directory_iterator<Path>( dir_path ) );
|
||||
}
|
||||
|
||||
template<class Path>
|
||||
basic_recursive_directory_iterator<Path>::
|
||||
basic_recursive_directory_iterator( const Path & dir_path, system_error_type & ec )
|
||||
: m_imp( new detail::recur_dir_itr_imp<Path> )
|
||||
{
|
||||
m_imp->m_stack.push( basic_directory_iterator<Path>( dir_path, std::nothrow ) );
|
||||
m_imp->m_no_throw = true;
|
||||
}
|
||||
|
||||
// increment
|
||||
template<class Path>
|
||||
void basic_recursive_directory_iterator<Path>::increment()
|
||||
{
|
||||
BOOST_ASSERT( m_imp.get() && "increment on end iterator" );
|
||||
|
||||
static const basic_directory_iterator<Path> end_itr;
|
||||
|
||||
if ( m_imp->m_no_push ) m_imp->m_no_push = false;
|
||||
else if ( is_directory( m_imp->m_stack.top()->status() ) )
|
||||
{
|
||||
system_error_type ec;
|
||||
m_imp->m_stack.push(
|
||||
m_imp->m_no_throw
|
||||
? basic_directory_iterator<Path>( *m_imp->m_stack.top(), ec )
|
||||
: basic_directory_iterator<Path>( *m_imp->m_stack.top() )
|
||||
);
|
||||
if ( m_imp->m_stack.top() != end_itr )
|
||||
{
|
||||
++m_imp->m_level;
|
||||
return;
|
||||
}
|
||||
m_imp->m_stack.pop();
|
||||
}
|
||||
|
||||
while ( !m_imp->m_stack.empty()
|
||||
&& ++m_imp->m_stack.top() == end_itr )
|
||||
{
|
||||
m_imp->m_stack.pop();
|
||||
--m_imp->m_level;
|
||||
}
|
||||
|
||||
if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
|
||||
}
|
||||
|
||||
// pop
|
||||
template<class Path>
|
||||
void basic_recursive_directory_iterator<Path>::pop()
|
||||
{
|
||||
BOOST_ASSERT( m_imp.get() && "pop on end iterator" );
|
||||
BOOST_ASSERT( m_imp->m_level > 0 && "pop with level < 1" );
|
||||
|
||||
m_imp->m_stack.pop();
|
||||
--m_imp->m_level;
|
||||
}
|
||||
|
||||
// what() basic_filesystem_error_decoder -------------------------------//
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
# if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x581))
|
||||
using boost::filesystem::system_message;
|
||||
# endif
|
||||
|
||||
inline void decode_system_message( system_error_type ec, std::string & target )
|
||||
{
|
||||
system_message( ec, target );
|
||||
}
|
||||
|
||||
# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)
|
||||
inline void decode_system_message( system_error_type ec, std::wstring & target )
|
||||
{
|
||||
system_message( ec, target );
|
||||
}
|
||||
# endif
|
||||
|
||||
template<class String>
|
||||
void decode_system_message( system_error_type ec, String & target )
|
||||
{
|
||||
std::string temp;
|
||||
system_message( ec, temp );
|
||||
for ( const char * p = temp.c_str(); *p != 0; ++p )
|
||||
{ target += static_cast<typename String::value_type>( *p ); }
|
||||
}
|
||||
}
|
||||
|
||||
template<class Path>
|
||||
typename Path::string_type what( const basic_filesystem_error<Path> & ex )
|
||||
{
|
||||
typename Path::string_type s;
|
||||
for ( const char * p = ex.what(); *p != 0; ++p )
|
||||
{ s += static_cast<typename Path::string_type::value_type>( *p ); }
|
||||
|
||||
if ( !ex.path1().empty() )
|
||||
{
|
||||
s += static_cast<typename Path::string_type::value_type>( ':' );
|
||||
s += static_cast<typename Path::string_type::value_type>( ' ' );
|
||||
s += static_cast<typename Path::string_type::value_type>( '\"' );
|
||||
s += ex.path1().file_string();
|
||||
s += static_cast<typename Path::string_type::value_type>( '\"' );
|
||||
}
|
||||
if ( !ex.path2().empty() )
|
||||
{
|
||||
s += static_cast<typename Path::string_type::value_type>( ',' );
|
||||
s += static_cast<typename Path::string_type::value_type>( ' ' );
|
||||
s += static_cast<typename Path::string_type::value_type>( '\"' );
|
||||
s += ex.path2().file_string();
|
||||
s += static_cast<typename Path::string_type::value_type>( '\"' );
|
||||
}
|
||||
if ( ex.system_error() )
|
||||
{
|
||||
s += static_cast<typename Path::string_type::value_type>( ' ' );
|
||||
|
||||
detail::decode_system_message( ex.system_error(), s );
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
#undef BOOST_FS_FUNC_STRING
|
||||
#undef BOOST_FS_FUNC
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
|
||||
#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
|
@ -1,106 +1,9 @@
|
||||
// boost/filesystem/exception.hpp ------------------------------------------//
|
||||
// boost/filesystem/exception.hpp -------------------------------------------//
|
||||
|
||||
// Copyright © 2002 Beman Dawes
|
||||
// Copyright © 2001 Dietmar Kühl
|
||||
//
|
||||
// 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)
|
||||
// Copyright Beman Dawes 2003
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/filesystem
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_EXCEPTION_HPP
|
||||
#define BOOST_FILESYSTEM_EXCEPTION_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <exception>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last header
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace filesystem
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
BOOST_FILESYSTEM_DECL int system_error_code(); // artifact of POSIX and WINDOWS error reporting
|
||||
}
|
||||
|
||||
enum error_code
|
||||
{
|
||||
no_error = 0,
|
||||
system_error, // system generated error; if possible, is translated
|
||||
// to one of the more specific errors below.
|
||||
other_error, // library generated error
|
||||
security_error, // includes access rights, permissions failures
|
||||
read_only_error,
|
||||
io_error,
|
||||
path_error,
|
||||
not_found_error,
|
||||
not_directory_error,
|
||||
busy_error, // implies trying again might succeed
|
||||
already_exists_error,
|
||||
not_empty_error,
|
||||
is_directory_error,
|
||||
out_of_space_error,
|
||||
out_of_memory_error,
|
||||
out_of_resource_error
|
||||
};
|
||||
|
||||
|
||||
class BOOST_FILESYSTEM_DECL filesystem_error : public std::exception
|
||||
{
|
||||
public:
|
||||
|
||||
filesystem_error(
|
||||
const std::string & who,
|
||||
const std::string & message ); // assumed to be error_code::other_error
|
||||
|
||||
filesystem_error(
|
||||
const std::string & who,
|
||||
const path & path1,
|
||||
const std::string & message,
|
||||
error_code ec = other_error );
|
||||
|
||||
filesystem_error(
|
||||
const std::string & who,
|
||||
const path & path1,
|
||||
int sys_err_code );
|
||||
|
||||
filesystem_error(
|
||||
const std::string & who,
|
||||
const path & path1,
|
||||
const path & path2,
|
||||
int sys_err_code );
|
||||
|
||||
~filesystem_error() throw();
|
||||
|
||||
virtual const char * what() const throw();
|
||||
|
||||
int native_error() const { return m_sys_err; }
|
||||
// Note: a value of 0 implies a library (rather than system) error
|
||||
error_code error() const { return m_err; }
|
||||
const std::string & who() const; // name of who throwing exception
|
||||
const path & path1() const; // argument 1 to who; may be empty()
|
||||
const path & path2() const; // argument 2 to who; may be empty()
|
||||
|
||||
private:
|
||||
class m_imp;
|
||||
shared_ptr<m_imp> m_imp_ptr;
|
||||
int m_sys_err;
|
||||
error_code m_err;
|
||||
};
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
#endif // BOOST_FILESYSTEM_EXCEPTION_HPP
|
||||
// This header is no long used. The contents have been moved to path.hpp.
|
||||
// It is provided so that user code #includes do not have to be changed.
|
||||
|
@ -12,180 +12,573 @@
|
||||
#ifndef BOOST_FILESYSTEM_FSTREAM_HPP
|
||||
#define BOOST_FILESYSTEM_FSTREAM_HPP
|
||||
|
||||
#include <boost/filesystem/path.hpp> // includes <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/operations.hpp> // for 8.3 hack (see below)
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <iosfwd>
|
||||
#include <fstream>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last header
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last #include
|
||||
|
||||
// NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for
|
||||
// various compiler problems. They have been removed to ease development of the
|
||||
// basic i18n functionality. Once the new interface is stable, the workarounds
|
||||
// will be reinstated for any compilers that otherwise can support the rest of
|
||||
// the library after internationalization.
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace filesystem
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)
|
||||
# if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
|
||||
// The 8.3 hack:
|
||||
// C++98 does not supply a wchar_t open, so try to get an equivalent
|
||||
// narrow char name based on the short, so-called 8.3, name.
|
||||
// Not needed for Dinkumware 405 and later as they do supply wchar_t open.
|
||||
BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
|
||||
std::ios_base::openmode mode ); // true if succeeds
|
||||
BOOST_FILESYSTEM_DECL std::string narrow_path_api(
|
||||
const std::wstring & ph ); // return is empty if fails
|
||||
|
||||
inline std::string path_proxy( const std::wstring & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
// Return a non-existant path if cannot supply narrow short path.
|
||||
// An empty path doesn't work because some Dinkumware versions
|
||||
// assert the path is non-empty.
|
||||
{
|
||||
std::string narrow_ph;
|
||||
bool created_file( false );
|
||||
if ( !exists( file_ph )
|
||||
&& (mode & std::ios_base::out) != 0
|
||||
&& create_file_api( file_ph, mode ) )
|
||||
{
|
||||
created_file = true;
|
||||
}
|
||||
narrow_ph = narrow_path_api( file_ph );
|
||||
if ( narrow_ph.empty() )
|
||||
{
|
||||
if ( created_file ) remove_api( file_ph );
|
||||
narrow_ph = "\x01";
|
||||
}
|
||||
return narrow_ph;
|
||||
}
|
||||
# else
|
||||
// Dinkumware 405 and later does supply wchar_t functions
|
||||
inline const std::wstring & path_proxy( const std::wstring & file_ph,
|
||||
std::ios_base::openmode )
|
||||
{ return file_ph; }
|
||||
# endif
|
||||
# endif
|
||||
|
||||
inline const std::string & path_proxy( const std::string & file_ph,
|
||||
std::ios_base::openmode )
|
||||
{ return file_ph; }
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template < class charT, class traits = std::char_traits<charT> >
|
||||
class basic_filebuf : public std::basic_filebuf<charT,traits>
|
||||
{
|
||||
private: // disallow copying
|
||||
basic_filebuf( const basic_filebuf & );
|
||||
const basic_filebuf & operator=( const basic_filebuf & );
|
||||
public:
|
||||
basic_filebuf() {}
|
||||
virtual ~basic_filebuf() {}
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
std::basic_filebuf<charT,traits> * open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
return std::basic_filebuf<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef basic_filebuf<char> filebuf;
|
||||
# ifndef BOOST_NO_STD_WSTRING
|
||||
typedef basic_filebuf<wchar_t> wfilebuf;
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>,
|
||||
basic_filebuf<charT,traits> *>::type
|
||||
open( const Path & file_ph, std::ios_base::openmode mode );
|
||||
|
||||
basic_filebuf<charT,traits> *
|
||||
open( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
# endif
|
||||
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
basic_filebuf<charT,traits> *
|
||||
open( const path & file_ph, std::ios_base::openmode mode );
|
||||
# endif
|
||||
};
|
||||
|
||||
template < class charT, class traits = std::char_traits<charT> >
|
||||
class basic_ifstream : public std::basic_ifstream<charT,traits>
|
||||
{
|
||||
private: // disallow copying
|
||||
basic_ifstream( const basic_ifstream & );
|
||||
const basic_ifstream & operator=( const basic_ifstream & );
|
||||
public:
|
||||
basic_ifstream() {}
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
|
||||
explicit basic_ifstream( const path & file_ph,
|
||||
std::ios_base::openmode mode = std::ios_base::in )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), mode ) {}
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
void open( const path & file_ph,
|
||||
std::ios_base::openmode mode = std::ios_base::in )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
# endif
|
||||
#else // workaround for VC++ 7.1 bug id VSWhidbey 38416
|
||||
explicit basic_ifstream( const path & file_ph )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), std::ios_base::in ) {}
|
||||
basic_ifstream( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), mode ) {}
|
||||
void open( const path & file_ph )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), std::ios_base::in );
|
||||
}
|
||||
void open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
#endif
|
||||
|
||||
// use two signatures, rather than one signature with default second
|
||||
// argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
template<class Path>
|
||||
explicit basic_ifstream( const Path & file_ph,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
|
||||
|
||||
template<class Path>
|
||||
basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
|
||||
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
open( const Path & file_ph );
|
||||
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
open( const Path & file_ph, std::ios_base::openmode mode );
|
||||
|
||||
explicit basic_ifstream( const wpath & file_ph );
|
||||
basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
void open( const wpath & file_ph );
|
||||
void open( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
# endif
|
||||
|
||||
explicit basic_ifstream( const path & file_ph );
|
||||
basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
void open( const path & file_ph );
|
||||
void open( const path & file_ph, std::ios_base::openmode mode );
|
||||
# endif
|
||||
virtual ~basic_ifstream() {}
|
||||
};
|
||||
|
||||
typedef basic_ifstream<char> ifstream;
|
||||
# ifndef BOOST_NO_STD_WSTRING
|
||||
typedef basic_ifstream<wchar_t> wifstream;
|
||||
# endif
|
||||
|
||||
template < class charT, class traits = std::char_traits<charT> >
|
||||
class basic_ofstream : public std::basic_ofstream<charT,traits>
|
||||
{
|
||||
private: // disallow copying
|
||||
basic_ofstream( const basic_ofstream & );
|
||||
const basic_ofstream & operator=( const basic_ofstream & );
|
||||
public:
|
||||
basic_ofstream() {}
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
|
||||
explicit basic_ofstream( const path & file_ph,
|
||||
std::ios_base::openmode mode = std::ios_base::out )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), mode ) {}
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
void open( const path & file_ph,
|
||||
std::ios_base::openmode mode = std::ios_base::out )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
# endif
|
||||
#else // workaround for VC++ 7.1 bug id VSWhidbey 38416
|
||||
explicit basic_ofstream( const path & file_ph )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), std::ios_base::out ) {}
|
||||
basic_ofstream( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), mode ) {}
|
||||
void open( const path & file_ph )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), std::ios_base::out );
|
||||
}
|
||||
void open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
#endif
|
||||
|
||||
// use two signatures, rather than one signature with default second
|
||||
// argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
|
||||
template<class Path>
|
||||
explicit basic_ofstream( const Path & file_ph,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
|
||||
explicit basic_ofstream( const wpath & file_ph );
|
||||
|
||||
template<class Path>
|
||||
basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
|
||||
basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
open( const Path & file_ph );
|
||||
void open( const wpath & file_ph );
|
||||
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
open( const Path & file_ph, std::ios_base::openmode mode );
|
||||
void open( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
|
||||
# endif
|
||||
|
||||
explicit basic_ofstream( const path & file_ph );
|
||||
basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
void open( const path & file_ph );
|
||||
void open( const path & file_ph, std::ios_base::openmode mode );
|
||||
# endif
|
||||
virtual ~basic_ofstream() {}
|
||||
};
|
||||
|
||||
typedef basic_ofstream<char> ofstream;
|
||||
# ifndef BOOST_NO_STD_WSTRING
|
||||
typedef basic_ofstream<wchar_t> wofstream;
|
||||
# endif
|
||||
|
||||
template < class charT, class traits = std::char_traits<charT> >
|
||||
class basic_fstream : public std::basic_fstream<charT,traits>
|
||||
{
|
||||
private: // disallow copying
|
||||
basic_fstream( const basic_fstream & );
|
||||
const basic_fstream & operator=( const basic_fstream & );
|
||||
public:
|
||||
basic_fstream() {}
|
||||
#if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
|
||||
explicit basic_fstream( const path & file_ph,
|
||||
std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), mode ) {}
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
void open( const path & file_ph,
|
||||
std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
# endif
|
||||
#else // workaround for VC++ 7.1 bug id VSWhidbey 38416
|
||||
explicit basic_fstream( const path & file_ph )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(),
|
||||
std::ios_base::in|std::ios_base::out ) {}
|
||||
basic_fstream( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
file_ph.native_file_string().c_str(), mode ) {}
|
||||
void open( const path & file_ph )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(),
|
||||
std::ios_base::in|std::ios_base::out );
|
||||
}
|
||||
void open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
file_ph.native_file_string().c_str(), mode );
|
||||
}
|
||||
#endif
|
||||
|
||||
// use two signatures, rather than one signature with default second
|
||||
// argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
|
||||
template<class Path>
|
||||
explicit basic_fstream( const Path & file_ph,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
|
||||
explicit basic_fstream( const wpath & file_ph );
|
||||
|
||||
template<class Path>
|
||||
basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
|
||||
basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
open( const Path & file_ph );
|
||||
void open( const wpath & file_ph );
|
||||
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
open( const Path & file_ph, std::ios_base::openmode mode );
|
||||
void open( const wpath & file_ph, std::ios_base::openmode mode );
|
||||
|
||||
# endif
|
||||
|
||||
explicit basic_fstream( const path & file_ph );
|
||||
basic_fstream( const path & file_ph, std::ios_base::openmode mode );
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
void open( const path & file_ph );
|
||||
void open( const path & file_ph, std::ios_base::openmode mode );
|
||||
# endif
|
||||
virtual ~basic_fstream() {}
|
||||
|
||||
};
|
||||
|
||||
typedef basic_filebuf<char> filebuf;
|
||||
typedef basic_ifstream<char> ifstream;
|
||||
typedef basic_ofstream<char> ofstream;
|
||||
typedef basic_fstream<char> fstream;
|
||||
# ifndef BOOST_NO_STD_WSTRING
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
typedef basic_filebuf<wchar_t> wfilebuf;
|
||||
typedef basic_ifstream<wchar_t> wifstream;
|
||||
typedef basic_fstream<wchar_t> wfstream;
|
||||
typedef basic_ofstream<wchar_t> wofstream;
|
||||
# endif
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
||||
|
||||
// basic_filebuf definitions -----------------------------------------------//
|
||||
|
||||
template <class charT, class traits>
|
||||
template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>,
|
||||
basic_filebuf<charT,traits> *>::type
|
||||
basic_filebuf<charT,traits>::open( const Path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
|
||||
file_ph.external_file_string(), mode ).c_str(), mode )
|
||||
== 0) ? 0 : this;
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_filebuf<charT,traits> *
|
||||
basic_filebuf<charT, traits>::open( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
|
||||
}
|
||||
|
||||
// basic_ifstream definitions ----------------------------------------------//
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in ).c_str(), std::ios_base::in ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in ).c_str(), std::ios_base::in ) {}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
|
||||
std::ios_base::openmode mode,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in ) {}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
basic_ifstream<charT,traits>::open( const Path & file_ph )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in ).c_str(), std::ios_base::in );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_ifstream<charT,traits>::open( const wpath & file_ph )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in ).c_str(), std::ios_base::in );
|
||||
}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
basic_ifstream<charT,traits>::open( const Path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_ifstream<charT,traits>::open( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in );
|
||||
}
|
||||
|
||||
// basic_ofstream definitions ----------------------------------------------//
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::out ).c_str(), std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::out ).c_str(), std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
|
||||
std::ios_base::openmode mode,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
basic_ofstream<charT,traits>::open( const Path & file_ph )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::out ).c_str(), std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_ofstream<charT,traits>::open( const wpath & file_ph )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::out ).c_str(), std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
basic_ofstream<charT,traits>::open( const Path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_ofstream<charT,traits>::open( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::out );
|
||||
}
|
||||
|
||||
// basic_fstream definitions -----------------------------------------------//
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in|std::ios_base::out ).c_str(),
|
||||
std::ios_base::in|std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in|std::ios_base::out ).c_str(),
|
||||
std::ios_base::in|std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
|
||||
std::ios_base::openmode mode,
|
||||
typename boost::enable_if<is_basic_path<Path> >::type* )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
basic_fstream<charT,traits>::open( const Path & file_ph )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in|std::ios_base::out ).c_str(),
|
||||
std::ios_base::in|std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_fstream<charT,traits>::open( const wpath & file_ph )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
std::ios_base::in|std::ios_base::out ).c_str(),
|
||||
std::ios_base::in|std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits> template<class Path>
|
||||
typename boost::enable_if<is_basic_path<Path>, void>::type
|
||||
basic_fstream<charT,traits>::open( const Path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_fstream<charT,traits>::open( const wpath & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
detail::path_proxy( file_ph.external_file_string(),
|
||||
mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
template <class charT, class traits>
|
||||
basic_filebuf<charT,traits> *
|
||||
basic_filebuf<charT, traits>::open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
return std::basic_filebuf<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
|
||||
}
|
||||
# endif
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
file_ph.file_string().c_str(), std::ios_base::in ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_ifstream<charT,traits>(
|
||||
file_ph.file_string().c_str(), mode ) {}
|
||||
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
template <class charT, class traits>
|
||||
void basic_ifstream<charT,traits>::open( const path & file_ph )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), std::ios_base::in );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_ifstream<charT,traits>::open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ifstream<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), mode );
|
||||
}
|
||||
# endif
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
file_ph.file_string().c_str(), std::ios_base::out ) {}
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_ofstream<charT,traits>(
|
||||
file_ph.file_string().c_str(), mode ) {}
|
||||
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
template <class charT, class traits>
|
||||
void basic_ofstream<charT,traits>::open( const path & file_ph )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_ofstream<charT,traits>::open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_ofstream<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), mode );
|
||||
}
|
||||
# endif
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
file_ph.file_string().c_str(),
|
||||
std::ios_base::in|std::ios_base::out ) {}
|
||||
|
||||
|
||||
template <class charT, class traits>
|
||||
basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
: std::basic_fstream<charT,traits>(
|
||||
file_ph.file_string().c_str(), mode ) {}
|
||||
|
||||
# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
|
||||
template <class charT, class traits>
|
||||
void basic_fstream<charT,traits>::open( const path & file_ph )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
|
||||
}
|
||||
|
||||
template <class charT, class traits>
|
||||
void basic_fstream<charT,traits>::open( const path & file_ph,
|
||||
std::ios_base::openmode mode )
|
||||
{
|
||||
std::basic_fstream<charT,traits>::open(
|
||||
file_ph.file_string().c_str(), mode );
|
||||
}
|
||||
# endif
|
||||
} // namespace filesystem
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
|
||||
#endif // BOOST_FILESYSTEM_FSTREAM_HPP
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,8 @@ namespace detail {
|
||||
res.reserve(size + !!prefix_space);
|
||||
if(prefix_space)
|
||||
res.append(1, prefix_space);
|
||||
res.append(beg, size);
|
||||
if (size)
|
||||
res.append(beg, size);
|
||||
}
|
||||
else {
|
||||
std::streamsize n=static_cast<std::streamsize>(w-size-!!prefix_space);
|
||||
@ -62,7 +63,8 @@ namespace detail {
|
||||
if(n_before) res.append(n_before, fill_char);
|
||||
if(prefix_space)
|
||||
res.append(1, prefix_space);
|
||||
res.append(beg, size);
|
||||
if (size)
|
||||
res.append(beg, size);
|
||||
if(n_after) res.append(n_after, fill_char);
|
||||
}
|
||||
} // -mk_str(..)
|
||||
|
@ -135,7 +135,7 @@ namespace boost {
|
||||
|
||||
for(unsigned long i=0; i<items_.size(); ++i) {
|
||||
// clear converted strings only if the corresponding argument is not bound :
|
||||
if( bound_.size()==0 || !bound_[ items_[i].argN_ ] )
|
||||
if( bound_.size()==0 || items_[i].argN_<0 || !bound_[ items_[i].argN_ ] )
|
||||
items_[i].res_.resize(0);
|
||||
}
|
||||
cur_arg_=0; dumped_=false;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2001-2004. Use, modification and
|
||||
// Copyright Douglas Gregor 2001-2006. 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)
|
||||
@ -19,10 +19,10 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#include <boost/type_traits/is_stateless.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/pending/ct_if.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
# include "boost/utility/enable_if.hpp"
|
||||
#else
|
||||
@ -105,42 +105,36 @@ inline void swap(function<Signature, Allocator>& f1,
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace function {
|
||||
class X;
|
||||
|
||||
/**
|
||||
* A union of a function pointer and a void pointer. This is necessary
|
||||
* because 5.2.10/6 allows reinterpret_cast<> to safely cast between
|
||||
* function pointer types and 5.2.9/10 allows static_cast<> to safely
|
||||
* cast between a void pointer and an object pointer. But it is not legal
|
||||
* to cast between a function pointer and a void* (in either direction),
|
||||
* so function requires a union of the two. */
|
||||
union any_pointer
|
||||
* A buffer used to store small function objects in
|
||||
* boost::function. It is a union containing function pointers,
|
||||
* object pointers, and a structure that resembles a bound
|
||||
* member function pointer.
|
||||
*/
|
||||
union function_buffer
|
||||
{
|
||||
// For pointers to function objects
|
||||
void* obj_ptr;
|
||||
|
||||
// For pointers to std::type_info objects
|
||||
// (get_functor_type_tag, check_functor_type_tag).
|
||||
const void* const_obj_ptr;
|
||||
void (*func_ptr)();
|
||||
char data[1];
|
||||
|
||||
// For function pointers of all kinds
|
||||
mutable void (*func_ptr)();
|
||||
|
||||
// For bound member pointers
|
||||
struct bound_memfunc_ptr_t {
|
||||
void (X::*memfunc_ptr)(int);
|
||||
void* obj_ptr;
|
||||
} bound_memfunc_ptr;
|
||||
|
||||
// To relax aliasing constraints
|
||||
mutable char data;
|
||||
};
|
||||
|
||||
inline any_pointer make_any_pointer(void* o)
|
||||
{
|
||||
any_pointer p;
|
||||
p.obj_ptr = o;
|
||||
return p;
|
||||
}
|
||||
|
||||
inline any_pointer make_any_pointer(const void* o)
|
||||
{
|
||||
any_pointer p;
|
||||
p.const_obj_ptr = o;
|
||||
return p;
|
||||
}
|
||||
|
||||
inline any_pointer make_any_pointer(void (*f)())
|
||||
{
|
||||
any_pointer p;
|
||||
p.func_ptr = f;
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unusable class is a placeholder for unused function arguments
|
||||
* It is also completely unusable except that it constructable from
|
||||
@ -169,7 +163,8 @@ namespace boost {
|
||||
enum functor_manager_operation_type {
|
||||
clone_functor_tag,
|
||||
destroy_functor_tag,
|
||||
check_functor_type_tag
|
||||
check_functor_type_tag,
|
||||
get_functor_type_tag
|
||||
};
|
||||
|
||||
// Tags used to decide between different types of functions
|
||||
@ -177,57 +172,79 @@ namespace boost {
|
||||
struct function_obj_tag {};
|
||||
struct member_ptr_tag {};
|
||||
struct function_obj_ref_tag {};
|
||||
struct stateless_function_obj_tag {};
|
||||
|
||||
template<typename F>
|
||||
class get_function_tag
|
||||
{
|
||||
typedef typename ct_if<(is_pointer<F>::value),
|
||||
function_ptr_tag,
|
||||
function_obj_tag>::type ptr_or_obj_tag;
|
||||
typedef typename mpl::if_c<(is_pointer<F>::value),
|
||||
function_ptr_tag,
|
||||
function_obj_tag>::type ptr_or_obj_tag;
|
||||
|
||||
typedef typename ct_if<(is_member_pointer<F>::value),
|
||||
member_ptr_tag,
|
||||
ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
|
||||
typedef typename mpl::if_c<(is_member_pointer<F>::value),
|
||||
member_ptr_tag,
|
||||
ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
|
||||
|
||||
typedef typename ct_if<(is_reference_wrapper<F>::value),
|
||||
function_obj_ref_tag,
|
||||
ptr_or_obj_or_mem_tag>::type or_ref_tag;
|
||||
typedef typename mpl::if_c<(is_reference_wrapper<F>::value),
|
||||
function_obj_ref_tag,
|
||||
ptr_or_obj_or_mem_tag>::type or_ref_tag;
|
||||
|
||||
public:
|
||||
typedef typename ct_if<(is_stateless<F>::value),
|
||||
stateless_function_obj_tag,
|
||||
or_ref_tag>::type type;
|
||||
typedef or_ref_tag type;
|
||||
};
|
||||
|
||||
// The trivial manager does nothing but return the same pointer (if we
|
||||
// are cloning) or return the null pointer (if we are deleting).
|
||||
template<typename F>
|
||||
struct trivial_manager
|
||||
struct reference_manager
|
||||
{
|
||||
static inline any_pointer
|
||||
get(any_pointer f, functor_manager_operation_type op)
|
||||
static inline void
|
||||
get(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op)
|
||||
{
|
||||
switch (op) {
|
||||
case clone_functor_tag: return f;
|
||||
case clone_functor_tag:
|
||||
out_buffer.obj_ptr = in_buffer.obj_ptr;
|
||||
return;
|
||||
|
||||
case destroy_functor_tag:
|
||||
return make_any_pointer(reinterpret_cast<void*>(0));
|
||||
out_buffer.obj_ptr = 0;
|
||||
return;
|
||||
|
||||
case check_functor_type_tag:
|
||||
{
|
||||
std::type_info* t = static_cast<std::type_info*>(f.obj_ptr);
|
||||
return BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(F), *t)?
|
||||
f
|
||||
: make_any_pointer(reinterpret_cast<void*>(0));
|
||||
// DPG TBD: Since we're only storing a pointer, it's
|
||||
// possible that the user could ask for a base class or
|
||||
// derived class. Is that okay?
|
||||
const std::type_info& check_type =
|
||||
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
|
||||
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(F)))
|
||||
out_buffer.obj_ptr = in_buffer.obj_ptr;
|
||||
else
|
||||
out_buffer.obj_ptr = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
// Clears up a warning with GCC 3.2.3
|
||||
return make_any_pointer(reinterpret_cast<void*>(0));
|
||||
case get_functor_type_tag:
|
||||
out_buffer.const_obj_ptr = &typeid(F);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine if boost::function can use the small-object
|
||||
* optimization with the function object type F.
|
||||
*/
|
||||
template<typename F>
|
||||
struct function_allows_small_object_optimization
|
||||
{
|
||||
BOOST_STATIC_CONSTANT
|
||||
(bool,
|
||||
value = ((sizeof(F) <= sizeof(function_buffer) &&
|
||||
(alignment_of<function_buffer>::value
|
||||
% alignment_of<F>::value == 0))));
|
||||
};
|
||||
|
||||
/**
|
||||
* The functor_manager class contains a static function "manage" which
|
||||
* can clone or destroy the given function/function object pointer.
|
||||
@ -239,30 +256,59 @@ namespace boost {
|
||||
typedef Functor functor_type;
|
||||
|
||||
// For function pointers, the manager is trivial
|
||||
static inline any_pointer
|
||||
manager(any_pointer function_ptr,
|
||||
functor_manager_operation_type op,
|
||||
function_ptr_tag)
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, function_ptr_tag)
|
||||
{
|
||||
if (op == clone_functor_tag)
|
||||
return function_ptr;
|
||||
else
|
||||
return make_any_pointer(static_cast<void (*)()>(0));
|
||||
out_buffer.func_ptr = in_buffer.func_ptr;
|
||||
else if (op == destroy_functor_tag)
|
||||
out_buffer.func_ptr = 0;
|
||||
else /* op == check_functor_type_tag */ {
|
||||
const std::type_info& check_type =
|
||||
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
|
||||
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
|
||||
out_buffer.obj_ptr = &in_buffer.func_ptr;
|
||||
else
|
||||
out_buffer.obj_ptr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// For function object pointers, we clone the pointer to each
|
||||
// function has its own version.
|
||||
static inline any_pointer
|
||||
manager(any_pointer function_obj_ptr,
|
||||
functor_manager_operation_type op,
|
||||
function_obj_tag)
|
||||
// Function objects that fit in the small-object buffer.
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, mpl::true_)
|
||||
{
|
||||
if (op == clone_functor_tag) {
|
||||
const functor_type* in_functor =
|
||||
reinterpret_cast<const functor_type*>(&in_buffer.data);
|
||||
new ((void*)&out_buffer.data) functor_type(*in_functor);
|
||||
} else if (op == destroy_functor_tag) {
|
||||
functor_type* out_functor =
|
||||
reinterpret_cast<functor_type*>(&out_buffer.data);
|
||||
// Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
|
||||
out_functor->~Functor();
|
||||
} else /* op == check_functor_type_tag */ {
|
||||
const std::type_info& check_type =
|
||||
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
|
||||
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
|
||||
out_buffer.obj_ptr = &in_buffer.data;
|
||||
else
|
||||
out_buffer.obj_ptr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Function objects that require heap allocation
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, mpl::false_)
|
||||
{
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
typedef typename Allocator::template rebind<functor_type>::other
|
||||
allocator_type;
|
||||
typedef typename allocator_type::pointer pointer_type;
|
||||
typedef typename Allocator::template rebind<functor_type>::other
|
||||
allocator_type;
|
||||
typedef typename allocator_type::pointer pointer_type;
|
||||
#else
|
||||
typedef functor_type* pointer_type;
|
||||
typedef functor_type* pointer_type;
|
||||
#endif // BOOST_NO_STD_ALLOCATOR
|
||||
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
@ -270,8 +316,10 @@ namespace boost {
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
|
||||
if (op == clone_functor_tag) {
|
||||
functor_type* f =
|
||||
static_cast<functor_type*>(function_obj_ptr.obj_ptr);
|
||||
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
|
||||
// can't do the static_cast that we should do.
|
||||
const functor_type* f =
|
||||
(const functor_type*)(in_buffer.obj_ptr);
|
||||
|
||||
// Clone the functor
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
@ -283,12 +331,11 @@ namespace boost {
|
||||
# else
|
||||
functor_type* new_f = new functor_type(*f);
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
return make_any_pointer(static_cast<void*>(new_f));
|
||||
}
|
||||
else {
|
||||
out_buffer.obj_ptr = new_f;
|
||||
} else if (op == destroy_functor_tag) {
|
||||
/* Cast from the void pointer to the functor pointer type */
|
||||
functor_type* f =
|
||||
reinterpret_cast<functor_type*>(function_obj_ptr.obj_ptr);
|
||||
static_cast<functor_type*>(out_buffer.obj_ptr);
|
||||
|
||||
# ifndef BOOST_NO_STD_ALLOCATOR
|
||||
/* Cast from the functor pointer type to the allocator's pointer
|
||||
@ -301,26 +348,44 @@ namespace boost {
|
||||
# else
|
||||
delete f;
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
|
||||
return make_any_pointer(static_cast<void*>(0));
|
||||
out_buffer.obj_ptr = 0;
|
||||
} else /* op == check_functor_type_tag */ {
|
||||
const std::type_info& check_type =
|
||||
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
|
||||
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
|
||||
out_buffer.obj_ptr = in_buffer.obj_ptr;
|
||||
else
|
||||
out_buffer.obj_ptr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// For function objects, we determine whether the function
|
||||
// object can use the small-object optimization buffer or
|
||||
// whether we need to allocate it on the heap.
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, function_obj_tag)
|
||||
{
|
||||
manager(in_buffer, out_buffer, op,
|
||||
mpl::bool_<(function_allows_small_object_optimization<functor_type>::value)>());
|
||||
}
|
||||
|
||||
public:
|
||||
/* Dispatch to an appropriate manager based on whether we have a
|
||||
function pointer or a function object pointer. */
|
||||
static any_pointer
|
||||
manage(any_pointer functor_ptr, functor_manager_operation_type op)
|
||||
static inline void
|
||||
manage(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op)
|
||||
{
|
||||
if (op == check_functor_type_tag) {
|
||||
std::type_info* type =
|
||||
static_cast<std::type_info*>(functor_ptr.obj_ptr);
|
||||
return (BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(Functor), *type)?
|
||||
functor_ptr
|
||||
: make_any_pointer(reinterpret_cast<void*>(0)));
|
||||
}
|
||||
else {
|
||||
typedef typename get_function_tag<functor_type>::type tag_type;
|
||||
return manager(functor_ptr, op, tag_type());
|
||||
typedef typename get_function_tag<functor_type>::type tag_type;
|
||||
switch (op) {
|
||||
case get_functor_type_tag:
|
||||
out_buffer.const_obj_ptr = &typeid(functor_type);
|
||||
return;
|
||||
|
||||
default:
|
||||
manager(in_buffer, out_buffer, op, tag_type());
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -386,6 +451,18 @@ namespace boost {
|
||||
else return true;
|
||||
}
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
/**
|
||||
* Stores the "manager" portion of the vtable for a
|
||||
* boost::function object.
|
||||
*/
|
||||
struct vtable_base
|
||||
{
|
||||
vtable_base() : manager(0) { }
|
||||
void (*manager)(const function_buffer& in_buffer,
|
||||
function_buffer& out_buffer,
|
||||
functor_manager_operation_type op);
|
||||
};
|
||||
} // end namespace function
|
||||
} // end namespace detail
|
||||
|
||||
@ -398,62 +475,61 @@ namespace boost {
|
||||
class function_base
|
||||
{
|
||||
public:
|
||||
function_base() : manager(0)
|
||||
{
|
||||
functor.obj_ptr = 0;
|
||||
}
|
||||
function_base() : vtable(0) { }
|
||||
|
||||
// Is this function empty?
|
||||
bool empty() const { return !manager; }
|
||||
/** Determine if the function is empty (i.e., has no target). */
|
||||
bool empty() const { return !vtable; }
|
||||
|
||||
/** Retrieve the type of the stored function object, or typeid(void)
|
||||
if this is empty. */
|
||||
const std::type_info& target_type() const
|
||||
{
|
||||
if (!vtable) return typeid(void);
|
||||
|
||||
detail::function::function_buffer type;
|
||||
vtable->manager(functor, type, detail::function::get_functor_type_tag);
|
||||
return *static_cast<const std::type_info*>(type.const_obj_ptr);
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
Functor* target()
|
||||
{
|
||||
if (!manager) return 0;
|
||||
if (!vtable) return 0;
|
||||
|
||||
detail::function::any_pointer result =
|
||||
manager(detail::function::make_any_pointer(&typeid(Functor)),
|
||||
detail::function::check_functor_type_tag);
|
||||
if (!result.obj_ptr) return 0;
|
||||
else {
|
||||
typedef typename detail::function::get_function_tag<Functor>::type tag;
|
||||
return get_functor_pointer<Functor>(tag(), 0);
|
||||
}
|
||||
detail::function::function_buffer type_result;
|
||||
type_result.const_obj_ptr = &typeid(Functor);
|
||||
vtable->manager(functor, type_result,
|
||||
detail::function::check_functor_type_tag);
|
||||
return static_cast<Functor*>(type_result.obj_ptr);
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
const Functor* target( Functor * = 0 ) const
|
||||
#else
|
||||
const Functor* target() const
|
||||
#endif
|
||||
{
|
||||
if (!manager) return 0;
|
||||
if (!vtable) return 0;
|
||||
|
||||
detail::function::any_pointer result =
|
||||
manager(detail::function::make_any_pointer(&typeid(Functor)),
|
||||
detail::function::check_functor_type_tag);
|
||||
if (!result.obj_ptr) return 0;
|
||||
else {
|
||||
typedef typename detail::function::get_function_tag<Functor>::type tag;
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
return get_functor_pointer(tag(), 0, (Functor*)0);
|
||||
#else
|
||||
return get_functor_pointer<Functor>(tag(), 0);
|
||||
#endif
|
||||
}
|
||||
detail::function::function_buffer type_result;
|
||||
type_result.const_obj_ptr = &typeid(Functor);
|
||||
vtable->manager(functor, type_result,
|
||||
detail::function::check_functor_type_tag);
|
||||
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
|
||||
// can't do the static_cast that we should do.
|
||||
return (const Functor*)(type_result.obj_ptr);
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
bool contains(const F& f) const
|
||||
{
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
if (const F* fp = this->target( (F*)0 )) {
|
||||
if (const F* fp = this->target( (F*)0 ))
|
||||
#else
|
||||
if (const F* fp = this->template target<F>()) {
|
||||
if (const F* fp = this->template target<F>())
|
||||
#endif
|
||||
{
|
||||
return function_equal(*fp, f);
|
||||
} else {
|
||||
return false;
|
||||
@ -484,44 +560,8 @@ public:
|
||||
#endif
|
||||
|
||||
public: // should be protected, but GCC 2.95.3 will fail to allow access
|
||||
detail::function::any_pointer (*manager)(
|
||||
detail::function::any_pointer,
|
||||
detail::function::functor_manager_operation_type);
|
||||
detail::function::any_pointer functor;
|
||||
|
||||
private:
|
||||
template<typename Functor>
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
Functor* get_functor_pointer(detail::function::function_ptr_tag, int, Functor * = 0)
|
||||
#else
|
||||
Functor* get_functor_pointer(detail::function::function_ptr_tag, int)
|
||||
#endif
|
||||
{ return reinterpret_cast<Functor*>(&functor.func_ptr); }
|
||||
|
||||
template<typename Functor, typename Tag>
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
Functor* get_functor_pointer(Tag, long, Functor * = 0)
|
||||
#else
|
||||
Functor* get_functor_pointer(Tag, long)
|
||||
#endif
|
||||
{ return static_cast<Functor*>(functor.obj_ptr); }
|
||||
|
||||
template<typename Functor>
|
||||
const Functor*
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
get_functor_pointer(detail::function::function_ptr_tag, int, Functor * = 0) const
|
||||
#else
|
||||
get_functor_pointer(detail::function::function_ptr_tag, int) const
|
||||
#endif
|
||||
{ return reinterpret_cast<const Functor*>(&functor.func_ptr); }
|
||||
|
||||
template<typename Functor, typename Tag>
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
const Functor* get_functor_pointer(Tag, long, Functor * = 0) const
|
||||
#else
|
||||
const Functor* get_functor_pointer(Tag, long) const
|
||||
#endif
|
||||
{ return static_cast<const Functor*>(functor.const_obj_ptr); }
|
||||
detail::function::vtable_base* vtable;
|
||||
mutable detail::function::function_buffer functor;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2001-2003. Use, modification and
|
||||
// Copyright Douglas Gregor 2001-2006. 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)
|
||||
@ -22,7 +22,7 @@
|
||||
#define BOOST_FUNCTION_ARGS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, a)
|
||||
|
||||
#define BOOST_FUNCTION_ARG_TYPE(J,I,D) \
|
||||
typedef BOOST_PP_CAT(T,I) BOOST_PP_CAT(arg, BOOST_PP_CAT(BOOST_PP_INC(I),_type));
|
||||
typedef BOOST_PP_CAT(T,I) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(I)),_type);
|
||||
|
||||
#define BOOST_FUNCTION_ARG_TYPES BOOST_PP_REPEAT(BOOST_FUNCTION_NUM_ARGS,BOOST_FUNCTION_ARG_TYPE,BOOST_PP_EMPTY)
|
||||
|
||||
@ -50,22 +50,23 @@
|
||||
BOOST_JOIN(function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER \
|
||||
BOOST_JOIN(void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER \
|
||||
BOOST_JOIN(stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER \
|
||||
BOOST_JOIN(stateless_void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_FUNCTION_REF_INVOKER \
|
||||
BOOST_JOIN(function_ref_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER \
|
||||
BOOST_JOIN(void_function_ref_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_INVOKER \
|
||||
BOOST_JOIN(get_function_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER \
|
||||
BOOST_JOIN(get_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER \
|
||||
BOOST_JOIN(get_stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER \
|
||||
BOOST_JOIN(get_function_ref_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
#define BOOST_FUNCTION_VTABLE BOOST_JOIN(basic_vtable,BOOST_FUNCTION_NUM_ARGS)
|
||||
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
# define BOOST_FUNCTION_VOID_RETURN_TYPE void
|
||||
# define BOOST_FUNCTION_RETURN(X) X
|
||||
#else
|
||||
# define BOOST_FUNCTION_VOID_RETURN_TYPE ::boost::detail::function::unusable
|
||||
# define BOOST_FUNCTION_VOID_RETURN_TYPE boost::detail::function::unusable
|
||||
# define BOOST_FUNCTION_RETURN(X) X; return BOOST_FUNCTION_VOID_RETURN_TYPE ()
|
||||
#endif
|
||||
|
||||
@ -79,7 +80,7 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_FUNCTION_INVOKER
|
||||
{
|
||||
static R invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
|
||||
static R invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
{
|
||||
FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
|
||||
@ -95,7 +96,7 @@ namespace boost {
|
||||
struct BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
{
|
||||
static BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
|
||||
invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
@ -111,11 +112,15 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
{
|
||||
static R invoke(any_pointer function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
|
||||
FunctionObj* f;
|
||||
if (function_allows_small_object_optimization<FunctionObj>::value)
|
||||
f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
|
||||
else
|
||||
f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
|
||||
return (*f)(BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
};
|
||||
@ -128,11 +133,15 @@ namespace boost {
|
||||
struct BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
{
|
||||
static BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
invoke(any_pointer function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
|
||||
FunctionObj* f;
|
||||
if (function_allows_small_object_optimization<FunctionObj>::value)
|
||||
f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
|
||||
else
|
||||
f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
|
||||
BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS));
|
||||
}
|
||||
};
|
||||
@ -142,12 +151,15 @@ namespace boost {
|
||||
typename R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
>
|
||||
struct BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER
|
||||
struct BOOST_FUNCTION_FUNCTION_REF_INVOKER
|
||||
{
|
||||
static R invoke(any_pointer BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS)
|
||||
static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionObj f = FunctionObj();
|
||||
return f(BOOST_FUNCTION_ARGS);
|
||||
FunctionObj* f =
|
||||
reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
|
||||
return (*f)(BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
};
|
||||
|
||||
@ -156,14 +168,16 @@ namespace boost {
|
||||
typename R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
>
|
||||
struct BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
|
||||
struct BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER
|
||||
{
|
||||
static BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
invoke(any_pointer BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS)
|
||||
invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionObj f = FunctionObj();
|
||||
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
|
||||
FunctionObj* f =
|
||||
reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
|
||||
BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS));
|
||||
}
|
||||
};
|
||||
|
||||
@ -174,7 +188,7 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
{
|
||||
typedef typename ct_if<(is_void<R>::value),
|
||||
typedef typename mpl::if_c<(is_void<R>::value),
|
||||
BOOST_FUNCTION_VOID_FUNCTION_INVOKER<
|
||||
FunctionPtr,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
@ -195,7 +209,7 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
{
|
||||
typedef typename ct_if<(is_void<R>::value),
|
||||
typedef typename mpl::if_c<(is_void<R>::value),
|
||||
BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
@ -214,15 +228,15 @@ namespace boost {
|
||||
typename R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
>
|
||||
struct BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER
|
||||
struct BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER
|
||||
{
|
||||
typedef typename ct_if<(is_void<R>::value),
|
||||
BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER<
|
||||
typedef typename mpl::if_c<(is_void<R>::value),
|
||||
BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>,
|
||||
BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER<
|
||||
BOOST_FUNCTION_FUNCTION_REF_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
@ -230,6 +244,199 @@ namespace boost {
|
||||
>::type type;
|
||||
};
|
||||
|
||||
/**
|
||||
* vtable for a specific boost::function instance.
|
||||
*/
|
||||
template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS,
|
||||
typename Allocator>
|
||||
struct BOOST_FUNCTION_VTABLE : vtable_base
|
||||
{
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
typedef R result_type;
|
||||
#else
|
||||
typedef typename function_return_type<R>::type result_type;
|
||||
#endif // BOOST_NO_VOID_RETURNS
|
||||
|
||||
typedef result_type (*invoker_type)(function_buffer&
|
||||
BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS);
|
||||
|
||||
template<typename F>
|
||||
BOOST_FUNCTION_VTABLE(F f) : vtable_base(), invoker(0)
|
||||
{
|
||||
init(f);
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
bool assign_to(F f, function_buffer& functor)
|
||||
{
|
||||
typedef typename get_function_tag<F>::type tag;
|
||||
return assign_to(f, functor, tag());
|
||||
}
|
||||
|
||||
void clear(function_buffer& functor)
|
||||
{
|
||||
if (manager)
|
||||
manager(functor, functor, destroy_functor_tag);
|
||||
}
|
||||
|
||||
private:
|
||||
template<typename F>
|
||||
void init(F f)
|
||||
{
|
||||
typedef typename get_function_tag<F>::type tag;
|
||||
init(f, tag());
|
||||
}
|
||||
|
||||
// Function pointers
|
||||
template<typename FunctionPtr>
|
||||
void init(FunctionPtr /*f*/, function_ptr_tag)
|
||||
{
|
||||
typedef typename BOOST_FUNCTION_GET_FUNCTION_INVOKER<
|
||||
FunctionPtr,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
manager = &functor_manager<FunctionPtr, Allocator>::manage;
|
||||
}
|
||||
|
||||
template<typename FunctionPtr>
|
||||
bool
|
||||
assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag)
|
||||
{
|
||||
this->clear(functor);
|
||||
if (f) {
|
||||
// should be a reinterpret cast, but some compilers insist
|
||||
// on giving cv-qualifiers to free functions
|
||||
functor.func_ptr = (void (*)())(f);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Member pointers
|
||||
#if BOOST_FUNCTION_NUM_ARGS > 0
|
||||
template<typename MemberPtr>
|
||||
void init(MemberPtr f, member_ptr_tag)
|
||||
{
|
||||
// DPG TBD: Add explicit support for member function
|
||||
// objects, so we invoke through mem_fn() but we retain the
|
||||
// right target_type() values.
|
||||
this->init(mem_fn(f));
|
||||
}
|
||||
|
||||
template<typename MemberPtr>
|
||||
bool assign_to(MemberPtr f, function_buffer& functor, member_ptr_tag)
|
||||
{
|
||||
// DPG TBD: Add explicit support for member function
|
||||
// objects, so we invoke through mem_fn() but we retain the
|
||||
// right target_type() values.
|
||||
if (f) {
|
||||
this->assign_to(mem_fn(f), functor);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif // BOOST_FUNCTION_NUM_ARGS > 0
|
||||
|
||||
// Function objects
|
||||
template<typename FunctionObj>
|
||||
void init(FunctionObj /*f*/, function_obj_tag)
|
||||
{
|
||||
typedef typename BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
manager = &functor_manager<FunctionObj, Allocator>::manage;
|
||||
}
|
||||
|
||||
// Assign to a function object using the small object optimization
|
||||
template<typename FunctionObj>
|
||||
void
|
||||
assign_functor(FunctionObj f, function_buffer& functor, mpl::true_)
|
||||
{
|
||||
new ((void*)&functor.data) FunctionObj(f);
|
||||
}
|
||||
|
||||
// Assign to a function object allocated on the heap.
|
||||
template<typename FunctionObj>
|
||||
void
|
||||
assign_functor(FunctionObj f, function_buffer& functor, mpl::false_)
|
||||
{
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
typedef typename Allocator::template rebind<FunctionObj>::other
|
||||
allocator_type;
|
||||
typedef typename allocator_type::pointer pointer_type;
|
||||
|
||||
allocator_type allocator;
|
||||
pointer_type copy = allocator.allocate(1);
|
||||
allocator.construct(copy, f);
|
||||
|
||||
// Get back to the original pointer type
|
||||
functor.obj_ptr = static_cast<FunctionObj*>(copy);
|
||||
# else
|
||||
functor.obj_ptr = new FunctionObj(f);
|
||||
# endif // BOOST_NO_STD_ALLOCATOR
|
||||
}
|
||||
|
||||
template<typename FunctionObj>
|
||||
bool
|
||||
assign_to(FunctionObj f, function_buffer& functor, function_obj_tag)
|
||||
{
|
||||
if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
|
||||
assign_functor(f, functor,
|
||||
mpl::bool_<(function_allows_small_object_optimization<FunctionObj>::value)>());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Reference to a function object
|
||||
template<typename FunctionObj>
|
||||
void
|
||||
init(const reference_wrapper<FunctionObj>& /*f*/, function_obj_ref_tag)
|
||||
{
|
||||
typedef typename BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
manager = &reference_manager<FunctionObj>::get;
|
||||
}
|
||||
|
||||
template<typename FunctionObj>
|
||||
bool
|
||||
assign_to(const reference_wrapper<FunctionObj>& f,
|
||||
function_buffer& functor, function_obj_ref_tag)
|
||||
{
|
||||
if (!boost::detail::function::has_empty_target(f.get_pointer())) {
|
||||
// DPG TBD: We might need to detect constness of
|
||||
// FunctionObj to assign into obj_ptr or const_obj_ptr to
|
||||
// be truly legit, but no platform in existence makes
|
||||
// const void* different from void*.
|
||||
functor.const_obj_ptr = f.get_pointer();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
invoker_type invoker;
|
||||
};
|
||||
} // end namespace function
|
||||
} // end namespace detail
|
||||
|
||||
@ -244,11 +451,15 @@ namespace boost {
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
typedef R result_type;
|
||||
#else
|
||||
typedef typename detail::function::function_return_type<R>::type
|
||||
typedef typename boost::detail::function::function_return_type<R>::type
|
||||
result_type;
|
||||
#endif // BOOST_NO_VOID_RETURNS
|
||||
|
||||
private:
|
||||
typedef boost::detail::function::BOOST_FUNCTION_VTABLE<
|
||||
R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS, Allocator>
|
||||
vtable_type;
|
||||
|
||||
struct clear_type {};
|
||||
|
||||
public:
|
||||
@ -274,8 +485,7 @@ namespace boost {
|
||||
typedef Allocator allocator_type;
|
||||
typedef BOOST_FUNCTION_FUNCTION self_type;
|
||||
|
||||
BOOST_FUNCTION_FUNCTION() : function_base()
|
||||
, invoker(0) {}
|
||||
BOOST_FUNCTION_FUNCTION() : function_base() { }
|
||||
|
||||
// MSVC chokes if the following two constructors are collapsed into
|
||||
// one with a default parameter.
|
||||
@ -283,36 +493,33 @@ namespace boost {
|
||||
BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
,typename enable_if_c<
|
||||
(::boost::type_traits::ice_not<
|
||||
(boost::type_traits::ice_not<
|
||||
(is_integral<Functor>::value)>::value),
|
||||
int>::type = 0
|
||||
#endif // BOOST_NO_SFINAE
|
||||
) :
|
||||
function_base(),
|
||||
invoker(0)
|
||||
function_base()
|
||||
{
|
||||
this->assign_to(f);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
BOOST_FUNCTION_FUNCTION(clear_type*) : function_base(), invoker(0) {}
|
||||
BOOST_FUNCTION_FUNCTION(clear_type*) : function_base() { }
|
||||
#else
|
||||
BOOST_FUNCTION_FUNCTION(int zero) : function_base(), invoker(0)
|
||||
BOOST_FUNCTION_FUNCTION(int zero) : function_base()
|
||||
{
|
||||
BOOST_ASSERT(zero == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) :
|
||||
function_base(),
|
||||
invoker(0)
|
||||
BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) : function_base()
|
||||
{
|
||||
this->assign_to_own(f);
|
||||
}
|
||||
|
||||
~BOOST_FUNCTION_FUNCTION() { clear(); }
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// MSVC 6.0 and prior require all definitions to be inline, but
|
||||
// these definitions can become very costly.
|
||||
result_type operator()(BOOST_FUNCTION_PARMS) const
|
||||
@ -320,7 +527,8 @@ namespace boost {
|
||||
if (this->empty())
|
||||
boost::throw_exception(bad_function_call());
|
||||
|
||||
return invoker(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
return static_cast<vtable_type*>(vtable)->invoker
|
||||
(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
#else
|
||||
result_type operator()(BOOST_FUNCTION_PARMS) const;
|
||||
@ -334,7 +542,7 @@ namespace boost {
|
||||
template<typename Functor>
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
typename enable_if_c<
|
||||
(::boost::type_traits::ice_not<
|
||||
(boost::type_traits::ice_not<
|
||||
(is_integral<Functor>::value)>::value),
|
||||
BOOST_FUNCTION_FUNCTION&>::type
|
||||
#else
|
||||
@ -342,7 +550,13 @@ namespace boost {
|
||||
#endif
|
||||
operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
||||
{
|
||||
self_type(f).swap(*this);
|
||||
this->clear();
|
||||
try {
|
||||
this->assign_to(f);
|
||||
} catch (...) {
|
||||
vtable = 0;
|
||||
throw;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -367,7 +581,13 @@ namespace boost {
|
||||
if (&f == this)
|
||||
return *this;
|
||||
|
||||
self_type(f).swap(*this);
|
||||
this->clear();
|
||||
try {
|
||||
this->assign_to_own(f);
|
||||
} catch (...) {
|
||||
vtable = 0;
|
||||
throw;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -376,21 +596,18 @@ namespace boost {
|
||||
if (&other == this)
|
||||
return;
|
||||
|
||||
std::swap(this->manager, other.manager);
|
||||
std::swap(this->functor, other.functor);
|
||||
std::swap(invoker, other.invoker);
|
||||
BOOST_FUNCTION_FUNCTION tmp = *this;
|
||||
*this = other;
|
||||
other = tmp;
|
||||
}
|
||||
|
||||
// Clear out a target, if there is one
|
||||
void clear()
|
||||
{
|
||||
if (this->manager) {
|
||||
function_base::functor =
|
||||
this->manager(this->functor, detail::function::destroy_functor_tag);
|
||||
if (vtable) {
|
||||
static_cast<vtable_type*>(vtable)->clear(this->functor);
|
||||
vtable = 0;
|
||||
}
|
||||
|
||||
this->manager = 0;
|
||||
invoker = 0;
|
||||
}
|
||||
|
||||
#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
|
||||
@ -416,131 +633,19 @@ namespace boost {
|
||||
void assign_to_own(const BOOST_FUNCTION_FUNCTION& f)
|
||||
{
|
||||
if (!f.empty()) {
|
||||
invoker = f.invoker;
|
||||
this->manager = f.manager;
|
||||
this->functor =
|
||||
f.manager(f.functor, detail::function::clone_functor_tag);
|
||||
this->vtable = f.vtable;
|
||||
f.vtable->manager(f.functor, this->functor,
|
||||
boost::detail::function::clone_functor_tag);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
void assign_to(Functor f)
|
||||
{
|
||||
typedef typename detail::function::get_function_tag<Functor>::type tag;
|
||||
this->assign_to(f, tag());
|
||||
static vtable_type stored_vtable(f);
|
||||
if (stored_vtable.assign_to(f, functor)) vtable = &stored_vtable;
|
||||
else vtable = 0;
|
||||
}
|
||||
|
||||
template<typename FunctionPtr>
|
||||
void assign_to(FunctionPtr f, detail::function::function_ptr_tag)
|
||||
{
|
||||
clear();
|
||||
|
||||
if (f) {
|
||||
typedef typename detail::function::BOOST_FUNCTION_GET_FUNCTION_INVOKER<
|
||||
FunctionPtr,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
this->manager =
|
||||
&detail::function::functor_manager<FunctionPtr, Allocator>::manage;
|
||||
this->functor =
|
||||
this->manager(detail::function::make_any_pointer(
|
||||
// should be a reinterpret cast, but some compilers
|
||||
// insist on giving cv-qualifiers to free functions
|
||||
(void (*)())(f)
|
||||
),
|
||||
detail::function::clone_functor_tag);
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_FUNCTION_NUM_ARGS > 0
|
||||
template<typename MemberPtr>
|
||||
void assign_to(MemberPtr f, detail::function::member_ptr_tag)
|
||||
{
|
||||
this->assign_to(mem_fn(f));
|
||||
}
|
||||
#endif // BOOST_FUNCTION_NUM_ARGS > 0
|
||||
|
||||
template<typename FunctionObj>
|
||||
void assign_to(FunctionObj f, detail::function::function_obj_tag)
|
||||
{
|
||||
if (!detail::function::has_empty_target(boost::addressof(f))) {
|
||||
typedef
|
||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
this->manager = &detail::function::functor_manager<
|
||||
FunctionObj, Allocator>::manage;
|
||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||
typedef typename Allocator::template rebind<FunctionObj>::other
|
||||
rebound_allocator_type;
|
||||
typedef typename rebound_allocator_type::pointer pointer_type;
|
||||
rebound_allocator_type allocator;
|
||||
pointer_type copy = allocator.allocate(1);
|
||||
allocator.construct(copy, f);
|
||||
|
||||
// Get back to the original pointer type
|
||||
FunctionObj* new_f = static_cast<FunctionObj*>(copy);
|
||||
#else
|
||||
FunctionObj* new_f = new FunctionObj(f);
|
||||
#endif // BOOST_NO_STD_ALLOCATOR
|
||||
this->functor =
|
||||
detail::function::make_any_pointer(static_cast<void*>(new_f));
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FunctionObj>
|
||||
void assign_to(const reference_wrapper<FunctionObj>& f,
|
||||
detail::function::function_obj_ref_tag)
|
||||
{
|
||||
if (!detail::function::has_empty_target(f.get_pointer())) {
|
||||
typedef
|
||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
this->manager = &detail::function::trivial_manager<FunctionObj>::get;
|
||||
this->functor =
|
||||
this->manager(
|
||||
detail::function::make_any_pointer(
|
||||
const_cast<FunctionObj*>(f.get_pointer())),
|
||||
detail::function::clone_functor_tag);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FunctionObj>
|
||||
void assign_to(FunctionObj, detail::function::stateless_function_obj_tag)
|
||||
{
|
||||
typedef
|
||||
typename detail::function::
|
||||
BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
actual_invoker_type;
|
||||
invoker = &actual_invoker_type::invoke;
|
||||
this->manager = &detail::function::trivial_manager<FunctionObj>::get;
|
||||
this->functor = detail::function::make_any_pointer(this);
|
||||
}
|
||||
|
||||
typedef result_type (*invoker_type)(detail::function::any_pointer
|
||||
BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS);
|
||||
|
||||
invoker_type invoker;
|
||||
};
|
||||
|
||||
template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
|
||||
@ -559,11 +664,11 @@ namespace boost {
|
||||
f1.swap(f2);
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS,
|
||||
typename Allocator>
|
||||
typename BOOST_FUNCTION_FUNCTION<
|
||||
R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS,
|
||||
R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS,
|
||||
Allocator>::result_type
|
||||
BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS,
|
||||
|
||||
@ -572,8 +677,9 @@ namespace boost {
|
||||
{
|
||||
if (this->empty())
|
||||
boost::throw_exception(bad_function_call());
|
||||
|
||||
return invoker(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
|
||||
return static_cast<vtable_type*>(vtable)->invoker
|
||||
(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -629,7 +735,7 @@ public:
|
||||
function(Functor f
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
,typename enable_if_c<
|
||||
(::boost::type_traits::ice_not<
|
||||
(boost::type_traits::ice_not<
|
||||
(is_integral<Functor>::value)>::value),
|
||||
int>::type = 0
|
||||
#endif
|
||||
@ -655,7 +761,7 @@ public:
|
||||
template<typename Functor>
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
typename enable_if_c<
|
||||
(::boost::type_traits::ice_not<
|
||||
(boost::type_traits::ice_not<
|
||||
(is_integral<Functor>::value)>::value),
|
||||
self_type&>::type
|
||||
#else
|
||||
@ -688,6 +794,7 @@ public:
|
||||
} // end namespace boost
|
||||
|
||||
// Cleanup after ourselves...
|
||||
#undef BOOST_FUNCTION_VTABLE
|
||||
#undef BOOST_FUNCTION_DEFAULT_ALLOCATOR
|
||||
#undef BOOST_FUNCTION_COMMA
|
||||
#undef BOOST_FUNCTION_FUNCTION
|
||||
@ -695,11 +802,11 @@ public:
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_FUNCTION_REF_INVOKER
|
||||
#undef BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER
|
||||
#undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER
|
||||
#undef BOOST_FUNCTION_TEMPLATE_PARMS
|
||||
#undef BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
|
@ -5,7 +5,7 @@
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* $Id: integer_traits.hpp,v 1.27.2.1 2005/08/24 15:45:17 johnmaddock Exp $
|
||||
* $Id: integer_traits.hpp,v 1.30 2006/02/05 10:19:42 johnmaddock Exp $
|
||||
*
|
||||
* Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
|
||||
*/
|
||||
@ -21,9 +21,9 @@
|
||||
|
||||
// These are an implementation detail and not part of the interface
|
||||
#include <limits.h>
|
||||
// we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it,
|
||||
// we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it,
|
||||
// and some may have <wchar.h> but not <cwchar> ...
|
||||
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun))
|
||||
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__))
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
|
@ -174,22 +174,22 @@ template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, in
|
||||
return a.get() != b.get();
|
||||
}
|
||||
|
||||
template<class T> inline bool operator==(intrusive_ptr<T> const & a, T * b)
|
||||
template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b)
|
||||
{
|
||||
return a.get() == b;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=(intrusive_ptr<T> const & a, T * b)
|
||||
template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b)
|
||||
{
|
||||
return a.get() != b;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator==(T * a, intrusive_ptr<T> const & b)
|
||||
template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b)
|
||||
{
|
||||
return a == b.get();
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=(T * a, intrusive_ptr<T> const & b)
|
||||
template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b)
|
||||
{
|
||||
return a != b.get();
|
||||
}
|
||||
@ -249,7 +249,7 @@ template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y>
|
||||
|
||||
#else
|
||||
|
||||
# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT)
|
||||
# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT)
|
||||
// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
|
||||
using std::basic_ostream;
|
||||
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
|
||||
|
@ -162,26 +162,6 @@ public:
|
||||
std::streamsize write(const char_type* s, std::streamsize n);
|
||||
std::streampos seek(stream_offset off, BOOST_IOS::seekdir way);
|
||||
|
||||
//----------Additional i/o functions--------------------------------------//
|
||||
|
||||
// Returns true if this chain is non-empty and its final link
|
||||
// is a source or sink, i.e., if it is ready to perform i/o.
|
||||
bool is_complete() const;
|
||||
bool auto_close() const;
|
||||
void set_auto_close(bool close);
|
||||
bool sync() { return front().BOOST_IOSTREAMS_PUBSYNC() != -1; }
|
||||
bool strict_sync();
|
||||
|
||||
//----------Container-like interface--------------------------------------//
|
||||
|
||||
typedef typename list_type::size_type size_type;
|
||||
streambuf_type& front() { return *list().front(); }
|
||||
BOOST_IOSTREAMS_DEFINE_PUSH(push, mode, char_type, push_impl)
|
||||
void pop();
|
||||
bool empty() const { return list().empty(); }
|
||||
size_type size() const { return list().size(); }
|
||||
void reset();
|
||||
|
||||
//----------Direct component access---------------------------------------//
|
||||
|
||||
const std::type_info& component_type(int n) const
|
||||
@ -218,6 +198,27 @@ public:
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
public:
|
||||
|
||||
//----------Container-like interface--------------------------------------//
|
||||
|
||||
typedef typename list_type::size_type size_type;
|
||||
streambuf_type& front() { return *list().front(); }
|
||||
BOOST_IOSTREAMS_DEFINE_PUSH(push, mode, char_type, push_impl)
|
||||
void pop();
|
||||
bool empty() const { return list().empty(); }
|
||||
size_type size() const { return list().size(); }
|
||||
void reset();
|
||||
|
||||
//----------Additional i/o functions--------------------------------------//
|
||||
|
||||
// Returns true if this chain is non-empty and its final link
|
||||
// is a source or sink, i.e., if it is ready to perform i/o.
|
||||
bool is_complete() const;
|
||||
bool auto_close() const;
|
||||
void set_auto_close(bool close);
|
||||
bool sync() { return front().BOOST_IOSTREAMS_PUBSYNC() != -1; }
|
||||
bool strict_sync();
|
||||
private:
|
||||
template<typename T>
|
||||
void push_impl(const T& t, int buffer_size = -1, int pback_size = -1)
|
||||
@ -420,26 +421,6 @@ public:
|
||||
const std::type_info& component_type(int n) const
|
||||
{ return chain_->component_type(n); }
|
||||
|
||||
//#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
|
||||
// // Deprecated.
|
||||
// template<int N>
|
||||
// const std::type_info& component_type() const
|
||||
// { return chain_->component_type(N); }
|
||||
//
|
||||
// template<typename T>
|
||||
// T* component(int n) const // Tru64 needs boost::type.
|
||||
// { return chain_->component(n, boost::type<T>()); }
|
||||
//
|
||||
// // Deprecated.
|
||||
// template<int N, typename T>
|
||||
// T* component() const // Tru64 needs boost::type.
|
||||
// { return chain_->component(N, boost::type<T>()); }
|
||||
//#else
|
||||
// template<typename T>
|
||||
// T* component(int n, boost::type<T> t) const
|
||||
// { return chain_->component(n, t); }
|
||||
//#endif
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
|
||||
// Deprecated.
|
||||
template<int N>
|
||||
|
@ -127,7 +127,7 @@ struct read_write_if_impl<output> {
|
||||
template<>
|
||||
struct seek_if_impl<random_access> {
|
||||
template<typename T>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( T& t, stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which )
|
||||
{ return iostreams::seek(t, off, way, which); }
|
||||
@ -136,7 +136,7 @@ struct seek_if_impl<random_access> {
|
||||
template<>
|
||||
struct seek_if_impl<any_tag> {
|
||||
template<typename T>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek(T&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode)
|
||||
{ throw cant_seek(); }
|
||||
};
|
||||
|
@ -80,16 +80,16 @@ public:
|
||||
std::streamsize write(const char_type* s, std::streamsize n, Sink* snk)
|
||||
{ return output_impl::write(t_, snk, s, n); }
|
||||
|
||||
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which )
|
||||
stream_offset seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which )
|
||||
{
|
||||
return this->seek( off, way, which,
|
||||
(basic_null_device<char_type, seekable>*) 0);
|
||||
}
|
||||
|
||||
template<typename Device>
|
||||
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which, Device* dev )
|
||||
stream_offset seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which, Device* dev )
|
||||
{ return any_impl::seek(t_, dev, off, way, which); }
|
||||
|
||||
void close(BOOST_IOS::openmode which)
|
||||
@ -122,7 +122,7 @@ public:
|
||||
template<>
|
||||
struct device_wrapper_impl<any_tag> {
|
||||
template<typename Device, typename Dummy>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Device& dev, Dummy*, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which )
|
||||
{
|
||||
@ -131,7 +131,7 @@ struct device_wrapper_impl<any_tag> {
|
||||
}
|
||||
|
||||
template<typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Device&, stream_offset, BOOST_IOS::seekdir,
|
||||
BOOST_IOS::openmode, any_tag )
|
||||
{
|
||||
@ -139,7 +139,7 @@ struct device_wrapper_impl<any_tag> {
|
||||
}
|
||||
|
||||
template<typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Device& dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which,
|
||||
random_access )
|
||||
@ -191,7 +191,7 @@ struct device_wrapper_impl<output> {
|
||||
template<>
|
||||
struct flt_wrapper_impl<any_tag> {
|
||||
template<typename Filter, typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Filter& f, Device* dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which )
|
||||
{
|
||||
@ -200,13 +200,13 @@ struct flt_wrapper_impl<any_tag> {
|
||||
}
|
||||
|
||||
template<typename Filter, typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Filter&, Device*, stream_offset,
|
||||
BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag )
|
||||
{ throw cant_seek(); }
|
||||
|
||||
template<typename Filter, typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Filter& f, Device* dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which,
|
||||
random_access tag )
|
||||
@ -216,14 +216,14 @@ struct flt_wrapper_impl<any_tag> {
|
||||
}
|
||||
|
||||
template<typename Filter, typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Filter& f, Device* dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which,
|
||||
random_access, any_tag )
|
||||
{ return f.seek(*dev, off, way); }
|
||||
|
||||
template<typename Filter, typename Device>
|
||||
static std::streampos
|
||||
static stream_offset
|
||||
seek( Filter& f, Device* dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which,
|
||||
random_access, two_sequence )
|
||||
|
@ -48,9 +48,9 @@ public:
|
||||
|
||||
std::streamsize read(char_type* s, std::streamsize n);
|
||||
std::streamsize write(const char_type* s, std::streamsize n);
|
||||
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which =
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
stream_offset seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which =
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
void close(BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out);
|
||||
#endif
|
||||
@ -66,12 +66,12 @@ public:
|
||||
{ return iostreams::write(t_, snk, s, n); }
|
||||
|
||||
template<typename Device>
|
||||
std::streampos seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way)
|
||||
stream_offset seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way)
|
||||
{ return iostreams::seek(t_, dev, off, way); }
|
||||
|
||||
template<typename Device>
|
||||
std::streampos seek( Device& dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which )
|
||||
stream_offset seek( Device& dev, stream_offset off,
|
||||
BOOST_IOS::seekdir way, BOOST_IOS::openmode which )
|
||||
{ return iostreams::seek(t_, dev, off, way, which); }
|
||||
|
||||
template<typename Device>
|
||||
@ -102,7 +102,7 @@ std::streamsize mode_adapter<Mode, T>::write
|
||||
{ return boost::iostreams::write(t_, s, n); }
|
||||
|
||||
template<typename Mode, typename T>
|
||||
std::streampos mode_adapter<Mode, T>::seek
|
||||
stream_offset mode_adapter<Mode, T>::seek
|
||||
(stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
|
||||
{ return boost::iostreams::seek(t_, off, way, which); }
|
||||
|
||||
|
@ -44,9 +44,9 @@ public:
|
||||
}
|
||||
return result;
|
||||
}
|
||||
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which =
|
||||
BOOST_IOS::in | BOOST_IOS::out )
|
||||
stream_offset seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which =
|
||||
BOOST_IOS::in | BOOST_IOS::out )
|
||||
{ return iostreams::seek(device_, off, way, which); }
|
||||
public:
|
||||
Device& device_;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
range_adapter(iterator first, iterator last);
|
||||
std::streamsize read(char_type* s, std::streamsize n);
|
||||
std::streamsize write(const char_type* s, std::streamsize n);
|
||||
std::streampos seek(stream_offset off, BOOST_IOS::seekdir way);
|
||||
stream_offset seek(stream_offset off, BOOST_IOS::seekdir way);
|
||||
private:
|
||||
iterator first_, cur_, last_;
|
||||
};
|
||||
@ -89,11 +89,11 @@ inline std::streamsize range_adapter<Mode, Range>::write
|
||||
|
||||
|
||||
template<typename Mode, typename Range>
|
||||
std::streampos range_adapter<Mode, Range>::seek
|
||||
stream_offset range_adapter<Mode, Range>::seek
|
||||
(stream_offset off, BOOST_IOS::seekdir way)
|
||||
{
|
||||
impl::seek(first_, cur_, last_, off, way);
|
||||
return offset_to_position(cur_ - first_);
|
||||
return static_cast<stream_offset>(cur_ - first_);
|
||||
}
|
||||
|
||||
//------------------Implementation of range_adapter_impl----------------------//
|
||||
|
@ -20,7 +20,7 @@
|
||||
// Description: Used to generate the traits classes is_istream, is_ostream,
|
||||
// etc.
|
||||
//
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
|
||||
# define BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait)
|
||||
#else
|
||||
# define BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) BOOST_PP_CAT(trait, _impl_)::
|
||||
|
@ -63,7 +63,7 @@ namespace std {
|
||||
|
||||
#if defined(__LIBCOMO__)
|
||||
using ::mbstate_t;
|
||||
#elif defined(BOOST_DINKUMWARE_STDLIB)
|
||||
#elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
|
||||
using ::mbstate_t;
|
||||
#elif defined(__SGI_STL_PORT)
|
||||
#elif defined(BOOST_NO_STDC_NAMESPACE)
|
||||
|
@ -47,7 +47,10 @@ template<typename Mode, typename Ch, typename T>
|
||||
struct resolve_traits {
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
boost::detail::is_incrementable<T>,
|
||||
mpl::and_<
|
||||
boost::detail::is_incrementable<T>, // Must come first
|
||||
is_dereferenceable<T> // for CW 9.[0-4]
|
||||
>,
|
||||
output_iterator_adapter<Mode, Ch, T>,
|
||||
const T&
|
||||
>::type type;
|
||||
@ -160,7 +163,10 @@ struct resolve_traits {
|
||||
mode_adapter<Mode, T>,
|
||||
is_iterator_range<T>,
|
||||
range_adapter<Mode, T>,
|
||||
is_dereferenceable<T>,
|
||||
mpl::and_<
|
||||
is_dereferenceable<T>,
|
||||
boost::detail::is_incrementable<T>
|
||||
>,
|
||||
output_iterator_adapter<Mode, Ch, T>,
|
||||
is_array<T>,
|
||||
array_adapter<Mode, T>,
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <boost/iostreams/detail/streambuf/linked_streambuf.hpp>
|
||||
#include <boost/iostreams/detail/error.hpp>
|
||||
#include <boost/iostreams/operations.hpp>
|
||||
#include <boost/iostreams/positioning.hpp>
|
||||
#include <boost/iostreams/traits.hpp>
|
||||
|
||||
// Must come last.
|
||||
@ -53,7 +52,7 @@ private:
|
||||
) streambuf_type;
|
||||
public: // stream needs access.
|
||||
void open(const T& t, int buffer_size, int pback_size);
|
||||
bool is_open() const;
|
||||
bool is_open();
|
||||
void close();
|
||||
bool auto_close() const { return auto_close_; }
|
||||
void set_auto_close(bool close) { auto_close_ = close; }
|
||||
@ -86,7 +85,7 @@ protected:
|
||||
BOOST_IOS::openmode which );
|
||||
pos_type seekpos(pos_type sp, BOOST_IOS::openmode which);
|
||||
private:
|
||||
pos_type seek_impl( stream_offset off, BOOST_IOS::seekdir way,
|
||||
pos_type seek_impl( off_type off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which );
|
||||
void init_input(any_tag) { }
|
||||
void init_input(input);
|
||||
@ -119,8 +118,7 @@ void direct_streambuf<T, Tr>::open(const T& t, int, int)
|
||||
}
|
||||
|
||||
template<typename T, typename Tr>
|
||||
bool direct_streambuf<T, Tr>::is_open() const
|
||||
{ return ibeg_ != 0 && !obeg_ != 0; }
|
||||
bool direct_streambuf<T, Tr>::is_open() { return ibeg_ != 0 && !obeg_ != 0; }
|
||||
|
||||
template<typename T, typename Tr>
|
||||
void direct_streambuf<T, Tr>::close()
|
||||
@ -187,10 +185,7 @@ template<typename T, typename Tr>
|
||||
inline typename direct_streambuf<T, Tr>::pos_type
|
||||
direct_streambuf<T, Tr>::seekpos
|
||||
(pos_type sp, BOOST_IOS::openmode)
|
||||
{
|
||||
return seek_impl( position_to_offset(sp), BOOST_IOS::beg,
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
}
|
||||
{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); }
|
||||
|
||||
template<typename T, typename Tr>
|
||||
void direct_streambuf<T, Tr>::close(BOOST_IOS::openmode which)
|
||||
@ -209,13 +204,13 @@ void direct_streambuf<T, Tr>::close(BOOST_IOS::openmode which)
|
||||
|
||||
template<typename T, typename Tr>
|
||||
typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seek_impl
|
||||
(stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
|
||||
(off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
|
||||
{
|
||||
using namespace std;
|
||||
BOOST_IOS::openmode both = BOOST_IOS::in | BOOST_IOS::out;
|
||||
if (two_head() && (which & both) == both)
|
||||
throw bad_seek();
|
||||
stream_offset result = -1;
|
||||
off_type result = -1;
|
||||
bool one = one_head();
|
||||
if (one && (pptr() != 0 || gptr()== 0))
|
||||
init_get_area(); // Switch to input mode, for code reuse.
|
||||
@ -247,7 +242,7 @@ typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seek_impl
|
||||
pbump(static_cast<int>(next - (pptr() - obeg_)));
|
||||
result = next;
|
||||
}
|
||||
return offset_to_position(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, typename Tr>
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
indirect_streambuf();
|
||||
|
||||
void open(const T& t BOOST_IOSTREAMS_PUSH_PARAMS());
|
||||
bool is_open() const;
|
||||
bool is_open();
|
||||
void close();
|
||||
bool auto_close() const;
|
||||
void set_auto_close(bool close);
|
||||
@ -118,7 +118,7 @@ private:
|
||||
void sync_impl();
|
||||
void close_impl(BOOST_IOS::openmode);
|
||||
|
||||
enum flag_type {
|
||||
enum {
|
||||
f_open = 1,
|
||||
f_input_closed = f_open << 1,
|
||||
f_output_closed = f_input_closed << 1,
|
||||
@ -189,7 +189,7 @@ void indirect_streambuf<T, Tr, Alloc, Mode>::open
|
||||
}
|
||||
|
||||
template<typename T, typename Tr, typename Alloc, typename Mode>
|
||||
inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open() const
|
||||
inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open()
|
||||
{ return (flags_ & f_open) != 0; }
|
||||
|
||||
template<typename T, typename Tr, typename Alloc, typename Mode>
|
||||
@ -328,10 +328,7 @@ template<typename T, typename Tr, typename Alloc, typename Mode>
|
||||
inline typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
|
||||
indirect_streambuf<T, Tr, Alloc, Mode>::seekpos
|
||||
(pos_type sp, BOOST_IOS::openmode)
|
||||
{
|
||||
return seek_impl( position_to_offset(sp), BOOST_IOS::beg,
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
}
|
||||
{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); }
|
||||
|
||||
template<typename T, typename Tr, typename Alloc, typename Mode>
|
||||
typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
|
||||
|
@ -51,9 +51,9 @@ public:
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
std::streamsize read(char_type* s, std::streamsize n);
|
||||
std::streamsize write(const char_type* s, std::streamsize n);
|
||||
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which =
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
stream_offset seek( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode which =
|
||||
BOOST_IOS::in | BOOST_IOS::out );
|
||||
void open( const std::string& path,
|
||||
BOOST_IOS::openmode mode =
|
||||
BOOST_IOS::in | BOOST_IOS::out,
|
||||
@ -154,7 +154,7 @@ inline std::streamsize basic_file<Ch>::write
|
||||
{ return pimpl_->file_.sputn(s, n); }
|
||||
|
||||
template<typename Ch>
|
||||
std::streampos basic_file<Ch>::seek
|
||||
stream_offset basic_file<Ch>::seek
|
||||
( stream_offset off, BOOST_IOS::seekdir way,
|
||||
BOOST_IOS::openmode )
|
||||
{ return iostreams::seek(pimpl_->file_, off, way); }
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
bool is_open() const { return pimpl_->flags_ != 0; }
|
||||
std::streamsize read(char_type* s, std::streamsize n);
|
||||
std::streamsize write(const char_type* s, std::streamsize n);
|
||||
std::streampos seek(stream_offset off, BOOST_IOS::seekdir way);
|
||||
stream_offset seek(stream_offset off, BOOST_IOS::seekdir way);
|
||||
void close();
|
||||
private:
|
||||
struct impl {
|
||||
|
@ -137,7 +137,7 @@ private:
|
||||
|
||||
//------------------Definition of mapped_file---------------------------------//
|
||||
|
||||
class BOOST_IOSTREAMS_DECL mapped_file {
|
||||
class mapped_file {
|
||||
private:
|
||||
typedef mapped_file_source delegate_type;
|
||||
delegate_type delegate_;
|
||||
@ -202,7 +202,7 @@ public:
|
||||
static int alignment() { return mapped_file_source::alignment(); }
|
||||
};
|
||||
|
||||
struct BOOST_IOSTREAMS_DECL mapped_file_sink : private mapped_file {
|
||||
struct mapped_file_sink : private mapped_file {
|
||||
friend struct operations<mapped_file_sink>;
|
||||
typedef char char_type;
|
||||
struct category
|
||||
|
@ -30,9 +30,9 @@ public:
|
||||
{ };
|
||||
std::streamsize read(Ch*, std::streamsize) { return 0; }
|
||||
std::streamsize write(const Ch*, std::streamsize n) { return n; }
|
||||
std::streampos seek( stream_offset, BOOST_IOS::seekdir,
|
||||
BOOST_IOS::openmode =
|
||||
BOOST_IOS::in | BOOST_IOS::out )
|
||||
stream_offset seek( stream_offset, BOOST_IOS::seekdir,
|
||||
BOOST_IOS::openmode =
|
||||
BOOST_IOS::in | BOOST_IOS::out )
|
||||
{ return -1; }
|
||||
void close(BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out) { }
|
||||
};
|
||||
|
@ -234,20 +234,14 @@ public:
|
||||
template<typename Sink>
|
||||
void close(Sink& snk, BOOST_IOS::openmode m)
|
||||
{
|
||||
namespace io = boost::iostreams;
|
||||
|
||||
if (m & BOOST_IOS::out) {
|
||||
|
||||
// Close zlib compressor.
|
||||
base_type::close(snk, BOOST_IOS::out);
|
||||
|
||||
if (flags_ & f_header_done) {
|
||||
|
||||
// Write final fields of gzip file format.
|
||||
write_long(this->crc(), snk);
|
||||
write_long(this->total_in(), snk);
|
||||
}
|
||||
// Close zlib compressor.
|
||||
base_type::close(snk, BOOST_IOS::out);
|
||||
|
||||
// Write final fields of gzip file format.
|
||||
write_long(this->crc(), snk);
|
||||
write_long(this->total_in(), snk);
|
||||
}
|
||||
#if BOOST_WORKAROUND(__GNUC__, == 2) && defined(__STL_CONFIG_H) || \
|
||||
BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) \
|
||||
@ -273,7 +267,7 @@ private:
|
||||
boost::iostreams::put(next, static_cast<char>(0xFF & (n >> 24)));
|
||||
}
|
||||
|
||||
enum flag_type {
|
||||
enum {
|
||||
f_header_done = 1,
|
||||
f_body_done = f_header_done << 1,
|
||||
f_footer_done = f_body_done << 1
|
||||
@ -462,7 +456,7 @@ private:
|
||||
if (static_cast<int>(read_uint32(rng, gzip::bad_footer)) != this->total_out())
|
||||
throw gzip_error(gzip::bad_length);
|
||||
}
|
||||
enum flag_type {
|
||||
enum {
|
||||
f_header_read = 1,
|
||||
f_footer_read = f_header_read << 1,
|
||||
f_text = f_footer_read << 1
|
||||
@ -553,11 +547,11 @@ std::streamsize basic_gzip_compressor<Alloc>::read_string
|
||||
static_cast<streamsize>(str.size() - offset_);
|
||||
streamsize amt = (std::min)(avail, n);
|
||||
std::copy( str.data() + offset_,
|
||||
str.data() + offset_ + amt,
|
||||
s );
|
||||
str.data() + offset_ + amt,
|
||||
s );
|
||||
offset_ += amt;
|
||||
if ( !(flags_ & f_header_done) &&
|
||||
offset_ == static_cast<std::size_t>(str.size()) )
|
||||
offset_ == static_cast<std::size_t>(str.size()) )
|
||||
{
|
||||
flags_ |= f_header_done;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ private:
|
||||
|
||||
void close();
|
||||
|
||||
enum flag_type {
|
||||
enum {
|
||||
f_read = 1,
|
||||
f_write = f_read << 1,
|
||||
f_eof = f_write << 1,
|
||||
|
@ -332,7 +332,7 @@ zlib_compressor_impl<Alloc>::zlib_compressor_impl(const zlib_params& p)
|
||||
|
||||
template<typename Alloc>
|
||||
zlib_compressor_impl<Alloc>::~zlib_compressor_impl()
|
||||
{ reset(true, false); }
|
||||
{ /*reset(true, false);*/ }
|
||||
|
||||
template<typename Alloc>
|
||||
bool zlib_compressor_impl<Alloc>::filter
|
||||
@ -357,7 +357,7 @@ zlib_decompressor_impl<Alloc>::zlib_decompressor_impl(const zlib_params& p)
|
||||
|
||||
template<typename Alloc>
|
||||
zlib_decompressor_impl<Alloc>::~zlib_decompressor_impl()
|
||||
{ reset(false, false); }
|
||||
{ /*reset(false, false);*/ }
|
||||
|
||||
template<typename Alloc>
|
||||
zlib_decompressor_impl<Alloc>::zlib_decompressor_impl(int window_bits)
|
||||
|
@ -46,7 +46,7 @@ inline std::streampos offset_to_position(stream_offset off)
|
||||
return std::streampos(std::mbstate_t(), off);
|
||||
}
|
||||
|
||||
inline stream_offset fpos_t_to_offset(fpos_t pos)
|
||||
inline stream_offset fpos_t_to_offset(std::fpos_t pos)
|
||||
{ // Helper function.
|
||||
#if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64)
|
||||
return pos;
|
||||
|
@ -52,7 +52,7 @@ namespace boost
|
||||
|
||||
template <class Category, class T, class Distance = std::ptrdiff_t,
|
||||
class Pointer = T*, class Reference = T&>
|
||||
struct iterator : detail::iterator_base<Category, T, Distance, Pointer, Reference> {};
|
||||
struct iterator : boost::detail::iterator_base<Category, T, Distance, Pointer, Reference> {};
|
||||
# endif
|
||||
} // namespace boost
|
||||
|
||||
|
@ -109,11 +109,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x2407) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
|
||||
# define BOOST_ITERATOR_NO_MPL_AUX_HAS_XXX // "MPL's has_xxx facility doesn't work"
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
|
||||
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
||||
|
@ -72,7 +72,7 @@ namespace boost
|
||||
: mpl::identity<Return>
|
||||
# endif
|
||||
{
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
typedef Return type;
|
||||
# endif
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ namespace boost { namespace detail {
|
||||
//
|
||||
template <bool GreaterEqual, bool LessEqual>
|
||||
struct minimum_category_impl
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
{
|
||||
template <class T1, class T2> struct apply
|
||||
{
|
||||
@ -77,12 +77,12 @@ template <class T1 = mpl::_1, class T2 = mpl::_2>
|
||||
struct minimum_category
|
||||
{
|
||||
typedef minimum_category_impl<
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround
|
||||
is_same<T2,int>::value ||
|
||||
# endif
|
||||
::boost::is_convertible<T1,T2>::value
|
||||
, ::boost::is_convertible<T2,T1>::value
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround
|
||||
|| is_same<T1,int>::value
|
||||
# endif
|
||||
> outer;
|
||||
@ -103,7 +103,7 @@ struct minimum_category<mpl::_1,mpl::_2>
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,minimum_category,(mpl::_1,mpl::_2))
|
||||
};
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround
|
||||
template <>
|
||||
struct minimum_category<int,int>
|
||||
{
|
||||
|
@ -53,14 +53,14 @@ namespace boost
|
||||
public:
|
||||
filter_iterator() { }
|
||||
|
||||
filter_iterator(Predicate f, Iterator x, Iterator end = Iterator())
|
||||
: super_t(x), m_predicate(f), m_end(end)
|
||||
filter_iterator(Predicate f, Iterator x, Iterator end_ = Iterator())
|
||||
: super_t(x), m_predicate(f), m_end(end_)
|
||||
{
|
||||
satisfy_predicate();
|
||||
}
|
||||
|
||||
filter_iterator(Iterator x, Iterator end = Iterator())
|
||||
: super_t(x), m_predicate(), m_end(end)
|
||||
filter_iterator(Iterator x, Iterator end_ = Iterator())
|
||||
: super_t(x), m_predicate(), m_end(end_)
|
||||
{
|
||||
// Pro8 is a little too aggressive about instantiating the
|
||||
// body of this function.
|
||||
@ -122,7 +122,7 @@ namespace boost
|
||||
, Iterator
|
||||
>::type x
|
||||
, Iterator end = Iterator()
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
, Predicate* = 0
|
||||
#endif
|
||||
)
|
||||
|
@ -97,7 +97,7 @@ namespace detail
|
||||
>
|
||||
{};
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <>
|
||||
struct old_category_to_traversal<int>
|
||||
{
|
||||
@ -131,7 +131,7 @@ namespace detail
|
||||
{
|
||||
};
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <>
|
||||
struct pure_traversal_tag<int>
|
||||
{
|
||||
|
@ -327,7 +327,7 @@ namespace boost
|
||||
}
|
||||
};
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// Deal with ETI
|
||||
template<>
|
||||
struct operator_arrow_result<int, int, int>
|
||||
@ -410,7 +410,7 @@ namespace boost
|
||||
:
|
||||
# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP
|
||||
iterator_difference<I1>
|
||||
# elif BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
# elif BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
mpl::if_<
|
||||
is_convertible<I2,I1>
|
||||
, typename I1::difference_type
|
||||
@ -431,14 +431,14 @@ namespace boost
|
||||
|
||||
// Macros which describe the declarations of binary operators
|
||||
# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
|
||||
# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
|
||||
template < \
|
||||
class Derived1, class V1, class TC1, class R1, class D1 \
|
||||
, class Derived2, class V2, class TC2, class R2, class D2 \
|
||||
> \
|
||||
prefix typename mpl::apply2<result_type,Derived1,Derived2>::type \
|
||||
operator op( \
|
||||
iterator_facade<Derived1, V1, TC1, R1, D1> const& lhs \
|
||||
# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
|
||||
template < \
|
||||
class Derived1, class V1, class TC1, class R1, class D1 \
|
||||
, class Derived2, class V2, class TC2, class R2, class D2 \
|
||||
> \
|
||||
prefix typename mpl::apply2<result_type,Derived1,Derived2>::type \
|
||||
operator op( \
|
||||
iterator_facade<Derived1, V1, TC1, R1, D1> const& lhs \
|
||||
, iterator_facade<Derived2, V2, TC2, R2, D2> const& rhs)
|
||||
# else
|
||||
# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
|
||||
@ -446,7 +446,7 @@ namespace boost
|
||||
class Derived1, class V1, class TC1, class R1, class D1 \
|
||||
, class Derived2, class V2, class TC2, class R2, class D2 \
|
||||
> \
|
||||
prefix typename detail::enable_if_interoperable< \
|
||||
prefix typename detail::enable_if_interoperable< \
|
||||
Derived1, Derived2 \
|
||||
, typename mpl::apply2<result_type,Derived1,Derived2>::type \
|
||||
>::type \
|
||||
@ -496,14 +496,14 @@ namespace boost
|
||||
;
|
||||
|
||||
BOOST_ITERATOR_FACADE_PLUS_HEAD(
|
||||
friend
|
||||
friend inline
|
||||
, (iterator_facade<Derived, V, TC, R, D> const&
|
||||
, typename Derived::difference_type)
|
||||
)
|
||||
;
|
||||
|
||||
BOOST_ITERATOR_FACADE_PLUS_HEAD(
|
||||
friend
|
||||
friend inline
|
||||
, (typename Derived::difference_type
|
||||
, iterator_facade<Derived, V, TC, R, D> const&)
|
||||
)
|
||||
@ -620,7 +620,7 @@ namespace boost
|
||||
|
||||
protected:
|
||||
// For use by derived classes
|
||||
typedef iterator_facade<Derived,Value,Reference,Difference> iterator_facade_;
|
||||
typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
|
||||
|
||||
public:
|
||||
|
||||
@ -666,7 +666,7 @@ namespace boost
|
||||
return this->derived();
|
||||
}
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
typename detail::postfix_increment_result<Derived,Value,Reference,CategoryOrTraversal>::type
|
||||
operator++(int)
|
||||
{
|
||||
@ -708,7 +708,7 @@ namespace boost
|
||||
return result -= x;
|
||||
}
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
// There appears to be a bug which trashes the data of classes
|
||||
// derived from iterator_facade when they are assigned unless we
|
||||
// define this assignment operator. This bug is only revealed
|
||||
@ -721,9 +721,9 @@ namespace boost
|
||||
# endif
|
||||
};
|
||||
|
||||
# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <class I, class V, class TC, class R, class D>
|
||||
typename detail::postfix_increment_result<I,V,R,TC>::type
|
||||
inline typename detail::postfix_increment_result<I,V,R,TC>::type
|
||||
operator++(
|
||||
iterator_facade<I,V,TC,R,D>& i
|
||||
, int
|
||||
|
@ -55,7 +55,7 @@ struct BOOST_ITERATOR_CATEGORY
|
||||
typedef typename detail::iterator_traits<Iterator>::iterator_category type;
|
||||
};
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <>
|
||||
struct iterator_value<int>
|
||||
{
|
||||
|
@ -328,11 +328,6 @@ private:
|
||||
return (u.*f_);
|
||||
}
|
||||
|
||||
template<class U> R & call(U & u, T *) const
|
||||
{
|
||||
return (u.*f_);
|
||||
}
|
||||
|
||||
template<class U> R const & call(U & u, void const *) const
|
||||
{
|
||||
return (get_pointer(u)->*f_);
|
||||
@ -352,7 +347,7 @@ public:
|
||||
return (p->*f_);
|
||||
}
|
||||
|
||||
template<class U> R const & operator()(U & u) const
|
||||
template<class U> R const & operator()(U const & u) const
|
||||
{
|
||||
return call(u, &u);
|
||||
}
|
||||
@ -364,13 +359,13 @@ public:
|
||||
return (t.*f_);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
R const & operator()(T const & t) const
|
||||
{
|
||||
return (t.*f_);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool operator==(dm const & rhs) const
|
||||
{
|
||||
return f_ == rhs.f_;
|
||||
|
@ -15,8 +15,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/apply_fwd.hpp,v $
|
||||
// $Date: 2004/09/02 15:40:41 $
|
||||
// $Revision: 1.2 $
|
||||
// $Date: 2005/08/25 16:27:21 $
|
||||
// $Revision: 1.3 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/aux_/na.hpp>
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
// agurt, 15/jan/02: top-level 'apply' template gives an ICE on MSVC
|
||||
// (for known reasons)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
# define BOOST_MPL_CFG_NO_APPLY_TEMPLATE
|
||||
#endif
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_support.hpp,v $
|
||||
// $Date: 2004/11/28 01:37:05 $
|
||||
// $Revision: 1.12 $
|
||||
// $Date: 2005/08/25 16:27:21 $
|
||||
// $Revision: 1.13 $
|
||||
|
||||
#include <boost/mpl/aux_/config/lambda.hpp>
|
||||
|
||||
@ -122,7 +122,7 @@ template< BOOST_MPL_PP_PARAMS(i,typename T) > \
|
||||
, name< BOOST_MPL_PP_ENUM(i,::boost::mpl::na) >* \
|
||||
); \
|
||||
/**/
|
||||
#elif !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#elif !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
|
||||
template< BOOST_MPL_PP_PARAMS(i,typename T) > \
|
||||
::boost::mpl::aux::yes_tag operator|( \
|
||||
|
@ -13,8 +13,8 @@ namespace boost { namespace mpl {
|
||||
|
||||
template< typename T, bool has_type_ >
|
||||
struct quote_impl
|
||||
: T
|
||||
{
|
||||
typedef typename T::type type;
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
|
@ -43,9 +43,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector1_c< T,C0 >
|
||||
: vector1_c< T, T(C0) >
|
||||
{
|
||||
typedef typename vector1_c< T,C0 >::type type;
|
||||
typedef typename vector1_c< T, T(C0) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -56,9 +56,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector2_c< T,C0,C1 >
|
||||
: vector2_c< T, T(C0), T(C1) >
|
||||
{
|
||||
typedef typename vector2_c< T,C0,C1 >::type type;
|
||||
typedef typename vector2_c< T, T(C0), T(C1) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -69,9 +69,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector3_c< T,C0,C1,C2 >
|
||||
: vector3_c< T, T(C0), T(C1), T(C2) >
|
||||
{
|
||||
typedef typename vector3_c< T,C0,C1,C2 >::type type;
|
||||
typedef typename vector3_c< T, T(C0), T(C1), T(C2) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -82,9 +82,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector4_c< T,C0,C1,C2,C3 >
|
||||
: vector4_c< T, T(C0), T(C1), T(C2), T(C3) >
|
||||
{
|
||||
typedef typename vector4_c< T,C0,C1,C2,C3 >::type type;
|
||||
typedef typename vector4_c< T, T(C0), T(C1), T(C2), T(C3) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -95,9 +95,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector5_c< T,C0,C1,C2,C3,C4 >
|
||||
: vector5_c< T, T(C0), T(C1), T(C2), T(C3), T(C4) >
|
||||
{
|
||||
typedef typename vector5_c< T,C0,C1,C2,C3,C4 >::type type;
|
||||
typedef typename vector5_c< T, T(C0), T(C1), T(C2), T(C3), T(C4) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -108,9 +108,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector6_c< T,C0,C1,C2,C3,C4,C5 >
|
||||
: vector6_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5) >
|
||||
{
|
||||
typedef typename vector6_c< T,C0,C1,C2,C3,C4,C5 >::type type;
|
||||
typedef typename vector6_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -122,9 +122,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector7_c< T,C0,C1,C2,C3,C4,C5,C6 >
|
||||
: vector7_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6) >
|
||||
{
|
||||
typedef typename vector7_c< T,C0,C1,C2,C3,C4,C5,C6 >::type type;
|
||||
typedef typename vector7_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -136,9 +136,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector8_c< T,C0,C1,C2,C3,C4,C5,C6,C7 >
|
||||
: vector8_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7) >
|
||||
{
|
||||
typedef typename vector8_c< T,C0,C1,C2,C3,C4,C5,C6,C7 >::type type;
|
||||
typedef typename vector8_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -150,9 +150,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX
|
||||
>
|
||||
: vector9_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8 >
|
||||
: vector9_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8) >
|
||||
{
|
||||
typedef typename vector9_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8 >::type type;
|
||||
typedef typename vector9_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -164,9 +164,9 @@ struct vector_c<
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX
|
||||
>
|
||||
: vector10_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9 >
|
||||
: vector10_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9) >
|
||||
{
|
||||
typedef typename vector10_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9 >::type type;
|
||||
typedef typename vector10_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -177,9 +177,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, LONG_MAX, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector11_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10 >
|
||||
: vector11_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10) >
|
||||
{
|
||||
typedef typename vector11_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10 >::type type;
|
||||
typedef typename vector11_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -190,9 +190,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector12_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 >
|
||||
: vector12_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11) >
|
||||
{
|
||||
typedef typename vector12_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 >::type type;
|
||||
typedef typename vector12_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -203,9 +203,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, LONG_MAX
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector13_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12 >
|
||||
: vector13_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12) >
|
||||
{
|
||||
typedef typename vector13_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12 >::type type;
|
||||
typedef typename vector13_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -217,11 +217,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector14_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13
|
||||
>
|
||||
: vector14_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13) >
|
||||
{
|
||||
typedef typename vector14_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13 >::type type;
|
||||
typedef typename vector14_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -233,11 +231,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector15_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
>
|
||||
: vector15_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14) >
|
||||
{
|
||||
typedef typename vector15_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14 >::type type;
|
||||
typedef typename vector15_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -249,12 +245,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector16_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15
|
||||
>
|
||||
: vector16_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15) >
|
||||
{
|
||||
typedef typename vector16_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15 >::type type;
|
||||
typedef typename vector16_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -266,12 +259,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, LONG_MAX, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector17_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16
|
||||
>
|
||||
: vector17_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16) >
|
||||
{
|
||||
typedef typename vector17_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16 >::type type;
|
||||
typedef typename vector17_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -283,12 +273,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17, LONG_MAX, LONG_MAX
|
||||
>
|
||||
: vector18_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17
|
||||
>
|
||||
: vector18_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17) >
|
||||
{
|
||||
typedef typename vector18_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17 >::type type;
|
||||
typedef typename vector18_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17) >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -300,12 +287,9 @@ struct vector_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17, C18, LONG_MAX
|
||||
>
|
||||
: vector19_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17, C18
|
||||
>
|
||||
: vector19_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18) >
|
||||
{
|
||||
typedef typename vector19_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18 >::type type;
|
||||
typedef typename vector19_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18) >::type type;
|
||||
};
|
||||
|
||||
/// primary template (not a specialization!)
|
||||
@ -316,12 +300,9 @@ template<
|
||||
, long C13, long C14, long C15, long C16, long C17, long C18, long C19
|
||||
>
|
||||
struct vector_c
|
||||
: vector20_c<
|
||||
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
|
||||
, C15, C16, C17, C18, C19
|
||||
>
|
||||
: vector20_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18), T(C19) >
|
||||
{
|
||||
typedef typename vector20_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19 >::type type;
|
||||
typedef typename vector20_c< T, T(C0), T(C1), T(C2), T(C3), T(C4), T(C5), T(C6), T(C7), T(C8), T(C9), T(C10), T(C11), T(C12), T(C13), T(C14), T(C15), T(C16), T(C17), T(C18), T(C19) >::type type;
|
||||
};
|
||||
|
||||
}}
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/yes_no.hpp,v $
|
||||
// $Date: 2004/09/28 13:56:59 $
|
||||
// $Revision: 1.7 $
|
||||
// $Date: 2005/08/25 16:27:21 $
|
||||
// $Revision: 1.8 $
|
||||
|
||||
#include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
#include <boost/mpl/aux_/config/arrays.hpp>
|
||||
@ -38,7 +38,7 @@ template<> struct yes_no_tag<true>
|
||||
|
||||
template< BOOST_MPL_AUX_NTTP_DECL(long, n) > struct weighted_tag
|
||||
{
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
typedef char (&type)[n];
|
||||
#else
|
||||
char buf[n];
|
||||
|
@ -15,8 +15,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/quote.hpp,v $
|
||||
// $Date: 2004/09/02 15:40:42 $
|
||||
// $Revision: 1.5 $
|
||||
// $Date: 2006/05/03 03:27:58 $
|
||||
// $Revision: 1.5.14.2 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/void.hpp>
|
||||
@ -60,9 +60,19 @@ namespace boost { namespace mpl {
|
||||
|
||||
template< typename T, bool has_type_ >
|
||||
struct quote_impl
|
||||
// GCC has a problem with metafunction forwarding when T is a
|
||||
// specialization of a template called 'type'.
|
||||
# if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4)) \
|
||||
&& BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(0)) \
|
||||
&& BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(2))
|
||||
{
|
||||
typedef typename T::type type;
|
||||
};
|
||||
# else
|
||||
: T
|
||||
{
|
||||
};
|
||||
# endif
|
||||
|
||||
template< typename T >
|
||||
struct quote_impl<T,false>
|
||||
|
@ -42,9 +42,10 @@ namespace boost {
|
||||
|
||||
struct populate_index_ranges {
|
||||
multi_array_types::index_range
|
||||
// RG: underscore on extent_ to stifle strange MSVC warning.
|
||||
operator()(multi_array_types::index base,
|
||||
multi_array_types::size_type extent) {
|
||||
return multi_array_types::index_range(base,base+extent);
|
||||
multi_array_types::size_type extent_) {
|
||||
return multi_array_types::index_range(base,base+extent_);
|
||||
}
|
||||
};
|
||||
|
||||
@ -379,12 +380,30 @@ public:
|
||||
}
|
||||
|
||||
|
||||
template <typename ExtentList>
|
||||
multi_array& resize(const ExtentList& extents) {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<ExtentList> >();
|
||||
|
||||
typedef detail::multi_array::extent_gen<NumDims> gen_type;
|
||||
gen_type ranges;
|
||||
|
||||
for (int i=0; i != NumDims; ++i) {
|
||||
typedef typename gen_type::range range_type;
|
||||
ranges.ranges_[i] = range_type(0,extents[i]);
|
||||
}
|
||||
|
||||
return this->resize(ranges);
|
||||
}
|
||||
|
||||
|
||||
|
||||
multi_array& resize(const detail::multi_array
|
||||
::extent_gen<NumDims>& ranges) {
|
||||
|
||||
|
||||
// build a multi_array with the specs given
|
||||
multi_array new_array(ranges);
|
||||
multi_array new_array(ranges,this->storage_order());
|
||||
|
||||
|
||||
// build a view of tmp with the minimum extents
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "boost/multi_array/storage_order.hpp"
|
||||
#include "boost/multi_array/types.hpp"
|
||||
#include "boost/config.hpp"
|
||||
#include "boost/multi_array/concept_checks.hpp" //for ignore_unused_...
|
||||
#include "boost/mpl/eval_if.hpp"
|
||||
#include "boost/mpl/if.hpp"
|
||||
#include "boost/mpl/size_t.hpp"
|
||||
@ -32,7 +33,7 @@
|
||||
#include "boost/iterator/reverse_iterator.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include <cassert>
|
||||
#include "boost/assert.hpp"
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
@ -129,11 +130,13 @@ protected:
|
||||
Reference access(boost::type<Reference>,index idx,TPtr base,
|
||||
const size_type* extents,
|
||||
const index* strides,
|
||||
const index* index_base) const {
|
||||
const index* index_bases) const {
|
||||
|
||||
BOOST_ASSERT(idx - index_bases[0] >= 0);
|
||||
BOOST_ASSERT(size_type(idx - index_bases[0]) < extents[0]);
|
||||
// return a sub_array<T,NDims-1> proxy object
|
||||
TPtr newbase = base + idx * strides[0];
|
||||
return Reference(newbase,extents+1,strides+1,index_base+1);
|
||||
return Reference(newbase,extents+1,strides+1,index_bases+1);
|
||||
|
||||
}
|
||||
|
||||
@ -165,9 +168,14 @@ protected:
|
||||
// used by array operator[] and iterators to get reference types.
|
||||
template <typename Reference, typename TPtr>
|
||||
Reference access(boost::type<Reference>,index idx,TPtr base,
|
||||
const size_type*,
|
||||
const size_type* extents,
|
||||
const index* strides,
|
||||
const index*) const {
|
||||
const index* index_bases) const {
|
||||
|
||||
ignore_unused_variable_warning(index_bases);
|
||||
ignore_unused_variable_warning(extents);
|
||||
BOOST_ASSERT(idx - index_bases[0] >= 0);
|
||||
BOOST_ASSERT(size_type(idx - index_bases[0]) < extents[0]);
|
||||
return *(base + idx * strides[0]);
|
||||
}
|
||||
|
||||
@ -201,7 +209,7 @@ struct value_accessor_generator {
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
|
||||
struct eti_value_accessor
|
||||
{
|
||||
@ -251,7 +259,7 @@ struct associated_types
|
||||
template <typename T, std::size_t NumDims>
|
||||
class multi_array_impl_base
|
||||
:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
public mpl::aux::msvc_eti_base<
|
||||
typename value_accessor_generator<T,mpl::size_t<NumDims> >::type
|
||||
>::type
|
||||
@ -307,9 +315,22 @@ protected:
|
||||
|
||||
// Used by operator() in our array classes
|
||||
template <typename Reference, typename IndexList, typename TPtr>
|
||||
Reference access_element(boost::type<Reference>, TPtr base,
|
||||
Reference access_element(boost::type<Reference>,
|
||||
const IndexList& indices,
|
||||
const index* strides) const {
|
||||
TPtr base,
|
||||
const size_type* extents,
|
||||
const index* strides,
|
||||
const index* index_bases) const {
|
||||
|
||||
ignore_unused_variable_warning(index_bases);
|
||||
ignore_unused_variable_warning(extents);
|
||||
#if !defined(NDEBUG) && !defined(BOOST_DISABLE_ASSERTS)
|
||||
for (size_type i = 0; i != NumDims; ++i) {
|
||||
BOOST_ASSERT(indices[i] - index_bases[i] >= 0);
|
||||
BOOST_ASSERT(size_type(indices[i] - index_bases[i]) < extents[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
index offset = 0;
|
||||
for (size_type n = 0; n != NumDims; ++n)
|
||||
offset += indices[n] * strides[n];
|
||||
@ -418,6 +439,12 @@ protected:
|
||||
index index_factor = current_range.stride();
|
||||
index len = (finish - start + (index_factor - 1)) / index_factor;
|
||||
|
||||
BOOST_ASSERT(index_bases[n] <= start &&
|
||||
start <= index_bases[n]+index(extents[n]));
|
||||
BOOST_ASSERT(index_bases[n] <= finish &&
|
||||
finish <= index_bases[n]+index(extents[n]));
|
||||
BOOST_ASSERT(index_factor > 0);
|
||||
|
||||
// the array data pointer is modified to account for non-zero
|
||||
// bases during slicing (see [Garcia] for the math involved)
|
||||
offset += start * strides[n];
|
||||
@ -433,7 +460,7 @@ protected:
|
||||
++dim;
|
||||
}
|
||||
}
|
||||
assert (dim == NDims);
|
||||
BOOST_ASSERT(dim == NDims);
|
||||
|
||||
return
|
||||
ArrayRef(base+offset,
|
||||
|
@ -29,8 +29,8 @@ class extent_gen {
|
||||
public:
|
||||
typedef boost::detail::multi_array::index index;
|
||||
typedef boost::detail::multi_array::size_type size_type;
|
||||
private:
|
||||
typedef extent_range<index,size_type> range;
|
||||
private:
|
||||
typedef typename range_list_generator<range,NumRanges>::type range_list;
|
||||
public:
|
||||
template <std::size_t Ranges>
|
||||
|
@ -28,9 +28,9 @@ namespace multi_array {
|
||||
template <int NumRanges, int NumDims>
|
||||
struct index_gen {
|
||||
private:
|
||||
typedef ::boost::detail::multi_array::index Index;
|
||||
typedef std::size_t SizeType;
|
||||
typedef index_range<Index,SizeType> range;
|
||||
typedef ::boost::detail::multi_array::index index;
|
||||
typedef ::boost::detail::multi_array::size_type size_type;
|
||||
typedef index_range<index,size_type> range;
|
||||
public:
|
||||
template <int Dims, int Ranges>
|
||||
struct gen_type {
|
||||
@ -44,27 +44,27 @@ public:
|
||||
|
||||
template <int ND>
|
||||
explicit index_gen(const index_gen<NumRanges-1,ND>& rhs,
|
||||
const index_range<Index,SizeType>& range)
|
||||
const range& r)
|
||||
{
|
||||
std::copy(rhs.ranges_.begin(),rhs.ranges_.end(),ranges_.begin());
|
||||
*ranges_.rbegin() = range;
|
||||
*ranges_.rbegin() = r;
|
||||
}
|
||||
|
||||
index_gen<NumRanges+1,NumDims+1>
|
||||
operator[](const index_range<Index,SizeType>& range) const
|
||||
operator[](const range& r) const
|
||||
{
|
||||
index_gen<NumRanges+1,NumDims+1> tmp;
|
||||
std::copy(ranges_.begin(),ranges_.end(),tmp.ranges_.begin());
|
||||
*tmp.ranges_.rbegin() = range;
|
||||
*tmp.ranges_.rbegin() = r;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
index_gen<NumRanges+1,NumDims>
|
||||
operator[](Index idx) const
|
||||
operator[](index idx) const
|
||||
{
|
||||
index_gen<NumRanges+1,NumDims> tmp;
|
||||
std::copy(ranges_.begin(),ranges_.end(),tmp.ranges_.begin());
|
||||
*tmp.ranges_.rbegin() = index_range<Index,SizeType>(idx);
|
||||
*tmp.ranges_.rbegin() = range(idx);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,15 @@ namespace multi_array {
|
||||
typedef Index index;
|
||||
typedef SizeType size_type;
|
||||
|
||||
private:
|
||||
static index from_start()
|
||||
{ return (std::numeric_limits<index>::min)(); }
|
||||
|
||||
static index to_end()
|
||||
{ return (std::numeric_limits<index>::max)(); }
|
||||
|
||||
public:
|
||||
|
||||
index_range()
|
||||
{
|
||||
start_ = from_start();
|
||||
@ -46,7 +55,7 @@ namespace multi_array {
|
||||
explicit index_range(index pos)
|
||||
{
|
||||
start_ = pos;
|
||||
finish_ = pos;
|
||||
finish_ = pos+1;
|
||||
stride_ = 1;
|
||||
degenerate_ = true;
|
||||
}
|
||||
@ -60,13 +69,13 @@ namespace multi_array {
|
||||
// These are for chaining assignments to an index_range
|
||||
index_range& start(index s) {
|
||||
start_ = s;
|
||||
degenerate_ = (start_ == finish_);
|
||||
degenerate_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
index_range& finish(index f) {
|
||||
finish_ = f;
|
||||
degenerate_ = (start_ == finish_);
|
||||
degenerate_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -77,7 +86,7 @@ namespace multi_array {
|
||||
return start_;
|
||||
}
|
||||
|
||||
index get_start(index low_index_range = 0) const
|
||||
index get_start(index low_index_range = index_range::from_start()) const
|
||||
{
|
||||
if (start_ == from_start())
|
||||
return low_index_range;
|
||||
@ -89,28 +98,15 @@ namespace multi_array {
|
||||
return finish_;
|
||||
}
|
||||
|
||||
index get_finish(index high_index_range = 0) const
|
||||
index get_finish(index high_index_range = index_range::to_end()) const
|
||||
{
|
||||
if (finish_ == to_end())
|
||||
return high_index_range;
|
||||
return finish_;
|
||||
}
|
||||
|
||||
size_type size(index recommended_length = 0) const
|
||||
{
|
||||
if ((start_ == from_start()) || (finish_ == to_end()))
|
||||
return recommended_length;
|
||||
else
|
||||
return (finish_ - start_) / stride_;
|
||||
}
|
||||
|
||||
index stride() const { return stride_; }
|
||||
|
||||
bool is_ascending_contiguous() const
|
||||
{
|
||||
return (start_ < finish_) && is_unit_stride();
|
||||
}
|
||||
|
||||
void set_index_range(index start, index finish, index stride=1)
|
||||
{
|
||||
start_ = start;
|
||||
@ -121,9 +117,6 @@ namespace multi_array {
|
||||
static index_range all()
|
||||
{ return index_range(from_start(), to_end(), 1); }
|
||||
|
||||
bool is_unit_stride() const
|
||||
{ return stride_ == 1; }
|
||||
|
||||
bool is_degenerate() const { return degenerate_; }
|
||||
|
||||
index_range operator-(index shift) const
|
||||
@ -148,12 +141,6 @@ namespace multi_array {
|
||||
|
||||
// add conversion to std::slice?
|
||||
|
||||
private:
|
||||
static index from_start()
|
||||
{ return (std::numeric_limits<index>::min)(); }
|
||||
|
||||
static index to_end()
|
||||
{ return (std::numeric_limits<index>::max)(); }
|
||||
public:
|
||||
index start_, finish_, stride_;
|
||||
bool degenerate_;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "boost/multi_array/base.hpp"
|
||||
#include "boost/iterator/iterator_facade.hpp"
|
||||
#include "boost/mpl/aux_/msvc_eti_base.hpp"
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
|
||||
@ -56,11 +57,11 @@ class array_iterator
|
||||
, Reference
|
||||
>
|
||||
, private
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,==1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
mpl::aux::msvc_eti_base<typename
|
||||
#endif
|
||||
value_accessor_generator<T,NumDims>::type
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,==1200)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
>::type
|
||||
#endif
|
||||
{
|
||||
@ -137,11 +138,15 @@ public:
|
||||
|
||||
template <class IteratorAdaptor>
|
||||
bool equal(IteratorAdaptor& rhs) const {
|
||||
const std::size_t N = NumDims::value;
|
||||
return (idx_ == rhs.idx_) &&
|
||||
(base_ == rhs.base_) &&
|
||||
(extents_ == rhs.extents_) &&
|
||||
(strides_ == rhs.strides_) &&
|
||||
(index_base_ == rhs.index_base_);
|
||||
( (extents_ == rhs.extents_) ||
|
||||
std::equal(extents_,extents_+N,rhs.extents_) ) &&
|
||||
( (strides_ == rhs.strides_) ||
|
||||
std::equal(strides_,strides_+N,rhs.strides_) ) &&
|
||||
( (index_base_ == rhs.index_base_) ||
|
||||
std::equal(index_base_,index_base_+N,rhs.index_base_) );
|
||||
}
|
||||
|
||||
template <class DifferenceType>
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "boost/multi_array/subarray.hpp"
|
||||
#include "boost/multi_array/view.hpp"
|
||||
#include "boost/multi_array/algorithm.hpp"
|
||||
#include "boost/type_traits/is_integral.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/concept_check.hpp"
|
||||
#include "boost/functional.hpp"
|
||||
@ -137,7 +138,13 @@ public:
|
||||
}
|
||||
|
||||
template <class BaseList>
|
||||
void reindex(const BaseList& values) {
|
||||
#ifdef BOOST_NO_SFINAE
|
||||
void
|
||||
#else
|
||||
typename
|
||||
disable_if<typename boost::is_integral<BaseList>::type,void >::type
|
||||
#endif // BOOST_NO_SFINAE
|
||||
reindex(const BaseList& values) {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<BaseList> >();
|
||||
boost::detail::multi_array::
|
||||
@ -206,8 +213,8 @@ public:
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<const element&>(),
|
||||
origin(),
|
||||
indices,strides());
|
||||
indices,origin(),
|
||||
shape(),strides(),index_bases());
|
||||
}
|
||||
|
||||
// Only allow const element access
|
||||
@ -503,11 +510,12 @@ public:
|
||||
|
||||
template <class IndexList>
|
||||
element& operator()(const IndexList& indices) {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<element&>(),
|
||||
origin(),
|
||||
indices,this->strides());
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<element&>(),
|
||||
indices,origin(),
|
||||
this->shape(),this->strides(),
|
||||
this->index_bases());
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,9 +79,11 @@ public:
|
||||
|
||||
template <typename IndexList>
|
||||
const element& operator()(const IndexList& indices) const {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<const element&>(),
|
||||
origin(),
|
||||
indices,strides());
|
||||
indices,origin(),
|
||||
shape(),strides(),index_bases());
|
||||
}
|
||||
|
||||
// see generate_array_view in base.hpp
|
||||
@ -284,9 +286,12 @@ public:
|
||||
|
||||
template <class IndexList>
|
||||
element& operator()(const IndexList& indices) {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<element&>(),
|
||||
origin(),
|
||||
indices,this->strides());
|
||||
indices,origin(),
|
||||
this->shape(),this->strides(),
|
||||
this->index_bases());
|
||||
}
|
||||
|
||||
iterator begin() {
|
||||
@ -316,6 +321,8 @@ public:
|
||||
|
||||
template <class IndexList>
|
||||
const element& operator()(const IndexList& indices) const {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::operator()(indices);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace multi_array{
|
||||
|
||||
// needed typedefs
|
||||
typedef std::size_t size_type;
|
||||
typedef int index;
|
||||
typedef std::ptrdiff_t index;
|
||||
|
||||
} // namespace multi_array
|
||||
} // namespace detail
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "boost/multi_array/storage_order.hpp"
|
||||
#include "boost/multi_array/subarray.hpp"
|
||||
#include "boost/multi_array/algorithm.hpp"
|
||||
#include "boost/type_traits/is_integral.hpp"
|
||||
#include "boost/array.hpp"
|
||||
#include "boost/limits.hpp"
|
||||
#include <algorithm>
|
||||
@ -72,7 +73,15 @@ public:
|
||||
|
||||
|
||||
template <class BaseList>
|
||||
void reindex(const BaseList& values) {
|
||||
#ifdef BOOST_NO_SFINAE
|
||||
void
|
||||
#else
|
||||
typename
|
||||
disable_if<typename boost::is_integral<BaseList>::type,void >::type
|
||||
#endif
|
||||
reindex(const BaseList& values) {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<BaseList> >();
|
||||
boost::detail::multi_array::
|
||||
copy_n(values.begin(),num_dimensions(),index_base_list_.begin());
|
||||
origin_offset_ =
|
||||
@ -109,9 +118,11 @@ public:
|
||||
|
||||
template <typename IndexList>
|
||||
const element& operator()(IndexList indices) const {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<const element&>(),
|
||||
origin(),
|
||||
indices,strides());
|
||||
indices,origin(),
|
||||
shape(),strides(),index_bases());
|
||||
}
|
||||
|
||||
// Only allow const element access
|
||||
@ -318,9 +329,12 @@ public:
|
||||
|
||||
template <class IndexList>
|
||||
element& operator()(const IndexList& indices) {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::access_element(boost::type<element&>(),
|
||||
origin(),
|
||||
indices,this->strides());
|
||||
indices,origin(),
|
||||
this->shape(),this->strides(),
|
||||
this->index_bases());
|
||||
}
|
||||
|
||||
|
||||
@ -379,6 +393,8 @@ public:
|
||||
|
||||
template <class IndexList>
|
||||
const element& operator()(const IndexList& indices) const {
|
||||
boost::function_requires<
|
||||
detail::multi_array::CollectionConcept<IndexList> >();
|
||||
return super_type::operator()(indices);
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581) )
|
||||
// BCB (up to 5.64) has the following bug:
|
||||
// If there is a member function/operator template of the form
|
||||
// template<class Expr> mfunc( Expr expr ) ;
|
||||
@ -133,7 +133,11 @@ class optional_base : public optional_tag
|
||||
{
|
||||
private :
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::make_reference_content<T>::type internal_type ;
|
||||
typedef
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
#endif
|
||||
::boost::detail::make_reference_content<T>::type internal_type ;
|
||||
|
||||
typedef aligned_storage<internal_type> storage_type ;
|
||||
|
||||
@ -401,7 +405,7 @@ class optional_base : public optional_tag
|
||||
reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; }
|
||||
reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; }
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
|
||||
void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; }
|
||||
#else
|
||||
void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->T::~T() ; m_initialized = false ; }
|
||||
|
@ -24,7 +24,11 @@
|
||||
# define BOOST_PP_CONFIG_DMC() 0x0040
|
||||
#
|
||||
# ifndef BOOST_PP_CONFIG_FLAGS
|
||||
# if defined(__SPIRIT_PP__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200
|
||||
# if defined(__GCCXML__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__WAVE__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__MWERKS__) && __MWERKS__ >= 0x3200
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__EDG__) || defined(__EDG_VERSION__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
|
||||
@ -32,6 +36,8 @@
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MWCC())
|
||||
# elif defined(__DMC__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_DMC())
|
||||
# elif defined(__BORLANDC__) && __BORLANDC__ >= 0x581
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_BCC())
|
||||
# elif defined(_MSC_VER)
|
||||
|
@ -20,8 +20,7 @@
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
# define BOOST_PP_STRINGIZE(text) BOOST_PP_STRINGIZE_A((text))
|
||||
# define BOOST_PP_STRINGIZE_A(arg) BOOST_PP_STRINGIZE_B ## (arg)
|
||||
# define BOOST_PP_STRINGIZE_B(arg) BOOST_PP_STRINGIZE_I ## arg
|
||||
# define BOOST_PP_STRINGIZE_A(arg) BOOST_PP_STRINGIZE_I arg
|
||||
# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# define BOOST_PP_STRINGIZE(text) BOOST_PP_STRINGIZE_OO((text))
|
||||
# define BOOST_PP_STRINGIZE_OO(par) BOOST_PP_STRINGIZE_I ## par
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user