Compare commits
1 Commits
release_30
...
svn-tags/l
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9789163feb |
159
CMakeLists.txt
159
CMakeLists.txt
@@ -1,159 +0,0 @@
|
||||
# See www/CMake.html for instructions on how to build libcxx with CMake.
|
||||
|
||||
#===============================================================================
|
||||
# Setup Project
|
||||
#===============================================================================
|
||||
|
||||
project(libcxx CXX C)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(PACKAGE_NAME libcxx)
|
||||
set(PACKAGE_VERSION trunk-svn)
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
|
||||
|
||||
# Add path for custom modules
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
|
||||
)
|
||||
|
||||
# Require out of source build.
|
||||
include(MacroEnsureOutOfSourceBuild)
|
||||
MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
|
||||
"${PROJECT_NAME} requires an out of source build. Please create a separate
|
||||
build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# Setup CMake Options
|
||||
#===============================================================================
|
||||
|
||||
# Define options.
|
||||
option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)
|
||||
option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)
|
||||
option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
|
||||
option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
|
||||
option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
|
||||
option(LIBCXX_ENABLE_CXX0X "Enable -std=c++0x and use of c++0x language features if the compiler supports it." ON)
|
||||
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
|
||||
|
||||
#===============================================================================
|
||||
# Configure System
|
||||
#===============================================================================
|
||||
|
||||
# Get triples.
|
||||
include(GetTriple)
|
||||
get_host_triple(LIBCXX_HOST_TRIPLE
|
||||
LIBCXX_HOST_ARCH
|
||||
LIBCXX_HOST_VENDOR
|
||||
LIBCXX_HOST_OS
|
||||
)
|
||||
set(LIBCXX_HOST_TRIPLE ${LIBCXX_HOST_TRIPLE} CACHE STRING "Host triple.")
|
||||
get_target_triple(LIBCXX_TARGET_TRIPLE
|
||||
LIBCXX_TARGET_ARCH
|
||||
LIBCXX_TARGET_VENDOR
|
||||
LIBCXX_TARGET_OS
|
||||
)
|
||||
set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.")
|
||||
|
||||
# Configure compiler.
|
||||
include(config-ix)
|
||||
|
||||
#===============================================================================
|
||||
# Setup Compiler Flags
|
||||
#===============================================================================
|
||||
|
||||
# Get required flags.
|
||||
# On all systems the system c++ standard library headers need to be excluded.
|
||||
if (MSVC)
|
||||
# MSVC only has -X, which disables all default includes; including the crt.
|
||||
# Thus, we do nothing and hope we don't accidentally include any of the C++
|
||||
# headers.
|
||||
else()
|
||||
if (LIBCXX_HAS_NOSTDINCXX_FLAG)
|
||||
set(LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++)
|
||||
endif()
|
||||
if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(append_if list condition var)
|
||||
if (${condition})
|
||||
list(APPEND ${list} ${var})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Get warning flags
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WALL_FLAG -Wall)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_W_FLAG -W)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WWRITE_STRINGS_FLAG -Wwrite-strings)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WNO_LONG_LONG_FLAG -Wno-long-long)
|
||||
if (LIBCXX_ENABLE_WERROR)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WERROR_FLAG -Werror)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WX_FLAG -WX)
|
||||
endif()
|
||||
if (LIBCXX_ENABLE_PEDANTIC)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_PEDANTIC_FLAG -pedantic)
|
||||
endif()
|
||||
|
||||
# Get feature flags.
|
||||
# Exceptions
|
||||
if (LIBCXX_ENABLE_EXCEPTIONS)
|
||||
# Catches C++ exceptions only and tells the compiler to assume that extern C
|
||||
# functions never throw a C++ exception.
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_EHSC_FLAG -EHsc)
|
||||
else()
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_LIBCPP_NO_EXCEPTIONS)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_NO_EHS_FLAG -EHs-)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_NO_EHA_FLAG -EHa-)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions)
|
||||
endif()
|
||||
# RTTI
|
||||
if (NOT LIBCXX_ENABLE_RTTI)
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_LIBCPP_NO_RTTI)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_NO_GR_FLAG -GR-)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_FNO_RTTI_FLAG -fno-rtti)
|
||||
endif()
|
||||
# Assert
|
||||
if (LLVM_ENABLE_ASSERTIONS)
|
||||
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
|
||||
if (NOT MSVC)
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_DEBUG)
|
||||
endif()
|
||||
# On Release builds cmake automatically defines NDEBUG, so we
|
||||
# explicitly undefine it:
|
||||
if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -UNDEBUG)
|
||||
endif()
|
||||
else()
|
||||
if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -DNDEBUG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This is the _ONLY_ place where add_definitions is called.
|
||||
add_definitions(
|
||||
${LIBCXX_CXX_REQUIRED_FLAGS}
|
||||
${LIBCXX_CXX_WARNING_FLAGS}
|
||||
${LIBCXX_CXX_FEATURE_FLAGS}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# Setup Source Code
|
||||
#===============================================================================
|
||||
|
||||
include_directories(include)
|
||||
|
||||
# Add source code. This also contains all of the logic for deciding linker flags
|
||||
# soname, etc...
|
||||
add_subdirectory(lib)
|
||||
|
||||
#===============================================================================
|
||||
# Setup Tests
|
||||
#===============================================================================
|
||||
|
||||
add_subdirectory(test)
|
34
CREDITS.TXT
34
CREDITS.TXT
@@ -1,34 +0,0 @@
|
||||
This file is a partial list of people who have contributed to the LLVM/libc++
|
||||
project. If you have contributed a patch or made some other contribution to
|
||||
LLVM/libc++, please submit a patch to this file to add yourself, and it will be
|
||||
done!
|
||||
|
||||
The list is sorted by surname and formatted to allow easy grepping and
|
||||
beautification by scripts. The fields are: name (N), email (E), web-address
|
||||
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
|
||||
(S).
|
||||
|
||||
N: Howard Hinnant
|
||||
E: hhinnant@apple.com
|
||||
D: Architect and primary author of libc++
|
||||
|
||||
N: Marshall Clow
|
||||
E: marshall@idio.com
|
||||
E: mclow@qualcomm.com
|
||||
D: Minor patches and bug fixes.
|
||||
|
||||
N: Bjorn Reese
|
||||
E: breese@users.sourceforge.net
|
||||
D: Initial regex prototype
|
||||
|
||||
N: David Chisnall
|
||||
E: theraven at theravensnest dot org
|
||||
D: FreeBSD port and libcxxrt support.
|
||||
|
||||
N: Ruben Van Boxem
|
||||
E: vanboxem dot ruben at gmail dot com
|
||||
D: Initial Windows patches.
|
||||
|
||||
N: Arvid Picciani
|
||||
E: aep at exys dot org
|
||||
D: Minor patches and musl port.
|
46
LICENSE.TXT
46
LICENSE.TXT
@@ -1,21 +1,10 @@
|
||||
==============================================================================
|
||||
libc++ License
|
||||
LLVM Release License
|
||||
==============================================================================
|
||||
|
||||
The libc++ library is dual licensed under both the University of Illinois
|
||||
"BSD-Like" license and the MIT license. As a user of this code you may choose
|
||||
to use it under either license. As a contributor, you agree to allow your code
|
||||
to be used under both.
|
||||
|
||||
Full text of the relevant licenses is included below.
|
||||
|
||||
==============================================================================
|
||||
|
||||
University of Illinois/NCSA
|
||||
Open Source License
|
||||
|
||||
Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
|
||||
|
||||
Copyright (c) 2007-2010 University of Illinois at Urbana-Champaign.
|
||||
All rights reserved.
|
||||
|
||||
Developed by:
|
||||
@@ -54,23 +43,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
||||
SOFTWARE.
|
||||
|
||||
==============================================================================
|
||||
The LLVM software contains code written by third parties. Such software will
|
||||
have its own individual LICENSE.TXT file in the directory in which it appears.
|
||||
This file will describe the copyrights, license, and restrictions which apply
|
||||
to that code.
|
||||
|
||||
Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
|
||||
The disclaimer of warranty in the University of Illinois Open Source License
|
||||
applies to all code in the LLVM Distribution, and nothing in any of the
|
||||
other licenses gives permission to use the names of the LLVM Team or the
|
||||
University of Illinois to endorse or promote products derived from this
|
||||
Software.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
The following pieces of software have additional or alternate copyrights,
|
||||
licenses, and/or restrictions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
Program Directory
|
||||
------- ---------
|
||||
<none yet>
|
||||
|
52
Makefile
52
Makefile
@@ -9,19 +9,10 @@ OBJROOT=.
|
||||
SYMROOT=.
|
||||
export TRIPLE=-apple-
|
||||
|
||||
ifeq (,$(RC_INDIGO))
|
||||
INSTALL_PREFIX=""
|
||||
else
|
||||
INSTALL_PREFIX="$(SDKROOT)"
|
||||
endif
|
||||
|
||||
help::
|
||||
echo Use make install DSTROOT=<destination>
|
||||
|
||||
installsrc:: $(SRCROOT)
|
||||
|
||||
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
||||
ditto $(SRCDIRS)/lib $(SRCROOT)/lib
|
||||
ditto $(SRCDIRS)/lib/buildit $(SRCROOT)/lib/buildit
|
||||
ditto $(SRCDIRS)/src $(SRCROOT)/src
|
||||
ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile
|
||||
|
||||
@@ -29,40 +20,19 @@ clean::
|
||||
|
||||
installhdrs::
|
||||
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext/*
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext/*
|
||||
mkdir -p $(DSTROOT)/usr/include/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/usr/include/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/usr/include
|
||||
chmod 755 $(DSTROOT)/usr/include/c++/v1
|
||||
chmod 644 $(DSTROOT)/usr/include/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/usr/include/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/usr/include/c++/v1/ext/*
|
||||
|
||||
install:: installhdrs $(DESTDIR)
|
||||
|
||||
cd lib && ./buildit
|
||||
ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib
|
||||
strip -S -o $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib && ln -s libc++.1.dylib libc++.dylib
|
||||
mkdir -p $(DSTROOT)/usr/lib
|
||||
strip -S -o $(DSTROOT)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd $(DSTROOT)/usr/lib && ln -s libc++.1.dylib libc++.dylib
|
||||
|
@@ -1,53 +0,0 @@
|
||||
# Define functions to get the host and target triple.
|
||||
|
||||
function(get_host_triple out out_arch out_vendor out_os)
|
||||
# Get the architecture.
|
||||
set(arch ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
if (arch STREQUAL "x86")
|
||||
set(arch "i686")
|
||||
endif()
|
||||
# Get the vendor.
|
||||
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
set(vendor "apple")
|
||||
else()
|
||||
set(vendor "pc")
|
||||
endif()
|
||||
# Get os.
|
||||
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
|
||||
set(os "win32")
|
||||
else()
|
||||
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} os)
|
||||
endif()
|
||||
set(triple "${arch}-${vendor}-${os}")
|
||||
set(${out} ${triple} PARENT_SCOPE)
|
||||
set(${out_arch} ${arch} PARENT_SCOPE)
|
||||
set(${out_vendor} ${vendor} PARENT_SCOPE)
|
||||
set(${out_os} ${os} PARENT_SCOPE)
|
||||
message(STATUS "Host triple: ${triple}")
|
||||
endfunction()
|
||||
|
||||
function(get_target_triple out out_arch out_vendor out_os)
|
||||
# Get the architecture.
|
||||
set(arch ${CMAKE_SYSTEM_PROCESSOR})
|
||||
if (arch STREQUAL "x86")
|
||||
set(arch "i686")
|
||||
endif()
|
||||
# Get the vendor.
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
set(vendor "apple")
|
||||
else()
|
||||
set(vendor "pc")
|
||||
endif()
|
||||
# Get os.
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
set(os "win32")
|
||||
else()
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} os)
|
||||
endif()
|
||||
set(triple "${arch}-${vendor}-${os}")
|
||||
set(${out} ${triple} PARENT_SCOPE)
|
||||
set(${out_arch} ${arch} PARENT_SCOPE)
|
||||
set(${out_vendor} ${vendor} PARENT_SCOPE)
|
||||
set(${out_os} ${os} PARENT_SCOPE)
|
||||
message(STATUS "Target triple: ${triple}")
|
||||
endfunction()
|
@@ -1,18 +0,0 @@
|
||||
# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
|
||||
|
||||
macro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )
|
||||
|
||||
string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
|
||||
if( _insource )
|
||||
message( SEND_ERROR "${_errorMessage}" )
|
||||
message( FATAL_ERROR
|
||||
"In-source builds are not allowed.
|
||||
CMake would overwrite the makefiles distributed with Compiler-RT.
|
||||
Please create a directory and run cmake from there, passing the path
|
||||
to this source directory as the last argument.
|
||||
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
|
||||
Please delete them."
|
||||
)
|
||||
endif( _insource )
|
||||
|
||||
endmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )
|
@@ -1,38 +0,0 @@
|
||||
include(CheckLibraryExists)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# Check compiler flags
|
||||
check_cxx_compiler_flag(-std=c++0x LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
check_cxx_compiler_flag(-fPIC LIBCXX_HAS_FPIC_FLAG)
|
||||
check_cxx_compiler_flag(-nodefaultlibs LIBCXX_HAS_NODEFAULTLIBS_FLAG)
|
||||
check_cxx_compiler_flag(-nostdinc++ LIBCXX_HAS_NOSTDINCXX_FLAG)
|
||||
check_cxx_compiler_flag(-Wall LIBCXX_HAS_WALL_FLAG)
|
||||
check_cxx_compiler_flag(-W LIBCXX_HAS_W_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-unused-parameter LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG)
|
||||
check_cxx_compiler_flag(-Wwrite-strings LIBCXX_HAS_WWRITE_STRINGS_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-long-long LIBCXX_HAS_WNO_LONG_LONG_FLAG)
|
||||
check_cxx_compiler_flag(-pedantic LIBCXX_HAS_PEDANTIC_FLAG)
|
||||
check_cxx_compiler_flag(-Werror LIBCXX_HAS_WERROR_FLAG)
|
||||
check_cxx_compiler_flag(-fno-exceptions LIBCXX_HAS_FNO_EXCEPTIONS_FLAG)
|
||||
check_cxx_compiler_flag(-fno-rtti LIBCXX_HAS_FNO_RTTI_FLAG)
|
||||
check_cxx_compiler_flag(/WX LIBCXX_HAS_WX_FLAG)
|
||||
check_cxx_compiler_flag(/EHsc LIBCXX_HAS_EHSC_FLAG)
|
||||
check_cxx_compiler_flag(/EHs- LIBCXX_HAS_NO_EHS_FLAG)
|
||||
check_cxx_compiler_flag(/EHa- LIBCXX_HAS_NO_EHA_FLAG)
|
||||
check_cxx_compiler_flag(/GR- LIBCXX_HAS_NO_GR_FLAG)
|
||||
|
||||
# Check libraries
|
||||
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
|
||||
check_library_exists(c printf "" LIBCXX_HAS_C_LIB)
|
||||
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
|
||||
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
|
||||
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
|
||||
|
||||
# Check C++0x features
|
||||
if (LIBCXX_ENABLE_CXX0X)
|
||||
if (LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -std=c++0x)
|
||||
endif()
|
||||
else()
|
||||
set(LIBCXX_HAS_STDCXX0X_FLAG FALSE)
|
||||
endif()
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -21,13 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
template <class _C, bool _IsConst> class __bit_iterator;
|
||||
template <class _C> class __bit_const_reference;
|
||||
|
||||
template <class _Tp>
|
||||
struct __has_storage_type
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template <class _C, bool = __has_storage_type<_C>::value>
|
||||
template <class _C>
|
||||
class __bit_reference
|
||||
{
|
||||
typedef typename _C::__storage_type __storage_type;
|
||||
@@ -44,13 +38,11 @@ class __bit_reference
|
||||
friend class __bit_const_reference<_C>;
|
||||
friend class __bit_iterator<_C, false>;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
|
||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT
|
||||
{return !static_cast<bool>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator ~() const {return !static_cast<bool>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference& operator=(bool __x) _NOEXCEPT
|
||||
__bit_reference& operator=(bool __x)
|
||||
{
|
||||
if (__x)
|
||||
*__seg_ |= __mask_;
|
||||
@@ -60,27 +52,20 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT
|
||||
{return operator=(static_cast<bool>(__x));}
|
||||
__bit_reference& operator=(const __bit_reference& __x) {return operator=(static_cast<bool>(__x));}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() {*__seg_ ^= __mask_;}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const
|
||||
{return __bit_iterator<_C, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
};
|
||||
|
||||
template <class _C>
|
||||
class __bit_reference<_C, false>
|
||||
{
|
||||
__bit_reference(__storage_pointer __s, __storage_type __m) : __seg_(__s), __mask_(__m) {}
|
||||
};
|
||||
|
||||
template <class _C, class _D>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT
|
||||
swap(__bit_reference<_C> __x, __bit_reference<_D> __y)
|
||||
{
|
||||
bool __t = __x;
|
||||
__x = __y;
|
||||
@@ -90,7 +75,7 @@ swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT
|
||||
template <class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT
|
||||
swap(__bit_reference<_C> __x, bool& __y)
|
||||
{
|
||||
bool __t = __x;
|
||||
__x = __y;
|
||||
@@ -100,7 +85,7 @@ swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT
|
||||
template <class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT
|
||||
swap(bool& __x, __bit_reference<_C> __y)
|
||||
{
|
||||
bool __t = __x;
|
||||
__x = __y;
|
||||
@@ -124,18 +109,16 @@ class __bit_const_reference
|
||||
friend class __bit_iterator<_C, true>;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_const_reference(const __bit_reference<_C>& __x) _NOEXCEPT
|
||||
__bit_const_reference(const __bit_reference<_C>& __x)
|
||||
: __seg_(__x.__seg_), __mask_(__x.__mask_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
|
||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return static_cast<bool>(*__seg_ & __mask_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const
|
||||
{return __bit_iterator<_C, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||
: __seg_(__s), __mask_(__m) {}
|
||||
__bit_const_reference(__storage_pointer __s, __storage_type __m) : __seg_(__s), __mask_(__m) {}
|
||||
|
||||
__bit_const_reference& operator=(const __bit_const_reference& __x);
|
||||
};
|
||||
@@ -153,25 +136,25 @@ __find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
// do middle whole words
|
||||
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
||||
if (*__first.__seg_)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(*__first.__seg_)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(*__first.__seg_)));
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
}
|
||||
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
||||
}
|
||||
@@ -187,11 +170,11 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = ~(*__first.__seg_ & __m);
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
@@ -200,7 +183,7 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
{
|
||||
__storage_type __b = ~*__first.__seg_;
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
}
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
@@ -208,7 +191,7 @@ __find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = ~(*__first.__seg_ & __m);
|
||||
if (__b)
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||
return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
|
||||
}
|
||||
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
||||
}
|
||||
@@ -238,20 +221,20 @@ __count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__r = _VSTD::__pop_count(*__first.__seg_ & __m);
|
||||
__r = _STD::__pop_count(*__first.__seg_ & __m);
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
// do middle whole words
|
||||
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
||||
__r += _VSTD::__pop_count(*__first.__seg_);
|
||||
__r += _STD::__pop_count(*__first.__seg_);
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__r += _VSTD::__pop_count(*__first.__seg_ & __m);
|
||||
__r += _STD::__pop_count(*__first.__seg_ & __m);
|
||||
}
|
||||
return __r;
|
||||
}
|
||||
@@ -269,20 +252,20 @@ __count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__r = _VSTD::__pop_count(~(*__first.__seg_ & __m));
|
||||
__r = _STD::__pop_count(~(*__first.__seg_ & __m));
|
||||
__n -= __dn;
|
||||
++__first.__seg_;
|
||||
}
|
||||
// do middle whole words
|
||||
for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
|
||||
__r += _VSTD::__pop_count(~*__first.__seg_);
|
||||
__r += _STD::__pop_count(~*__first.__seg_);
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__r += _VSTD::__pop_count(~(*__first.__seg_ & __m));
|
||||
__r += _STD::__pop_count(~(*__first.__seg_ & __m));
|
||||
}
|
||||
return __r;
|
||||
}
|
||||
@@ -310,7 +293,7 @@ __fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
*__first.__seg_ &= ~__m;
|
||||
__n -= __dn;
|
||||
@@ -318,7 +301,7 @@ __fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
}
|
||||
// do middle whole words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
|
||||
_STD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
@@ -340,7 +323,7 @@ __fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||
__storage_type __dn = _STD::min(__clz_f, __n);
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
*__first.__seg_ |= __m;
|
||||
__n -= __dn;
|
||||
@@ -348,7 +331,7 @@ __fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
|
||||
}
|
||||
// do middle whole words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
|
||||
_STD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last partial word
|
||||
if (__n > 0)
|
||||
@@ -380,7 +363,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
fill(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, bool __value)
|
||||
{
|
||||
_VSTD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value);
|
||||
_STD::fill_n(__first, static_cast<typename _C::size_type>(__last - __first), __value);
|
||||
}
|
||||
|
||||
// copy
|
||||
@@ -401,7 +384,7 @@ __copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
@@ -415,7 +398,7 @@ __copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst
|
||||
// __first.__ctz_ == 0;
|
||||
// do middle words
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
_VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
|
||||
_STD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
__result.__seg_ += __nw;
|
||||
// do last word
|
||||
@@ -448,12 +431,12 @@ __copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsCon
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz_f = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
|
||||
__storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
||||
*__result.__seg_ &= ~__m;
|
||||
if (__result.__ctz_ > __first.__ctz_)
|
||||
@@ -491,7 +474,7 @@ __copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsCon
|
||||
{
|
||||
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = *__first.__seg_ & __m;
|
||||
__storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__storage_type __dn = _STD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
||||
*__result.__seg_ &= ~__m;
|
||||
*__result.__seg_ |= __b << __result.__ctz_;
|
||||
@@ -537,7 +520,7 @@ __copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C,
|
||||
// do first word
|
||||
if (__last.__ctz_ != 0)
|
||||
{
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
__n -= __dn;
|
||||
unsigned __clz = __bits_per_word - __last.__ctz_;
|
||||
__storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz);
|
||||
@@ -554,7 +537,7 @@ __copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C,
|
||||
__storage_type __nw = __n / __bits_per_word;
|
||||
__result.__seg_ -= __nw;
|
||||
__last.__seg_ -= __nw;
|
||||
_VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
|
||||
_STD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
|
||||
__n -= __nw * __bits_per_word;
|
||||
// do last word
|
||||
if (__n > 0)
|
||||
@@ -584,13 +567,13 @@ __copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_
|
||||
// do first word
|
||||
if (__last.__ctz_ != 0)
|
||||
{
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__last.__ctz_), __n);
|
||||
__n -= __dn;
|
||||
unsigned __clz_l = __bits_per_word - __last.__ctz_;
|
||||
__storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l);
|
||||
__storage_type __b = *__last.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min(__dn, static_cast<difference_type>(__result.__ctz_));
|
||||
__storage_type __ddn = _STD::min(__dn, static_cast<difference_type>(__result.__ctz_));
|
||||
if (__ddn > 0)
|
||||
{
|
||||
__m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r);
|
||||
@@ -634,7 +617,7 @@ __copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_
|
||||
__m = ~__storage_type(0) << (__bits_per_word - __n);
|
||||
__storage_type __b = *--__last.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__result.__ctz_));
|
||||
__storage_type __dn = _STD::min(__n, static_cast<difference_type>(__result.__ctz_));
|
||||
__m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r);
|
||||
*__result.__seg_ &= ~__m;
|
||||
*__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_);
|
||||
@@ -672,7 +655,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator<_C, false>
|
||||
move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result)
|
||||
{
|
||||
return _VSTD::copy(__first, __last, __result);
|
||||
return _STD::copy(__first, __last, __result);
|
||||
}
|
||||
|
||||
// move_backward
|
||||
@@ -682,17 +665,17 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator<_C, false>
|
||||
move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result)
|
||||
{
|
||||
return _VSTD::copy(__first, __last, __result);
|
||||
return _STD::copy(__first, __last, __result);
|
||||
}
|
||||
|
||||
// swap_ranges
|
||||
|
||||
template <class __C1, class __C2>
|
||||
__bit_iterator<__C2, false>
|
||||
__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
||||
__bit_iterator<__C2, false> __result)
|
||||
template <class _C1, class _C2>
|
||||
__bit_iterator<_C2, false>
|
||||
__swap_ranges_aligned(__bit_iterator<_C1, false> __first, __bit_iterator<_C1, false> __last,
|
||||
__bit_iterator<_C2, false> __result)
|
||||
{
|
||||
typedef __bit_iterator<__C1, false> _I1;
|
||||
typedef __bit_iterator<_C1, false> _I1;
|
||||
typedef typename _I1::difference_type difference_type;
|
||||
typedef typename _I1::__storage_type __storage_type;
|
||||
static const unsigned __bits_per_word = _I1::__bits_per_word;
|
||||
@@ -703,7 +686,7 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
||||
__storage_type __b1 = *__first.__seg_ & __m;
|
||||
@@ -737,12 +720,12 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <class __C1, class __C2>
|
||||
__bit_iterator<__C2, false>
|
||||
__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last,
|
||||
__bit_iterator<__C2, false> __result)
|
||||
template <class _C1, class _C2>
|
||||
__bit_iterator<_C2, false>
|
||||
__swap_ranges_unaligned(__bit_iterator<_C1, false> __first, __bit_iterator<_C1, false> __last,
|
||||
__bit_iterator<_C2, false> __result)
|
||||
{
|
||||
typedef __bit_iterator<__C1, false> _I1;
|
||||
typedef __bit_iterator<_C1, false> _I1;
|
||||
typedef typename _I1::difference_type difference_type;
|
||||
typedef typename _I1::__storage_type __storage_type;
|
||||
static const unsigned __bits_per_word = _I1::__bits_per_word;
|
||||
@@ -753,13 +736,13 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
|
||||
if (__first.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz_f = __bits_per_word - __first.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b1 = *__first.__seg_ & __m;
|
||||
*__first.__seg_ &= ~__m;
|
||||
unsigned __clz_r = __bits_per_word - __result.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
|
||||
__storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
||||
__storage_type __b2 = *__result.__seg_ & __m;
|
||||
*__result.__seg_ &= ~__m;
|
||||
@@ -814,7 +797,7 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
|
||||
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b1 = *__first.__seg_ & __m;
|
||||
*__first.__seg_ &= ~__m;
|
||||
__storage_type __dn = _VSTD::min<__storage_type>(__n, __clz_r);
|
||||
__storage_type __dn = _STD::min<__storage_type>(__n, __clz_r);
|
||||
__m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
||||
__storage_type __b2 = *__result.__seg_ & __m;
|
||||
*__result.__seg_ &= ~__m;
|
||||
@@ -837,11 +820,11 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <class __C1, class __C2>
|
||||
template <class _C1, class _C2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator<__C2, false>
|
||||
swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1,
|
||||
__bit_iterator<__C2, false> __first2)
|
||||
__bit_iterator<_C2, false>
|
||||
swap_ranges(__bit_iterator<_C1, false> __first1, __bit_iterator<_C1, false> __last1,
|
||||
__bit_iterator<_C2, false> __first2)
|
||||
{
|
||||
if (__first1.__ctz_ == __first2.__ctz_)
|
||||
return __swap_ranges_aligned(__first1, __last1, __first2);
|
||||
@@ -888,13 +871,13 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __
|
||||
if (__d1 <= __bit_array<_C>::capacity())
|
||||
{
|
||||
__bit_array<_C> __b(__d1);
|
||||
_VSTD::copy(__first, __middle, __b.begin());
|
||||
_VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first));
|
||||
_STD::copy(__first, __middle, __b.begin());
|
||||
_STD::copy(__b.begin(), __b.end(), _STD::copy(__middle, __last, __first));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
__bit_iterator<_C, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle);
|
||||
__bit_iterator<_C, false> __mp = _STD::swap_ranges(__first, __middle, __middle);
|
||||
__first = __middle;
|
||||
__middle = __mp;
|
||||
__d2 -= __d1;
|
||||
@@ -905,14 +888,14 @@ rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __
|
||||
if (__d2 <= __bit_array<_C>::capacity())
|
||||
{
|
||||
__bit_array<_C> __b(__d2);
|
||||
_VSTD::copy(__middle, __last, __b.begin());
|
||||
_VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last));
|
||||
_STD::copy(__middle, __last, __b.begin());
|
||||
_STD::copy_backward(__b.begin(), __b.end(), _STD::copy_backward(__first, __middle, __last));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
__bit_iterator<_C, false> __mp = __first + __d2;
|
||||
_VSTD::swap_ranges(__first, __mp, __middle);
|
||||
_STD::swap_ranges(__first, __mp, __middle);
|
||||
__first = __mp;
|
||||
__d1 -= __d2;
|
||||
}
|
||||
@@ -939,12 +922,12 @@ __equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __
|
||||
if (__first1.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz_f = __bits_per_word - __first1.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz_f), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||
__storage_type __b = *__first1.__seg_ & __m;
|
||||
unsigned __clz_r = __bits_per_word - __first2.__ctz_;
|
||||
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
|
||||
__storage_type __ddn = _STD::min<__storage_type>(__dn, __clz_r);
|
||||
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
|
||||
if (__first2.__ctz_ > __first1.__ctz_)
|
||||
if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_)))
|
||||
@@ -983,7 +966,7 @@ __equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __
|
||||
{
|
||||
__m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||
__storage_type __b = *__first1.__seg_ & __m;
|
||||
__storage_type __dn = _VSTD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__storage_type __dn = _STD::min(__n, static_cast<difference_type>(__clz_r));
|
||||
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
|
||||
if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_))
|
||||
return false;
|
||||
@@ -1017,7 +1000,7 @@ __equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __la
|
||||
if (__first1.__ctz_ != 0)
|
||||
{
|
||||
unsigned __clz = __bits_per_word - __first1.__ctz_;
|
||||
difference_type __dn = _VSTD::min(static_cast<difference_type>(__clz), __n);
|
||||
difference_type __dn = _STD::min(static_cast<difference_type>(__clz), __n);
|
||||
__n -= __dn;
|
||||
__storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
|
||||
if ((*__first2.__seg_ & __m) != (*__first1.__seg_ & __m))
|
||||
@@ -1045,7 +1028,6 @@ __equal_aligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __la
|
||||
}
|
||||
|
||||
template <class _C, bool _IC1, bool _IC2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
equal(__bit_iterator<_C, _IC1> __first1, __bit_iterator<_C, _IC1> __last1, __bit_iterator<_C, _IC2> __first2)
|
||||
{
|
||||
@@ -1074,14 +1056,12 @@ private:
|
||||
unsigned __ctz_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator(const __bit_iterator<_C, false>& __it) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator(const __bit_iterator<_C, false>& __it)
|
||||
: __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
|
||||
{return reference(__seg_, __storage_type(1) << __ctz_);}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return reference(__seg_, __storage_type(1) << __ctz_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator& operator++()
|
||||
{
|
||||
@@ -1181,8 +1161,7 @@ public:
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
|
||||
: __seg_(__s), __ctz_(__ctz) {}
|
||||
__bit_iterator(__storage_pointer __s, unsigned __ctz) : __seg_(__s), __ctz_(__ctz) {}
|
||||
|
||||
#if defined(__clang__)
|
||||
friend typename _C::__self;
|
||||
@@ -1213,15 +1192,15 @@ private:
|
||||
template <class _D, bool _IC> friend __bit_iterator<_D, false> copy_backward(__bit_iterator<_D, _IC> __first,
|
||||
__bit_iterator<_D, _IC> __last,
|
||||
__bit_iterator<_D, false> __result);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> __swap_ranges_unaligned(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class __C1, class __C2>friend __bit_iterator<__C2, false> swap_ranges(__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C1, false>,
|
||||
__bit_iterator<__C2, false>);
|
||||
template <class _C1, class _C2>friend __bit_iterator<_C2, false> __swap_ranges_aligned(__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C2, false>);
|
||||
template <class _C1, class _C2>friend __bit_iterator<_C2, false> __swap_ranges_unaligned(__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C2, false>);
|
||||
template <class _C1, class _C2>friend __bit_iterator<_C2, false> swap_ranges(__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C1, false>,
|
||||
__bit_iterator<_C2, false>);
|
||||
template <class _D> friend __bit_iterator<_D, false> rotate(__bit_iterator<_D, false>,
|
||||
__bit_iterator<_D, false>,
|
||||
__bit_iterator<_D, false>);
|
||||
|
187
include/__config
187
include/__config
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#define _LIBCPP_VERSION 1001
|
||||
#define _LIBCPP_VERSION 1000
|
||||
|
||||
#define _LIBCPP_ABI_VERSION 1
|
||||
|
||||
@@ -47,15 +47,6 @@
|
||||
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#endif // __FreeBSD__
|
||||
|
||||
#ifdef _WIN32
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
// Compiler intrinsics (GCC or MSVC)
|
||||
# if (defined(_MSC_VER) && _MSC_VER >= 1400) || (__GNUC__ >= 4 && __GNUC_MINOR__ > 3)
|
||||
# define _LIBCP_HAS_IS_BASE_OF
|
||||
# endif
|
||||
#endif // _WIN32
|
||||
|
||||
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
@@ -91,23 +82,10 @@
|
||||
|
||||
#define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__))
|
||||
|
||||
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
|
||||
#define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__))
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
#if !__has_feature(cxx_alias_templates)
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
#endif
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
#ifdef __linux__
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#else
|
||||
typedef __char16_t char16_t;
|
||||
typedef __char32_t char32_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_exceptions))
|
||||
#define _LIBCPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
@@ -116,112 +94,56 @@ typedef __char32_t char32_t;
|
||||
#define _LIBCPP_NO_RTTI
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#define _LIBCPP_HAS_NO_STRONG_USING
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#define _LIBCPP_HAS_NO_DECLTYPE
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_NULLPTR
|
||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#else // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#if __has_feature(cxx_rvalue_references)
|
||||
#define _LIBCPP_MOVE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_decltype))
|
||||
#define _LIBCPP_HAS_NO_DECLTYPE
|
||||
#endif
|
||||
|
||||
#if __has_feature(cxx_attributes)
|
||||
# define _ATTRIBUTE(x) [[x]]
|
||||
#else
|
||||
# define _ATTRIBUTE(x) __attribute__ ((x))
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
|
||||
#if !(__has_feature(cxx_deleted_functions))
|
||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#endif // !(__has_feature(cxx_deleted_functions))
|
||||
|
||||
#if !(__has_feature(cxx_lambdas))
|
||||
#define _LIBCPP_HAS_NO_LAMBDAS
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_nullptr))
|
||||
#define _LIBCPP_HAS_NO_NULLPTR
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_rvalue_references))
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_static_assert))
|
||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_auto_type))
|
||||
#define _LIBCPP_HAS_NO_AUTO_TYPE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_variadic_templates))
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_trailing_return))
|
||||
#define _LIBCPP_HAS_NO_TRAILING_RETURN
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_generalized_initializers))
|
||||
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif
|
||||
|
||||
#if __has_feature(is_base_of)
|
||||
# define _LIBCP_HAS_IS_BASE_OF
|
||||
#endif
|
||||
|
||||
// Objective-C++ features (opt-in)
|
||||
#if __has_feature(objc_arc)
|
||||
#define _LIBCPP_HAS_OBJC_ARC
|
||||
#endif
|
||||
|
||||
#if __has_feature(objc_arc_weak)
|
||||
#define _LIBCPP_HAS_OBJC_ARC_WEAK
|
||||
#endif
|
||||
|
||||
// Inline namespaces are available in Clang regardless of C++ dialect.
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
|
||||
#define _LIBCPP_END_NAMESPACE_STD } }
|
||||
#define _VSTD std::_LIBCPP_NAMESPACE
|
||||
|
||||
namespace std {
|
||||
inline namespace _LIBCPP_NAMESPACE {
|
||||
}
|
||||
}
|
||||
|
||||
#if !(__has_feature(cxx_constexpr))
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if (__has_feature(cxx_noexcept))
|
||||
# define _NOEXCEPT noexcept
|
||||
# define _NOEXCEPT_(x) noexcept(x)
|
||||
#else
|
||||
# define _NOEXCEPT throw()
|
||||
# define _NOEXCEPT_(x)
|
||||
#endif
|
||||
|
||||
#if __has_feature(underlying_type)
|
||||
# define _LIBCXX_UNDERLYING_TYPE(T) __underlying_type(T)
|
||||
#endif
|
||||
|
||||
// end defined(__clang__)
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
#define _ATTRIBUTE(x) __attribute__((x))
|
||||
|
||||
#if !__EXCEPTIONS
|
||||
#define _LIBCPP_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
|
||||
#define _NOEXCEPT throw()
|
||||
#define _NOEXCEPT_(x)
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
@@ -233,16 +155,11 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
|
||||
#else // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#define _LIBCPP_HAS_NO_TRAILING_RETURN
|
||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
|
||||
#define _LIBCPP_MOVE
|
||||
#endif
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
||||
@@ -256,7 +173,6 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
|
||||
@@ -265,9 +181,16 @@ namespace std {
|
||||
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#endif // defined(__GNUC__)
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_STRONG_USING
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
|
||||
#define _LIBCPP_END_NAMESPACE_STD }
|
||||
#define _STD std
|
||||
#else // _LIBCPP_HAS_NO_STRONG_USING
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
|
||||
#define _LIBCPP_END_NAMESPACE_STD } }
|
||||
#define _VSTD std::_LIBCPP_NAMESPACE
|
||||
#define _STD std::_LIBCPP_NAMESPACE
|
||||
|
||||
namespace std {
|
||||
namespace _LIBCPP_NAMESPACE {
|
||||
@@ -275,7 +198,7 @@ namespace _LIBCPP_NAMESPACE {
|
||||
using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
|
||||
}
|
||||
|
||||
#endif // defined(__GNUC__)
|
||||
#endif // _LIBCPP_HAS_NO_STRONG_USING
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
typedef unsigned short char16_t;
|
||||
@@ -297,40 +220,4 @@ template <unsigned> struct __static_assert_check {};
|
||||
#define decltype(x) __typeof__(x)
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||
#define constexpr const
|
||||
#endif
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(__x) 0
|
||||
#endif
|
||||
|
||||
#if __APPLE__ || __FreeBSD__ || _WIN32
|
||||
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
|
||||
#endif
|
||||
|
||||
#if __APPLE__ || __FreeBSD__
|
||||
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||
#endif
|
||||
|
||||
#if __APPLE__ || __FreeBSD__
|
||||
#define _LIBCPP_WCTYPE_IS_MASK
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_DEBUG2
|
||||
# if _LIBCPP_DEBUG2 == 0
|
||||
# define _LIBCPP_DEBUG_LEVEL 1
|
||||
# elif _LIBCPP_DEBUG2 == 1
|
||||
# define _LIBCPP_DEBUG_LEVEL 2
|
||||
# else
|
||||
# error Supported values for _LIBCPP_DEBUG2 are 0 and 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_DEBUG2
|
||||
# include <__debug>
|
||||
#else
|
||||
# define _LIBCPP_ASSERT(x, m) ((void)0)
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CONFIG
|
||||
|
191
include/__debug
191
include/__debug
@@ -1,191 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===--------------------------- __debug ----------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_DEBUG_H
|
||||
#define _LIBCPP_DEBUG_H
|
||||
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
|
||||
# include <cstdlib>
|
||||
# include <cstdio>
|
||||
# include <cstddef>
|
||||
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
|
||||
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
struct _LIBCPP_VISIBLE __c_node;
|
||||
|
||||
struct _LIBCPP_VISIBLE __i_node
|
||||
{
|
||||
void* __i_;
|
||||
__i_node* __next_;
|
||||
__c_node* __c_;
|
||||
|
||||
__i_node(const __i_node&) = delete;
|
||||
__i_node& operator=(const __i_node&) = delete;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__i_node(void* __i, __i_node* __next, __c_node* __c)
|
||||
: __i_(__i), __next_(__next), __c_(__c) {}
|
||||
~__i_node();
|
||||
};
|
||||
|
||||
struct _LIBCPP_VISIBLE __c_node
|
||||
{
|
||||
void* __c_;
|
||||
__c_node* __next_;
|
||||
__i_node** beg_;
|
||||
__i_node** end_;
|
||||
__i_node** cap_;
|
||||
|
||||
__c_node(const __c_node&) = delete;
|
||||
__c_node& operator=(const __c_node&) = delete;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__c_node(void* __c, __c_node* __next)
|
||||
: __c_(__c), __next_(__next), beg_(nullptr), end_(nullptr), cap_(nullptr) {}
|
||||
virtual ~__c_node();
|
||||
|
||||
virtual bool __dereferenceable(const void*) const = 0;
|
||||
virtual bool __decrementable(const void*) const = 0;
|
||||
virtual bool __addable(const void*, ptrdiff_t) const = 0;
|
||||
virtual bool __subscriptable(const void*, ptrdiff_t) const = 0;
|
||||
|
||||
void __add(__i_node* __i);
|
||||
_LIBCPP_HIDDEN void __remove(__i_node* __i);
|
||||
};
|
||||
|
||||
template <class _Cont>
|
||||
struct _C_node
|
||||
: public __c_node
|
||||
{
|
||||
_C_node(void* __c, __c_node* __n)
|
||||
: __c_node(__c, __n) {}
|
||||
|
||||
virtual bool __dereferenceable(const void*) const;
|
||||
virtual bool __decrementable(const void*) const;
|
||||
virtual bool __addable(const void*, ptrdiff_t) const;
|
||||
virtual bool __subscriptable(const void*, ptrdiff_t) const;
|
||||
};
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__dereferenceable(const void* __i) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__dereferenceable(__j);
|
||||
}
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__decrementable(const void* __i) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__decrementable(__j);
|
||||
}
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__addable(__j, __n);
|
||||
}
|
||||
|
||||
template <class _Cont>
|
||||
bool
|
||||
_C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
|
||||
{
|
||||
typedef typename _Cont::const_iterator iterator;
|
||||
const iterator* __j = static_cast<const iterator*>(__i);
|
||||
_Cont* _C = static_cast<_Cont*>(__c_);
|
||||
return _C->__subscriptable(__j, __n);
|
||||
}
|
||||
|
||||
class _LIBCPP_VISIBLE __libcpp_db
|
||||
{
|
||||
__c_node** __cbeg_;
|
||||
__c_node** __cend_;
|
||||
size_t __csz_;
|
||||
__i_node** __ibeg_;
|
||||
__i_node** __iend_;
|
||||
size_t __isz_;
|
||||
|
||||
__libcpp_db();
|
||||
public:
|
||||
__libcpp_db(const __libcpp_db&) = delete;
|
||||
__libcpp_db& operator=(const __libcpp_db&) = delete;
|
||||
~__libcpp_db();
|
||||
|
||||
class __db_c_iterator;
|
||||
class __db_c_const_iterator;
|
||||
class __db_i_iterator;
|
||||
class __db_i_const_iterator;
|
||||
|
||||
__db_c_const_iterator __c_end() const;
|
||||
__db_i_const_iterator __i_end() const;
|
||||
|
||||
template <class _Cont>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __insert_c(_Cont* __c)
|
||||
{
|
||||
__c_node* __n = __insert_c(static_cast<void*>(__c));
|
||||
::new(__n) _C_node<_Cont>(__n->__c_, __n->__next_);
|
||||
}
|
||||
|
||||
void __insert_i(void* __i);
|
||||
__c_node* __insert_c(void* __c);
|
||||
void __erase_c(void* __c);
|
||||
|
||||
void __insert_ic(void* __i, const void* __c);
|
||||
void __iterator_copy(void* __i, const void* __i0);
|
||||
void __erase_i(void* __i);
|
||||
|
||||
void* __find_c_from_i(void* __i) const;
|
||||
void __invalidate_all(void* __c);
|
||||
__c_node* __find_c_and_lock(void* __c) const;
|
||||
__c_node* __find_c(void* __c) const;
|
||||
void unlock() const;
|
||||
|
||||
void swap(void* __c1, void* __c2);
|
||||
|
||||
|
||||
bool __dereferenceable(const void* __i) const;
|
||||
bool __decrementable(const void* __i) const;
|
||||
bool __addable(const void* __i, ptrdiff_t __n) const;
|
||||
bool __subscriptable(const void* __i, ptrdiff_t __n) const;
|
||||
bool __comparable(const void* __i, const void* __j) const;
|
||||
private:
|
||||
_LIBCPP_HIDDEN
|
||||
__i_node* __insert_iterator(void* __i);
|
||||
_LIBCPP_HIDDEN
|
||||
__i_node* __find_iterator(const void* __i) const;
|
||||
|
||||
friend _LIBCPP_VISIBLE __libcpp_db* __get_db();
|
||||
};
|
||||
|
||||
_LIBCPP_VISIBLE __libcpp_db* __get_db();
|
||||
_LIBCPP_VISIBLE const __libcpp_db* __get_const_db();
|
||||
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_DEBUG_H
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -196,12 +196,12 @@ mem_fn(_R (_T::* __pm)(_A0, _A1, _A2) const volatile)
|
||||
|
||||
// bad_function_call
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_function_call
|
||||
class bad_function_call
|
||||
: public exception
|
||||
{
|
||||
};
|
||||
|
||||
template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
|
||||
template<class _Fp> class function; // undefined
|
||||
|
||||
namespace __function
|
||||
{
|
||||
@@ -314,8 +314,8 @@ class __func<_F, _Alloc, _R()>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R()>* __clone() const;
|
||||
virtual void __clone(__base<_R()>*) const;
|
||||
virtual void destroy();
|
||||
@@ -396,9 +396,8 @@ class __func<_F, _Alloc, _R(_A0)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -479,9 +478,8 @@ class __func<_F, _Alloc, _R(_A0, _A1)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0, _A1)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0, _A1)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -562,9 +560,8 @@ class __func<_F, _Alloc, _R(_A0, _A1, _A2)>
|
||||
{
|
||||
__compressed_pair<_F, _Alloc> __f_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f) : __f_(_VSTD::move(__f)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __func(_F __f, _Alloc __a)
|
||||
: __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
|
||||
explicit __func(_F __f) : __f_(_STD::move(__f)) {}
|
||||
explicit __func(_F __f, _Alloc __a) : __f_(_STD::move(__f), _STD::move(__a)) {}
|
||||
virtual __base<_R(_A0, _A1, _A2)>* __clone() const;
|
||||
virtual void __clone(__base<_R(_A0, _A1, _A2)>*) const;
|
||||
virtual void destroy();
|
||||
@@ -642,7 +639,7 @@ __func<_F, _Alloc, _R(_A0, _A1, _A2)>::target_type() const
|
||||
} // __function
|
||||
|
||||
template<class _R>
|
||||
class _LIBCPP_VISIBLE function<_R()>
|
||||
class function<_R()>
|
||||
{
|
||||
typedef __function::__base<_R()> __base;
|
||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||
@@ -656,18 +653,16 @@ public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -690,19 +685,18 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
// 20.7.16.2.3, function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;}
|
||||
operator bool() const {return __f_;}
|
||||
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2>
|
||||
bool operator==(const function<_R2()>&) const;// = delete;
|
||||
bool operator==(const function<_R2()>&);// = delete;
|
||||
template<class _R2>
|
||||
bool operator!=(const function<_R2()>&) const;// = delete;
|
||||
bool operator!=(const function<_R2()>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()() const;
|
||||
@@ -831,7 +825,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R()>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -878,7 +872,7 @@ function<_R()>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R>
|
||||
@@ -926,7 +920,7 @@ function<_R()>::target() const
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _R, class _A0>
|
||||
class _LIBCPP_VISIBLE function<_R(_A0)>
|
||||
class function<_R(_A0)>
|
||||
: public unary_function<_A0, _R>
|
||||
{
|
||||
typedef __function::__base<_R(_A0)> __base;
|
||||
@@ -934,42 +928,33 @@ class _LIBCPP_VISIBLE function<_R(_A0)>
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class _B0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_B0)) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)()) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)() const) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)() volatile) {return __p;}
|
||||
template <class _R2, class _C>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)() const volatile) {return __p;}
|
||||
template <class _R2, class _B0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_B0)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -992,19 +977,18 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
// 20.7.16.2.3, function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;}
|
||||
operator bool() const {return __f_;}
|
||||
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class _B0>
|
||||
bool operator==(const function<_R2(_B0)>&) const;// = delete;
|
||||
bool operator==(const function<_R2(_B0)>&);// = delete;
|
||||
template<class _R2, class _B0>
|
||||
bool operator!=(const function<_R2(_B0)>&) const;// = delete;
|
||||
bool operator!=(const function<_R2(_B0)>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()(_A0) const;
|
||||
@@ -1133,7 +1117,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_A0)>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1180,7 +1164,7 @@ function<_R(_A0)>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class _A0>
|
||||
@@ -1228,7 +1212,7 @@ function<_R(_A0)>::target() const
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _R, class _A0, class _A1>
|
||||
class _LIBCPP_VISIBLE function<_R(_A0, _A1)>
|
||||
class function<_R(_A0, _A1)>
|
||||
: public binary_function<_A0, _A1, _R>
|
||||
{
|
||||
typedef __function::__base<_R(_A0, _A1)> __base;
|
||||
@@ -1236,42 +1220,33 @@ class _LIBCPP_VISIBLE function<_R(_A0, _A1)>
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class _B0, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_B0, _B1)) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1)) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1) const) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1) volatile) {return __p;}
|
||||
template <class _R2, class _C, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1) const volatile) {return __p;}
|
||||
template <class _R2, class _B0, class _B1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_B0, _B1)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -1294,7 +1269,6 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
@@ -1304,9 +1278,9 @@ public:
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class _B0, class _B1>
|
||||
bool operator==(const function<_R2(_B0, _B1)>&) const;// = delete;
|
||||
bool operator==(const function<_R2(_B0, _B1)>&);// = delete;
|
||||
template<class _R2, class _B0, class _B1>
|
||||
bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete;
|
||||
bool operator!=(const function<_R2(_B0, _B1)>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()(_A0, _A1) const;
|
||||
@@ -1435,7 +1409,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_A0, _A1)>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1482,7 +1456,7 @@ function<_R(_A0, _A1)>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class _A0, class _A1>
|
||||
@@ -1530,49 +1504,40 @@ function<_R(_A0, _A1)>::target() const
|
||||
#endif // _LIBCPP_NO_RTTI
|
||||
|
||||
template<class _R, class _A0, class _A1, class _A2>
|
||||
class _LIBCPP_VISIBLE function<_R(_A0, _A1, _A2)>
|
||||
class function<_R(_A0, _A1, _A2)>
|
||||
{
|
||||
typedef __function::__base<_R(_A0, _A1, _A2)> __base;
|
||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||
__base* __f_;
|
||||
|
||||
template <class _F>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const _F&) {return true;}
|
||||
template <class _R2, class _B0, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (*__p)(_B0, _B1, _B2)) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2)) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2) const) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2) volatile) {return __p;}
|
||||
template <class _R2, class _C, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(_R2 (_C::*__p)(_B1, _B2) const volatile) {return __p;}
|
||||
template <class _R2, class _B0, class _B1, class _B2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static bool __not_null(const function<_R(_B0, _B1, _B2)>& __p) {return __p;}
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
// 20.7.16.2.1, construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
|
||||
explicit function() : __f_(0) {}
|
||||
function(nullptr_t) : __f_(0) {}
|
||||
function(const function&);
|
||||
template<class _F>
|
||||
function(_F,
|
||||
typename enable_if<!is_integral<_F>::value>::type* = 0);
|
||||
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
|
||||
template<class _Alloc>
|
||||
function(allocator_arg_t, const _Alloc&, const function&);
|
||||
@@ -1595,19 +1560,18 @@ public:
|
||||
// 20.7.16.2.2, function modifiers:
|
||||
void swap(function&);
|
||||
template<class _F, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void assign(_F __f, const _Alloc& __a)
|
||||
{function(allocator_arg, __a, __f).swap(*this);}
|
||||
|
||||
// 20.7.16.2.3, function capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;}
|
||||
operator bool() const {return __f_;}
|
||||
|
||||
private:
|
||||
// deleted overloads close possible hole in the type system
|
||||
template<class _R2, class _B0, class _B1, class _B2>
|
||||
bool operator==(const function<_R2(_B0, _B1, _B2)>&) const;// = delete;
|
||||
bool operator==(const function<_R2(_B0, _B1, _B2)>&);// = delete;
|
||||
template<class _R2, class _B0, class _B1, class _B2>
|
||||
bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete;
|
||||
bool operator!=(const function<_R2(_B0, _B1, _B2)>&);// = delete;
|
||||
public:
|
||||
// 20.7.16.2.4, function invocation:
|
||||
_R operator()(_A0, _A1, _A2) const;
|
||||
@@ -1737,7 +1701,7 @@ typename enable_if
|
||||
>::type
|
||||
function<_R(_A0, _A1, _A2)>::operator=(_F __f)
|
||||
{
|
||||
function(_VSTD::move(__f)).swap(*this);
|
||||
function(_STD::move(__f)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1784,7 +1748,7 @@ function<_R(_A0, _A1, _A2)>::swap(function& __f)
|
||||
__f_ = (__base*)&__buf_;
|
||||
}
|
||||
else
|
||||
_VSTD::swap(__f_, __f.__f_);
|
||||
_STD::swap(__f_, __f.__f_);
|
||||
}
|
||||
|
||||
template<class _R, class _A0, class _A1, class _A2>
|
||||
@@ -1858,11 +1822,11 @@ swap(function<_F>& __x, function<_F>& __y)
|
||||
{return __x.swap(__y);}
|
||||
|
||||
template<class _Tp> struct __is_bind_expression : public false_type {};
|
||||
template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
|
||||
template<class _Tp> struct is_bind_expression
|
||||
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
||||
|
||||
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
||||
template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
|
||||
template<class _Tp> struct is_placeholder
|
||||
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
||||
|
||||
namespace placeholders
|
||||
@@ -1909,7 +1873,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __mu_return1<true, _Ti, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
|
||||
{
|
||||
__ti(_VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
__ti(_STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
}
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
@@ -1947,7 +1911,7 @@ __mu(_Ti&, _Uj& __uj)
|
||||
// compiler bug workaround
|
||||
typename tuple_element<_Indx, _Uj>::type __t = get<_Indx>(__uj);
|
||||
return __t;
|
||||
// return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
|
||||
// return _STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
|
||||
}
|
||||
|
||||
template <class _Ti, class _Uj>
|
||||
@@ -2051,8 +2015,8 @@ class __bind
|
||||
public:
|
||||
template <class _G, class ..._BA>
|
||||
explicit __bind(_G&& __f, _BA&& ...__bound_args)
|
||||
: __f_(_VSTD::forward<_G>(__f)),
|
||||
__bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
: __f_(_STD::forward<_G>(__f)),
|
||||
__bound_args_(_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
@@ -2085,21 +2049,21 @@ public:
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
|
||||
: base(_VSTD::forward<_G>(__f),
|
||||
_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
: base(_STD::forward<_G>(__f),
|
||||
_STD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
result_type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||
return base::operator()(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
result_type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||
return base::operator()(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2112,7 +2076,7 @@ __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
template<class _R, class _F, class ..._BoundArgs>
|
||||
@@ -2121,7 +2085,7 @@ __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
return type(_VSTD::forward<_F>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -21,21 +21,21 @@
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Arg, class _Result>
|
||||
struct _LIBCPP_VISIBLE unary_function
|
||||
struct unary_function
|
||||
{
|
||||
typedef _Arg argument_type;
|
||||
typedef _Result result_type;
|
||||
};
|
||||
|
||||
template <class _Arg1, class _Arg2, class _Result>
|
||||
struct _LIBCPP_VISIBLE binary_function
|
||||
struct binary_function
|
||||
{
|
||||
typedef _Arg1 first_argument_type;
|
||||
typedef _Arg2 second_argument_type;
|
||||
typedef _Result result_type;
|
||||
};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
||||
template <class _Tp> struct hash;
|
||||
|
||||
template <class _Tp>
|
||||
struct __has_result_type
|
||||
@@ -281,65 +281,171 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile>
|
||||
|
||||
// __invoke
|
||||
|
||||
// bullets 1 and 2
|
||||
// first bullet
|
||||
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...);
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// bullets 3 and 4
|
||||
|
||||
template <class _F, class _A0>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype(_VSTD::forward<_A0>(__a0).*__f)
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return _VSTD::forward<_A0>(__a0).*__f;
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _F, class _A0>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return (*_VSTD::forward<_A0>(__a0)).*__f;
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// bullet 5
|
||||
// second bullet
|
||||
|
||||
template <class _F, class ..._Args>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _Args&& ...__args)
|
||||
-> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...))
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return _VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...);
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// third bullet
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
typename __apply_cv<_T1, _R>::type&&
|
||||
>::type
|
||||
__invoke(_R _T::* __f, _T1&& __t1)
|
||||
{
|
||||
return _STD::forward<_T1>(__t1).*__f;
|
||||
}
|
||||
|
||||
// forth bullet
|
||||
|
||||
template <class _T1, class _R, bool>
|
||||
struct __4th_helper
|
||||
{
|
||||
};
|
||||
|
||||
template <class _T1, class _R>
|
||||
struct __4th_helper<_T1, _R, true>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __4th_helper<_T1, _R,
|
||||
!is_base_of<_T,
|
||||
typename remove_reference<_T1>::type
|
||||
>::value
|
||||
>::type&&
|
||||
__invoke(_R _T::* __f, _T1&& __t1)
|
||||
{
|
||||
return (*_STD::forward<_T1>(__t1)).*__f;
|
||||
}
|
||||
|
||||
// fifth bullet
|
||||
|
||||
template <class _F, class ..._T>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename result_of<_F(_T...)>::type
|
||||
__invoke(_F&& __f, _T&& ...__t)
|
||||
{
|
||||
return _STD::forward<_F>(__f)(_STD::forward<_T>(__t)...);
|
||||
}
|
||||
|
||||
template <class _Tp, class ..._Args>
|
||||
struct __invoke_return
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_Args>()...)) type;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE reference_wrapper
|
||||
class reference_wrapper
|
||||
: public __weak_result_type<_Tp>
|
||||
{
|
||||
public:
|
||||
@@ -350,22 +456,21 @@ private:
|
||||
|
||||
public:
|
||||
// construct/copy/destroy
|
||||
_LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT : __f_(&__f) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) : __f_(&__f) {}
|
||||
#ifdef _LIBCPP_MOVE
|
||||
private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
|
||||
#endif
|
||||
|
||||
// access
|
||||
_LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
|
||||
_LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
|
||||
_LIBCPP_INLINE_VISIBILITY operator type& () const {return *__f_;}
|
||||
_LIBCPP_INLINE_VISIBILITY type& get() const {return *__f_;}
|
||||
|
||||
// invoke
|
||||
template <class... _ArgTypes>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_of<type&, _ArgTypes...>::type
|
||||
typename __invoke_return<type&, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args) const
|
||||
{
|
||||
return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
|
||||
return __invoke(get(), _STD::forward<_ArgTypes>(__args)...);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -377,7 +482,7 @@ template <class _Tp> struct __is_reference_wrapper
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<_Tp>
|
||||
ref(_Tp& __t) _NOEXCEPT
|
||||
ref(_Tp& __t)
|
||||
{
|
||||
return reference_wrapper<_Tp>(__t);
|
||||
}
|
||||
@@ -385,7 +490,7 @@ ref(_Tp& __t) _NOEXCEPT
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<_Tp>
|
||||
ref(reference_wrapper<_Tp> __t) _NOEXCEPT
|
||||
ref(reference_wrapper<_Tp> __t)
|
||||
{
|
||||
return ref(__t.get());
|
||||
}
|
||||
@@ -393,7 +498,7 @@ ref(reference_wrapper<_Tp> __t) _NOEXCEPT
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<const _Tp>
|
||||
cref(const _Tp& __t) _NOEXCEPT
|
||||
cref(const _Tp& __t)
|
||||
{
|
||||
return reference_wrapper<const _Tp>(__t);
|
||||
}
|
||||
@@ -401,25 +506,15 @@ cref(const _Tp& __t) _NOEXCEPT
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
reference_wrapper<const _Tp>
|
||||
cref(reference_wrapper<_Tp> __t) _NOEXCEPT
|
||||
cref(reference_wrapper<_Tp> __t)
|
||||
{
|
||||
return cref(__t.get());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
|
||||
template <class _Tp> void ref(const _Tp&& __t) = delete;
|
||||
template <class _Tp> void cref(const _Tp&& __t) = delete;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
|
||||
template <class _Tp> void ref(const _Tp&& __t);// = delete;
|
||||
template <class _Tp> void cref(const _Tp&& __t);// = delete;
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Tp> void ref(const _Tp&& __t);// = delete; // LWG 688
|
||||
template <class _Tp> void cref(const _Tp&& __t);// = delete; // LWG 688
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -842,7 +842,7 @@ struct __4th_helper
|
||||
template <class _T1, class _R>
|
||||
struct __4th_helper<_T1, _R, true>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _R>::type type;
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
@@ -873,7 +873,7 @@ __invoke(_R _T::* __f, _T1& __t1)
|
||||
|
||||
template <class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()())
|
||||
typename result_of<_F()>::type
|
||||
__invoke(_F __f)
|
||||
{
|
||||
return __f();
|
||||
@@ -881,7 +881,7 @@ __invoke(_F __f)
|
||||
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()(declval<_A0&>()))
|
||||
typename result_of<_F(_A0)>::type
|
||||
__invoke(_F __f, _A0& __a0)
|
||||
{
|
||||
return __f(__a0);
|
||||
@@ -889,7 +889,7 @@ __invoke(_F __f, _A0& __a0)
|
||||
|
||||
template <class _F, class _A0, class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>()))
|
||||
typename result_of<_F(_A0, _A1)>::type
|
||||
__invoke(_F __f, _A0& __a0, _A1& __a1)
|
||||
{
|
||||
return __f(__a0, __a1);
|
||||
@@ -897,7 +897,7 @@ __invoke(_F __f, _A0& __a0, _A1& __a1)
|
||||
|
||||
template <class _F, class _A0, class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>()))
|
||||
typename result_of<_F(_A0, _A1, _A2)>::type
|
||||
__invoke(_F __f, _A0& __a0, _A1& __a1, _A2& __a2)
|
||||
{
|
||||
return __f(__a0, __a1, __a2);
|
||||
@@ -959,13 +959,13 @@ struct __invoke_return
|
||||
template <class _F>
|
||||
struct __invoke_return<_F, false>
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_F>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_F>())) type;
|
||||
};
|
||||
|
||||
template <class _Tp, class _A0>
|
||||
struct __invoke_return0
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>())) type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _A0>
|
||||
@@ -983,20 +983,20 @@ struct __invoke_return0<_R _T::*, _A0*>
|
||||
template <class _Tp, class _A0, class _A1>
|
||||
struct __invoke_return1
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
|
||||
_VSTD::declval<_A1>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>(),
|
||||
_STD::declval<_A1>())) type;
|
||||
};
|
||||
|
||||
template <class _Tp, class _A0, class _A1, class _A2>
|
||||
struct __invoke_return2
|
||||
{
|
||||
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
|
||||
_VSTD::declval<_A1>(),
|
||||
_VSTD::declval<_A2>())) type;
|
||||
typedef decltype(__invoke(_STD::declval<_Tp>(), _STD::declval<_A0>(),
|
||||
_STD::declval<_A1>(),
|
||||
_STD::declval<_A2>())) type;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE reference_wrapper
|
||||
class reference_wrapper
|
||||
: public __weak_result_type<_Tp>
|
||||
{
|
||||
public:
|
||||
@@ -1015,7 +1015,6 @@ public:
|
||||
|
||||
// invoke
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return<type&>::type
|
||||
operator() () const
|
||||
{
|
||||
@@ -1023,7 +1022,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _A0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return0<type&, _A0>::type
|
||||
operator() (_A0& __a0) const
|
||||
{
|
||||
@@ -1031,7 +1029,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _A0, class _A1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return1<type&, _A0, _A1>::type
|
||||
operator() (_A0& __a0, _A1& __a1) const
|
||||
{
|
||||
@@ -1039,7 +1036,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _A0, class _A1, class _A2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return2<type&, _A0, _A1, _A2>::type
|
||||
operator() (_A0& __a0, _A1& __a1, _A2& __a2) const
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
235
include/__locale
235
include/__locale
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -19,11 +19,7 @@
|
||||
#include <cstdint>
|
||||
#include <cctype>
|
||||
#include <locale.h>
|
||||
#if _WIN32
|
||||
# include <support/win32/locale_win32.h>
|
||||
#elif (__GLIBC__ || __APPLE__ || __FreeBSD__)
|
||||
# include <xlocale.h>
|
||||
#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD_
|
||||
#include <xlocale.h>
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -31,10 +27,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class locale;
|
||||
|
||||
template <class _Facet> bool has_facet(const locale&) _NOEXCEPT;
|
||||
template <class _Facet> bool has_facet(const locale&) throw();
|
||||
template <class _Facet> const _Facet& use_facet(const locale&);
|
||||
|
||||
class _LIBCPP_VISIBLE locale
|
||||
class locale
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -53,19 +49,18 @@ public:
|
||||
all = collate | ctype | monetary | numeric | time | messages;
|
||||
|
||||
// construct/copy/destroy:
|
||||
locale() _NOEXCEPT;
|
||||
locale(const locale&) _NOEXCEPT;
|
||||
locale() throw();
|
||||
locale(const locale&) throw();
|
||||
explicit locale(const char*);
|
||||
explicit locale(const string&);
|
||||
locale(const locale&, const char*, category);
|
||||
locale(const locale&, const string&, category);
|
||||
template <class _Facet>
|
||||
_LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*);
|
||||
template <class _Facet> locale(const locale&, _Facet*);
|
||||
locale(const locale&, const locale&, category);
|
||||
|
||||
~locale();
|
||||
~locale() throw();
|
||||
|
||||
const locale& operator=(const locale&) _NOEXCEPT;
|
||||
const locale& operator=(const locale&) throw();
|
||||
|
||||
template <class _Facet> locale combine(const locale&) const;
|
||||
|
||||
@@ -90,15 +85,14 @@ private:
|
||||
bool has_facet(id&) const;
|
||||
const facet* use_facet(id&) const;
|
||||
|
||||
template <class _Facet> friend bool has_facet(const locale&) _NOEXCEPT;
|
||||
template <class _Facet> friend bool has_facet(const locale&) throw();
|
||||
template <class _Facet> friend const _Facet& use_facet(const locale&);
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE locale::facet
|
||||
class locale::facet
|
||||
: public __shared_count
|
||||
{
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit facet(size_t __refs = 0)
|
||||
: __shared_count(static_cast<long>(__refs)-1) {}
|
||||
|
||||
@@ -107,17 +101,17 @@ protected:
|
||||
// facet(const facet&) = delete; // effectively done in __shared_count
|
||||
// void operator=(const facet&) = delete;
|
||||
private:
|
||||
virtual void __on_zero_shared() _NOEXCEPT;
|
||||
virtual void __on_zero_shared();
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE locale::id
|
||||
class locale::id
|
||||
{
|
||||
once_flag __flag_;
|
||||
int32_t __id_;
|
||||
|
||||
static int32_t __next_id;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY id() {}
|
||||
id() {}
|
||||
private:
|
||||
void __init();
|
||||
void operator=(const id&); // = delete;
|
||||
@@ -141,16 +135,16 @@ locale
|
||||
locale::combine(const locale& __other) const
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (!_VSTD::has_facet<_Facet>(__other))
|
||||
if (!_STD::has_facet<_Facet>(__other))
|
||||
throw runtime_error("locale::combine: locale missing facet");
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other)));
|
||||
return locale(*this, &const_cast<_Facet&>(_STD::use_facet<_Facet>(__other)));
|
||||
}
|
||||
|
||||
template <class _Facet>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
has_facet(const locale& __l) _NOEXCEPT
|
||||
has_facet(const locale& __l) throw()
|
||||
{
|
||||
return __l.has_facet(_Facet::id);
|
||||
}
|
||||
@@ -166,31 +160,27 @@ use_facet(const locale& __l)
|
||||
// template <class _CharT> class collate;
|
||||
|
||||
template <class _CharT>
|
||||
class _LIBCPP_VISIBLE collate
|
||||
class collate
|
||||
: public locale::facet
|
||||
{
|
||||
public:
|
||||
typedef _CharT char_type;
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit collate(size_t __refs = 0)
|
||||
: locale::facet(__refs) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(const char_type* __lo1, const char_type* __hi1,
|
||||
const char_type* __lo2, const char_type* __hi2) const
|
||||
{
|
||||
return do_compare(__lo1, __hi1, __lo2, __hi2);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
string_type transform(const char_type* __lo, const char_type* __hi) const
|
||||
{
|
||||
return do_transform(__lo, __hi);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
long hash(const char_type* __lo, const char_type* __hi) const
|
||||
{
|
||||
return do_hash(__lo, __hi);
|
||||
@@ -231,29 +221,29 @@ collate<_CharT>::do_compare(const char_type* __lo1, const char_type* __hi1,
|
||||
|
||||
template <class _CharT>
|
||||
long
|
||||
collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
|
||||
collate<_CharT>::do_hash(const char_type* lo, const char_type* hi) const
|
||||
{
|
||||
size_t __h = 0;
|
||||
const size_t __sr = __CHAR_BIT__ * sizeof(size_t) - 8;
|
||||
const size_t __mask = size_t(0xF) << (__sr + 4);
|
||||
for(const char_type* __p = __lo; __p != __hi; ++__p)
|
||||
size_t h = 0;
|
||||
const size_t sr = __CHAR_BIT__ * sizeof(size_t) - 8;
|
||||
const size_t mask = size_t(0xF) << (sr + 4);
|
||||
for(const char_type* p = lo; p != hi; ++p)
|
||||
{
|
||||
__h = (__h << 4) + *__p;
|
||||
size_t __g = __h & __mask;
|
||||
__h ^= __g | (__g >> __sr);
|
||||
h = (h << 4) + *p;
|
||||
size_t g = h & mask;
|
||||
h ^= g | (g >> sr);
|
||||
}
|
||||
return static_cast<long>(__h);
|
||||
return static_cast<long>(h);
|
||||
}
|
||||
|
||||
extern template class _LIBCPP_VISIBLE collate<char>;
|
||||
extern template class _LIBCPP_VISIBLE collate<wchar_t>;
|
||||
extern template class collate<char>;
|
||||
extern template class collate<wchar_t>;
|
||||
|
||||
// template <class CharT> class collate_byname;
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE collate_byname;
|
||||
template <class _CharT> class collate_byname;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE collate_byname<char>
|
||||
class collate_byname<char>
|
||||
: public collate<char>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -272,7 +262,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE collate_byname<wchar_t>
|
||||
class collate_byname<wchar_t>
|
||||
: public collate<wchar_t>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -296,46 +286,18 @@ bool
|
||||
locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
|
||||
const basic_string<_CharT, _Traits, _Allocator>& __y) const
|
||||
{
|
||||
return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare(
|
||||
return _STD::use_facet<_STD::collate<_CharT> >(*this).compare(
|
||||
__x.data(), __x.data() + __x.size(),
|
||||
__y.data(), __y.data() + __y.size()) < 0;
|
||||
}
|
||||
|
||||
// template <class charT> class ctype
|
||||
|
||||
class _LIBCPP_VISIBLE ctype_base
|
||||
{
|
||||
class ctype_base {
|
||||
public:
|
||||
#if __GLIBC__
|
||||
typedef unsigned short mask;
|
||||
static const mask space = _ISspace;
|
||||
static const mask print = _ISprint;
|
||||
static const mask cntrl = _IScntrl;
|
||||
static const mask upper = _ISupper;
|
||||
static const mask lower = _ISlower;
|
||||
static const mask alpha = _ISalpha;
|
||||
static const mask digit = _ISdigit;
|
||||
static const mask punct = _ISpunct;
|
||||
static const mask xdigit = _ISxdigit;
|
||||
static const mask blank = _ISblank;
|
||||
#elif _WIN32
|
||||
typedef unsigned short mask;
|
||||
static const mask space = _SPACE;
|
||||
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
|
||||
static const mask cntrl = _CONTROL;
|
||||
static const mask upper = _UPPER;
|
||||
static const mask lower = _LOWER;
|
||||
static const mask alpha = _ALPHA;
|
||||
static const mask digit = _DIGIT;
|
||||
static const mask punct = _PUNCT;
|
||||
static const mask xdigit = _HEX;
|
||||
static const mask blank = _BLANK;
|
||||
#elif (__APPLE__ || __FreeBSD__)
|
||||
#if __APPLE__
|
||||
typedef __uint32_t mask;
|
||||
#elif __FreeBSD__
|
||||
typedef unsigned long mask;
|
||||
#endif
|
||||
|
||||
#if __APPLE__
|
||||
static const mask space = _CTYPE_S;
|
||||
static const mask print = _CTYPE_R;
|
||||
static const mask cntrl = _CTYPE_C;
|
||||
@@ -346,29 +308,28 @@ public:
|
||||
static const mask punct = _CTYPE_P;
|
||||
static const mask xdigit = _CTYPE_X;
|
||||
static const mask blank = _CTYPE_B;
|
||||
#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
|
||||
typedef unsigned long mask;
|
||||
static const mask space = 1<<0;
|
||||
static const mask print = 1<<1;
|
||||
static const mask cntrl = 1<<2;
|
||||
static const mask upper = 1<<3;
|
||||
static const mask lower = 1<<4;
|
||||
static const mask alpha = 1<<5;
|
||||
static const mask digit = 1<<6;
|
||||
static const mask punct = 1<<7;
|
||||
static const mask xdigit = 1<<8;
|
||||
static const mask blank = 1<<9;
|
||||
#endif // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
|
||||
#else // __APPLE__
|
||||
static const mask space = _ISspace;
|
||||
static const mask print = _ISprint;
|
||||
static const mask cntrl = _IScntrl;
|
||||
static const mask upper = _ISupper;
|
||||
static const mask lower = _ISlower;
|
||||
static const mask alpha = _ISalpha;
|
||||
static const mask digit = _ISdigit;
|
||||
static const mask punct = _ISpunct;
|
||||
static const mask xdigit = _ISxdigit;
|
||||
static const mask blank = _ISblank;
|
||||
#endif // __APPLE__
|
||||
static const mask alnum = alpha | digit;
|
||||
static const mask graph = alnum | punct;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE ctype_base() {}
|
||||
};
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE ctype;
|
||||
template <class _CharT> class ctype;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype<wchar_t>
|
||||
class ctype<wchar_t>
|
||||
: public locale::facet,
|
||||
public ctype_base
|
||||
{
|
||||
@@ -470,7 +431,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype<char>
|
||||
class ctype<char>
|
||||
: public locale::facet, public ctype_base
|
||||
{
|
||||
const mask* __tab_;
|
||||
@@ -567,12 +528,8 @@ public:
|
||||
#else
|
||||
static const size_t table_size = 256; // FIXME: Don't hardcode this.
|
||||
#endif
|
||||
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
||||
static const mask* classic_table() _NOEXCEPT;
|
||||
#if defined(__GLIBC__)
|
||||
static const int* __classic_upper_table() _NOEXCEPT;
|
||||
static const int* __classic_lower_table() _NOEXCEPT;
|
||||
#endif
|
||||
const mask* table() const throw() {return __tab_;}
|
||||
static const mask* classic_table() throw();
|
||||
|
||||
protected:
|
||||
~ctype();
|
||||
@@ -588,10 +545,10 @@ protected:
|
||||
|
||||
// template <class CharT> class ctype_byname;
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE ctype_byname;
|
||||
template <class _CharT> class ctype_byname;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype_byname<char>
|
||||
class ctype_byname<char>
|
||||
: public ctype<char>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -609,7 +566,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE ctype_byname<wchar_t>
|
||||
class ctype_byname<wchar_t>
|
||||
: public ctype<wchar_t>
|
||||
{
|
||||
locale_t __l;
|
||||
@@ -740,7 +697,7 @@ tolower(_CharT __c, const locale& __loc)
|
||||
|
||||
// codecvt_base
|
||||
|
||||
class _LIBCPP_VISIBLE codecvt_base
|
||||
class codecvt_base
|
||||
{
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE codecvt_base() {}
|
||||
@@ -749,12 +706,12 @@ public:
|
||||
|
||||
// template <class internT, class externT, class stateT> class codecvt;
|
||||
|
||||
template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_VISIBLE codecvt;
|
||||
template <class _InternT, class _ExternT, class _StateT> class codecvt;
|
||||
|
||||
// template <> class codecvt<char, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<char, char, mbstate_t>
|
||||
class codecvt<char, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -791,13 +748,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const _NOEXCEPT
|
||||
int encoding() const throw()
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
bool always_noconv() const throw()
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -809,7 +766,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const _NOEXCEPT
|
||||
int max_length() const throw()
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -831,16 +788,16 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
virtual int do_max_length() const throw();
|
||||
};
|
||||
|
||||
// template <> class codecvt<wchar_t, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<wchar_t, char, mbstate_t>
|
||||
class codecvt<wchar_t, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -876,13 +833,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const _NOEXCEPT
|
||||
int encoding() const throw()
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
bool always_noconv() const throw()
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -894,7 +851,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const _NOEXCEPT
|
||||
int max_length() const throw()
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -914,16 +871,16 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
virtual int do_max_length() const throw();
|
||||
};
|
||||
|
||||
// template <> class codecvt<char16_t, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<char16_t, char, mbstate_t>
|
||||
class codecvt<char16_t, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -960,13 +917,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const _NOEXCEPT
|
||||
int encoding() const throw()
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
bool always_noconv() const throw()
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -978,7 +935,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const _NOEXCEPT
|
||||
int max_length() const throw()
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -1000,16 +957,16 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
virtual int do_max_length() const throw();
|
||||
};
|
||||
|
||||
// template <> class codecvt<char32_t, char, mbstate_t>
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE codecvt<char32_t, char, mbstate_t>
|
||||
class codecvt<char32_t, char, mbstate_t>
|
||||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
@@ -1046,13 +1003,13 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int encoding() const _NOEXCEPT
|
||||
int encoding() const throw()
|
||||
{
|
||||
return do_encoding();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool always_noconv() const _NOEXCEPT
|
||||
bool always_noconv() const throw()
|
||||
{
|
||||
return do_always_noconv();
|
||||
}
|
||||
@@ -1064,7 +1021,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int max_length() const _NOEXCEPT
|
||||
int max_length() const throw()
|
||||
{
|
||||
return do_max_length();
|
||||
}
|
||||
@@ -1086,23 +1043,21 @@ protected:
|
||||
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
|
||||
virtual result do_unshift(state_type& __st,
|
||||
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
|
||||
virtual int do_encoding() const _NOEXCEPT;
|
||||
virtual bool do_always_noconv() const _NOEXCEPT;
|
||||
virtual int do_encoding() const throw();
|
||||
virtual bool do_always_noconv() const throw();
|
||||
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
|
||||
virtual int do_max_length() const _NOEXCEPT;
|
||||
virtual int do_max_length() const throw();
|
||||
};
|
||||
|
||||
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
|
||||
|
||||
template <class _InternT, class _ExternT, class _StateT>
|
||||
class _LIBCPP_VISIBLE codecvt_byname
|
||||
class codecvt_byname
|
||||
: public codecvt<_InternT, _ExternT, _StateT>
|
||||
{
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit codecvt_byname(const char* __nm, size_t __refs = 0)
|
||||
: codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
explicit codecvt_byname(const string& __nm, size_t __refs = 0)
|
||||
: codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
|
||||
protected:
|
||||
@@ -1119,7 +1074,7 @@ extern template class codecvt_byname<wchar_t, char, mbstate_t>;
|
||||
extern template class codecvt_byname<char16_t, char, mbstate_t>;
|
||||
extern template class codecvt_byname<char32_t, char, mbstate_t>;
|
||||
|
||||
_LIBCPP_VISIBLE void __throw_runtime_error(const char*);
|
||||
void __throw_runtime_error(const char*);
|
||||
|
||||
template <size_t _N>
|
||||
struct __narrow_to_utf8
|
||||
@@ -1303,10 +1258,10 @@ struct __widen_from_utf8<32>
|
||||
|
||||
// template <class charT> class numpunct
|
||||
|
||||
template <class _CharT> class _LIBCPP_VISIBLE numpunct;
|
||||
template <class _CharT> class numpunct;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct<char>
|
||||
class numpunct<char>
|
||||
: public locale::facet
|
||||
{
|
||||
public:
|
||||
@@ -1337,7 +1292,7 @@ protected:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct<wchar_t>
|
||||
class numpunct<wchar_t>
|
||||
: public locale::facet
|
||||
{
|
||||
public:
|
||||
@@ -1369,10 +1324,10 @@ protected:
|
||||
|
||||
// template <class charT> class numpunct_byname
|
||||
|
||||
template <class charT> class _LIBCPP_VISIBLE numpunct_byname;
|
||||
template <class charT> class numpunct_byname;
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct_byname<char>
|
||||
class numpunct_byname<char>
|
||||
: public numpunct<char>
|
||||
{
|
||||
public:
|
||||
@@ -1390,7 +1345,7 @@ private:
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE numpunct_byname<wchar_t>
|
||||
class numpunct_byname<wchar_t>
|
||||
: public numpunct<wchar_t>
|
||||
{
|
||||
public:
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -18,24 +18,13 @@
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#ifdef _LIBCPP_SHARED_LOCK
|
||||
|
||||
namespace ting {
|
||||
template <class _Mutex> class shared_lock;
|
||||
template <class _Mutex> class upgrade_lock;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_SHARED_LOCK
|
||||
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE mutex
|
||||
class mutex
|
||||
{
|
||||
pthread_mutex_t __m_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex() {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
|
||||
~mutex();
|
||||
|
||||
@@ -49,12 +38,12 @@ public:
|
||||
void unlock();
|
||||
|
||||
typedef pthread_mutex_t* native_handle_type;
|
||||
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
|
||||
native_handle_type native_handle() {return &__m_;}
|
||||
};
|
||||
|
||||
struct _LIBCPP_VISIBLE defer_lock_t {};
|
||||
struct _LIBCPP_VISIBLE try_to_lock_t {};
|
||||
struct _LIBCPP_VISIBLE adopt_lock_t {};
|
||||
struct defer_lock_t {};
|
||||
struct try_to_lock_t {};
|
||||
struct adopt_lock_t {};
|
||||
|
||||
//constexpr
|
||||
extern const
|
||||
@@ -69,7 +58,7 @@ extern const
|
||||
adopt_lock_t adopt_lock;
|
||||
|
||||
template <class _Mutex>
|
||||
class _LIBCPP_VISIBLE lock_guard
|
||||
class lock_guard
|
||||
{
|
||||
public:
|
||||
typedef _Mutex mutex_type;
|
||||
@@ -78,13 +67,10 @@ private:
|
||||
mutex_type& __m_;
|
||||
public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit lock_guard(mutex_type& __m)
|
||||
: __m_(__m) {__m_.lock();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
lock_guard(mutex_type& __m, adopt_lock_t)
|
||||
: __m_(__m) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~lock_guard() {__m_.unlock();}
|
||||
|
||||
private:
|
||||
@@ -93,7 +79,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _Mutex>
|
||||
class _LIBCPP_VISIBLE unique_lock
|
||||
class unique_lock
|
||||
{
|
||||
public:
|
||||
typedef _Mutex mutex_type;
|
||||
@@ -103,29 +89,21 @@ private:
|
||||
bool __owns_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock() : __m_(nullptr), __owns_(false) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit unique_lock(mutex_type& __m)
|
||||
: __m_(&__m), __owns_(true) {__m_->lock();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, defer_lock_t)
|
||||
: __m_(&__m), __owns_(false) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, try_to_lock_t)
|
||||
: __m_(&__m), __owns_(__m.try_lock()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, adopt_lock_t)
|
||||
: __m_(&__m), __owns_(true) {}
|
||||
template <class _Clock, class _Duration>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
|
||||
: __m_(&__m), __owns_(__m.try_lock_until(__t)) {}
|
||||
template <class _Rep, class _Period>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
|
||||
: __m_(&__m), __owns_(__m.try_lock_for(__d)) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~unique_lock()
|
||||
{
|
||||
if (__owns_)
|
||||
@@ -137,12 +115,10 @@ private:
|
||||
unique_lock& operator=(unique_lock const&); // = delete;
|
||||
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
unique_lock(unique_lock&& __u)
|
||||
: __m_(__u.__m_), __owns_(__u.__owns_)
|
||||
{__u.__m_ = nullptr; __u.__owns_ = false;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_lock& operator=(unique_lock&& __u)
|
||||
{
|
||||
if (__owns_)
|
||||
@@ -153,29 +129,7 @@ public:
|
||||
__u.__owns_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef _LIBCPP_SHARED_LOCK
|
||||
|
||||
unique_lock(ting::shared_lock<mutex_type>&&, try_to_lock_t);
|
||||
template <class _Clock, class _Duration>
|
||||
unique_lock(ting::shared_lock<mutex_type>&&,
|
||||
const chrono::time_point<_Clock, _Duration>&);
|
||||
template <class _Rep, class _Period>
|
||||
unique_lock(ting::shared_lock<mutex_type>&&,
|
||||
const chrono::duration<_Rep, _Period>&);
|
||||
|
||||
explicit unique_lock(ting::upgrade_lock<mutex_type>&&);
|
||||
unique_lock(ting::upgrade_lock<mutex_type>&&, try_to_lock_t);
|
||||
template <class _Clock, class _Duration>
|
||||
unique_lock(ting::upgrade_lock<mutex_type>&&,
|
||||
const chrono::time_point<_Clock, _Duration>&);
|
||||
template <class _Rep, class _Period>
|
||||
unique_lock(ting::upgrade_lock<mutex_type>&&,
|
||||
const chrono::duration<_Rep, _Period>&);
|
||||
|
||||
#endif // _LIBCPP_SHARED_LOCK
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
void lock();
|
||||
bool try_lock();
|
||||
@@ -187,13 +141,11 @@ public:
|
||||
|
||||
void unlock();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(unique_lock& __u)
|
||||
{
|
||||
_VSTD::swap(__m_, __u.__m_);
|
||||
_VSTD::swap(__owns_, __u.__owns_);
|
||||
_STD::swap(__m_, __u.__m_);
|
||||
_STD::swap(__owns_, __u.__owns_);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex_type* release()
|
||||
{
|
||||
mutex_type* __m = __m_;
|
||||
@@ -202,12 +154,9 @@ public:
|
||||
return __m;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool owns_lock() const {return __owns_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool () const {return __owns_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
mutex_type* mutex() const {return __m_;}
|
||||
};
|
||||
|
||||
@@ -272,11 +221,11 @@ unique_lock<_Mutex>::unlock()
|
||||
}
|
||||
|
||||
template <class _Mutex>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) {__x.swap(__y);}
|
||||
|
||||
struct _LIBCPP_VISIBLE cv_status
|
||||
struct cv_status
|
||||
{
|
||||
enum _ {
|
||||
no_timeout,
|
||||
@@ -285,16 +234,15 @@ struct _LIBCPP_VISIBLE cv_status
|
||||
|
||||
_ __v_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY cv_status(_ __v) : __v_(__v) {}
|
||||
_LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;}
|
||||
cv_status(_ __v) : __v_(__v) {}
|
||||
operator int() const {return __v_;}
|
||||
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE condition_variable
|
||||
class condition_variable
|
||||
{
|
||||
pthread_cond_t __cv_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
|
||||
~condition_variable();
|
||||
|
||||
@@ -338,7 +286,7 @@ public:
|
||||
_Predicate __pred);
|
||||
|
||||
typedef pthread_cond_t* native_handle_type;
|
||||
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
|
||||
native_handle_type native_handle() {return &__cv_;}
|
||||
|
||||
private:
|
||||
void __do_timed_wait(unique_lock<mutex>& __lk,
|
||||
@@ -346,7 +294,7 @@ private:
|
||||
};
|
||||
|
||||
template <class _To, class _Rep, class _Period>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename enable_if
|
||||
<
|
||||
chrono::__is_duration<_To>::value,
|
||||
@@ -414,22 +362,22 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
|
||||
const chrono::duration<_Rep, _Period>& __d)
|
||||
{
|
||||
using namespace chrono;
|
||||
system_clock::time_point __s_now = system_clock::now();
|
||||
steady_clock::time_point __c_now = steady_clock::now();
|
||||
system_clock::time_point __s_now = system_clock::now();
|
||||
monotonic_clock::time_point __c_now = monotonic_clock::now();
|
||||
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
|
||||
return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
|
||||
cv_status::timeout;
|
||||
return monotonic_clock::now() - __c_now < __d ? cv_status::no_timeout :
|
||||
cv_status::timeout;
|
||||
}
|
||||
|
||||
template <class _Rep, class _Period, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
condition_variable::wait_for(unique_lock<mutex>& __lk,
|
||||
const chrono::duration<_Rep, _Period>& __d,
|
||||
_Predicate __pred)
|
||||
{
|
||||
return wait_until(__lk, chrono::steady_clock::now() + __d,
|
||||
_VSTD::move(__pred));
|
||||
return wait_until(__lk, chrono::monotonic_clock::now() + __d,
|
||||
_STD::move(__pred));
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -47,36 +47,29 @@ public:
|
||||
typedef typename add_lvalue_reference<allocator_type>::type __alloc_ref;
|
||||
typedef typename add_lvalue_reference<allocator_type>::type __alloc_const_ref;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY __alloc_rr& __alloc() {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const __alloc_rr& __alloc() const {return __end_cap_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const {return __end_cap_.first();}
|
||||
|
||||
__split_buffer()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
|
||||
__split_buffer();
|
||||
explicit __split_buffer(__alloc_rr& __a);
|
||||
explicit __split_buffer(const __alloc_rr& __a);
|
||||
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
|
||||
~__split_buffer();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__split_buffer(__split_buffer&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__split_buffer(__split_buffer&& __c);
|
||||
__split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
|
||||
__split_buffer& operator=(__split_buffer&& __c)
|
||||
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value) ||
|
||||
!__alloc_traits::propagate_on_container_move_assignment::value);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__split_buffer& operator=(__split_buffer&& __c);
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT {return __end_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT {return __end_;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const {return __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() {return __end_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const {return __end_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT
|
||||
{__destruct_at_end(__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__destruct_at_end(__begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return __end_ == __begin_;}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
|
||||
@@ -89,23 +82,25 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const {return *(__end_ - 1);}
|
||||
|
||||
void reserve(size_type __n);
|
||||
void shrink_to_fit() _NOEXCEPT;
|
||||
void shrink_to_fit();
|
||||
void push_front(const_reference __x);
|
||||
void push_back(const_reference __x);
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push_front(value_type&& __x);
|
||||
void push_back(value_type&& __x);
|
||||
#if !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
template <class... _Args>
|
||||
void emplace_back(_Args&&... __args);
|
||||
#endif // !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
|
||||
|
||||
void __construct_at_end(size_type __n);
|
||||
void __construct_at_end(size_type __n, false_type);
|
||||
void __construct_at_end(size_type __n, true_type);
|
||||
void __construct_at_end(size_type __n, const_reference __x);
|
||||
void __construct_at_end(size_type __n, const_reference __x, false_type);
|
||||
void __construct_at_end(size_type __n, const_reference __x, true_type);
|
||||
template <class _InputIter>
|
||||
typename enable_if
|
||||
<
|
||||
@@ -123,51 +118,38 @@ public:
|
||||
__construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin)
|
||||
{__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());}
|
||||
{__destruct_at_begin(__new_begin, has_trivial_destructor<value_type>());}
|
||||
void __destruct_at_begin(pointer __new_begin, false_type);
|
||||
void __destruct_at_begin(pointer __new_begin, true_type);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __destruct_at_end(pointer __new_last) _NOEXCEPT
|
||||
{__destruct_at_end(__new_last, is_trivially_destructible<value_type>());}
|
||||
void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
|
||||
void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last)
|
||||
{__destruct_at_end(__new_last, has_trivial_destructor<value_type>());}
|
||||
void __destruct_at_end(pointer __new_last, false_type);
|
||||
void __destruct_at_end(pointer __new_last, true_type);
|
||||
|
||||
void swap(__split_buffer& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value);
|
||||
void swap(__split_buffer& __x);
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__split_buffer& __c, true_type)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
|
||||
void __move_assign_alloc(const __split_buffer& __c, true_type)
|
||||
{
|
||||
__alloc() = _VSTD::move(__c.__alloc());
|
||||
__alloc() = _STD::move(__c.__alloc());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign_alloc(__split_buffer& __c, false_type) _NOEXCEPT
|
||||
void __move_assign_alloc(const __split_buffer& __c, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{__swap_alloc(__x, __y, integral_constant<bool,
|
||||
__alloc_traits::propagate_on_container_swap::value>());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, true_type)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(__x, __y);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, false_type) _NOEXCEPT
|
||||
static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, false_type)
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -202,18 +184,35 @@ __split_buffer<_Tp, _Allocator>::__invariants() const
|
||||
// Precondition: size() + __n <= capacity()
|
||||
// Postcondition: size() == size() + __n
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n)
|
||||
{
|
||||
__construct_at_end(__n, __is_zero_default_constructible<value_type>());
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, false_type)
|
||||
{
|
||||
__alloc_rr& __a = this->__alloc();
|
||||
do
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_));
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), value_type());
|
||||
++this->__end_;
|
||||
--__n;
|
||||
} while (__n > 0);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, true_type)
|
||||
{
|
||||
_STD::memset(this->__end_, 0, __n*sizeof(value_type));
|
||||
this->__end_ += __n;
|
||||
}
|
||||
|
||||
// Copy constructs __n objects starting at __end_ from __x
|
||||
// throws if construction throws
|
||||
// Precondition: __n > 0
|
||||
@@ -221,18 +220,36 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n)
|
||||
// Postcondition: size() == old size() + __n
|
||||
// Postcondition: [i] == __x for all i in [size() - __n, __n)
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
|
||||
{
|
||||
__construct_at_end(__n, __x, integral_constant<bool, has_trivial_copy_constructor<value_type>::value &&
|
||||
has_trivial_copy_assign<value_type>::value>());
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x, false_type)
|
||||
{
|
||||
__alloc_rr& __a = this->__alloc();
|
||||
do
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), __x);
|
||||
++this->__end_;
|
||||
--__n;
|
||||
} while (__n > 0);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x, true_type)
|
||||
{
|
||||
_STD::fill_n(this->__end_, __n, __x);
|
||||
this->__end_ += __n;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InputIter>
|
||||
typename enable_if
|
||||
@@ -249,14 +266,14 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIt
|
||||
if (__end_ == __end_cap())
|
||||
{
|
||||
size_type __old_cap = __end_cap() - __first_;
|
||||
size_type __new_cap = _VSTD::max<size_type>(2 * __old_cap, 8);
|
||||
size_type __new_cap = _STD::max<size_type>(2 * __old_cap, 8);
|
||||
__split_buffer __buf(__new_cap, 0, __a);
|
||||
for (pointer __p = __begin_; __p != __end_; ++__p, ++__buf.__end_)
|
||||
__alloc_traits::construct(__buf.__alloc(),
|
||||
_VSTD::__to_raw_pointer(__buf.__end_), _VSTD::move(*__p));
|
||||
_STD::__to_raw_pointer(__buf.__end_), _STD::move(*__p));
|
||||
swap(__buf);
|
||||
}
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
|
||||
++this->__end_;
|
||||
}
|
||||
}
|
||||
@@ -273,7 +290,7 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _F
|
||||
__alloc_rr& __a = this->__alloc();
|
||||
for (; __first != __last; ++__first)
|
||||
{
|
||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
|
||||
__alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
|
||||
++this->__end_;
|
||||
}
|
||||
}
|
||||
@@ -298,7 +315,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_t
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type)
|
||||
{
|
||||
while (__new_last < __end_)
|
||||
__alloc_traits::destroy(__alloc(), --__end_);
|
||||
@@ -307,7 +324,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_typ
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type) _NOEXCEPT
|
||||
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type)
|
||||
{
|
||||
__end_ = __new_last;
|
||||
}
|
||||
@@ -324,7 +341,6 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
__split_buffer<_Tp, _Allocator>::__split_buffer()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||
: __first_(0), __begin_(0), __end_(0), __end_cap_(0)
|
||||
{
|
||||
}
|
||||
@@ -351,15 +367,14 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
|
||||
__alloc_traits::deallocate(__alloc(), __first_, capacity());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
|
||||
: __first_(_VSTD::move(__c.__first_)),
|
||||
__begin_(_VSTD::move(__c.__begin_)),
|
||||
__end_(_VSTD::move(__c.__end_)),
|
||||
__end_cap_(_VSTD::move(__c.__end_cap_))
|
||||
: __first_(_STD::move(__c.__first_)),
|
||||
__begin_(_STD::move(__c.__begin_)),
|
||||
__end_(_STD::move(__c.__end_)),
|
||||
__end_cap_(_STD::move(__c.__end_cap_))
|
||||
{
|
||||
__c.__first_ = nullptr;
|
||||
__c.__begin_ = nullptr;
|
||||
@@ -396,9 +411,6 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al
|
||||
template <class _Tp, class _Allocator>
|
||||
__split_buffer<_Tp, _Allocator>&
|
||||
__split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
|
||||
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value) ||
|
||||
!__alloc_traits::propagate_on_container_move_assignment::value)
|
||||
{
|
||||
clear();
|
||||
shrink_to_fit();
|
||||
@@ -413,18 +425,16 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
|
||||
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
|
||||
__is_nothrow_swappable<__alloc_rr>::value)
|
||||
{
|
||||
_VSTD::swap(__first_, __x.__first_);
|
||||
_VSTD::swap(__begin_, __x.__begin_);
|
||||
_VSTD::swap(__end_, __x.__end_);
|
||||
_VSTD::swap(__end_cap(), __x.__end_cap());
|
||||
_STD::swap(__first_, __x.__first_);
|
||||
_STD::swap(__begin_, __x.__begin_);
|
||||
_STD::swap(__end_, __x.__end_);
|
||||
_STD::swap(__end_cap(), __x.__end_cap());
|
||||
__swap_alloc(__alloc(), __x.__alloc());
|
||||
}
|
||||
|
||||
@@ -437,16 +447,16 @@ __split_buffer<_Tp, _Allocator>::reserve(size_type __n)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__n, 0, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
__split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
__split_buffer<_Tp, _Allocator>::shrink_to_fit()
|
||||
{
|
||||
if (capacity() > size())
|
||||
{
|
||||
@@ -458,10 +468,10 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
__t.__end_ = __t.__begin_ + (__end_ - __begin_);
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
@@ -481,7 +491,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
|
||||
{
|
||||
difference_type __d = __end_cap() - __end_;
|
||||
__d = (__d + 1) / 2;
|
||||
__begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__begin_ = _STD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__end_ += __d;
|
||||
}
|
||||
else
|
||||
@@ -490,17 +500,17 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__begin_-1), __x);
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__begin_-1), __x);
|
||||
--__begin_;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -512,7 +522,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
|
||||
{
|
||||
difference_type __d = __end_cap() - __end_;
|
||||
__d = (__d + 1) / 2;
|
||||
__begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__begin_ = _STD::move_backward(__begin_, __end_, __end_ + __d);
|
||||
__end_ += __d;
|
||||
}
|
||||
else
|
||||
@@ -521,18 +531,18 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__begin_-1),
|
||||
_VSTD::move(__x));
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__begin_-1),
|
||||
_STD::move(__x));
|
||||
--__begin_;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
@@ -545,7 +555,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
{
|
||||
difference_type __d = __begin_ - __first_;
|
||||
__d = (__d + 1) / 2;
|
||||
__end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
|
||||
__end_ = _STD::move(__begin_, __end_, __begin_ - __d);
|
||||
__begin_ -= __d;
|
||||
}
|
||||
else
|
||||
@@ -554,17 +564,17 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_), __x);
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_), __x);
|
||||
++__end_;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
void
|
||||
@@ -576,7 +586,7 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
{
|
||||
difference_type __d = __begin_ - __first_;
|
||||
__d = (__d + 1) / 2;
|
||||
__end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
|
||||
__end_ = _STD::move(__begin_, __end_, __begin_ - __d);
|
||||
__begin_ -= __d;
|
||||
}
|
||||
else
|
||||
@@ -585,19 +595,17 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
|
||||
_VSTD::move(__x));
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_),
|
||||
_STD::move(__x));
|
||||
++__end_;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class... _Args>
|
||||
void
|
||||
@@ -609,7 +617,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
{
|
||||
difference_type __d = __begin_ - __first_;
|
||||
__d = (__d + 1) / 2;
|
||||
__end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
|
||||
__end_ = _STD::move(__begin_, __end_, __begin_ - __d);
|
||||
__begin_ -= __d;
|
||||
}
|
||||
else
|
||||
@@ -618,30 +626,18 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
|
||||
__split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
|
||||
__t.__construct_at_end(move_iterator<pointer>(__begin_),
|
||||
move_iterator<pointer>(__end_));
|
||||
_VSTD::swap(__first_, __t.__first_);
|
||||
_VSTD::swap(__begin_, __t.__begin_);
|
||||
_VSTD::swap(__end_, __t.__end_);
|
||||
_VSTD::swap(__end_cap(), __t.__end_cap());
|
||||
_STD::swap(__first_, __t.__first_);
|
||||
_STD::swap(__begin_, __t.__begin_);
|
||||
_STD::swap(__end_, __t.__end_);
|
||||
_STD::swap(__end_cap(), __t.__end_cap());
|
||||
}
|
||||
}
|
||||
__alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__alloc_traits::construct(__alloc(), _STD::__to_raw_pointer(__end_),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
++__end_;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
void
|
||||
swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -64,9 +64,7 @@ public:
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(__sso_allocator& __a) const {return &buf_ == &__a.buf_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(__sso_allocator& __a) const {return &buf_ != &__a.buf_;}
|
||||
};
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -97,7 +97,7 @@ typename __stdinbuf<_CharT>::int_type
|
||||
__stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
{
|
||||
char __extbuf[__limit];
|
||||
int __nread = _VSTD::max(1, __encoding_);
|
||||
int __nread = max(1, __encoding_);
|
||||
for (int __i = 0; __i < __nread; ++__i)
|
||||
{
|
||||
char __c = getc(__file_);
|
||||
@@ -120,7 +120,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
&__1buf, &__1buf + 1, __inxt);
|
||||
switch (__r)
|
||||
{
|
||||
case _VSTD::codecvt_base::ok:
|
||||
case _STD::codecvt_base::ok:
|
||||
break;
|
||||
case codecvt_base::partial:
|
||||
__st_ = __sv_st;
|
||||
@@ -136,11 +136,11 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
break;
|
||||
case codecvt_base::error:
|
||||
return traits_type::eof();
|
||||
case _VSTD::codecvt_base::noconv:
|
||||
case _STD::codecvt_base::noconv:
|
||||
__1buf = static_cast<char_type>(__extbuf[0]);
|
||||
break;
|
||||
}
|
||||
} while (__r == _VSTD::codecvt_base::partial);
|
||||
} while (__r == _STD::codecvt_base::partial);
|
||||
}
|
||||
if (!__consume)
|
||||
{
|
||||
@@ -166,9 +166,9 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
|
||||
switch (__cv_->out(__st_, &__ci, &__ci + 1, __inxt,
|
||||
__extbuf, __extbuf + sizeof(__extbuf), __enxt))
|
||||
{
|
||||
case _VSTD::codecvt_base::ok:
|
||||
case _STD::codecvt_base::ok:
|
||||
break;
|
||||
case _VSTD::codecvt_base::noconv:
|
||||
case _STD::codecvt_base::noconv:
|
||||
__extbuf[0] = static_cast<char>(__c);
|
||||
__enxt = __extbuf + 1;
|
||||
break;
|
||||
|
456
include/__tree
456
include/__tree
File diff suppressed because it is too large
Load Diff
157
include/__tuple
157
include/__tuple
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -25,92 +25,45 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
|
||||
template <class _Tp> class tuple_size;
|
||||
template <size_t _Ip, class _Tp> class tuple_element;
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<const _Tp>
|
||||
: public tuple_size<_Tp> {};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<volatile _Tp>
|
||||
: public tuple_size<_Tp> {};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<const volatile _Tp>
|
||||
: public tuple_size<_Tp> {};
|
||||
|
||||
template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
|
||||
|
||||
template <size_t _Ip, class _Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const _Tp>
|
||||
{
|
||||
public:
|
||||
typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class _Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, volatile _Tp>
|
||||
{
|
||||
public:
|
||||
typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class _Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const volatile _Tp>
|
||||
{
|
||||
public:
|
||||
typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
|
||||
};
|
||||
|
||||
template <class ..._Tp> class _LIBCPP_VISIBLE tuple;
|
||||
template <class _T1, class _T2> class _LIBCPP_VISIBLE pair;
|
||||
template <class _Tp, size_t _Size> struct _LIBCPP_VISIBLE array;
|
||||
template <class ..._Tp> class tuple;
|
||||
template <class _T1, class _T2> class pair;
|
||||
template <class _Tp, size_t _Size> struct array;
|
||||
|
||||
template <class _Tp> struct __tuple_like : false_type {};
|
||||
|
||||
template <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {};
|
||||
template <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {};
|
||||
template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {};
|
||||
|
||||
template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
|
||||
template <class... _Tp> struct __tuple_like<tuple<_Tp...>> : true_type {};
|
||||
template <class... _Tp> struct __tuple_like<const tuple<_Tp...>> : true_type {};
|
||||
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
|
||||
template <class _T1, class _T2> struct __tuple_like<const pair<_T1, _T2> > : true_type {};
|
||||
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
|
||||
template <class _Tp, size_t _Size> struct __tuple_like<const array<_Tp, _Size> > : true_type {};
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(tuple<_Tp...>&) _NOEXCEPT;
|
||||
typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
get(tuple<_Tp...>&);
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(const tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(tuple<_Tp...>&&) _NOEXCEPT;
|
||||
const typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
get(const tuple<_Tp...>&);
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(pair<_T1, _T2>&) _NOEXCEPT;
|
||||
get(pair<_T1, _T2>&);
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(const pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(pair<_T1, _T2>&&) _NOEXCEPT;
|
||||
get(const pair<_T1, _T2>&);
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_Tp&
|
||||
get(array<_Tp, _Size>&) _NOEXCEPT;
|
||||
get(array<_Tp, _Size>&);
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
const _Tp&
|
||||
get(const array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_Tp&&
|
||||
get(array<_Tp, _Size>&&) _NOEXCEPT;
|
||||
get(const array<_Tp, _Size>&);
|
||||
|
||||
// __make_tuple_indices
|
||||
|
||||
@@ -143,7 +96,7 @@ struct __make_tuple_indices
|
||||
template <class ..._Tp> struct __tuple_types {};
|
||||
|
||||
template <size_t _Ip>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<> >
|
||||
class tuple_element<_Ip, __tuple_types<>>
|
||||
{
|
||||
public:
|
||||
static_assert(_Ip == 0, "tuple_element index out of range");
|
||||
@@ -151,34 +104,29 @@ public:
|
||||
};
|
||||
|
||||
template <class _Hp, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<0, __tuple_types<_Hp, _Tp...> >
|
||||
class tuple_element<0, __tuple_types<_Hp, _Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef _Hp type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class _Hp, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<_Hp, _Tp...> >
|
||||
class tuple_element<_Ip, __tuple_types<_Hp, _Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef typename tuple_element<_Ip-1, __tuple_types<_Tp...> >::type type;
|
||||
typedef typename tuple_element<_Ip-1, __tuple_types<_Tp...>>::type type;
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<__tuple_types<_Tp...> >
|
||||
class tuple_size<__tuple_types<_Tp...>>
|
||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||
{
|
||||
};
|
||||
|
||||
template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {};
|
||||
template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...>> : true_type {};
|
||||
|
||||
// __make_tuple_types
|
||||
|
||||
// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
|
||||
// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
|
||||
// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
|
||||
// lvalue_reference type, then __tuple_types<_Types&...> is the result.
|
||||
|
||||
template <class _TupleTypes, class _Tp, size_t _Sp, size_t _Ep>
|
||||
struct __make_tuple_types_imp;
|
||||
|
||||
@@ -187,7 +135,7 @@ struct __make_tuple_types_imp<__tuple_types<_Types...>, _Tp, _Sp, _Ep>
|
||||
{
|
||||
typedef typename remove_reference<_Tp>::type _Tpr;
|
||||
typedef typename __make_tuple_types_imp<__tuple_types<_Types...,
|
||||
typename conditional<is_lvalue_reference<_Tp>::value,
|
||||
typename conditional<is_reference<_Tp>::value,
|
||||
typename tuple_element<_Sp, _Tpr>::type&,
|
||||
typename tuple_element<_Sp, _Tpr>::type>::type>,
|
||||
_Tp, _Sp+1, _Ep>::type type;
|
||||
@@ -206,19 +154,45 @@ struct __make_tuple_types
|
||||
typedef typename __make_tuple_types_imp<__tuple_types<>, _Tp, _Sp, _Ep>::type type;
|
||||
};
|
||||
|
||||
// __make_assignable_types
|
||||
|
||||
template <class _Tuple, class _Tp, size_t _Sp, size_t _Ep>
|
||||
struct __make_assignable_types_imp;
|
||||
|
||||
template <class ..._Types, class _Tp, size_t _Sp, size_t _Ep>
|
||||
struct __make_assignable_types_imp<__tuple_types<_Types...>, _Tp, _Sp, _Ep>
|
||||
{
|
||||
typedef typename __make_assignable_types_imp<__tuple_types<_Types...,
|
||||
typename remove_reference<typename tuple_element<_Sp, _Tp>::type>::type>,
|
||||
_Tp, _Sp+1, _Ep>::type type;
|
||||
};
|
||||
|
||||
template <class ..._Types, class _Tp, size_t _Ep>
|
||||
struct __make_assignable_types_imp<__tuple_types<_Types...>, _Tp, _Ep, _Ep>
|
||||
{
|
||||
typedef __tuple_types<_Types...> type;
|
||||
};
|
||||
|
||||
template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, size_t _Sp = 0>
|
||||
struct __make_assignable_types
|
||||
{
|
||||
static_assert(_Sp <= _Ep, "__make_assignable_types input error");
|
||||
typedef typename __make_assignable_types_imp<__tuple_types<>, typename remove_reference<_Tp>::type, _Sp, _Ep>::type type;
|
||||
};
|
||||
|
||||
// __tuple_convertible
|
||||
|
||||
template <bool, class _Tp, class _Up>
|
||||
struct __tuple_convertible_imp : public false_type {};
|
||||
|
||||
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
|
||||
struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
|
||||
struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...>>
|
||||
: public integral_constant<bool,
|
||||
is_constructible<_Up0, _Tp0>::value &&
|
||||
__tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
|
||||
is_convertible<_Tp0, _Up0>::value &&
|
||||
__tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...>>::value> {};
|
||||
|
||||
template <>
|
||||
struct __tuple_convertible_imp<true, __tuple_types<>, __tuple_types<> >
|
||||
struct __tuple_convertible_imp<true, __tuple_types<>, __tuple_types<>>
|
||||
: public true_type {};
|
||||
|
||||
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
|
||||
@@ -235,19 +209,6 @@ struct __tuple_convertible<_Tp, _Up, true, true>
|
||||
|
||||
// __tuple_assignable
|
||||
|
||||
template <bool, class _Tp, class _Up>
|
||||
struct __tuple_assignable_imp : public false_type {};
|
||||
|
||||
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
|
||||
struct __tuple_assignable_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
|
||||
: public integral_constant<bool,
|
||||
is_assignable<_Up0&, _Tp0>::value &&
|
||||
__tuple_assignable_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
|
||||
|
||||
template <>
|
||||
struct __tuple_assignable_imp<true, __tuple_types<>, __tuple_types<> >
|
||||
: public true_type {};
|
||||
|
||||
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
|
||||
bool = __tuple_like<_Up>::value>
|
||||
struct __tuple_assignable
|
||||
@@ -255,9 +216,9 @@ struct __tuple_assignable
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
struct __tuple_assignable<_Tp, _Up, true, true>
|
||||
: public __tuple_assignable_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
|
||||
tuple_size<_Up>::value,
|
||||
typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
|
||||
: public __tuple_convertible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
|
||||
tuple_size<_Up>::value,
|
||||
typename __make_tuple_types<_Tp>::type, typename __make_assignable_types<_Up>::type>
|
||||
{};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
|
||||
template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
|
||||
template <class _Tp> class tuple_size;
|
||||
template <size_t _Ip, class _Tp> class tuple_element;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
144
include/array
144
include/array
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -34,28 +34,28 @@ struct array
|
||||
|
||||
// No explicit construct/copy/destroy for aggregate type
|
||||
void fill(const T& u);
|
||||
void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>())));
|
||||
void swap(array& a);
|
||||
|
||||
// iterators:
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
|
||||
// capacity:
|
||||
constexpr size_type size() const noexcept;
|
||||
constexpr size_type max_size() const noexcept;
|
||||
bool empty() const noexcept;
|
||||
constexpr size_type size() const;
|
||||
constexpr size_type max_size() const;
|
||||
bool empty() const;
|
||||
|
||||
// element access:
|
||||
reference operator[](size_type n);
|
||||
@@ -68,8 +68,8 @@ struct array
|
||||
reference back();
|
||||
const_reference back() const;
|
||||
|
||||
T* data() noexcept;
|
||||
const T* data() const noexcept;
|
||||
T* data();
|
||||
const T* data() const;
|
||||
};
|
||||
|
||||
template <class T, size_t N>
|
||||
@@ -86,15 +86,14 @@ template <class T, size_t N>
|
||||
bool operator>=(const array<T,N>& x, const array<T,N>& y);
|
||||
|
||||
template <class T, size_t N >
|
||||
void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y)));
|
||||
void swap(array<T,N>& x, array<T,N>& y);
|
||||
|
||||
template <class T> class tuple_size;
|
||||
template <int I, class T> class tuple_element;
|
||||
template <class T, size_t N> struct tuple_size<array<T, N>>;
|
||||
template <int I, class T, size_t N> struct tuple_element<I, array<T, N>>;
|
||||
template <int I, class T, size_t N> T& get(array<T, N>&) noexcept;
|
||||
template <int I, class T, size_t N> const T& get(const array<T, N>&) noexcept;
|
||||
template <int I, class T, size_t N> T&& get(array<T, N>&&) noexcept;
|
||||
template <int I, class T, size_t N> T& get(array<T, N>&);
|
||||
template <int I, class T, size_t N> const T& get(const array<T, N>&);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -116,7 +115,7 @@ template <int I, class T, size_t N> T&& get(array<T, N>&&) noexcept;
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
struct _LIBCPP_VISIBLE array
|
||||
struct array
|
||||
{
|
||||
// types:
|
||||
typedef array __self;
|
||||
@@ -135,47 +134,29 @@ struct _LIBCPP_VISIBLE array
|
||||
value_type __elems_[_Size > 0 ? _Size : 1];
|
||||
|
||||
// No explicit construct/copy/destroy for aggregate type
|
||||
_LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u)
|
||||
{_VSTD::fill_n(__elems_, _Size, __u);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{_VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u) {_STD::fill_n(__elems_, _Size, __u);}
|
||||
_LIBCPP_INLINE_VISIBILITY void swap(array& __a) {_STD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
|
||||
|
||||
// iterators:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() _NOEXCEPT {return iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const _NOEXCEPT {return const_iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() _NOEXCEPT {return iterator(__elems_ + _Size);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const _NOEXCEPT {return const_iterator(__elems_ + _Size);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const {return const_iterator(__elems_);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__elems_ + _Size);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const {return const_iterator(__elems_ + _Size);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cbegin() const {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator cend() const {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crbegin() const {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator crend() const {return rend();}
|
||||
|
||||
// capacity:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*constexpr*/ size_type size() const _NOEXCEPT {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
/*constexpr*/ size_type max_size() const _NOEXCEPT {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return _Size == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY /*constexpr*/ size_type size() const {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY /*constexpr*/ size_type max_size() const {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return _Size == 0;}
|
||||
|
||||
// element access:
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];}
|
||||
@@ -188,10 +169,8 @@ struct _LIBCPP_VISIBLE array
|
||||
_LIBCPP_INLINE_VISIBILITY reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type* data() _NOEXCEPT {return __elems_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type* data() const _NOEXCEPT {return __elems_;}
|
||||
_LIBCPP_INLINE_VISIBILITY value_type* data() {return __elems_;}
|
||||
_LIBCPP_INLINE_VISIBILITY const value_type* data() const {return __elems_;}
|
||||
};
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
@@ -225,7 +204,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
{
|
||||
return _VSTD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
|
||||
return _STD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
@@ -241,7 +220,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
|
||||
return _STD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
@@ -270,34 +249,27 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
typename enable_if
|
||||
<
|
||||
__is_swappable<_Tp>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_size<array<_Tp, _Size> >
|
||||
: public integral_constant<size_t, _Size> {};
|
||||
class tuple_size<array<_Tp, _Size> > : public integral_constant<size_t, _Size> {};
|
||||
|
||||
template <class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_size<const array<_Tp, _Size> >
|
||||
: public integral_constant<size_t, _Size> {};
|
||||
class tuple_size<const array<_Tp, _Size> > : public integral_constant<size_t, _Size> {};
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, array<_Tp, _Size> >
|
||||
class tuple_element<_Ip, array<_Tp, _Size> >
|
||||
{
|
||||
public:
|
||||
typedef _Tp type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const array<_Tp, _Size> >
|
||||
class tuple_element<_Ip, const array<_Tp, _Size> >
|
||||
{
|
||||
public:
|
||||
typedef const _Tp type;
|
||||
@@ -306,7 +278,7 @@ public:
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
_Tp&
|
||||
get(array<_Tp, _Size>& __a) _NOEXCEPT
|
||||
get(array<_Tp, _Size>& __a)
|
||||
{
|
||||
return __a[_Ip];
|
||||
}
|
||||
@@ -314,23 +286,11 @@ get(array<_Tp, _Size>& __a) _NOEXCEPT
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
const _Tp&
|
||||
get(const array<_Tp, _Size>& __a) _NOEXCEPT
|
||||
get(const array<_Tp, _Size>& __a)
|
||||
{
|
||||
return __a[_Ip];
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
_Tp&&
|
||||
get(array<_Tp, _Size>&& __a) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::move(__a[_Ip]);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_ARRAY
|
||||
|
1513
include/atomic
1513
include/atomic
File diff suppressed because it is too large
Load Diff
362
include/bitset
362
include/bitset
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -27,23 +27,20 @@ public:
|
||||
class reference
|
||||
{
|
||||
friend class bitset;
|
||||
reference() noexcept;
|
||||
reference();
|
||||
public:
|
||||
~reference() noexcept;
|
||||
reference& operator=(bool x) noexcept; // for b[i] = x;
|
||||
reference& operator=(const reference&) noexcept; // for b[i] = b[j];
|
||||
bool operator~() const noexcept; // flips the bit
|
||||
operator bool() const noexcept; // for x = b[i];
|
||||
reference& flip() noexcept; // for b[i].flip();
|
||||
~reference();
|
||||
reference& operator=(bool x); // for b[i] = x;
|
||||
reference& operator=(const reference&); // for b[i] = b[j];
|
||||
bool operator~() const; // flips the bit
|
||||
operator bool() const; // for x = b[i];
|
||||
reference& flip(); // for b[i].flip();
|
||||
};
|
||||
|
||||
// 23.3.5.1 constructors:
|
||||
constexpr bitset() noexcept;
|
||||
constexpr bitset(unsigned long long val) noexcept;
|
||||
template <class charT>
|
||||
explicit bitset(const charT* str,
|
||||
typename basic_string<charT>::size_type n = basic_string<charT>::npos,
|
||||
charT zero = charT('0'), charT one = charT('1'));
|
||||
constexpr bitset();
|
||||
constexpr bitset(unsigned long long val);
|
||||
explicit bitset( const char* str );
|
||||
template<class charT, class traits, class Allocator>
|
||||
explicit bitset(const basic_string<charT,traits,Allocator>& str,
|
||||
typename basic_string<charT,traits,Allocator>::size_type pos = 0,
|
||||
@@ -52,17 +49,17 @@ public:
|
||||
charT zero = charT('0'), charT one = charT('1'));
|
||||
|
||||
// 23.3.5.2 bitset operations:
|
||||
bitset& operator&=(const bitset& rhs) noexcept;
|
||||
bitset& operator|=(const bitset& rhs) noexcept;
|
||||
bitset& operator^=(const bitset& rhs) noexcept;
|
||||
bitset& operator<<=(size_t pos) noexcept;
|
||||
bitset& operator>>=(size_t pos) noexcept;
|
||||
bitset& set() noexcept;
|
||||
bitset& operator&=(const bitset& rhs);
|
||||
bitset& operator|=(const bitset& rhs);
|
||||
bitset& operator^=(const bitset& rhs);
|
||||
bitset& operator<<=(size_t pos);
|
||||
bitset& operator>>=(size_t pos);
|
||||
bitset& set();
|
||||
bitset& set(size_t pos, bool val = true);
|
||||
bitset& reset() noexcept;
|
||||
bitset& reset();
|
||||
bitset& reset(size_t pos);
|
||||
bitset operator~() const noexcept;
|
||||
bitset& flip() noexcept;
|
||||
bitset operator~() const;
|
||||
bitset& flip();
|
||||
bitset& flip(size_t pos);
|
||||
|
||||
// element access:
|
||||
@@ -77,27 +74,27 @@ public:
|
||||
template <class charT>
|
||||
basic_string<charT, char_traits<charT>, allocator<charT> > to_string(charT zero = charT('0'), charT one = charT('1')) const;
|
||||
basic_string<char, char_traits<char>, allocator<char> > to_string(char zero = '0', char one = '1') const;
|
||||
size_t count() const noexcept;
|
||||
constexpr size_t size() const noexcept;
|
||||
bool operator==(const bitset& rhs) const noexcept;
|
||||
bool operator!=(const bitset& rhs) const noexcept;
|
||||
size_t count() const;
|
||||
constexpr size_t size() const;
|
||||
bool operator==(const bitset& rhs) const;
|
||||
bool operator!=(const bitset& rhs) const;
|
||||
bool test(size_t pos) const;
|
||||
bool all() const noexcept;
|
||||
bool any() const noexcept;
|
||||
bool none() const noexcept;
|
||||
bitset operator<<(size_t pos) const noexcept;
|
||||
bitset operator>>(size_t pos) const noexcept;
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
bool none() const;
|
||||
bitset operator<<(size_t pos) const;
|
||||
bitset operator>>(size_t pos) const;
|
||||
};
|
||||
|
||||
// 23.3.5.3 bitset operators:
|
||||
template <size_t N>
|
||||
bitset<N> operator&(const bitset<N>&, const bitset<N>&) noexcept;
|
||||
bitset<N> operator&(const bitset<N>&, const bitset<N>&);
|
||||
|
||||
template <size_t N>
|
||||
bitset<N> operator|(const bitset<N>&, const bitset<N>&) noexcept;
|
||||
bitset<N> operator|(const bitset<N>&, const bitset<N>&);
|
||||
|
||||
template <size_t N>
|
||||
bitset<N> operator^(const bitset<N>&, const bitset<N>&) noexcept;
|
||||
bitset<N> operator^(const bitset<N>&, const bitset<N>&);
|
||||
|
||||
template <class charT, class traits, size_t N>
|
||||
basic_istream<charT, traits>&
|
||||
@@ -129,15 +126,6 @@ template <size_t N> struct hash<std::bitset<N>>;
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
class __bitset;
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
struct __has_storage_type<__bitset<_N_words, _Size> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
class __bitset
|
||||
{
|
||||
@@ -164,34 +152,34 @@ protected:
|
||||
typedef __bit_iterator<__bitset, false> iterator;
|
||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||
|
||||
__bitset() _NOEXCEPT;
|
||||
explicit __bitset(unsigned long long __v) _NOEXCEPT;
|
||||
__bitset();
|
||||
explicit __bitset(unsigned long long __v);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos)
|
||||
{return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const
|
||||
{return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos)
|
||||
{return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const
|
||||
{return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
|
||||
void operator&=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator|=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator^=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator&=(const __bitset& __v);
|
||||
void operator|=(const __bitset& __v);
|
||||
void operator^=(const __bitset& __v);
|
||||
|
||||
void flip() _NOEXCEPT;
|
||||
void flip();
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const
|
||||
{return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());}
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const
|
||||
{return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());}
|
||||
|
||||
bool all() const _NOEXCEPT;
|
||||
bool any() const _NOEXCEPT;
|
||||
size_t __hash_code() const _NOEXCEPT;
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
size_t __hash_code() const;
|
||||
private:
|
||||
void __init(unsigned long long __v, false_type) _NOEXCEPT;
|
||||
void __init(unsigned long long __v, true_type) _NOEXCEPT;
|
||||
void __init(unsigned long long __v, false_type);
|
||||
void __init(unsigned long long __v, true_type);
|
||||
unsigned long to_ulong(false_type) const;
|
||||
unsigned long to_ulong(true_type) const;
|
||||
unsigned long long to_ullong(false_type) const;
|
||||
@@ -202,9 +190,9 @@ private:
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::__bitset()
|
||||
{
|
||||
_VSTD::fill_n(__first_, _N_words, __storage_type(0));
|
||||
_STD::fill_n(__first_, _N_words, __storage_type(0));
|
||||
}
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
@@ -214,8 +202,8 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, false_type)
|
||||
__storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)];
|
||||
for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word)
|
||||
__t[__i] = static_cast<__storage_type>(__v);
|
||||
_VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
|
||||
_VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
|
||||
_STD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
|
||||
_STD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
|
||||
__storage_type(0));
|
||||
}
|
||||
|
||||
@@ -225,12 +213,12 @@ void
|
||||
__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type)
|
||||
{
|
||||
__first_[0] = __v;
|
||||
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||
_STD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||
}
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::__bitset(unsigned long long __v)
|
||||
{
|
||||
__init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
|
||||
}
|
||||
@@ -238,7 +226,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::operator&=(const __bitset& __v)
|
||||
{
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
__first_[__i] &= __v.__first_[__i];
|
||||
@@ -247,7 +235,7 @@ __bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::operator|=(const __bitset& __v)
|
||||
{
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
__first_[__i] |= __v.__first_[__i];
|
||||
@@ -256,7 +244,7 @@ __bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<_N_words, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::operator^=(const __bitset& __v)
|
||||
{
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
__first_[__i] ^= __v.__first_[__i];
|
||||
@@ -264,7 +252,7 @@ __bitset<_N_words, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
void
|
||||
__bitset<_N_words, _Size>::flip() _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::flip()
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = _Size;
|
||||
@@ -286,7 +274,7 @@ unsigned long
|
||||
__bitset<_N_words, _Size>::to_ulong(false_type) const
|
||||
{
|
||||
const_iterator __e = __make_iter(_Size);
|
||||
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
|
||||
const_iterator __i = _STD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
|
||||
if (__i != __e)
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw overflow_error("bitset to_ulong overflow error");
|
||||
@@ -309,7 +297,7 @@ unsigned long long
|
||||
__bitset<_N_words, _Size>::to_ullong(false_type) const
|
||||
{
|
||||
const_iterator __e = __make_iter(_Size);
|
||||
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
|
||||
const_iterator __i = _STD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
|
||||
if (__i != __e)
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw overflow_error("bitset to_ullong overflow error");
|
||||
@@ -347,7 +335,7 @@ __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
bool
|
||||
__bitset<_N_words, _Size>::all() const _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::all() const
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = _Size;
|
||||
@@ -367,7 +355,7 @@ __bitset<_N_words, _Size>::all() const _NOEXCEPT
|
||||
|
||||
template <size_t _N_words, size_t _Size>
|
||||
bool
|
||||
__bitset<_N_words, _Size>::any() const _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::any() const
|
||||
{
|
||||
// do middle whole words
|
||||
size_type __n = _Size;
|
||||
@@ -388,7 +376,7 @@ __bitset<_N_words, _Size>::any() const _NOEXCEPT
|
||||
template <size_t _N_words, size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
__bitset<_N_words, _Size>::__hash_code() const _NOEXCEPT
|
||||
__bitset<_N_words, _Size>::__hash_code() const
|
||||
{
|
||||
size_t __h = 0;
|
||||
for (size_type __i = 0; __i < _N_words; ++__i)
|
||||
@@ -422,43 +410,43 @@ protected:
|
||||
typedef __bit_iterator<__bitset, false> iterator;
|
||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||
|
||||
__bitset() _NOEXCEPT;
|
||||
explicit __bitset(unsigned long long __v) _NOEXCEPT;
|
||||
__bitset();
|
||||
explicit __bitset(unsigned long long __v);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos)
|
||||
{return reference(&__first_, __storage_type(1) << __pos);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const
|
||||
{return const_reference(&__first_, __storage_type(1) << __pos);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos)
|
||||
{return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const
|
||||
{return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||
|
||||
void operator&=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator|=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator^=(const __bitset& __v) _NOEXCEPT;
|
||||
void operator&=(const __bitset& __v);
|
||||
void operator|=(const __bitset& __v);
|
||||
void operator^=(const __bitset& __v);
|
||||
|
||||
void flip() _NOEXCEPT;
|
||||
void flip();
|
||||
|
||||
unsigned long to_ulong() const;
|
||||
unsigned long long to_ullong() const;
|
||||
|
||||
bool all() const _NOEXCEPT;
|
||||
bool any() const _NOEXCEPT;
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
|
||||
size_t __hash_code() const _NOEXCEPT;
|
||||
size_t __hash_code() const;
|
||||
};
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<1, _Size>::__bitset() _NOEXCEPT
|
||||
__bitset<1, _Size>::__bitset()
|
||||
: __first_(0)
|
||||
{
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
__bitset<1, _Size>::__bitset(unsigned long long __v)
|
||||
: __first_(static_cast<__storage_type>(__v))
|
||||
{
|
||||
}
|
||||
@@ -466,7 +454,7 @@ __bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
|
||||
__bitset<1, _Size>::operator&=(const __bitset& __v)
|
||||
{
|
||||
__first_ &= __v.__first_;
|
||||
}
|
||||
@@ -474,7 +462,7 @@ __bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
|
||||
__bitset<1, _Size>::operator|=(const __bitset& __v)
|
||||
{
|
||||
__first_ |= __v.__first_;
|
||||
}
|
||||
@@ -482,7 +470,7 @@ __bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
|
||||
__bitset<1, _Size>::operator^=(const __bitset& __v)
|
||||
{
|
||||
__first_ ^= __v.__first_;
|
||||
}
|
||||
@@ -490,7 +478,7 @@ __bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__bitset<1, _Size>::flip() _NOEXCEPT
|
||||
__bitset<1, _Size>::flip()
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
|
||||
__first_ = ~__first_;
|
||||
@@ -516,7 +504,7 @@ __bitset<1, _Size>::to_ullong() const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
__bitset<1, _Size>::all() const _NOEXCEPT
|
||||
__bitset<1, _Size>::all() const
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
|
||||
return !(~__first_ & __m);
|
||||
@@ -525,7 +513,7 @@ __bitset<1, _Size>::all() const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
__bitset<1, _Size>::any() const _NOEXCEPT
|
||||
__bitset<1, _Size>::any() const
|
||||
{
|
||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
|
||||
return __first_ & __m;
|
||||
@@ -534,7 +522,7 @@ __bitset<1, _Size>::any() const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
__bitset<1, _Size>::__hash_code() const _NOEXCEPT
|
||||
__bitset<1, _Size>::__hash_code() const
|
||||
{
|
||||
return __first_;
|
||||
}
|
||||
@@ -563,40 +551,40 @@ protected:
|
||||
typedef __bit_iterator<__bitset, false> iterator;
|
||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||
|
||||
__bitset() _NOEXCEPT;
|
||||
explicit __bitset(unsigned long long) _NOEXCEPT;
|
||||
__bitset();
|
||||
explicit __bitset(unsigned long long);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t)
|
||||
{return reference(0, 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t) const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t) const
|
||||
{return const_reference(0, 1);}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos)
|
||||
{return iterator(0, 0);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const
|
||||
{return const_iterator(0, 0);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator^=(const __bitset&) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) {}
|
||||
_LIBCPP_INLINE_VISIBILITY void operator^=(const __bitset&) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY void flip() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const {return 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const {return 0;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool all() const {return true;}
|
||||
_LIBCPP_INLINE_VISIBILITY bool any() const {return false;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY size_t __hash_code() const {return 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<0, 0>::__bitset() _NOEXCEPT
|
||||
__bitset<0, 0>::__bitset()
|
||||
{
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
|
||||
__bitset<0, 0>::__bitset(unsigned long long)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -604,7 +592,7 @@ template <size_t _Size> class bitset;
|
||||
template <size_t _Size> struct hash<bitset<_Size> >;
|
||||
|
||||
template <size_t _Size>
|
||||
class _LIBCPP_VISIBLE bitset
|
||||
class bitset
|
||||
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
|
||||
{
|
||||
static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1;
|
||||
@@ -615,12 +603,9 @@ public:
|
||||
typedef typename base::const_reference const_reference;
|
||||
|
||||
// 23.3.5.1 constructors:
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset() _NOEXCEPT {}
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
|
||||
template<class _CharT>
|
||||
explicit bitset(const _CharT* __str,
|
||||
typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
|
||||
_CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset() {}
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset(unsigned long long __v) : base(__v) {}
|
||||
explicit bitset(const char* __str);
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
explicit bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
typename basic_string<_CharT,_Traits,_Allocator>::size_type __pos = 0,
|
||||
@@ -629,17 +614,17 @@ public:
|
||||
_CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
|
||||
|
||||
// 23.3.5.2 bitset operations:
|
||||
bitset& operator&=(const bitset& __rhs) _NOEXCEPT;
|
||||
bitset& operator|=(const bitset& __rhs) _NOEXCEPT;
|
||||
bitset& operator^=(const bitset& __rhs) _NOEXCEPT;
|
||||
bitset& operator<<=(size_t __pos) _NOEXCEPT;
|
||||
bitset& operator>>=(size_t __pos) _NOEXCEPT;
|
||||
bitset& set() _NOEXCEPT;
|
||||
bitset& operator&=(const bitset& __rhs);
|
||||
bitset& operator|=(const bitset& __rhs);
|
||||
bitset& operator^=(const bitset& __rhs);
|
||||
bitset& operator<<=(size_t __pos);
|
||||
bitset& operator>>=(size_t __pos);
|
||||
bitset& set();
|
||||
bitset& set(size_t __pos, bool __val = true);
|
||||
bitset& reset() _NOEXCEPT;
|
||||
bitset& reset();
|
||||
bitset& reset(size_t __pos);
|
||||
bitset operator~() const _NOEXCEPT;
|
||||
bitset& flip() _NOEXCEPT;
|
||||
bitset operator~() const;
|
||||
bitset& flip();
|
||||
bitset& flip(size_t __pos);
|
||||
|
||||
// element access:
|
||||
@@ -658,50 +643,50 @@ public:
|
||||
_CharT __one = _CharT('1')) const;
|
||||
basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
|
||||
char __one = '1') const;
|
||||
size_t count() const _NOEXCEPT;
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY size_t size() const _NOEXCEPT {return _Size;}
|
||||
bool operator==(const bitset& __rhs) const _NOEXCEPT;
|
||||
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
|
||||
size_t count() const;
|
||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY size_t size() const {return _Size;}
|
||||
bool operator==(const bitset& __rhs) const;
|
||||
bool operator!=(const bitset& __rhs) const;
|
||||
bool test(size_t __pos) const;
|
||||
bool all() const _NOEXCEPT;
|
||||
bool any() const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();}
|
||||
bitset operator<<(size_t __pos) const _NOEXCEPT;
|
||||
bitset operator>>(size_t __pos) const _NOEXCEPT;
|
||||
bool all() const;
|
||||
bool any() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool none() const {return !any();}
|
||||
bitset operator<<(size_t __pos) const;
|
||||
bitset operator>>(size_t __pos) const;
|
||||
|
||||
private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t __hash_code() const _NOEXCEPT {return base::__hash_code();}
|
||||
size_t __hash_code() const {return base::__hash_code();}
|
||||
|
||||
friend struct hash<bitset>;
|
||||
};
|
||||
|
||||
template <size_t _Size>
|
||||
template<class _CharT>
|
||||
bitset<_Size>::bitset(const _CharT* __str,
|
||||
typename basic_string<_CharT>::size_type __n,
|
||||
_CharT __zero, _CharT __one)
|
||||
bitset<_Size>::bitset(const char* __str)
|
||||
{
|
||||
size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
|
||||
size_t __rlen = strlen(__str);
|
||||
for (size_t __i = 0; __i < __rlen; ++__i)
|
||||
if (__str[__i] != __zero && __str[__i] != __one)
|
||||
if (__str[__i] != '0' && __str[__i] != '1')
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw invalid_argument("bitset string ctor has invalid argument");
|
||||
#else
|
||||
assert(!"bitset string ctor has invalid argument");
|
||||
#endif
|
||||
size_t _M = _VSTD::min(__rlen, _Size);
|
||||
size_t _M = _STD::min(__rlen, _Size);
|
||||
size_t __i = 0;
|
||||
for (; __i < _M; ++__i)
|
||||
{
|
||||
_CharT __c = __str[_M - 1 - __i];
|
||||
if (__c == __zero)
|
||||
switch (__str[_M - 1 - __i])
|
||||
{
|
||||
case '0':
|
||||
(*this)[__i] = false;
|
||||
else
|
||||
break;
|
||||
case '1':
|
||||
(*this)[__i] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
_STD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
@@ -717,7 +702,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
#else
|
||||
assert(!"bitset string pos out of range");
|
||||
#endif
|
||||
size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
|
||||
size_t __rlen = _STD::min(__n, __str.size() - __pos);
|
||||
for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
|
||||
if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -725,7 +710,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
#else
|
||||
assert(!"bitset string ctor has invalid argument");
|
||||
#endif
|
||||
size_t _M = _VSTD::min(__rlen, _Size);
|
||||
size_t _M = _STD::min(__rlen, _Size);
|
||||
size_t __i = 0;
|
||||
for (; __i < _M; ++__i)
|
||||
{
|
||||
@@ -735,13 +720,13 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
|
||||
else
|
||||
(*this)[__i] = true;
|
||||
}
|
||||
_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
_STD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
|
||||
bitset<_Size>::operator&=(const bitset& __rhs)
|
||||
{
|
||||
base::operator&=(__rhs);
|
||||
return *this;
|
||||
@@ -750,7 +735,7 @@ bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT
|
||||
bitset<_Size>::operator|=(const bitset& __rhs)
|
||||
{
|
||||
base::operator|=(__rhs);
|
||||
return *this;
|
||||
@@ -759,7 +744,7 @@ bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT
|
||||
bitset<_Size>::operator^=(const bitset& __rhs)
|
||||
{
|
||||
base::operator^=(__rhs);
|
||||
return *this;
|
||||
@@ -767,30 +752,30 @@ bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT
|
||||
|
||||
template <size_t _Size>
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
|
||||
bitset<_Size>::operator<<=(size_t __pos)
|
||||
{
|
||||
__pos = _VSTD::min(__pos, _Size);
|
||||
_VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
|
||||
_VSTD::fill_n(base::__make_iter(0), __pos, false);
|
||||
__pos = _STD::min(__pos, _Size);
|
||||
_STD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
|
||||
_STD::fill_n(base::__make_iter(0), __pos, false);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
|
||||
bitset<_Size>::operator>>=(size_t __pos)
|
||||
{
|
||||
__pos = _VSTD::min(__pos, _Size);
|
||||
_VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
|
||||
_VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
|
||||
__pos = _STD::min(__pos, _Size);
|
||||
_STD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
|
||||
_STD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::set() _NOEXCEPT
|
||||
bitset<_Size>::set()
|
||||
{
|
||||
_VSTD::fill_n(base::__make_iter(0), _Size, true);
|
||||
_STD::fill_n(base::__make_iter(0), _Size, true);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -811,9 +796,9 @@ bitset<_Size>::set(size_t __pos, bool __val)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::reset() _NOEXCEPT
|
||||
bitset<_Size>::reset()
|
||||
{
|
||||
_VSTD::fill_n(base::__make_iter(0), _Size, false);
|
||||
_STD::fill_n(base::__make_iter(0), _Size, false);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -834,7 +819,7 @@ bitset<_Size>::reset(size_t __pos)
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
bitset<_Size>::operator~() const _NOEXCEPT
|
||||
bitset<_Size>::operator~() const
|
||||
{
|
||||
bitset __x(*this);
|
||||
__x.flip();
|
||||
@@ -844,7 +829,7 @@ bitset<_Size>::operator~() const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>&
|
||||
bitset<_Size>::flip() _NOEXCEPT
|
||||
bitset<_Size>::flip()
|
||||
{
|
||||
base::flip();
|
||||
return *this;
|
||||
@@ -924,23 +909,23 @@ bitset<_Size>::to_string(char __zero, char __one) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
size_t
|
||||
bitset<_Size>::count() const _NOEXCEPT
|
||||
bitset<_Size>::count() const
|
||||
{
|
||||
return static_cast<size_t>(_VSTD::count(base::__make_iter(0), base::__make_iter(_Size), true));
|
||||
return static_cast<size_t>(_STD::count(base::__make_iter(0), base::__make_iter(_Size), true));
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
|
||||
bitset<_Size>::operator==(const bitset& __rhs) const
|
||||
{
|
||||
return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
|
||||
return _STD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT
|
||||
bitset<_Size>::operator!=(const bitset& __rhs) const
|
||||
{
|
||||
return !(*this == __rhs);
|
||||
}
|
||||
@@ -961,7 +946,7 @@ bitset<_Size>::test(size_t __pos) const
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::all() const _NOEXCEPT
|
||||
bitset<_Size>::all() const
|
||||
{
|
||||
return base::all();
|
||||
}
|
||||
@@ -969,7 +954,7 @@ bitset<_Size>::all() const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
bitset<_Size>::any() const _NOEXCEPT
|
||||
bitset<_Size>::any() const
|
||||
{
|
||||
return base::any();
|
||||
}
|
||||
@@ -977,7 +962,7 @@ bitset<_Size>::any() const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT
|
||||
bitset<_Size>::operator<<(size_t __pos) const
|
||||
{
|
||||
bitset __r = *this;
|
||||
__r <<= __pos;
|
||||
@@ -987,7 +972,7 @@ bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT
|
||||
bitset<_Size>::operator>>(size_t __pos) const
|
||||
{
|
||||
bitset __r = *this;
|
||||
__r >>= __pos;
|
||||
@@ -997,7 +982,7 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
operator&(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
{
|
||||
bitset<_Size> __r = __x;
|
||||
__r &= __y;
|
||||
@@ -1007,7 +992,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
operator|(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
{
|
||||
bitset<_Size> __r = __x;
|
||||
__r |= __y;
|
||||
@@ -1017,7 +1002,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
template <size_t _Size>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bitset<_Size>
|
||||
operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
operator^(const bitset<_Size>& __x, const bitset<_Size>& __y)
|
||||
{
|
||||
bitset<_Size> __r = __x;
|
||||
__r ^= __y;
|
||||
@@ -1025,22 +1010,13 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
||||
}
|
||||
|
||||
template <size_t _Size>
|
||||
struct _LIBCPP_VISIBLE hash<bitset<_Size> >
|
||||
struct hash<bitset<_Size> >
|
||||
: public unary_function<bitset<_Size>, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT
|
||||
size_t operator()(const bitset<_Size>& __bs) const
|
||||
{return __bs.__hash_code();}
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x);
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_BITSET
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
340
include/cerrno
340
include/cerrno
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -30,362 +30,28 @@ Macros:
|
||||
|
||||
#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
|
||||
|
||||
#ifdef ELAST
|
||||
|
||||
const int __elast1 = ELAST+1;
|
||||
const int __elast2 = ELAST+2;
|
||||
|
||||
#else
|
||||
|
||||
const int __elast1 = 104;
|
||||
const int __elast2 = 105;
|
||||
|
||||
#endif
|
||||
#undef ELAST
|
||||
|
||||
#ifdef ENOTRECOVERABLE
|
||||
|
||||
#define EOWNERDEAD __elast1
|
||||
|
||||
#ifdef ELAST
|
||||
#undef ELAST
|
||||
#define ELAST EOWNERDEAD
|
||||
#endif
|
||||
|
||||
#elif defined(EOWNERDEAD)
|
||||
|
||||
#define ENOTRECOVERABLE __elast1
|
||||
#ifdef ELAST
|
||||
#undef ELAST
|
||||
#define ELAST ENOTRECOVERABLE
|
||||
#endif
|
||||
|
||||
#else // defined(EOWNERDEAD)
|
||||
|
||||
#define EOWNERDEAD __elast1
|
||||
#define ENOTRECOVERABLE __elast2
|
||||
#ifdef ELAST
|
||||
#undef ELAST
|
||||
#define ELAST ENOTRECOVERABLE
|
||||
#endif
|
||||
|
||||
#endif // defined(EOWNERDEAD)
|
||||
|
||||
#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
|
||||
|
||||
// supply errno values likely to be missing, particularly on Windows
|
||||
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT 9901
|
||||
#endif
|
||||
|
||||
#ifndef EADDRINUSE
|
||||
#define EADDRINUSE 9902
|
||||
#endif
|
||||
|
||||
#ifndef EADDRNOTAVAIL
|
||||
#define EADDRNOTAVAIL 9903
|
||||
#endif
|
||||
|
||||
#ifndef EISCONN
|
||||
#define EISCONN 9904
|
||||
#endif
|
||||
|
||||
#ifndef EBADMSG
|
||||
#define EBADMSG 9905
|
||||
#endif
|
||||
|
||||
#ifndef ECONNABORTED
|
||||
#define ECONNABORTED 9906
|
||||
#endif
|
||||
|
||||
#ifndef EALREADY
|
||||
#define EALREADY 9907
|
||||
#endif
|
||||
|
||||
#ifndef ECONNREFUSED
|
||||
#define ECONNREFUSED 9908
|
||||
#endif
|
||||
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET 9909
|
||||
#endif
|
||||
|
||||
#ifndef EDESTADDRREQ
|
||||
#define EDESTADDRREQ 9910
|
||||
#endif
|
||||
|
||||
#ifndef EHOSTUNREACH
|
||||
#define EHOSTUNREACH 9911
|
||||
#endif
|
||||
|
||||
#ifndef EIDRM
|
||||
#define EIDRM 9912
|
||||
#endif
|
||||
|
||||
#ifndef EMSGSIZE
|
||||
#define EMSGSIZE 9913
|
||||
#endif
|
||||
|
||||
#ifndef ENETDOWN
|
||||
#define ENETDOWN 9914
|
||||
#endif
|
||||
|
||||
#ifndef ENETRESET
|
||||
#define ENETRESET 9915
|
||||
#endif
|
||||
|
||||
#ifndef ENETUNREACH
|
||||
#define ENETUNREACH 9916
|
||||
#endif
|
||||
|
||||
#ifndef ENOBUFS
|
||||
#define ENOBUFS 9917
|
||||
#endif
|
||||
|
||||
#ifndef ENOLINK
|
||||
#define ENOLINK 9918
|
||||
#endif
|
||||
|
||||
#ifndef ENODATA
|
||||
#define ENODATA 9919
|
||||
#endif
|
||||
|
||||
#ifndef ENOMSG
|
||||
#define ENOMSG 9920
|
||||
#endif
|
||||
|
||||
#ifndef ENOPROTOOPT
|
||||
#define ENOPROTOOPT 9921
|
||||
#endif
|
||||
|
||||
#ifndef ENOSR
|
||||
#define ENOSR 9922
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSOCK
|
||||
#define ENOTSOCK 9923
|
||||
#endif
|
||||
|
||||
#ifndef ENOSTR
|
||||
#define ENOSTR 9924
|
||||
#endif
|
||||
|
||||
#ifndef ENOTCONN
|
||||
#define ENOTCONN 9925
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSUP
|
||||
#define ENOTSUP 9926
|
||||
#endif
|
||||
|
||||
#ifndef ECANCELED
|
||||
#define ECANCELED 9927
|
||||
#endif
|
||||
|
||||
#ifndef EINPROGRESS
|
||||
#define EINPROGRESS 9928
|
||||
#endif
|
||||
|
||||
#ifndef EOPNOTSUPP
|
||||
#define EOPNOTSUPP 9929
|
||||
#endif
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
#define EWOULDBLOCK 9930
|
||||
#endif
|
||||
|
||||
#ifndef EOWNERDEAD
|
||||
#define EOWNERDEAD 9931
|
||||
#endif
|
||||
|
||||
#ifndef EPROTO
|
||||
#define EPROTO 9932
|
||||
#endif
|
||||
|
||||
#ifndef EPROTONOSUPPORT
|
||||
#define EPROTONOSUPPORT 9933
|
||||
#endif
|
||||
|
||||
#ifndef ENOTRECOVERABLE
|
||||
#define ENOTRECOVERABLE 9934
|
||||
#endif
|
||||
|
||||
#ifndef ETIME
|
||||
#define ETIME 9935
|
||||
#endif
|
||||
|
||||
#ifndef ETXTBSY
|
||||
#define ETXTBSY 9936
|
||||
#endif
|
||||
|
||||
#ifndef ETIMEDOUT
|
||||
#define ETIMEDOUT 9938
|
||||
#endif
|
||||
|
||||
#ifndef ELOOP
|
||||
#define ELOOP 9939
|
||||
#endif
|
||||
|
||||
#ifndef EOVERFLOW
|
||||
#define EOVERFLOW 9940
|
||||
#endif
|
||||
|
||||
#ifndef EPROTOTYPE
|
||||
#define EPROTOTYPE 9941
|
||||
#endif
|
||||
|
||||
#ifndef ENOSYS
|
||||
#define ENOSYS 9942
|
||||
#endif
|
||||
|
||||
#ifndef EINVAL
|
||||
#define EINVAL 9943
|
||||
#endif
|
||||
|
||||
#ifndef ERANGE
|
||||
#define ERANGE 9944
|
||||
#endif
|
||||
|
||||
#ifndef EILSEQ
|
||||
#define EILSEQ 9945
|
||||
#endif
|
||||
|
||||
// Windows Mobile doesn't appear to define these:
|
||||
|
||||
#ifndef E2BIG
|
||||
#define E2BIG 9946
|
||||
#endif
|
||||
|
||||
#ifndef EDOM
|
||||
#define EDOM 9947
|
||||
#endif
|
||||
|
||||
#ifndef EFAULT
|
||||
#define EFAULT 9948
|
||||
#endif
|
||||
|
||||
#ifndef EBADF
|
||||
#define EBADF 9949
|
||||
#endif
|
||||
|
||||
#ifndef EPIPE
|
||||
#define EPIPE 9950
|
||||
#endif
|
||||
|
||||
#ifndef EXDEV
|
||||
#define EXDEV 9951
|
||||
#endif
|
||||
|
||||
#ifndef EBUSY
|
||||
#define EBUSY 9952
|
||||
#endif
|
||||
|
||||
#ifndef ENOTEMPTY
|
||||
#define ENOTEMPTY 9953
|
||||
#endif
|
||||
|
||||
#ifndef ENOEXEC
|
||||
#define ENOEXEC 9954
|
||||
#endif
|
||||
|
||||
#ifndef EEXIST
|
||||
#define EEXIST 9955
|
||||
#endif
|
||||
|
||||
#ifndef EFBIG
|
||||
#define EFBIG 9956
|
||||
#endif
|
||||
|
||||
#ifndef ENAMETOOLONG
|
||||
#define ENAMETOOLONG 9957
|
||||
#endif
|
||||
|
||||
#ifndef ENOTTY
|
||||
#define ENOTTY 9958
|
||||
#endif
|
||||
|
||||
#ifndef EINTR
|
||||
#define EINTR 9959
|
||||
#endif
|
||||
|
||||
#ifndef ESPIPE
|
||||
#define ESPIPE 9960
|
||||
#endif
|
||||
|
||||
#ifndef EIO
|
||||
#define EIO 9961
|
||||
#endif
|
||||
|
||||
#ifndef EISDIR
|
||||
#define EISDIR 9962
|
||||
#endif
|
||||
|
||||
#ifndef ECHILD
|
||||
#define ECHILD 9963
|
||||
#endif
|
||||
|
||||
#ifndef ENOLCK
|
||||
#define ENOLCK 9964
|
||||
#endif
|
||||
|
||||
#ifndef ENOSPC
|
||||
#define ENOSPC 9965
|
||||
#endif
|
||||
|
||||
#ifndef ENXIO
|
||||
#define ENXIO 9966
|
||||
#endif
|
||||
|
||||
#ifndef ENODEV
|
||||
#define ENODEV 9967
|
||||
#endif
|
||||
|
||||
#ifndef ENOENT
|
||||
#define ENOENT 9968
|
||||
#endif
|
||||
|
||||
#ifndef ESRCH
|
||||
#define ESRCH 9969
|
||||
#endif
|
||||
|
||||
#ifndef ENOTDIR
|
||||
#define ENOTDIR 9970
|
||||
#endif
|
||||
|
||||
#ifndef ENOMEM
|
||||
#define ENOMEM 9971
|
||||
#endif
|
||||
|
||||
#ifndef EPERM
|
||||
#define EPERM 9972
|
||||
#endif
|
||||
|
||||
#ifndef EACCES
|
||||
#define EACCES 9973
|
||||
#endif
|
||||
|
||||
#ifndef EROFS
|
||||
#define EROFS 9974
|
||||
#endif
|
||||
|
||||
#ifndef EDEADLK
|
||||
#define EDEADLK 9975
|
||||
#endif
|
||||
|
||||
#ifndef EAGAIN
|
||||
#define EAGAIN 9976
|
||||
#endif
|
||||
|
||||
#ifndef ENFILE
|
||||
#define ENFILE 9977
|
||||
#endif
|
||||
|
||||
#ifndef EMFILE
|
||||
#define EMFILE 9978
|
||||
#endif
|
||||
|
||||
#ifndef EMLINK
|
||||
#define EMLINK 9979
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CERRNO
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -223,26 +223,26 @@ public:
|
||||
typedef duration::rep rep;
|
||||
typedef duration::period period;
|
||||
typedef chrono::time_point<system_clock> time_point;
|
||||
static const bool is_steady = false;
|
||||
static const bool is_monotonic = false;
|
||||
|
||||
static time_point now() noexcept;
|
||||
static time_t to_time_t (const time_point& __t) noexcept;
|
||||
static time_point from_time_t(time_t __t) noexcept;
|
||||
static time_point now();
|
||||
static time_t to_time_t (const time_point& __t);
|
||||
static time_point from_time_t(time_t __t);
|
||||
};
|
||||
|
||||
class steady_clock
|
||||
class monotonic_clock
|
||||
{
|
||||
public:
|
||||
typedef nanoseconds duration;
|
||||
typedef duration::rep rep;
|
||||
typedef duration::period period;
|
||||
typedef chrono::time_point<steady_clock, duration> time_point;
|
||||
static const bool is_steady = true;
|
||||
typedef chrono::time_point<monotonic_clock, duration> time_point;
|
||||
static const bool is_monotonic = true;
|
||||
|
||||
static time_point now() noexcept;
|
||||
static time_point now();
|
||||
};
|
||||
|
||||
typedef steady_clock high_resolution_clock;
|
||||
typedef monotonic_clock high_resolution_clock;
|
||||
|
||||
} // chrono
|
||||
|
||||
@@ -262,7 +262,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
namespace chrono
|
||||
{
|
||||
|
||||
template <class _Rep, class _Period = ratio<1> > class _LIBCPP_VISIBLE duration;
|
||||
template <class _Rep, class _Period = ratio<1> > class duration;
|
||||
|
||||
template <class _Tp>
|
||||
struct __is_duration : false_type {};
|
||||
@@ -282,8 +282,7 @@ struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
|
||||
} // chrono
|
||||
|
||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||
struct _LIBCPP_VISIBLE common_type<chrono::duration<_Rep1, _Period1>,
|
||||
chrono::duration<_Rep2, _Period2> >
|
||||
struct common_type<chrono::duration<_Rep1, _Period1>, chrono::duration<_Rep2, _Period2> >
|
||||
{
|
||||
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
|
||||
typename __ratio_gcd<_Period1, _Period2>::type> type;
|
||||
@@ -358,11 +357,10 @@ duration_cast(const duration<_Rep, _Period>& __fd)
|
||||
return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
|
||||
}
|
||||
|
||||
template <class _Rep>
|
||||
struct _LIBCPP_VISIBLE treat_as_floating_point : is_floating_point<_Rep> {};
|
||||
template <class _Rep> struct treat_as_floating_point : is_floating_point<_Rep> {};
|
||||
|
||||
template <class _Rep>
|
||||
struct _LIBCPP_VISIBLE duration_values
|
||||
struct duration_values
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY static _Rep zero() {return _Rep(0);}
|
||||
@@ -373,7 +371,7 @@ public:
|
||||
// duration
|
||||
|
||||
template <class _Rep, class _Period>
|
||||
class _LIBCPP_VISIBLE duration
|
||||
class duration
|
||||
{
|
||||
static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
|
||||
static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
|
||||
@@ -407,7 +405,7 @@ public:
|
||||
(ratio_divide<_Period2, period>::type::den == 1 &&
|
||||
!treat_as_floating_point<_Rep2>::value)
|
||||
>::type* = 0)
|
||||
: __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
|
||||
: __rep_(_STD::chrono::duration_cast<duration>(__d).count()) {}
|
||||
|
||||
// observer
|
||||
|
||||
@@ -669,7 +667,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
template <class _Clock, class _Duration = typename _Clock::duration>
|
||||
class _LIBCPP_VISIBLE time_point
|
||||
class time_point
|
||||
{
|
||||
static_assert(__is_duration<_Duration>::value,
|
||||
"Second template parameter of time_point must be a std::chrono::duration");
|
||||
@@ -713,8 +711,7 @@ public:
|
||||
} // chrono
|
||||
|
||||
template <class _Clock, class _Duration1, class _Duration2>
|
||||
struct _LIBCPP_VISIBLE common_type<chrono::time_point<_Clock, _Duration1>,
|
||||
chrono::time_point<_Clock, _Duration2> >
|
||||
struct common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _Duration2> >
|
||||
{
|
||||
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
|
||||
};
|
||||
@@ -726,7 +723,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
time_point<_Clock, _ToDuration>
|
||||
time_point_cast(const time_point<_Clock, _Duration>& __t)
|
||||
{
|
||||
return time_point<_Clock, _ToDuration>(_VSTD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
|
||||
return time_point<_Clock, _ToDuration>(_STD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
|
||||
}
|
||||
|
||||
// time_point ==
|
||||
@@ -836,33 +833,33 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
|
||||
/////////////////////// clocks ///////////////////////////
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
class _LIBCPP_VISIBLE system_clock
|
||||
class system_clock
|
||||
{
|
||||
public:
|
||||
typedef microseconds duration;
|
||||
typedef duration::rep rep;
|
||||
typedef duration::period period;
|
||||
typedef chrono::time_point<system_clock> time_point;
|
||||
static const bool is_steady = false;
|
||||
static const bool is_monotonic = false;
|
||||
|
||||
static time_point now() _NOEXCEPT;
|
||||
static time_t to_time_t (const time_point& __t) _NOEXCEPT;
|
||||
static time_point from_time_t(time_t __t) _NOEXCEPT;
|
||||
static time_point now();
|
||||
static time_t to_time_t (const time_point& __t);
|
||||
static time_point from_time_t(time_t __t);
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE steady_clock
|
||||
class monotonic_clock
|
||||
{
|
||||
public:
|
||||
typedef nanoseconds duration;
|
||||
typedef duration::rep rep;
|
||||
typedef duration::period period;
|
||||
typedef chrono::time_point<steady_clock, duration> time_point;
|
||||
static const bool is_steady = true;
|
||||
typedef chrono::time_point<monotonic_clock, duration> time_point;
|
||||
static const bool is_monotonic = true;
|
||||
|
||||
static time_point now() _NOEXCEPT;
|
||||
static time_point now();
|
||||
};
|
||||
|
||||
typedef steady_clock high_resolution_clock;
|
||||
typedef monotonic_clock high_resolution_clock;
|
||||
|
||||
} // chrono
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
861
include/cmath
861
include/cmath
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -177,7 +177,7 @@ protected:
|
||||
|
||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||
codecvt_mode _Mode = (codecvt_mode)0>
|
||||
class _LIBCPP_VISIBLE codecvt_utf8
|
||||
class codecvt_utf8
|
||||
: public __codecvt_utf8<_Elem>
|
||||
{
|
||||
public:
|
||||
@@ -185,7 +185,6 @@ public:
|
||||
explicit codecvt_utf8(size_t __refs = 0)
|
||||
: __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~codecvt_utf8() {}
|
||||
};
|
||||
|
||||
@@ -405,7 +404,7 @@ protected:
|
||||
|
||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||
codecvt_mode _Mode = (codecvt_mode)0>
|
||||
class _LIBCPP_VISIBLE codecvt_utf16
|
||||
class codecvt_utf16
|
||||
: public __codecvt_utf16<_Elem, _Mode & little_endian>
|
||||
{
|
||||
public:
|
||||
@@ -413,7 +412,6 @@ public:
|
||||
explicit codecvt_utf16(size_t __refs = 0)
|
||||
: __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~codecvt_utf16() {}
|
||||
};
|
||||
|
||||
@@ -528,7 +526,7 @@ protected:
|
||||
|
||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||
codecvt_mode _Mode = (codecvt_mode)0>
|
||||
class _LIBCPP_VISIBLE codecvt_utf8_utf16
|
||||
class codecvt_utf8_utf16
|
||||
: public __codecvt_utf8_utf16<_Elem>
|
||||
{
|
||||
public:
|
||||
@@ -536,7 +534,6 @@ public:
|
||||
explicit codecvt_utf8_utf16(size_t __refs = 0)
|
||||
: __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~codecvt_utf8_utf16() {}
|
||||
};
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -191,17 +191,17 @@ template<class T> T norm(const complex<T>&);
|
||||
template<Integral T> double norm(T);
|
||||
float norm(float);
|
||||
|
||||
template<class T> complex<T> conj(const complex<T>&);
|
||||
complex<long double> conj(long double);
|
||||
complex<double> conj(double);
|
||||
template<Integral T> complex<double> conj(T);
|
||||
complex<float> conj(float);
|
||||
template<class T> complex<T> conj(const complex<T>&);
|
||||
long double conj(long double);
|
||||
double conj(double);
|
||||
template<Integral T> double conj(T);
|
||||
float conj(float);
|
||||
|
||||
template<class T> complex<T> proj(const complex<T>&);
|
||||
complex<long double> proj(long double);
|
||||
complex<double> proj(double);
|
||||
template<Integral T> complex<double> proj(T);
|
||||
complex<float> proj(float);
|
||||
template<class T> complex<T> proj(const complex<T>&);
|
||||
long double proj(long double);
|
||||
double proj(double);
|
||||
template<Integral T> double proj(T);
|
||||
float proj(float);
|
||||
|
||||
template<class T> complex<T> polar(const T&, const T& = 0);
|
||||
|
||||
@@ -253,13 +253,13 @@ template<class T, class charT, class traits>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template<class _Tp> class _LIBCPP_VISIBLE complex;
|
||||
template<class _Tp> class complex;
|
||||
|
||||
template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
|
||||
template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
|
||||
|
||||
template<class _Tp>
|
||||
class _LIBCPP_VISIBLE complex
|
||||
class complex
|
||||
{
|
||||
public:
|
||||
typedef _Tp value_type;
|
||||
@@ -316,11 +316,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<> class _LIBCPP_VISIBLE complex<double>;
|
||||
template<> class _LIBCPP_VISIBLE complex<long double>;
|
||||
template<> class complex<double>;
|
||||
template<> class complex<long double>;
|
||||
|
||||
template<>
|
||||
class _LIBCPP_VISIBLE complex<float>
|
||||
class complex<float>
|
||||
{
|
||||
float __re_;
|
||||
float __im_;
|
||||
@@ -375,7 +375,7 @@ public:
|
||||
};
|
||||
|
||||
template<>
|
||||
class _LIBCPP_VISIBLE complex<double>
|
||||
class complex<double>
|
||||
{
|
||||
double __re_;
|
||||
double __im_;
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
};
|
||||
|
||||
template<>
|
||||
class _LIBCPP_VISIBLE complex<long double>
|
||||
class complex<long double>
|
||||
{
|
||||
long double __re_;
|
||||
long double __im_;
|
||||
@@ -781,6 +781,20 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
|
||||
return !(__x == __y);
|
||||
}
|
||||
|
||||
/*
|
||||
Move to <istream>
|
||||
|
||||
template<class T, class charT, class traits>
|
||||
basic_istream<charT, traits>&
|
||||
operator>>(basic_istream<charT, traits>&, complex<T>&);
|
||||
|
||||
Move to <ostream>
|
||||
|
||||
template<class T, class charT, class traits>
|
||||
basic_ostream<charT, traits>&
|
||||
operator<<(basic_ostream<charT, traits>&, const complex<T>&);
|
||||
*/
|
||||
|
||||
// 26.3.7 values:
|
||||
|
||||
// real
|
||||
@@ -980,17 +994,17 @@ conj(const complex<_Tp>& __c)
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
complex<long double>
|
||||
long double
|
||||
conj(long double __re)
|
||||
{
|
||||
return complex<long double>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
complex<double>
|
||||
double
|
||||
conj(double __re)
|
||||
{
|
||||
return complex<double>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
@@ -998,18 +1012,18 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value,
|
||||
complex<double>
|
||||
double
|
||||
>::type
|
||||
conj(_Tp __re)
|
||||
{
|
||||
return complex<double>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
complex<float>
|
||||
float
|
||||
conj(float __re)
|
||||
{
|
||||
return complex<float>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
// proj
|
||||
@@ -1026,21 +1040,21 @@ proj(const complex<_Tp>& __c)
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
complex<long double>
|
||||
long double
|
||||
proj(long double __re)
|
||||
{
|
||||
if (isinf(__re))
|
||||
__re = abs(__re);
|
||||
return complex<long double>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
complex<double>
|
||||
double
|
||||
proj(double __re)
|
||||
{
|
||||
if (isinf(__re))
|
||||
__re = abs(__re);
|
||||
return complex<double>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
@@ -1048,20 +1062,20 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value,
|
||||
complex<double>
|
||||
double
|
||||
>::type
|
||||
proj(_Tp __re)
|
||||
{
|
||||
return complex<double>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
complex<float>
|
||||
float
|
||||
proj(float __re)
|
||||
{
|
||||
if (isinf(__re))
|
||||
__re = abs(__re);
|
||||
return complex<float>(__re);
|
||||
return __re;
|
||||
}
|
||||
|
||||
// polar
|
||||
@@ -1173,7 +1187,7 @@ complex<typename __promote<_Tp, _Up>::type>
|
||||
pow(const complex<_Tp>& __x, const complex<_Up>& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
return _STD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
template<class _Tp, class _Up>
|
||||
@@ -1186,7 +1200,7 @@ typename enable_if
|
||||
pow(const complex<_Tp>& __x, const _Up& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
return _STD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
template<class _Tp, class _Up>
|
||||
@@ -1199,7 +1213,7 @@ typename enable_if
|
||||
pow(const _Tp& __x, const complex<_Up>& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
return _STD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
// asinh
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -61,8 +61,6 @@ public:
|
||||
native_handle_type native_handle();
|
||||
};
|
||||
|
||||
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
||||
|
||||
class condition_variable_any
|
||||
{
|
||||
public:
|
||||
@@ -115,7 +113,7 @@ public:
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE condition_variable_any
|
||||
class condition_variable_any
|
||||
{
|
||||
condition_variable __cv_;
|
||||
shared_ptr<mutex> __mut_;
|
||||
@@ -153,11 +151,11 @@ public:
|
||||
_Predicate __pred);
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
condition_variable_any::condition_variable_any()
|
||||
: __mut_(make_shared<mutex>()) {}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
condition_variable_any::notify_one()
|
||||
{
|
||||
@@ -165,7 +163,7 @@ condition_variable_any::notify_one()
|
||||
__cv_.notify_one();
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
condition_variable_any::notify_all()
|
||||
{
|
||||
@@ -192,7 +190,7 @@ condition_variable_any::wait(_Lock& __lock)
|
||||
} // __mut_.unlock(), __lock.lock()
|
||||
|
||||
template <class _Lock, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
condition_variable_any::wait(_Lock& __lock, _Predicate __pred)
|
||||
{
|
||||
@@ -214,7 +212,7 @@ condition_variable_any::wait_until(_Lock& __lock,
|
||||
} // __mut_.unlock(), __lock.lock()
|
||||
|
||||
template <class _Lock, class _Clock, class _Duration, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
condition_variable_any::wait_until(_Lock& __lock,
|
||||
const chrono::time_point<_Clock, _Duration>& __t,
|
||||
@@ -227,28 +225,25 @@ condition_variable_any::wait_until(_Lock& __lock,
|
||||
}
|
||||
|
||||
template <class _Lock, class _Rep, class _Period>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
cv_status
|
||||
condition_variable_any::wait_for(_Lock& __lock,
|
||||
const chrono::duration<_Rep, _Period>& __d)
|
||||
{
|
||||
return wait_until(__lock, chrono::steady_clock::now() + __d);
|
||||
return wait_until(__lock, chrono::monotonic_clock::now() + __d);
|
||||
}
|
||||
|
||||
template <class _Lock, class _Rep, class _Period, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
condition_variable_any::wait_for(_Lock& __lock,
|
||||
const chrono::duration<_Rep, _Period>& __d,
|
||||
_Predicate __pred)
|
||||
{
|
||||
return wait_until(__lock, chrono::steady_clock::now() + __d,
|
||||
_VSTD::move(__pred));
|
||||
return wait_until(__lock, chrono::monotonic_clock::now() + __d,
|
||||
_STD::move(__pred));
|
||||
}
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_CONDITION_VARIABLE
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef long double max_align_t;
|
||||
|
||||
#ifdef _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
struct _LIBCPP_VISIBLE nullptr_t
|
||||
struct nullptr_t
|
||||
{
|
||||
void* _;
|
||||
|
||||
@@ -78,23 +78,54 @@ struct _LIBCPP_VISIBLE nullptr_t
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, nullptr_t) {return true;}
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, nullptr_t) {return false;}
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, nullptr_t) {return true;}
|
||||
|
||||
template <typename _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator==(nullptr_t, _Tp* __p) {return 0 == __p;}
|
||||
|
||||
template <typename _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator==(_Tp* __p, nullptr_t) {return __p == 0;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator!=(nullptr_t, _Tp* __p) {return 0 != __p;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator!=(_Tp* __p, nullptr_t) {return __p != 0;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator<(nullptr_t, _Tp* __p) {return 0 < __p;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator<(_Tp* __p, nullptr_t) {return __p < 0;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, _Tp* __p) {return 0 <= __p;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator<=(_Tp* __p, nullptr_t) {return __p <= 0;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, _Tp* __p) {return 0 > __p;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator>(_Tp* __p, nullptr_t) {return __p > 0;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, _Tp* __p) {return 0 >= __p;}
|
||||
|
||||
template <class _Tp>
|
||||
friend _LIBCPP_ALWAYS_INLINE bool operator>=(_Tp* __p, nullptr_t) {return __p >= 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
||||
|
||||
#define nullptr _VSTD::__get_nullptr_t()
|
||||
#define nullptr _STD::__get_nullptr_t()
|
||||
|
||||
#else // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
namespace std
|
||||
{
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_NULLPTR
|
||||
|
||||
#endif // _LIBCPP_CSTDDEF
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -78,26 +78,23 @@ using ::strcoll;
|
||||
using ::strxfrm;
|
||||
|
||||
using ::memchr;
|
||||
inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
|
||||
|
||||
using ::strchr;
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
|
||||
|
||||
using ::strcspn;
|
||||
|
||||
using ::strpbrk;
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
|
||||
|
||||
using ::strrchr;
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);}
|
||||
|
||||
using ::strspn;
|
||||
|
||||
using ::strstr;
|
||||
|
||||
#ifndef __GLIBC__ // GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
|
||||
inline _LIBCPP_INLINE_VISIBILITY char* strstr( char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
|
||||
#endif
|
||||
|
||||
using ::strtok;
|
||||
using ::memset;
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -106,9 +106,6 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
|
||||
#include <__config>
|
||||
#include <cwctype>
|
||||
#include <wchar.h>
|
||||
#if _WIN32
|
||||
#include <support/win32/support.h> // pull in *swprintf defines
|
||||
#endif // _WIN32
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
565
include/deque
565
include/deque
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -20,56 +20,54 @@ namespace std
|
||||
class exception
|
||||
{
|
||||
public:
|
||||
exception() noexcept;
|
||||
exception(const exception&) noexcept;
|
||||
exception& operator=(const exception&) noexcept;
|
||||
virtual ~exception() noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
exception() throw();
|
||||
exception(const exception&) throw();
|
||||
exception& operator=(const exception&) throw();
|
||||
virtual ~exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class bad_exception
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_exception() noexcept;
|
||||
bad_exception(const bad_exception&) noexcept;
|
||||
bad_exception& operator=(const bad_exception&) noexcept;
|
||||
virtual ~bad_exception() noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
bad_exception() throw();
|
||||
bad_exception(const bad_exception&) throw();
|
||||
bad_exception& operator=(const bad_exception&) throw();
|
||||
virtual ~bad_exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
typedef void (*unexpected_handler)();
|
||||
unexpected_handler set_unexpected(unexpected_handler f ) noexcept;
|
||||
unexpected_handler get_unexpected() noexcept;
|
||||
[[noreturn]] void unexpected();
|
||||
unexpected_handler set_unexpected(unexpected_handler f ) throw();
|
||||
void unexpected [[noreturn]] ();
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
terminate_handler set_terminate(terminate_handler f ) noexcept;
|
||||
terminate_handler get_terminate() noexcept;
|
||||
[[noreturn]] void terminate() noexcept;
|
||||
terminate_handler set_terminate(terminate_handler f ) throw();
|
||||
void terminate [[noreturn]] ();
|
||||
|
||||
bool uncaught_exception() noexcept;
|
||||
bool uncaught_exception() throw();
|
||||
|
||||
typedef unspecified exception_ptr;
|
||||
|
||||
exception_ptr current_exception() noexcept;
|
||||
exception_ptr current_exception();
|
||||
void rethrow_exception [[noreturn]] (exception_ptr p);
|
||||
template<class E> exception_ptr make_exception_ptr(E e) noexcept;
|
||||
template<class E> exception_ptr make_exception_ptr(E e);
|
||||
|
||||
class nested_exception
|
||||
{
|
||||
public:
|
||||
nested_exception() noexcept;
|
||||
nested_exception(const nested_exception&) noexcept = default;
|
||||
nested_exception& operator=(const nested_exception&) noexcept = default;
|
||||
nested_exception() throw();
|
||||
nested_exception(const nested_exception&) throw() = default;
|
||||
nested_exception& operator=(const nested_exception&) throw() = default;
|
||||
virtual ~nested_exception() = default;
|
||||
|
||||
// access functions
|
||||
[[noreturn]] void rethrow_nested() const;
|
||||
exception_ptr nested_ptr() const noexcept;
|
||||
void rethrow_nested [[noreturn]] () const;
|
||||
exception_ptr nested_ptr() const;
|
||||
};
|
||||
|
||||
template <class T> [[noreturn]] void throw_with_nested(T&& t);
|
||||
template <class T> void throw_with_nested [[noreturn]] (T&& t);
|
||||
template <class E> void rethrow_if_nested(const E& e);
|
||||
|
||||
} // std
|
||||
@@ -88,65 +86,60 @@ namespace std // purposefully not using versioning namespace
|
||||
class _LIBCPP_EXCEPTION_ABI exception
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
|
||||
virtual ~exception() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY exception() throw() {}
|
||||
virtual ~exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_exception
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
|
||||
virtual ~bad_exception() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY bad_exception() throw() {}
|
||||
virtual ~bad_exception() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
typedef void (*unexpected_handler)();
|
||||
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void unexpected();
|
||||
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) throw();
|
||||
_LIBCPP_VISIBLE void unexpected();
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) throw();
|
||||
_LIBCPP_VISIBLE void terminate() __attribute__((__noreturn__));
|
||||
|
||||
_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE bool uncaught_exception() throw();
|
||||
|
||||
class exception_ptr;
|
||||
|
||||
exception_ptr current_exception() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) void rethrow_exception(exception_ptr);
|
||||
exception_ptr current_exception();
|
||||
void rethrow_exception(exception_ptr); // noreturn
|
||||
|
||||
class _LIBCPP_VISIBLE exception_ptr
|
||||
class exception_ptr
|
||||
{
|
||||
void* __ptr_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
|
||||
exception_ptr(const exception_ptr&) _NOEXCEPT;
|
||||
exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
|
||||
~exception_ptr() _NOEXCEPT;
|
||||
exception_ptr() : __ptr_() {}
|
||||
exception_ptr(nullptr_t) : __ptr_() {}
|
||||
exception_ptr(const exception_ptr&);
|
||||
exception_ptr& operator=(const exception_ptr&);
|
||||
~exception_ptr();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool() const _NOEXCEPT {return __ptr_ != nullptr;}
|
||||
operator bool() const {return __ptr_ != nullptr;}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
|
||||
friend bool operator==(const exception_ptr& __x, const exception_ptr& __y)
|
||||
{return __x.__ptr_ == __y.__ptr_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
|
||||
friend bool operator!=(const exception_ptr& __x, const exception_ptr& __y)
|
||||
{return !(__x == __y);}
|
||||
|
||||
friend exception_ptr current_exception() _NOEXCEPT;
|
||||
_ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr);
|
||||
friend exception_ptr current_exception();
|
||||
friend void rethrow_exception(exception_ptr); // noreturn
|
||||
};
|
||||
|
||||
template<class _E>
|
||||
exception_ptr
|
||||
make_exception_ptr(_E __e) _NOEXCEPT
|
||||
make_exception_ptr(_E __e)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
@@ -166,14 +159,14 @@ class _LIBCPP_EXCEPTION_ABI nested_exception
|
||||
{
|
||||
exception_ptr __ptr_;
|
||||
public:
|
||||
nested_exception() _NOEXCEPT;
|
||||
// nested_exception(const nested_exception&) noexcept = default;
|
||||
// nested_exception& operator=(const nested_exception&) noexcept = default;
|
||||
virtual ~nested_exception() _NOEXCEPT;
|
||||
nested_exception();
|
||||
// nested_exception(const nested_exception&) throw() = default;
|
||||
// nested_exception& operator=(const nested_exception&) throw() = default;
|
||||
virtual ~nested_exception();
|
||||
|
||||
// access functions
|
||||
_ATTRIBUTE(noreturn) void rethrow_nested() const;
|
||||
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
|
||||
void rethrow_nested /*[[noreturn]]*/ () const;
|
||||
exception_ptr nested_ptr() const {return __ptr_;}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
@@ -181,49 +174,47 @@ struct __nested
|
||||
: public _Tp,
|
||||
public nested_exception
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
|
||||
explicit __nested(const _Tp& __t) : _Tp(__t) {}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
throw_with_nested(_Tp&& __t, typename enable_if<
|
||||
#ifdef _LIBCPP_MOVE
|
||||
throw_with_nested /*[[noreturn]]*/ (_Tp&& __t, typename enable_if<
|
||||
is_class<typename remove_reference<_Tp>::type>::value &&
|
||||
!is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
|
||||
>::type* = 0)
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
throw_with_nested (_Tp& __t, typename enable_if<
|
||||
is_class<_Tp>::value && !is_base_of<nested_exception, _Tp>::value
|
||||
>::type* = 0)
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
|
||||
throw __nested<typename remove_reference<_Tp>::type>(_STD::forward<_Tp>(__t));
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
_ATTRIBUTE(noreturn)
|
||||
void
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
throw_with_nested(_Tp&& __t, typename enable_if<
|
||||
#ifdef _LIBCPP_MOVE
|
||||
throw_with_nested /*[[noreturn]]*/ (_Tp&& __t, typename enable_if<
|
||||
!is_class<typename remove_reference<_Tp>::type>::value ||
|
||||
is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
|
||||
>::type* = 0)
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _LIBCPP_MOVE
|
||||
throw_with_nested (_Tp& __t, typename enable_if<
|
||||
!is_class<_Tp>::value || is_base_of<nested_exception, _Tp>::value
|
||||
>::type* = 0)
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw _VSTD::forward<_Tp>(__t);
|
||||
throw _STD::forward<_Tp>(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
rethrow_if_nested(const _E& __e, typename enable_if<
|
||||
is_polymorphic<_E>::value
|
||||
@@ -235,7 +226,7 @@ rethrow_if_nested(const _E& __e, typename enable_if<
|
||||
}
|
||||
|
||||
template <class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
rethrow_if_nested(const _E& __e, typename enable_if<
|
||||
!is_polymorphic<_E>::value
|
||||
|
@@ -1,46 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===------------------------- hash_set ------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_EXT_HASH
|
||||
#define _LIBCPP_EXT_HASH
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
namespace __gnu_cxx {
|
||||
using namespace std;
|
||||
|
||||
template <typename T> struct _LIBCPP_VISIBLE hash : public std::hash<T>
|
||||
{ };
|
||||
|
||||
template <> struct _LIBCPP_VISIBLE hash<const char*>
|
||||
: public unary_function<const char*, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const char *__c) const _NOEXCEPT
|
||||
{
|
||||
return __do_string_hash(__c, __c + strlen(__c));
|
||||
}
|
||||
};
|
||||
|
||||
template <> struct _LIBCPP_VISIBLE hash<char *>
|
||||
: public unary_function<char*, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(char *__c) const _NOEXCEPT
|
||||
{
|
||||
return __do_string_hash<const char *>(__c, __c + strlen(__c));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif _LIBCPP_EXT_HASH
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -203,11 +203,8 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
|
||||
#include <__hash_table>
|
||||
#include <functional>
|
||||
#include <stdexcept>
|
||||
#include <ext/__hash>
|
||||
|
||||
#if __DEPRECATED
|
||||
#warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
|
||||
#endif
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -220,13 +217,11 @@ class __hash_map_hasher
|
||||
: private _Hash
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : _Hash() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_hasher() : _Hash() {}
|
||||
__hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
|
||||
const _Hash& hash_function() const {return *this;}
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const typename _Tp::first_type& __x) const
|
||||
{return static_cast<const _Hash&>(*this)(__x);}
|
||||
};
|
||||
@@ -236,13 +231,11 @@ class __hash_map_hasher<_Tp, _Hash, false>
|
||||
{
|
||||
_Hash __hash_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : __hash_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return __hash_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_hasher() : __hash_() {}
|
||||
__hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
|
||||
const _Hash& hash_function() const {return __hash_;}
|
||||
size_t operator()(const _Tp& __x) const
|
||||
{return __hash_(__x.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const typename _Tp::first_type& __x) const
|
||||
{return __hash_(__x);}
|
||||
};
|
||||
@@ -252,19 +245,15 @@ class __hash_map_equal
|
||||
: private _Pred
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal() : _Pred() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : _Pred(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_equal() : _Pred() {}
|
||||
__hash_map_equal(const _Pred& __p) : _Pred(__p) {}
|
||||
const _Pred& key_eq() const {return *this;}
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x.first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x,
|
||||
const typename _Tp::first_type& __y) const
|
||||
{return static_cast<const _Pred&>(*this)(__x, __y);}
|
||||
@@ -275,19 +264,15 @@ class __hash_map_equal<_Tp, _Pred, false>
|
||||
{
|
||||
_Pred __pred_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal() : __pred_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : __pred_(__p) {}
|
||||
_LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return __pred_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_equal() : __pred_() {}
|
||||
__hash_map_equal(const _Pred& __p) : __pred_(__p) {}
|
||||
const _Pred& key_eq() const {return __pred_;}
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||
{return __pred_(__x.first, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
|
||||
{return __pred_(__x, __y.first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
|
||||
{return __pred_(__x.first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const typename _Tp::first_type& __x,
|
||||
const typename _Tp::first_type& __y) const
|
||||
{return __pred_(__x, __y);}
|
||||
@@ -313,15 +298,13 @@ public:
|
||||
bool __first_constructed;
|
||||
bool __second_constructed;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __hash_map_node_destructor(allocator_type& __na)
|
||||
: __na_(__na),
|
||||
__first_constructed(false),
|
||||
__second_constructed(false)
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
@@ -329,8 +312,7 @@ public:
|
||||
{
|
||||
__x.__value_constructed = false;
|
||||
}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#else // _LIBCPP_MOVE
|
||||
__hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
|
||||
: __na_(__x.__na_),
|
||||
__first_constructed(__x.__value_constructed),
|
||||
@@ -338,22 +320,21 @@ public:
|
||||
{
|
||||
const_cast<bool&>(__x.__value_constructed) = false;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()(pointer __p)
|
||||
{
|
||||
if (__second_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
|
||||
__alloc_traits::destroy(__na_, addressof(__p->__value_.second));
|
||||
if (__first_constructed)
|
||||
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
|
||||
__alloc_traits::destroy(__na_, addressof(__p->__value_.first));
|
||||
if (__p)
|
||||
__alloc_traits::deallocate(__na_, __p, 1);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _HashIterator>
|
||||
class _LIBCPP_VISIBLE __hash_map_iterator
|
||||
class __hash_map_iterator
|
||||
{
|
||||
_HashIterator __i_;
|
||||
|
||||
@@ -373,15 +354,14 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {}
|
||||
__hash_map_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
__hash_map_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *operator->();}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
reference operator*() const {return *operator->();}
|
||||
pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator& operator++() {++__i_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_iterator& operator++() {++__i_; return *this;}
|
||||
__hash_map_iterator operator++(int)
|
||||
{
|
||||
__hash_map_iterator __t(*this);
|
||||
@@ -389,22 +369,20 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
friend bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
{return __x.__i_ == __y.__i_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
friend bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||
{return __x.__i_ != __y.__i_;}
|
||||
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
||||
template <class, class, class, class, class> friend class hash_map;
|
||||
template <class, class, class, class, class> friend class hash_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
template <class> friend class __hash_map_const_iterator;
|
||||
};
|
||||
|
||||
template <class _HashIterator>
|
||||
class _LIBCPP_VISIBLE __hash_map_const_iterator
|
||||
class __hash_map_const_iterator
|
||||
{
|
||||
_HashIterator __i_;
|
||||
|
||||
@@ -424,23 +402,17 @@ public:
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}
|
||||
__hash_map_const_iterator() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator(
|
||||
__hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
|
||||
: __i_(__i.__i_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference operator*() const {return *operator->();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return (pointer)__i_.operator->();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator& operator++() {++__i_; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hash_map_const_iterator operator++(int)
|
||||
{
|
||||
__hash_map_const_iterator __t(*this);
|
||||
@@ -448,28 +420,25 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
friend bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
{return __x.__i_ == __y.__i_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
friend bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||
{return __x.__i_ != __y.__i_;}
|
||||
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_map;
|
||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
||||
template <class, class, class, class, class> friend class hash_map;
|
||||
template <class, class, class, class, class> friend class hash_multimap;
|
||||
template <class> friend class __hash_const_iterator;
|
||||
template <class> friend class __hash_const_local_iterator;
|
||||
};
|
||||
|
||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||
class _LIBCPP_VISIBLE hash_map
|
||||
class hash_map
|
||||
{
|
||||
public:
|
||||
// types
|
||||
typedef _Key key_type;
|
||||
typedef _Tp mapped_type;
|
||||
typedef _Tp data_type;
|
||||
typedef _Hash hasher;
|
||||
typedef _Pred key_equal;
|
||||
typedef _Alloc allocator_type;
|
||||
@@ -511,7 +480,7 @@ public:
|
||||
typedef __hash_map_iterator<typename __table::iterator> iterator;
|
||||
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY hash_map() {__table_.rehash(193);}
|
||||
hash_map() {__table_.rehash(193);}
|
||||
explicit hash_map(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
hash_map(size_type __n, const hasher& __hf,
|
||||
@@ -530,79 +499,52 @@ public:
|
||||
const allocator_type& __a);
|
||||
hash_map(const hash_map& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_map& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const
|
||||
{return __table_.hash_function().hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const
|
||||
{return __table_.key_eq().key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
mapped_type& operator[](const key_type& __k);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const
|
||||
{return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
|
||||
private:
|
||||
@@ -672,16 +614,16 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
|
||||
{
|
||||
__node_allocator& __na = __table_.__node_alloc();
|
||||
__node_holder __h(__node_traits::allocate(__na, 1), _D(__na));
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
|
||||
__node_traits::construct(__na, addressof(__h->__value_.first), __k);
|
||||
__h.get_deleter().__first_constructed = true;
|
||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||
__node_traits::construct(__na, addressof(__h->__value_.second));
|
||||
__h.get_deleter().__second_constructed = true;
|
||||
return _VSTD::move(__h);
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -704,7 +646,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -732,7 +674,7 @@ operator==(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -742,13 +684,12 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
|
||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||
class _LIBCPP_VISIBLE hash_multimap
|
||||
class hash_multimap
|
||||
{
|
||||
public:
|
||||
// types
|
||||
typedef _Key key_type;
|
||||
typedef _Tp mapped_type;
|
||||
typedef _Tp data_type;
|
||||
typedef _Hash hasher;
|
||||
typedef _Pred key_equal;
|
||||
typedef _Alloc allocator_type;
|
||||
@@ -788,7 +729,6 @@ public:
|
||||
typedef __hash_map_iterator<typename __table::iterator> iterator;
|
||||
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hash_multimap() {__table_.rehash(193);}
|
||||
explicit hash_multimap(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -808,76 +748,49 @@ public:
|
||||
const allocator_type& __a);
|
||||
hash_multimap(const hash_multimap& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first.__i_, __last.__i_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_multimap& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const
|
||||
{return __table_.hash_function().hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const
|
||||
{return __table_.key_eq().key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const
|
||||
{return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
};
|
||||
|
||||
@@ -940,7 +853,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -950,7 +863,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -972,9 +885,9 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
{
|
||||
_EqRng __xeq = __x.equal_range(__i->first);
|
||||
_EqRng __yeq = __y.equal_range(__i->first);
|
||||
if (_VSTD::distance(__xeq.first, __xeq.second) !=
|
||||
_VSTD::distance(__yeq.first, __yeq.second) ||
|
||||
!_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
if (_STD::distance(__xeq.first, __xeq.second) !=
|
||||
_STD::distance(__yeq.first, __yeq.second) ||
|
||||
!_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
return false;
|
||||
__i = __xeq.second;
|
||||
}
|
||||
@@ -982,7 +895,7 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -196,19 +196,16 @@ template <class Value, class Hash, class Pred, class Alloc>
|
||||
#include <__config>
|
||||
#include <__hash_table>
|
||||
#include <functional>
|
||||
#include <ext/__hash>
|
||||
|
||||
#if __DEPRECATED
|
||||
#warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>
|
||||
#endif
|
||||
|
||||
namespace __gnu_cxx {
|
||||
|
||||
using namespace std;
|
||||
|
||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
template <class _Value, class _Hash = std::hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE hash_set
|
||||
class hash_set
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -234,7 +231,6 @@ public:
|
||||
typedef typename __table::const_iterator iterator;
|
||||
typedef typename __table::const_iterator const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hash_set() {__table_.rehash(193);}
|
||||
explicit hash_set(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -252,74 +248,47 @@ public:
|
||||
const allocator_type& __a);
|
||||
hash_set(const hash_set& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> insert(const value_type& __x)
|
||||
{return __table_.__insert_unique(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_set& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const {return __table_.hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const {return __table_.key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_unique(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
};
|
||||
|
||||
@@ -381,7 +350,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -391,7 +360,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -419,7 +388,7 @@ operator==(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_set<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -429,7 +398,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
|
||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||
class _Alloc = allocator<_Value> >
|
||||
class _LIBCPP_VISIBLE hash_multiset
|
||||
class hash_multiset
|
||||
{
|
||||
public:
|
||||
// types
|
||||
@@ -455,7 +424,6 @@ public:
|
||||
typedef typename __table::const_iterator iterator;
|
||||
typedef typename __table::const_iterator const_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hash_multiset() {__table_.rehash(193);}
|
||||
explicit hash_multiset(size_type __n, const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal());
|
||||
@@ -473,73 +441,46 @@ public:
|
||||
const key_equal& __eql, const allocator_type& __a);
|
||||
hash_multiset(const hash_multiset& __u);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __table_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __table_.max_size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() {return __table_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const {return __table_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const {return __table_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
|
||||
template <class _InputIterator>
|
||||
void insert(_InputIterator __first, _InputIterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __p) {__table_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void erase(const_iterator __first, const_iterator __last)
|
||||
{__table_.erase(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() {__table_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(hash_multiset& __u) {__table_.swap(__u.__table_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
hasher hash_funct() const {return __table_.hash_function();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
key_equal key_eq() const {return __table_.key_eq();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, iterator> equal_range(const key_type& __k)
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
|
||||
{return __table_.__equal_range_multi(__k);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type bucket_count() const {return __table_.bucket_count();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_bucket_count() const {return __table_.max_bucket_count();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void resize(size_type __n) {__table_.rehash(__n);}
|
||||
};
|
||||
|
||||
@@ -602,7 +543,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
template <class _InputIterator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
_InputIterator __last)
|
||||
@@ -612,7 +553,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
@@ -634,9 +575,9 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
{
|
||||
_EqRng __xeq = __x.equal_range(*__i);
|
||||
_EqRng __yeq = __y.equal_range(*__i);
|
||||
if (_VSTD::distance(__xeq.first, __xeq.second) !=
|
||||
_VSTD::distance(__yeq.first, __yeq.second) ||
|
||||
!_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
if (_STD::distance(__xeq.first, __xeq.second) !=
|
||||
_STD::distance(__yeq.first, __yeq.second) ||
|
||||
!_STD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
|
||||
return false;
|
||||
__i = __xeq.second;
|
||||
}
|
||||
@@ -644,7 +585,7 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
}
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
|
||||
|
File diff suppressed because it is too large
Load Diff
106
include/fstream
106
include/fstream
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -176,7 +176,7 @@ typedef basic_fstream<wchar_t> wfstream;
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_filebuf
|
||||
class basic_filebuf
|
||||
: public basic_streambuf<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -189,13 +189,13 @@ public:
|
||||
|
||||
// 27.9.1.2 Constructors/destructor:
|
||||
basic_filebuf();
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_filebuf(basic_filebuf&& __rhs);
|
||||
#endif
|
||||
virtual ~basic_filebuf();
|
||||
|
||||
// 27.9.1.3 Assign/swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_filebuf& operator=(basic_filebuf&& __rhs);
|
||||
#endif
|
||||
void swap(basic_filebuf& __rhs);
|
||||
@@ -260,7 +260,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()
|
||||
setbuf(0, 4096);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
|
||||
@@ -333,7 +333,7 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
|
||||
swap(__rhs);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
|
||||
@@ -362,9 +362,9 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
||||
basic_streambuf<char_type, traits_type>::swap(__rhs);
|
||||
if (__extbuf_ != __extbuf_min_ && __rhs.__extbuf_ != __rhs.__extbuf_min_)
|
||||
{
|
||||
_VSTD::swap(__extbuf_, __rhs.__extbuf_);
|
||||
_VSTD::swap(__extbufnext_, __rhs.__extbufnext_);
|
||||
_VSTD::swap(__extbufend_, __rhs.__extbufend_);
|
||||
_STD::swap(__extbuf_, __rhs.__extbuf_);
|
||||
_STD::swap(__extbufnext_, __rhs.__extbufnext_);
|
||||
_STD::swap(__extbufend_, __rhs.__extbufend_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -387,17 +387,17 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
||||
__rhs.__extbufnext_ = __rhs.__extbuf_ + __ln;
|
||||
__rhs.__extbufend_ = __rhs.__extbuf_ + __le;
|
||||
}
|
||||
_VSTD::swap(__ebs_, __rhs.__ebs_);
|
||||
_VSTD::swap(__intbuf_, __rhs.__intbuf_);
|
||||
_VSTD::swap(__ibs_, __rhs.__ibs_);
|
||||
_VSTD::swap(__file_, __rhs.__file_);
|
||||
_VSTD::swap(__cv_, __rhs.__cv_);
|
||||
_VSTD::swap(__st_, __rhs.__st_);
|
||||
_VSTD::swap(__om_, __rhs.__om_);
|
||||
_VSTD::swap(__cm_, __rhs.__cm_);
|
||||
_VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
|
||||
_VSTD::swap(__owns_ib_, __rhs.__owns_ib_);
|
||||
_VSTD::swap(__always_noconv_, __rhs.__always_noconv_);
|
||||
_STD::swap(__ebs_, __rhs.__ebs_);
|
||||
_STD::swap(__intbuf_, __rhs.__intbuf_);
|
||||
_STD::swap(__ibs_, __rhs.__ibs_);
|
||||
_STD::swap(__file_, __rhs.__file_);
|
||||
_STD::swap(__cv_, __rhs.__cv_);
|
||||
_STD::swap(__st_, __rhs.__st_);
|
||||
_STD::swap(__om_, __rhs.__om_);
|
||||
_STD::swap(__cm_, __rhs.__cm_);
|
||||
_STD::swap(__owns_eb_, __rhs.__owns_eb_);
|
||||
_STD::swap(__owns_ib_, __rhs.__owns_ib_);
|
||||
_STD::swap(__always_noconv_, __rhs.__always_noconv_);
|
||||
if (this->eback() == (char_type*)__rhs.__extbuf_min_)
|
||||
{
|
||||
ptrdiff_t __n = this->gptr() - this->eback();
|
||||
@@ -579,7 +579,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
|
||||
this->setg(this->eback(),
|
||||
this->eback() + __unget_sz,
|
||||
this->eback() + __unget_sz + __nmemb);
|
||||
__c = traits_type::to_int_type(*this->gptr());
|
||||
__c = *this->gptr();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -587,7 +587,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
|
||||
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
||||
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
||||
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
||||
size_t __nmemb = _VSTD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
||||
size_t __nmemb = min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
||||
static_cast<size_t>(__extbufend_ - __extbufnext_));
|
||||
codecvt_base::result __r;
|
||||
state_type __svs = __st_;
|
||||
@@ -602,18 +602,18 @@ basic_filebuf<_CharT, _Traits>::underflow()
|
||||
if (__r == codecvt_base::noconv)
|
||||
{
|
||||
this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_);
|
||||
__c = traits_type::to_int_type(*this->gptr());
|
||||
__c = *this->gptr();
|
||||
}
|
||||
else if (__inext != this->eback() + __unget_sz)
|
||||
{
|
||||
this->setg(this->eback(), this->eback() + __unget_sz, __inext);
|
||||
__c = traits_type::to_int_type(*this->gptr());
|
||||
__c = *this->gptr();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
__c = traits_type::to_int_type(*this->gptr());
|
||||
__c = *this->gptr();
|
||||
if (this->eback() == &__1buf)
|
||||
this->setg(0, 0, 0);
|
||||
return __c;
|
||||
@@ -957,7 +957,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
|
||||
// basic_ifstream
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ifstream
|
||||
class basic_ifstream
|
||||
: public basic_istream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -970,11 +970,11 @@ public:
|
||||
basic_ifstream();
|
||||
explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in);
|
||||
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ifstream(basic_ifstream&& __rhs);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ifstream& operator=(basic_ifstream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ifstream& __rhs);
|
||||
@@ -1014,13 +1014,13 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
|
||||
: basic_istream<char_type, traits_type>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_istream<char_type, traits_type>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
this->set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -1030,12 +1030,12 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ifstream<_CharT, _Traits>&
|
||||
basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
|
||||
{
|
||||
basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_istream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1102,7 +1102,7 @@ basic_ifstream<_CharT, _Traits>::close()
|
||||
// basic_ofstream
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ofstream
|
||||
class basic_ofstream
|
||||
: public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -1115,11 +1115,11 @@ public:
|
||||
basic_ofstream();
|
||||
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
|
||||
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ofstream(basic_ofstream&& __rhs);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ofstream& operator=(basic_ofstream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ofstream& __rhs);
|
||||
@@ -1159,13 +1159,13 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
|
||||
: basic_ostream<char_type, traits_type>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_ostream<char_type, traits_type>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
this->set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -1175,12 +1175,12 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ofstream<_CharT, _Traits>&
|
||||
basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
|
||||
{
|
||||
basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_ostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1247,7 +1247,7 @@ basic_ofstream<_CharT, _Traits>::close()
|
||||
// basic_fstream
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_fstream
|
||||
class basic_fstream
|
||||
: public basic_iostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -1260,11 +1260,11 @@ public:
|
||||
basic_fstream();
|
||||
explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_fstream(basic_fstream&& __rhs);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_fstream& operator=(basic_fstream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_fstream& __rhs);
|
||||
@@ -1304,13 +1304,13 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
|
||||
: basic_iostream<char_type, traits_type>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_iostream<char_type, traits_type>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
this->set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -1320,12 +1320,12 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_fstream<_CharT, _Traits>&
|
||||
basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
|
||||
{
|
||||
basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_iostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
|
File diff suppressed because it is too large
Load Diff
2219
include/future
2219
include/future
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -29,15 +29,15 @@ public:
|
||||
typedef const E* iterator;
|
||||
typedef const E* const_iterator;
|
||||
|
||||
initializer_list() noexcept;
|
||||
initializer_list();
|
||||
|
||||
size_t size() const noexcept;
|
||||
const E* begin() const noexcept;
|
||||
const E* end() const noexcept;
|
||||
size_t size() const;
|
||||
const E* begin() const;
|
||||
const E* end() const;
|
||||
};
|
||||
|
||||
template<class E> const E* begin(initializer_list<E> il) noexcept;
|
||||
template<class E> const E* end(initializer_list<E> il) noexcept;
|
||||
template<class E> const E* begin(initializer_list<E> il);
|
||||
template<class E> const E* end(initializer_list<E> il);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -51,16 +51,14 @@ template<class E> const E* end(initializer_list<E> il) noexcept;
|
||||
namespace std // purposefully not versioned
|
||||
{
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
template<class _E>
|
||||
class _LIBCPP_VISIBLE initializer_list
|
||||
class initializer_list
|
||||
{
|
||||
const _E* __begin_;
|
||||
size_t __size_;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
initializer_list(const _E* __b, size_t __s) _NOEXCEPT
|
||||
initializer_list(const _E* __b, size_t __s)
|
||||
: __begin_(__b),
|
||||
__size_(__s)
|
||||
{}
|
||||
@@ -73,17 +71,17 @@ public:
|
||||
typedef const _E* iterator;
|
||||
typedef const _E* const_iterator;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}
|
||||
_LIBCPP_ALWAYS_INLINE initializer_list() : __begin_(nullptr), __size_(0) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE size_t size() const _NOEXCEPT {return __size_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* begin() const _NOEXCEPT {return __begin_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* end() const _NOEXCEPT {return __begin_ + __size_;}
|
||||
_LIBCPP_ALWAYS_INLINE size_t size() const {return __size_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* begin() const {return __begin_;}
|
||||
_LIBCPP_ALWAYS_INLINE const _E* end() const {return __begin_ + __size_;}
|
||||
};
|
||||
|
||||
template<class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
const _E*
|
||||
begin(initializer_list<_E> __il) _NOEXCEPT
|
||||
begin(initializer_list<_E> __il)
|
||||
{
|
||||
return __il.begin();
|
||||
}
|
||||
@@ -91,13 +89,11 @@ begin(initializer_list<_E> __il) _NOEXCEPT
|
||||
template<class _E>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
const _E*
|
||||
end(initializer_list<_E> __il) _NOEXCEPT
|
||||
end(initializer_list<_E> __il)
|
||||
{
|
||||
return __il.end();
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
} // std
|
||||
|
||||
#endif // _LIBCPP_INITIALIZER_LIST
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -43,12 +43,10 @@ class __iom_t1
|
||||
{
|
||||
ios_base::fmtflags __mask_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t1(ios_base::fmtflags __m) : __mask_(__m) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t1& __x)
|
||||
{
|
||||
@@ -58,7 +56,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t1& __x)
|
||||
{
|
||||
@@ -80,12 +77,10 @@ class __iom_t2
|
||||
{
|
||||
ios_base::fmtflags __mask_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t2(ios_base::fmtflags __m) : __mask_(__m) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t2& __x)
|
||||
{
|
||||
@@ -95,7 +90,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t2& __x)
|
||||
{
|
||||
@@ -117,12 +111,10 @@ class __iom_t3
|
||||
{
|
||||
int __base_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t3(int __b) : __base_(__b) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t3& __x)
|
||||
{
|
||||
@@ -135,7 +127,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t3& __x)
|
||||
{
|
||||
@@ -161,12 +152,10 @@ class __iom_t4
|
||||
{
|
||||
_CharT __fill_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t4(_CharT __c) : __fill_(__c) {}
|
||||
|
||||
template <class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t4& __x)
|
||||
{
|
||||
@@ -189,12 +178,10 @@ class __iom_t5
|
||||
{
|
||||
int __n_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t5(int __n) : __n_(__n) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t5& __x)
|
||||
{
|
||||
@@ -204,7 +191,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t5& __x)
|
||||
{
|
||||
@@ -226,12 +212,10 @@ class __iom_t6
|
||||
{
|
||||
int __n_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __iom_t6(int __n) : __n_(__n) {}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t6& __x)
|
||||
{
|
||||
@@ -241,7 +225,6 @@ public:
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t6& __x)
|
||||
{
|
||||
@@ -271,7 +254,6 @@ class __iom_t7
|
||||
_MoneyT& __mon_;
|
||||
bool __intl_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t7(_MoneyT& __mon, bool __intl)
|
||||
: __mon_(__mon), __intl_(__intl) {}
|
||||
|
||||
@@ -331,7 +313,6 @@ class __iom_t8
|
||||
const _MoneyT& __mon_;
|
||||
bool __intl_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t8(const _MoneyT& __mon, bool __intl)
|
||||
: __mon_(__mon), __intl_(__intl) {}
|
||||
|
||||
@@ -390,7 +371,6 @@ class __iom_t9
|
||||
tm* __tm_;
|
||||
const _CharT* __fmt_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t9(tm* __tm, const _CharT* __fmt)
|
||||
: __tm_(__tm), __fmt_(__fmt) {}
|
||||
|
||||
@@ -451,7 +431,6 @@ class __iom_t10
|
||||
const tm* __tm_;
|
||||
const _CharT* __fmt_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__iom_t10(const tm* __tm, const _CharT* __fmt)
|
||||
: __tm_(__tm), __fmt_(__fmt) {}
|
||||
|
||||
|
82
include/ios
82
include/ios
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -222,7 +222,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
typedef ptrdiff_t streamsize;
|
||||
|
||||
class _LIBCPP_VISIBLE ios_base
|
||||
class ios_base
|
||||
{
|
||||
public:
|
||||
class failure;
|
||||
@@ -266,22 +266,22 @@ public:
|
||||
enum seekdir {beg, cur, end};
|
||||
typedef seekdir seek_dir;
|
||||
|
||||
typedef _VSTD::streamoff streamoff;
|
||||
typedef _VSTD::streampos streampos;
|
||||
typedef _STD::streamoff streamoff;
|
||||
typedef _STD::streampos streampos;
|
||||
|
||||
class Init;
|
||||
|
||||
// 27.5.2.2 fmtflags state:
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
|
||||
_LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
|
||||
fmtflags flags() const;
|
||||
fmtflags flags(fmtflags __fmtfl);
|
||||
fmtflags setf(fmtflags __fmtfl);
|
||||
fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
|
||||
void unsetf(fmtflags __mask);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize precision() const;
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize width() const;
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
|
||||
streamsize precision() const;
|
||||
streamsize precision(streamsize __prec);
|
||||
streamsize width() const;
|
||||
streamsize width(streamsize __wide);
|
||||
|
||||
// 27.5.2.3 locales:
|
||||
locale imbue(const locale& __loc);
|
||||
@@ -307,23 +307,22 @@ private:
|
||||
public:
|
||||
static bool sync_with_stdio(bool __sync = true);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
|
||||
iostate rdstate() const;
|
||||
void clear(iostate __state = goodbit);
|
||||
_LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
|
||||
void setstate(iostate __state);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool good() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool eof() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool fail() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool bad() const;
|
||||
bool good() const;
|
||||
bool eof() const;
|
||||
bool fail() const;
|
||||
bool bad() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
|
||||
_LIBCPP_INLINE_VISIBILITY void exceptions(iostate __except);
|
||||
iostate exceptions() const;
|
||||
void exceptions(iostate __except);
|
||||
|
||||
void __set_badbit_and_consider_rethrow();
|
||||
void __set_failbit_and_consider_rethrow();
|
||||
|
||||
protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ios_base() {// purposefully does no initialization
|
||||
}
|
||||
|
||||
@@ -371,7 +370,7 @@ private:
|
||||
};
|
||||
|
||||
//enum class io_errc
|
||||
struct _LIBCPP_VISIBLE io_errc
|
||||
struct io_errc
|
||||
{
|
||||
enum _ {
|
||||
stream = 1
|
||||
@@ -382,12 +381,9 @@ enum _ {
|
||||
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc> : public true_type { };
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc::_> : public true_type { };
|
||||
template <> struct is_error_code_enum<io_errc> : public true_type { };
|
||||
template <> struct is_error_code_enum<io_errc::_> : public true_type { };
|
||||
|
||||
_LIBCPP_VISIBLE
|
||||
const error_category& iostream_category();
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -404,7 +400,7 @@ make_error_condition(io_errc __e)
|
||||
return error_condition(static_cast<int>(__e), iostream_category());
|
||||
}
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI ios_base::failure
|
||||
class ios_base::failure
|
||||
: public system_error
|
||||
{
|
||||
public:
|
||||
@@ -413,7 +409,7 @@ public:
|
||||
virtual ~failure() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE ios_base::Init
|
||||
class ios_base::Init
|
||||
{
|
||||
public:
|
||||
Init();
|
||||
@@ -560,7 +556,7 @@ ios_base::exceptions(iostate __except)
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ios
|
||||
class basic_ios
|
||||
: public ios_base
|
||||
{
|
||||
public:
|
||||
@@ -587,52 +583,36 @@ public:
|
||||
_LIBCPP_ALWAYS_INLINE void exceptions(iostate __except) {ios_base::exceptions(__except);}
|
||||
|
||||
// 27.5.4.1 Constructor/destructor:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
|
||||
virtual ~basic_ios();
|
||||
|
||||
// 27.5.4.2 Members:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<char_type, traits_type>* tie() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_streambuf<char_type, traits_type>* rdbuf() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
|
||||
|
||||
basic_ios& copyfmt(const basic_ios& __rhs);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type fill() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type fill(char_type __ch);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
locale imbue(const locale& __loc);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char narrow(char_type __c, char __dfault) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type widen(char __c) const;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
basic_ios() {// purposefully does no initialization
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void init(basic_streambuf<char_type, traits_type>* __sb);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void move(basic_ios& __rhs);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void move(basic_ios&& __rhs) {move(__rhs);}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(basic_ios& __rhs);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
|
||||
private:
|
||||
basic_ostream<char_type, traits_type>* __tie_;
|
||||
@@ -776,8 +756,8 @@ void
|
||||
basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs)
|
||||
{
|
||||
ios_base::swap(__rhs);
|
||||
_VSTD::swap(__tie_, __rhs.__tie_);
|
||||
_VSTD::swap(__fill_, __rhs.__fill_);
|
||||
_STD::swap(__tie_, __rhs.__tie_);
|
||||
_STD::swap(__fill_, __rhs.__fill_);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace std
|
||||
template<class charT> struct char_traits;
|
||||
template<class T> class allocator;
|
||||
|
||||
class ios_base;
|
||||
template <class charT, class traits = char_traits<charT> > class basic_ios;
|
||||
|
||||
template <class charT, class traits = char_traits<charT> > class basic_streambuf;
|
||||
@@ -93,49 +92,32 @@ typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class ios_base;
|
||||
template<class _CharT> struct char_traits;
|
||||
template<class _Tp> class allocator;
|
||||
|
||||
template<class _CharT> struct _LIBCPP_VISIBLE char_traits;
|
||||
template<class _Tp> class _LIBCPP_VISIBLE allocator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ios;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ios;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_streambuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_istream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ostream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_iostream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_streambuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_istream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ostream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_iostream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_stringbuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_istringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_ostringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
|
||||
class basic_stringstream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_stringbuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_istringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ostringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_stringstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_filebuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ifstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ofstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class basic_fstream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_filebuf;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ifstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_ofstream;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_fstream;
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE istreambuf_iterator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE ostreambuf_iterator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class istreambuf_iterator;
|
||||
template <class _CharT, class _Traits = char_traits<_CharT> > class ostreambuf_iterator;
|
||||
|
||||
typedef basic_ios<char> ios;
|
||||
typedef basic_ios<wchar_t> wios;
|
||||
@@ -170,7 +152,7 @@ typedef basic_ifstream<wchar_t> wifstream;
|
||||
typedef basic_ofstream<wchar_t> wofstream;
|
||||
typedef basic_fstream<wchar_t> wfstream;
|
||||
|
||||
template <class _State> class _LIBCPP_VISIBLE fpos;
|
||||
template <class _State> class fpos;
|
||||
typedef fpos<mbstate_t> streampos;
|
||||
typedef fpos<mbstate_t> wstreampos;
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
@@ -182,8 +164,7 @@ typedef long long streamoff; // for char_traits in <string>
|
||||
|
||||
template <class _CharT, // for <stdexcept>
|
||||
class _Traits = char_traits<_CharT>,
|
||||
class _Allocator = allocator<_CharT> >
|
||||
class _LIBCPP_VISIBLE basic_string;
|
||||
class _Allocator = allocator<_CharT> > class basic_string;
|
||||
typedef basic_string<char, char_traits<char>, allocator<char> > string;
|
||||
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
428
include/istream
428
include/istream
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -160,7 +160,7 @@ template <class charT, class traits, class T>
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_istream
|
||||
class basic_istream
|
||||
: virtual public basic_ios<_CharT, _Traits>
|
||||
{
|
||||
streamsize __gc_;
|
||||
@@ -176,14 +176,12 @@ public:
|
||||
explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb);
|
||||
virtual ~basic_istream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_istream(basic_istream&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.7.1.1.2 Assign/swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_istream& operator=(basic_istream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_istream& __rhs);
|
||||
@@ -213,7 +211,6 @@ public:
|
||||
basic_istream& operator>>(void*& __p);
|
||||
|
||||
// 27.7.1.3 Unformatted input:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
streamsize gcount() const {return __gc_;}
|
||||
int_type get();
|
||||
basic_istream& get(char_type& __c);
|
||||
@@ -240,7 +237,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_istream<_CharT, _Traits>::sentry
|
||||
class basic_istream<_CharT, _Traits>::sentry
|
||||
{
|
||||
bool __ok_;
|
||||
|
||||
@@ -251,7 +248,6 @@ public:
|
||||
explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
|
||||
// ~sentry() = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// explicit
|
||||
operator bool() const {return __ok_;}
|
||||
};
|
||||
@@ -291,7 +287,7 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_
|
||||
this->init(__sb);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -311,7 +307,7 @@ basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT, _Traits>::~basic_istream()
|
||||
@@ -323,7 +319,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
|
||||
{
|
||||
_VSTD::swap(__gc_, __rhs.__gc_);
|
||||
_STD::swap(__gc_, __rhs.__gc_);
|
||||
basic_ios<char_type, traits_type>::swap(__rhs);
|
||||
}
|
||||
|
||||
@@ -742,29 +738,26 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
|
||||
if (__sen)
|
||||
{
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
streamsize __n = __is.width();
|
||||
if (__n <= 0)
|
||||
if (__n == 0)
|
||||
__n = numeric_limits<streamsize>::max() / sizeof(_CharT) - 1;
|
||||
streamsize __c = 0;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (__c < __n-1)
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __c < __n-1; ++__i, ++__s, ++__c)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
_CharT __ch = *__i;
|
||||
if (__ct.is(__ct.space, __ch))
|
||||
break;
|
||||
*__s++ = __ch;
|
||||
++__c;
|
||||
__is.rdbuf()->sbumpc();
|
||||
*__s = __ch;
|
||||
}
|
||||
*__s = _CharT();
|
||||
__is.width(0);
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
@@ -806,11 +799,17 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
|
||||
if (__sen)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
if (__i != __eof)
|
||||
{
|
||||
__c = *__i;
|
||||
if (++__i == __eof)
|
||||
__is.setstate(ios_base::eofbit);
|
||||
}
|
||||
else
|
||||
__c = _Traits::to_char_type(__i);
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -850,42 +849,42 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
|
||||
sentry __s(*this, true);
|
||||
if (__s)
|
||||
{
|
||||
streamsize __c = 0;
|
||||
if (__sb)
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (true)
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
typedef ostreambuf_iterator<char_type, traits_type> _O;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
_O __o(__sb);
|
||||
for (; __i != __eof; ++__i, ++__o, ++__c)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
if (traits_type::eq_int_type(
|
||||
__sb->sputc(traits_type::to_char_type(__i)),
|
||||
traits_type::eof()))
|
||||
*__o = *__i;
|
||||
if (__o.failed())
|
||||
break;
|
||||
++__gc_;
|
||||
this->rdbuf()->sbumpc();
|
||||
}
|
||||
if (__gc_ == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (__gc_ == 0)
|
||||
if (__c == 0)
|
||||
this->__set_failbit_and_consider_rethrow();
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -910,11 +909,22 @@ basic_istream<_CharT, _Traits>::get()
|
||||
sentry __s(*this, true);
|
||||
if (__s)
|
||||
{
|
||||
__r = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__r, traits_type::eof()))
|
||||
this->setstate(ios_base::failbit | ios_base::eofbit);
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i != __eof)
|
||||
{
|
||||
__r = traits_type::to_int_type(*__i);
|
||||
++__c;
|
||||
if (++__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
}
|
||||
else
|
||||
__gc_ = 1;
|
||||
__err |= ios_base::failbit | ios_base::eofbit;
|
||||
this->setstate(__err);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -949,31 +959,30 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
streamsize __c = 0;
|
||||
if (__n > 0)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (__gc_ < __n-1)
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __n > 1; ++__i, ++__s, ++__c)
|
||||
{
|
||||
int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
*__s++ = __ch;
|
||||
++__gc_;
|
||||
this->rdbuf()->sbumpc();
|
||||
*__s = __ch;
|
||||
}
|
||||
*__s = char_type();
|
||||
if (__gc_ == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1006,36 +1015,38 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
streamsize __c = 0;
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
while (true)
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
typedef ostreambuf_iterator<char_type, traits_type> _O;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
_O __o(&__sb);
|
||||
for (; __i != __eof; ++__i, ++__o, ++__c)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof()))
|
||||
*__o = __ch;
|
||||
if (__o.failed())
|
||||
break;
|
||||
++__gc_;
|
||||
this->rdbuf()->sbumpc();
|
||||
}
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
if (__gc_ == 0)
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1067,36 +1078,33 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (true)
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
for (; __i != __eof; ++__s, --__n)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sgetc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
if (__n < 2)
|
||||
{
|
||||
this->rdbuf()->sbumpc();
|
||||
++__gc_;
|
||||
this->setstate(ios_base::failbit);
|
||||
break;
|
||||
}
|
||||
if (__gc_ >= __n-1)
|
||||
{
|
||||
__err |= ios_base::failbit;
|
||||
break;
|
||||
}
|
||||
*__s++ = __ch;
|
||||
this->rdbuf()->sbumpc();
|
||||
++__gc_;
|
||||
*__s = __ch;
|
||||
}
|
||||
if (__n > 0)
|
||||
if (__n)
|
||||
*__s = char_type();
|
||||
if (__gc_ == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1128,40 +1136,35 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__n == numeric_limits<streamsize>::max())
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
if (__n != numeric_limits<streamsize>::max())
|
||||
{
|
||||
while (true)
|
||||
for (; __n > 0 && __i != __eof; --__n)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
++__gc_;
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (__gc_ < __n)
|
||||
while (__i != __eof)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
++__gc_;
|
||||
char_type __ch = traits_type::to_char_type(__i);
|
||||
char_type __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (traits_type::eq(__ch, __dlm))
|
||||
break;
|
||||
}
|
||||
}
|
||||
this->setstate(__err);
|
||||
if (__i == __eof)
|
||||
this->setstate(ios_base::eofbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1208,17 +1211,20 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
for (; __gc_ < __n; ++__gc_)
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __n > 0; ++__i, ++__s, ++__c, --__n)
|
||||
*__s = *__i;
|
||||
if (__i == __eof)
|
||||
{
|
||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
||||
if (traits_type::eq_int_type(__i, traits_type::eof()))
|
||||
{
|
||||
this->setstate(ios_base::failbit | ios_base::eofbit);
|
||||
break;
|
||||
}
|
||||
*__s++ = traits_type::to_char_type(__i);
|
||||
ios_base::iostate __err = ios_base::eofbit;
|
||||
if (__n > 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
}
|
||||
__gc_ = __c;
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
@@ -1236,19 +1242,45 @@ template<class _CharT, class _Traits>
|
||||
streamsize
|
||||
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
|
||||
{
|
||||
streamsize __c = this->rdbuf()->in_avail();
|
||||
switch (__c)
|
||||
__gc_ = 0;
|
||||
streamsize __c = 0;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
case -1:
|
||||
this->setstate(ios_base::eofbit);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
read(__s, _VSTD::min(__c, __n));
|
||||
break;
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
sentry __sen(*this, true);
|
||||
if (__sen)
|
||||
{
|
||||
typedef istreambuf_iterator<char_type, traits_type> _I;
|
||||
_I __i(*this);
|
||||
_I __eof;
|
||||
__c = this->rdbuf()->in_avail();
|
||||
switch (__c)
|
||||
{
|
||||
case -1:
|
||||
__i = __eof;
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
__c = min(__c, __n);
|
||||
for (streamsize __k = 0; __k < __c; ++__k, ++__s, ++__i)
|
||||
*__s = *__i;
|
||||
}
|
||||
if (__i == __eof)
|
||||
this->setstate(ios_base::eofbit);
|
||||
__gc_ = __c;
|
||||
}
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
return __gc_;
|
||||
catch (...)
|
||||
{
|
||||
this->__set_badbit_and_consider_rethrow();
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
return __c;
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
@@ -1411,19 +1443,15 @@ ws(basic_istream<_CharT, _Traits>& __is)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
|
||||
if (__sen)
|
||||
{
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
while (true)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__is.setstate(ios_base::eofbit);
|
||||
break;
|
||||
}
|
||||
if (!__ct.is(__ct.space, _Traits::to_char_type(__i)))
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof; ++__i)
|
||||
if (!__ct.is(__ct.space, *__i))
|
||||
break;
|
||||
__is.rdbuf()->sbumpc();
|
||||
}
|
||||
if (__i == __eof)
|
||||
__is.setstate(ios_base::failbit | ios_base::eofbit);
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1435,7 +1463,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
|
||||
return __is;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1446,10 +1474,10 @@ operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
|
||||
return __is;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_iostream
|
||||
class basic_iostream
|
||||
: public basic_istream<_CharT, _Traits>,
|
||||
public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
@@ -1465,14 +1493,12 @@ public:
|
||||
explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb);
|
||||
virtual ~basic_iostream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_iostream(basic_iostream&& __rhs);
|
||||
#endif
|
||||
|
||||
// assign/swap
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_iostream& operator=(basic_iostream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_iostream& __rhs);
|
||||
@@ -1486,12 +1512,12 @@ basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, trait
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
|
||||
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
|
||||
: basic_istream<_CharT, _Traits>(_STD::move(__rhs))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1504,7 +1530,7 @@ basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_iostream<_CharT, _Traits>::~basic_iostream()
|
||||
@@ -1532,30 +1558,27 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
||||
if (__sen)
|
||||
{
|
||||
__str.clear();
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
streamsize __n = __is.width();
|
||||
if (__n <= 0)
|
||||
if (__n == 0)
|
||||
__n = __str.max_size();
|
||||
if (__n <= 0)
|
||||
if (__n < 0)
|
||||
__n = numeric_limits<streamsize>::max();
|
||||
streamsize __c = 0;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
while (__c < __n)
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __c < __n; ++__i, ++__c)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
_CharT __ch = *__i;
|
||||
if (__ct.is(__ct.space, __ch))
|
||||
break;
|
||||
__str.push_back(__ch);
|
||||
++__c;
|
||||
__is.rdbuf()->sbumpc();
|
||||
}
|
||||
__is.width(0);
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
@@ -1585,28 +1608,31 @@ getline(basic_istream<_CharT, _Traits>& __is,
|
||||
if (__sen)
|
||||
{
|
||||
__str.clear();
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
streamsize __extr = 0;
|
||||
while (true)
|
||||
streamsize __c = 0;
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
streamsize __n = __str.max_size();
|
||||
if (__n < 0)
|
||||
__n = numeric_limits<streamsize>::max();
|
||||
for (; __i != __eof;)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
++__extr;
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
_CharT __ch = *__i;
|
||||
++__i;
|
||||
++__c;
|
||||
if (_Traits::eq(__ch, __dlm))
|
||||
break;
|
||||
__str.push_back(__ch);
|
||||
if (__str.size() == __str.max_size())
|
||||
if (__c == __n)
|
||||
{
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(ios_base::failbit);
|
||||
break;
|
||||
}
|
||||
__str.push_back(__ch);
|
||||
}
|
||||
if (__extr == 0)
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
}
|
||||
@@ -1621,7 +1647,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str)
|
||||
@@ -1629,10 +1655,10 @@ getline(basic_istream<_CharT, _Traits>& __is,
|
||||
return getline(__is, __str, __is.widen('\n'));
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
|
||||
@@ -1641,7 +1667,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
basic_istream<_CharT, _Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
basic_string<_CharT, _Traits, _Allocator>& __str)
|
||||
@@ -1649,7 +1675,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
|
||||
return getline(__is, __str, __is.widen('\n'));
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
@@ -1664,26 +1690,24 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
|
||||
{
|
||||
basic_string<_CharT, _Traits> __str;
|
||||
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
streamsize __c = 0;
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
_CharT __zero = __ct.widen('0');
|
||||
_CharT __one = __ct.widen('1');
|
||||
while (__c < _Size)
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
for (; __i != __eof && __c < _Size; ++__i, ++__c)
|
||||
{
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sgetc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
{
|
||||
__err |= ios_base::eofbit;
|
||||
break;
|
||||
}
|
||||
_CharT __ch = _Traits::to_char_type(__i);
|
||||
if (!_Traits::eq(__ch, __zero) && !_Traits::eq(__ch, __one))
|
||||
_CharT __ch = *__i;
|
||||
if (__ch != __zero && __ch != __one)
|
||||
break;
|
||||
__str.push_back(__ch);
|
||||
++__c;
|
||||
__is.rdbuf()->sbumpc();
|
||||
}
|
||||
__is.width(0);
|
||||
__x = bitset<_Size>(__str);
|
||||
ios_base::iostate __err = ios_base::goodbit;
|
||||
if (__i == __eof)
|
||||
__err |= ios_base::eofbit;
|
||||
if (__c == 0)
|
||||
__err |= ios_base::failbit;
|
||||
__is.setstate(__err);
|
||||
|
316
include/iterator
316
include/iterator
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
typedef void pointer;
|
||||
|
||||
explicit back_insert_iterator(Container& x);
|
||||
back_insert_iterator& operator=(const typename Container::value_type& value);
|
||||
back_insert_iterator& operator=(typename Container::const_reference value);
|
||||
back_insert_iterator& operator*();
|
||||
back_insert_iterator& operator++();
|
||||
back_insert_iterator operator++(int);
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
typedef void pointer;
|
||||
|
||||
explicit front_insert_iterator(Container& x);
|
||||
front_insert_iterator& operator=(const typename Container::value_type& value);
|
||||
front_insert_iterator& operator=(typename Container::const_reference value);
|
||||
front_insert_iterator& operator*();
|
||||
front_insert_iterator& operator++();
|
||||
front_insert_iterator operator++(int);
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
typedef void pointer;
|
||||
|
||||
insert_iterator(Container& x, typename Container::iterator i);
|
||||
insert_iterator& operator=(const typename Container::value_type& value);
|
||||
insert_iterator& operator=(typename Container::const_reference value);
|
||||
insert_iterator& operator*();
|
||||
insert_iterator& operator++();
|
||||
insert_iterator& operator++(int);
|
||||
@@ -325,11 +325,11 @@ template <class T, size_t N> T* end(T (&array)[N]);
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
struct _LIBCPP_VISIBLE input_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE output_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE forward_iterator_tag : public input_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||
struct _LIBCPP_VISIBLE random_access_iterator_tag : public bidirectional_iterator_tag {};
|
||||
struct input_iterator_tag {};
|
||||
struct output_iterator_tag {};
|
||||
struct forward_iterator_tag : public input_iterator_tag {};
|
||||
struct bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
|
||||
|
||||
template <class _Tp>
|
||||
struct __has_iterator_category
|
||||
@@ -372,11 +372,11 @@ struct __iterator_traits<_Iter, true>
|
||||
// the client expects instead of failing at compile time.
|
||||
|
||||
template <class _Iter>
|
||||
struct _LIBCPP_VISIBLE iterator_traits
|
||||
struct iterator_traits
|
||||
: __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};
|
||||
|
||||
template<class _Tp>
|
||||
struct _LIBCPP_VISIBLE iterator_traits<_Tp*>
|
||||
struct iterator_traits<_Tp*>
|
||||
{
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef typename remove_const<_Tp>::type value_type;
|
||||
@@ -407,7 +407,7 @@ struct __is_random_access_iterator : public __has_iterator_category_convertible_
|
||||
|
||||
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
|
||||
class _Pointer = _Tp*, class _Reference = _Tp&>
|
||||
struct _LIBCPP_VISIBLE iterator
|
||||
struct iterator
|
||||
{
|
||||
typedef _Tp value_type;
|
||||
typedef _Distance difference_type;
|
||||
@@ -482,29 +482,29 @@ distance(_InputIter __first, _InputIter __last)
|
||||
}
|
||||
|
||||
template <class _ForwardIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_ForwardIter
|
||||
next(_ForwardIter __x,
|
||||
typename iterator_traits<_ForwardIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type* = 0)
|
||||
{
|
||||
_VSTD::advance(__x, __n);
|
||||
advance(__x, __n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _BidiretionalIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_BidiretionalIter
|
||||
prev(_BidiretionalIter __x,
|
||||
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)
|
||||
{
|
||||
_VSTD::advance(__x, -__n);
|
||||
advance(__x, -__n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _Iter>
|
||||
class _LIBCPP_VISIBLE reverse_iterator
|
||||
class reverse_iterator
|
||||
: public iterator<typename iterator_traits<_Iter>::iterator_category,
|
||||
typename iterator_traits<_Iter>::value_type,
|
||||
typename iterator_traits<_Iter>::difference_type,
|
||||
@@ -611,7 +611,7 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
|
||||
}
|
||||
|
||||
template <class _Container>
|
||||
class _LIBCPP_VISIBLE back_insert_iterator
|
||||
class back_insert_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
void,
|
||||
void,
|
||||
@@ -624,12 +624,12 @@ public:
|
||||
typedef _Container container_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(&__x) {}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value)
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::const_reference __value)
|
||||
{container->push_back(__value); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{container->push_back(_VSTD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{container->push_back(_STD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY back_insert_iterator operator++(int) {return *this;}
|
||||
@@ -644,7 +644,7 @@ back_inserter(_Container& __x)
|
||||
}
|
||||
|
||||
template <class _Container>
|
||||
class _LIBCPP_VISIBLE front_insert_iterator
|
||||
class front_insert_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
void,
|
||||
void,
|
||||
@@ -657,12 +657,12 @@ public:
|
||||
typedef _Container container_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(&__x) {}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value)
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::const_reference __value)
|
||||
{container->push_front(__value); return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{container->push_front(_VSTD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{container->push_front(_STD::move(__value)); return *this;}
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY front_insert_iterator operator++(int) {return *this;}
|
||||
@@ -677,7 +677,7 @@ front_inserter(_Container& __x)
|
||||
}
|
||||
|
||||
template <class _Container>
|
||||
class _LIBCPP_VISIBLE insert_iterator
|
||||
class insert_iterator
|
||||
: public iterator<output_iterator_tag,
|
||||
void,
|
||||
void,
|
||||
@@ -692,12 +692,12 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator(_Container& __x, typename _Container::iterator __i)
|
||||
: container(&__x), iter(__i) {}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value)
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::const_reference __value)
|
||||
{iter = container->insert(iter, __value); ++iter; return *this;}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value)
|
||||
{iter = container->insert(iter, _VSTD::move(__value)); ++iter; return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{iter = container->insert(iter, _STD::move(__value)); ++iter; return *this;}
|
||||
#endif // _LIBCPP_MOVE
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int) {return *this;}
|
||||
@@ -713,7 +713,7 @@ inserter(_Container& __x, typename _Container::iterator __i)
|
||||
|
||||
template <class _Tp, class _CharT = char,
|
||||
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
|
||||
class _LIBCPP_VISIBLE istream_iterator
|
||||
class istream_iterator
|
||||
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
|
||||
{
|
||||
public:
|
||||
@@ -752,7 +752,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_VISIBLE ostream_iterator
|
||||
class ostream_iterator
|
||||
: public iterator<output_iterator_tag, void, void, void, void>
|
||||
{
|
||||
public:
|
||||
@@ -781,7 +781,7 @@ public:
|
||||
};
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE istreambuf_iterator
|
||||
class istreambuf_iterator
|
||||
: public iterator<input_iterator_tag, _CharT,
|
||||
typename _Traits::off_type, _CharT*,
|
||||
_CharT>
|
||||
@@ -806,7 +806,6 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
|
||||
};
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __test_for_eof()
|
||||
{
|
||||
if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
|
||||
@@ -821,7 +820,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) throw()
|
||||
: __sbuf_(__p.__sbuf_) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _CharT operator*() const {return __sbuf_->sgetc();}
|
||||
_LIBCPP_INLINE_VISIBILITY _CharT operator*() const {return __sbuf_->sgetc();}
|
||||
_LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}
|
||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
|
||||
{
|
||||
@@ -853,7 +852,7 @@ bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
|
||||
{return !__a.equal(__b);}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE ostreambuf_iterator
|
||||
class ostreambuf_iterator
|
||||
: public iterator<output_iterator_tag, void, void, void, void>
|
||||
{
|
||||
public:
|
||||
@@ -881,7 +880,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Iter>
|
||||
class _LIBCPP_VISIBLE move_iterator
|
||||
class move_iterator
|
||||
{
|
||||
private:
|
||||
_Iter __i;
|
||||
@@ -891,7 +890,7 @@ public:
|
||||
typedef typename iterator_traits<iterator_type>::value_type value_type;
|
||||
typedef typename iterator_traits<iterator_type>::difference_type difference_type;
|
||||
typedef typename iterator_traits<iterator_type>::pointer pointer;
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
typedef value_type&& reference;
|
||||
#else
|
||||
typedef typename iterator_traits<iterator_type>::reference reference;
|
||||
@@ -902,13 +901,8 @@ public:
|
||||
template <class _Up> _LIBCPP_INLINE_VISIBILITY move_iterator(const move_iterator<_Up>& __u)
|
||||
: __i(__u.base()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY _Iter base() const {return __i;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {
|
||||
return static_cast<reference>(*__i);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {
|
||||
typename iterator_traits<iterator_type>::reference __ref = *__i;
|
||||
return &__ref;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__i;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &(operator*());}
|
||||
_LIBCPP_INLINE_VISIBILITY move_iterator& operator++() {++__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY move_iterator operator++(int)
|
||||
{move_iterator __tmp(*this); ++__i; return __tmp;}
|
||||
@@ -924,9 +918,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY move_iterator& operator-=(difference_type __n)
|
||||
{__i -= __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
|
||||
{
|
||||
return static_cast<reference>(__i[__n]);
|
||||
}
|
||||
{return __i[__n];}
|
||||
};
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
@@ -1007,35 +999,35 @@ template <class _Iter> class __wrap_iter;
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter>
|
||||
__wrap_iter<_Iter>
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type, const __wrap_iter<_Iter>&);
|
||||
|
||||
template <class _I, class _O> _O copy(_I, _I, _O);
|
||||
template <class _B1, class _B2> _B2 copy_backward(_B1, _B1, _B2);
|
||||
@@ -1045,7 +1037,7 @@ template <class _B1, class _B2> _B2 move_backward(_B1, _B1, _B2);
|
||||
template <class _Tp>
|
||||
typename enable_if
|
||||
<
|
||||
is_trivially_copy_assignable<_Tp>::value,
|
||||
has_trivial_copy_assign<_Tp>::value,
|
||||
_Tp*
|
||||
>::type
|
||||
__unwrap_iter(__wrap_iter<_Tp*>);
|
||||
@@ -1063,108 +1055,33 @@ public:
|
||||
private:
|
||||
iterator_type __i;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
__get_db()->__insert_i(this);
|
||||
#endif
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter() {}
|
||||
template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,
|
||||
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
|
||||
: __i(__u.base())
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
__get_db()->__iterator_copy(this, &__u);
|
||||
#endif
|
||||
}
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter(const __wrap_iter& __x)
|
||||
: __i(__x.base())
|
||||
{
|
||||
__get_db()->__iterator_copy(this, &__x);
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter& operator=(const __wrap_iter& __x)
|
||||
{
|
||||
if (this != &__x)
|
||||
{
|
||||
__get_db()->__iterator_copy(this, &__x);
|
||||
__i = __x.__i;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
~__wrap_iter()
|
||||
{
|
||||
__get_db()->__erase_i(this);
|
||||
}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to dereference a non-dereferenceable iterator");
|
||||
#endif
|
||||
return *__i;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT {return &(operator*());}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to increment non-incrementable iterator");
|
||||
#endif
|
||||
++__i;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT
|
||||
{__wrap_iter __tmp(*this); ++(*this); return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
||||
"Attempted to decrement non-decrementable iterator");
|
||||
#endif
|
||||
--__i;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT
|
||||
{__wrap_iter __tmp(*this); --(*this); return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
|
||||
{__wrap_iter __w(*this); __w += __n; return __w;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
|
||||
"Attempted to add/subtract iterator outside of valid range");
|
||||
#endif
|
||||
__i += __n;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT
|
||||
{return *this + (-__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
|
||||
{*this += -__n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
|
||||
"Attempted to subscript iterator outside of valid range");
|
||||
#endif
|
||||
return __i[__n];
|
||||
}
|
||||
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0)
|
||||
: __i(__u.base()) {}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__i;}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &(operator*());}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() {++__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int)
|
||||
{__wrap_iter __tmp(*this); ++__i; return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() {--__i; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int)
|
||||
{__wrap_iter __tmp(*this); --__i; return __tmp;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const
|
||||
{return __wrap_iter(__i + __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n)
|
||||
{__i += __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const
|
||||
{return __wrap_iter(__i - __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n)
|
||||
{__i -= __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
|
||||
{return __i[__n];}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT {return __i;}
|
||||
_LIBCPP_INLINE_VISIBILITY iterator_type base() const {return __i;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
|
||||
{
|
||||
__get_db()->__insert_ic(this, __p);
|
||||
}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) : __i(__x) {}
|
||||
|
||||
template <class _Up> friend class __wrap_iter;
|
||||
template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
|
||||
@@ -1173,42 +1090,42 @@ private:
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
friend
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&);
|
||||
|
||||
template <class _Iter1>
|
||||
friend
|
||||
__wrap_iter<_Iter1>
|
||||
operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT;
|
||||
operator+(typename __wrap_iter<_Iter1>::difference_type, const __wrap_iter<_Iter1>&);
|
||||
|
||||
template <class _I, class _O> friend _O copy(_I, _I, _O);
|
||||
template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2);
|
||||
@@ -1219,7 +1136,7 @@ private:
|
||||
friend
|
||||
typename enable_if
|
||||
<
|
||||
is_trivially_copy_assignable<_Tp>::value,
|
||||
has_trivial_copy_assign<_Tp>::value,
|
||||
_Tp*
|
||||
>::type
|
||||
__unwrap_iter(__wrap_iter<_Tp*>);
|
||||
@@ -1228,68 +1145,56 @@ private:
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
||||
"Attempted to compare incomparable iterators");
|
||||
#endif
|
||||
return __x.base() == __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
||||
"Attempted to compare incomparable iterators");
|
||||
#endif
|
||||
return __x.base() < __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
return !(__x == __y);
|
||||
return __x.base() != __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
return __y < __x;
|
||||
return __x.base() > __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
return !(__x < __y);
|
||||
return __x.base() >= __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
return !(__y < __x);
|
||||
return __x.base() <= __y.base();
|
||||
}
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __wrap_iter<_Iter1>::difference_type
|
||||
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
|
||||
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y)
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
||||
"Attempted to subtract incompatible iterators");
|
||||
#endif
|
||||
return __x.base() - __y.base();
|
||||
}
|
||||
|
||||
@@ -1297,10 +1202,9 @@ template <class _Iter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__wrap_iter<_Iter>
|
||||
operator+(typename __wrap_iter<_Iter>::difference_type __n,
|
||||
__wrap_iter<_Iter> __x) _NOEXCEPT
|
||||
const __wrap_iter<_Iter>& __x)
|
||||
{
|
||||
__x += __n;
|
||||
return __x;
|
||||
return __wrap_iter<_Iter>(__x.base() + __n);
|
||||
}
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
@@ -1711,10 +1615,10 @@ operator+(typename __debug_iter<_Container, _Iter>::difference_type __n,
|
||||
|
||||
#endif // _LIBCPP_DEBUG
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
|
||||
#if defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
begin(_C& __c) -> decltype(__c.begin())
|
||||
{
|
||||
@@ -1722,7 +1626,7 @@ begin(_C& __c) -> decltype(__c.begin())
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
begin(const _C& __c) -> decltype(__c.begin())
|
||||
{
|
||||
@@ -1730,7 +1634,7 @@ begin(const _C& __c) -> decltype(__c.begin())
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
end(_C& __c) -> decltype(__c.end())
|
||||
{
|
||||
@@ -1738,17 +1642,17 @@ end(_C& __c) -> decltype(__c.end())
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
auto
|
||||
end(const _C& __c) -> decltype(__c.end())
|
||||
{
|
||||
return __c.end();
|
||||
}
|
||||
|
||||
#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
|
||||
#else // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::iterator
|
||||
begin(_C& __c)
|
||||
{
|
||||
@@ -1756,7 +1660,7 @@ begin(_C& __c)
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::const_iterator
|
||||
begin(const _C& __c)
|
||||
{
|
||||
@@ -1764,7 +1668,7 @@ begin(const _C& __c)
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::iterator
|
||||
end(_C& __c)
|
||||
{
|
||||
@@ -1772,17 +1676,17 @@ end(_C& __c)
|
||||
}
|
||||
|
||||
template <class _C>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
typename _C::const_iterator
|
||||
end(const _C& __c)
|
||||
{
|
||||
return __c.end();
|
||||
}
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
|
||||
#endif // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_DECLTYPE)
|
||||
|
||||
template <class _T, size_t _N>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_T*
|
||||
begin(_T (&__array)[_N])
|
||||
{
|
||||
@@ -1790,7 +1694,7 @@ begin(_T (&__array)[_N])
|
||||
}
|
||||
|
||||
template <class _T, size_t _N>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
_T*
|
||||
end(_T (&__array)[_N])
|
||||
{
|
||||
|
210
include/limits
210
include/limits
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -22,9 +22,9 @@ class numeric_limits
|
||||
{
|
||||
public:
|
||||
static const bool is_specialized = false;
|
||||
static T min() noexcept;
|
||||
static T max() noexcept;
|
||||
static T lowest() noexcept;
|
||||
static T min() throw();
|
||||
static T max() throw();
|
||||
static T lowest() throw();
|
||||
|
||||
static const int digits = 0;
|
||||
static const int digits10 = 0;
|
||||
@@ -33,8 +33,8 @@ public:
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = 0;
|
||||
static T epsilon() noexcept;
|
||||
static T round_error() noexcept;
|
||||
static T epsilon() throw();
|
||||
static T round_error() throw();
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -46,10 +46,10 @@ public:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
static T infinity() noexcept;
|
||||
static T quiet_NaN() noexcept;
|
||||
static T signaling_NaN() noexcept;
|
||||
static T denorm_min() noexcept;
|
||||
static T infinity() throw();
|
||||
static T quiet_NaN() throw();
|
||||
static T signaling_NaN() throw();
|
||||
static T denorm_min() throw();
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = false;
|
||||
@@ -132,9 +132,9 @@ protected:
|
||||
typedef _Tp type;
|
||||
|
||||
static const bool is_specialized = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return type();}
|
||||
|
||||
static const int digits = 0;
|
||||
static const int digits10 = 0;
|
||||
@@ -143,8 +143,8 @@ protected:
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = 0;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type();}
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -156,10 +156,10 @@ protected:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type();}
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = false;
|
||||
@@ -196,15 +196,15 @@ protected:
|
||||
static const int max_digits10 = 0;
|
||||
static const type __min = __libcpp_compute_min<type, digits, is_signed>::value;
|
||||
static const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return min();}
|
||||
|
||||
static const bool is_integer = true;
|
||||
static const bool is_exact = true;
|
||||
static const int radix = 2;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type(0);}
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -216,10 +216,10 @@ protected:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type(0);}
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = true;
|
||||
@@ -248,15 +248,15 @@ protected:
|
||||
static const int max_digits10 = 0;
|
||||
static const type __min = false;
|
||||
static const type __max = true;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __min;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __max;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return min();}
|
||||
|
||||
static const bool is_integer = true;
|
||||
static const bool is_exact = true;
|
||||
static const int radix = 2;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type(0);}
|
||||
|
||||
static const int min_exponent = 0;
|
||||
static const int min_exponent10 = 0;
|
||||
@@ -268,10 +268,10 @@ protected:
|
||||
static const bool has_signaling_NaN = false;
|
||||
static const float_denorm_style has_denorm = denorm_absent;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type(0);}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type(0);}
|
||||
|
||||
static const bool is_iec559 = false;
|
||||
static const bool is_bounded = true;
|
||||
@@ -294,15 +294,15 @@ protected:
|
||||
static const int digits = __FLT_MANT_DIG__;
|
||||
static const int digits10 = __FLT_DIG__;
|
||||
static const int max_digits10 = 2+(digits * 30103)/100000;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __FLT_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __FLT_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __FLT_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __FLT_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();}
|
||||
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = __FLT_RADIX__;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __FLT_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5F;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __FLT_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5F;}
|
||||
|
||||
static const int min_exponent = __FLT_MIN_EXP__;
|
||||
static const int min_exponent10 = __FLT_MIN_10_EXP__;
|
||||
@@ -314,10 +314,10 @@ protected:
|
||||
static const bool has_signaling_NaN = true;
|
||||
static const float_denorm_style has_denorm = denorm_present;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_valf();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_valf();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nanf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nansf("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __FLT_DENORM_MIN__;}
|
||||
|
||||
static const bool is_iec559 = true;
|
||||
static const bool is_bounded = true;
|
||||
@@ -340,15 +340,15 @@ protected:
|
||||
static const int digits = __DBL_MANT_DIG__;
|
||||
static const int digits10 = __DBL_DIG__;
|
||||
static const int max_digits10 = 2+(digits * 30103)/100000;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __DBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __DBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __DBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __DBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();}
|
||||
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = __FLT_RADIX__;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __DBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __DBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5;}
|
||||
|
||||
static const int min_exponent = __DBL_MIN_EXP__;
|
||||
static const int min_exponent10 = __DBL_MIN_10_EXP__;
|
||||
@@ -360,10 +360,10 @@ protected:
|
||||
static const bool has_signaling_NaN = true;
|
||||
static const float_denorm_style has_denorm = denorm_present;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_val();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nan("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nans("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_val();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nan("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nans("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __DBL_DENORM_MIN__;}
|
||||
|
||||
static const bool is_iec559 = true;
|
||||
static const bool is_bounded = true;
|
||||
@@ -386,15 +386,15 @@ protected:
|
||||
static const int digits = __LDBL_MANT_DIG__;
|
||||
static const int digits10 = __LDBL_DIG__;
|
||||
static const int max_digits10 = 2+(digits * 30103)/100000;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __LDBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __LDBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __LDBL_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __LDBL_MAX__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();}
|
||||
|
||||
static const bool is_integer = false;
|
||||
static const bool is_exact = false;
|
||||
static const int radix = __FLT_RADIX__;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __LDBL_EPSILON__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5;}
|
||||
|
||||
static const int min_exponent = __LDBL_MIN_EXP__;
|
||||
static const int min_exponent10 = __LDBL_MIN_10_EXP__;
|
||||
@@ -406,10 +406,10 @@ protected:
|
||||
static const bool has_signaling_NaN = true;
|
||||
static const float_denorm_style has_denorm = denorm_present;
|
||||
static const bool has_denorm_loss = false;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_vall();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_vall();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nanl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nansl("");}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __LDBL_DENORM_MIN__;}
|
||||
|
||||
#if (defined(__ppc__) || defined(__ppc64__))
|
||||
static const bool is_iec559 = false;
|
||||
@@ -425,16 +425,16 @@ protected:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits
|
||||
class numeric_limits
|
||||
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
|
||||
{
|
||||
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
|
||||
typedef typename __base::type type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -443,8 +443,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -456,10 +456,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
@@ -471,16 +471,16 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits<const _Tp>
|
||||
class numeric_limits<const _Tp>
|
||||
: private numeric_limits<_Tp>
|
||||
{
|
||||
typedef numeric_limits<_Tp> __base;
|
||||
typedef _Tp type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -489,8 +489,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -502,10 +502,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
@@ -517,16 +517,16 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits<volatile _Tp>
|
||||
class numeric_limits<volatile _Tp>
|
||||
: private numeric_limits<_Tp>
|
||||
{
|
||||
typedef numeric_limits<_Tp> __base;
|
||||
typedef _Tp type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -535,8 +535,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -548,10 +548,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
@@ -563,16 +563,16 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_VISIBLE numeric_limits<const volatile _Tp>
|
||||
class numeric_limits<const volatile _Tp>
|
||||
: private numeric_limits<_Tp>
|
||||
{
|
||||
typedef numeric_limits<_Tp> __base;
|
||||
typedef _Tp type;
|
||||
public:
|
||||
static const bool is_specialized = __base::is_specialized;
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();}
|
||||
|
||||
static const int digits = __base::digits;
|
||||
static const int digits10 = __base::digits10;
|
||||
@@ -581,8 +581,8 @@ public:
|
||||
static const bool is_integer = __base::is_integer;
|
||||
static const bool is_exact = __base::is_exact;
|
||||
static const int radix = __base::radix;
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();}
|
||||
|
||||
static const int min_exponent = __base::min_exponent;
|
||||
static const int min_exponent10 = __base::min_exponent10;
|
||||
@@ -594,10 +594,10 @@ public:
|
||||
static const bool has_signaling_NaN = __base::has_signaling_NaN;
|
||||
static const float_denorm_style has_denorm = __base::has_denorm;
|
||||
static const bool has_denorm_loss = __base::has_denorm_loss;
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();}
|
||||
_LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();}
|
||||
|
||||
static const bool is_iec559 = __base::is_iec559;
|
||||
static const bool is_bounded = __base::is_bounded;
|
||||
|
1126
include/list
1126
include/list
File diff suppressed because it is too large
Load Diff
573
include/locale
573
include/locale
File diff suppressed because it is too large
Load Diff
800
include/map
800
include/map
File diff suppressed because it is too large
Load Diff
1351
include/memory
1351
include/memory
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -175,15 +175,12 @@ template<class Callable, class ...Args>
|
||||
#include <__config>
|
||||
#include <__mutex_base>
|
||||
#include <functional>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE recursive_mutex
|
||||
class recursive_mutex
|
||||
{
|
||||
pthread_mutex_t __m_;
|
||||
|
||||
@@ -201,11 +198,10 @@ public:
|
||||
void unlock();
|
||||
|
||||
typedef pthread_mutex_t* native_handle_type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
native_handle_type native_handle() {return &__m_;}
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE timed_mutex
|
||||
class timed_mutex
|
||||
{
|
||||
mutex __m_;
|
||||
condition_variable __cv_;
|
||||
@@ -222,9 +218,8 @@ public:
|
||||
void lock();
|
||||
bool try_lock();
|
||||
template <class _Rep, class _Period>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
||||
{return try_lock_until(chrono::steady_clock::now() + __d);}
|
||||
{return try_lock_until(chrono::monotonic_clock::now() + __d);}
|
||||
template <class _Clock, class _Duration>
|
||||
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
|
||||
void unlock();
|
||||
@@ -247,7 +242,7 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
|
||||
return false;
|
||||
}
|
||||
|
||||
class _LIBCPP_VISIBLE recursive_timed_mutex
|
||||
class recursive_timed_mutex
|
||||
{
|
||||
mutex __m_;
|
||||
condition_variable __cv_;
|
||||
@@ -265,9 +260,8 @@ public:
|
||||
void lock();
|
||||
bool try_lock();
|
||||
template <class _Rep, class _Period>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
||||
{return try_lock_until(chrono::steady_clock::now() + __d);}
|
||||
{return try_lock_until(chrono::monotonic_clock::now() + __d);}
|
||||
template <class _Clock, class _Duration>
|
||||
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
|
||||
void unlock();
|
||||
@@ -367,9 +361,9 @@ lock(_L0& __l0, _L1& __l1)
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _L0, class _L1, class _L2, class ..._L3>
|
||||
template <class _L0, class _L1, class ..._L2>
|
||||
void
|
||||
__lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
|
||||
__lock_first(int __i, _L0& __l0, _L1& __l1, _L2& ...__l2)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -378,7 +372,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
|
||||
case 0:
|
||||
{
|
||||
unique_lock<_L0> __u0(__l0);
|
||||
__i = try_lock(__l1, __l2, __l3...);
|
||||
__i = try_lock(__l1, __l2...);
|
||||
if (__i == -1)
|
||||
{
|
||||
__u0.release();
|
||||
@@ -391,32 +385,32 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
|
||||
case 1:
|
||||
{
|
||||
unique_lock<_L1> __u1(__l1);
|
||||
__i = try_lock(__l2, __l3..., __l0);
|
||||
__i = try_lock(__l2..., __l0);
|
||||
if (__i == -1)
|
||||
{
|
||||
__u1.release();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (__i == sizeof...(_L3) + 1)
|
||||
if (__i == sizeof...(_L2))
|
||||
__i = 0;
|
||||
else
|
||||
__i += 2;
|
||||
sched_yield();
|
||||
break;
|
||||
default:
|
||||
__lock_first(__i - 2, __l2, __l3..., __l0, __l1);
|
||||
__lock_first(__i - 2, __l2..., __l0, __l1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class _L0, class _L1, class _L2, class ..._L3>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
template <class _L0, class _L1, class ..._L2>
|
||||
inline
|
||||
void
|
||||
lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
|
||||
lock(_L0& __l0, _L1& __l1, _L2& ...__l2)
|
||||
{
|
||||
__lock_first(0, __l0, __l1, __l2, __l3...);
|
||||
__lock_first(0, __l0, __l1, __l2...);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -435,9 +429,8 @@ template<class _Callable>
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
struct _LIBCPP_VISIBLE once_flag
|
||||
struct once_flag
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
// constexpr
|
||||
once_flag() {}
|
||||
|
||||
@@ -458,61 +451,23 @@ private:
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
class __call_once_param
|
||||
{
|
||||
_F __f_;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
|
||||
#ifdef _LIBCPP_MOVE
|
||||
explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(const _F& __f) : __f_(__f) {}
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()()
|
||||
{
|
||||
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
|
||||
__execute(_Index());
|
||||
}
|
||||
|
||||
private:
|
||||
template <size_t ..._Indices>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <class _F>
|
||||
class __call_once_param
|
||||
{
|
||||
_F __f_;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(const _F& __f) : __f_(__f) {}
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()()
|
||||
{
|
||||
__f_();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__call_once_proxy(void* __vp)
|
||||
@@ -532,9 +487,10 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
|
||||
{
|
||||
if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
|
||||
{
|
||||
typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G;
|
||||
__call_once_param<_G> __p(_G(__decay_copy(_VSTD::forward<_Callable>(__func)),
|
||||
__decay_copy(_VSTD::forward<_Args>(__args))...));
|
||||
typedef decltype(std::bind(std::forward<_Callable>(__func),
|
||||
std::forward<_Args>(__args)...)) _G;
|
||||
__call_once_param<_G> __p(std::bind(std::forward<_Callable>(__func),
|
||||
std::forward<_Args>(__args)...));
|
||||
__call_once(__flag.__state_, &__p, &__call_once_proxy<_G>);
|
||||
}
|
||||
}
|
||||
|
89
include/new
89
include/new
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -21,34 +21,34 @@ class bad_alloc
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_alloc() noexcept;
|
||||
bad_alloc(const bad_alloc&) noexcept;
|
||||
bad_alloc& operator=(const bad_alloc&) noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
bad_alloc() throw();
|
||||
bad_alloc(const bad_alloc&) throw();
|
||||
bad_alloc& operator=(const bad_alloc&) throw();
|
||||
virtual ~bad_alloc() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
struct nothrow_t {};
|
||||
extern const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
new_handler set_new_handler(new_handler new_p) noexcept;
|
||||
new_handler get_new_handler() noexcept;
|
||||
new_handler set_new_handler(new_handler new_p) throw();
|
||||
|
||||
} // std
|
||||
|
||||
void* operator new(std::size_t size); // replaceable
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable
|
||||
void operator delete(void* ptr) noexcept; // replaceable
|
||||
void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable
|
||||
void* operator new(std::size_t size) throw(std::bad_alloc); // replaceable
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) throw(); // replaceable
|
||||
void operator delete(void* ptr) throw(); // replaceable
|
||||
void operator delete(void* ptr, const std::nothrow_t&) throw(); // replaceable
|
||||
|
||||
void* operator new[](std::size_t size); // replaceable
|
||||
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable
|
||||
void operator delete[](void* ptr) noexcept; // replaceable
|
||||
void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable
|
||||
void* operator new[](std::size_t size) throw(std::bad_alloc); // replaceable
|
||||
void* operator new[](std::size_t size, const std::nothrow_t&) throw(); // replaceable
|
||||
void operator delete[](void* ptr) throw(); // replaceable
|
||||
void operator delete[](void* ptr, const std::nothrow_t&) throw(); // replaceable
|
||||
|
||||
void* operator new (std::size_t size, void* ptr) noexcept;
|
||||
void* operator new[](std::size_t size, void* ptr) noexcept;
|
||||
void operator delete (void* ptr, void*) noexcept;
|
||||
void operator delete[](void* ptr, void*) noexcept;
|
||||
void* operator new (std::size_t size, void* ptr) throw();
|
||||
void* operator new[](std::size_t size, void* ptr) throw();
|
||||
void operator delete (void* ptr, void*) throw();
|
||||
void operator delete[](void* ptr, void*) throw();
|
||||
|
||||
*/
|
||||
|
||||
@@ -65,51 +65,42 @@ class _LIBCPP_EXCEPTION_ABI bad_alloc
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_alloc() _NOEXCEPT;
|
||||
virtual ~bad_alloc() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
bad_alloc() throw();
|
||||
virtual ~bad_alloc() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_array_new_length
|
||||
: public bad_alloc
|
||||
{
|
||||
public:
|
||||
bad_array_new_length() _NOEXCEPT;
|
||||
virtual ~bad_array_new_length() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
bad_array_new_length() throw();
|
||||
virtual ~bad_array_new_length() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
void __throw_bad_alloc(); // not in C++ spec
|
||||
|
||||
struct _LIBCPP_VISIBLE nothrow_t {};
|
||||
struct nothrow_t {};
|
||||
extern _LIBCPP_VISIBLE const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE new_handler get_new_handler() _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) throw();
|
||||
|
||||
} // std
|
||||
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz)
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
throw(std::bad_alloc)
|
||||
#endif
|
||||
;
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t) throw(std::bad_alloc);
|
||||
_LIBCPP_VISIBLE void* operator new(std::size_t, const std::nothrow_t&) throw();
|
||||
_LIBCPP_VISIBLE void operator delete(void*) throw();
|
||||
_LIBCPP_VISIBLE void operator delete(void*, const std::nothrow_t&) throw();
|
||||
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz)
|
||||
#if !__has_feature(cxx_noexcept)
|
||||
throw(std::bad_alloc)
|
||||
#endif
|
||||
;
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t) throw(std::bad_alloc);
|
||||
_LIBCPP_VISIBLE void* operator new[](std::size_t, const std::nothrow_t&) throw();
|
||||
_LIBCPP_VISIBLE void operator delete[](void*) throw();
|
||||
_LIBCPP_VISIBLE void operator delete[](void*, const std::nothrow_t&) throw();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete (void*, void*) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete[](void*, void*) _NOEXCEPT {}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new (std::size_t, void* __p) throw() {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) throw() {return __p;}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete (void*, void*) throw() {}
|
||||
_LIBCPP_INLINE_VISIBILITY inline void operator delete[](void*, void*) throw() {}
|
||||
|
||||
#endif // _LIBCPP_NEW
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -138,7 +138,7 @@ template <class charT, class traits, class T>
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ostream
|
||||
class basic_ostream
|
||||
: virtual public basic_ios<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -153,14 +153,12 @@ public:
|
||||
explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb);
|
||||
virtual ~basic_ostream();
|
||||
protected:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ostream(basic_ostream&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.7.2.3 Assign/swap
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ostream& operator=(basic_ostream&& __rhs);
|
||||
#endif
|
||||
void swap(basic_ostream& __rhs);
|
||||
@@ -205,7 +203,7 @@ protected:
|
||||
};
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_ostream<_CharT, _Traits>::sentry
|
||||
class basic_ostream<_CharT, _Traits>::sentry
|
||||
{
|
||||
bool __ok_;
|
||||
basic_ostream<_CharT, _Traits>& __os_;
|
||||
@@ -263,7 +261,7 @@ basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<char_type, traits_
|
||||
this->init(__sb);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -281,7 +279,7 @@ basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT, _Traits>::~basic_ostream()
|
||||
@@ -1208,7 +1206,7 @@ flush(basic_ostream<_CharT, _Traits>& __os)
|
||||
return __os;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Stream, class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1224,7 +1222,7 @@ operator<<(_Stream&& __os, const _Tp& __x)
|
||||
return __os;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
@@ -1278,7 +1276,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Y> const& __p)
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, bitset<_Size>& __x)
|
||||
{
|
||||
return __os << __x.template to_string<_CharT, _Traits>
|
||||
(use_facet<ctype<_CharT> >(__os.getloc()).widen('0'),
|
||||
|
321
include/queue
321
include/queue
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -31,28 +31,21 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
queue() = default;
|
||||
~queue() = default;
|
||||
|
||||
queue(const queue& q) = default;
|
||||
queue(queue&& q) = default;
|
||||
|
||||
queue& operator=(const queue& q) = default;
|
||||
queue& operator=(queue&& q) = default;
|
||||
|
||||
queue();
|
||||
explicit queue(const container_type& c);
|
||||
explicit queue(container_type&& c)
|
||||
explicit queue(container_type&& c);
|
||||
queue(queue&& q);
|
||||
template <class Alloc>
|
||||
explicit queue(const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(const container_type& c, const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(container_type&& c, const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(const queue& q, const Alloc& a);
|
||||
template <class Alloc>
|
||||
queue(queue&& q, const Alloc& a);
|
||||
|
||||
queue& operator=(queue&& q);
|
||||
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
|
||||
@@ -66,7 +59,7 @@ public:
|
||||
template <class... Args> void emplace(Args&&... args);
|
||||
void pop();
|
||||
|
||||
void swap(queue& q) noexcept(noexcept(swap(c, q.c)));
|
||||
void swap(queue& q);
|
||||
};
|
||||
|
||||
template <class T, class Container>
|
||||
@@ -88,8 +81,7 @@ template <class T, class Container>
|
||||
bool operator<=(const queue<T, Container>& x,const queue<T, Container>& y);
|
||||
|
||||
template <class T, class Container>
|
||||
void swap(queue<T, Container>& x, queue<T, Container>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
void swap(queue<T, Container>& x, queue<T, Container>& y);
|
||||
|
||||
template <class T, class Container = vector<T>,
|
||||
class Compare = less<typename Container::value_type>>
|
||||
@@ -107,16 +99,7 @@ protected:
|
||||
Compare comp;
|
||||
|
||||
public:
|
||||
priority_queue() = default;
|
||||
~priority_queue() = default;
|
||||
|
||||
priority_queue(const priority_queue& q) = default;
|
||||
priority_queue(priority_queue&& q) = default;
|
||||
|
||||
priority_queue& operator=(const priority_queue& q) = default;
|
||||
priority_queue& operator=(priority_queue&& q) = default;
|
||||
|
||||
explicit priority_queue(const Compare& comp);
|
||||
explicit priority_queue(const Compare& comp = Compare());
|
||||
priority_queue(const Compare& comp, const container_type& c);
|
||||
explicit priority_queue(const Compare& comp, container_type&& c);
|
||||
template <class InputIterator>
|
||||
@@ -128,6 +111,8 @@ public:
|
||||
template <class InputIterator>
|
||||
priority_queue(InputIterator first, InputIterator last,
|
||||
const Compare& comp, container_type&& c);
|
||||
priority_queue(priority_queue&& q);
|
||||
priority_queue& operator=(priority_queue&& q);
|
||||
template <class Alloc>
|
||||
explicit priority_queue(const Alloc& a);
|
||||
template <class Alloc>
|
||||
@@ -138,8 +123,6 @@ public:
|
||||
template <class Alloc>
|
||||
priority_queue(const Compare& comp, container_type&& c,
|
||||
const Alloc& a);
|
||||
template <class Alloc>
|
||||
priority_queue(const priority_queue& q, const Alloc& a);
|
||||
template <class Alloc>
|
||||
priority_queue(priority_queue&& q, const Alloc& a);
|
||||
|
||||
@@ -152,14 +135,12 @@ public:
|
||||
template <class... Args> void emplace(Args&&... args);
|
||||
void pop();
|
||||
|
||||
void swap(priority_queue& q)
|
||||
noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp.q.comp)));
|
||||
void swap(priority_queue& q);
|
||||
};
|
||||
|
||||
template <class T, class Container, class Compare>
|
||||
void swap(priority_queue<T, Container, Compare>& x,
|
||||
priority_queue<T, Container, Compare>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
priority_queue<T, Container, Compare>& y);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -186,7 +167,7 @@ bool
|
||||
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
||||
|
||||
template <class _Tp, class _Container = deque<_Tp> >
|
||||
class _LIBCPP_VISIBLE queue
|
||||
class queue
|
||||
{
|
||||
public:
|
||||
typedef _Container container_type;
|
||||
@@ -199,123 +180,82 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
|
||||
: c() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(const queue& __q) : c(__q.c) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
|
||||
: c(_VSTD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue& operator=(const queue& __q) {c = __q.c; return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue& operator=(queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
|
||||
{c = _VSTD::move(__q.c); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue() : c() {}
|
||||
explicit queue(const container_type& __c) : c(__c) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
explicit queue(container_type&& __c) : c(_STD::move(__c)) {}
|
||||
queue(queue&& __q) : c(_STD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit queue(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(const queue& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__q.c, __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(const container_type& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__c, __a) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(container_type&& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__c), __a) {}
|
||||
: c(_STD::move(__c), __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
queue(queue&& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__q.c), __a) {}
|
||||
: c(_STD::move(__q.c), __a) {}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
queue& operator=(queue&& __q)
|
||||
{
|
||||
c = _STD::move(__q.c);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference front() {return c.front();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference front() const {return c.front();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference back() {return c.back();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference back() const {return c.back();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(const value_type& __v) {c.push_back(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push(value_type&& __v) {c.push_back(_STD::move(__v));}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_VSTD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
{c.emplace_back(_STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop() {c.pop_front();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(c, __q.c);
|
||||
}
|
||||
|
||||
template <class _T1, class _C1>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
|
||||
|
||||
template <class _T1, class _C1>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -323,7 +263,7 @@ operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -331,7 +271,7 @@ operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -339,7 +279,7 @@ operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -347,7 +287,7 @@ operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -355,7 +295,7 @@ operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -363,23 +303,22 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<queue<_Tp, _Container>, _Alloc>
|
||||
struct uses_allocator<queue<_Tp, _Container>, _Alloc>
|
||||
: public uses_allocator<_Container, _Alloc>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container = vector<_Tp>,
|
||||
class _Compare = less<typename _Container::value_type> >
|
||||
class _LIBCPP_VISIBLE priority_queue
|
||||
class priority_queue
|
||||
{
|
||||
public:
|
||||
typedef _Container container_type;
|
||||
@@ -394,40 +333,10 @@ protected:
|
||||
value_compare comp;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<container_type>::value &&
|
||||
is_nothrow_default_constructible<value_compare>::value)
|
||||
: c(), comp() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue(priority_queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
|
||||
is_nothrow_move_constructible<value_compare>::value)
|
||||
: c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue& operator=(const priority_queue& __q)
|
||||
{c = __q.c; comp = __q.comp; return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
priority_queue& operator=(priority_queue&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
|
||||
is_nothrow_move_assignable<value_compare>::value)
|
||||
{c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit priority_queue(const value_compare& __comp)
|
||||
explicit priority_queue(const value_compare& __comp = value_compare())
|
||||
: c(), comp(__comp) {}
|
||||
priority_queue(const value_compare& __comp, const container_type& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
explicit priority_queue(const value_compare& __comp, container_type&& __c);
|
||||
#endif
|
||||
template <class _InputIter>
|
||||
@@ -436,11 +345,13 @@ public:
|
||||
template <class _InputIter>
|
||||
priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp, const container_type& __c);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _InputIter>
|
||||
priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp, container_type&& __c);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
priority_queue(priority_queue&& __q);
|
||||
priority_queue& operator=(priority_queue&& __q);
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
explicit priority_queue(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -458,7 +369,7 @@ public:
|
||||
priority_queue(const priority_queue& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
priority_queue(const value_compare& __comp, container_type&& __c,
|
||||
const _Alloc& __a,
|
||||
@@ -468,67 +379,60 @@ public:
|
||||
priority_queue(priority_queue&& __q, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference top() const {return c.front();}
|
||||
|
||||
void push(const value_type& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push(value_type&& __v);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args> void emplace(_Args&&... __args);
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop();
|
||||
|
||||
void swap(priority_queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
|
||||
__is_nothrow_swappable<value_compare>::value);
|
||||
void swap(priority_queue& __q);
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp,
|
||||
const container_type& __c)
|
||||
: c(__c),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
container_type&& __c)
|
||||
: c(_VSTD::move(__c)),
|
||||
: c(_STD::move(__c)),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp)
|
||||
: c(__f, __l),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp,
|
||||
const container_type& __c)
|
||||
@@ -536,29 +440,46 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
|
||||
comp(__comp)
|
||||
{
|
||||
c.insert(c.end(), __f, __l);
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
|
||||
const value_compare& __comp,
|
||||
container_type&& __c)
|
||||
: c(_VSTD::move(__c)),
|
||||
: c(_STD::move(__c)),
|
||||
comp(__comp)
|
||||
{
|
||||
c.insert(c.end(), __f, __l);
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q)
|
||||
: c(_STD::move(__q.c)),
|
||||
comp(_STD::move(__q.comp))
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
priority_queue<_Tp, _Container, _Compare>&
|
||||
priority_queue<_Tp, _Container, _Compare>::operator=(priority_queue&& __q)
|
||||
{
|
||||
c = _STD::move(__q.c);
|
||||
comp = _STD::move(__q.comp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type*)
|
||||
@@ -568,7 +489,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -580,7 +501,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
const container_type& __c,
|
||||
const _Alloc& __a,
|
||||
@@ -589,12 +510,12 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
|
||||
: c(__c, __a),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
@@ -602,108 +523,102 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue&
|
||||
: c(__q.c, __a),
|
||||
comp(__q.comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
|
||||
container_type&& __c,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type*)
|
||||
: c(_VSTD::move(__c), __a),
|
||||
: c(_STD::move(__c), __a),
|
||||
comp(__comp)
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class _Alloc>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
|
||||
const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type*)
|
||||
: c(_VSTD::move(__q.c), __a),
|
||||
comp(_VSTD::move(__q.comp))
|
||||
: c(_STD::move(__q.c), __a),
|
||||
comp(_STD::move(__q.comp))
|
||||
{
|
||||
_VSTD::make_heap(c.begin(), c.end(), comp);
|
||||
_STD::make_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
|
||||
{
|
||||
c.push_back(__v);
|
||||
_VSTD::push_heap(c.begin(), c.end(), comp);
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
|
||||
{
|
||||
c.push_back(_VSTD::move(__v));
|
||||
_VSTD::push_heap(c.begin(), c.end(), comp);
|
||||
c.push_back(_STD::move(__v));
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
template <class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
|
||||
{
|
||||
c.emplace_back(_VSTD::forward<_Args>(__args)...);
|
||||
_VSTD::push_heap(c.begin(), c.end(), comp);
|
||||
c.emplace_back(_STD::forward<_Args>(__args)...);
|
||||
_STD::push_heap(c.begin(), c.end(), comp);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::pop()
|
||||
{
|
||||
_VSTD::pop_heap(c.begin(), c.end(), comp);
|
||||
_STD::pop_heap(c.begin(), c.end(), comp);
|
||||
c.pop_back();
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
|
||||
__is_nothrow_swappable<value_compare>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(c, __q.c);
|
||||
swap(comp, __q.comp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(priority_queue<_Tp, _Container, _Compare>& __x,
|
||||
priority_queue<_Tp, _Container, _Compare>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Compare, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
|
||||
struct uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
|
||||
: public uses_allocator<_Container, _Alloc>
|
||||
{
|
||||
};
|
||||
|
1158
include/random
1158
include/random
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -23,14 +23,13 @@ class ratio
|
||||
public:
|
||||
static const intmax_t num;
|
||||
static const intmax_t den;
|
||||
typedef ratio<num, den> type;
|
||||
};
|
||||
|
||||
// ratio arithmetic
|
||||
template <class R1, class R2> using ratio_add = ...;
|
||||
template <class R1, class R2> using ratio_subtract = ...;
|
||||
template <class R1, class R2> using ratio_multiply = ...;
|
||||
template <class R1, class R2> using ratio_divide = ...;
|
||||
template <class R1, class R2> struct ratio_add;
|
||||
template <class R1, class R2> struct ratio_subtract;
|
||||
template <class R1, class R2> struct ratio_multiply;
|
||||
template <class R1, class R2> struct ratio_divide;
|
||||
|
||||
// ratio comparison
|
||||
template <class R1, class R2> struct ratio_equal;
|
||||
@@ -221,7 +220,7 @@ public:
|
||||
};
|
||||
|
||||
template <intmax_t _Num, intmax_t _Den = 1>
|
||||
class _LIBCPP_VISIBLE ratio
|
||||
class ratio
|
||||
{
|
||||
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
|
||||
static_assert(_Den != 0, "ratio divide by 0");
|
||||
@@ -261,7 +260,7 @@ typedef ratio< 1000000000000000LL, 1LL> peta;
|
||||
typedef ratio<1000000000000000000LL, 1LL> exa;
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_multiply
|
||||
struct ratio_multiply
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_d2 = __static_gcd<_R1::num, _R2::den>::value;
|
||||
@@ -274,21 +273,8 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_multiply
|
||||
= typename __ratio_multiply<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_multiply
|
||||
: public __ratio_multiply<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_divide
|
||||
struct ratio_divide
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
|
||||
@@ -301,21 +287,8 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_divide
|
||||
= typename __ratio_divide<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_divide
|
||||
: public __ratio_divide<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_add
|
||||
struct ratio_add
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
|
||||
@@ -336,21 +309,8 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_add
|
||||
= typename __ratio_add<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_add
|
||||
: public __ratio_add<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct __ratio_subtract
|
||||
struct ratio_subtract
|
||||
{
|
||||
private:
|
||||
static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
|
||||
@@ -371,27 +331,14 @@ public:
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2> using ratio_subtract
|
||||
= typename __ratio_subtract<_R1, _R2>::type;
|
||||
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_subtract
|
||||
: public __ratio_subtract<_R1, _R2>::type {};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
|
||||
// ratio_equal
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_equal
|
||||
struct ratio_equal
|
||||
: public integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_not_equal
|
||||
struct ratio_not_equal
|
||||
: public integral_constant<bool, !ratio_equal<_R1, _R2>::value> {};
|
||||
|
||||
// ratio_less
|
||||
@@ -450,19 +397,19 @@ struct __ratio_less<_R1, _R2, -1LL, -1LL>
|
||||
};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_less
|
||||
struct ratio_less
|
||||
: public integral_constant<bool, __ratio_less<_R1, _R2>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_less_equal
|
||||
struct ratio_less_equal
|
||||
: public integral_constant<bool, !ratio_less<_R2, _R1>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_greater
|
||||
struct ratio_greater
|
||||
: public integral_constant<bool, ratio_less<_R2, _R1>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
struct _LIBCPP_VISIBLE ratio_greater_equal
|
||||
struct ratio_greater_equal
|
||||
: public integral_constant<bool, !ratio_less<_R1, _R2>::value> {};
|
||||
|
||||
template <class _R1, class _R2>
|
||||
|
643
include/regex
643
include/regex
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -49,25 +49,24 @@ public:
|
||||
scoped_allocator_adaptor();
|
||||
template <class OuterA2>
|
||||
scoped_allocator_adaptor(OuterA2&& outerAlloc,
|
||||
const InnerAllocs&... innerAllocs) noexcept;
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor& other) noexcept;
|
||||
scoped_allocator_adaptor(scoped_allocator_adaptor&& other) noexcept;
|
||||
const InnerAllocs&... innerAllocs);
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor& other);
|
||||
template <class OuterA2>
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other) noexcept;
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other);
|
||||
template <class OuterA2>
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept;
|
||||
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other);
|
||||
|
||||
~scoped_allocator_adaptor();
|
||||
|
||||
inner_allocator_type& inner_allocator() noexcept;
|
||||
const inner_allocator_type& inner_allocator() const noexcept;
|
||||
inner_allocator_type& inner_allocator();
|
||||
const inner_allocator_type& inner_allocator() const;
|
||||
|
||||
outer_allocator_type& outer_allocator() noexcept;
|
||||
const outer_allocator_type& outer_allocator() const noexcept;
|
||||
outer_allocator_type& outer_allocator();
|
||||
const outer_allocator_type& outer_allocator() const;
|
||||
|
||||
pointer allocate(size_type n);
|
||||
pointer allocate(size_type n, const_void_pointer hint);
|
||||
void deallocate(pointer p, size_type n) noexcept;
|
||||
void deallocate(pointer p, size_type n);
|
||||
|
||||
size_type max_size() const;
|
||||
template <class T, class... Args> void construct(T* p, Args&& args);
|
||||
@@ -84,20 +83,18 @@ public:
|
||||
void construct(pair<T1, T2>* p, pair<U, V>&& x);
|
||||
template <class T> void destroy(T* p);
|
||||
|
||||
template <class T> void destroy(T* p) noexcept;
|
||||
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const noexcept;
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const;
|
||||
};
|
||||
|
||||
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);
|
||||
|
||||
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
||||
bool
|
||||
operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
|
||||
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -110,7 +107,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
#if defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
|
||||
// scoped_allocator_adaptor
|
||||
|
||||
@@ -184,26 +181,23 @@ private:
|
||||
|
||||
protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage() _NOEXCEPT {}
|
||||
__scoped_allocator_storage() {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)),
|
||||
const _InnerAllocs& ...__innerAllocs)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)),
|
||||
__inner_(__innerAllocs...) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, const _OuterA2&>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT
|
||||
const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other)
|
||||
: outer_allocator_type(__other.outer_allocator()),
|
||||
__inner_(__other.inner_allocator()) {}
|
||||
|
||||
@@ -211,39 +205,32 @@ protected:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::move(__other.outer_allocator())),
|
||||
__inner_(_VSTD::move(__other.inner_allocator())) {}
|
||||
__scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other)
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())),
|
||||
__inner_(_STD::move(__other.inner_allocator())) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::forward<_OuterA2>(__o)),
|
||||
__inner_(__i)
|
||||
{
|
||||
}
|
||||
__scoped_allocator_storage(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__o)),
|
||||
__inner_(__i)
|
||||
{
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT {return __inner_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const _NOEXCEPT {return __inner_;}
|
||||
inner_allocator_type& inner_allocator() {return __inner_;}
|
||||
const inner_allocator_type& inner_allocator() const {return __inner_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator() _NOEXCEPT
|
||||
outer_allocator_type& outer_allocator()
|
||||
{return static_cast<outer_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
{return static_cast<const outer_allocator_type&>(*this);}
|
||||
|
||||
scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
select_on_container_copy_construction() const _NOEXCEPT
|
||||
select_on_container_copy_construction() const
|
||||
{
|
||||
return scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
|
||||
(
|
||||
@@ -265,59 +252,50 @@ class __scoped_allocator_storage<_OuterAlloc>
|
||||
protected:
|
||||
typedef scoped_allocator_adaptor<_OuterAlloc> inner_allocator_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage() _NOEXCEPT {}
|
||||
__scoped_allocator_storage() {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)) {}
|
||||
__scoped_allocator_storage(_OuterA2&& __outerAlloc)
|
||||
: outer_allocator_type(_STD::forward<_OuterA2>(__outerAlloc)) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, const _OuterA2&>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
const __scoped_allocator_storage<_OuterA2>& __other) _NOEXCEPT
|
||||
const __scoped_allocator_storage<_OuterA2>& __other)
|
||||
: outer_allocator_type(__other.outer_allocator()) {}
|
||||
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__scoped_allocator_storage(
|
||||
__scoped_allocator_storage<_OuterA2>&& __other) _NOEXCEPT
|
||||
: outer_allocator_type(_VSTD::move(__other.outer_allocator())) {}
|
||||
__scoped_allocator_storage<_OuterA2>&& __other)
|
||||
: outer_allocator_type(_STD::move(__other.outer_allocator())) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT
|
||||
inner_allocator_type& inner_allocator()
|
||||
{return static_cast<inner_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const _NOEXCEPT
|
||||
const inner_allocator_type& inner_allocator() const
|
||||
{return static_cast<const inner_allocator_type&>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator() _NOEXCEPT
|
||||
outer_allocator_type& outer_allocator()
|
||||
{return static_cast<outer_allocator_type&>(*this);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
{return static_cast<const outer_allocator_type&>(*this);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor<outer_allocator_type>
|
||||
select_on_container_copy_construction() const _NOEXCEPT
|
||||
select_on_container_copy_construction() const
|
||||
{return scoped_allocator_adaptor<outer_allocator_type>(
|
||||
allocator_traits<outer_allocator_type>::
|
||||
select_on_container_copy_construction(outer_allocator())
|
||||
);}
|
||||
|
||||
__scoped_allocator_storage(const outer_allocator_type& __o,
|
||||
const inner_allocator_type& __i) _NOEXCEPT;
|
||||
const inner_allocator_type& __i);
|
||||
|
||||
template <class...> friend class __scoped_allocator_storage;
|
||||
};
|
||||
@@ -345,8 +323,7 @@ template <class _Alloc, bool = __has_outer_allocator<_Alloc>::value>
|
||||
struct __outermost
|
||||
{
|
||||
typedef _Alloc type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type& operator()(type& __a) const _NOEXCEPT {return __a;}
|
||||
type& operator()(type& __a) const {return __a;}
|
||||
};
|
||||
|
||||
template <class _Alloc>
|
||||
@@ -354,16 +331,15 @@ struct __outermost<_Alloc, true>
|
||||
{
|
||||
typedef typename remove_reference
|
||||
<
|
||||
decltype(_VSTD::declval<_Alloc>().outer_allocator())
|
||||
decltype(_STD::declval<_Alloc>().outer_allocator())
|
||||
>::type _OuterAlloc;
|
||||
typedef typename __outermost<_OuterAlloc>::type type;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type& operator()(_Alloc& __a) const _NOEXCEPT
|
||||
type& operator()(_Alloc& __a) const
|
||||
{return __outermost<_OuterAlloc>()(__a.outer_allocator());}
|
||||
};
|
||||
|
||||
template <class _OuterAlloc, class... _InnerAllocs>
|
||||
class _LIBCPP_VISIBLE scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
|
||||
class scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
|
||||
: public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
|
||||
{
|
||||
typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
|
||||
@@ -405,75 +381,61 @@ public:
|
||||
> other;
|
||||
};
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor() _NOEXCEPT {}
|
||||
scoped_allocator_adaptor() {}
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __outerAlloc,
|
||||
const _InnerAllocs& ...__innerAllocs) _NOEXCEPT
|
||||
: base(_VSTD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
|
||||
const _InnerAllocs& ...__innerAllocs)
|
||||
: base(_STD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {}
|
||||
// scoped_allocator_adaptor(const scoped_allocator_adaptor& __other) = default;
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, const _OuterA2&>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other)
|
||||
: base(__other) {}
|
||||
template <class _OuterA2,
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(
|
||||
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
|
||||
: base(_VSTD::move(__other)) {}
|
||||
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other)
|
||||
: base(_STD::move(__other)) {}
|
||||
|
||||
// ~scoped_allocator_adaptor() = default;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
inner_allocator_type& inner_allocator() _NOEXCEPT
|
||||
inner_allocator_type& inner_allocator()
|
||||
{return base::inner_allocator();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const inner_allocator_type& inner_allocator() const _NOEXCEPT
|
||||
const inner_allocator_type& inner_allocator() const
|
||||
{return base::inner_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
outer_allocator_type& outer_allocator() _NOEXCEPT
|
||||
outer_allocator_type& outer_allocator()
|
||||
{return base::outer_allocator();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
const outer_allocator_type& outer_allocator() const
|
||||
{return base::outer_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n)
|
||||
{return allocator_traits<outer_allocator_type>::
|
||||
allocate(outer_allocator(), __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n, const_void_pointer __hint)
|
||||
{return allocator_traits<outer_allocator_type>::
|
||||
allocate(outer_allocator(), __n, __hint);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void deallocate(pointer __p, size_type __n) _NOEXCEPT
|
||||
void deallocate(pointer __p, size_type __n)
|
||||
{allocator_traits<outer_allocator_type>::
|
||||
deallocate(outer_allocator(), __p, __n);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const
|
||||
{return allocator_traits<outer_allocator_type>::max_size(outer_allocator());}
|
||||
{allocator_traits<outer_allocator_type>::max_size(outer_allocator());}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void construct(_Tp* __p, _Args&& ...__args)
|
||||
{__construct(__uses_alloc_ctor<_Tp, inner_allocator_type, _Args...>(),
|
||||
__p, _VSTD::forward<_Args>(__args)...);}
|
||||
__p, _STD::forward<_Args>(__args)...);}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void destroy(_Tp* __p)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -481,8 +443,7 @@ public:
|
||||
destroy(_OM()(outer_allocator()), __p);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const _NOEXCEPT
|
||||
scoped_allocator_adaptor select_on_container_copy_construction() const
|
||||
{return base::select_on_container_copy_construction();}
|
||||
|
||||
private:
|
||||
@@ -491,13 +452,11 @@ private:
|
||||
class = typename enable_if<
|
||||
is_constructible<outer_allocator_type, _OuterA2>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
scoped_allocator_adaptor(_OuterA2&& __o,
|
||||
const inner_allocator_type& __i) _NOEXCEPT
|
||||
: base(_VSTD::forward<_OuterA2>(__o), __i) {}
|
||||
const inner_allocator_type& __i)
|
||||
: base(_STD::forward<_OuterA2>(__o), __i) {}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct(integral_constant<int, 0>, _Tp* __p, _Args&& ...__args)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -505,12 +464,11 @@ private:
|
||||
(
|
||||
_OM()(outer_allocator()),
|
||||
__p,
|
||||
_VSTD::forward<_Args>(__args)...
|
||||
_STD::forward<_Args>(__args)...
|
||||
);
|
||||
}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct(integral_constant<int, 1>, _Tp* __p, _Args&& ...__args)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -520,12 +478,11 @@ private:
|
||||
__p,
|
||||
allocator_arg,
|
||||
inner_allocator(),
|
||||
_VSTD::forward<_Args>(__args)...
|
||||
_STD::forward<_Args>(__args)...
|
||||
);
|
||||
}
|
||||
|
||||
template <class _Tp, class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct(integral_constant<int, 2>, _Tp* __p, _Args&& ...__args)
|
||||
{
|
||||
typedef __outermost<outer_allocator_type> _OM;
|
||||
@@ -533,7 +490,7 @@ private:
|
||||
(
|
||||
_OM()(outer_allocator()),
|
||||
__p,
|
||||
_VSTD::forward<_Args>(__args)...,
|
||||
_STD::forward<_Args>(__args)...,
|
||||
inner_allocator()
|
||||
);
|
||||
}
|
||||
@@ -545,16 +502,16 @@ template <class _OuterA1, class _OuterA2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2>& __b) _NOEXCEPT
|
||||
const scoped_allocator_adaptor<_OuterA2>& __b)
|
||||
{
|
||||
return __a.outer_allocator() == __b.outer_allocator();
|
||||
}
|
||||
|
||||
template <class _OuterA1, class _OuterA2, class _InnerA0, class... _InnerAllocs>
|
||||
template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerA0, _InnerAllocs...>& __b) _NOEXCEPT
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b)
|
||||
{
|
||||
return __a.outer_allocator() == __b.outer_allocator() &&
|
||||
__a.inner_allocator() == __b.inner_allocator();
|
||||
@@ -564,12 +521,12 @@ template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b) _NOEXCEPT
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b)
|
||||
{
|
||||
return !(__a == __b);
|
||||
}
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
#endif // defined(_LIBCPP_MOVE) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
481
include/set
481
include/set
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -42,12 +42,7 @@ public:
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
set()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value);
|
||||
explicit set(const value_compare& comp);
|
||||
explicit set(const value_compare& comp = value_compare());
|
||||
set(const value_compare& comp, const allocator_type& a);
|
||||
template <class InputIterator>
|
||||
set(InputIterator first, InputIterator last,
|
||||
@@ -56,10 +51,7 @@ public:
|
||||
set(InputIterator first, InputIterator last, const value_compare& comp,
|
||||
const allocator_type& a);
|
||||
set(const set& s);
|
||||
set(set&& s)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<allocator_type>::value &&
|
||||
is_nothrow_move_constructible<key_compare>::value);
|
||||
set(set&& s);
|
||||
explicit set(const allocator_type& a);
|
||||
set(const set& s, const allocator_type& a);
|
||||
set(set&& s, const allocator_type& a);
|
||||
@@ -69,33 +61,29 @@ public:
|
||||
~set();
|
||||
|
||||
set& operator=(const set& s);
|
||||
set& operator=(set&& s)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<key_compare>::value);
|
||||
set& operator=(set&& s);
|
||||
set& operator=(initializer_list<value_type> il);
|
||||
|
||||
// iterators:
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
|
||||
// capacity:
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
|
||||
// modifiers:
|
||||
template <class... Args>
|
||||
@@ -113,16 +101,12 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear() noexcept;
|
||||
void clear();
|
||||
|
||||
void swap(set& s)
|
||||
noexcept(
|
||||
__is_nothrow_swappable<key_compare>::value &&
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value));
|
||||
void swap(set& s);
|
||||
|
||||
// observers:
|
||||
allocator_type get_allocator() const noexcept;
|
||||
allocator_type get_allocator() const;
|
||||
key_compare key_comp() const;
|
||||
value_compare value_comp() const;
|
||||
|
||||
@@ -171,8 +155,7 @@ operator<=(const set<Key, Compare, Allocator>& x,
|
||||
// specialized algorithms:
|
||||
template <class Key, class Compare, class Allocator>
|
||||
void
|
||||
swap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
swap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y);
|
||||
|
||||
template <class Key, class Compare = less<Key>,
|
||||
class Allocator = allocator<Key>>
|
||||
@@ -198,12 +181,7 @@ public:
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
multiset()
|
||||
noexcept(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value);
|
||||
explicit multiset(const value_compare& comp);
|
||||
explicit multiset(const value_compare& comp = value_compare());
|
||||
multiset(const value_compare& comp, const allocator_type& a);
|
||||
template <class InputIterator>
|
||||
multiset(InputIterator first, InputIterator last,
|
||||
@@ -212,10 +190,7 @@ public:
|
||||
multiset(InputIterator first, InputIterator last,
|
||||
const value_compare& comp, const allocator_type& a);
|
||||
multiset(const multiset& s);
|
||||
multiset(multiset&& s)
|
||||
noexcept(
|
||||
is_nothrow_move_constructible<allocator_type>::value &&
|
||||
is_nothrow_move_constructible<key_compare>::value);
|
||||
multiset(multiset&& s);
|
||||
explicit multiset(const allocator_type& a);
|
||||
multiset(const multiset& s, const allocator_type& a);
|
||||
multiset(multiset&& s, const allocator_type& a);
|
||||
@@ -225,33 +200,29 @@ public:
|
||||
~multiset();
|
||||
|
||||
multiset& operator=(const multiset& s);
|
||||
multiset& operator=(multiset&& s)
|
||||
noexcept(
|
||||
allocator_type::propagate_on_container_move_assignment::value &&
|
||||
is_nothrow_move_assignable<allocator_type>::value &&
|
||||
is_nothrow_move_assignable<key_compare>::value);
|
||||
multiset& operator=(multiset&& s);
|
||||
multiset& operator=(initializer_list<value_type> il);
|
||||
|
||||
// iterators:
|
||||
iterator begin() noexcept;
|
||||
const_iterator begin() const noexcept;
|
||||
iterator end() noexcept;
|
||||
const_iterator end() const noexcept;
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
|
||||
reverse_iterator rbegin() noexcept;
|
||||
const_reverse_iterator rbegin() const noexcept;
|
||||
reverse_iterator rend() noexcept;
|
||||
const_reverse_iterator rend() const noexcept;
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rend();
|
||||
const_reverse_iterator rend() const;
|
||||
|
||||
const_iterator cbegin() const noexcept;
|
||||
const_iterator cend() const noexcept;
|
||||
const_reverse_iterator crbegin() const noexcept;
|
||||
const_reverse_iterator crend() const noexcept;
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
const_reverse_iterator crbegin() const;
|
||||
const_reverse_iterator crend() const;
|
||||
|
||||
// capacity:
|
||||
bool empty() const noexcept;
|
||||
size_type size() const noexcept;
|
||||
size_type max_size() const noexcept;
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
|
||||
// modifiers:
|
||||
template <class... Args>
|
||||
@@ -269,16 +240,12 @@ public:
|
||||
iterator erase(const_iterator position);
|
||||
size_type erase(const key_type& k);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
void clear() noexcept;
|
||||
void clear();
|
||||
|
||||
void swap(multiset& s)
|
||||
noexcept(
|
||||
__is_nothrow_swappable<key_compare>::value &&
|
||||
(!allocator_type::propagate_on_container_swap::value ||
|
||||
__is_nothrow_swappable<allocator_type>::value));
|
||||
void swap(multiset& s);
|
||||
|
||||
// observers:
|
||||
allocator_type get_allocator() const noexcept;
|
||||
allocator_type get_allocator() const;
|
||||
key_compare key_comp() const;
|
||||
value_compare value_comp() const;
|
||||
|
||||
@@ -327,8 +294,7 @@ operator<=(const multiset<Key, Compare, Allocator>& x,
|
||||
// specialized algorithms:
|
||||
template <class Key, class Compare, class Allocator>
|
||||
void
|
||||
swap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
swap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -344,7 +310,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Key, class _Compare = less<_Key>,
|
||||
class _Allocator = allocator<_Key> >
|
||||
class _LIBCPP_VISIBLE set
|
||||
class set
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -370,21 +336,14 @@ public:
|
||||
typedef typename __base::difference_type difference_type;
|
||||
typedef typename __base::const_iterator iterator;
|
||||
typedef typename __base::const_iterator const_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit set(const value_compare& __comp = value_compare())
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value)
|
||||
: __tree_(__comp) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const value_compare& __comp, const allocator_type& __a)
|
||||
: __tree_(__comp, __a) {}
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(_InputIterator __f, _InputIterator __l,
|
||||
const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
@@ -393,7 +352,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(_InputIterator __f, _InputIterator __l, const value_compare& __comp,
|
||||
const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -401,51 +359,36 @@ public:
|
||||
insert(__f, __l);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const set& __s)
|
||||
: __tree_(__s.__tree_)
|
||||
{
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set& operator=(const set& __s)
|
||||
{
|
||||
__tree_ = __s.__tree_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
set(set&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_VSTD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit set(const allocator_type& __a)
|
||||
: __tree_(__a) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(const set& __s, const allocator_type& __a)
|
||||
: __tree_(__s.__tree_.value_comp(), __a)
|
||||
{
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
set(set&& __s, const allocator_type& __a);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
{
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set(initializer_list<value_type> __il, const value_compare& __comp,
|
||||
const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -453,189 +396,138 @@ public:
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
set& operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
__tree_.__assign_unique(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
set& operator=(set&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _VSTD::move(__s.__tree_);
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() _NOEXCEPT {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const _NOEXCEPT {return __tree_.end();}
|
||||
iterator begin() {return __tree_.begin();}
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
iterator end() {return __tree_.end();}
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
const_iterator cbegin() const {return begin();}
|
||||
const_iterator cend() const {return end();}
|
||||
const_reverse_iterator crbegin() const {return rbegin();}
|
||||
const_reverse_iterator crend() const {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
size_type size() const {return __tree_.size();}
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
|
||||
// modifiers:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> emplace(_Args&&... __args)
|
||||
{return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
|
||||
{return __tree_.__emplace_unique(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
{return __tree_.__emplace_hint_unique(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_MOVE
|
||||
pair<iterator,bool> insert(const value_type& __v)
|
||||
{return __tree_.__insert_unique(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
pair<iterator,bool> insert(value_type&& __v)
|
||||
{return __tree_.__insert_unique(_VSTD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
{return __tree_.__insert_unique(_STD::move(__v));}
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, const value_type& __v)
|
||||
{return __tree_.__insert_unique(__p, __v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, value_type&& __v)
|
||||
{return __tree_.__insert_unique(__p, _VSTD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{return __tree_.__insert_unique(__p, _STD::move(__v));}
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(_InputIterator __f, _InputIterator __l)
|
||||
{
|
||||
for (const_iterator __e = cend(); __f != __l; ++__f)
|
||||
__tree_.__insert_unique(__e, *__f);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k)
|
||||
{return __tree_.__erase_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f, __l);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT {__tree_.clear();}
|
||||
void clear() {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
|
||||
{__tree_.swap(__s.__tree_);}
|
||||
void swap(set& __s) {__tree_.swap(__s.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
key_compare key_comp() const {return __tree_.value_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare value_comp() const {return __tree_.value_comp();}
|
||||
|
||||
// set operations:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const key_type& __k)
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator lower_bound(const key_type& __k) const
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator upper_bound(const key_type& __k)
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator upper_bound(const key_type& __k) const
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator,iterator> equal_range(const key_type& __k)
|
||||
{return __tree_.__equal_range_unique(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
|
||||
{return __tree_.__equal_range_unique(__k);}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
|
||||
: __tree_(_VSTD::move(__s.__tree_), __a)
|
||||
: __tree_(_STD::move(__s.__tree_), __a)
|
||||
{
|
||||
if (__a != __s.get_allocator())
|
||||
{
|
||||
const_iterator __e = cend();
|
||||
while (!__s.empty())
|
||||
insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
insert(__e, _STD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -644,7 +536,7 @@ operator!=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -653,7 +545,7 @@ operator> (const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -662,7 +554,7 @@ operator>=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
const set<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -672,18 +564,17 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x,
|
||||
|
||||
// specialized algorithms:
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(set<_Key, _Compare, _Allocator>& __x,
|
||||
set<_Key, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare = less<_Key>,
|
||||
class _Allocator = allocator<_Key> >
|
||||
class _LIBCPP_VISIBLE multiset
|
||||
class multiset
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -709,22 +600,15 @@ public:
|
||||
typedef typename __base::difference_type difference_type;
|
||||
typedef typename __base::const_iterator iterator;
|
||||
typedef typename __base::const_iterator const_iterator;
|
||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
typedef _STD::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef _STD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// construct/copy/destroy:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit multiset(const value_compare& __comp = value_compare())
|
||||
_NOEXCEPT_(
|
||||
is_nothrow_default_constructible<allocator_type>::value &&
|
||||
is_nothrow_default_constructible<key_compare>::value &&
|
||||
is_nothrow_copy_constructible<key_compare>::value)
|
||||
: __tree_(__comp) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const value_compare& __comp, const allocator_type& __a)
|
||||
: __tree_(__comp, __a) {}
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(_InputIterator __f, _InputIterator __l,
|
||||
const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
@@ -733,7 +617,6 @@ public:
|
||||
}
|
||||
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(_InputIterator __f, _InputIterator __l,
|
||||
const value_compare& __comp, const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -741,7 +624,6 @@ public:
|
||||
insert(__f, __l);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const multiset& __s)
|
||||
: __tree_(__s.__tree_.value_comp(),
|
||||
__alloc_traits::select_on_container_copy_construction(__s.__tree_.__alloc()))
|
||||
@@ -749,41 +631,27 @@ public:
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset& operator=(const multiset& __s)
|
||||
{
|
||||
__tree_ = __s.__tree_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
multiset(multiset&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
|
||||
: __tree_(_VSTD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
: __tree_(_STD::move(__s.__tree_)) {}
|
||||
#endif // _LIBCPP_MOVE
|
||||
explicit multiset(const allocator_type& __a)
|
||||
: __tree_(__a) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(const multiset& __s, const allocator_type& __a)
|
||||
: __tree_(__s.__tree_.value_comp(), __a)
|
||||
{
|
||||
insert(__s.begin(), __s.end());
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
multiset(multiset&& __s, const allocator_type& __a);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
|
||||
: __tree_(__comp)
|
||||
{
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset(initializer_list<value_type> __il, const value_compare& __comp,
|
||||
const allocator_type& __a)
|
||||
: __tree_(__comp, __a)
|
||||
@@ -791,189 +659,137 @@ public:
|
||||
insert(__il.begin(), __il.end());
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
multiset& operator=(initializer_list<value_type> __il)
|
||||
{
|
||||
__tree_.__assign_multi(__il.begin(), __il.end());
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
multiset& operator=(multiset&& __s)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
|
||||
{
|
||||
__tree_ = _VSTD::move(__s.__tree_);
|
||||
__tree_ = _STD::move(__s.__tree_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator begin() _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator end() _NOEXCEPT {return __tree_.end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator end() const _NOEXCEPT {return __tree_.end();}
|
||||
iterator begin() {return __tree_.begin();}
|
||||
const_iterator begin() const {return __tree_.begin();}
|
||||
iterator end() {return __tree_.end();}
|
||||
const_iterator end() const {return __tree_.end();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rbegin() _NOEXCEPT
|
||||
{return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT
|
||||
{return const_reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reverse_iterator rend() _NOEXCEPT
|
||||
{return reverse_iterator(begin());}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rend() const _NOEXCEPT
|
||||
{return const_reverse_iterator(begin());}
|
||||
reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
reverse_iterator rend() {return reverse_iterator(begin());}
|
||||
const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT {return begin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT {return end();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
const_iterator cbegin() const {return begin();}
|
||||
const_iterator cend() const {return end();}
|
||||
const_reverse_iterator crbegin() const {return rbegin();}
|
||||
const_reverse_iterator crend() const {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
|
||||
bool empty() const {return __tree_.size() == 0;}
|
||||
size_type size() const {return __tree_.size();}
|
||||
size_type max_size() const {return __tree_.max_size();}
|
||||
|
||||
// modifiers:
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace(_Args&&... __args)
|
||||
{return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
|
||||
{return __tree_.__emplace_multi(_STD::forward<_Args>(__args)...);}
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator emplace_hint(const_iterator __p, _Args&&... __args)
|
||||
{return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
{return __tree_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const value_type& __v)
|
||||
{return __tree_.__insert_multi(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(value_type&& __v)
|
||||
{return __tree_.__insert_multi(_VSTD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
{return __tree_.__insert_multi(_STD::move(__v));}
|
||||
#endif // _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, const value_type& __v)
|
||||
{return __tree_.__insert_multi(__p, __v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
iterator insert(const_iterator __p, value_type&& __v)
|
||||
{return __tree_.__insert_multi(_VSTD::move(__v));}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{return __tree_.__insert_multi(_STD::move(__v));}
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(_InputIterator __f, _InputIterator __l)
|
||||
{
|
||||
for (const_iterator __e = cend(); __f != __l; ++__f)
|
||||
__tree_.__insert_multi(__e, *__f);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(initializer_list<value_type> __il)
|
||||
{insert(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type erase(const key_type& __k) {return __tree_.__erase_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __f, const_iterator __l)
|
||||
{return __tree_.erase(__f, __l);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT {__tree_.clear();}
|
||||
void clear() {__tree_.clear();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(multiset& __s)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<__base>::value)
|
||||
{__tree_.swap(__s.__tree_);}
|
||||
void swap(multiset& __s) {__tree_.swap(__s.__tree_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
allocator_type get_allocator() const {return __tree_.__alloc();}
|
||||
key_compare key_comp() const {return __tree_.value_comp();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_compare value_comp() const {return __tree_.value_comp();}
|
||||
|
||||
// set operations:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator find(const key_type& __k) {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator lower_bound(const key_type& __k)
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator lower_bound(const key_type& __k) const
|
||||
{return __tree_.lower_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator upper_bound(const key_type& __k)
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator upper_bound(const key_type& __k) const
|
||||
{return __tree_.upper_bound(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator,iterator> equal_range(const key_type& __k)
|
||||
{return __tree_.__equal_range_multi(__k);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
|
||||
{return __tree_.__equal_range_multi(__k);}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
|
||||
: __tree_(_VSTD::move(__s.__tree_), __a)
|
||||
: __tree_(_STD::move(__s.__tree_), __a)
|
||||
{
|
||||
if (__a != __s.get_allocator())
|
||||
{
|
||||
const_iterator __e = cend();
|
||||
while (!__s.empty())
|
||||
insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
insert(__e, _STD::move(__s.__tree_.remove(__s.begin())->__value_));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
return __x.size() == __y.size() && _STD::equal(__x.begin(), __x.end(), __y.begin());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
{
|
||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
return _STD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -982,7 +798,7 @@ operator!=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -991,7 +807,7 @@ operator> (const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -1000,7 +816,7 @@ operator>=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
const multiset<_Key, _Compare, _Allocator>& __y)
|
||||
@@ -1009,11 +825,10 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
|
||||
}
|
||||
|
||||
template <class _Key, class _Compare, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(multiset<_Key, _Compare, _Allocator>& __x,
|
||||
multiset<_Key, _Compare, _Allocator>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -182,7 +182,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
// basic_stringbuf
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_stringbuf
|
||||
class basic_stringbuf
|
||||
: public basic_streambuf<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -206,12 +206,12 @@ public:
|
||||
explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
explicit basic_stringbuf(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_stringbuf(basic_stringbuf&& __rhs);
|
||||
#endif
|
||||
|
||||
// 27.8.1.2 Assign and swap:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_stringbuf& operator=(basic_stringbuf&& __rhs);
|
||||
#endif
|
||||
void swap(basic_stringbuf& __rhs);
|
||||
@@ -250,7 +250,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type&
|
||||
str(__s);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
|
||||
@@ -261,7 +261,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&&
|
||||
ptrdiff_t __nout = __rhs.pptr() - __rhs.pbase();
|
||||
ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
|
||||
ptrdiff_t __hm = __rhs.__hm_ - __rhs.pbase();
|
||||
__str_ = _VSTD::move(__rhs.__str_);
|
||||
__str_ = _STD::move(__rhs.__str_);
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setg(__p, __p + __ninp, __p + __einp);
|
||||
this->setp(__p, __p + __eout);
|
||||
@@ -284,7 +284,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
||||
ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
|
||||
ptrdiff_t __hm = __rhs.__hm_ - __rhs.pbase();
|
||||
__mode_ = __rhs.__mode_;
|
||||
__str_ = _VSTD::move(__rhs.__str_);
|
||||
__str_ = _STD::move(__rhs.__str_);
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setg(__p, __p + __ninp, __p + __einp);
|
||||
this->setp(__p, __p + __eout);
|
||||
@@ -298,7 +298,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
void
|
||||
@@ -314,7 +314,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
|
||||
ptrdiff_t __lnout = this->pptr() - this->pbase();
|
||||
ptrdiff_t __leout = this->epptr() - this->pbase();
|
||||
ptrdiff_t __lhm = this->__hm_ - this->pbase();
|
||||
_VSTD::swap(__mode_, __rhs.__mode_);
|
||||
_STD::swap(__mode_, __rhs.__mode_);
|
||||
__str_.swap(__rhs.__str_);
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setg(__p, __p + __rninp, __p + __reinp);
|
||||
@@ -451,7 +451,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__hm_ = _VSTD::max(this->pptr() + 1, __hm_);
|
||||
__hm_ = max(this->pptr() + 1, __hm_);
|
||||
if (__mode_ & ios_base::in)
|
||||
{
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
@@ -525,7 +525,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
|
||||
// basic_istringstream
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_istringstream
|
||||
class basic_istringstream
|
||||
: public basic_istream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -546,12 +546,12 @@ public:
|
||||
explicit basic_istringstream(ios_base::openmode __wch = ios_base::in);
|
||||
explicit basic_istringstream(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::in);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_istringstream(basic_istringstream&& __rhs);
|
||||
|
||||
// 27.8.2.2 Assign and swap:
|
||||
basic_istringstream& operator=(basic_istringstream&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(basic_istringstream& __rhs);
|
||||
|
||||
// 27.8.2.3 Members:
|
||||
@@ -577,13 +577,13 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const stri
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
|
||||
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_istream<_CharT, _Traits>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -592,12 +592,12 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_istringstream<_CharT, _Traits, _Allocator>&
|
||||
basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs)
|
||||
{
|
||||
basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_istream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -644,7 +644,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
||||
// basic_ostringstream
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_ostringstream
|
||||
class basic_ostringstream
|
||||
: public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -665,12 +665,12 @@ public:
|
||||
explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
|
||||
explicit basic_ostringstream(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_ostringstream(basic_ostringstream&& __rhs);
|
||||
|
||||
// 27.8.2.2 Assign and swap:
|
||||
basic_ostringstream& operator=(basic_ostringstream&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(basic_ostringstream& __rhs);
|
||||
|
||||
// 27.8.2.3 Members:
|
||||
@@ -696,13 +696,13 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const stri
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
|
||||
: basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_ostream<_CharT, _Traits>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -711,12 +711,12 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_ostringstream<_CharT, _Traits, _Allocator>&
|
||||
basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs)
|
||||
{
|
||||
basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_ostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@@ -763,7 +763,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
||||
// basic_stringstream
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_VISIBLE basic_stringstream
|
||||
class basic_stringstream
|
||||
: public basic_iostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
@@ -784,12 +784,12 @@ public:
|
||||
explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
explicit basic_stringstream(const string_type& __s,
|
||||
ios_base::openmode __wch = ios_base::in | ios_base::out);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
basic_stringstream(basic_stringstream&& __rhs);
|
||||
|
||||
// 27.8.2.2 Assign and swap:
|
||||
basic_stringstream& operator=(basic_stringstream&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
void swap(basic_stringstream& __rhs);
|
||||
|
||||
// 27.8.2.3 Members:
|
||||
@@ -815,13 +815,13 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
|
||||
: basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: basic_iostream<_CharT, _Traits>(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
|
||||
}
|
||||
@@ -830,12 +830,12 @@ template <class _CharT, class _Traits, class _Allocator>
|
||||
basic_stringstream<_CharT, _Traits, _Allocator>&
|
||||
basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& __rhs)
|
||||
{
|
||||
basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
basic_iostream<char_type, traits_type>::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
|
115
include/stack
115
include/stack
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -31,21 +31,14 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
stack() = default;
|
||||
~stack() = default;
|
||||
|
||||
stack(const stack& q) = default;
|
||||
stack(stack&& q) = default;
|
||||
|
||||
stack& operator=(const stack& q) = default;
|
||||
stack& operator=(stack&& q) = default;
|
||||
|
||||
explicit stack();
|
||||
explicit stack(const container_type& c);
|
||||
explicit stack(container_type&& c);
|
||||
stack(stack&& s);
|
||||
stack& operator=(stack&& s);
|
||||
template <class Alloc> explicit stack(const Alloc& a);
|
||||
template <class Alloc> stack(const container_type& c, const Alloc& a);
|
||||
template <class Alloc> stack(container_type&& c, const Alloc& a);
|
||||
template <class Alloc> stack(const stack& c, const Alloc& a);
|
||||
template <class Alloc> stack(stack&& c, const Alloc& a);
|
||||
|
||||
bool empty() const;
|
||||
@@ -58,7 +51,7 @@ public:
|
||||
template <class... Args> void emplace(Args&&... args);
|
||||
void pop();
|
||||
|
||||
void swap(stack& c) noexcept(noexcept(swap(c, q.c)));
|
||||
void swap(stack& c);
|
||||
};
|
||||
|
||||
template <class T, class Container>
|
||||
@@ -75,8 +68,7 @@ template <class T, class Container>
|
||||
bool operator<=(const stack<T, Container>& x, const stack<T, Container>& y);
|
||||
|
||||
template <class T, class Container>
|
||||
void swap(stack<T, Container>& x, stack<T, Container>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
void swap(stack<T, Container>& x, stack<T, Container>& y);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -100,7 +92,7 @@ bool
|
||||
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
||||
|
||||
template <class _Tp, class _Container = deque<_Tp> >
|
||||
class _LIBCPP_VISIBLE stack
|
||||
class stack
|
||||
{
|
||||
public:
|
||||
typedef _Container container_type;
|
||||
@@ -113,99 +105,57 @@ protected:
|
||||
container_type c;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
|
||||
: c() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(const stack& __q) : c(__q.c) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
|
||||
: c(_VSTD::move(__q.c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack& operator=(const stack& __q) {c = __q.c; return *this;}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack& operator=(stack&& __q)
|
||||
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
|
||||
{c = _VSTD::move(__q.c); return *this;}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack() : c() {}
|
||||
explicit stack(const container_type& __c) : c(__c) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
explicit stack(container_type&& __c) : c(_STD::move(__c)) {}
|
||||
stack(stack&& __s) : c(_STD::move(__s.c)) {}
|
||||
stack& operator=(stack&& __s) {c = _STD::move(__s.c); return *this;}
|
||||
#endif // _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit stack(const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(const container_type& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__c, __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(const stack& __s, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(__s.c, __a) {}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(container_type&& __c, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__c), __a) {}
|
||||
: c(_STD::move(__c), __a) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
stack(stack&& __s, const _Alloc& __a,
|
||||
typename enable_if<uses_allocator<container_type,
|
||||
_Alloc>::value>::type* = 0)
|
||||
: c(_VSTD::move(__s.c), __a) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
: c(_STD::move(__s.c), __a) {}
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
reference top() {return c.back();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference top() const {return c.back();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(const value_type& __v) {c.push_back(__v);}
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class... _Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_VSTD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
void push(value_type&& __v) {c.push_back(_STD::move(__v));}
|
||||
template <class... _Args> void emplace(_Args&&... __args)
|
||||
{c.emplace_back(_STD::forward<_Args>(__args)...);}
|
||||
#endif // _LIBCPP_MOVE
|
||||
void pop() {c.pop_back();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(stack& __s)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
using _STD::swap;
|
||||
swap(c, __s.c);
|
||||
}
|
||||
|
||||
@@ -221,7 +171,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -229,7 +179,7 @@ operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -237,7 +187,7 @@ operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -245,7 +195,7 @@ operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -253,7 +203,7 @@ operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -261,7 +211,7 @@ operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
{
|
||||
@@ -269,16 +219,15 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
|
||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
||||
{
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Container, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<stack<_Tp, _Container>, _Alloc>
|
||||
struct uses_allocator<stack<_Tp, _Container>, _Alloc>
|
||||
: public uses_allocator<_Container, _Alloc>
|
||||
{
|
||||
};
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -33,9 +33,9 @@ class xxx_error : public exception // at least indirectly
|
||||
{
|
||||
public:
|
||||
explicit xxx_error(const string& what_arg);
|
||||
explicit xxx_error(const char* what_arg);
|
||||
explicit xxx_error(const char* what_arg); // extension
|
||||
|
||||
virtual const char* what() const noexcept // returns what_arg
|
||||
virtual const char* what() const // returns what_arg
|
||||
};
|
||||
|
||||
} // std
|
||||
@@ -60,12 +60,12 @@ public:
|
||||
explicit logic_error(const string&);
|
||||
explicit logic_error(const char*);
|
||||
|
||||
logic_error(const logic_error&) _NOEXCEPT;
|
||||
logic_error& operator=(const logic_error&) _NOEXCEPT;
|
||||
logic_error(const logic_error&) throw();
|
||||
logic_error& operator=(const logic_error&) throw();
|
||||
|
||||
virtual ~logic_error() _NOEXCEPT;
|
||||
virtual ~logic_error() throw();
|
||||
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI runtime_error
|
||||
@@ -77,12 +77,12 @@ public:
|
||||
explicit runtime_error(const string&);
|
||||
explicit runtime_error(const char*);
|
||||
|
||||
runtime_error(const runtime_error&) _NOEXCEPT;
|
||||
runtime_error& operator=(const runtime_error&) _NOEXCEPT;
|
||||
runtime_error(const runtime_error&) throw();
|
||||
runtime_error& operator=(const runtime_error&) throw();
|
||||
|
||||
virtual ~runtime_error() _NOEXCEPT;
|
||||
virtual ~runtime_error() throw();
|
||||
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI domain_error
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~domain_error() _NOEXCEPT;
|
||||
virtual ~domain_error() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI invalid_argument
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~invalid_argument() _NOEXCEPT;
|
||||
virtual ~invalid_argument() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI length_error
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~length_error() _NOEXCEPT;
|
||||
virtual ~length_error() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI out_of_range
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {}
|
||||
|
||||
virtual ~out_of_range() _NOEXCEPT;
|
||||
virtual ~out_of_range() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI range_error
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {}
|
||||
|
||||
virtual ~range_error() _NOEXCEPT;
|
||||
virtual ~range_error() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI overflow_error
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {}
|
||||
|
||||
virtual ~overflow_error() _NOEXCEPT;
|
||||
virtual ~overflow_error() throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI underflow_error
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {}
|
||||
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {}
|
||||
|
||||
virtual ~underflow_error() _NOEXCEPT;
|
||||
virtual ~underflow_error() throw();
|
||||
};
|
||||
|
||||
} // std
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -117,7 +117,7 @@ protected:
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
class _LIBCPP_VISIBLE basic_streambuf
|
||||
class basic_streambuf
|
||||
{
|
||||
public:
|
||||
// types:
|
||||
@@ -399,13 +399,13 @@ template <class _CharT, class _Traits>
|
||||
void
|
||||
basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
|
||||
{
|
||||
_VSTD::swap(__loc_, __sb.__loc_);
|
||||
_VSTD::swap(__binp_, __sb.__binp_);
|
||||
_VSTD::swap(__ninp_, __sb.__ninp_);
|
||||
_VSTD::swap(__einp_, __sb.__einp_);
|
||||
_VSTD::swap(__bout_, __sb.__bout_);
|
||||
_VSTD::swap(__nout_, __sb.__nout_);
|
||||
_VSTD::swap(__eout_, __sb.__eout_);
|
||||
_STD::swap(__loc_, __sb.__loc_);
|
||||
_STD::swap(__binp_, __sb.__binp_);
|
||||
_STD::swap(__ninp_, __sb.__ninp_);
|
||||
_STD::swap(__einp_, __sb.__einp_);
|
||||
_STD::swap(__bout_, __sb.__bout_);
|
||||
_STD::swap(__nout_, __sb.__nout_);
|
||||
_STD::swap(__eout_, __sb.__eout_);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
|
1368
include/string
1368
include/string
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE strstreambuf
|
||||
class strstreambuf
|
||||
: public streambuf
|
||||
{
|
||||
public:
|
||||
@@ -149,12 +149,10 @@ public:
|
||||
strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0);
|
||||
strstreambuf(const unsigned char* __gnext, streamsize __n);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
strstreambuf(strstreambuf&& __rhs);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf& operator=(strstreambuf&& __rhs);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~strstreambuf();
|
||||
|
||||
@@ -189,150 +187,95 @@ private:
|
||||
void __init(char* __gnext, streamsize __n, char* __pbeg);
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf::strstreambuf(strstreambuf&& __rhs)
|
||||
: streambuf(__rhs),
|
||||
__strmode_(__rhs.__strmode_),
|
||||
__alsize_(__rhs.__alsize_),
|
||||
__palloc_(__rhs.__palloc_),
|
||||
__pfree_(__rhs.__pfree_)
|
||||
{
|
||||
__rhs.setg(nullptr, nullptr, nullptr);
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf&
|
||||
strstreambuf::operator=(strstreambuf&& __rhs)
|
||||
{
|
||||
if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0)
|
||||
{
|
||||
if (__pfree_)
|
||||
__pfree_(eback());
|
||||
else
|
||||
delete [] eback();
|
||||
}
|
||||
streambuf::operator=(__rhs);
|
||||
__strmode_ = __rhs.__strmode_;
|
||||
__alsize_ = __rhs.__alsize_;
|
||||
__palloc_ = __rhs.__palloc_;
|
||||
__pfree_ = __rhs.__pfree_;
|
||||
__rhs.setg(nullptr, nullptr, nullptr);
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
class _LIBCPP_VISIBLE istrstream
|
||||
class istrstream
|
||||
: public istream
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit istrstream(const char* __s)
|
||||
: istream(&__sb_), __sb_(__s, 0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit istrstream(char* __s)
|
||||
: istream(&__sb_), __sb_(__s, 0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream(const char* __s, streamsize __n)
|
||||
: istream(&__sb_), __sb_(__s, __n) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream(char* __s, streamsize __n)
|
||||
: istream(&__sb_), __sb_(__s, __n) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
istrstream(istrstream&& __rhs)
|
||||
: istream(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: istream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
istream::set_rdbuf(&__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
istrstream& operator=(istrstream&& __rhs)
|
||||
{
|
||||
istream::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
istream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~istrstream();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(istrstream& __rhs)
|
||||
{
|
||||
istream::swap(__rhs);
|
||||
__sb_.swap(__rhs.__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char *str() {return __sb_.str();}
|
||||
|
||||
private:
|
||||
strstreambuf __sb_;
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE ostrstream
|
||||
class ostrstream
|
||||
: public ostream
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream()
|
||||
: ostream(&__sb_) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
|
||||
: ostream(&__sb_),
|
||||
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
ostrstream(ostrstream&& __rhs)
|
||||
: ostream(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: ostream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
ostream::set_rdbuf(&__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
ostrstream& operator=(ostrstream&& __rhs)
|
||||
{
|
||||
ostream::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
ostream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~ostrstream();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(ostrstream& __rhs)
|
||||
{
|
||||
ostream::swap(__rhs);
|
||||
__sb_.swap(__rhs.__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char* str() {return __sb_.str();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int pcount() const {return __sb_.pcount();}
|
||||
|
||||
private:
|
||||
strstreambuf __sb_; // exposition only
|
||||
};
|
||||
|
||||
class _LIBCPP_VISIBLE strstream
|
||||
class strstream
|
||||
: public iostream
|
||||
{
|
||||
public:
|
||||
@@ -343,36 +286,31 @@ public:
|
||||
typedef char_traits<char>::off_type off_type;
|
||||
|
||||
// constructors/destructor
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream()
|
||||
: iostream(&__sb_) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
: iostream(&__sb_),
|
||||
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
strstream(strstream&& __rhs)
|
||||
: iostream(_VSTD::move(__rhs)),
|
||||
__sb_(_VSTD::move(__rhs.__sb_))
|
||||
: iostream(_STD::move(__rhs)),
|
||||
__sb_(_STD::move(__rhs.__sb_))
|
||||
{
|
||||
iostream::set_rdbuf(&__sb_);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstream& operator=(strstream&& __rhs)
|
||||
{
|
||||
iostream::operator=(_VSTD::move(__rhs));
|
||||
__sb_ = _VSTD::move(__rhs.__sb_);
|
||||
iostream::operator=(_STD::move(__rhs));
|
||||
__sb_ = _STD::move(__rhs.__sb_);
|
||||
return *this;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
virtual ~strstream();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(strstream& __rhs)
|
||||
{
|
||||
iostream::swap(__rhs);
|
||||
@@ -380,13 +318,9 @@ public:
|
||||
}
|
||||
|
||||
// Members:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int pcount() const {return __sb_.pcount();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char* str() {return __sb_.str();}
|
||||
|
||||
private:
|
||||
|
@@ -1,110 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===--------------------- support/win32/locale_win32.h -------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
|
||||
#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
|
||||
|
||||
// ctype mask table defined in msvcrt.dll
|
||||
extern "C" unsigned short __declspec(dllimport) _ctype[];
|
||||
|
||||
#include "support/win32/support.h"
|
||||
#include <memory>
|
||||
#include <xlocinfo.h> // _locale_t
|
||||
#define locale_t _locale_t
|
||||
#define LC_COLLATE_MASK _M_COLLATE
|
||||
#define LC_CTYPE_MASK _M_CTYPE
|
||||
#define LC_MONETARY_MASK _M_MONETARY
|
||||
#define LC_NUMERIC_MASK _M_NUMERIC
|
||||
#define LC_TIME_MASK _M_TIME
|
||||
#define LC_MESSAGES_MASK _M_MESSAGES
|
||||
#define LC_ALL_MASK ( LC_COLLATE_MASK \
|
||||
| LC_CTYPE_MASK \
|
||||
| LC_MESSAGES_MASK \
|
||||
| LC_MONETARY_MASK \
|
||||
| LC_NUMERIC_MASK \
|
||||
| LC_TIME_MASK )
|
||||
#define freelocale _free_locale
|
||||
// FIXME: base currently unused. Needs manual work to construct the new locale
|
||||
locale_t newlocale( int mask, const char * locale, locale_t base );
|
||||
locale_t uselocale( locale_t newloc );
|
||||
lconv *localeconv_l( locale_t loc );
|
||||
size_t mbrlen_l( const char *__restrict__ s, size_t n,
|
||||
mbstate_t *__restrict__ ps, locale_t loc);
|
||||
size_t mbsrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t len, mbstate_t *__restrict__ ps, locale_t loc );
|
||||
size_t wcrtomb_l( char *__restrict__ s, wchar_t wc, mbstate_t *__restrict__ ps,
|
||||
locale_t loc);
|
||||
size_t mbrtowc_l( wchar_t *__restrict__ pwc, const char *__restrict__ s,
|
||||
size_t n, mbstate_t *__restrict__ ps, locale_t loc);
|
||||
size_t mbsnrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t nms, size_t len, mbstate_t *__restrict__ ps, locale_t loc);
|
||||
size_t wcsnrtombs_l( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps, locale_t loc);
|
||||
wint_t btowc_l( int c, locale_t loc );
|
||||
int wctob_l( wint_t c, locale_t loc );
|
||||
typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
|
||||
typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
|
||||
_LIBCPP_ALWAYS_INLINE inline
|
||||
decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
|
||||
{
|
||||
__locale_raii __current( uselocale(__l), uselocale );
|
||||
return MB_CUR_MAX;
|
||||
}
|
||||
|
||||
// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
|
||||
#include <stdio.h>
|
||||
#define mbtowc_l _mbtowc_l
|
||||
#define strtoll_l _strtoi64_l
|
||||
#define strtoull_l _strtoui64_l
|
||||
// FIXME: current msvcrt does not know about long double
|
||||
#define strtold_l _strtod_l
|
||||
#define islower_l _islower_l
|
||||
#define isupper_l _isupper_l
|
||||
#define isdigit_l _isdigit_l
|
||||
#define isxdigit_l _isxdigit_l
|
||||
#define strcoll_l _strcoll_l
|
||||
#define strxfrm_l _strxfrm_l
|
||||
#define wcscoll_l _wcscoll_l
|
||||
#define wcsxfrm_l _wcsxfrm_l
|
||||
#define toupper_l _toupper_l
|
||||
#define tolower_l _tolower_l
|
||||
#define iswspace_l _iswspace_l
|
||||
#define iswprint_l _iswprint_l
|
||||
#define iswcntrl_l _iswcntrl_l
|
||||
#define iswupper_l _iswupper_l
|
||||
#define iswlower_l _iswlower_l
|
||||
#define iswalpha_l _iswalpha_l
|
||||
#define iswdigit_l _iswdigit_l
|
||||
#define iswpunct_l _iswpunct_l
|
||||
#define iswxdigit_l _iswxdigit_l
|
||||
#define towupper_l _towupper_l
|
||||
#define towlower_l _towlower_l
|
||||
#define strftime_l _strftime_l
|
||||
#define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define vsscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define snprintf_l( __s, __n, __l, __f, ... ) _snprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
|
||||
#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
|
||||
#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
|
||||
int asprintf_l( char **ret, locale_t loc, const char *format, ... );
|
||||
int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
|
||||
|
||||
|
||||
// not-so-pressing FIXME: use locale to determine blank characters
|
||||
inline int isblank_l( int c, locale_t /*loc*/ )
|
||||
{
|
||||
return ( c == ' ' || c == '\t' );
|
||||
}
|
||||
inline int iswblank_l( wint_t c, locale_t /*loc*/ )
|
||||
{
|
||||
return ( c == L' ' || c == L'\t' );
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
|
@@ -1,31 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
//===----------------------- support/win32/support.h ----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_SUPPORT_WIN32_SUPPORT_H
|
||||
#define _LIBCPP_SUPPORT_WIN32_SUPPORT_H
|
||||
|
||||
/*
|
||||
Functions and constants used in libc++ that are missing from the Windows C library.
|
||||
*/
|
||||
|
||||
#include <wchar.h> // mbstate_t
|
||||
#include <stdio.h> // _snwprintf
|
||||
#define swprintf _snwprintf
|
||||
#define vswprintf _vsnwprintf
|
||||
|
||||
int vasprintf( char **sptr, const char *__restrict__ fmt , va_list ap );
|
||||
int asprintf(char **sptr, const char *__restrict__ fmt, ...);
|
||||
|
||||
size_t mbsnrtowcs( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
||||
size_t nmc, size_t len, mbstate_t *__restrict__ ps );
|
||||
size_t wcsnrtombs( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps );
|
||||
|
||||
#endif // _LIBCPP_SUPPORT_WIN32_SUPPORT_H
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -20,24 +20,24 @@ namespace std
|
||||
class error_category
|
||||
{
|
||||
public:
|
||||
virtual ~error_category() noexcept;
|
||||
virtual ~error_category();
|
||||
|
||||
error_category(const error_category&) = delete;
|
||||
error_category& operator=(const error_category&) = delete;
|
||||
|
||||
virtual const char* name() const noexcept = 0;
|
||||
virtual error_condition default_error_condition(int ev) const noexcept;
|
||||
virtual bool equivalent(int code, const error_condition& condition) const noexcept;
|
||||
virtual bool equivalent(const error_code& code, int condition) const noexcept;
|
||||
virtual const char* name() const = 0;
|
||||
virtual error_condition default_error_condition(int ev) const;
|
||||
virtual bool equivalent(int code, const error_condition& condition) const;
|
||||
virtual bool equivalent(const error_code& code, int condition) const;
|
||||
virtual string message(int ev) const = 0;
|
||||
|
||||
bool operator==(const error_category& rhs) const noexcept;
|
||||
bool operator!=(const error_category& rhs) const noexcept;
|
||||
bool operator<(const error_category& rhs) const noexcept;
|
||||
bool operator==(const error_category& rhs) const;
|
||||
bool operator!=(const error_category& rhs) const;
|
||||
bool operator<(const error_category& rhs) const;
|
||||
};
|
||||
|
||||
const error_category& generic_category() noexcept;
|
||||
const error_category& system_category() noexcept;
|
||||
const error_category& generic_category();
|
||||
const error_category& system_category();
|
||||
|
||||
template <class T> struct is_error_code_enum
|
||||
: public false_type {};
|
||||
@@ -49,27 +49,27 @@ class error_code
|
||||
{
|
||||
public:
|
||||
// constructors:
|
||||
error_code() noexcept;
|
||||
error_code(int val, const error_category& cat) noexcept;
|
||||
error_code();
|
||||
error_code(int val, const error_category& cat);
|
||||
template <class ErrorCodeEnum>
|
||||
error_code(ErrorCodeEnum e) noexcept;
|
||||
error_code(ErrorCodeEnum e);
|
||||
|
||||
// modifiers:
|
||||
void assign(int val, const error_category& cat) noexcept;
|
||||
void assign(int val, const error_category& cat);
|
||||
template <class ErrorCodeEnum>
|
||||
error_code& operator=(ErrorCodeEnum e) noexcept;
|
||||
void clear() noexcept;
|
||||
error_code& operator=(ErrorCodeEnum e);
|
||||
void clear();
|
||||
|
||||
// observers:
|
||||
int value() const noexcept;
|
||||
const error_category& category() const noexcept;
|
||||
error_condition default_error_condition() const noexcept;
|
||||
int value() const;
|
||||
const error_category& category() const;
|
||||
error_condition default_error_condition() const;
|
||||
string message() const;
|
||||
explicit operator bool() const noexcept;
|
||||
explicit operator bool() const;
|
||||
};
|
||||
|
||||
// non-member functions:
|
||||
bool operator<(const error_code& lhs, const error_code& rhs) noexcept;
|
||||
bool operator<(const error_code& lhs, const error_code& rhs);
|
||||
template <class charT, class traits>
|
||||
basic_ostream<charT,traits>&
|
||||
operator<<(basic_ostream<charT,traits>& os, const error_code& ec);
|
||||
@@ -78,25 +78,25 @@ class error_condition
|
||||
{
|
||||
public:
|
||||
// constructors:
|
||||
error_condition() noexcept;
|
||||
error_condition(int val, const error_category& cat) noexcept;
|
||||
error_condition();
|
||||
error_condition(int val, const error_category& cat);
|
||||
template <class ErrorConditionEnum>
|
||||
error_condition(ErrorConditionEnum e) noexcept;
|
||||
error_condition(ErrorConditionEnum e);
|
||||
|
||||
// modifiers:
|
||||
void assign(int val, const error_category& cat) noexcept;
|
||||
void assign(int val, const error_category& cat);
|
||||
template <class ErrorConditionEnum>
|
||||
error_condition& operator=(ErrorConditionEnum e) noexcept;
|
||||
void clear() noexcept;
|
||||
error_condition& operator=(ErrorConditionEnum e);
|
||||
void clear();
|
||||
|
||||
// observers:
|
||||
int value() const noexcept;
|
||||
const error_category& category() const noexcept;
|
||||
string message() const noexcept;
|
||||
explicit operator bool() const noexcept;
|
||||
int value() const;
|
||||
const error_category& category() const;
|
||||
string message() const;
|
||||
explicit operator bool() const;
|
||||
};
|
||||
|
||||
bool operator<(const error_condition& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator<(const error_condition& lhs, const error_condition& rhs);
|
||||
|
||||
class system_error
|
||||
: public runtime_error
|
||||
@@ -109,8 +109,8 @@ public:
|
||||
system_error(int ev, const error_category& ecat, const char* what_arg);
|
||||
system_error(int ev, const error_category& ecat);
|
||||
|
||||
const error_code& code() const noexcept;
|
||||
const char* what() const noexcept;
|
||||
const error_code& code() const throw();
|
||||
const char* what() const throw();
|
||||
};
|
||||
|
||||
enum class errc
|
||||
@@ -198,18 +198,18 @@ enum class errc
|
||||
template <> struct is_error_condition_enum<errc>
|
||||
: true_type { }
|
||||
|
||||
error_code make_error_code(errc e) noexcept;
|
||||
error_condition make_error_condition(errc e) noexcept;
|
||||
error_code make_error_code(errc e);
|
||||
error_condition make_error_condition(errc e);
|
||||
|
||||
// Comparison operators:
|
||||
bool operator==(const error_code& lhs, const error_code& rhs) noexcept;
|
||||
bool operator==(const error_code& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator==(const error_condition& lhs, const error_code& rhs) noexcept;
|
||||
bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator!=(const error_code& lhs, const error_code& rhs) noexcept;
|
||||
bool operator!=(const error_code& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept;
|
||||
bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept;
|
||||
bool operator==(const error_code& lhs, const error_code& rhs);
|
||||
bool operator==(const error_code& lhs, const error_condition& rhs);
|
||||
bool operator==(const error_condition& lhs, const error_code& rhs);
|
||||
bool operator==(const error_condition& lhs, const error_condition& rhs);
|
||||
bool operator!=(const error_code& lhs, const error_code& rhs);
|
||||
bool operator!=(const error_code& lhs, const error_condition& rhs);
|
||||
bool operator!=(const error_condition& lhs, const error_code& rhs);
|
||||
bool operator!=(const error_condition& lhs, const error_condition& rhs);
|
||||
|
||||
template <> struct hash<std::error_code>;
|
||||
|
||||
@@ -229,14 +229,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// is_error_code_enum
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE is_error_code_enum
|
||||
template <class _Tp> struct is_error_code_enum
|
||||
: public false_type {};
|
||||
|
||||
// is_error_condition_enum
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_VISIBLE is_error_condition_enum
|
||||
template <class _Tp> struct is_error_condition_enum
|
||||
: public false_type {};
|
||||
|
||||
// Some error codes are not present on all platforms, so we provide equivalents
|
||||
@@ -344,19 +342,15 @@ enum _ {
|
||||
|
||||
_ __v_;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
errc(_ __v) : __v_(__v) {}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
operator int() const {return __v_;}
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_condition_enum<errc>
|
||||
template <> struct is_error_condition_enum<errc>
|
||||
: true_type { };
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE is_error_condition_enum<errc::_>
|
||||
template <> struct is_error_condition_enum<errc::_>
|
||||
: true_type { };
|
||||
|
||||
class error_condition;
|
||||
@@ -366,31 +360,31 @@ class error_code;
|
||||
|
||||
class __do_message;
|
||||
|
||||
class _LIBCPP_VISIBLE error_category
|
||||
class error_category
|
||||
{
|
||||
public:
|
||||
virtual ~error_category() _NOEXCEPT;
|
||||
virtual ~error_category();
|
||||
|
||||
private:
|
||||
error_category() _NOEXCEPT;
|
||||
error_category();
|
||||
error_category(const error_category&);// = delete;
|
||||
error_category& operator=(const error_category&);// = delete;
|
||||
|
||||
public:
|
||||
virtual const char* name() const _NOEXCEPT = 0;
|
||||
virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
|
||||
virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
|
||||
virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
|
||||
virtual const char* name() const = 0;
|
||||
virtual error_condition default_error_condition(int __ev) const;
|
||||
virtual bool equivalent(int __code, const error_condition& __condition) const;
|
||||
virtual bool equivalent(const error_code& __code, int __condition) const;
|
||||
virtual string message(int __ev) const = 0;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;}
|
||||
bool operator==(const error_category& __rhs) const {return this == &__rhs;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);}
|
||||
bool operator!=(const error_category& __rhs) const {return !(*this == __rhs);}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
|
||||
bool operator< (const error_category& __rhs) const {return this < &__rhs;}
|
||||
|
||||
friend class __do_message;
|
||||
};
|
||||
@@ -402,30 +396,28 @@ public:
|
||||
virtual string message(int ev) const;
|
||||
};
|
||||
|
||||
const error_category& generic_category() _NOEXCEPT;
|
||||
const error_category& system_category() _NOEXCEPT;
|
||||
const error_category& generic_category();
|
||||
const error_category& system_category();
|
||||
|
||||
class _LIBCPP_VISIBLE error_condition
|
||||
class error_condition
|
||||
{
|
||||
int __val_;
|
||||
const error_category* __cat_;
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}
|
||||
error_condition() : __val_(0), __cat_(&generic_category()) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition(int __val, const error_category& __cat) _NOEXCEPT
|
||||
error_condition(int __val, const error_category& __cat)
|
||||
: __val_(__val), __cat_(&__cat) {}
|
||||
|
||||
template <class _E>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition(_E __e,
|
||||
typename enable_if<is_error_condition_enum<_E>::value>::type* = 0
|
||||
) _NOEXCEPT
|
||||
error_condition(_E __e, typename enable_if<is_error_condition_enum<_E>::value>::type* = 0)
|
||||
{*this = make_error_condition(__e);}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void assign(int __val, const error_category& __cat) _NOEXCEPT
|
||||
void assign(int __val, const error_category& __cat)
|
||||
{
|
||||
__val_ = __val;
|
||||
__cat_ = &__cat;
|
||||
@@ -438,38 +430,38 @@ public:
|
||||
is_error_condition_enum<_E>::value,
|
||||
error_condition&
|
||||
>::type
|
||||
operator=(_E __e) _NOEXCEPT
|
||||
operator=(_E __e)
|
||||
{*this = make_error_condition(__e); return *this;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void clear() _NOEXCEPT
|
||||
void clear()
|
||||
{
|
||||
__val_ = 0;
|
||||
__cat_ = &generic_category();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int value() const _NOEXCEPT {return __val_;}
|
||||
int value() const {return __val_;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
const error_category& category() const _NOEXCEPT {return *__cat_;}
|
||||
const error_category& category() const {return *__cat_;}
|
||||
string message() const;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
//explicit
|
||||
operator bool() const _NOEXCEPT {return __val_ != 0;}
|
||||
operator bool() const {return __val_ != 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
error_condition
|
||||
make_error_condition(errc __e) _NOEXCEPT
|
||||
make_error_condition(errc __e)
|
||||
{
|
||||
return error_condition(static_cast<int>(__e), generic_category());
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
operator<(const error_condition& __x, const error_condition& __y)
|
||||
{
|
||||
return __x.category() < __y.category()
|
||||
|| __x.category() == __y.category() && __x.value() < __y.value();
|
||||
@@ -477,27 +469,25 @@ operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
|
||||
// error_code
|
||||
|
||||
class _LIBCPP_VISIBLE error_code
|
||||
class error_code
|
||||
{
|
||||
int __val_;
|
||||
const error_category* __cat_;
|
||||
public:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}
|
||||
error_code() : __val_(0), __cat_(&system_category()) {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_code(int __val, const error_category& __cat) _NOEXCEPT
|
||||
error_code(int __val, const error_category& __cat)
|
||||
: __val_(__val), __cat_(&__cat) {}
|
||||
|
||||
template <class _E>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_code(_E __e,
|
||||
typename enable_if<is_error_code_enum<_E>::value>::type* = 0
|
||||
) _NOEXCEPT
|
||||
error_code(_E __e, typename enable_if<is_error_code_enum<_E>::value>::type* = 0)
|
||||
{*this = make_error_code(__e);}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void assign(int __val, const error_category& __cat) _NOEXCEPT
|
||||
void assign(int __val, const error_category& __cat)
|
||||
{
|
||||
__val_ = __val;
|
||||
__cat_ = &__cat;
|
||||
@@ -510,43 +500,43 @@ public:
|
||||
is_error_code_enum<_E>::value,
|
||||
error_code&
|
||||
>::type
|
||||
operator=(_E __e) _NOEXCEPT
|
||||
operator=(_E __e)
|
||||
{*this = make_error_code(__e); return *this;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void clear() _NOEXCEPT
|
||||
void clear()
|
||||
{
|
||||
__val_ = 0;
|
||||
__cat_ = &system_category();
|
||||
}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int value() const _NOEXCEPT {return __val_;}
|
||||
int value() const {return __val_;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
const error_category& category() const _NOEXCEPT {return *__cat_;}
|
||||
const error_category& category() const {return *__cat_;}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
error_condition default_error_condition() const _NOEXCEPT
|
||||
error_condition default_error_condition() const
|
||||
{return __cat_->default_error_condition(__val_);}
|
||||
|
||||
string message() const;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
//explicit
|
||||
operator bool() const _NOEXCEPT {return __val_ != 0;}
|
||||
operator bool() const {return __val_ != 0;}
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
error_code
|
||||
make_error_code(errc __e) _NOEXCEPT
|
||||
make_error_code(errc __e)
|
||||
{
|
||||
return error_code(static_cast<int>(__e), generic_category());
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator<(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
operator<(const error_code& __x, const error_code& __y)
|
||||
{
|
||||
return __x.category() < __y.category()
|
||||
|| __x.category() == __y.category() && __x.value() < __y.value();
|
||||
@@ -554,14 +544,14 @@ operator<(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
operator==(const error_code& __x, const error_code& __y)
|
||||
{
|
||||
return __x.category() == __y.category() && __x.value() == __y.value();
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT
|
||||
operator==(const error_code& __x, const error_condition& __y)
|
||||
{
|
||||
return __x.category().equivalent(__x.value(), __y)
|
||||
|| __y.category().equivalent(__x, __y.value());
|
||||
@@ -569,44 +559,39 @@ operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_condition& __x, const error_code& __y) _NOEXCEPT
|
||||
operator==(const error_condition& __x, const error_code& __y)
|
||||
{
|
||||
return __y == __x;
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
operator==(const error_condition& __x, const error_condition& __y)
|
||||
{
|
||||
return __x.category() == __y.category() && __x.value() == __y.value();
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
operator!=(const error_code& __x, const error_code& __y) {return !(__x == __y);}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
operator!=(const error_code& __x, const error_condition& __y) {return !(__x == __y);}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
operator!=(const error_condition& __x, const error_code& __y) {return !(__x == __y);}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
||||
{return !(__x == __y);}
|
||||
operator!=(const error_condition& __x, const error_condition& __y) {return !(__x == __y);}
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<error_code>
|
||||
struct hash<error_code>
|
||||
: public unary_function<error_code, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(const error_code& __ec) const _NOEXCEPT
|
||||
size_t operator()(const error_code& __ec) const
|
||||
{
|
||||
return static_cast<size_t>(__ec.value());
|
||||
}
|
||||
@@ -614,7 +599,7 @@ struct _LIBCPP_VISIBLE hash<error_code>
|
||||
|
||||
// system_error
|
||||
|
||||
class _LIBCPP_VISIBLE system_error
|
||||
class system_error
|
||||
: public runtime_error
|
||||
{
|
||||
error_code __ec_;
|
||||
@@ -625,10 +610,10 @@ public:
|
||||
system_error(int __ev, const error_category& __ecat, const string& __what_arg);
|
||||
system_error(int __ev, const error_category& __ecat, const char* __what_arg);
|
||||
system_error(int __ev, const error_category& __ecat);
|
||||
~system_error() _NOEXCEPT;
|
||||
~system_error() throw();
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
const error_code& code() const _NOEXCEPT {return __ec_;}
|
||||
const error_code& code() const throw() {return __ec_;}
|
||||
|
||||
private:
|
||||
static string __init(const error_code&, string);
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
189
include/thread
189
include/thread
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -95,9 +95,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
|
||||
#include <system_error>
|
||||
#include <chrono>
|
||||
#include <__mutex_base>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#pragma GCC system_header
|
||||
@@ -106,71 +103,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp>
|
||||
class __thread_specific_ptr
|
||||
{
|
||||
pthread_key_t __key_;
|
||||
|
||||
__thread_specific_ptr(const __thread_specific_ptr&);
|
||||
__thread_specific_ptr& operator=(const __thread_specific_ptr&);
|
||||
|
||||
static void __at_thread_exit(void*);
|
||||
public:
|
||||
typedef _Tp* pointer;
|
||||
|
||||
__thread_specific_ptr();
|
||||
~__thread_specific_ptr();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer get() const {return static_cast<_Tp*>(pthread_getspecific(__key_));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator*() const {return *get();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pointer operator->() const {return get();}
|
||||
pointer release();
|
||||
void reset(pointer __p = nullptr);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
void
|
||||
__thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
|
||||
{
|
||||
delete static_cast<pointer>(__p);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
|
||||
{
|
||||
int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
|
||||
if (__ec)
|
||||
throw system_error(error_code(__ec, system_category()),
|
||||
"__thread_specific_ptr construction failed");
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
__thread_specific_ptr<_Tp>::~__thread_specific_ptr()
|
||||
{
|
||||
pthread_key_delete(__key_);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
typename __thread_specific_ptr<_Tp>::pointer
|
||||
__thread_specific_ptr<_Tp>::release()
|
||||
{
|
||||
pointer __p = get();
|
||||
pthread_setspecific(__key_, 0);
|
||||
return __p;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
void
|
||||
__thread_specific_ptr<_Tp>::reset(pointer __p)
|
||||
{
|
||||
pointer __p_old = get();
|
||||
pthread_setspecific(__key_, __p);
|
||||
delete __p_old;
|
||||
}
|
||||
|
||||
class thread;
|
||||
class __thread_id;
|
||||
|
||||
@@ -181,7 +113,7 @@ __thread_id get_id();
|
||||
|
||||
} // this_thread
|
||||
|
||||
class _LIBCPP_VISIBLE __thread_id
|
||||
class __thread_id
|
||||
{
|
||||
// FIXME: pthread_t is a pointer on Darwin but a long on Linux.
|
||||
// NULL is the no-thread value on Darwin. Someone needs to check
|
||||
@@ -189,50 +121,40 @@ class _LIBCPP_VISIBLE __thread_id
|
||||
pthread_t __id_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__thread_id() : __id_(0) {}
|
||||
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(__thread_id __x, __thread_id __y)
|
||||
friend bool operator==(__thread_id __x, __thread_id __y)
|
||||
{return __x.__id_ == __y.__id_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(__thread_id __x, __thread_id __y)
|
||||
friend bool operator!=(__thread_id __x, __thread_id __y)
|
||||
{return !(__x == __y);}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator< (__thread_id __x, __thread_id __y)
|
||||
friend bool operator< (__thread_id __x, __thread_id __y)
|
||||
{return __x.__id_ < __y.__id_;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator<=(__thread_id __x, __thread_id __y)
|
||||
friend bool operator<=(__thread_id __x, __thread_id __y)
|
||||
{return !(__y < __x);}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator> (__thread_id __x, __thread_id __y)
|
||||
friend bool operator> (__thread_id __x, __thread_id __y)
|
||||
{return __y < __x ;}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator>=(__thread_id __x, __thread_id __y)
|
||||
friend bool operator>=(__thread_id __x, __thread_id __y)
|
||||
{return !(__x < __y);}
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id)
|
||||
{return __os << __id.__id_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__thread_id(pthread_t __id) : __id_(__id) {}
|
||||
|
||||
friend __thread_id this_thread::get_id();
|
||||
friend class _LIBCPP_VISIBLE thread;
|
||||
friend class thread;
|
||||
};
|
||||
|
||||
template<class _Tp> struct hash;
|
||||
|
||||
template<>
|
||||
struct _LIBCPP_VISIBLE hash<__thread_id>
|
||||
struct hash<__thread_id>
|
||||
: public unary_function<__thread_id, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(__thread_id __v) const
|
||||
{
|
||||
const size_t* const __p = reinterpret_cast<const size_t*>(&__v);
|
||||
@@ -243,7 +165,7 @@ struct _LIBCPP_VISIBLE hash<__thread_id>
|
||||
namespace this_thread
|
||||
{
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
__thread_id
|
||||
get_id()
|
||||
{
|
||||
@@ -252,17 +174,21 @@ get_id()
|
||||
|
||||
} // this_thread
|
||||
|
||||
class _LIBCPP_VISIBLE thread
|
||||
class thread
|
||||
{
|
||||
pthread_t __t_;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
thread(const thread&) = delete;
|
||||
thread& operator=(const thread&) = delete;
|
||||
#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
thread(const thread&);
|
||||
thread& operator=(const thread&);
|
||||
#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
public:
|
||||
typedef __thread_id id;
|
||||
typedef pthread_t native_handle_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
thread() : __t_(0) {}
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
template <class _F, class ..._Args,
|
||||
@@ -277,76 +203,41 @@ public:
|
||||
#endif
|
||||
~thread();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#ifdef _LIBCPP_MOVE
|
||||
thread(thread&& __t) : __t_(__t.__t_) {__t.__t_ = 0;}
|
||||
thread& operator=(thread&& __t);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(thread& __t) {_VSTD::swap(__t_, __t.__t_);}
|
||||
void swap(thread& __t) {_STD::swap(__t_, __t.__t_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool joinable() const {return __t_ != 0;}
|
||||
void join();
|
||||
void detach();
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
id get_id() const {return __t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
native_handle_type native_handle() {return __t_;}
|
||||
|
||||
static unsigned hardware_concurrency();
|
||||
};
|
||||
|
||||
class __assoc_sub_state;
|
||||
|
||||
class _LIBCPP_HIDDEN __thread_struct_imp;
|
||||
|
||||
class __thread_struct
|
||||
{
|
||||
__thread_struct_imp* __p_;
|
||||
|
||||
__thread_struct(const __thread_struct&);
|
||||
__thread_struct& operator=(const __thread_struct&);
|
||||
public:
|
||||
__thread_struct();
|
||||
~__thread_struct();
|
||||
|
||||
void notify_all_at_thread_exit(condition_variable*, mutex*);
|
||||
void __make_ready_at_thread_exit(__assoc_sub_state*);
|
||||
};
|
||||
|
||||
__thread_specific_ptr<__thread_struct>& __thread_local_data();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F, class ..._Args, size_t ..._Indices>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__threaad_execute(tuple<_F, _Args...>& __t, __tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
{
|
||||
__thread_local_data().reset(new __thread_struct);
|
||||
std::unique_ptr<_F> __p(static_cast<_F*>(__vp));
|
||||
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
|
||||
__threaad_execute(*__p, _Index());
|
||||
(*__p)();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F, class ..._Args,
|
||||
class
|
||||
>
|
||||
thread::thread(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G;
|
||||
_VSTD::unique_ptr<_G> __p(new _G(__decay_copy(_VSTD::forward<_F>(__f)),
|
||||
__decay_copy(_VSTD::forward<_Args>(__args))...));
|
||||
typedef decltype(bind(std::forward<_F>(__f), std::forward<_Args>(__args)...)) _G;
|
||||
std::unique_ptr<_G> __p(new _G(bind(std::forward<_F>(__f),
|
||||
std::forward<_Args>(__args)...)));
|
||||
int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get());
|
||||
if (__ec == 0)
|
||||
__p.release();
|
||||
@@ -356,16 +247,6 @@ thread::thread(_F&& __f, _Args&&... __args)
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
{
|
||||
__thread_local_data().reset(new __thread_struct);
|
||||
std::unique_ptr<_F> __p(static_cast<_F*>(__vp));
|
||||
(*__p)();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
thread::thread(_F __f)
|
||||
{
|
||||
@@ -379,9 +260,9 @@ thread::thread(_F __f)
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifdef _LIBCPP_MOVE
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
thread&
|
||||
thread::operator=(thread&& __t)
|
||||
{
|
||||
@@ -392,9 +273,9 @@ thread::operator=(thread&& __t)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_MOVE
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void swap(thread& __x, thread& __y) {__x.swap(__y);}
|
||||
|
||||
namespace this_thread
|
||||
@@ -426,15 +307,15 @@ sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
|
||||
}
|
||||
|
||||
template <class _Duration>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void
|
||||
sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
|
||||
sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t)
|
||||
{
|
||||
using namespace chrono;
|
||||
sleep_for(__t - steady_clock::now());
|
||||
sleep_for(__t - monotonic_clock::now());
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void yield() {sched_yield();}
|
||||
|
||||
} // this_thread
|
||||
|
432
include/tuple
432
include/tuple
@@ -25,7 +25,7 @@ public:
|
||||
template <class... U>
|
||||
explicit tuple(U&&...);
|
||||
tuple(const tuple&) = default;
|
||||
tuple(tuple&&) = default;
|
||||
tuple(tuple&&);
|
||||
template <class... U>
|
||||
tuple(const tuple<U...>&);
|
||||
template <class... U>
|
||||
@@ -56,8 +56,7 @@ public:
|
||||
tuple(allocator_arg_t, const Alloc& a, pair<U1, U2>&&);
|
||||
|
||||
tuple& operator=(const tuple&);
|
||||
tuple&
|
||||
operator=(tuple&&) noexcept(AND(is_nothrow_move_assignable<T>::value ...));
|
||||
tuple& operator=(tuple&&);
|
||||
template <class... U>
|
||||
tuple& operator=(const tuple<U...>&);
|
||||
template <class... U>
|
||||
@@ -67,16 +66,19 @@ public:
|
||||
template <class U1, class U2>
|
||||
tuple& operator=(pair<U1, U2>&&); //iffsizeof...(T) == 2
|
||||
|
||||
void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...));
|
||||
void swap(tuple&);
|
||||
};
|
||||
|
||||
const unspecified ignore;
|
||||
|
||||
template <class... T> tuple<V...> make_tuple(T&&...);
|
||||
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept;
|
||||
template <class... T> tuple<T&...> tie(T&...) noexcept;
|
||||
template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls);
|
||||
|
||||
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...);
|
||||
template <class... T> tuple<T&...> tie(T&...);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(const tuple<T...>&, const tuple<U...>&);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(tuple<T...>&&, const tuple<U...>&);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(const tuple<T...>&, tuple<U...>&&);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(tuple<T...>&&, tuple<U...>&&);
|
||||
|
||||
// 20.4.1.4, tuple helper classes:
|
||||
template <class T> class tuple_size; // undefined
|
||||
template <class... T> class tuple_size<tuple<T...>>;
|
||||
@@ -84,15 +86,8 @@ template <intsize_t I, class T> class tuple_element; // undefined
|
||||
template <intsize_t I, class... T> class tuple_element<I, tuple<T...>>;
|
||||
|
||||
// 20.4.1.5, element access:
|
||||
template <intsize_t I, class... T>
|
||||
typename tuple_element<I, tuple<T...>>::type&
|
||||
get(tuple<T...>&) noexcept;
|
||||
template <intsize_t I, class... T>
|
||||
typename tuple_element<I, tuple<T...>>::type const&
|
||||
get(const tuple<T...>&) noexcept;
|
||||
template <intsize_t I, class... T>
|
||||
typename tuple_element<I, tuple<T...>>::type&&
|
||||
get(tuple<T...>&&) noexcept;
|
||||
template <intsize_t I, class... T> typename tuple_element<I, tuple<T...>>::type& get(tuple<T...>&);
|
||||
template <intsize_t I, class... T> typename tuple_element<I, tuple<T...>>::type const& get(const tuple<T...>&);
|
||||
|
||||
// 20.4.1.6, relational operators:
|
||||
template<class... T, class... U> bool operator==(const tuple<T...>&, const tuple<U...>&);
|
||||
@@ -106,8 +101,7 @@ template <class... Types, class Alloc>
|
||||
struct uses_allocator<tuple<Types...>, Alloc>;
|
||||
|
||||
template <class... Types>
|
||||
void
|
||||
swap(tuple<Types...>& x, tuple<Types...>& y) noexcept(noexcept(x.swap(y)));
|
||||
void swap(tuple<Types...>& x, tuple<Types...>& y);
|
||||
|
||||
} // std
|
||||
|
||||
@@ -128,7 +122,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
// tuple_size
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...> >
|
||||
class tuple_size<tuple<_Tp...>>
|
||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||
{
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
class tuple_size<const tuple<_Tp...>>
|
||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||
{
|
||||
};
|
||||
@@ -136,10 +136,17 @@ class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...> >
|
||||
// tuple_element
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple_element<_Ip, tuple<_Tp...> >
|
||||
class tuple_element<_Ip, tuple<_Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
|
||||
typedef typename tuple_element<_Ip, __tuple_types<_Tp...>>::type type;
|
||||
};
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
class tuple_element<_Ip, const tuple<_Tp...>>
|
||||
{
|
||||
public:
|
||||
typedef const typename tuple_element<_Ip, __tuple_types<_Tp...>>::type type;
|
||||
};
|
||||
|
||||
// __tuple_leaf
|
||||
@@ -148,9 +155,8 @@ template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value>
|
||||
class __tuple_leaf;
|
||||
|
||||
template <size_t _Ip, class _Hp, bool _Ep>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Hp>::value)
|
||||
{
|
||||
swap(__x.get(), __y.get());
|
||||
}
|
||||
@@ -187,27 +193,24 @@ public:
|
||||
{static_assert(!is_reference<_Hp>::value,
|
||||
"Attempted to default construct a reference element in a tuple");}
|
||||
|
||||
template <class _Tp,
|
||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(_Tp&& __t)
|
||||
: value(_VSTD::forward<_Tp>(__t))
|
||||
{static_assert(!is_reference<_Hp>::value ||
|
||||
: value(_STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
is_same<typename remove_reference<_Tp>::type,
|
||||
reference_wrapper<
|
||||
typename remove_reference<_Hp>::type
|
||||
>
|
||||
>::value) ||
|
||||
(is_rvalue_reference<_Hp>::value &&
|
||||
!is_lvalue_reference<_Tp>::value),
|
||||
>::value),
|
||||
"Attempted to construct a reference element in a tuple with an rvalue");}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
|
||||
: value(_VSTD::forward<_Tp>(__t))
|
||||
: value(_STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -221,7 +224,7 @@ public:
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
|
||||
: value(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
|
||||
: value(allocator_arg_t(), __a, _STD::forward<_Tp>(__t))
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -235,7 +238,7 @@ public:
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
|
||||
: value(_VSTD::forward<_Tp>(__t), __a)
|
||||
: value(_STD::forward<_Tp>(__t), __a)
|
||||
{static_assert(!is_lvalue_reference<_Hp>::value ||
|
||||
is_lvalue_reference<_Hp>::value &&
|
||||
(is_lvalue_reference<_Tp>::value ||
|
||||
@@ -246,10 +249,6 @@ public:
|
||||
>::value),
|
||||
"Attempted to construct a reference element in a tuple with an rvalue");}
|
||||
|
||||
__tuple_leaf(const __tuple_leaf& __t)
|
||||
: value(__t.get())
|
||||
{static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
|
||||
@@ -260,14 +259,14 @@ public:
|
||||
__tuple_leaf&
|
||||
operator=(_Tp&& __t)
|
||||
{
|
||||
value = _VSTD::forward<_Tp>(__t);
|
||||
value = _STD::forward<_Tp>(__t);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
|
||||
int swap(__tuple_leaf& __t)
|
||||
{
|
||||
_VSTD::swap(*this, __t);
|
||||
_STD::swap(*this, __t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -298,26 +297,25 @@ public:
|
||||
__tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
|
||||
: _Hp(__a) {}
|
||||
|
||||
template <class _Tp,
|
||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(_Tp&& __t)
|
||||
: _Hp(_VSTD::forward<_Tp>(__t)) {}
|
||||
: _Hp(_STD::forward<_Tp>(__t)) {}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
|
||||
: _Hp(_VSTD::forward<_Tp>(__t)) {}
|
||||
: _Hp(_STD::forward<_Tp>(__t)) {}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
|
||||
: _Hp(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t)) {}
|
||||
: _Hp(allocator_arg_t(), __a, _STD::forward<_Tp>(__t)) {}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
|
||||
: _Hp(_VSTD::forward<_Tp>(__t), __a) {}
|
||||
: _Hp(_STD::forward<_Tp>(__t), __a) {}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -329,15 +327,13 @@ public:
|
||||
__tuple_leaf&
|
||||
operator=(_Tp&& __t)
|
||||
{
|
||||
_Hp::operator=(_VSTD::forward<_Tp>(__t));
|
||||
_Hp::operator=(_STD::forward<_Tp>(__t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
|
||||
_LIBCPP_INLINE_VISIBILITY int swap(__tuple_leaf& __t)
|
||||
{
|
||||
_VSTD::swap(*this, __t);
|
||||
_STD::swap(*this, __t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -345,23 +341,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const {return static_cast<const _Hp&>(*this);}
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __swallow(_Tp&&...) {}
|
||||
|
||||
template <bool ...> struct __all;
|
||||
|
||||
template <>
|
||||
struct __all<>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <bool _B0, bool ... _B>
|
||||
struct __all<_B0, _B...>
|
||||
{
|
||||
static const bool value = _B0 && __all<_B...>::value;
|
||||
};
|
||||
template <class ..._Tp> void __swallow(_Tp&&...) {}
|
||||
|
||||
// __tuple_impl
|
||||
|
||||
@@ -373,92 +353,82 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||
{
|
||||
template <size_t ..._Uf, class ..._Tf,
|
||||
size_t ..._Ul, class ..._Tl, class ..._Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit
|
||||
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
||||
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
||||
_Up&&... __u) :
|
||||
__tuple_leaf<_Uf, _Tf>(_VSTD::forward<_Up>(__u))...,
|
||||
__tuple_leaf<_Uf, _Tf>(_STD::forward<_Up>(__u))...,
|
||||
__tuple_leaf<_Ul, _Tl>()...
|
||||
{}
|
||||
|
||||
template <class _Alloc, size_t ..._Uf, class ..._Tf,
|
||||
size_t ..._Ul, class ..._Tl, class ..._Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit
|
||||
__tuple_impl(allocator_arg_t, const _Alloc& __a,
|
||||
__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
||||
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
||||
_Up&&... __u) :
|
||||
__tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a,
|
||||
_VSTD::forward<_Up>(__u))...,
|
||||
_STD::forward<_Up>(__u))...,
|
||||
__tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)...
|
||||
{}
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if
|
||||
<
|
||||
__tuple_convertible<_Tuple, tuple<_Tp...> >::value
|
||||
__tuple_convertible<_Tuple, tuple<_Tp...>>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tuple_impl(_Tuple&& __t)
|
||||
: __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
|
||||
: __tuple_leaf<_Indx, _Tp>(_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
|
||||
{}
|
||||
|
||||
template <class _Alloc, class _Tuple,
|
||||
class = typename enable_if
|
||||
<
|
||||
__tuple_convertible<_Tuple, tuple<_Tp...> >::value
|
||||
__tuple_convertible<_Tuple, tuple<_Tp...>>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
|
||||
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(), __a,
|
||||
_VSTD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
|
||||
_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
|
||||
{}
|
||||
|
||||
template <class _Tuple>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__tuple_assignable<_Tuple, tuple<_Tp...> >::value,
|
||||
__tuple_assignable<_Tuple, tuple<_Tp...>>::value,
|
||||
__tuple_impl&
|
||||
>::type
|
||||
operator=(_Tuple&& __t)
|
||||
{
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(_STD::forward<typename tuple_element<_Indx,
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(__tuple_impl& __t)
|
||||
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||
{
|
||||
__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
|
||||
}
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
class _LIBCPP_VISIBLE tuple
|
||||
class tuple
|
||||
{
|
||||
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
|
||||
|
||||
base base_;
|
||||
|
||||
template <size_t _Jp, class ..._Up> friend
|
||||
typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&);
|
||||
typename tuple_element<_Jp, tuple<_Up...>>::type& get(tuple<_Up...>&);
|
||||
template <size_t _Jp, class ..._Up> friend
|
||||
const typename tuple_element<_Jp, tuple<_Up...> >::type& get(const tuple<_Up...>&);
|
||||
template <size_t _Jp, class ..._Up> friend
|
||||
typename tuple_element<_Jp, tuple<_Up...> >::type&& get(tuple<_Up...>&&);
|
||||
const typename tuple_element<_Jp, tuple<_Up...>>::type& get(const tuple<_Up...>&);
|
||||
public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit tuple(const _Tp& ... __t)
|
||||
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
|
||||
@@ -468,7 +438,6 @@ public:
|
||||
) {}
|
||||
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
|
||||
: base_(allocator_arg_t(), __a,
|
||||
typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
@@ -492,14 +461,13 @@ public:
|
||||
>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit
|
||||
tuple(_Up&&... __u)
|
||||
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
_VSTD::forward<_Up>(__u)...) {}
|
||||
_STD::forward<_Up>(__u)...) {}
|
||||
|
||||
template <class _Alloc, class ..._Up,
|
||||
class = typename enable_if
|
||||
@@ -515,14 +483,13 @@ public:
|
||||
>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
|
||||
: base_(allocator_arg_t(), __a,
|
||||
typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||
_VSTD::forward<_Up>(__u)...) {}
|
||||
_STD::forward<_Up>(__u)...) {}
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if
|
||||
@@ -530,9 +497,8 @@ public:
|
||||
__tuple_convertible<_Tuple, tuple>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(_Tuple&& __t)
|
||||
: base_(_VSTD::forward<_Tuple>(__t)) {}
|
||||
: base_(_STD::forward<_Tuple>(__t)) {}
|
||||
|
||||
template <class _Alloc, class _Tuple,
|
||||
class = typename enable_if
|
||||
@@ -540,9 +506,8 @@ public:
|
||||
__tuple_convertible<_Tuple, tuple>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
|
||||
: base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
|
||||
: base_(allocator_arg_t(), __a, _STD::forward<_Tuple>(__t)) {}
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if
|
||||
@@ -550,86 +515,61 @@ public:
|
||||
__tuple_assignable<_Tuple, tuple>::value
|
||||
>::type
|
||||
>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple&
|
||||
operator=(_Tuple&& __t)
|
||||
{
|
||||
base_.operator=(_VSTD::forward<_Tuple>(__t));
|
||||
base_.operator=(_STD::forward<_Tuple>(__t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||
{base_.swap(__t.base_);}
|
||||
void swap(tuple& __t) {base_.swap(__t.base_);}
|
||||
};
|
||||
|
||||
template <>
|
||||
class _LIBCPP_VISIBLE tuple<>
|
||||
class tuple<>
|
||||
{
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple() {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&) {}
|
||||
template <class _Alloc>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&, const tuple&) {}
|
||||
template <class _U>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(array<_U, 0>) {}
|
||||
template <class _Alloc, class _U>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
tuple(allocator_arg_t, const _Alloc&, array<_U, 0>) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(tuple&) _NOEXCEPT {}
|
||||
void swap(tuple&) {}
|
||||
};
|
||||
|
||||
template <class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__all<__is_swappable<_Tp>::value...>::value,
|
||||
void
|
||||
>::type
|
||||
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
|
||||
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||
{__t.swap(__u);}
|
||||
void
|
||||
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u) {__t.swap(__u);}
|
||||
|
||||
// get
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
inline
|
||||
typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
get(tuple<_Tp...>& __t)
|
||||
{
|
||||
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
|
||||
typedef typename tuple_element<_Ip, tuple<_Tp...>>::type type;
|
||||
return static_cast<__tuple_leaf<_Ip, type>&>(__t.base_).get();
|
||||
}
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
inline
|
||||
const typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
get(const tuple<_Tp...>& __t)
|
||||
{
|
||||
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
|
||||
typedef typename tuple_element<_Ip, tuple<_Tp...>>::type type;
|
||||
return static_cast<const __tuple_leaf<_Ip, type>&>(__t.base_).get();
|
||||
}
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(tuple<_Tp...>&& __t)
|
||||
{
|
||||
typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
|
||||
return static_cast<type&&>(
|
||||
static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get());
|
||||
}
|
||||
|
||||
// tie
|
||||
|
||||
template <class ..._Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp&...>
|
||||
tie(_Tp&... __t)
|
||||
{
|
||||
@@ -639,8 +579,10 @@ tie(_Tp&... __t)
|
||||
template <class _Up>
|
||||
struct __ignore_t
|
||||
{
|
||||
__ignore_t() {}
|
||||
template <class _Tp>
|
||||
__ignore_t(_Tp&&) {}
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const __ignore_t& operator=(_Tp&&) const {return *this;}
|
||||
};
|
||||
|
||||
@@ -655,7 +597,7 @@ struct ___make_tuple_return
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct ___make_tuple_return<reference_wrapper<_Tp> >
|
||||
struct ___make_tuple_return<reference_wrapper<_Tp>>
|
||||
{
|
||||
typedef _Tp& type;
|
||||
};
|
||||
@@ -667,26 +609,25 @@ struct __make_tuple_return
|
||||
};
|
||||
|
||||
template <class... _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<typename __make_tuple_return<_Tp>::type...>
|
||||
make_tuple(_Tp&&... __t)
|
||||
{
|
||||
return tuple<typename __make_tuple_return<_Tp>::type...>(_VSTD::forward<_Tp>(__t)...);
|
||||
return tuple<typename __make_tuple_return<_Tp>::type...>(_STD::forward<_Tp>(__t)...);
|
||||
}
|
||||
|
||||
template <class... _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
tuple<_Tp&&...>
|
||||
forward_as_tuple(_Tp&&... __t)
|
||||
{
|
||||
return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
|
||||
return tuple<_Tp&&...>(_STD::forward<_Tp>(__t)...);
|
||||
}
|
||||
|
||||
template <size_t _I>
|
||||
struct __tuple_equal
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Up& __y)
|
||||
{
|
||||
return __tuple_equal<_I - 1>()(__x, __y) && get<_I-1>(__x) == get<_I-1>(__y);
|
||||
@@ -697,7 +638,6 @@ template <>
|
||||
struct __tuple_equal<0>
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp&, const _Up&)
|
||||
{
|
||||
return true;
|
||||
@@ -705,7 +645,7 @@ struct __tuple_equal<0>
|
||||
};
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -713,7 +653,7 @@ operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -724,7 +664,6 @@ template <size_t _I>
|
||||
struct __tuple_less
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp& __x, const _Up& __y)
|
||||
{
|
||||
return __tuple_less<_I-1>()(__x, __y) ||
|
||||
@@ -736,7 +675,6 @@ template <>
|
||||
struct __tuple_less<0>
|
||||
{
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Tp&, const _Up&)
|
||||
{
|
||||
return false;
|
||||
@@ -744,7 +682,7 @@ struct __tuple_less<0>
|
||||
};
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -752,7 +690,7 @@ operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -760,7 +698,7 @@ operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -768,7 +706,7 @@ operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
}
|
||||
|
||||
template <class ..._Tp, class ..._Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline
|
||||
bool
|
||||
operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
@@ -777,144 +715,76 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
|
||||
// tuple_cat
|
||||
|
||||
template <class _Tp, class _Up> struct __tuple_cat_type;
|
||||
|
||||
template <class ..._Ttypes, class ..._Utypes>
|
||||
struct __tuple_cat_type<tuple<_Ttypes...>, __tuple_types<_Utypes...> >
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
typedef tuple<_Ttypes..., _Utypes...> type;
|
||||
};
|
||||
|
||||
template <class _ResultTuple, bool _Is_Tuple0TupleLike, class ..._Tuples>
|
||||
struct __tuple_cat_return_1
|
||||
{
|
||||
};
|
||||
|
||||
template <class ..._Types, class _Tuple0>
|
||||
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0>
|
||||
{
|
||||
typedef typename __tuple_cat_type<tuple<_Types...>,
|
||||
typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <class ..._Types, class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples...>
|
||||
: public __tuple_cat_return_1<
|
||||
typename __tuple_cat_type<
|
||||
tuple<_Types...>,
|
||||
typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type
|
||||
>::type,
|
||||
__tuple_like<typename remove_reference<_Tuple1>::type>::value,
|
||||
_Tuple1, _Tuples...>
|
||||
{
|
||||
};
|
||||
|
||||
template <class ..._Tuples> struct __tuple_cat_return;
|
||||
|
||||
template <class _Tuple0, class ..._Tuples>
|
||||
struct __tuple_cat_return<_Tuple0, _Tuples...>
|
||||
: public __tuple_cat_return_1<tuple<>,
|
||||
__tuple_like<typename remove_reference<_Tuple0>::type>::value, _Tuple0,
|
||||
_Tuples...>
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct __tuple_cat_return<>
|
||||
{
|
||||
typedef tuple<> type;
|
||||
};
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<>
|
||||
tuple_cat()
|
||||
{
|
||||
return tuple<>();
|
||||
return tuple<_Tp..., _Up...>(get<_I1>(__x)..., get<_I2>(__y)...);
|
||||
}
|
||||
|
||||
template <class _R, class _Indices, class _Tuple0, class ..._Tuples>
|
||||
struct __tuple_cat_return_ref_imp;
|
||||
|
||||
template <class ..._Types, size_t ..._I0, class _Tuple0>
|
||||
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0>
|
||||
template <class... _Tp, class... _Up>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
typedef tuple<_Types..., typename __apply_cv<_Tuple0,
|
||||
typename tuple_element<_I0, _T0>::type>::type&&...> type;
|
||||
};
|
||||
return __tuple_cat(__x, typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
__y, typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class ..._Types, size_t ..._I0, class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>,
|
||||
_Tuple0, _Tuple1, _Tuples...>
|
||||
: public __tuple_cat_return_ref_imp<
|
||||
tuple<_Types..., typename __apply_cv<_Tuple0,
|
||||
typename tuple_element<_I0,
|
||||
typename remove_reference<_Tuple0>::type>::type>::type&&...>,
|
||||
typename __make_tuple_indices<tuple_size<typename
|
||||
remove_reference<_Tuple1>::type>::value>::type,
|
||||
_Tuple1, _Tuples...>
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
};
|
||||
return tuple<_Tp..., _Up...>(_STD::forward<_Tp>(get<_I1>(__x))..., get<_I2>(__y)...);
|
||||
}
|
||||
|
||||
template <class _Tuple0, class ..._Tuples>
|
||||
struct __tuple_cat_return_ref
|
||||
: public __tuple_cat_return_ref_imp<tuple<>,
|
||||
typename __make_tuple_indices<
|
||||
tuple_size<typename remove_reference<_Tuple0>::type>::value
|
||||
>::type, _Tuple0, _Tuples...>
|
||||
template <class... _Tp, class... _Up>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(tuple<_Tp...>&& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
};
|
||||
return __tuple_cat(_STD::move(__x), typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
__y, typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class _Types, class _I0, class _J0>
|
||||
struct __tuple_cat;
|
||||
|
||||
template <class ..._Types, size_t ..._I0, size_t ..._J0>
|
||||
struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...> >
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
template <class _Tuple0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
|
||||
operator()(tuple<_Types...> __t, _Tuple0&& __t0)
|
||||
{
|
||||
return _VSTD::forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_VSTD::forward<_Tuple0>(__t0))...);
|
||||
}
|
||||
return tuple<_Tp..., _Up...>(get<_I1>(__x)..., _STD::forward<_Up>(get<_I2>(__y))...);
|
||||
}
|
||||
|
||||
template <class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type
|
||||
operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls)
|
||||
{
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
typedef typename remove_reference<_Tuple1>::type _T1;
|
||||
return __tuple_cat<
|
||||
tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,
|
||||
typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,
|
||||
typename __make_tuple_indices<tuple_size<_T1>::value>::type>()
|
||||
(_VSTD::forward_as_tuple(
|
||||
_VSTD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_VSTD::forward<_Tuple0>(__t0))...
|
||||
),
|
||||
_VSTD::forward<_Tuple1>(__t1),
|
||||
_VSTD::forward<_Tuples>(__tpls)...);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tuple0, class... _Tuples>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __tuple_cat_return<_Tuple0, _Tuples...>::type
|
||||
tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
|
||||
template <class... _Tp, class... _Up>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(const tuple<_Tp...>& __x, tuple<_Up...>&& __y)
|
||||
{
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
return __tuple_cat<tuple<>, __tuple_indices<>,
|
||||
typename __make_tuple_indices<tuple_size<_T0>::value>::type>()
|
||||
(tuple<>(), _VSTD::forward<_Tuple0>(__t0),
|
||||
_VSTD::forward<_Tuples>(__tpls)...);
|
||||
return __tuple_cat(__x, typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
_STD::move(__y), typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
return tuple<_Tp..., _Up...>(_STD::forward<_Tp>(get<_I1>(__x))..., _STD::forward<_Up>(get<_I2>(__y))...);
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(tuple<_Tp...>&& __x, tuple<_Up...>&& __y)
|
||||
{
|
||||
return __tuple_cat(_STD::move(__x), typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
_STD::move(__y), typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class ..._Tp, class _Alloc>
|
||||
struct _LIBCPP_VISIBLE uses_allocator<tuple<_Tp...>, _Alloc>
|
||||
struct uses_allocator<tuple<_Tp...>, _Alloc>
|
||||
: true_type {};
|
||||
|
||||
template <class _T1, class _T2>
|
||||
@@ -923,8 +793,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
pair<_T1, _T2>::pair(piecewise_construct_t,
|
||||
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
|
||||
__tuple_indices<_I1...>, __tuple_indices<_I2...>)
|
||||
: first(_VSTD::forward<_Args1>(get<_I1>( __first_args))...),
|
||||
second(_VSTD::forward<_Args2>(get<_I2>(__second_args))...)
|
||||
: first(_STD::forward<_Args1>(get<_I1>( __first_args))...),
|
||||
second(_STD::forward<_Args2>(get<_I2>(__second_args))...)
|
||||
{
|
||||
}
|
||||
|
||||
|
2212
include/type_traits
2212
include/type_traits
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -21,24 +21,24 @@ namespace std
|
||||
class type_index
|
||||
{
|
||||
public:
|
||||
type_index(const type_info& rhs) noexcept;
|
||||
type_index(const type_info& rhs);
|
||||
|
||||
bool operator==(const type_index& rhs) const noexcept;
|
||||
bool operator!=(const type_index& rhs) const noexcept;
|
||||
bool operator< (const type_index& rhs) const noexcept;
|
||||
bool operator<=(const type_index& rhs) const noexcept;
|
||||
bool operator> (const type_index& rhs) const noexcept;
|
||||
bool operator>=(const type_index& rhs) const noexcept;
|
||||
bool operator==(const type_index& rhs) const;
|
||||
bool operator!=(const type_index& rhs) const;
|
||||
bool operator< (const type_index& rhs) const;
|
||||
bool operator<=(const type_index& rhs) const;
|
||||
bool operator> (const type_index& rhs) const;
|
||||
bool operator>=(const type_index& rhs) const;
|
||||
|
||||
size_t hash_code() const noexcept;
|
||||
const char* name() const noexcept;
|
||||
size_t hash_code() const;
|
||||
const char* name() const;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct hash<type_index>
|
||||
: public unary_function<type_index, size_t>
|
||||
{
|
||||
size_t operator()(type_index index) const noexcept;
|
||||
size_t operator()(type_index index) const;
|
||||
};
|
||||
|
||||
} // std
|
||||
@@ -53,47 +53,30 @@ struct hash<type_index>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_VISIBLE type_index
|
||||
class type_index
|
||||
{
|
||||
const type_info* __t_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
type_index(const type_info& __y) _NOEXCEPT : __t_(&__y) {}
|
||||
type_index(const type_info& __y) : __t_(&__y) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_index& __y) const _NOEXCEPT
|
||||
{return *__t_ == *__y.__t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_index& __y) const _NOEXCEPT
|
||||
{return *__t_ != *__y.__t_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator< (const type_index& __y) const _NOEXCEPT
|
||||
{return __t_->before(*__y.__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator<=(const type_index& __y) const _NOEXCEPT
|
||||
{return !__y.__t_->before(*__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator> (const type_index& __y) const _NOEXCEPT
|
||||
{return __y.__t_->before(*__t_);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator>=(const type_index& __y) const _NOEXCEPT
|
||||
{return !__t_->before(*__y.__t_);}
|
||||
bool operator==(const type_index& __y) const {return *__t_ == *__y.__t_;}
|
||||
bool operator!=(const type_index& __y) const {return *__t_ != *__y.__t_;}
|
||||
bool operator< (const type_index& __y) const {return __t_->before(*__y.__t_);}
|
||||
bool operator<=(const type_index& __y) const {return !__y.__t_->before(*__t_);}
|
||||
bool operator> (const type_index& __y) const {return __y.__t_->before(*__t_);}
|
||||
bool operator>=(const type_index& __y) const {return !__t_->before(*__y.__t_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t hash_code() const _NOEXCEPT {return __t_->hash_code();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const _NOEXCEPT {return __t_->name();}
|
||||
size_t hash_code() const {return __t_->hash_code();}
|
||||
const char* name() const {return __t_->name();}
|
||||
};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
||||
template <class _Tp> struct hash;
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<type_index>
|
||||
struct hash<type_index>
|
||||
: public unary_function<type_index, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(type_index __index) const _NOEXCEPT
|
||||
{return __index.hash_code();}
|
||||
size_t operator()(type_index __index) const {return __index.hash_code();}
|
||||
};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -22,12 +22,12 @@ class type_info
|
||||
public:
|
||||
virtual ~type_info();
|
||||
|
||||
bool operator==(const type_info& rhs) const noexcept;
|
||||
bool operator!=(const type_info& rhs) const noexcept;
|
||||
bool operator==(const type_info& rhs) const;
|
||||
bool operator!=(const type_info& rhs) const;
|
||||
|
||||
bool before(const type_info& rhs) const noexcept;
|
||||
size_t hash_code() const noexcept;
|
||||
const char* name() const noexcept;
|
||||
bool before(const type_info& rhs) const;
|
||||
size_t hash_code() const throw();
|
||||
const char* name() const;
|
||||
|
||||
type_info(const type_info& rhs) = delete;
|
||||
type_info& operator=(const type_info& rhs) = delete;
|
||||
@@ -37,20 +37,20 @@ class bad_cast
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_cast() noexcept;
|
||||
bad_cast(const bad_cast&) noexcept;
|
||||
bad_cast& operator=(const bad_cast&) noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
bad_cast() throw();
|
||||
bad_cast(const bad_cast&) throw();
|
||||
bad_cast& operator=(const bad_cast&) throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class bad_typeid
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_typeid() noexcept;
|
||||
bad_typeid(const bad_typeid&) noexcept;
|
||||
bad_typeid& operator=(const bad_typeid&) noexcept;
|
||||
virtual const char* what() const noexcept;
|
||||
bad_typeid() throw();
|
||||
bad_typeid(const bad_typeid&) throw();
|
||||
bad_typeid& operator=(const bad_typeid&) throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
} // std
|
||||
@@ -73,28 +73,22 @@ class _LIBCPP_EXCEPTION_ABI type_info
|
||||
protected:
|
||||
const char* __type_name;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit type_info(const char* __n)
|
||||
: __type_name(__n) {}
|
||||
|
||||
public:
|
||||
virtual ~type_info();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const _NOEXCEPT {return __type_name;}
|
||||
const char* name() const {return __type_name;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool before(const type_info& __arg) const _NOEXCEPT
|
||||
bool before(const type_info& __arg) const
|
||||
{return __type_name < __arg.__type_name;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t hash_code() const _NOEXCEPT
|
||||
size_t hash_code() const throw()
|
||||
{return *reinterpret_cast<const size_t*>(&__type_name);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_info& __arg) const _NOEXCEPT
|
||||
bool operator==(const type_info& __arg) const
|
||||
{return __type_name == __arg.__type_name;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_info& __arg) const _NOEXCEPT
|
||||
bool operator!=(const type_info& __arg) const
|
||||
{return !operator==(__arg);}
|
||||
|
||||
};
|
||||
@@ -103,18 +97,18 @@ class _LIBCPP_EXCEPTION_ABI bad_cast
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_cast() _NOEXCEPT;
|
||||
virtual ~bad_cast() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
bad_cast() throw();
|
||||
virtual ~bad_cast() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_typeid
|
||||
: public exception
|
||||
{
|
||||
public:
|
||||
bad_typeid() _NOEXCEPT;
|
||||
virtual ~bad_typeid() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
bad_typeid() throw();
|
||||
virtual ~bad_typeid() throw();
|
||||
virtual const char* what() const throw();
|
||||
};
|
||||
|
||||
} // std
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user