early-access version 3088

This commit is contained in:
pineappleEA
2022-11-05 15:35:56 +01:00
parent 4e4fc25ce3
commit b601909c6d
35519 changed files with 5996896 additions and 860 deletions

View File

@@ -0,0 +1,107 @@
m4_dnl
m4_dnl Copyright (C) 2000 Stephen Cleary
m4_dnl
m4_dnl Distributed under the Boost Software License, Version 1.0. (See accompany-
m4_dnl ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
m4_dnl
m4_dnl See http://www.boost.org for updates, documentation, and revision history.
m4_dnl
m4_dnl
m4_dnl
m4_dnl BOOST_M4_FOR: repeat a given text for a range of values
m4_dnl $1 - variable to hold the current value.
m4_dnl $2 - the starting value.
m4_dnl $3 - the ending value (text is _not_ repeated for this value).
m4_dnl $4 - the text to repeat.
m4_dnl $5 - the delimeter text (optional).
m4_dnl
m4_dnl If the starting value is < ending value:
m4_dnl Will repeat $4, binding $1 to the values in the range [$2, $3).
m4_dnl Else (that is, starting value >= ending value):
m4_dnl Will do nothing
m4_dnl Repeats $5 in-between each occurrence of $4
m4_dnl
m4_dnl Logic:
m4_dnl Set $1 to $2 and call BOOST_M4_FOR_LIST_HELPER:
m4_dnl If $1 >= $3, do nothing
m4_dnl Else
m4_dnl output $4,
m4_dnl set $1 to itself incremented,
m4_dnl If $1 != $3, output $5,
m4_dnl and use recursion
m4_dnl
m4_define(`BOOST_M4_FOR',
`m4_ifelse(m4_eval($# < 4 || $# > 5), 1,
`m4_errprint(m4___file__:m4___line__: `Boost m4 script: BOOST_M4_FOR: Wrong number of arguments ($#)')',
`m4_pushdef(`$1', `$2')BOOST_M4_FOR_HELPER($@)m4_popdef(`$1')')')m4_dnl
m4_define(`BOOST_M4_FOR_HELPER',
`m4_ifelse(m4_eval($1 >= $3), 1, ,
`$4`'m4_define(`$1', m4_incr($1))m4_ifelse(m4_eval($1 != $3), 1, `$5')`'BOOST_M4_FOR_HELPER($@)')')m4_dnl
m4_dnl
m4_dnl Testing/Examples:
m4_dnl
m4_dnl The following line will output:
m4_dnl "repeat.m4:42: Boost m4 script: BOOST_M4_FOR: Wrong number of arguments (3)"
m4_dnl BOOST_M4_FOR(i, 1, 3)
m4_dnl
m4_dnl The following line will output:
m4_dnl "repeat.m4:46: Boost m4 script: BOOST_M4_FOR: Wrong number of arguments (6)"
m4_dnl BOOST_M4_FOR(i, 1, 3, i, ` ', 13)
m4_dnl
m4_dnl The following line will output (nothing):
m4_dnl ""
m4_dnl BOOST_M4_FOR(i, 7, 0, i )
m4_dnl
m4_dnl The following line will output (nothing):
m4_dnl ""
m4_dnl BOOST_M4_FOR(i, 0, 0, i )
m4_dnl
m4_dnl The following line will output:
m4_dnl "0 1 2 3 4 5 6 "
m4_dnl BOOST_M4_FOR(i, 0, 7, i )
m4_dnl
m4_dnl The following line will output:
m4_dnl "-13 -12 -11 "
m4_dnl BOOST_M4_FOR(i, -13, -10, i )
m4_dnl
m4_dnl The following two lines will output:
m4_dnl "(0, 0) (0, 1) (0, 2) (0, 3) "
m4_dnl "(1, 0) (1, 1) (1, 2) (1, 3) "
m4_dnl "(2, 0) (2, 1) (2, 2) (2, 3) "
m4_dnl "(3, 0) (3, 1) (3, 2) (3, 3) "
m4_dnl "(4, 0) (4, 1) (4, 2) (4, 3) "
m4_dnl "(5, 0) (5, 1) (5, 2) (5, 3) "
m4_dnl "(6, 0) (6, 1) (6, 2) (6, 3) "
m4_dnl "(7, 0) (7, 1) (7, 2) (7, 3) "
m4_dnl ""
m4_dnl BOOST_M4_FOR(i, 0, 8, BOOST_M4_FOR(j, 0, 4, (i, j) )
m4_dnl )
m4_dnl
m4_dnl The following line will output (nothing):
m4_dnl ""
m4_dnl BOOST_M4_FOR(i, 7, 0, i, |)
m4_dnl
m4_dnl The following line will output (nothing):
m4_dnl ""
m4_dnl BOOST_M4_FOR(i, 0, 0, i, |)
m4_dnl
m4_dnl The following line will output:
m4_dnl "0|1|2|3|4|5|6"
m4_dnl BOOST_M4_FOR(i, 0, 7, i, |)
m4_dnl
m4_dnl The following line will output:
m4_dnl "-13, -12, -11"
m4_dnl BOOST_M4_FOR(i, -13, -10, i, `, ')
m4_dnl
m4_dnl The following two lines will output:
m4_dnl "[(0, 0), (0, 1), (0, 2), (0, 3)],"
m4_dnl "[(1, 0), (1, 1), (1, 2), (1, 3)],"
m4_dnl "[(2, 0), (2, 1), (2, 2), (2, 3)],"
m4_dnl "[(3, 0), (3, 1), (3, 2), (3, 3)],"
m4_dnl "[(4, 0), (4, 1), (4, 2), (4, 3)],"
m4_dnl "[(5, 0), (5, 1), (5, 2), (5, 3)],"
m4_dnl "[(6, 0), (6, 1), (6, 2), (6, 3)],"
m4_dnl "[(7, 0), (7, 1), (7, 2), (7, 3)]"
m4_dnl BOOST_M4_FOR(i, 0, 8, `[BOOST_M4_FOR(j, 0, 4, (i, j), `, ')]', `,
m4_dnl ')
m4_dnl

View File

@@ -0,0 +1,69 @@
// Copyright (C) 2000 Stephen Cleary
//
// 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 for updates, documentation, and revision history.
#ifndef BOOST_POOL_GUARD_HPP
#define BOOST_POOL_GUARD_HPP
/*!
\file
\brief Extremely Light-Weight guard class.
\details Auto-lock/unlock-er
detail/guard.hpp provides a type guard<Mutex>
that allows scoped access to the Mutex's locking and unlocking operations.
It is used to ensure that a Mutex is unlocked, even if an exception is thrown.
*/
namespace boost {
namespace details {
namespace pool {
template <typename Mutex> //!< \tparam Mutex (platform-specific) mutex class.
class guard
{ //! Locks the mutex, binding guard<Mutex> to Mutex.
/*! Example:
Given a (platform-specific) mutex class, we can wrap code as follows:
extern mutex global_lock;
static void f()
{
boost::details::pool::guard<mutex> g(global_lock);
// g's constructor locks "global_lock"
... // do anything:
// throw exceptions
// return
// or just fall through
} // g's destructor unlocks "global_lock"
*/
private:
Mutex & mtx;
guard(const guard &); //!< Guards the mutex, ensuring unlocked on destruction, even if exception is thrown.
void operator=(const guard &);
public:
explicit guard(Mutex & nmtx)
:mtx(nmtx)
{ //! Locks the mutex of the guard class.
mtx.lock();
}
~guard()
{ //! destructor unlocks the mutex of the guard class.
mtx.unlock();
}
}; // class guard
} // namespace pool
} // namespace details
} // namespace boost
#endif

View File

@@ -0,0 +1,144 @@
// Copyright (C) 2000 Stephen Cleary
// Copyright (C) 2018 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 for updates, documentation, and revision history.
#ifndef BOOST_POOL_MUTEX_HPP
#define BOOST_POOL_MUTEX_HPP
#include <boost/config.hpp>
namespace boost{ namespace details{ namespace pool{
class null_mutex
{
private:
null_mutex(const null_mutex &);
void operator=(const null_mutex &);
public:
null_mutex() {}
static void lock() {}
static void unlock() {}
};
}}} // namespace boost::details::pool
#if !defined(BOOST_HAS_THREADS) || defined(BOOST_NO_MT) || defined(BOOST_POOL_NO_MT)
namespace boost{ namespace details{ namespace pool{
typedef null_mutex default_mutex;
}}} // namespace boost::details::pool
#elif !defined(BOOST_NO_CXX11_HDR_MUTEX)
#include <mutex>
namespace boost{ namespace details{ namespace pool{
typedef std::mutex default_mutex;
}}} // namespace boost::details::pool
#elif defined(BOOST_HAS_PTHREADS)
#include <boost/assert.hpp>
#include <pthread.h>
namespace boost{ namespace details{ namespace pool{
class pt_mutex
{
private:
pthread_mutex_t m_;
pt_mutex(pt_mutex const &);
pt_mutex & operator=(pt_mutex const &);
public:
pt_mutex()
{
BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 );
}
~pt_mutex()
{
BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 );
}
void lock()
{
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
}
void unlock()
{
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
}
};
typedef pt_mutex default_mutex;
}}} // namespace boost::details::pool
#elif defined(BOOST_HAS_WINTHREADS) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#include <boost/winapi/critical_section.hpp>
namespace boost{ namespace details{ namespace pool{
class cs_mutex
{
private:
boost::winapi::CRITICAL_SECTION_ cs_;
cs_mutex(cs_mutex const &);
cs_mutex & operator=(cs_mutex const &);
public:
cs_mutex()
{
boost::winapi::InitializeCriticalSection( &cs_ );
}
~cs_mutex()
{
boost::winapi::DeleteCriticalSection( &cs_ );
}
void lock()
{
boost::winapi::EnterCriticalSection( &cs_ );
}
void unlock()
{
boost::winapi::LeaveCriticalSection( &cs_ );
}
};
typedef cs_mutex default_mutex;
}}} // namespace boost::details::pool
#else
// Use #define BOOST_DISABLE_THREADS to avoid this error
# error Unrecognized threading platform
#endif
#endif // #ifndef BOOST_POOL_MUTEX_HPP

View File

@@ -0,0 +1,24 @@
@echo off
rem
rem Copyright (C) 2000, 2001 Stephen Cleary
rem
rem Distributed under the Boost Software License, Version 1.0. (See accompany-
rem ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
rem Check for Windows NT
if %OS%==Windows_NT goto NT
rem Not NT - run m4 as normal, then exit
m4 -P -E -DNumberOfArguments=%1 pool_construct.m4 > pool_construct.ipp
goto end
rem DJGPP programs (including m4) running on Windows/NT do NOT support long
rem file names (see the DJGPP v2 FAQ, question 8.1)
rem Note that the output doesn't have to be a short name because it's an
rem argument to the command shell, not m4.
:NT
m4 -P -E -DNumberOfArguments=%1 < pool_construct.m4 > pool_construct.ipp
:end

View File

@@ -0,0 +1,852 @@
// Copyright (C) 2000 Stephen Cleary
//
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org for updates, documentation, and revision history.
// This file was AUTOMATICALLY GENERATED from "stdin"
// Do NOT include directly!
// Do NOT edit!
template <typename T0>
element_type * construct(T0 & a0)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0>
element_type * construct(const T0 & a0)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0>
element_type * construct(volatile T0 & a0)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0>
element_type * construct(const volatile T0 & a0)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(T0 & a0, T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const T0 & a0, T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(volatile T0 & a0, T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const volatile T0 & a0, T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(T0 & a0, const T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const T0 & a0, const T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(volatile T0 & a0, const T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const volatile T0 & a0, const T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(T0 & a0, volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const T0 & a0, volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(volatile T0 & a0, volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const volatile T0 & a0, volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(T0 & a0, const volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const T0 & a0, const volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(volatile T0 & a0, const volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const volatile T0 & a0, const volatile T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(volatile T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const volatile T0 & a0, const volatile T1 & a1, const volatile T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}

View File

@@ -0,0 +1,84 @@
m4_dnl
m4_dnl Copyright (C) 2000 Stephen Cleary
m4_dnl
m4_dnl Distributed under the Boost Software License, Version 1.0. (See accompany-
m4_dnl ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
m4_dnl
m4_dnl See http://www.boost.org for updates, documentation, and revision history.
m4_dnl
m4_dnl
m4_dnl
m4_dnl Avoid the use of any m4_* identifiers in this header file,
m4_dnl as that may cause incompatibility problems with future
m4_dnl versions of m4.
m4_dnl
m4_dnl This is a normal header file, except that lines starting
m4_dnl with `m4_dnl' will be stripped, TBA_FOR
m4_dnl macros will be replaced with repeated text, and text in
m4_dnl single quotes (`...') will have their single quotes
m4_dnl stripped.
m4_dnl
m4_dnl
m4_dnl Check to make sure NumberOfArguments was defined. If it's not defined,
m4_dnl default to 3
m4_dnl
m4_ifdef(`NumberOfArguments', , `m4_errprint(m4___file__:m4___line__`: NumberOfArguments is not defined; defaulting to 3
')m4_define(`NumberOfArguments', 3)')m4_dnl
m4_ifelse(NumberOfArguments, , `m4_errprint(m4___file__:m4___line__`: NumberOfArguments is defined to be empty; defaulting to 3
')m4_define(`NumberOfArguments', 3)')m4_dnl
m4_dnl
m4_dnl Check to make sure NumberOfArguments >= 1. If it's not, then fatal error.
m4_dnl
m4_ifelse(m4_eval(NumberOfArguments < 1), 1, `m4_errprint(m4___file__:m4___line__`: NumberOfArguments ('NumberOfArguments`) is less than 1
')m4_m4exit(1)')m4_dnl
m4_dnl
m4_dnl Include the BOOST_M4_FOR macro definition
m4_dnl
m4_include(`for.m4')`'m4_dnl
m4_dnl
m4_dnl Begin the generated file.
m4_dnl
// Copyright (C) 2000 Stephen Cleary
//
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org for updates, documentation, and revision history.
m4_dnl These warnings apply to the file generated from this file.
m4_dnl Of course, you may freely edit this file.
// This file was AUTOMATICALLY GENERATED from "m4___file__"
// Do NOT include directly!
// Do NOT edit!
m4_dnl
m4_dnl First we define a simple 'cv_qual' macro which takes a number, either
m4_dnl 0, 1, 2, or 3, and determines cv-qualification.
m4_dnl
m4_define(`cv_qual',
`m4_ifelse($1, 0, `',
`m4_ifelse($1, 1, `const ',
`m4_ifelse($1, 2, `volatile ',
`m4_ifelse($1, 3, `const volatile ',
`m4_errprint(m4___file__:m4___line__: `Boost m4 script: cv-determiner: Not 0, 1, 2, or 3 (was '$1`)')'
)')')')')m4_dnl
m4_dnl
m4_dnl Next we go through the actual loop. For each number of arguments from
m4_dnl 1 to NumberOfArguments, we create a template function that takes that
m4_dnl many template arguments, and also generate all cv-qualified permutations
m4_dnl of that function.
m4_dnl
BOOST_M4_FOR(N, 1, NumberOfArguments + 1,
`BOOST_M4_FOR(cv, 0, m4_eval(4 ** N),
`template <BOOST_M4_FOR(i, 0, N, `typename T`'i', `, ')>
element_type * construct(BOOST_M4_FOR(i, 0, N,
`cv_qual(m4_eval((cv >> (i * 2)) % 4))T`'i & a`'i', `, '))
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(BOOST_M4_FOR(i, 0, N, `a`'i', `, ')); }
catch (...) { (free)(ret); throw; }
return ret;
}
')')

View File

@@ -0,0 +1,12 @@
#!/bin/sh
#
# Copyright (C) 2000 Stephen Cleary
#
# Distributed under the Boost Software License, Version 1.0. (See accompany-
# ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org for updates, documentation, and revision history.
#
m4 -P -E -DNumberOfArguments=$1 pool_construct.m4 > pool_construct.ipp

View File

@@ -0,0 +1,25 @@
@echo off
rem
rem Copyright (C) 2001 Stephen Cleary
rem
rem Distributed under the Boost Software License, Version 1.0. (See accompany-
rem ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
rem
rem See http://www.boost.org for updates, documentation, and revision history.
rem
rem Check for Windows NT
if %OS%==Windows_NT goto NT
rem Not NT - run m4 as normal, then exit
m4 -P -E -DNumberOfArguments=%1 pool_construct_simple.m4 > pool_construct_simple.ipp
goto end
rem DJGPP programs (including m4) running on Windows/NT do NOT support long
rem file names (see the DJGPP v2 FAQ, question 8.1)
rem Note that the output doesn't have to be a short name because it's an
rem argument to the command shell, not m4.
:NT
m4 -P -E -DNumberOfArguments=%1 < pool_construct_simple.m4 > pool_construct_simple.ipp
:end

View File

@@ -0,0 +1,43 @@
// Copyright (C) 2000 Stephen Cleary
//
// 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 for updates, documentation, and revision history.
// This file was AUTOMATICALLY GENERATED from "stdin"
// Do NOT include directly!
// Do NOT edit!
template <typename T0>
element_type * construct(const T0 & a0)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1>
element_type * construct(const T0 & a0, const T1 & a1)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1); }
catch (...) { (free)(ret); throw; }
return ret;
}
template <typename T0, typename T1, typename T2>
element_type * construct(const T0 & a0, const T1 & a1, const T2 & a2)
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(a0, a1, a2); }
catch (...) { (free)(ret); throw; }
return ret;
}

View File

@@ -0,0 +1,72 @@
m4_dnl
m4_dnl Copyright (C) 2001 Stephen Cleary
m4_dnl
m4_dnl Distributed under the Boost Software License, Version 1.0. (See accompany-
m4_dnl ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
m4_dnl
m4_dnl See http://www.boost.org for updates, documentation, and revision history.
m4_dnl
m4_dnl
m4_dnl
m4_dnl Avoid the use of any m4_* identifiers in this header file,
m4_dnl as that may cause incompatibility problems with future
m4_dnl versions of m4.
m4_dnl
m4_dnl This is a normal header file, except that lines starting
m4_dnl with `m4_dnl' will be stripped, TBA_FOR
m4_dnl macros will be replaced with repeated text, and text in
m4_dnl single quotes (`...') will have their single quotes
m4_dnl stripped.
m4_dnl
m4_dnl
m4_dnl Check to make sure NumberOfArguments was defined. If it's not defined,
m4_dnl default to 3
m4_dnl
m4_ifdef(`NumberOfArguments', , `m4_errprint(m4___file__:m4___line__`: NumberOfArguments is not defined; defaulting to 3
')m4_define(`NumberOfArguments', 3)')m4_dnl
m4_ifelse(NumberOfArguments, , `m4_errprint(m4___file__:m4___line__`: NumberOfArguments is defined to be empty; defaulting to 3
')m4_define(`NumberOfArguments', 3)')m4_dnl
m4_dnl
m4_dnl Check to make sure NumberOfArguments >= 1. If it's not, then fatal error.
m4_dnl
m4_ifelse(m4_eval(NumberOfArguments < 1), 1, `m4_errprint(m4___file__:m4___line__`: NumberOfArguments ('NumberOfArguments`) is less than 1
')m4_m4exit(1)')m4_dnl
m4_dnl
m4_dnl Include the BOOST_M4_FOR macro definition
m4_dnl
m4_include(`for.m4')`'m4_dnl
m4_dnl
m4_dnl Begin the generated file.
m4_dnl
// Copyright (C) 2000 Stephen Cleary
//
// 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 for updates, documentation, and revision history.
m4_dnl These warnings apply to the file generated from this file.
m4_dnl Of course, you may freely edit this file.
// This file was AUTOMATICALLY GENERATED from "m4___file__"
// Do NOT include directly!
// Do NOT edit!
m4_dnl
m4_dnl Here we go through the actual loop. For each number of arguments from
m4_dnl 1 to NumberOfArguments, we create a template function that takes that
m4_dnl many template arguments.
m4_dnl
BOOST_M4_FOR(N, 1, NumberOfArguments + 1,
`template <BOOST_M4_FOR(i, 0, N, `typename T`'i', `, ')>
element_type * construct(BOOST_M4_FOR(i, 0, N,
`const T`'i & a`'i', `, '))
{
element_type * const ret = (malloc)();
if (ret == 0)
return ret;
try { new (ret) element_type(BOOST_M4_FOR(i, 0, N, `a`'i', `, ')); }
catch (...) { (free)(ret); throw; }
return ret;
}
')

View File

@@ -0,0 +1,12 @@
#!/bin/sh
#
# Copyright (C) 2001 Stephen Cleary
#
# Distributed under the Boost Software License, Version 1.0. (See accompany-
# ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org for updates, documentation, and revision history.
#
m4 -P -E -DNumberOfArguments=$1 pool_construct_simple.m4 > pool_construct_simple.ipp