miniboost: update to 1.71.0

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2020-01-03 21:38:08 +00:00
parent 69117635c5
commit f4ce7693a3
180 changed files with 3488 additions and 2878 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Macros and inline functions to swap the order of bytes in integer values.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Copyright (C) 1993-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,6 +1,6 @@
/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
scheduling interface.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
/* Copyright (C) 1999-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Error constants. Linux specific version.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,6 +1,6 @@
/* Macros to control TS 18661-3 glibc features where the same
definitions are appropriate for all platforms.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Macros to control TS 18661-3 glibc features on x86.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Declarations for getopt (basic, portable features only).
Copyright (C) 1989-2018 Free Software Foundation, Inc.
Copyright (C) 1989-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.
Patches to this file should be submitted to both projects.

View file

@ -1,5 +1,5 @@
/* Declarations for getopt (POSIX compatibility shim).
Copyright (C) 1989-2018 Free Software Foundation, Inc.
Copyright (C) 1989-2019 Free Software Foundation, Inc.
Unlike the bulk of the getopt implementation, this file is NOT part
of gnulib.

View file

@ -1,5 +1,5 @@
/* Handle feature test macros at the start of a header.
Copyright (C) 2016-2018 Free Software Foundation, Inc.
Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux version.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Copyright (C) 1993-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Properties of long double type. ldbl-96 version.
Copyright (C) 2016-2018 Free Software Foundation, Inc.
Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Old-style Unix parameters and limits. Linux version.
Copyright (C) 1995-2018 Free Software Foundation, Inc.
Copyright (C) 1995-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Define POSIX options for Linux.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -25,7 +25,10 @@
/* Processes have a saved set-user-ID and a saved set-group-ID. */
#define _POSIX_SAVED_IDS 1
/* Priority scheduling is supported. */
/* Priority scheduling is not supported with the correct semantics,
but GNU/Linux applications expect that the corresponding interfaces
are available, even though the semantics do not meet the POSIX
requirements. See glibc bug 14829. */
#define _POSIX_PRIORITY_SCHEDULING 200809L
/* Synchronizing file data is supported. */

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Declaration of common pthread types for all architectures.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -86,6 +86,9 @@ extern int unshare (int __flags) __THROW;
/* Get index of currently used CPU. */
extern int sched_getcpu (void) __THROW;
/* Get currently used CPU and NUMA node. */
extern int getcpu (unsigned int *, unsigned int *) __THROW;
/* Switch process to namespace of type NSTYPE indicated by FD. */
extern int setns (int __fd, int __nstype) __THROW;
#endif

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
/* Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Checking macros for select functions.
Copyright (C) 2011-2018 Free Software Foundation, Inc.
Copyright (C) 2011-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
/* Copyright (C) 2001-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* The proper definitions for Linux's sigaction.
Copyright (C) 1993-2018 Free Software Foundation, Inc.
Copyright (C) 1993-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -26,7 +26,7 @@
#define FP_XSTATE_MAGIC1 0x46505853U
#define FP_XSTATE_MAGIC2 0x46505845U
#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
#define FP_XSTATE_MAGIC2_SIZE sizeof (FP_XSTATE_MAGIC2)
struct _fpx_sw_bytes
{

View file

@ -1,5 +1,5 @@
/* sigevent constants. Linux version.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* siginfo constants. Linux version.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -35,7 +35,9 @@
enum
{
SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
SI_TKILL = -6, /* Sent by tkill. */
SI_DETHREAD = -7, /* Sent by execve killing subsidiary
threads. */
SI_TKILL, /* Sent by tkill. */
SI_SIGIO, /* Sent by queued SIGIO. */
#if __SI_ASYNCIO_AFTER_SIGIO
SI_ASYNCIO, /* Sent by AIO completion. */
@ -51,6 +53,7 @@ enum
SI_KERNEL = 0x80 /* Send by kernel. */
#define SI_ASYNCNL SI_ASYNCNL
#define SI_DETHREAD SI_DETHREAD
#define SI_TKILL SI_TKILL
#define SI_SIGIO SI_SIGIO
#define SI_ASYNCIO SI_ASYNCIO
@ -81,8 +84,10 @@ enum
# define ILL_PRVREG ILL_PRVREG
ILL_COPROC, /* Coprocessor error. */
# define ILL_COPROC ILL_COPROC
ILL_BADSTK /* Internal stack error. */
ILL_BADSTK, /* Internal stack error. */
# define ILL_BADSTK ILL_BADSTK
ILL_BADIADDR /* Unimplemented instruction address. */
# define ILL_BADIADDR ILL_BADIADDR
};
/* `si_code' values for SIGFPE signal. */
@ -102,8 +107,12 @@ enum
# define FPE_FLTRES FPE_FLTRES
FPE_FLTINV, /* Floating point invalid operation. */
# define FPE_FLTINV FPE_FLTINV
FPE_FLTSUB /* Subscript out of range. */
FPE_FLTSUB, /* Subscript out of range. */
# define FPE_FLTSUB FPE_FLTSUB
FPE_FLTUNK = 14, /* Undiagnosed floating-point exception. */
# define FPE_FLTUNK FPE_FLTUNK
FPE_CONDTRAP /* Trap on condition. */
# define FPE_CONDTRAP FPE_CONDTRAP
};
/* `si_code' values for SIGSEGV signal. */
@ -115,8 +124,14 @@ enum
# define SEGV_ACCERR SEGV_ACCERR
SEGV_BNDERR, /* Bounds checking failure. */
# define SEGV_BNDERR SEGV_BNDERR
SEGV_PKUERR /* Protection key checking failure. */
SEGV_PKUERR, /* Protection key checking failure. */
# define SEGV_PKUERR SEGV_PKUERR
SEGV_ACCADI, /* ADI not enabled for mapped object. */
# define SEGV_ACCADI SEGV_ACCADI
SEGV_ADIDERR, /* Disrupting MCD error. */
# define SEGV_ADIDERR SEGV_ADIDERR
SEGV_ADIPERR /* Precise MCD exception. */
# define SEGV_ADIPERR SEGV_ADIPERR
};
/* `si_code' values for SIGBUS signal. */
@ -141,8 +156,14 @@ enum
{
TRAP_BRKPT = 1, /* Process breakpoint. */
# define TRAP_BRKPT TRAP_BRKPT
TRAP_TRACE /* Process trace trap. */
TRAP_TRACE, /* Process trace trap. */
# define TRAP_TRACE TRAP_TRACE
TRAP_BRANCH, /* Process taken branch trap. */
# define TRAP_BRANCH TRAP_BRANCH
TRAP_HWBKPT, /* Hardware breakpoint/watchpoint. */
# define TRAP_HWBKPT TRAP_HWBKPT
TRAP_UNK /* Undiagnosed trap. */
# define TRAP_UNK TRAP_UNK
};
# endif

View file

@ -0,0 +1,31 @@
/* System-specific extensions of <signal.h>, Linux version.
Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _SIGNAL_H
# error "Never include <bits/signal_ext.h> directly; use <signal.h> instead."
#endif
#ifdef __USE_GNU
/* Send SIGNAL to the thread TID in the thread group (process)
identified by TGID. This function behaves like kill, but also
fails with ESRCH if the specified TID does not belong to the
specified thread group. */
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
#endif /* __USE_GNU */

View file

@ -1,5 +1,5 @@
/* Signal number constants. Generic template.
Copyright (C) 1991-2018 Free Software Foundation, Inc.
Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Signal number definitions. Linux version.
Copyright (C) 1995-2018 Free Software Foundation, Inc.
Copyright (C) 1995-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* sigstack, sigaltstack definitions.
Copyright (C) 1998-2018 Free Software Foundation, Inc.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Signal handling function for threaded programs.
Copyright (C) 1998-2018 Free Software Foundation, Inc.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* ss_flags values for stack_t. Linux version.
Copyright (C) 1998-2018 Free Software Foundation, Inc.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Define intN_t types.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Define uintN_t types.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Perform binary search - inline version.
Copyright (C) 1991-2018 Free Software Foundation, Inc.
Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Floating-point inline functions for stdlib.h.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* -mlong-double-64 compatibility mode for <stdlib.h> functions.
Copyright (C) 2006-2018 Free Software Foundation, Inc.
Copyright (C) 2006-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Checking macros for stdlib functions.
Copyright (C) 2005-2018 Free Software Foundation, Inc.
Copyright (C) 2005-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
/* Copyright (C) 2004-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Fortify macros for strings.h functions.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Common threading primitives definitions for both POSIX and C11.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -124,7 +124,27 @@ struct __pthread_mutex_s
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
binary compatibility with static initializers. */
binary compatibility with static initializers.
Concurrency notes:
The __kind of a mutex is initialized either by the static
PTHREAD_MUTEX_INITIALIZER or by a call to pthread_mutex_init.
After a mutex has been initialized, the __kind of a mutex is usually not
changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can
be enabled. This is done concurrently in the pthread_mutex_*lock functions
by using the macro FORCE_ELISION. This macro is only defined for
architectures which supports lock elision.
For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and
PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already set
type of a mutex.
Before a mutex is initialized, only PTHREAD_MUTEX_NO_ELISION_NP can be set
with pthread_mutexattr_settype.
After a mutex has been initialized, the functions pthread_mutex_*lock can
enable elision - if the mutex-type and the machine supports it - by setting
the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently. Afterwards
the lock / unlock functions are using specific elision code-paths. */
int __kind;
__PTHREAD_COMPAT_PADDING_MID
#if __PTHREAD_MUTEX_NUSERS_AFTER_KIND

View file

@ -1,5 +1,5 @@
/* System-dependent timing definitions. Linux version.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

36
miniboost/bits/time64.h Normal file
View file

@ -0,0 +1,36 @@
/* bits/time64.h -- underlying types for __time64_t. Generic version.
Copyright (C) 2018-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _BITS_TYPES_H
# error "Never include <bits/time64.h> directly; use <sys/types.h> instead."
#endif
#ifndef _BITS_TIME64_H
#define _BITS_TIME64_H 1
/* Define __TIME64_T_TYPE so that it is always a 64-bit type. */
#if __TIMESIZE == 64
/* If we already have 64-bit time type then use it. */
# define __TIME64_T_TYPE __TIME_T_TYPE
#else
/* Define a 64-bit time type alongsize the 32-bit one. */
# define __TIME64_T_TYPE __SQUAD_TYPE
#endif
#endif /* bits/time64.h */

25
miniboost/bits/timesize.h Normal file
View file

@ -0,0 +1,25 @@
/* Bit size of the time_t type at glibc build time, x86-64 and x32 case.
Copyright (C) 2018-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#if defined __x86_64__ && defined __ILP32__
/* For x32, time is 64-bit even though word size is 32-bit. */
# define __TIMESIZE 64
#else
/* For others, time size is word size. */
# define __TIMESIZE __WORDSIZE
#endif

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -104,7 +104,7 @@ struct timex
#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
/* Read-only bits */
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER \
| STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
#endif /* bits/timex.h */

View file

@ -1,5 +1,5 @@
/* bits/types.h -- definitions of __*_t types underlying *_t types.
Copyright (C) 2002-2018 Free Software Foundation, Inc.
Copyright (C) 2002-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -25,6 +25,7 @@
#include <features.h>
#include <bits/wordsize.h>
#include <bits/timesize.h>
/* Convenience types. */
typedef unsigned char __u_char;
@ -86,7 +87,7 @@ __extension__ typedef unsigned long long int __uintmax_t;
32 -- "natural" 32-bit type (always int)
64 -- "natural" 64-bit type (long or long long)
LONG32 -- 32-bit type, traditionally long
QUAD -- 64-bit type, always long long
QUAD -- 64-bit type, traditionally long long
WORD -- natural type of __WORDSIZE bits (int or long)
LONGWORD -- type of __WORDSIZE bits, traditionally long
@ -112,14 +113,14 @@ __extension__ typedef unsigned long long int __uintmax_t;
#define __SLONGWORD_TYPE long int
#define __ULONGWORD_TYPE unsigned long int
#if __WORDSIZE == 32
# define __SQUAD_TYPE __quad_t
# define __UQUAD_TYPE __u_quad_t
# define __SQUAD_TYPE __int64_t
# define __UQUAD_TYPE __uint64_t
# define __SWORD_TYPE int
# define __UWORD_TYPE unsigned int
# define __SLONG32_TYPE long int
# define __ULONG32_TYPE unsigned long int
# define __S64_TYPE __quad_t
# define __U64_TYPE __u_quad_t
# define __S64_TYPE __int64_t
# define __U64_TYPE __uint64_t
/* We want __extension__ before typedef's that use nonstandard base types
such as `long long' in C89 mode. */
# define __STD_TYPE __extension__ typedef
@ -138,6 +139,7 @@ __extension__ typedef unsigned long long int __uintmax_t;
# error
#endif
#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
#include <bits/time64.h> /* Defines __TIME*_T_TYPE macros. */
__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
@ -211,6 +213,15 @@ __STD_TYPE __U32_TYPE __socklen_t;
It is not currently necessary for this to be machine-specific. */
typedef int __sig_atomic_t;
/* Seconds since the Epoch, visible to user code when time_t is too
narrow only for consistency with the old way of widening too-narrow
types. User code should never use __time64_t. */
#if __TIMESIZE == 64 && defined __LIBC
# define __time64_t __time_t
#elif __TIMESIZE != 64
__STD_TYPE __TIME64_T_TYPE __time64_t;
#endif
#undef __STD_TYPE
#endif /* bits/types.h */

View file

@ -1,5 +1,5 @@
/* Definition of struct __locale_struct and __locale_t.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.

View file

@ -1,5 +1,5 @@
/* Define __sigval_t.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Define error_t.
Copyright (C) 1991-2018 Free Software Foundation, Inc.
Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Definition of locale_t.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -107,7 +107,7 @@ typedef struct
/* SIGPOLL. */
struct
{
long int si_band; /* Band event for SIGPOLL. */
__SI_BAND_TYPE si_band; /* Band event for SIGPOLL. */
int si_fd;
} _sigpoll;

View file

@ -1,5 +1,5 @@
/* Define stack_t. Linux version.
Copyright (C) 1998-2018 Free Software Foundation, Inc.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Sched parameter structure. Generic version.
Copyright (C) 1996-2018 Free Software Foundation, Inc.
Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Define struct sigstack.
Copyright (C) 1998-2018 Free Software Foundation, Inc.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Inline functions to return unsigned integer values unchanged.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Implementation limits related to sys/uio.h - Linux version.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Checking macros for unistd functions.
Copyright (C) 2005-2018 Free Software Foundation, Inc.
Copyright (C) 2005-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -0,0 +1,36 @@
/* System-specific extensions of <unistd.h>, Linux version.
Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _UNISTD_H
# error "Never include <bits/unistd_ext.h> directly; use <unistd.h> instead."
#endif
#ifdef __USE_GNU
/* Return the kernel thread ID (TID) of the current thread. The
returned value is not subject to caching. Most Linux system calls
accept a TID in place of a PID. Using the TID to change properties
of a thread that has been created using pthread_create can lead to
undefined behavior (comparable to manipulating file descriptors
directly that have not been created explicitly). Note that a TID
uniquely identifies a thread only while this thread is running; a
TID can be reused once a thread has exited, even if the thread is
not detached and has not been joined. */
extern __pid_t gettid (void) __THROW;
#endif

View file

@ -1,5 +1,5 @@
/* Definitions of flag bits for `waitpid' et al.
Copyright (C) 1992-2018 Free Software Foundation, Inc.
Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Definitions of status bits for `wait' et al.
Copyright (C) 1992-2018 Free Software Foundation, Inc.
Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* -mlong-double-64 compatibility mode for <wchar.h> functions.
Copyright (C) 2006-2018 Free Software Foundation, Inc.
Copyright (C) 2006-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -27,9 +27,7 @@ __LDBL_REDIR_DECL (swprintf);
__LDBL_REDIR_DECL (vfwprintf);
__LDBL_REDIR_DECL (vwprintf);
__LDBL_REDIR_DECL (vswprintf);
# if defined __USE_ISOC99 && !defined __USE_GNU \
&& !defined __REDIRECT \
&& (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
# if !__GLIBC_USE (DEPRECATED_SCANF)
__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf)
__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf)
__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf)
@ -42,8 +40,7 @@ __LDBL_REDIR_DECL (swscanf);
#ifdef __USE_ISOC99
__LDBL_REDIR1_DECL (wcstold, wcstod);
# if !defined __USE_GNU && !defined __REDIRECT \
&& (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
# if !__GLIBC_USE (DEPRECATED_SCANF)
__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf)
__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf)
__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf)

View file

@ -1,5 +1,5 @@
/* wchar_t type related definitions.
Copyright (C) 2000-2018 Free Software Foundation, Inc.
Copyright (C) 2000-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,5 +1,5 @@
/* Checking macros for wchar functions.
Copyright (C) 2005-2018 Free Software Foundation, Inc.
Copyright (C) 2005-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View file

@ -2136,7 +2136,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
#undef BOOST_BIND_ST
#undef BOOST_BIND_NOEXCEPT
#ifdef BOOST_BIND_ENABLE_STDCALL
#if defined(BOOST_BIND_ENABLE_STDCALL) && !defined(_M_X64)
#define BOOST_BIND_CC __stdcall
#define BOOST_BIND_ST
@ -2150,7 +2150,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
#endif
#ifdef BOOST_BIND_ENABLE_FASTCALL
#if defined(BOOST_BIND_ENABLE_FASTCALL) && !defined(_M_X64)
#define BOOST_BIND_CC __fastcall
#define BOOST_BIND_ST
@ -2197,7 +2197,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
#undef BOOST_BIND_MF_CC
#undef BOOST_BIND_MF_NOEXCEPT
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
#define BOOST_BIND_MF_NAME(X) X##_cdecl
#define BOOST_BIND_MF_CC __cdecl
@ -2212,7 +2212,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
#define BOOST_BIND_MF_NAME(X) X##_stdcall
#define BOOST_BIND_MF_CC __stdcall
@ -2227,7 +2227,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
#define BOOST_BIND_MF_NAME(X) X##_fastcall
#define BOOST_BIND_MF_CC __fastcall

View file

@ -49,7 +49,7 @@ template<class V> struct mf
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
@ -61,7 +61,7 @@ template<class V> struct mf
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
@ -73,7 +73,7 @@ template<class V> struct mf
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
@ -102,7 +102,7 @@ template<> struct mf<void>
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
@ -155,7 +155,7 @@ template<> struct mf<void>
#undef BOOST_MEM_FN_NAME2
#undef BOOST_MEM_FN_CC
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl
@ -217,7 +217,7 @@ namespace _mfi
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NAME
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
@ -229,7 +229,7 @@ namespace _mfi
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
@ -241,7 +241,7 @@ namespace _mfi
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
@ -270,7 +270,7 @@ namespace _mfi
#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#ifdef BOOST_MEM_FN_ENABLE_CDECL
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
@ -282,7 +282,7 @@ namespace _mfi
#endif
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
@ -294,7 +294,7 @@ namespace _mfi
#endif
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
#define BOOST_MEM_FN_NAME(X) X##_fastcall
#define BOOST_MEM_FN_CC __fastcall

View file

@ -8,6 +8,10 @@
// See www.boost.org/libs/circular_buffer for documentation.
/*! @file
Includes <boost/circular_buffer/base.hpp>
*/
#if !defined(BOOST_CIRCULAR_BUFFER_HPP)
#define BOOST_CIRCULAR_BUFFER_HPP
@ -19,12 +23,12 @@
#include <boost/config/workaround.hpp>
#include <boost/static_assert.hpp>
// BOOST_CB_ENABLE_DEBUG: Debug support control.
/*! Debug support control. */
#if !defined(BOOST_CB_ENABLE_DEBUG)
#define BOOST_CB_ENABLE_DEBUG 0
#endif
// BOOST_CB_ASSERT: Runtime assertion.
/*! INTERNAL ONLY */
#if BOOST_CB_ENABLE_DEBUG
#include <boost/assert.hpp>
#define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr)
@ -32,7 +36,7 @@
#define BOOST_CB_ASSERT(Expr) ((void)0)
#endif
// BOOST_CB_IS_CONVERTIBLE: Check if Iterator::value_type is convertible to Type.
/*! INTERNAL ONLY */
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
#define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)
#else
@ -42,8 +46,7 @@
BOOST_STATIC_ASSERT((is_convertible<typename std::iterator_traits<Iterator>::value_type, Type>::value))
#endif
// BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS:
// Check if the STL provides templated iterator constructors for its containers.
/*! INTERNAL ONLY */
#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
#define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false);
#else

View file

@ -49,14 +49,14 @@ namespace boost {
\brief Circular buffer - a STL compliant container.
\tparam T The type of the elements stored in the <code>circular_buffer</code>.
\par Type Requirements T
The <code>T</code> has to be <a href="http://www.sgi.com/tech/stl/Assignable.html">
The <code>T</code> has to be <a href="https://www.boost.org/sgi/stl/Assignable.html">
SGIAssignable</a> (SGI STL defined combination of <a href="../../../utility/Assignable.html">
Assignable</a> and <a href="../../../utility/CopyConstructible.html">CopyConstructible</a>).
Moreover <code>T</code> has to be <a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">
Moreover <code>T</code> has to be <a href="https://www.boost.org/sgi/stl/DefaultConstructible.html">
DefaultConstructible</a> if supplied as a default parameter when invoking some of the
<code>circular_buffer</code>'s methods e.g.
<code>insert(iterator pos, const value_type& item = %value_type())</code>. And
<a href="http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a> and/or
<a href="https://www.boost.org/sgi/stl/EqualityComparable.html">EqualityComparable</a> and/or
<a href="../../../utility/LessThanComparable.html">LessThanComparable</a> if the <code>circular_buffer</code>
will be compared with another container.
\tparam Alloc The allocator type used for all internal memory management.
@ -146,7 +146,7 @@ public:
//! An array range.
/*!
(A typedef for the <a href="http://www.sgi.com/tech/stl/pair.html"><code>std::pair</code></a> where
(A typedef for the <a href="https://www.boost.org/sgi/stl/pair.html"><code>std::pair</code></a> where
its first element is a pointer to a beginning of an array and its second element represents
a size of the array.)
*/
@ -154,7 +154,7 @@ public:
//! A range of a const array.
/*!
(A typedef for the <a href="http://www.sgi.com/tech/stl/pair.html"><code>std::pair</code></a> where
(A typedef for the <a href="https://www.boost.org/sgi/stl/pair.html"><code>std::pair</code></a> where
its first element is a pointer to a beginning of a const array and its second element represents
a size of the const array.)
*/
@ -711,7 +711,7 @@ public:
//! Rotate elements in the <code>circular_buffer</code>.
/*!
A more effective implementation of
<code><a href="http://www.sgi.com/tech/stl/rotate.html">std::rotate</a></code>.
<code><a href="https://www.boost.org/sgi/stl/rotate.html">std::rotate</a></code>.
\pre <code>new_begin</code> is a valid iterator pointing to the <code>circular_buffer</code> <b>except</b> its
end.
\post Before calling the method suppose:<br><br>
@ -733,7 +733,7 @@ public:
<code>circular_buffer</code> is full.
\par Complexity
Linear (in <code>(std::min)(m, n)</code>); constant if the <code>circular_buffer</code> is full.
\sa <code><a href="http://www.sgi.com/tech/stl/rotate.html">std::rotate</a></code>
\sa <code><a href="https://www.boost.org/sgi/stl/rotate.html">std::rotate</a></code>
*/
void rotate(const_iterator new_begin) {
BOOST_CB_ASSERT(new_begin.is_valid(this)); // check for uninitialized or invalidated iterator
@ -1131,7 +1131,7 @@ public:
/*!
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity() == std::distance(first, last) \&\& full() \&\& (*this)[0]== *first \&\&
(*this)[1] == *(first + 1) \&\& ... \&\& (*this)[std::distance(first, last) - 1] == *(last - 1)</code>
\param first The beginning of the range to be copied.
@ -1153,7 +1153,7 @@ public:
/*!
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity() == buffer_capacity \&\& size() \<= std::distance(first, last) \&\&
(*this)[0]== *(last - buffer_capacity) \&\& (*this)[1] == *(last - buffer_capacity + 1) \&\& ... \&\&
(*this)[buffer_capacity - 1] == *(last - 1)</code><br><br>
@ -1170,7 +1170,7 @@ public:
\par Complexity
Linear (in <code>std::distance(first, last)</code>; in
<code>min[capacity, std::distance(first, last)]</code> if the <code>InputIterator</code> is a
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
<a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
*/
template <class InputIterator>
circular_buffer(capacity_type buffer_capacity, InputIterator first, InputIterator last,
@ -1316,7 +1316,7 @@ public:
specified range.
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity() == std::distance(first, last) \&\& size() == std::distance(first, last) \&\&
(*this)[0]== *first \&\& (*this)[1] == *(first + 1) \&\& ... \&\& (*this)[std::distance(first, last) - 1]
== *(last - 1)</code>
@ -1349,7 +1349,7 @@ public:
<code>circular_buffer</code> will be removed and replaced with copies of elements from the specified range.
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity() == buffer_capacity \&\& size() \<= std::distance(first, last) \&\&
(*this)[0]== *(last - buffer_capacity) \&\& (*this)[1] == *(last - buffer_capacity + 1) \&\& ... \&\&
(*this)[buffer_capacity - 1] == *(last - 1)</code><br><br>
@ -1370,7 +1370,7 @@ public:
\par Complexity
Linear (in <code>std::distance(first, last)</code>; in
<code>min[capacity, std::distance(first, last)]</code> if the <code>InputIterator</code> is a
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
<a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
\sa <code>\link operator=(const circular_buffer&) operator=\endlink</code>,
<code>\link assign(size_type, param_value_type) assign(size_type, const_reference)\endlink</code>,
<code>\link assign(capacity_type, size_type, param_value_type)
@ -1414,6 +1414,7 @@ public:
// push and pop
private:
/*! INTERNAL ONLY */
template <class ValT>
void push_back_impl(ValT item) {
if (full()) {
@ -1429,6 +1430,7 @@ private:
}
}
/*! INTERNAL ONLY */
template <class ValT>
void push_front_impl(ValT item) {
BOOST_TRY {
@ -1621,6 +1623,7 @@ public:
--m_size;
}
private:
/*! INTERNAL ONLY */
template <class ValT>
iterator insert_impl(iterator pos, ValT item) {
BOOST_CB_ASSERT(pos.is_valid(this)); // check for uninitialized or invalidated iterator
@ -1791,7 +1794,7 @@ public:
/*!
\pre <code>pos</code> is a valid iterator pointing to the <code>circular_buffer</code> or its end.<br>
Valid range <code>[first, last)</code> where <code>first</code> and <code>last</code> meet the
requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
requirements of an <a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post Elements from the range
<code>[first + max[0, distance(first, last) - (pos - begin()) - reserve()], last)</code> will be
inserted at the position <code>pos</code>.<br>The number of <code>min[pos - begin(), max[0,
@ -1814,7 +1817,7 @@ public:
Linear (in <code>[std::distance(pos, end()) + std::distance(first, last)]</code>; in
<code>min[capacity(), std::distance(pos, end()) + std::distance(first, last)]</code> if the
<code>InputIterator</code> is a
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
<a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
\par Example
Consider a <code>circular_buffer</code> with the capacity of 6 and the size of 4. Its internal buffer may
look like the one below.<br><br>
@ -1840,6 +1843,7 @@ public:
}
private:
/*! INTERNAL ONLY */
template <class ValT>
iterator rinsert_impl(iterator pos, ValT item) {
BOOST_CB_ASSERT(pos.is_valid(this)); // check for uninitialized or invalidated iterator
@ -2035,7 +2039,7 @@ public:
/*!
\pre <code>pos</code> is a valid iterator pointing to the <code>circular_buffer</code> or its end.<br>
Valid range <code>[first, last)</code> where <code>first</code> and <code>last</code> meet the
requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
requirements of an <a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post Elements from the range
<code>[first, last - max[0, distance(first, last) - (end() - pos) - reserve()])</code> will be inserted
before the position <code>pos</code>.<br>The number of <code>min[end() - pos, max[0,
@ -2057,7 +2061,7 @@ public:
Linear (in <code>[std::distance(begin(), pos) + std::distance(first, last)]</code>; in
<code>min[capacity(), std::distance(begin(), pos) + std::distance(first, last)]</code> if the
<code>InputIterator</code> is a
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
<a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
\par Example
Consider a <code>circular_buffer</code> with the capacity of 6 and the size of 4. Its internal buffer may
look like the one below.<br><br>
@ -2332,20 +2336,20 @@ public:
private:
// Helper methods
//! Check if the <code>index</code> is valid.
/*! INTERNAL ONLY */
void check_position(size_type index) const {
if (index >= size())
throw_exception(std::out_of_range("circular_buffer"));
}
//! Increment the pointer.
/*! INTERNAL ONLY */
template <class Pointer>
void increment(Pointer& p) const {
if (++p == m_end)
p = m_buff;
}
//! Decrement the pointer.
/*! INTERNAL ONLY */
template <class Pointer>
void decrement(Pointer& p) const {
if (p == m_buff)
@ -2353,30 +2357,32 @@ private:
--p;
}
//! Add <code>n</code> to the pointer.
/*! INTERNAL ONLY */
template <class Pointer>
Pointer add(Pointer p, difference_type n) const {
return p + (n < (m_end - p) ? n : n - capacity());
return p + (n < (m_end - p) ? n : n - (m_end - m_buff));
}
//! Subtract <code>n</code> from the pointer.
/*! INTERNAL ONLY */
template <class Pointer>
Pointer sub(Pointer p, difference_type n) const {
return p - (n > (p - m_buff) ? n - capacity() : n);
return p - (n > (p - m_buff) ? n - (m_end - m_buff) : n);
}
//! Map the null pointer to virtual end of circular buffer.
/*! INTERNAL ONLY */
pointer map_pointer(pointer p) const { return p == 0 ? m_last : p; }
/*! INTERNAL ONLY */
const Alloc& alloc() const {
return base::get();
}
/*! INTERNAL ONLY */
Alloc& alloc() {
return base::get();
}
//! Allocate memory.
/*! INTERNAL ONLY */
pointer allocate(size_type n) {
if (n > max_size())
throw_exception(std::length_error("circular_buffer"));
@ -2389,18 +2395,20 @@ private:
#endif
}
//! Deallocate memory.
/*! INTERNAL ONLY */
void deallocate(pointer p, size_type n) {
if (p != 0)
alloc().deallocate(p, n);
}
//! Does the pointer point to the uninitialized memory?
/*! INTERNAL ONLY */
bool is_uninitialized(const_pointer p) const BOOST_NOEXCEPT {
return p >= m_last && (m_first < m_last || p < m_first);
return (m_first < m_last)
? (p >= m_last || p < m_first)
: (p >= m_last && p < m_first);
}
//! Replace an element.
/*! INTERNAL ONLY */
void replace(pointer pos, param_value_type item) {
*pos = item;
#if BOOST_CB_ENABLE_DEBUG
@ -2408,7 +2416,7 @@ private:
#endif
}
//! Replace an element.
/*! INTERNAL ONLY */
void replace(pointer pos, rvalue_type item) {
*pos = boost::move(item);
#if BOOST_CB_ENABLE_DEBUG
@ -2416,11 +2424,7 @@ private:
#endif
}
//! Construct or replace an element.
/*!
<code>construct</code> has to be set to <code>true</code> if and only if
<code>pos</code> points to an uninitialized memory.
*/
/*! INTERNAL ONLY */
void construct_or_replace(bool construct, pointer pos, param_value_type item) {
if (construct)
cb_details::allocator_traits<Alloc>::construct(alloc(), boost::to_address(pos), item);
@ -2428,11 +2432,7 @@ private:
replace(pos, item);
}
//! Construct or replace an element.
/*!
<code>construct</code> has to be set to <code>true</code> if and only if
<code>pos</code> points to an uninitialized memory.
*/
/*! INTERNAL ONLY */
void construct_or_replace(bool construct, pointer pos, rvalue_type item) {
if (construct)
cb_details::allocator_traits<Alloc>::construct(alloc(), boost::to_address(pos), boost::move(item));
@ -2440,7 +2440,7 @@ private:
replace(pos, boost::move(item));
}
//! Destroy an item.
/*! INTERNAL ONLY */
void destroy_item(pointer p) {
cb_details::allocator_traits<Alloc>::destroy(alloc(), boost::to_address(p));
#if BOOST_CB_ENABLE_DEBUG
@ -2449,13 +2449,13 @@ private:
#endif
}
//! Destroy an item only if it has been constructed.
/*! INTERNAL ONLY */
void destroy_if_constructed(pointer pos) {
if (is_uninitialized(pos))
destroy_item(pos);
}
//! Destroy the whole content of the circular buffer.
/*! INTERNAL ONLY */
void destroy_content() {
#if BOOST_CB_ENABLE_DEBUG
destroy_content(false_type());
@ -2464,18 +2464,18 @@ private:
#endif
}
//! Specialized destroy_content method.
/*! INTERNAL ONLY */
void destroy_content(const true_type&) {
m_first = add(m_first, size());
}
//! Specialized destroy_content method.
/*! INTERNAL ONLY */
void destroy_content(const false_type&) {
for (size_type ii = 0; ii < size(); ++ii, increment(m_first))
destroy_item(m_first);
}
//! Destroy content and free allocated memory.
/*! INTERNAL ONLY */
void destroy() BOOST_NOEXCEPT {
destroy_content();
deallocate(m_buff, capacity());
@ -2487,13 +2487,13 @@ private:
#endif
}
//! Initialize the internal buffer.
/*! INTERNAL ONLY */
void initialize_buffer(capacity_type buffer_capacity) {
m_buff = allocate(buffer_capacity);
m_end = m_buff + buffer_capacity;
}
//! Initialize the internal buffer.
/*! INTERNAL ONLY */
void initialize_buffer(capacity_type buffer_capacity, param_value_type item) {
initialize_buffer(buffer_capacity);
BOOST_TRY {
@ -2505,7 +2505,7 @@ private:
BOOST_CATCH_END
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class IntegralType>
void initialize(IntegralType n, IntegralType item, const true_type&) {
m_size = static_cast<size_type>(n);
@ -2513,7 +2513,7 @@ private:
m_first = m_last = m_buff;
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class Iterator>
void initialize(Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
@ -2524,7 +2524,7 @@ private:
#endif
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class InputIterator>
void initialize(InputIterator first, InputIterator last, const std::input_iterator_tag&) {
BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS // check if the STL provides templated iterator constructors
@ -2534,7 +2534,7 @@ private:
initialize(distance, boost::make_move_iterator(tmp.begin()), boost::make_move_iterator(tmp.end()), distance);
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void initialize(ForwardIterator first, ForwardIterator last, const std::forward_iterator_tag&) {
BOOST_CB_ASSERT(std::distance(first, last) >= 0); // check for wrong range
@ -2542,7 +2542,7 @@ private:
initialize(distance, first, last, distance);
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class IntegralType>
void initialize(capacity_type buffer_capacity, IntegralType n, IntegralType item, const true_type&) {
BOOST_CB_ASSERT(buffer_capacity >= static_cast<size_type>(n)); // check for capacity lower than n
@ -2552,7 +2552,7 @@ private:
m_last = buffer_capacity == size() ? m_buff : m_buff + size();
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class Iterator>
void initialize(capacity_type buffer_capacity, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
@ -2563,7 +2563,7 @@ private:
#endif
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class InputIterator>
void initialize(capacity_type buffer_capacity,
InputIterator first,
@ -2586,7 +2586,7 @@ private:
}
}
//! Specialized initialize method.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void initialize(capacity_type buffer_capacity,
ForwardIterator first,
@ -2596,7 +2596,7 @@ private:
initialize(buffer_capacity, first, last, std::distance(first, last));
}
//! Initialize the circular buffer.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void initialize(capacity_type buffer_capacity,
ForwardIterator first,
@ -2621,7 +2621,7 @@ private:
m_last = m_buff;
}
//! Reset the circular buffer.
/*! INTERNAL ONLY */
void reset(pointer buff, pointer last, capacity_type new_capacity) {
destroy();
m_size = last - buff;
@ -2630,23 +2630,23 @@ private:
m_last = last == m_end ? m_buff : last;
}
//! Specialized method for swapping the allocator.
/*! INTERNAL ONLY */
void swap_allocator(circular_buffer<T, Alloc>&, const true_type&) {
// Swap is not needed because allocators have no state.
}
//! Specialized method for swapping the allocator.
/*! INTERNAL ONLY */
void swap_allocator(circular_buffer<T, Alloc>& cb, const false_type&) {
adl_move_swap(alloc(), cb.alloc());
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class IntegralType>
void assign(IntegralType n, IntegralType item, const true_type&) {
assign(static_cast<size_type>(n), static_cast<value_type>(item));
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class Iterator>
void assign(Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
@ -2657,7 +2657,7 @@ private:
#endif
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class InputIterator>
void assign(InputIterator first, InputIterator last, const std::input_iterator_tag&) {
BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS // check if the STL provides templated iterator constructors
@ -2669,7 +2669,7 @@ private:
(boost::make_move_iterator(tmp.begin()), boost::make_move_iterator(tmp.end()), alloc()));
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void assign(ForwardIterator first, ForwardIterator last, const std::forward_iterator_tag&) {
BOOST_CB_ASSERT(std::distance(first, last) >= 0); // check for wrong range
@ -2677,13 +2677,13 @@ private:
assign_n(distance, distance, cb_details::make_assign_range(first, last, alloc()));
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class IntegralType>
void assign(capacity_type new_capacity, IntegralType n, IntegralType item, const true_type&) {
assign(new_capacity, static_cast<size_type>(n), static_cast<value_type>(item));
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class Iterator>
void assign(capacity_type new_capacity, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
@ -2694,7 +2694,7 @@ private:
#endif
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class InputIterator>
void assign(capacity_type new_capacity, InputIterator first, InputIterator last, const std::input_iterator_tag&) {
if (new_capacity == capacity()) {
@ -2706,7 +2706,7 @@ private:
}
}
//! Specialized assign method.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void assign(capacity_type new_capacity, ForwardIterator first, ForwardIterator last,
const std::forward_iterator_tag&) {
@ -2720,7 +2720,7 @@ private:
cb_details::make_assign_range(first, last, alloc()));
}
//! Helper assign method.
/*! INTERNAL ONLY */
template <class Functor>
void assign_n(capacity_type new_capacity, size_type n, const Functor& fnc) {
if (new_capacity == capacity()) {
@ -2750,7 +2750,7 @@ private:
m_last = add(m_buff, size());
}
//! Helper insert method.
/*! INTERNAL ONLY */
template <class ValT>
iterator insert_item(const iterator& pos, ValT item) {
pointer p = pos.m_it;
@ -2786,13 +2786,13 @@ private:
return iterator(this, p);
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class IntegralType>
void insert(const iterator& pos, IntegralType n, IntegralType item, const true_type&) {
insert(pos, static_cast<size_type>(n), static_cast<value_type>(item));
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class Iterator>
void insert(const iterator& pos, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
@ -2803,7 +2803,7 @@ private:
#endif
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class InputIterator>
void insert(iterator pos, InputIterator first, InputIterator last, const std::input_iterator_tag&) {
if (!full() || pos != begin()) {
@ -2812,7 +2812,7 @@ private:
}
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void insert(const iterator& pos, ForwardIterator first, ForwardIterator last, const std::forward_iterator_tag&) {
BOOST_CB_ASSERT(std::distance(first, last) >= 0); // check for wrong range
@ -2829,7 +2829,7 @@ private:
insert_n(pos, n, cb_details::iterator_wrapper<ForwardIterator>(first));
}
//! Helper insert method.
/*! INTERNAL ONLY */
template <class Wrapper>
void insert_n(const iterator& pos, size_type n, const Wrapper& wrapper) {
size_type construct = reserve();
@ -2877,13 +2877,13 @@ private:
m_size += construct;
}
//! Specialized rinsert method.
/*! INTERNAL ONLY */
template <class IntegralType>
void rinsert(const iterator& pos, IntegralType n, IntegralType item, const true_type&) {
rinsert(pos, static_cast<size_type>(n), static_cast<value_type>(item));
}
//! Specialized rinsert method.
/*! INTERNAL ONLY */
template <class Iterator>
void rinsert(const iterator& pos, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
@ -2894,7 +2894,7 @@ private:
#endif
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class InputIterator>
void rinsert(iterator pos, InputIterator first, InputIterator last, const std::input_iterator_tag&) {
if (!full() || pos.m_it != 0) {
@ -2906,14 +2906,14 @@ private:
}
}
//! Specialized rinsert method.
/*! INTERNAL ONLY */
template <class ForwardIterator>
void rinsert(const iterator& pos, ForwardIterator first, ForwardIterator last, const std::forward_iterator_tag&) {
BOOST_CB_ASSERT(std::distance(first, last) >= 0); // check for wrong range
rinsert_n(pos, std::distance(first, last), cb_details::iterator_wrapper<ForwardIterator>(first));
}
//! Helper rinsert method.
/*! INTERNAL ONLY */
template <class Wrapper>
void rinsert_n(const iterator& pos, size_type n, const Wrapper& wrapper) {
if (n == 0)
@ -2966,25 +2966,25 @@ private:
m_size += construct;
}
//! Specialized erase_begin method.
/*! INTERNAL ONLY */
void erase_begin(size_type n, const true_type&) {
m_first = add(m_first, n);
m_size -= n;
}
//! Specialized erase_begin method.
/*! INTERNAL ONLY */
void erase_begin(size_type n, const false_type&) {
iterator b = begin();
rerase(b, b + n);
}
//! Specialized erase_end method.
/*! INTERNAL ONLY */
void erase_end(size_type n, const true_type&) {
m_last = sub(m_last, n);
m_size -= n;
}
//! Specialized erase_end method.
/*! INTERNAL ONLY */
void erase_end(size_type n, const false_type&) {
iterator e = end();
erase(e - n, e);
@ -2998,7 +2998,7 @@ private:
\param lhs The <code>circular_buffer</code> to compare.
\param rhs The <code>circular_buffer</code> to compare.
\return <code>lhs.\link circular_buffer::size() size()\endlink == rhs.\link circular_buffer::size() size()\endlink
&& <a href="http://www.sgi.com/tech/stl/equal.html">std::equal</a>(lhs.\link circular_buffer::begin()
&& <a href="https://www.boost.org/sgi/stl/equal.html">std::equal</a>(lhs.\link circular_buffer::begin()
begin()\endlink, lhs.\link circular_buffer::end() end()\endlink,
rhs.\link circular_buffer::begin() begin()\endlink)</code>
\throws Nothing.
@ -3017,7 +3017,7 @@ inline bool operator == (const circular_buffer<T, Alloc>& lhs, const circular_bu
right one.
\param lhs The <code>circular_buffer</code> to compare.
\param rhs The <code>circular_buffer</code> to compare.
\return <code><a href="http://www.sgi.com/tech/stl/lexicographical_compare.html">
\return <code><a href="https://www.boost.org/sgi/stl/lexicographical_compare.html">
std::lexicographical_compare</a>(lhs.\link circular_buffer::begin() begin()\endlink,
lhs.\link circular_buffer::end() end()\endlink, rhs.\link circular_buffer::begin() begin()\endlink,
rhs.\link circular_buffer::end() end()\endlink)</code>

View file

@ -453,7 +453,7 @@ public:
/*!
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity().%capacity() == std::distance(first, last) \&\& capacity().min_capacity() == 0 \&\&
full() \&\& (*this)[0]== *first \&\& (*this)[1] == *(first + 1) \&\& ... \&\&
(*this)[std::distance(first, last) - 1] == *(last - 1)</code><br><br>
@ -478,7 +478,7 @@ public:
of allocated memory) filled with a copy of the range.
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity() == capacity_ctrl \&\& size() \<= std::distance(first, last) \&\& (*this)[0]==
*(last - capacity_ctrl.%capacity()) \&\& (*this)[1] == *(last - capacity_ctrl.%capacity() + 1) \&\& ...
\&\& (*this)[capacity_ctrl.%capacity() - 1] == *(last - 1)</code><br><br>
@ -499,7 +499,7 @@ public:
\par Complexity
Linear (in <code>std::distance(first, last)</code>; in
<code>min[capacity_ctrl.%capacity(), std::distance(first, last)]</code> if the <code>InputIterator</code>
is a <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
is a <a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
*/
template <class InputIterator>
circular_buffer_space_optimized(capacity_type capacity_ctrl, InputIterator first, InputIterator last,
@ -655,7 +655,7 @@ public:
elements from the specified range.
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity().%capacity() == std::distance(first, last) \&\& capacity().min_capacity() == 0 \&\&
size() == std::distance(first, last) \&\& (*this)[0]== *first \&\& (*this)[1] == *(first + 1) \&\& ...
\&\& (*this)[std::distance(first, last) - 1] == *(last - 1)</code><br><br>
@ -692,7 +692,7 @@ public:
elements from the specified range.
\pre Valid range <code>[first, last)</code>.<br>
<code>first</code> and <code>last</code> have to meet the requirements of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
<a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post <code>capacity() == capacity_ctrl \&\& size() \<= std::distance(first, last) \&\&
(*this)[0]== *(last - capacity) \&\& (*this)[1] == *(last - capacity + 1) \&\& ... \&\&
(*this)[capacity - 1] == *(last - 1)</code><br><br>
@ -715,7 +715,7 @@ public:
\par Complexity
Linear (in <code>std::distance(first, last)</code>; in
<code>min[capacity_ctrl.%capacity(), std::distance(first, last)]</code> if the <code>InputIterator</code>
is a <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
is a <a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
\sa <code>\link operator=(const circular_buffer_space_optimized&) operator=\endlink</code>,
<code>\link assign(size_type, param_value_type) assign(size_type, const_reference)\endlink</code>,
<code>\link assign(capacity_type, size_type, param_value_type)
@ -1114,7 +1114,7 @@ public:
/*!
\pre <code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or its
end.<br>Valid range <code>[first, last)</code> where <code>first</code> and <code>last</code> meet the
requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
requirements of an <a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post Elements from the range
<code>[first + max[0, distance(first, last) - (pos - begin()) - reserve()], last)</code> will be
inserted at the position <code>pos</code>.<br>The number of <code>min[pos - begin(), max[0,
@ -1136,7 +1136,7 @@ public:
Linear (in <code>[size() + std::distance(first, last)]</code>; in
<code>min[capacity().%capacity(), size() + std::distance(first, last)]</code> if the
<code>InputIterator</code> is a
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
<a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
\par Example
Consider a <code>circular_buffer_space_optimized</code> with the capacity of 6 and the size of 4. Its
internal buffer may look like the one below.<br><br>
@ -1326,7 +1326,7 @@ public:
\pre <code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or its
end.<br>
Valid range <code>[first, last)</code> where <code>first</code> and <code>last</code> meet the
requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
requirements of an <a href="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</a>.
\post Elements from the range
<code>[first, last - max[0, distance(first, last) - (end() - pos) - reserve()])</code> will be inserted
before the position <code>pos</code>.<br>The number of <code>min[end() - pos, max[0,
@ -1349,7 +1349,7 @@ public:
Linear (in <code>[size() + std::distance(first, last)]</code>; in
<code>min[capacity().%capacity(), size() + std::distance(first, last)]</code> if the
<code>InputIterator</code> is a
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
<a href="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
\par Example
Consider a <code>circular_buffer_space_optimized</code> with the capacity of 6 and the size of 4. Its
internal buffer may look like the one below.<br><br>
@ -1522,7 +1522,7 @@ public:
private:
// Helper methods
//! Adjust the amount of allocated memory.
/*! INTERNAL ONLY */
void adjust_min_capacity() {
if (m_capacity_ctrl.min_capacity() > circular_buffer<T, Alloc>::capacity())
circular_buffer<T, Alloc>::set_capacity(m_capacity_ctrl.min_capacity());
@ -1530,7 +1530,7 @@ private:
check_high_capacity();
}
//! Ensure the reserve for possible growth up.
/*! INTERNAL ONLY */
size_type ensure_reserve(size_type new_capacity, size_type buffer_size) const {
if (buffer_size + new_capacity / 5 >= new_capacity)
new_capacity *= 2; // ensure at least 20% reserve
@ -1539,10 +1539,7 @@ private:
return new_capacity;
}
//! Check for low capacity.
/*
\post If the capacity is low it will be increased.
*/
/*! INTERNAL ONLY */
void check_low_capacity(size_type n = 1) {
size_type new_size = size() + n;
size_type new_capacity = circular_buffer<T, Alloc>::capacity();
@ -1558,10 +1555,7 @@ private:
#endif
}
//! Check for high capacity.
/*
\post If the capacity is high it will be decreased.
*/
/*! INTERNAL ONLY */
void check_high_capacity() {
size_type new_capacity = circular_buffer<T, Alloc>::capacity();
while (new_capacity / 3 >= size()) { // (new_capacity / 3) -> avoid oscillations
@ -1578,28 +1572,28 @@ private:
#endif
}
//! Specialized method for reducing the capacity.
/*! INTERNAL ONLY */
void reduce_capacity(const true_type&) {
circular_buffer<T, Alloc>::set_capacity((std::max)(m_capacity_ctrl.min_capacity(), size()));
}
//! Specialized method for reducing the capacity.
/*! INTERNAL ONLY */
void reduce_capacity(const false_type&) {}
//! Determine the initial capacity.
/*! INTERNAL ONLY */
static size_type init_capacity(const capacity_type& capacity_ctrl, size_type n) {
BOOST_CB_ASSERT(capacity_ctrl.capacity() >= n); // check for capacity lower than n
return (std::max)(capacity_ctrl.min_capacity(), n);
}
//! Specialized method for determining the initial capacity.
/*! INTERNAL ONLY */
template <class IntegralType>
static size_type init_capacity(const capacity_type& capacity_ctrl, IntegralType n, IntegralType,
const true_type&) {
return init_capacity(capacity_ctrl, static_cast<size_type>(n));
}
//! Specialized method for determining the initial capacity.
/*! INTERNAL ONLY */
template <class Iterator>
static size_type init_capacity(const capacity_type& capacity_ctrl, Iterator first, Iterator last,
const false_type&) {
@ -1612,14 +1606,14 @@ private:
#endif
}
//! Specialized method for determining the initial capacity.
/*! INTERNAL ONLY */
template <class InputIterator>
static size_type init_capacity(const capacity_type& capacity_ctrl, InputIterator, InputIterator,
const std::input_iterator_tag&) {
return capacity_ctrl.capacity();
}
//! Specialized method for determining the initial capacity.
/*! INTERNAL ONLY */
template <class ForwardIterator>
static size_type init_capacity(const capacity_type& capacity_ctrl, ForwardIterator first, ForwardIterator last,
const std::forward_iterator_tag&) {
@ -1628,13 +1622,13 @@ private:
(std::min)(capacity_ctrl.capacity(), static_cast<size_type>(std::distance(first, last))));
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class IntegralType>
void insert(const iterator& pos, IntegralType n, IntegralType item, const true_type&) {
insert(pos, static_cast<size_type>(n), static_cast<value_type>(item));
}
//! Specialized insert method.
/*! INTERNAL ONLY */
template <class Iterator>
void insert(const iterator& pos, Iterator first, Iterator last, const false_type&) {
size_type index = pos - begin();
@ -1642,13 +1636,13 @@ private:
circular_buffer<T, Alloc>::insert(begin() + index, first, last);
}
//! Specialized rinsert method.
/*! INTERNAL ONLY */
template <class IntegralType>
void rinsert(const iterator& pos, IntegralType n, IntegralType item, const true_type&) {
rinsert(pos, static_cast<size_type>(n), static_cast<value_type>(item));
}
//! Specialized rinsert method.
/*! INTERNAL ONLY */
template <class Iterator>
void rinsert(const iterator& pos, Iterator first, Iterator last, const false_type&) {
size_type index = pos - begin();

View file

@ -99,7 +99,8 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
#if defined(BOOST_MSVC) \
|| defined(__BORLANDC__) \
|| (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
|| (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))
|| (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) \
|| (defined(BOOST_CLANG) && defined(BOOST_WINDOWS) && defined(_MSC_VER) && (__clang_major__ >= 4))
#ifndef BOOST_VERSION_HPP
# include <boost/version.hpp>
@ -173,11 +174,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
// vc14:
# define BOOST_LIB_TOOLSET "vc140"
# elif defined(BOOST_MSVC)
# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1920)
// vc14.1:
# define BOOST_LIB_TOOLSET "vc141"
# elif defined(BOOST_MSVC)
// vc14.2:
# define BOOST_LIB_TOOLSET "vc142"
# elif defined(__BORLANDC__)
// CBuilder 6:
@ -198,6 +204,11 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
// Metrowerks CodeWarrior 9.x
# define BOOST_LIB_TOOLSET "cw9"
# elif defined(BOOST_CLANG) && defined(BOOST_WINDOWS) && defined(_MSC_VER) && (__clang_major__ >= 4)
// Clang on Windows
# define BOOST_LIB_TOOLSET "clangw" BOOST_STRINGIZE(__clang_major__)
# endif
#endif // BOOST_LIB_TOOLSET
@ -405,9 +416,9 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
&& defined(BOOST_LIB_VERSION)
#ifdef BOOST_AUTO_LINK_TAGGED
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_ARCH_AND_MODEL_OPT ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_ARCH_AND_MODEL_OPT ".lib")
# endif
#elif defined(BOOST_AUTO_LINK_SYSTEM)
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")

View file

@ -57,6 +57,14 @@
# define BOOST_HAS_STDINT_H
#endif
#if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
#if (__clang_major__ >= 4) && defined(__has_include)
#if __has_include(<quadmath.h>)
# define BOOST_HAS_FLOAT128
#endif
#endif
#endif
#define BOOST_HAS_NRVO

View file

@ -232,7 +232,6 @@
// C++0x features in 4.6.n and later
//
#if (BOOST_GCC_VERSION < 40600) || !defined(BOOST_GCC_CXX11)
#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DEFAULTED_MOVES
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_NULLPTR
@ -243,6 +242,9 @@
// C++0x features in 4.7.n and later
//
#if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11)
// Note that while constexpr is partly supported in gcc-4.6 it's a
// pre-std version with several bugs:
# define BOOST_NO_CXX11_CONSTEXPR
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
@ -307,8 +309,8 @@
# define BOOST_FALLTHROUGH __attribute__((fallthrough))
#endif
#ifdef __MINGW32__
// Currently (June 2017) thread_local is broken on mingw for all current compiler releases, see
#if defined(__MINGW32__) && !defined(__MINGW64__)
// Currently (March 2019) thread_local is broken on mingw for all current 32bit compiler releases, see
// https://sourceforge.net/p/mingw-w64/bugs/527/
// Not setting this causes program termination on thread exit.
#define BOOST_NO_CXX11_THREAD_LOCAL
@ -325,7 +327,7 @@
//
// __builtin_unreachable:
#if BOOST_GCC_VERSION >= 40800
#if BOOST_GCC_VERSION >= 40500
#define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable();
#endif

View file

@ -43,6 +43,9 @@
# error "Compiler not supported or configured - please reconfigure"
#endif
// VS2005 (VC8) docs: __assume has been in Visual C++ for multiple releases
#define BOOST_UNREACHABLE_RETURN(x) __assume(0);
#if _MSC_FULL_VER < 180020827
# define BOOST_NO_FENV_H
#endif
@ -202,8 +205,9 @@
#if (_MSC_VER < 1911) || (_MSVC_LANG < 201703)
# define BOOST_NO_CXX17_STRUCTURED_BINDINGS
# define BOOST_NO_CXX17_IF_CONSTEXPR
# define BOOST_NO_CXX17_HDR_OPTIONAL
# define BOOST_NO_CXX17_HDR_STRING_VIEW
// Let the defaults handle these now:
//# define BOOST_NO_CXX17_HDR_OPTIONAL
//# define BOOST_NO_CXX17_HDR_STRING_VIEW
#endif
// MSVC including version 14 has not yet completely
@ -313,7 +317,7 @@
# endif
# else
# if _MSC_VER < 1200
// Note: Versions up to 7.0 aren't supported.
// Note: Versions up to 10.0 aren't supported.
# define BOOST_COMPILER_VERSION 5.0
# elif _MSC_VER < 1300
# define BOOST_COMPILER_VERSION 6.0
@ -335,6 +339,8 @@
# define BOOST_COMPILER_VERSION 14.0
# elif _MSC_VER < 1920
# define BOOST_COMPILER_VERSION 14.1
# elif _MSC_VER < 1930
# define BOOST_COMPILER_VERSION 14.2
# else
# define BOOST_COMPILER_VERSION _MSC_VER
# endif
@ -346,8 +352,8 @@
#include <boost/config/pragma_message.hpp>
//
// last known and checked version is 19.12.25830.2 (VC++ 2017.3):
#if (_MSC_VER > 1912)
// last known and checked version is 19.20.27508 (VC++ 2019 RC3):
#if (_MSC_VER > 1920)
# if defined(BOOST_ASSERT_CONFIG)
# error "Boost.Config is older than your current compiler version."
# elif !defined(BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE)

View file

@ -992,6 +992,23 @@ namespace std{ using ::type_info; }
#ifndef BOOST_ATTRIBUTE_UNUSED
# define BOOST_ATTRIBUTE_UNUSED
#endif
//
// [[nodiscard]]:
//
#ifdef __has_cpp_attribute
#if __has_cpp_attribute(nodiscard)
# define BOOST_ATTRIBUTE_NODISCARD [[nodiscard]]
#endif
#if __has_cpp_attribute(no_unique_address) && !(defined(__GNUC__) && (__cplusplus < 201100))
# define BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS [[no_unique_address]]
#endif
#endif
#ifndef BOOST_ATTRIBUTE_NODISCARD
# define BOOST_ATTRIBUTE_NODISCARD
#endif
#ifndef BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS
# define BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS
#endif
#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST
@ -1027,6 +1044,7 @@ namespace std{ using ::type_info; }
#if !defined(__has_include)
# define BOOST_NO_CXX17_HDR_OPTIONAL
# define BOOST_NO_CXX17_HDR_STRING_VIEW
# define BOOST_NO_CXX17_HDR_VARIANT
#else
#if !__has_include(<optional>)
# define BOOST_NO_CXX17_HDR_OPTIONAL
@ -1034,6 +1052,9 @@ namespace std{ using ::type_info; }
#if !__has_include(<string_view>)
# define BOOST_NO_CXX17_HDR_STRING_VIEW
#endif
#if !__has_include(<variant>)
# define BOOST_NO_CXX17_HDR_VARIANT
#endif
#endif
//

View file

@ -42,8 +42,11 @@
# define BOOST_HAS_STDINT_H
#endif
#include <cygwin/version.h>
#if (CYGWIN_VERSION_API_MAJOR == 0 && CYGWIN_VERSION_API_MINOR < 231)
/// Cygwin has no fenv.h
#define BOOST_NO_FENV_H
#endif
// Cygwin has it's own <pthread.h> which breaks <shared_mutex> unless the correct compiler flags are used:
#ifndef BOOST_NO_CXX14_HDR_SHARED_MUTEX

View file

@ -12,40 +12,17 @@
// like (GCC 2.96) . Do not even think of getting this to work,
// a miserable failure will be guaranteed!
//
// Equally, this file has been tested for RTPs (Real Time Processes)
// only, not for DKMs (Downloadable Kernel Modules). These two types
// of executables differ largely in the available functionality of
// the C-library, STL, and so on. A DKM uses a C89 library with no
// wide character support and no guarantee of ANSI C. The same Dinkum
// VxWorks supports C++ linkage in the kernel with
// DKMs (Downloadable Kernel Modules). But, until recently
// the kernel used a C89 library with no
// wide character support and no guarantee of ANSI C.
// Regardless of the C library the same Dinkum
// STL library is used in both contexts.
//
// Similarly the Dinkum abridged STL that supports the loosely specified
// embedded C++ standard has not been tested and is unlikely to work
// on anything but the simplest library.
// ====================================================================
//
// Additional Configuration
// -------------------------------------------------------------------
//
// Because of the ordering of include files and other issues the following
// additional definitions worked better outside this file.
//
// When building the log library add the following to the b2 invocation
// define=BOOST_LOG_WITHOUT_IPC
// and
// -DBOOST_LOG_WITHOUT_DEFAULT_FACTORIES
// to your compile options.
//
// When building the test library add
// -DBOOST_TEST_LIMITED_SIGNAL_DETAILS
// to your compile options
//
// When building containers library add
// -DHAVE_MORECORE=0
// to your c compile options so dlmalloc heap library is compiled
// without brk() calls
//
// ====================================================================
//
// Some important information regarding the usage of POSIX semaphores:
// -------------------------------------------------------------------
@ -112,30 +89,20 @@
// --------------------------------
#define BOOST_PLATFORM "vxWorks"
// Special behaviour for DKMs:
#ifdef _WRS_KERNEL
// DKMs do not have the <cwchar>-header,
// but apparently they do have an intrinsic wchar_t meanwhile!
# define BOOST_NO_CWCHAR
// Lots of wide-functions and -headers are unavailable for DKMs as well:
# define BOOST_NO_CWCTYPE
# define BOOST_NO_SWPRINTF
# define BOOST_NO_STD_WSTRING
# define BOOST_NO_STD_WSTREAMBUF
#endif
// Generally available headers:
#define BOOST_HAS_UNISTD_H
#define BOOST_HAS_STDINT_H
#define BOOST_HAS_DIRENT_H
#define BOOST_HAS_SLIST
//#define BOOST_HAS_SLIST
// vxWorks does not have installed an iconv-library by default,
// so unfortunately no Unicode support from scratch is available!
// Thus, instead it is suggested to switch to ICU, as this seems
// to be the most complete and portable option...
#define BOOST_LOCALE_WITH_ICU
#ifndef BOOST_LOCALE_WITH_ICU
#define BOOST_LOCALE_WITH_ICU
#endif
// Generally available functionality:
#define BOOST_HAS_THREADS
@ -170,16 +137,18 @@
# ifndef _POSIX_THREADS
# define _POSIX_THREADS 1
# endif
// no sysconf( _SC_PAGESIZE) in kernel
# define BOOST_THREAD_USES_GETPAGESIZE
#endif
#if (_WRS_VXWORKS_MAJOR < 7)
// vxWorks-around: <time.h> #defines CLOCKS_PER_SEC as sysClkRateGet() but
// miserably fails to #include the required <sysLib.h> to make
// sysClkRateGet() available! So we manually include it here.
#ifdef __RTP__
# include <time.h>
# include <sysLib.h>
#endif
# ifdef __RTP__
# include <time.h>
# include <sysLib.h>
# endif
// vxWorks-around: In <stdint.h> the macros INT32_C(), UINT32_C(), INT64_C() and
// UINT64_C() are defined erroneously, yielding not a signed/
@ -188,30 +157,47 @@
// when trying to define several constants which do not fit into a
// long type! We correct them here by redefining.
#include <cstdint>
# include <cstdint>
// Special behaviour for DKMs:
// Some macro-magic to do the job
#define VX_JOIN(X, Y) VX_DO_JOIN(X, Y)
#define VX_DO_JOIN(X, Y) VX_DO_JOIN2(X, Y)
#define VX_DO_JOIN2(X, Y) X##Y
# define VX_JOIN(X, Y) VX_DO_JOIN(X, Y)
# define VX_DO_JOIN(X, Y) VX_DO_JOIN2(X, Y)
# define VX_DO_JOIN2(X, Y) X##Y
// Correctly setup the macros
#undef INT32_C
#undef UINT32_C
#undef INT64_C
#undef UINT64_C
#define INT32_C(x) VX_JOIN(x, L)
#define UINT32_C(x) VX_JOIN(x, UL)
#define INT64_C(x) VX_JOIN(x, LL)
#define UINT64_C(x) VX_JOIN(x, ULL)
# undef INT32_C
# undef UINT32_C
# undef INT64_C
# undef UINT64_C
# define INT32_C(x) VX_JOIN(x, L)
# define UINT32_C(x) VX_JOIN(x, UL)
# define INT64_C(x) VX_JOIN(x, LL)
# define UINT64_C(x) VX_JOIN(x, ULL)
// #include Libraries required for the following function adaption
#include <sys/time.h>
# include <sys/time.h>
#endif // _WRS_VXWORKS_MAJOR < 7
#include <ioLib.h>
#include <tickLib.h>
#if defined(_WRS_KERNEL) && (_CPPLIB_VER < 700)
// recent kernels use Dinkum clib v7.00+
// with widechar but older kernels
// do not have the <cwchar>-header,
// but apparently they do have an intrinsic wchar_t meanwhile!
# define BOOST_NO_CWCHAR
// Lots of wide-functions and -headers are unavailable for DKMs as well:
# define BOOST_NO_CWCTYPE
# define BOOST_NO_SWPRINTF
# define BOOST_NO_STD_WSTRING
# define BOOST_NO_STD_WSTREAMBUF
#endif
// Use C-linkage for the following helper functions
#ifdef __cplusplus
extern "C" {
@ -253,9 +239,9 @@ inline int truncate(const char *p, off_t l){
}
#ifdef __GNUC__
#define ___unused __attribute__((unused))
# define ___unused __attribute__((unused))
#else
#define ___unused
# define ___unused
#endif
// Fake symlink handling by dummy functions:
@ -291,7 +277,7 @@ inline int gettimeofday(struct timeval *tv, void * /*tzv*/) {
* to avoid conflict with MPL operator times
*/
#if (_WRS_VXWORKS_MAJOR < 7)
#ifdef __cplusplus
# ifdef __cplusplus
// vxWorks provides neither struct tms nor function times()!
// We implement an empty dummy-function, simply setting the user
@ -327,7 +313,7 @@ struct tms{
namespace std {
using ::times;
}
#endif // __cplusplus
# endif // __cplusplus
#endif // _WRS_VXWORKS_MAJOR < 7
@ -336,16 +322,16 @@ extern "C" void bzero (void *, size_t); // FD_ZERO uses bzero() but does
// Put the selfmade functions into the std-namespace, just in case
namespace std {
# ifdef __RTP__
# ifdef __RTP__
using ::getrlimit;
using ::setrlimit;
# endif
# endif
using ::truncate;
using ::symlink;
using ::readlink;
#if (_WRS_VXWORKS_MAJOR < 7)
# if (_WRS_VXWORKS_MAJOR < 7)
using ::gettimeofday;
#endif
# endif
}
#endif // __cplusplus
@ -355,10 +341,12 @@ namespace std {
// Include signal.h which might contain a typo to be corrected here
#include <signal.h>
#if (_WRS_VXWORKS_MAJOR < 7)
#define getpagesize() sysconf(_SC_PAGESIZE) // getpagesize is deprecated anyway!
# define getpagesize() sysconf(_SC_PAGESIZE) // getpagesize is deprecated anyway!
inline int lstat(p, b) { return stat(p, b); } // lstat() == stat(), as vxWorks has no symlinks!
#endif
#ifndef S_ISSOCK
# define S_ISSOCK(mode) ((mode & S_IFMT) == S_IFSOCK) // Is file a socket?
#endif
@ -379,7 +367,7 @@ typedef int locale_t; // locale_t is a POSIX-ex
// vxWorks 7 adds C++11 support
// however it is optional, and does not match exactly the support determined
// by examining the Dinkum STL version and GCC version (or ICC and DCC)
#ifndef _WRS_CONFIG_LANG_LIB_CPLUS_CPLUS_USER_2011
#if !( defined( _WRS_CONFIG_LANG_LIB_CPLUS_CPLUS_USER_2011) || defined(_WRS_CONFIG_LIBCPLUS_STD))
# define BOOST_NO_CXX11_ADDRESSOF // C11 addressof operator on memory location
# define BOOST_NO_CXX11_ALLOCATOR
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
@ -408,9 +396,9 @@ typedef int locale_t; // locale_t is a POSIX-ex
# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
# define BOOST_NO_CXX11_HDR_UNORDERED_SET
#else
#ifndef BOOST_SYSTEM_NO_DEPRECATED
# define BOOST_SYSTEM_NO_DEPRECATED // workaround link error in spirit
#endif
# ifndef BOOST_SYSTEM_NO_DEPRECATED
# define BOOST_SYSTEM_NO_DEPRECATED // workaround link error in spirit
# endif
#endif
@ -418,6 +406,8 @@ typedef int locale_t; // locale_t is a POSIX-ex
#undef NONE
// restrict is an iostreams class
#undef restrict
// affects some typeof tests
#undef V7
// use fake poll() from Unix layer in ASIO to get full functionality
// most libraries will use select() but this define allows 'iostream' functionality
@ -430,4 +420,3 @@ typedef int locale_t; // locale_t is a POSIX-ex
# define BOOST_ASIO_DISABLE_SERIAL_PORT
#endif

View file

@ -174,6 +174,9 @@
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)
# define BOOST_NO_CXX17_STD_APPLY
# define BOOST_NO_CXX17_ITERATOR_TRAITS
# define BOOST_NO_CXX17_HDR_STRING_VIEW
# define BOOST_NO_CXX17_HDR_OPTIONAL
# define BOOST_NO_CXX17_HDR_VARIANT
#endif
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) || !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 201709)
# define BOOST_NO_CXX17_STD_INVOKE

View file

@ -91,6 +91,7 @@
# define BOOST_NO_CXX17_STD_APPLY
# define BOOST_NO_CXX17_HDR_OPTIONAL
# define BOOST_NO_CXX17_HDR_STRING_VIEW
# define BOOST_NO_CXX17_HDR_VARIANT
#endif
#if (_LIBCPP_VERSION > 4000) && (__cplusplus > 201402L) && !defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
# define BOOST_NO_AUTO_PTR

View file

@ -301,6 +301,7 @@ extern "C" char *gets (char *__s);
# define BOOST_NO_CXX17_STD_APPLY
# define BOOST_NO_CXX17_HDR_OPTIONAL
# define BOOST_NO_CXX17_HDR_STRING_VIEW
# define BOOST_NO_CXX17_HDR_VARIANT
#endif
#if defined(__has_include)

View file

@ -7,6 +7,8 @@
# pragma once
#endif
#include <boost/config.hpp>
//
// boost/checked_delete.hpp
//
@ -26,7 +28,7 @@ namespace boost
// verify that types are complete for increased safety
template<class T> inline void checked_delete(T * x)
template<class T> inline void checked_delete(T * x) BOOST_NOEXCEPT
{
// intentionally complex - simplification causes regressions
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
@ -34,7 +36,7 @@ template<class T> inline void checked_delete(T * x)
delete x;
}
template<class T> inline void checked_array_delete(T * x)
template<class T> inline void checked_array_delete(T * x) BOOST_NOEXCEPT
{
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
(void) sizeof(type_must_be_complete);
@ -46,7 +48,7 @@ template<class T> struct checked_deleter
typedef void result_type;
typedef T * argument_type;
void operator()(T * x) const
void operator()(T * x) const BOOST_NOEXCEPT
{
// boost:: disables ADL
boost::checked_delete(x);
@ -58,7 +60,7 @@ template<class T> struct checked_array_deleter
typedef void result_type;
typedef T * argument_type;
void operator()(T * x) const
void operator()(T * x) const BOOST_NOEXCEPT
{
boost::checked_array_delete(x);
}

View file

@ -71,6 +71,10 @@ public:
template<class U>
empty_value(boost::empty_init_t, const U& value)
: value_(value) { }
template<class U>
empty_value(boost::empty_init_t, U& value)
: value_(value) { }
#endif
const T& get() const BOOST_NOEXCEPT {
@ -115,6 +119,10 @@ public:
template<class U>
empty_value(boost::empty_init_t, const U& value)
: T(value) { }
template<class U>
empty_value(boost::empty_init_t, U& value)
: T(value) { }
#endif
const T& get() const BOOST_NOEXCEPT {

View file

@ -32,9 +32,21 @@
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# define BOOST_TRY { if ("")
# define BOOST_CATCH(x) else if (!"")
# else
# elif !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
# define BOOST_TRY { if (true)
# define BOOST_CATCH(x) else if (false)
# else
// warning C4127: conditional expression is constant
# define BOOST_TRY { \
__pragma(warning(push)) \
__pragma(warning(disable: 4127)) \
if (true) \
__pragma(warning(pop))
# define BOOST_CATCH(x) else \
__pragma(warning(push)) \
__pragma(warning(disable: 4127)) \
if (false) \
__pragma(warning(pop))
# endif
# define BOOST_RETHROW
# define BOOST_CATCH_END }

View file

@ -47,7 +47,7 @@ public:
bool operator==( typeinfo const& rhs ) const
{
#if ( defined(_WIN32) || defined(__CYGWIN__) ) && defined(__GNUC__) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
#if ( defined(_WIN32) || defined(__CYGWIN__) ) && ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
return lib_id_ == rhs.lib_id_? this == &rhs: std::strcmp( name_, rhs.name_ ) == 0;
@ -65,7 +65,7 @@ public:
bool before( typeinfo const& rhs ) const
{
#if ( defined(_WIN32) || defined(__CYGWIN__) ) && defined(__GNUC__) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
#if ( defined(_WIN32) || defined(__CYGWIN__) ) && ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
return lib_id_ == rhs.lib_id_? std::less< typeinfo const* >()( this, &rhs ): std::strcmp( name_, rhs.name_ ) < 0;

View file

@ -0,0 +1,17 @@
/*
Copyright 2019 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_CORE_USE_DEFAULT_HPP
#define BOOST_CORE_USE_DEFAULT_HPP
namespace boost {
struct use_default { };
} /* boost */
#endif

View file

@ -10,13 +10,13 @@
//
// boost/current_function.hpp - BOOST_CURRENT_FUNCTION
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright 2002-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
//
// http://www.boost.org/libs/assert/current_function.html
// http://www.boost.org/libs/assert
//
namespace boost
@ -32,7 +32,7 @@ inline void current_function_helper()
# define BOOST_CURRENT_FUNCTION "(unknown)"
#elif defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__)
#elif defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) || defined(__clang__)
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__

View file

@ -1,193 +0,0 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See Boost website at http://www.boost.org/
*/
#ifndef BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
#define BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#include <boost/detail/select_type.hpp>
#include <boost/type_traits/is_same.hpp>
#include <cstddef>
#include <memory>
#include <new>
namespace boost{
namespace detail{
/* Allocator adaption layer. Some stdlibs provide allocators without rebind
* and template ctors. These facilities are simulated with the external
* template class rebind_to and the aid of partial_std_allocator_wrapper.
*/
namespace allocator{
/* partial_std_allocator_wrapper inherits the functionality of a std
* allocator while providing a templatized ctor and other bits missing
* in some stdlib implementation or another.
*/
template<typename Type>
class partial_std_allocator_wrapper:public std::allocator<Type>
{
public:
/* Oddly enough, STLport does not define std::allocator<void>::value_type
* when configured to work without partial template specialization.
* No harm in supplying the definition here unconditionally.
*/
typedef Type value_type;
partial_std_allocator_wrapper(){};
template<typename Other>
partial_std_allocator_wrapper(const partial_std_allocator_wrapper<Other>&){}
partial_std_allocator_wrapper(const std::allocator<Type>& x):
std::allocator<Type>(x)
{
};
#if defined(BOOST_DINKUMWARE_STDLIB)
/* Dinkumware guys didn't provide a means to call allocate() without
* supplying a hint, in disagreement with the standard.
*/
Type* allocate(std::size_t n,const void* hint=0)
{
std::allocator<Type>& a=*this;
return a.allocate(n,hint);
}
#endif
};
/* Detects whether a given allocator belongs to a defective stdlib not
* having the required member templates.
* Note that it does not suffice to check the Boost.Config stdlib
* macros, as the user might have passed a custom, compliant allocator.
* The checks also considers partial_std_allocator_wrapper to be
* a standard defective allocator.
*/
#if defined(BOOST_NO_STD_ALLOCATOR)&&\
(defined(BOOST_HAS_PARTIAL_STD_ALLOCATOR)||defined(BOOST_DINKUMWARE_STDLIB))
template<typename Allocator>
struct is_partial_std_allocator
{
BOOST_STATIC_CONSTANT(bool,
value=
(is_same<
std::allocator<BOOST_DEDUCED_TYPENAME Allocator::value_type>,
Allocator
>::value)||
(is_same<
partial_std_allocator_wrapper<
BOOST_DEDUCED_TYPENAME Allocator::value_type>,
Allocator
>::value));
};
#else
template<typename Allocator>
struct is_partial_std_allocator
{
BOOST_STATIC_CONSTANT(bool,value=false);
};
#endif
/* rebind operations for defective std allocators */
template<typename Allocator,typename Type>
struct partial_std_allocator_rebind_to
{
typedef partial_std_allocator_wrapper<Type> type;
};
/* rebind operation in all other cases */
template<typename Allocator>
struct rebinder
{
template<typename Type>
struct result
{
#ifdef BOOST_NO_CXX11_ALLOCATOR
typedef typename Allocator::BOOST_NESTED_TEMPLATE
rebind<Type>::other other;
#else
typedef typename std::allocator_traits<Allocator>::BOOST_NESTED_TEMPLATE
rebind_alloc<Type> other;
#endif
};
};
template<typename Allocator,typename Type>
struct compliant_allocator_rebind_to
{
typedef typename rebinder<Allocator>::
BOOST_NESTED_TEMPLATE result<Type>::other type;
};
/* rebind front-end */
template<typename Allocator,typename Type>
struct rebind_to:
boost::detail::if_true<
is_partial_std_allocator<Allocator>::value
>::template then<
partial_std_allocator_rebind_to<Allocator,Type>,
compliant_allocator_rebind_to<Allocator,Type>
>::type
{
};
/* allocator-independent versions of construct and destroy */
template<typename Type>
void construct(void* p,const Type& t)
{
new (p) Type(t);
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC++ issues spurious warnings about unreferencend formal parameters
* in destroy<Type> when Type is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename Type>
void destroy(const Type* p)
{
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
const_cast<Type*>(p)->~Type();
#else
p->~Type();
#endif
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
} /* namespace boost::detail::allocator */
} /* namespace boost::detail */
} /* namespace boost */
#endif

View file

@ -1,36 +0,0 @@
#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// detail/sp_typeinfo.hpp
//
// Deprecated, please use boost/core/typeinfo.hpp
//
// Copyright 2007 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/core/typeinfo.hpp>
namespace boost
{
namespace detail
{
typedef boost::core::typeinfo sp_typeinfo;
} // namespace detail
} // namespace boost
#define BOOST_SP_TYPEID(T) BOOST_CORE_TYPEID(T)
#endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED

View file

@ -165,7 +165,7 @@ boost
protected:
~error_info_container() throw()
~error_info_container() BOOST_NOEXCEPT_OR_NOTHROW
{
}
};
@ -233,7 +233,7 @@ boost
#ifdef __HP_aCC
//On HP aCC, this protected copy constructor prevents throwing boost::exception.
//On all other platforms, the same effect is achieved by the pure virtual destructor.
exception( exception const & x ) throw():
exception( exception const & x ) BOOST_NOEXCEPT_OR_NOTHROW:
data_(x.data_),
throw_function_(x.throw_function_),
throw_file_(x.throw_file_),
@ -242,7 +242,7 @@ boost
}
#endif
virtual ~exception() throw()
virtual ~exception() BOOST_NOEXCEPT_OR_NOTHROW
#ifndef __HP_aCC
= 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
#endif
@ -287,7 +287,7 @@ boost
inline
exception::
~exception() throw()
~exception() BOOST_NOEXCEPT_OR_NOTHROW
{
}
@ -337,7 +337,7 @@ boost
{
}
~error_info_injector() throw()
~error_info_injector() BOOST_NOEXCEPT_OR_NOTHROW
{
}
};
@ -398,7 +398,7 @@ boost
virtual void rethrow() const = 0;
virtual
~clone_base() throw()
~clone_base() BOOST_NOEXCEPT_OR_NOTHROW
{
}
};
@ -445,7 +445,7 @@ boost
copy_boost_exception(this,&x);
}
~clone_impl() throw()
~clone_impl() BOOST_NOEXCEPT_OR_NOTHROW
{
}
@ -487,7 +487,7 @@ boost
{
}
~wrapexcept() throw()
~wrapexcept() BOOST_NOEXCEPT_OR_NOTHROW
{
}
};

View file

@ -30,6 +30,13 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
// Define a compiler generic null pointer value
#if defined(BOOST_NO_NULLPTR)
#define BOOST_FOREACH_NULL 0
#else
#define BOOST_FOREACH_NULL nullptr
#endif
// Some compilers let us detect even const-qualified rvalues at compile-time
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|| defined(BOOST_MSVC) && !defined(_PREFAST_) \
@ -909,7 +916,7 @@ rderef(auto_any_t cur, type2type<T, C> *)
// A sneaky way to get the type of the collection without evaluating the expression
#define BOOST_FOREACH_TYPEOF(COL) \
(true ? 0 : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL)))
(true ? BOOST_FOREACH_NULL : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL)))
// returns true_* if the type is noncopyable
#define BOOST_FOREACH_IS_NONCOPYABLE(COL) \
@ -939,7 +946,7 @@ rderef(auto_any_t cur, type2type<T, C> *)
(COL)
# define BOOST_FOREACH_SHOULD_COPY(COL) \
(true ? 0 : boost::foreach_detail_::or_( \
(true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \
BOOST_FOREACH_IS_RVALUE(COL) \
, BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL)))
@ -962,11 +969,11 @@ rderef(auto_any_t cur, type2type<T, C> *)
// If the type happens to be a lightweight proxy, always make a copy.
# define BOOST_FOREACH_SHOULD_COPY(COL) \
(boost::foreach_detail_::should_copy_impl( \
true ? 0 : boost::foreach_detail_::or_( \
true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \
boost::foreach_detail_::is_array_(COL) \
, BOOST_FOREACH_IS_NONCOPYABLE(COL) \
, boost::foreach_detail_::not_(boost::foreach_detail_::is_const_(COL))) \
, true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \
, true ? BOOST_FOREACH_NULL : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \
, &BOOST_FOREACH_ID(_foreach_is_rvalue)))
#elif !defined(BOOST_FOREACH_NO_RVALUE_DETECTION)
@ -985,7 +992,7 @@ rderef(auto_any_t cur, type2type<T, C> *)
// Determine whether the collection expression is an lvalue or an rvalue.
// NOTE: this gets the answer wrong for const rvalues.
# define BOOST_FOREACH_SHOULD_COPY(COL) \
(true ? 0 : boost::foreach_detail_::or_( \
(true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \
boost::foreach_detail_::is_rvalue_((COL), 0) \
, BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL)))
@ -1004,7 +1011,7 @@ rderef(auto_any_t cur, type2type<T, C> *)
// Can't use rvalues with BOOST_FOREACH (unless they are lightweight proxies)
# define BOOST_FOREACH_SHOULD_COPY(COL) \
(true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))
(true ? BOOST_FOREACH_NULL : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))
#endif

View file

@ -4,6 +4,8 @@
#ifndef FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
# define FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
# include <boost/core/use_default.hpp>
# include <boost/iterator/iterator_categories.hpp>
# include <boost/mpl/or.hpp> // used in iterator_tag inheritance logic
@ -33,8 +35,7 @@
namespace boost {
namespace iterators {
// forward declaration
struct use_default;
using boost::use_default;
namespace detail {

View file

@ -9,6 +9,8 @@
#include <boost/static_assert.hpp>
#include <boost/core/use_default.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/detail/enable_if.hpp>
@ -35,12 +37,10 @@ namespace iterators {
// Used as a default template argument internally, merely to
// indicate "use the default", this can also be passed by users
// explicitly in order to specify that the default should be used.
struct use_default;
using boost::use_default;
} // namespace iterators
using iterators::use_default;
// the incompleteness of use_default causes massive problems for
// is_convertible (naturally). This workaround is fortunately not
// needed for vc6/vc7.

View file

@ -16,7 +16,7 @@
#include <boost/iterator/detail/enable_if.hpp>
#include <boost/static_assert.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/core/addressof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/add_const.hpp>

View file

@ -27,6 +27,9 @@
namespace boost {
namespace move_detail {
template<typename T>
struct voider { typedef void type; };
//////////////////////////////////////
// if_c
//////////////////////////////////////
@ -52,7 +55,9 @@ struct if_ : if_c<0 != T1::value, T2, T3>
//////////////////////////////////////
// enable_if_c
//////////////////////////////////////
template <bool B, class T = void>
struct enable_if_nat{};
template <bool B, class T = enable_if_nat>
struct enable_if_c
{
typedef T type;
@ -64,13 +69,13 @@ struct enable_if_c<false, T> {};
//////////////////////////////////////
// enable_if
//////////////////////////////////////
template <class Cond, class T = void>
template <class Cond, class T = enable_if_nat>
struct enable_if : enable_if_c<Cond::value, T> {};
//////////////////////////////////////
// disable_if_c
//////////////////////////////////////
template <bool B, class T = void>
template <bool B, class T = enable_if_nat>
struct disable_if_c
: enable_if_c<!B, T>
{};
@ -78,7 +83,7 @@ struct disable_if_c
//////////////////////////////////////
// disable_if
//////////////////////////////////////
template <class Cond, class T = void>
template <class Cond, class T = enable_if_nat>
struct disable_if : enable_if_c<!Cond::value, T> {};
//////////////////////////////////////
@ -117,13 +122,13 @@ struct is_same<T, T>
//////////////////////////////////////
// enable_if_same
//////////////////////////////////////
template <class T, class U, class R = void>
template <class T, class U, class R = enable_if_nat>
struct enable_if_same : enable_if<is_same<T, U>, R> {};
//////////////////////////////////////
// disable_if_same
//////////////////////////////////////
template <class T, class U, class R = void>
template <class T, class U, class R = enable_if_nat>
struct disable_if_same : disable_if<is_same<T, U>, R> {};
} //namespace move_detail {

View file

@ -46,7 +46,7 @@ struct if_c<false,T1,T2>
};
// agurt, 05/sep/04: nondescriptive parameter names for the sake of DigitalMars
// (and possibly MWCW < 8.0); see http://article.gmane.org/gmane.comp.lib.boost.devel/108959
// (and possibly MWCW < 8.0); see https://lists.boost.org/Archives/boost/2004/09/71383.php
template<
typename BOOST_MPL_AUX_NA_PARAM(T1)
, typename BOOST_MPL_AUX_NA_PARAM(T2)

View file

@ -0,0 +1,143 @@
/* Copyright 2003-2018 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
#define BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
#include <memory>
#else
#include <boost/detail/workaround.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <new>
#endif
namespace boost{
namespace multi_index{
namespace detail{
/* poor man's replacement of std::allocator_traits */
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
template<typename Allocator>
struct allocator_traits:std::allocator_traits<Allocator>
{
/* wrap std::allocator_traits alias templates for use in C++03 codebase */
typedef std::allocator_traits<Allocator> super;
template<typename T>
struct rebind_alloc
{
typedef typename super::template rebind_alloc<T> type;
};
template<typename T>
struct rebind_traits
{
typedef typename super::template rebind_traits<T> type;
};
};
#else
/* not a full std::allocator_traits rewrite (not needed) */
template<typename Allocator>
struct allocator_traits
{
typedef Allocator allocator_type;
typedef typename Allocator::value_type value_type;
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
/* [const_]void_pointer not provided as boost::pointer_traits's
* rebind_to has been seen to fail with things like
* boost::interprocess::offset_ptr in relatively old environments.
*/
typedef typename Allocator::difference_type difference_type;
typedef typename Allocator::size_type size_type;
template<typename T>
struct rebind_alloc
{
typedef typename Allocator::template rebind<T>::other type;
};
template<typename T>
struct rebind_traits
{
typedef allocator_traits<typename rebind_alloc<T>::type> type;
};
static pointer allocate(Allocator& a,size_type n){return a.allocate(n);}
static pointer allocate(Allocator& a,size_type n,const_pointer p)
/* should've been const_void_pointer p */
{return a.allocate(n,p);}
static void deallocate(Allocator& a,pointer p,size_type n)
{a.deallocate(p,n);}
template<typename T>
static void construct(Allocator&,T* p,const T& x)
{::new (static_cast<void*>(p)) T(x);}
template<typename T>
static void construct(Allocator&,T* p,BOOST_RV_REF(T) x)
{::new (static_cast<void*>(p)) T(boost::move(x));}
template<typename T,BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
static void construct(Allocator&,T* p,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
vartempl_placement_new(p,BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC issues spurious warnings about unreferencend formal parameters in
* destroy<T> when T is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename T>
static void destroy(Allocator&,T* p){p->~T();}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
static size_type max_size(Allocator& a)BOOST_NOEXCEPT{return a.max_size();}
};
#endif
template<typename Allocator,typename T>
struct rebind_alloc_for
{
typedef typename allocator_traits<Allocator>::
template rebind_alloc<T>::type type;
};
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif

View file

@ -15,8 +15,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/detail/allocator_utilities.hpp>
#include <boost/multi_index/detail/adl_swap.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/noncopyable.hpp>
#include <memory>
@ -45,34 +45,18 @@ namespace detail{
template<typename T,typename Allocator=std::allocator<T> >
struct auto_space:private noncopyable
{
typedef typename boost::detail::allocator::rebind_to<
Allocator,T
>::type allocator;
#ifdef BOOST_NO_CXX11_ALLOCATOR
typedef typename allocator::pointer pointer;
#else
typedef std::allocator_traits<allocator> traits;
typedef typename traits::pointer pointer;
#endif
typedef typename rebind_alloc_for<
Allocator,T>
::type allocator;
typedef allocator_traits<allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::size_type size_type;
explicit auto_space(const Allocator& al=Allocator(),std::size_t n=1):
al_(al),n_(n),
#ifdef BOOST_NO_CXX11_ALLOCATOR
data_(n_?al_.allocate(n_):pointer(0))
#else
data_(n_?traits::allocate(al_,n_):pointer(0))
#endif
explicit auto_space(const Allocator& al=Allocator(),size_type n=1):
al_(al),n_(n),data_(n_?alloc_traits::allocate(al_,n_):pointer(0))
{}
~auto_space()
{
if(n_)
#ifdef BOOST_NO_CXX11_ALLOCATOR
al_.deallocate(data_,n_);
#else
traits::deallocate(al_,data_,n_);
#endif
}
~auto_space(){if(n_)alloc_traits::deallocate(al_,data_,n_);}
Allocator get_allocator()const{return al_;}
@ -86,9 +70,9 @@ struct auto_space:private noncopyable
}
private:
allocator al_;
std::size_t n_;
pointer data_;
allocator al_;
size_type n_;
pointer data_;
};
template<typename T,typename Allocator>

Some files were not shown because too many files have changed in this diff Show more