Compare commits
177 Commits
release_32
...
release_33
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db2b81bf90 | ||
![]() |
8c23819220 | ||
![]() |
74f4da7219 | ||
![]() |
e58bc12f2a | ||
![]() |
34cb066fa2 | ||
![]() |
63d8f7e341 | ||
![]() |
15467189c3 | ||
![]() |
867deb8e06 | ||
![]() |
155f06018e | ||
![]() |
a9b94f1337 | ||
![]() |
912438c272 | ||
![]() |
d3b5b6b9f4 | ||
![]() |
006ab1e213 | ||
![]() |
df4182153c | ||
![]() |
a5f0e6c5c1 | ||
![]() |
05e7d24b3d | ||
![]() |
c5e6aa5f5c | ||
![]() |
f9e75aef34 | ||
![]() |
9493e27c0f | ||
![]() |
c52fb8d7bf | ||
![]() |
9c2ce95063 | ||
![]() |
08dd25303e | ||
![]() |
5544f7e0c7 | ||
![]() |
b4e67cfd42 | ||
![]() |
2062f37772 | ||
![]() |
61fe0ac9b3 | ||
![]() |
4313ec3975 | ||
![]() |
ae57a1ab1d | ||
![]() |
993248935c | ||
![]() |
4f67100219 | ||
![]() |
a5733b3ad3 | ||
![]() |
0795931dee | ||
![]() |
6dcaf3ee1a | ||
![]() |
e1e96cb840 | ||
![]() |
79a35570a5 | ||
![]() |
128f7bf4fa | ||
![]() |
c5e8961a35 | ||
![]() |
4aa8b06e67 | ||
![]() |
cf31d3864e | ||
![]() |
b777d6a4b2 | ||
![]() |
11a50ac497 | ||
![]() |
d4c96a6c89 | ||
![]() |
f6bdda044c | ||
![]() |
a1985ebbc8 | ||
![]() |
9d00ed5d87 | ||
![]() |
fc2f021bdd | ||
![]() |
8b25c00ef1 | ||
![]() |
302fa82a1c | ||
![]() |
db4d478ff4 | ||
![]() |
742fecbd2a | ||
![]() |
2c0d3edf68 | ||
![]() |
34d36f39b0 | ||
![]() |
32d40f5f44 | ||
![]() |
02d5e18917 | ||
![]() |
d1c0082675 | ||
![]() |
c3a9b81e67 | ||
![]() |
3fbd1dfb24 | ||
![]() |
d9cdb2dcfd | ||
![]() |
782da33d1c | ||
![]() |
c1ca2e1e8b | ||
![]() |
295891fdc2 | ||
![]() |
0d01eb54e7 | ||
![]() |
f5f4684e71 | ||
![]() |
ae7bf9daac | ||
![]() |
9976b5511a | ||
![]() |
06d8bf6ce2 | ||
![]() |
9b145da078 | ||
![]() |
04bd79b23a | ||
![]() |
bdea27ba8f | ||
![]() |
b74309e3ad | ||
![]() |
903439f735 | ||
![]() |
c19fe86743 | ||
![]() |
53e2763966 | ||
![]() |
dab9b2eb32 | ||
![]() |
dece7fe670 | ||
![]() |
a22d2addb1 | ||
![]() |
e33c2d1926 | ||
![]() |
e47bc9bc4f | ||
![]() |
c7cbe502db | ||
![]() |
c789025a5a | ||
![]() |
6319f1462d | ||
![]() |
23fb972520 | ||
![]() |
707f318787 | ||
![]() |
83eade6abb | ||
![]() |
cc7bdae931 | ||
![]() |
3101474720 | ||
![]() |
11a31d0583 | ||
![]() |
fae54b9c14 | ||
![]() |
4a0e74fff8 | ||
![]() |
0560f786fe | ||
![]() |
76aa2ef017 | ||
![]() |
0dee9cd5ad | ||
![]() |
3bc6a98c3e | ||
![]() |
6b875ef374 | ||
![]() |
af4d161908 | ||
![]() |
af69f47e86 | ||
![]() |
b85dea35b0 | ||
![]() |
8eba41324c | ||
![]() |
1608b64881 | ||
![]() |
fe14b970ac | ||
![]() |
5920cfc403 | ||
![]() |
b18165e704 | ||
![]() |
d854ce6bfa | ||
![]() |
9ae96d0f21 | ||
![]() |
635bbbb6d1 | ||
![]() |
46c49d19aa | ||
![]() |
88c3190d6c | ||
![]() |
6afc7ad3eb | ||
![]() |
fd329a445e | ||
![]() |
b73568dc24 | ||
![]() |
66a48c5ad5 | ||
![]() |
7fa0ca75e5 | ||
![]() |
88dec1ef5c | ||
![]() |
6b8b9922f0 | ||
![]() |
cedb7fcc10 | ||
![]() |
a38e2c9d1a | ||
![]() |
5f4841fb83 | ||
![]() |
43807c2fba | ||
![]() |
4cceb7a5e8 | ||
![]() |
8b9eee35d8 | ||
![]() |
548d392d5d | ||
![]() |
c8e1889601 | ||
![]() |
edfb05351e | ||
![]() |
aac8dd8331 | ||
![]() |
a5b51964c1 | ||
![]() |
81d1ef7a3f | ||
![]() |
cccf25579a | ||
![]() |
54e2fff2e1 | ||
![]() |
e0f0bfb5e6 | ||
![]() |
7173a501bb | ||
![]() |
7b9d6a8d40 | ||
![]() |
78f0de22db | ||
![]() |
5ce391e336 | ||
![]() |
0b93963db7 | ||
![]() |
b05a55675f | ||
![]() |
1b031c947f | ||
![]() |
3e3ae9ec41 | ||
![]() |
b4ebb0e415 | ||
![]() |
750039f50c | ||
![]() |
f619e230cc | ||
![]() |
304c31b355 | ||
![]() |
83e2c4d877 | ||
![]() |
6ae47055f9 | ||
![]() |
8226d0b7c5 | ||
![]() |
239e341c94 | ||
![]() |
ba1920fe4b | ||
![]() |
002a984948 | ||
![]() |
159b9ba4ce | ||
![]() |
0e0bc1cfe8 | ||
![]() |
352bd3a273 | ||
![]() |
db8a030bd3 | ||
![]() |
ed9f69d342 | ||
![]() |
bbda4db0d5 | ||
![]() |
d1a7479763 | ||
![]() |
21772ec063 | ||
![]() |
2328902ab1 | ||
![]() |
5f767b7b28 | ||
![]() |
bf68bdc4ed | ||
![]() |
0aa900e94f | ||
![]() |
c6e54b964f | ||
![]() |
27c836ff3a | ||
![]() |
3793a7d202 | ||
![]() |
ee717d8c44 | ||
![]() |
b2f2b68143 | ||
![]() |
a46482e8bb | ||
![]() |
3d4f92c08a | ||
![]() |
0a69fa14d2 | ||
![]() |
7fa77a701f | ||
![]() |
a358fbe504 | ||
![]() |
53008d8b0c | ||
![]() |
af01e708aa | ||
![]() |
b0895ff8ae | ||
![]() |
641f6c1f65 | ||
![]() |
8a9c5ea750 | ||
![]() |
984f10fdc0 | ||
![]() |
537b2fa6b8 | ||
![]() |
faa17162e9 |
4
.arcconfig
Normal file
4
.arcconfig
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"project_id" : "libcxx",
|
||||||
|
"conduit_uri" : "http://llvm-reviews.chandlerc.com/"
|
||||||
|
}
|
@@ -39,6 +39,14 @@ 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_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)
|
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
|
||||||
|
|
||||||
|
set(CXXABIS none libcxxabi libcxxrt libsupc++)
|
||||||
|
if (NOT DEFINED LIBCXX_CXX_ABI)
|
||||||
|
set(LIBCXX_CXX_ABI "none")
|
||||||
|
endif()
|
||||||
|
set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
|
||||||
|
"Specify C++ ABI library to use." FORCE)
|
||||||
|
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS "";${CXXABIS})
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Configure System
|
# Configure System
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -58,6 +66,91 @@ get_target_triple(LIBCXX_TARGET_TRIPLE
|
|||||||
)
|
)
|
||||||
set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.")
|
set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.")
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Add an ABI library if appropriate
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
#
|
||||||
|
# _setup_abi: Set up the build to use an ABI library
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
# abidefines: A list of defines needed to compile libc++ with the ABI library
|
||||||
|
# abilibs : A list of libraries to link against
|
||||||
|
# abifiles : A list of files (which may be relative paths) to copy into the
|
||||||
|
# libc++ build tree for the build. These files will also be
|
||||||
|
# installed alongside the libc++ headers.
|
||||||
|
# abidirs : A list of relative paths to create under an include directory
|
||||||
|
# in the libc++ build directory.
|
||||||
|
#
|
||||||
|
macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs)
|
||||||
|
list(APPEND LIBCXX_CXX_FEATURE_FLAGS ${abidefines})
|
||||||
|
set(${abipathvar} "${${abipathvar}}"
|
||||||
|
CACHE STRINGS
|
||||||
|
"Paths to ABI include directories separate by ';'."
|
||||||
|
)
|
||||||
|
set(LIBCXX_CXX_ABI_LIBRARIES ${abilibs})
|
||||||
|
set(LIBCXX_ABILIB_FILES ${abifiles})
|
||||||
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
|
||||||
|
foreach(_d ${abidirs})
|
||||||
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/${_d}")
|
||||||
|
endforeach()
|
||||||
|
set(LIBCXX_ABILIB_FILE_PATHS)
|
||||||
|
foreach(fpath ${LIBCXX_ABILIB_FILES})
|
||||||
|
set(found FALSE)
|
||||||
|
foreach(incpath ${${abipathvar}})
|
||||||
|
if (EXISTS "${incpath}/${fpath}")
|
||||||
|
set(found TRUE)
|
||||||
|
get_filename_component(dstdir ${fpath} PATH)
|
||||||
|
get_filename_component(ifile ${fpath} NAME)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${CMAKE_BINARY_DIR}/include/${dstdir}/${ifile}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
"${incpath}/${fpath}"
|
||||||
|
"${CMAKE_BINARY_DIR}/include/${dstdir}"
|
||||||
|
MAIN_DEPENDENCY "${incpath}/${fpath}"
|
||||||
|
)
|
||||||
|
list(APPEND LIBCXX_CXX_ABI_DEPS
|
||||||
|
"${CMAKE_BINARY_DIR}/include/${dstdir}/${ifile}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if (NOT found)
|
||||||
|
message(FATAL_ERROR "Failed to find ${fpath}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
add_custom_target(abilib_headers DEPENDS ${LIBCXX_CXX_ABI_DEPS})
|
||||||
|
set(LIBCXX_CXX_ABI_DEPS abilib_headers)
|
||||||
|
include_directories("${CMAKE_BINARY_DIR}/include")
|
||||||
|
install(DIRECTORY "${CMAKE_BINARY_DIR}/include/"
|
||||||
|
DESTINATION include/c++/v1
|
||||||
|
FILES_MATCHING
|
||||||
|
PATTERN "*"
|
||||||
|
)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
if ("${LIBCXX_CXX_ABI}" STREQUAL "libsupc++")
|
||||||
|
set(_LIBSUPCXX_INCLUDE_FILES
|
||||||
|
cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h
|
||||||
|
bits/cxxabi_tweaks.h bits/cxxabi_forced.h
|
||||||
|
)
|
||||||
|
setup_abi_lib("LIBCXX_LIBSUPCXX_INCLUDE_PATHS" "-D__GLIBCXX__"
|
||||||
|
"supc++" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
|
||||||
|
)
|
||||||
|
elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
|
||||||
|
setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
|
||||||
|
"c++abi" "cxxabi.h;cxa_demangle.h" ""
|
||||||
|
)
|
||||||
|
elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
|
||||||
|
setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
|
||||||
|
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
|
||||||
|
)
|
||||||
|
elseif (NOT "${LIBCXX_CXX_ABI}" STREQUAL "none")
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Currently libsupc++, libcxxabi, libcxxrt and none are "
|
||||||
|
"supported for c++ abi."
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Configure compiler.
|
# Configure compiler.
|
||||||
include(config-ix)
|
include(config-ix)
|
||||||
|
|
||||||
@@ -135,6 +228,10 @@ else()
|
|||||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -DNDEBUG)
|
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -DNDEBUG)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
# Static library
|
||||||
|
if (NOT LIBCXX_ENABLE_SHARED)
|
||||||
|
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_LIBCPP_BUILD_STATIC)
|
||||||
|
endif()
|
||||||
|
|
||||||
# This is the _ONLY_ place where add_definitions is called.
|
# This is the _ONLY_ place where add_definitions is called.
|
||||||
add_definitions(
|
add_definitions(
|
||||||
|
133
CREDITS.TXT
133
CREDITS.TXT
@@ -8,61 +8,10 @@ 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
|
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
|
||||||
(S).
|
(S).
|
||||||
|
|
||||||
N: Howard Hinnant
|
N: Saleem Abdulrasool
|
||||||
E: hhinnant@apple.com
|
E: compnerd@compnerd.org
|
||||||
D: Architect and primary author of libc++
|
|
||||||
|
|
||||||
N: Marshall Clow
|
|
||||||
E: mclow.lists@gmail.com
|
|
||||||
E: marshall@idio.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 and Solaris ports, libcxxrt support, some atomics work.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
N: Craig Silverstein
|
|
||||||
E: csilvers@google.com
|
|
||||||
D: Implemented Cityhash as the string hash function on 64-bit machines
|
|
||||||
|
|
||||||
N: Google Inc.
|
|
||||||
D: Copyright owner and contributor of the CityHash algorithm
|
|
||||||
|
|
||||||
N: Jeffrey Yasskin
|
|
||||||
E: jyasskin@gmail.com
|
|
||||||
E: jyasskin@google.com
|
|
||||||
D: Linux fixes.
|
|
||||||
|
|
||||||
N: Jonathan Sauer
|
|
||||||
D: Minor patches, mostly related to constexpr
|
|
||||||
|
|
||||||
N: Richard Smith
|
|
||||||
D: Minor patches.
|
|
||||||
|
|
||||||
N: Andrew Morrow
|
|
||||||
E: andrew.c.morrow@gmail.com
|
|
||||||
D: Minor patches and Linux fixes.
|
D: Minor patches and Linux fixes.
|
||||||
|
|
||||||
N: Hyeon-bin Jeong
|
|
||||||
E: tuhertz@gmail.com
|
|
||||||
D: Minor patches and bug fixes.
|
|
||||||
|
|
||||||
N: Michel Morin
|
|
||||||
E: mimomorin@gmail.com
|
|
||||||
D: Minor patches to is_convertible.
|
|
||||||
|
|
||||||
N: Dimitry Andric
|
N: Dimitry Andric
|
||||||
E: dimitry@andric.com
|
E: dimitry@andric.com
|
||||||
D: Visibility fixes, minor FreeBSD portability patches.
|
D: Visibility fixes, minor FreeBSD portability patches.
|
||||||
@@ -71,6 +20,84 @@ N: Holger Arnold
|
|||||||
E: holgerar@gmail.com
|
E: holgerar@gmail.com
|
||||||
D: Minor fix.
|
D: Minor fix.
|
||||||
|
|
||||||
|
N: Ruben Van Boxem
|
||||||
|
E: vanboxem dot ruben at gmail dot com
|
||||||
|
D: Initial Windows patches.
|
||||||
|
|
||||||
|
N: David Chisnall
|
||||||
|
E: theraven at theravensnest dot org
|
||||||
|
D: FreeBSD and Solaris ports, libcxxrt support, some atomics work.
|
||||||
|
|
||||||
|
N: Marshall Clow
|
||||||
|
E: mclow.lists@gmail.com
|
||||||
|
E: marshall@idio.com
|
||||||
|
D: Minor patches and bug fixes.
|
||||||
|
|
||||||
|
N: Google Inc.
|
||||||
|
D: Copyright owner and contributor of the CityHash algorithm
|
||||||
|
|
||||||
|
N: Howard Hinnant
|
||||||
|
E: hhinnant@apple.com
|
||||||
|
D: Architect and primary author of libc++
|
||||||
|
|
||||||
|
N: Hyeon-bin Jeong
|
||||||
|
E: tuhertz@gmail.com
|
||||||
|
D: Minor patches and bug fixes.
|
||||||
|
|
||||||
N: Argyrios Kyrtzidis
|
N: Argyrios Kyrtzidis
|
||||||
E: kyrtzidis@apple.com
|
E: kyrtzidis@apple.com
|
||||||
D: Bug fixes.
|
D: Bug fixes.
|
||||||
|
|
||||||
|
N: Bruce Mitchener, Jr.
|
||||||
|
E: bruce.mitchener@gmail.com
|
||||||
|
D: Emscripten-related changes.
|
||||||
|
|
||||||
|
N: Michel Morin
|
||||||
|
E: mimomorin@gmail.com
|
||||||
|
D: Minor patches to is_convertible.
|
||||||
|
|
||||||
|
N: Andrew Morrow
|
||||||
|
E: andrew.c.morrow@gmail.com
|
||||||
|
D: Minor patches and Linux fixes.
|
||||||
|
|
||||||
|
N: Arvid Picciani
|
||||||
|
E: aep at exys dot org
|
||||||
|
D: Minor patches and musl port.
|
||||||
|
|
||||||
|
N: Bjorn Reese
|
||||||
|
E: breese@users.sourceforge.net
|
||||||
|
D: Initial regex prototype
|
||||||
|
|
||||||
|
N: Jonathan Sauer
|
||||||
|
D: Minor patches, mostly related to constexpr
|
||||||
|
|
||||||
|
N: Craig Silverstein
|
||||||
|
E: csilvers@google.com
|
||||||
|
D: Implemented Cityhash as the string hash function on 64-bit machines
|
||||||
|
|
||||||
|
N: Richard Smith
|
||||||
|
D: Minor patches.
|
||||||
|
|
||||||
|
N: Joerg Sonnenberger
|
||||||
|
E: joerg@NetBSD.org
|
||||||
|
D: NetBSD port.
|
||||||
|
|
||||||
|
N: Stephan Tolksdorf
|
||||||
|
E: st@quanttec.com
|
||||||
|
D: Minor <atomic> fix
|
||||||
|
|
||||||
|
N: Michael van der Westhuizen
|
||||||
|
E: r1mikey at gmail dot com
|
||||||
|
|
||||||
|
N: Klaas de Vries
|
||||||
|
E: klaas at klaasgaaf dot nl
|
||||||
|
D: Minor bug fix.
|
||||||
|
|
||||||
|
N: Zhang Xiongpang
|
||||||
|
E: zhangxiongpang@gmail.com
|
||||||
|
D: Minor patches and bug fixes.
|
||||||
|
|
||||||
|
N: Jeffrey Yasskin
|
||||||
|
E: jyasskin@gmail.com
|
||||||
|
E: jyasskin@google.com
|
||||||
|
D: Linux fixes.
|
||||||
|
@@ -14,7 +14,7 @@ Full text of the relevant licenses is included below.
|
|||||||
University of Illinois/NCSA
|
University of Illinois/NCSA
|
||||||
Open Source License
|
Open Source License
|
||||||
|
|
||||||
Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT
|
Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT
|
Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
7
Makefile
7
Makefile
@@ -1,5 +1,5 @@
|
|||||||
##
|
##
|
||||||
# libcpp Makefile
|
# libc++ Makefile
|
||||||
##
|
##
|
||||||
|
|
||||||
SRCDIRS = .
|
SRCDIRS = .
|
||||||
@@ -33,9 +33,8 @@ clean::
|
|||||||
# The installheaders target is used by clang's runtime/libcxx makefile.
|
# The installheaders target is used by clang's runtime/libcxx makefile.
|
||||||
installheaders::
|
installheaders::
|
||||||
mkdir -p $(HEADER_DIR)/c++/v1/ext
|
mkdir -p $(HEADER_DIR)/c++/v1/ext
|
||||||
rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* \
|
(cd $(SRCDIRS)/include && tar cf - --exclude=support .) | \
|
||||||
$(HEADER_DIR)/c++/v1/
|
(cd $(HEADER_DIR)/c++/v1 && tar xf -)
|
||||||
chown -R root:wheel $(HEADER_DIR)/c++
|
|
||||||
chmod 755 $(HEADER_DIR)/c++/v1
|
chmod 755 $(HEADER_DIR)/c++/v1
|
||||||
chmod 644 $(HEADER_DIR)/c++/v1/*
|
chmod 644 $(HEADER_DIR)/c++/v1/*
|
||||||
chmod 755 $(HEADER_DIR)/c++/v1/ext
|
chmod 755 $(HEADER_DIR)/c++/v1/ext
|
||||||
|
@@ -81,6 +81,16 @@ class __bit_reference<_Cp, false>
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _Cp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY inline
|
||||||
|
void
|
||||||
|
swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT
|
||||||
|
{
|
||||||
|
bool __t = __x;
|
||||||
|
__x = __y;
|
||||||
|
__y = __t;
|
||||||
|
}
|
||||||
|
|
||||||
template <class _Cp, class _Dp>
|
template <class _Cp, class _Dp>
|
||||||
_LIBCPP_INLINE_VISIBILITY inline
|
_LIBCPP_INLINE_VISIBILITY inline
|
||||||
void
|
void
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#ifndef _LIBCPP_CONFIG
|
#ifndef _LIBCPP_CONFIG
|
||||||
#define _LIBCPP_CONFIG
|
#define _LIBCPP_CONFIG
|
||||||
|
|
||||||
#if !_MSC_VER // explicit macro necessary because it is only defined below in this file
|
#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -51,6 +51,9 @@
|
|||||||
# define _LIBCPP_LITTLE_ENDIAN 0
|
# define _LIBCPP_LITTLE_ENDIAN 0
|
||||||
# define _LIBCPP_BIG_ENDIAN 1
|
# define _LIBCPP_BIG_ENDIAN 1
|
||||||
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||||
|
# ifndef __LONG_LONG_SUPPORTED
|
||||||
|
# define _LIBCPP_HAS_NO_LONG_LONG
|
||||||
|
# endif // __LONG_LONG_SUPPORTED
|
||||||
#endif // __FreeBSD__
|
#endif // __FreeBSD__
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -63,6 +66,12 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
# if defined(__GNUC__) && _GNUC_VER >= 403
|
||||||
|
# define _LIBCP_HAS_IS_BASE_OF
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __sun__
|
#ifdef __sun__
|
||||||
# include <sys/isa_defs.h>
|
# include <sys/isa_defs.h>
|
||||||
# ifdef _LITTLE_ENDIAN
|
# ifdef _LITTLE_ENDIAN
|
||||||
@@ -87,24 +96,27 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||||
|
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
// only really useful for a DLL
|
// only really useful for a DLL
|
||||||
#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
|
#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
|
||||||
# ifdef cxx_EXPORTS
|
# ifdef cxx_EXPORTS
|
||||||
# define _LIBCPP_HIDDEN
|
# define _LIBCPP_HIDDEN
|
||||||
# define _LIBCPP_VISIBLE __declspec(dllexport)
|
# define _LIBCPP_FUNC_VIS __declspec(dllexport)
|
||||||
|
# define _LIBCPP_TYPE_VIS __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define _LIBCPP_HIDDEN
|
# define _LIBCPP_HIDDEN
|
||||||
# define _LIBCPP_VISIBLE __declspec(dllimport)
|
# define _LIBCPP_FUNC_VIS __declspec(dllimport)
|
||||||
|
# define _LIBCPP_TYPE_VIS __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# define _LIBCPP_HIDDEN
|
# define _LIBCPP_HIDDEN
|
||||||
# define _LIBCPP_VISIBLE
|
# define _LIBCPP_FUNC_VIS
|
||||||
|
# define _LIBCPP_TYPE_VIS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_INLINE_VISIBILITY
|
#ifndef _LIBCPP_INLINE_VISIBILITY
|
||||||
# if _MSC_VER
|
# ifdef _MSC_VER
|
||||||
# define _LIBCPP_INLINE_VISIBILITY __forceinline
|
# define _LIBCPP_INLINE_VISIBILITY __forceinline
|
||||||
# else // MinGW GCC and Clang
|
# else // MinGW GCC and Clang
|
||||||
# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
|
# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
|
||||||
@@ -112,23 +124,35 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_EXCEPTION_ABI
|
#ifndef _LIBCPP_EXCEPTION_ABI
|
||||||
#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE
|
#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_ALWAYS_INLINE
|
#ifndef _LIBCPP_ALWAYS_INLINE
|
||||||
# if _MSC_VER
|
# ifdef _MSC_VER
|
||||||
# define _LIBCPP_ALWAYS_INLINE __forceinline
|
# define _LIBCPP_ALWAYS_INLINE __forceinline
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
#ifndef __has_attribute
|
||||||
|
#define __has_attribute(__x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_HIDDEN
|
#ifndef _LIBCPP_HIDDEN
|
||||||
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
|
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_VISIBLE
|
#ifndef _LIBCPP_FUNC_VIS
|
||||||
#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default")))
|
#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_TYPE_VIS
|
||||||
|
# if __has_attribute(type_visibility)
|
||||||
|
# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
|
||||||
|
# else
|
||||||
|
# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_INLINE_VISIBILITY
|
#ifndef _LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -136,7 +160,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_EXCEPTION_ABI
|
#ifndef _LIBCPP_EXCEPTION_ABI
|
||||||
#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
|
#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_CANTTHROW
|
#ifndef _LIBCPP_CANTTHROW
|
||||||
@@ -192,7 +216,9 @@ typedef __char32_t char32_t;
|
|||||||
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
|
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !(__has_feature(cxx_defaulted_functions))
|
||||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
#endif // !(__has_feature(cxx_defaulted_functions))
|
||||||
|
|
||||||
#if !(__has_feature(cxx_deleted_functions))
|
#if !(__has_feature(cxx_deleted_functions))
|
||||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||||
@@ -252,7 +278,7 @@ typedef __char32_t char32_t;
|
|||||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
|
#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
|
||||||
#define _LIBCPP_HAS_QUICK_EXIT
|
#define _LIBCPP_HAS_QUICK_EXIT
|
||||||
#define _LIBCPP_HAS_C11_FEATURES
|
#define _LIBCPP_HAS_C11_FEATURES
|
||||||
#endif
|
#endif
|
||||||
@@ -398,8 +424,14 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#define _LIBCPP_CONSTEXPR constexpr
|
#define _LIBCPP_CONSTEXPR constexpr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
#define _LIBCPP_DEFAULT {}
|
||||||
|
#else
|
||||||
|
#define _LIBCPP_DEFAULT = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define _NOALIAS __attribute__((malloc))
|
#define _NOALIAS __attribute__((__malloc__))
|
||||||
#else
|
#else
|
||||||
#define _NOALIAS
|
#define _NOALIAS
|
||||||
#endif
|
#endif
|
||||||
@@ -415,7 +447,7 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx
|
#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
|
||||||
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
|
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
|
||||||
__lx __v_; \
|
__lx __v_; \
|
||||||
_LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
|
_LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
|
||||||
@@ -423,7 +455,7 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
|
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
|
||||||
};
|
};
|
||||||
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
|
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x
|
#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
|
||||||
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
|
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
|
||||||
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
|
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
|
|
||||||
@@ -431,18 +463,18 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
|
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__
|
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
|
||||||
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
|
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
|
||||||
#endif
|
#endif
|
||||||
#if __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#define _DECLARE_C99_LDBL_MATH 1
|
#define _DECLARE_C99_LDBL_MATH 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__ || __FreeBSD__
|
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||||
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__ || __FreeBSD__ || __sun__
|
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
|
||||||
#define _LIBCPP_WCTYPE_IS_MASK
|
#define _LIBCPP_WCTYPE_IS_MASK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -16,7 +16,9 @@
|
|||||||
# include <cstdlib>
|
# include <cstdlib>
|
||||||
# include <cstdio>
|
# include <cstdio>
|
||||||
# include <cstddef>
|
# include <cstddef>
|
||||||
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
|
# ifndef _LIBCPP_ASSERT
|
||||||
|
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
|
||||||
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -24,9 +26,9 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE __c_node;
|
struct _LIBCPP_TYPE_VIS __c_node;
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE __i_node
|
struct _LIBCPP_TYPE_VIS __i_node
|
||||||
{
|
{
|
||||||
void* __i_;
|
void* __i_;
|
||||||
__i_node* __next_;
|
__i_node* __next_;
|
||||||
@@ -40,7 +42,7 @@ struct _LIBCPP_VISIBLE __i_node
|
|||||||
~__i_node();
|
~__i_node();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE __c_node
|
struct _LIBCPP_TYPE_VIS __c_node
|
||||||
{
|
{
|
||||||
void* __c_;
|
void* __c_;
|
||||||
__c_node* __next_;
|
__c_node* __next_;
|
||||||
@@ -117,7 +119,7 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
|
|||||||
return _Cp->__subscriptable(__j, __n);
|
return _Cp->__subscriptable(__j, __n);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE __libcpp_db
|
class _LIBCPP_TYPE_VIS __libcpp_db
|
||||||
{
|
{
|
||||||
__c_node** __cbeg_;
|
__c_node** __cbeg_;
|
||||||
__c_node** __cend_;
|
__c_node** __cend_;
|
||||||
@@ -176,11 +178,11 @@ private:
|
|||||||
_LIBCPP_HIDDEN
|
_LIBCPP_HIDDEN
|
||||||
__i_node* __find_iterator(const void* __i) const;
|
__i_node* __find_iterator(const void* __i) const;
|
||||||
|
|
||||||
friend _LIBCPP_VISIBLE __libcpp_db* __get_db();
|
friend _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
|
||||||
};
|
};
|
||||||
|
|
||||||
_LIBCPP_VISIBLE __libcpp_db* __get_db();
|
_LIBCPP_FUNC_VIS __libcpp_db* __get_db();
|
||||||
_LIBCPP_VISIBLE const __libcpp_db* __get_const_db();
|
_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
|
||||||
|
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
@@ -203,7 +203,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
|
template<class _Fp> class _LIBCPP_TYPE_VIS function; // undefined
|
||||||
|
|
||||||
namespace __function
|
namespace __function
|
||||||
{
|
{
|
||||||
@@ -644,7 +644,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const
|
|||||||
} // __function
|
} // __function
|
||||||
|
|
||||||
template<class _Rp>
|
template<class _Rp>
|
||||||
class _LIBCPP_VISIBLE function<_Rp()>
|
class _LIBCPP_TYPE_VIS function<_Rp()>
|
||||||
{
|
{
|
||||||
typedef __function::__base<_Rp()> __base;
|
typedef __function::__base<_Rp()> __base;
|
||||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||||
@@ -928,7 +928,7 @@ function<_Rp()>::target() const
|
|||||||
#endif // _LIBCPP_NO_RTTI
|
#endif // _LIBCPP_NO_RTTI
|
||||||
|
|
||||||
template<class _Rp, class _A0>
|
template<class _Rp, class _A0>
|
||||||
class _LIBCPP_VISIBLE function<_Rp(_A0)>
|
class _LIBCPP_TYPE_VIS function<_Rp(_A0)>
|
||||||
: public unary_function<_A0, _Rp>
|
: public unary_function<_A0, _Rp>
|
||||||
{
|
{
|
||||||
typedef __function::__base<_Rp(_A0)> __base;
|
typedef __function::__base<_Rp(_A0)> __base;
|
||||||
@@ -1230,7 +1230,7 @@ function<_Rp(_A0)>::target() const
|
|||||||
#endif // _LIBCPP_NO_RTTI
|
#endif // _LIBCPP_NO_RTTI
|
||||||
|
|
||||||
template<class _Rp, class _A0, class _A1>
|
template<class _Rp, class _A0, class _A1>
|
||||||
class _LIBCPP_VISIBLE function<_Rp(_A0, _A1)>
|
class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1)>
|
||||||
: public binary_function<_A0, _A1, _Rp>
|
: public binary_function<_A0, _A1, _Rp>
|
||||||
{
|
{
|
||||||
typedef __function::__base<_Rp(_A0, _A1)> __base;
|
typedef __function::__base<_Rp(_A0, _A1)> __base;
|
||||||
@@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1)>::target() const
|
|||||||
#endif // _LIBCPP_NO_RTTI
|
#endif // _LIBCPP_NO_RTTI
|
||||||
|
|
||||||
template<class _Rp, class _A0, class _A1, class _A2>
|
template<class _Rp, class _A0, class _A1, class _A2>
|
||||||
class _LIBCPP_VISIBLE function<_Rp(_A0, _A1, _A2)>
|
class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1, _A2)>
|
||||||
{
|
{
|
||||||
typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
|
typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
|
||||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||||
@@ -1860,11 +1860,11 @@ swap(function<_Fp>& __x, function<_Fp>& __y)
|
|||||||
{return __x.swap(__y);}
|
{return __x.swap(__y);}
|
||||||
|
|
||||||
template<class _Tp> struct __is_bind_expression : public false_type {};
|
template<class _Tp> struct __is_bind_expression : public false_type {};
|
||||||
template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
|
template<class _Tp> struct _LIBCPP_TYPE_VIS is_bind_expression
|
||||||
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
||||||
|
|
||||||
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
||||||
template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
|
template<class _Tp> struct _LIBCPP_TYPE_VIS is_placeholder
|
||||||
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
||||||
|
|
||||||
namespace placeholders
|
namespace placeholders
|
||||||
|
@@ -23,21 +23,21 @@
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Arg, class _Result>
|
template <class _Arg, class _Result>
|
||||||
struct _LIBCPP_VISIBLE unary_function
|
struct _LIBCPP_TYPE_VIS unary_function
|
||||||
{
|
{
|
||||||
typedef _Arg argument_type;
|
typedef _Arg argument_type;
|
||||||
typedef _Result result_type;
|
typedef _Result result_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Arg1, class _Arg2, class _Result>
|
template <class _Arg1, class _Arg2, class _Result>
|
||||||
struct _LIBCPP_VISIBLE binary_function
|
struct _LIBCPP_TYPE_VIS binary_function
|
||||||
{
|
{
|
||||||
typedef _Arg1 first_argument_type;
|
typedef _Arg1 first_argument_type;
|
||||||
typedef _Arg2 second_argument_type;
|
typedef _Arg2 second_argument_type;
|
||||||
typedef _Result result_type;
|
typedef _Result result_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
template <class _Tp> struct _LIBCPP_TYPE_VIS hash;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct __has_result_type
|
struct __has_result_type
|
||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE less : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS less : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x < __y;}
|
{return __x < __y;}
|
||||||
@@ -348,7 +348,7 @@ struct __invoke_return
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE reference_wrapper
|
class _LIBCPP_TYPE_VIS reference_wrapper
|
||||||
: public __weak_result_type<_Tp>
|
: public __weak_result_type<_Tp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -996,7 +996,7 @@ struct __invoke_return2
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE reference_wrapper
|
class _LIBCPP_TYPE_VIS reference_wrapper
|
||||||
: public __weak_result_type<_Tp>
|
: public __weak_result_type<_Tp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_FUNC_VIS
|
||||||
size_t __next_prime(size_t __n);
|
size_t __next_prime(size_t __n);
|
||||||
|
|
||||||
template <class _NodePtr>
|
template <class _NodePtr>
|
||||||
@@ -80,14 +80,14 @@ __next_pow2(size_t __n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
|
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
|
||||||
template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_iterator;
|
template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS __hash_const_iterator;
|
||||||
template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_iterator;
|
template <class _HashIterator> class _LIBCPP_TYPE_VIS __hash_map_iterator;
|
||||||
template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
template <class _HashIterator> class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
class _LIBCPP_VISIBLE unordered_map;
|
class _LIBCPP_TYPE_VIS unordered_map;
|
||||||
|
|
||||||
template <class _NodePtr>
|
template <class _NodePtr>
|
||||||
class _LIBCPP_VISIBLE __hash_iterator
|
class _LIBCPP_TYPE_VIS __hash_iterator
|
||||||
{
|
{
|
||||||
typedef _NodePtr __node_pointer;
|
typedef _NodePtr __node_pointer;
|
||||||
|
|
||||||
@@ -142,14 +142,14 @@ private:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
template <class, class, class, class> friend class __hash_table;
|
template <class, class, class, class> friend class __hash_table;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_map_iterator;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _ConstNodePtr>
|
template <class _ConstNodePtr>
|
||||||
class _LIBCPP_VISIBLE __hash_const_iterator
|
class _LIBCPP_TYPE_VIS __hash_const_iterator
|
||||||
{
|
{
|
||||||
typedef _ConstNodePtr __node_pointer;
|
typedef _ConstNodePtr __node_pointer;
|
||||||
|
|
||||||
@@ -220,15 +220,15 @@ private:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
template <class, class, class, class> friend class __hash_table;
|
template <class, class, class, class> friend class __hash_table;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
|
||||||
|
|
||||||
template <class _NodePtr>
|
template <class _NodePtr>
|
||||||
class _LIBCPP_VISIBLE __hash_local_iterator
|
class _LIBCPP_TYPE_VIS __hash_local_iterator
|
||||||
{
|
{
|
||||||
typedef _NodePtr __node_pointer;
|
typedef _NodePtr __node_pointer;
|
||||||
|
|
||||||
@@ -294,12 +294,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class, class, class, class> friend class __hash_table;
|
template <class, class, class, class> friend class __hash_table;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_map_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _ConstNodePtr>
|
template <class _ConstNodePtr>
|
||||||
class _LIBCPP_VISIBLE __hash_const_local_iterator
|
class _LIBCPP_TYPE_VIS __hash_const_local_iterator
|
||||||
{
|
{
|
||||||
typedef _ConstNodePtr __node_pointer;
|
typedef _ConstNodePtr __node_pointer;
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class, class, class, class> friend class __hash_table;
|
template <class, class, class, class> friend class __hash_table;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
|
@@ -19,11 +19,11 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
# include <support/win32/locale_win32.h>
|
# include <support/win32/locale_win32.h>
|
||||||
#elif (__GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__)
|
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)) || defined(EMSCRIPTEN)
|
||||||
# include <xlocale.h>
|
# include <xlocale.h>
|
||||||
#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD_
|
#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || EMSCRIPTEN
|
||||||
|
|
||||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE locale;
|
class _LIBCPP_TYPE_VIS locale;
|
||||||
|
|
||||||
template <class _Facet>
|
template <class _Facet>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -43,12 +43,12 @@ _LIBCPP_INLINE_VISIBILITY
|
|||||||
const _Facet&
|
const _Facet&
|
||||||
use_facet(const locale&);
|
use_facet(const locale&);
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE locale
|
class _LIBCPP_TYPE_VIS locale
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
class _LIBCPP_VISIBLE facet;
|
class _LIBCPP_TYPE_VIS facet;
|
||||||
class _LIBCPP_VISIBLE id;
|
class _LIBCPP_TYPE_VIS id;
|
||||||
|
|
||||||
typedef int category;
|
typedef int category;
|
||||||
static const category // values assigned here are for exposition only
|
static const category // values assigned here are for exposition only
|
||||||
@@ -103,7 +103,7 @@ private:
|
|||||||
template <class _Facet> friend const _Facet& use_facet(const locale&);
|
template <class _Facet> friend const _Facet& use_facet(const locale&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE locale::facet
|
class _LIBCPP_TYPE_VIS locale::facet
|
||||||
: public __shared_count
|
: public __shared_count
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -119,7 +119,7 @@ private:
|
|||||||
virtual void __on_zero_shared() _NOEXCEPT;
|
virtual void __on_zero_shared() _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE locale::id
|
class _LIBCPP_TYPE_VIS locale::id
|
||||||
{
|
{
|
||||||
once_flag __flag_;
|
once_flag __flag_;
|
||||||
int32_t __id_;
|
int32_t __id_;
|
||||||
@@ -175,7 +175,7 @@ use_facet(const locale& __l)
|
|||||||
// template <class _CharT> class collate;
|
// template <class _CharT> class collate;
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
class _LIBCPP_VISIBLE collate
|
class _LIBCPP_TYPE_VIS collate
|
||||||
: public locale::facet
|
: public locale::facet
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -254,15 +254,15 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
|
|||||||
return static_cast<long>(__h);
|
return static_cast<long>(__h);
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate<char>)
|
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS collate<char>)
|
||||||
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS collate<wchar_t>)
|
||||||
|
|
||||||
// template <class CharT> class collate_byname;
|
// template <class CharT> class collate_byname;
|
||||||
|
|
||||||
template <class _CharT> class _LIBCPP_VISIBLE collate_byname;
|
template <class _CharT> class _LIBCPP_TYPE_VIS collate_byname;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE collate_byname<char>
|
class _LIBCPP_TYPE_VIS collate_byname<char>
|
||||||
: public collate<char>
|
: public collate<char>
|
||||||
{
|
{
|
||||||
locale_t __l;
|
locale_t __l;
|
||||||
@@ -281,7 +281,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE collate_byname<wchar_t>
|
class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
|
||||||
: public collate<wchar_t>
|
: public collate<wchar_t>
|
||||||
{
|
{
|
||||||
locale_t __l;
|
locale_t __l;
|
||||||
@@ -312,10 +312,10 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
|
|||||||
|
|
||||||
// template <class charT> class ctype
|
// template <class charT> class ctype
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE ctype_base
|
class _LIBCPP_TYPE_VIS ctype_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#if __GLIBC__
|
#ifdef __GLIBC__
|
||||||
typedef unsigned short mask;
|
typedef unsigned short mask;
|
||||||
static const mask space = _ISspace;
|
static const mask space = _ISspace;
|
||||||
static const mask print = _ISprint;
|
static const mask print = _ISprint;
|
||||||
@@ -327,7 +327,7 @@ public:
|
|||||||
static const mask punct = _ISpunct;
|
static const mask punct = _ISpunct;
|
||||||
static const mask xdigit = _ISxdigit;
|
static const mask xdigit = _ISxdigit;
|
||||||
static const mask blank = _ISblank;
|
static const mask blank = _ISblank;
|
||||||
#elif _WIN32
|
#elif defined(_WIN32)
|
||||||
typedef unsigned short mask;
|
typedef unsigned short mask;
|
||||||
static const mask space = _SPACE;
|
static const mask space = _SPACE;
|
||||||
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
|
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
|
||||||
@@ -339,11 +339,13 @@ public:
|
|||||||
static const mask punct = _PUNCT;
|
static const mask punct = _PUNCT;
|
||||||
static const mask xdigit = _HEX;
|
static const mask xdigit = _HEX;
|
||||||
static const mask blank = _BLANK;
|
static const mask blank = _BLANK;
|
||||||
#elif (__APPLE__ || __FreeBSD__)
|
#elif (defined(__APPLE__) || defined(__FreeBSD__)) || defined(EMSCRIPTEN)
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
typedef __uint32_t mask;
|
typedef __uint32_t mask;
|
||||||
#elif __FreeBSD__
|
#elif defined(__FreeBSD__)
|
||||||
typedef unsigned long mask;
|
typedef unsigned long mask;
|
||||||
|
#elif defined(EMSCRIPTEN)
|
||||||
|
typedef unsigned short mask;
|
||||||
#endif
|
#endif
|
||||||
static const mask space = _CTYPE_S;
|
static const mask space = _CTYPE_S;
|
||||||
static const mask print = _CTYPE_R;
|
static const mask print = _CTYPE_R;
|
||||||
@@ -355,7 +357,7 @@ public:
|
|||||||
static const mask punct = _CTYPE_P;
|
static const mask punct = _CTYPE_P;
|
||||||
static const mask xdigit = _CTYPE_X;
|
static const mask xdigit = _CTYPE_X;
|
||||||
static const mask blank = _CTYPE_B;
|
static const mask blank = _CTYPE_B;
|
||||||
#elif __sun__
|
#elif defined(__sun__)
|
||||||
typedef unsigned int mask;
|
typedef unsigned int mask;
|
||||||
static const mask space = _ISSPACE;
|
static const mask space = _ISSPACE;
|
||||||
static const mask print = _ISPRINT;
|
static const mask print = _ISPRINT;
|
||||||
@@ -367,7 +369,7 @@ public:
|
|||||||
static const mask punct = _ISPUNCT;
|
static const mask punct = _ISPUNCT;
|
||||||
static const mask xdigit = _ISXDIGIT;
|
static const mask xdigit = _ISXDIGIT;
|
||||||
static const mask blank = _ISBLANK;
|
static const mask blank = _ISBLANK;
|
||||||
#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __sun__
|
#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__
|
||||||
typedef unsigned long mask;
|
typedef unsigned long mask;
|
||||||
static const mask space = 1<<0;
|
static const mask space = 1<<0;
|
||||||
static const mask print = 1<<1;
|
static const mask print = 1<<1;
|
||||||
@@ -386,10 +388,10 @@ public:
|
|||||||
_LIBCPP_ALWAYS_INLINE ctype_base() {}
|
_LIBCPP_ALWAYS_INLINE ctype_base() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT> class _LIBCPP_VISIBLE ctype;
|
template <class _CharT> class _LIBCPP_TYPE_VIS ctype;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE ctype<wchar_t>
|
class _LIBCPP_TYPE_VIS ctype<wchar_t>
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public ctype_base
|
public ctype_base
|
||||||
{
|
{
|
||||||
@@ -491,7 +493,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE ctype<char>
|
class _LIBCPP_TYPE_VIS ctype<char>
|
||||||
: public locale::facet, public ctype_base
|
: public locale::facet, public ctype_base
|
||||||
{
|
{
|
||||||
const mask* __tab_;
|
const mask* __tab_;
|
||||||
@@ -590,7 +592,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
||||||
static const mask* classic_table() _NOEXCEPT;
|
static const mask* classic_table() _NOEXCEPT;
|
||||||
#if defined(__GLIBC__)
|
#if defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
static const int* __classic_upper_table() _NOEXCEPT;
|
static const int* __classic_upper_table() _NOEXCEPT;
|
||||||
static const int* __classic_lower_table() _NOEXCEPT;
|
static const int* __classic_lower_table() _NOEXCEPT;
|
||||||
#endif
|
#endif
|
||||||
@@ -609,10 +611,10 @@ protected:
|
|||||||
|
|
||||||
// template <class CharT> class ctype_byname;
|
// template <class CharT> class ctype_byname;
|
||||||
|
|
||||||
template <class _CharT> class _LIBCPP_VISIBLE ctype_byname;
|
template <class _CharT> class _LIBCPP_TYPE_VIS ctype_byname;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE ctype_byname<char>
|
class _LIBCPP_TYPE_VIS ctype_byname<char>
|
||||||
: public ctype<char>
|
: public ctype<char>
|
||||||
{
|
{
|
||||||
locale_t __l;
|
locale_t __l;
|
||||||
@@ -630,7 +632,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE ctype_byname<wchar_t>
|
class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
|
||||||
: public ctype<wchar_t>
|
: public ctype<wchar_t>
|
||||||
{
|
{
|
||||||
locale_t __l;
|
locale_t __l;
|
||||||
@@ -761,7 +763,7 @@ tolower(_CharT __c, const locale& __loc)
|
|||||||
|
|
||||||
// codecvt_base
|
// codecvt_base
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE codecvt_base
|
class _LIBCPP_TYPE_VIS codecvt_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_ALWAYS_INLINE codecvt_base() {}
|
_LIBCPP_ALWAYS_INLINE codecvt_base() {}
|
||||||
@@ -770,12 +772,12 @@ public:
|
|||||||
|
|
||||||
// template <class internT, class externT, class stateT> class codecvt;
|
// 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 _LIBCPP_TYPE_VIS codecvt;
|
||||||
|
|
||||||
// template <> class codecvt<char, char, mbstate_t>
|
// template <> class codecvt<char, char, mbstate_t>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE codecvt<char, char, mbstate_t>
|
class _LIBCPP_TYPE_VIS codecvt<char, char, mbstate_t>
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public codecvt_base
|
public codecvt_base
|
||||||
{
|
{
|
||||||
@@ -861,7 +863,7 @@ protected:
|
|||||||
// template <> class codecvt<wchar_t, char, mbstate_t>
|
// template <> class codecvt<wchar_t, char, mbstate_t>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE codecvt<wchar_t, char, mbstate_t>
|
class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public codecvt_base
|
public codecvt_base
|
||||||
{
|
{
|
||||||
@@ -944,7 +946,7 @@ protected:
|
|||||||
// template <> class codecvt<char16_t, char, mbstate_t>
|
// template <> class codecvt<char16_t, char, mbstate_t>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE codecvt<char16_t, char, mbstate_t>
|
class _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public codecvt_base
|
public codecvt_base
|
||||||
{
|
{
|
||||||
@@ -1030,7 +1032,7 @@ protected:
|
|||||||
// template <> class codecvt<char32_t, char, mbstate_t>
|
// template <> class codecvt<char32_t, char, mbstate_t>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE codecvt<char32_t, char, mbstate_t>
|
class _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public codecvt_base
|
public codecvt_base
|
||||||
{
|
{
|
||||||
@@ -1116,7 +1118,7 @@ protected:
|
|||||||
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
|
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
|
||||||
|
|
||||||
template <class _InternT, class _ExternT, class _StateT>
|
template <class _InternT, class _ExternT, class _StateT>
|
||||||
class _LIBCPP_VISIBLE codecvt_byname
|
class _LIBCPP_TYPE_VIS codecvt_byname
|
||||||
: public codecvt<_InternT, _ExternT, _StateT>
|
: public codecvt<_InternT, _ExternT, _StateT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1140,7 +1142,7 @@ _LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<wchar_t, char, mbstate_t>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char16_t, char, mbstate_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char16_t, char, mbstate_t>)
|
||||||
_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char32_t, char, mbstate_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char32_t, char, mbstate_t>)
|
||||||
|
|
||||||
_LIBCPP_VISIBLE void __throw_runtime_error(const char*);
|
_LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
|
||||||
|
|
||||||
template <size_t _Np>
|
template <size_t _Np>
|
||||||
struct __narrow_to_utf8
|
struct __narrow_to_utf8
|
||||||
@@ -1324,10 +1326,10 @@ struct __widen_from_utf8<32>
|
|||||||
|
|
||||||
// template <class charT> class numpunct
|
// template <class charT> class numpunct
|
||||||
|
|
||||||
template <class _CharT> class _LIBCPP_VISIBLE numpunct;
|
template <class _CharT> class _LIBCPP_TYPE_VIS numpunct;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE numpunct<char>
|
class _LIBCPP_TYPE_VIS numpunct<char>
|
||||||
: public locale::facet
|
: public locale::facet
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1358,7 +1360,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE numpunct<wchar_t>
|
class _LIBCPP_TYPE_VIS numpunct<wchar_t>
|
||||||
: public locale::facet
|
: public locale::facet
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1390,10 +1392,10 @@ protected:
|
|||||||
|
|
||||||
// template <class charT> class numpunct_byname
|
// template <class charT> class numpunct_byname
|
||||||
|
|
||||||
template <class charT> class _LIBCPP_VISIBLE numpunct_byname;
|
template <class charT> class _LIBCPP_TYPE_VIS numpunct_byname;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE numpunct_byname<char>
|
class _LIBCPP_TYPE_VIS numpunct_byname<char>
|
||||||
: public numpunct<char>
|
: public numpunct<char>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1411,7 +1413,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE numpunct_byname<wchar_t>
|
class _LIBCPP_TYPE_VIS numpunct_byname<wchar_t>
|
||||||
: public numpunct<wchar_t>
|
: public numpunct<wchar_t>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -32,7 +32,7 @@ template <class _Mutex> class upgrade_lock;
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE mutex
|
class _LIBCPP_TYPE_VIS mutex
|
||||||
{
|
{
|
||||||
pthread_mutex_t __m_;
|
pthread_mutex_t __m_;
|
||||||
|
|
||||||
@@ -58,9 +58,9 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
|
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE defer_lock_t {};
|
struct _LIBCPP_TYPE_VIS defer_lock_t {};
|
||||||
struct _LIBCPP_VISIBLE try_to_lock_t {};
|
struct _LIBCPP_TYPE_VIS try_to_lock_t {};
|
||||||
struct _LIBCPP_VISIBLE adopt_lock_t {};
|
struct _LIBCPP_TYPE_VIS adopt_lock_t {};
|
||||||
|
|
||||||
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
|
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class _Mutex>
|
template <class _Mutex>
|
||||||
class _LIBCPP_VISIBLE lock_guard
|
class _LIBCPP_TYPE_VIS lock_guard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Mutex mutex_type;
|
typedef _Mutex mutex_type;
|
||||||
@@ -101,7 +101,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Mutex>
|
template <class _Mutex>
|
||||||
class _LIBCPP_VISIBLE unique_lock
|
class _LIBCPP_TYPE_VIS unique_lock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Mutex mutex_type;
|
typedef _Mutex mutex_type;
|
||||||
@@ -285,7 +285,7 @@ void
|
|||||||
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
|
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
|
||||||
{__x.swap(__y);}
|
{__x.swap(__y);}
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE cv_status
|
struct _LIBCPP_TYPE_VIS cv_status
|
||||||
{
|
{
|
||||||
enum __lx {
|
enum __lx {
|
||||||
no_timeout,
|
no_timeout,
|
||||||
@@ -299,7 +299,7 @@ struct _LIBCPP_VISIBLE cv_status
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE condition_variable
|
class _LIBCPP_TYPE_VIS condition_variable
|
||||||
{
|
{
|
||||||
pthread_cond_t __cv_;
|
pthread_cond_t __cv_;
|
||||||
public:
|
public:
|
||||||
|
@@ -41,7 +41,7 @@ public:
|
|||||||
typedef typename traits_type::off_type off_type;
|
typedef typename traits_type::off_type off_type;
|
||||||
typedef typename traits_type::state_type state_type;
|
typedef typename traits_type::state_type state_type;
|
||||||
|
|
||||||
explicit __stdinbuf(FILE* __fp);
|
__stdinbuf(FILE* __fp, state_type* __st);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int_type underflow();
|
virtual int_type underflow();
|
||||||
@@ -53,7 +53,7 @@ private:
|
|||||||
|
|
||||||
FILE* __file_;
|
FILE* __file_;
|
||||||
const codecvt<char_type, char, state_type>* __cv_;
|
const codecvt<char_type, char, state_type>* __cv_;
|
||||||
state_type __st_;
|
state_type* __st_;
|
||||||
int __encoding_;
|
int __encoding_;
|
||||||
bool __always_noconv_;
|
bool __always_noconv_;
|
||||||
|
|
||||||
@@ -64,9 +64,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
__stdinbuf<_CharT>::__stdinbuf(FILE* __fp)
|
__stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
|
||||||
: __file_(__fp),
|
: __file_(__fp),
|
||||||
__st_()
|
__st_(__st)
|
||||||
{
|
{
|
||||||
imbue(this->getloc());
|
imbue(this->getloc());
|
||||||
}
|
}
|
||||||
@@ -119,15 +119,15 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
|
|||||||
codecvt_base::result __r;
|
codecvt_base::result __r;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
state_type __sv_st = __st_;
|
state_type __sv_st = *__st_;
|
||||||
__r = __cv_->in(__st_, __extbuf, __extbuf + __nread, __enxt,
|
__r = __cv_->in(*__st_, __extbuf, __extbuf + __nread, __enxt,
|
||||||
&__1buf, &__1buf + 1, __inxt);
|
&__1buf, &__1buf + 1, __inxt);
|
||||||
switch (__r)
|
switch (__r)
|
||||||
{
|
{
|
||||||
case _VSTD::codecvt_base::ok:
|
case _VSTD::codecvt_base::ok:
|
||||||
break;
|
break;
|
||||||
case codecvt_base::partial:
|
case codecvt_base::partial:
|
||||||
__st_ = __sv_st;
|
*__st_ = __sv_st;
|
||||||
if (__nread == sizeof(__extbuf))
|
if (__nread == sizeof(__extbuf))
|
||||||
return traits_type::eof();
|
return traits_type::eof();
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
|
|||||||
{
|
{
|
||||||
for (int __i = __nread; __i > 0;)
|
for (int __i = __nread; __i > 0;)
|
||||||
{
|
{
|
||||||
if (ungetc(__extbuf[--__i], __file_) == EOF)
|
if (ungetc(traits_type::to_int_type(__extbuf[--__i]), __file_) == EOF)
|
||||||
return traits_type::eof();
|
return traits_type::eof();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
|
|||||||
char* __enxt;
|
char* __enxt;
|
||||||
const char_type __ci = traits_type::to_char_type(__c);
|
const char_type __ci = traits_type::to_char_type(__c);
|
||||||
const char_type* __inxt;
|
const char_type* __inxt;
|
||||||
switch (__cv_->out(__st_, &__ci, &__ci + 1, __inxt,
|
switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
|
||||||
__extbuf, __extbuf + sizeof(__extbuf), __enxt))
|
__extbuf, __extbuf + sizeof(__extbuf), __enxt))
|
||||||
{
|
{
|
||||||
case _VSTD::codecvt_base::ok:
|
case _VSTD::codecvt_base::ok:
|
||||||
@@ -200,7 +200,7 @@ public:
|
|||||||
typedef typename traits_type::off_type off_type;
|
typedef typename traits_type::off_type off_type;
|
||||||
typedef typename traits_type::state_type state_type;
|
typedef typename traits_type::state_type state_type;
|
||||||
|
|
||||||
explicit __stdoutbuf(FILE* __fp);
|
__stdoutbuf(FILE* __fp, state_type* __st);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int_type overflow (int_type __c = traits_type::eof());
|
virtual int_type overflow (int_type __c = traits_type::eof());
|
||||||
@@ -210,7 +210,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
FILE* __file_;
|
FILE* __file_;
|
||||||
const codecvt<char_type, char, state_type>* __cv_;
|
const codecvt<char_type, char, state_type>* __cv_;
|
||||||
state_type __st_;
|
state_type* __st_;
|
||||||
bool __always_noconv_;
|
bool __always_noconv_;
|
||||||
|
|
||||||
__stdoutbuf(const __stdoutbuf&);
|
__stdoutbuf(const __stdoutbuf&);
|
||||||
@@ -218,10 +218,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
__stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp)
|
__stdoutbuf<_CharT>::__stdoutbuf(FILE* __fp, state_type* __st)
|
||||||
: __file_(__fp),
|
: __file_(__fp),
|
||||||
__cv_(&use_facet<codecvt<char_type, char, state_type> >(this->getloc())),
|
__cv_(&use_facet<codecvt<char_type, char, state_type> >(this->getloc())),
|
||||||
__st_(),
|
__st_(__st),
|
||||||
__always_noconv_(__cv_->always_noconv())
|
__always_noconv_(__cv_->always_noconv())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -249,7 +249,7 @@ __stdoutbuf<_CharT>::overflow(int_type __c)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
const char_type* __e;
|
const char_type* __e;
|
||||||
__r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,
|
__r = __cv_->out(*__st_, this->pbase(), this->pptr(), __e,
|
||||||
__extbuf,
|
__extbuf,
|
||||||
__extbuf + sizeof(__extbuf),
|
__extbuf + sizeof(__extbuf),
|
||||||
__extbe);
|
__extbe);
|
||||||
@@ -289,7 +289,7 @@ __stdoutbuf<_CharT>::sync()
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
char* __extbe;
|
char* __extbe;
|
||||||
__r = __cv_->unshift(__st_, __extbuf,
|
__r = __cv_->unshift(*__st_, __extbuf,
|
||||||
__extbuf + sizeof(__extbuf),
|
__extbuf + sizeof(__extbuf),
|
||||||
__extbe);
|
__extbe);
|
||||||
size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
|
size_t __nmemb = static_cast<size_t>(__extbe - __extbuf);
|
||||||
|
@@ -25,17 +25,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
template <class _Tp, class _Compare, class _Allocator> class __tree;
|
template <class _Tp, class _Compare, class _Allocator> class __tree;
|
||||||
template <class _Tp, class _NodePtr, class _DiffType>
|
template <class _Tp, class _NodePtr, class _DiffType>
|
||||||
class _LIBCPP_VISIBLE __tree_iterator;
|
class _LIBCPP_TYPE_VIS __tree_iterator;
|
||||||
template <class _Tp, class _ConstNodePtr, class _DiffType>
|
template <class _Tp, class _ConstNodePtr, class _DiffType>
|
||||||
class _LIBCPP_VISIBLE __tree_const_iterator;
|
class _LIBCPP_TYPE_VIS __tree_const_iterator;
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE map;
|
class _LIBCPP_TYPE_VIS map;
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE multimap;
|
class _LIBCPP_TYPE_VIS multimap;
|
||||||
template <class _Key, class _Compare, class _Allocator>
|
template <class _Key, class _Compare, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE set;
|
class _LIBCPP_TYPE_VIS set;
|
||||||
template <class _Key, class _Compare, class _Allocator>
|
template <class _Key, class _Compare, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE multiset;
|
class _LIBCPP_TYPE_VIS multiset;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@@ -614,11 +614,11 @@ public:
|
|||||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _TreeIterator> class _LIBCPP_VISIBLE __map_iterator;
|
template <class _TreeIterator> class _LIBCPP_TYPE_VIS __map_iterator;
|
||||||
template <class _TreeIterator> class _LIBCPP_VISIBLE __map_const_iterator;
|
template <class _TreeIterator> class _LIBCPP_TYPE_VIS __map_const_iterator;
|
||||||
|
|
||||||
template <class _Tp, class _NodePtr, class _DiffType>
|
template <class _Tp, class _NodePtr, class _DiffType>
|
||||||
class _LIBCPP_VISIBLE __tree_iterator
|
class _LIBCPP_TYPE_VIS __tree_iterator
|
||||||
{
|
{
|
||||||
typedef _NodePtr __node_pointer;
|
typedef _NodePtr __node_pointer;
|
||||||
typedef typename pointer_traits<__node_pointer>::element_type __node;
|
typedef typename pointer_traits<__node_pointer>::element_type __node;
|
||||||
@@ -673,16 +673,16 @@ private:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||||
template <class, class, class> friend class __tree;
|
template <class, class, class> friend class __tree;
|
||||||
template <class, class, class> friend class _LIBCPP_VISIBLE __tree_const_iterator;
|
template <class, class, class> friend class _LIBCPP_TYPE_VIS __tree_const_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __map_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __map_iterator;
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
|
||||||
template <class, class, class> friend class _LIBCPP_VISIBLE set;
|
template <class, class, class> friend class _LIBCPP_TYPE_VIS set;
|
||||||
template <class, class, class> friend class _LIBCPP_VISIBLE multiset;
|
template <class, class, class> friend class _LIBCPP_TYPE_VIS multiset;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _ConstNodePtr, class _DiffType>
|
template <class _Tp, class _ConstNodePtr, class _DiffType>
|
||||||
class _LIBCPP_VISIBLE __tree_const_iterator
|
class _LIBCPP_TYPE_VIS __tree_const_iterator
|
||||||
{
|
{
|
||||||
typedef _ConstNodePtr __node_pointer;
|
typedef _ConstNodePtr __node_pointer;
|
||||||
typedef typename pointer_traits<__node_pointer>::element_type __node;
|
typedef typename pointer_traits<__node_pointer>::element_type __node;
|
||||||
@@ -759,11 +759,11 @@ private:
|
|||||||
explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
|
explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
|
||||||
: __ptr_(__p) {}
|
: __ptr_(__p) {}
|
||||||
template <class, class, class> friend class __tree;
|
template <class, class, class> friend class __tree;
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
|
||||||
template <class, class, class> friend class _LIBCPP_VISIBLE set;
|
template <class, class, class> friend class _LIBCPP_TYPE_VIS set;
|
||||||
template <class, class, class> friend class _LIBCPP_VISIBLE multiset;
|
template <class, class, class> friend class _LIBCPP_TYPE_VIS multiset;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __map_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __map_const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Compare, class _Allocator>
|
template <class _Tp, class _Compare, class _Allocator>
|
||||||
|
@@ -27,46 +27,46 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
|
template <class _Tp> class _LIBCPP_TYPE_VIS tuple_size;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_size<const _Tp>
|
class _LIBCPP_TYPE_VIS tuple_size<const _Tp>
|
||||||
: public tuple_size<_Tp> {};
|
: public tuple_size<_Tp> {};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_size<volatile _Tp>
|
class _LIBCPP_TYPE_VIS tuple_size<volatile _Tp>
|
||||||
: public tuple_size<_Tp> {};
|
: public tuple_size<_Tp> {};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_size<const volatile _Tp>
|
class _LIBCPP_TYPE_VIS tuple_size<const volatile _Tp>
|
||||||
: public tuple_size<_Tp> {};
|
: public tuple_size<_Tp> {};
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
|
template <size_t _Ip, class _Tp> class _LIBCPP_TYPE_VIS tuple_element;
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp>
|
template <size_t _Ip, class _Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const _Tp>
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, const _Tp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
|
typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp>
|
template <size_t _Ip, class _Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, volatile _Tp>
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, volatile _Tp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
|
typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp>
|
template <size_t _Ip, class _Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const volatile _Tp>
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, const volatile _Tp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
|
typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class ..._Tp> class _LIBCPP_VISIBLE tuple;
|
template <class ..._Tp> class _LIBCPP_TYPE_VIS tuple;
|
||||||
template <class _T1, class _T2> struct _LIBCPP_VISIBLE pair;
|
template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS pair;
|
||||||
template <class _Tp, size_t _Size> struct _LIBCPP_VISIBLE array;
|
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS array;
|
||||||
|
|
||||||
template <class _Tp> struct __tuple_like : false_type {};
|
template <class _Tp> struct __tuple_like : false_type {};
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ struct __make_tuple_indices
|
|||||||
template <class ..._Tp> struct __tuple_types {};
|
template <class ..._Tp> struct __tuple_types {};
|
||||||
|
|
||||||
template <size_t _Ip>
|
template <size_t _Ip>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<> >
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, __tuple_types<> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static_assert(_Ip == 0, "tuple_element index out of range");
|
static_assert(_Ip == 0, "tuple_element index out of range");
|
||||||
@@ -162,21 +162,21 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Hp, class ..._Tp>
|
template <class _Hp, class ..._Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_element<0, __tuple_types<_Hp, _Tp...> >
|
class _LIBCPP_TYPE_VIS tuple_element<0, __tuple_types<_Hp, _Tp...> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Hp type;
|
typedef _Hp type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t _Ip, class _Hp, class ..._Tp>
|
template <size_t _Ip, class _Hp, class ..._Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, __tuple_types<_Hp, _Tp...> >
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, __tuple_types<_Hp, _Tp...> >
|
||||||
{
|
{
|
||||||
public:
|
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>
|
template <class ..._Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_size<__tuple_types<_Tp...> >
|
class _LIBCPP_TYPE_VIS tuple_size<__tuple_types<_Tp...> >
|
||||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE tuple_size;
|
template <class _Tp> class _LIBCPP_TYPE_VIS tuple_size;
|
||||||
template <size_t _Ip, class _Tp> class _LIBCPP_VISIBLE tuple_element;
|
template <size_t _Ip, class _Tp> class _LIBCPP_TYPE_VIS tuple_element;
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
|
||||||
|
@@ -1398,7 +1398,7 @@ __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
|
|||||||
// Find first element in sequence that matchs __value_, with a mininum of loop checks
|
// Find first element in sequence that matchs __value_, with a mininum of loop checks
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (__first == __s) // return __last if no element matches __value_
|
if (__first >= __s) // return __last if no element matches __value_
|
||||||
return __last;
|
return __last;
|
||||||
if (__pred(*__first, __value_))
|
if (__pred(*__first, __value_))
|
||||||
break;
|
break;
|
||||||
@@ -1528,10 +1528,10 @@ copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
|
|||||||
|
|
||||||
// copy_backward
|
// copy_backward
|
||||||
|
|
||||||
template <class _InputIterator, class _OutputIterator>
|
template <class _BidirectionalIterator, class _OutputIterator>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
_OutputIterator
|
_OutputIterator
|
||||||
__copy_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
|
__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
|
||||||
{
|
{
|
||||||
while (__first != __last)
|
while (__first != __last)
|
||||||
*--__result = *--__last;
|
*--__result = *--__last;
|
||||||
@@ -2764,7 +2764,7 @@ class __rs_default
|
|||||||
|
|
||||||
__rs_default();
|
__rs_default();
|
||||||
public:
|
public:
|
||||||
typedef unsigned result_type;
|
typedef uint_fast32_t result_type;
|
||||||
|
|
||||||
static const result_type _Min = 0;
|
static const result_type _Min = 0;
|
||||||
static const result_type _Max = 0xFFFFFFFF;
|
static const result_type _Max = 0xFFFFFFFF;
|
||||||
|
@@ -118,7 +118,7 @@ template <int I, class T, size_t N> T&& get(array<T, N>&&) noexcept;
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp, size_t _Size>
|
template <class _Tp, size_t _Size>
|
||||||
struct _LIBCPP_VISIBLE array
|
struct _LIBCPP_TYPE_VIS array
|
||||||
{
|
{
|
||||||
// types:
|
// types:
|
||||||
typedef array __self;
|
typedef array __self;
|
||||||
@@ -284,22 +284,22 @@ swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, size_t _Size>
|
template <class _Tp, size_t _Size>
|
||||||
class _LIBCPP_VISIBLE tuple_size<array<_Tp, _Size> >
|
class _LIBCPP_TYPE_VIS tuple_size<array<_Tp, _Size> >
|
||||||
: public integral_constant<size_t, _Size> {};
|
: public integral_constant<size_t, _Size> {};
|
||||||
|
|
||||||
template <class _Tp, size_t _Size>
|
template <class _Tp, size_t _Size>
|
||||||
class _LIBCPP_VISIBLE tuple_size<const array<_Tp, _Size> >
|
class _LIBCPP_TYPE_VIS tuple_size<const array<_Tp, _Size> >
|
||||||
: public integral_constant<size_t, _Size> {};
|
: public integral_constant<size_t, _Size> {};
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp, size_t _Size>
|
template <size_t _Ip, class _Tp, size_t _Size>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, array<_Tp, _Size> >
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, array<_Tp, _Size> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp type;
|
typedef _Tp type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp, size_t _Size>
|
template <size_t _Ip, class _Tp, size_t _Size>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, const array<_Tp, _Size> >
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, const array<_Tp, _Size> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef const _Tp type;
|
typedef const _Tp type;
|
||||||
@@ -310,6 +310,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
|||||||
_Tp&
|
_Tp&
|
||||||
get(array<_Tp, _Size>& __a) _NOEXCEPT
|
get(array<_Tp, _Size>& __a) _NOEXCEPT
|
||||||
{
|
{
|
||||||
|
static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)");
|
||||||
return __a[_Ip];
|
return __a[_Ip];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,6 +319,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
|||||||
const _Tp&
|
const _Tp&
|
||||||
get(const array<_Tp, _Size>& __a) _NOEXCEPT
|
get(const array<_Tp, _Size>& __a) _NOEXCEPT
|
||||||
{
|
{
|
||||||
|
static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)");
|
||||||
return __a[_Ip];
|
return __a[_Ip];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,6 +330,7 @@ _LIBCPP_INLINE_VISIBILITY inline
|
|||||||
_Tp&&
|
_Tp&&
|
||||||
get(array<_Tp, _Size>&& __a) _NOEXCEPT
|
get(array<_Tp, _Size>&& __a) _NOEXCEPT
|
||||||
{
|
{
|
||||||
|
static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)");
|
||||||
return _VSTD::move(__a[_Ip]);
|
return _VSTD::move(__a[_Ip]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ template <class T> T kill_dependency(T y) noexcept;
|
|||||||
|
|
||||||
// lock-free property
|
// lock-free property
|
||||||
|
|
||||||
|
#define ATOMIC_BOOL_LOCK_FREE unspecified
|
||||||
#define ATOMIC_CHAR_LOCK_FREE unspecified
|
#define ATOMIC_CHAR_LOCK_FREE unspecified
|
||||||
#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
|
#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
|
||||||
#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
|
#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
|
||||||
@@ -41,6 +42,7 @@ template <class T> T kill_dependency(T y) noexcept;
|
|||||||
#define ATOMIC_INT_LOCK_FREE unspecified
|
#define ATOMIC_INT_LOCK_FREE unspecified
|
||||||
#define ATOMIC_LONG_LOCK_FREE unspecified
|
#define ATOMIC_LONG_LOCK_FREE unspecified
|
||||||
#define ATOMIC_LLONG_LOCK_FREE unspecified
|
#define ATOMIC_LLONG_LOCK_FREE unspecified
|
||||||
|
#define ATOMIC_POINTER_LOCK_FREE unspecified
|
||||||
|
|
||||||
// flag type and operations
|
// flag type and operations
|
||||||
|
|
||||||
@@ -472,6 +474,7 @@ template <class T>
|
|||||||
|
|
||||||
// Atomics for standard typedef types
|
// Atomics for standard typedef types
|
||||||
|
|
||||||
|
typedef atomic<bool> atomic_bool;
|
||||||
typedef atomic<char> atomic_char;
|
typedef atomic<char> atomic_char;
|
||||||
typedef atomic<signed char> atomic_schar;
|
typedef atomic<signed char> atomic_schar;
|
||||||
typedef atomic<unsigned char> atomic_uchar;
|
typedef atomic<unsigned char> atomic_uchar;
|
||||||
@@ -619,7 +622,12 @@ struct __atomic_base // false
|
|||||||
{return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
|
{return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__atomic_base() _NOEXCEPT {} // = default;
|
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
__atomic_base() _NOEXCEPT = default;
|
||||||
|
#else
|
||||||
|
__atomic_base() _NOEXCEPT : __a_() {}
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
|
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
|
||||||
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||||
@@ -642,7 +650,7 @@ struct __atomic_base<_Tp, true>
|
|||||||
{
|
{
|
||||||
typedef __atomic_base<_Tp, false> __base;
|
typedef __atomic_base<_Tp, false> __base;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__atomic_base() _NOEXCEPT {} // = default;
|
__atomic_base() _NOEXCEPT _LIBCPP_DEFAULT
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
|
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
|
||||||
|
|
||||||
@@ -723,7 +731,7 @@ struct atomic
|
|||||||
{
|
{
|
||||||
typedef __atomic_base<_Tp> __base;
|
typedef __atomic_base<_Tp> __base;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
atomic() _NOEXCEPT {} // = default;
|
atomic() _NOEXCEPT _LIBCPP_DEFAULT
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
|
_LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
|
||||||
|
|
||||||
@@ -743,7 +751,7 @@ struct atomic<_Tp*>
|
|||||||
{
|
{
|
||||||
typedef __atomic_base<_Tp*> __base;
|
typedef __atomic_base<_Tp*> __base;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
atomic() _NOEXCEPT {} // = default;
|
atomic() _NOEXCEPT _LIBCPP_DEFAULT
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
|
_LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
|
||||||
|
|
||||||
@@ -1364,7 +1372,12 @@ typedef struct atomic_flag
|
|||||||
{__c11_atomic_store(&__a_, false, __m);}
|
{__c11_atomic_store(&__a_, false, __m);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
atomic_flag() _NOEXCEPT {} // = default;
|
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
atomic_flag() _NOEXCEPT = default;
|
||||||
|
#else
|
||||||
|
atomic_flag() _NOEXCEPT : __a_() {}
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {}
|
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {}
|
||||||
|
|
||||||
@@ -1454,6 +1467,7 @@ atomic_signal_fence(memory_order __m) _NOEXCEPT
|
|||||||
|
|
||||||
// Atomics for standard typedef types
|
// Atomics for standard typedef types
|
||||||
|
|
||||||
|
typedef atomic<bool> atomic_bool;
|
||||||
typedef atomic<char> atomic_char;
|
typedef atomic<char> atomic_char;
|
||||||
typedef atomic<signed char> atomic_schar;
|
typedef atomic<signed char> atomic_schar;
|
||||||
typedef atomic<unsigned char> atomic_uchar;
|
typedef atomic<unsigned char> atomic_uchar;
|
||||||
@@ -1499,14 +1513,16 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
|
|||||||
|
|
||||||
// lock-free property
|
// lock-free property
|
||||||
|
|
||||||
#define ATOMIC_CHAR_LOCK_FREE 0
|
#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
|
||||||
#define ATOMIC_CHAR16_T_LOCK_FREE 0
|
#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
|
||||||
#define ATOMIC_CHAR32_T_LOCK_FREE 0
|
#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
|
||||||
#define ATOMIC_WCHAR_T_LOCK_FREE 0
|
#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
|
||||||
#define ATOMIC_SHORT_LOCK_FREE 0
|
#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
|
||||||
#define ATOMIC_INT_LOCK_FREE 0
|
#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
|
||||||
#define ATOMIC_LONG_LOCK_FREE 0
|
#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
|
||||||
#define ATOMIC_LLONG_LOCK_FREE 0
|
#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
|
||||||
|
#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
|
||||||
|
#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
|
||||||
|
|
||||||
#endif // !__has_feature(cxx_atomic)
|
#endif // !__has_feature(cxx_atomic)
|
||||||
|
|
||||||
|
@@ -249,7 +249,13 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||||||
_LIBCPP_CONSTEXPR
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||||
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
#if __SIZE_WIDTH__ == 64
|
||||||
: __first_{__v}
|
: __first_{__v}
|
||||||
|
#elif __SIZE_WIDTH__ == 32
|
||||||
|
: __first_{__v, __v >> __bits_per_word}
|
||||||
|
#else
|
||||||
|
#error This constructor has not been ported to this platform
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
@@ -626,13 +632,14 @@ __bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t _Size> class _LIBCPP_VISIBLE bitset;
|
template <size_t _Size> class _LIBCPP_TYPE_VIS bitset;
|
||||||
template <size_t _Size> struct hash<bitset<_Size> >;
|
template <size_t _Size> struct _LIBCPP_TYPE_VIS hash<bitset<_Size> >;
|
||||||
|
|
||||||
template <size_t _Size>
|
template <size_t _Size>
|
||||||
class _LIBCPP_VISIBLE bitset
|
class _LIBCPP_TYPE_VIS bitset
|
||||||
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
|
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1;
|
static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1;
|
||||||
typedef __bitset<__n_words, _Size> base;
|
typedef __bitset<__n_words, _Size> base;
|
||||||
|
|
||||||
@@ -1053,7 +1060,7 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <size_t _Size>
|
template <size_t _Size>
|
||||||
struct _LIBCPP_VISIBLE hash<bitset<_Size> >
|
struct _LIBCPP_TYPE_VIS hash<bitset<_Size> >
|
||||||
: public unary_function<bitset<_Size>, size_t>
|
: public unary_function<bitset<_Size>, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@@ -279,7 +279,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
namespace chrono
|
namespace chrono
|
||||||
{
|
{
|
||||||
|
|
||||||
template <class _Rep, class _Period = ratio<1> > class _LIBCPP_VISIBLE duration;
|
template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TYPE_VIS duration;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct __is_duration : false_type {};
|
struct __is_duration : false_type {};
|
||||||
@@ -299,7 +299,7 @@ struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
|
|||||||
} // chrono
|
} // chrono
|
||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
struct _LIBCPP_VISIBLE common_type<chrono::duration<_Rep1, _Period1>,
|
struct _LIBCPP_TYPE_VIS common_type<chrono::duration<_Rep1, _Period1>,
|
||||||
chrono::duration<_Rep2, _Period2> >
|
chrono::duration<_Rep2, _Period2> >
|
||||||
{
|
{
|
||||||
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
|
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
|
||||||
@@ -377,10 +377,10 @@ duration_cast(const duration<_Rep, _Period>& __fd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rep>
|
template <class _Rep>
|
||||||
struct _LIBCPP_VISIBLE treat_as_floating_point : is_floating_point<_Rep> {};
|
struct _LIBCPP_TYPE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
|
||||||
|
|
||||||
template <class _Rep>
|
template <class _Rep>
|
||||||
struct _LIBCPP_VISIBLE duration_values
|
struct _LIBCPP_TYPE_VIS duration_values
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() {return _Rep(0);}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() {return _Rep(0);}
|
||||||
@@ -391,7 +391,7 @@ public:
|
|||||||
// duration
|
// duration
|
||||||
|
|
||||||
template <class _Rep, class _Period>
|
template <class _Rep, class _Period>
|
||||||
class _LIBCPP_VISIBLE duration
|
class _LIBCPP_TYPE_VIS duration
|
||||||
{
|
{
|
||||||
static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a 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");
|
static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
|
||||||
@@ -696,7 +696,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
|||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
template <class _Clock, class _Duration = typename _Clock::duration>
|
template <class _Clock, class _Duration = typename _Clock::duration>
|
||||||
class _LIBCPP_VISIBLE time_point
|
class _LIBCPP_TYPE_VIS time_point
|
||||||
{
|
{
|
||||||
static_assert(__is_duration<_Duration>::value,
|
static_assert(__is_duration<_Duration>::value,
|
||||||
"Second template parameter of time_point must be a std::chrono::duration");
|
"Second template parameter of time_point must be a std::chrono::duration");
|
||||||
@@ -740,7 +740,7 @@ public:
|
|||||||
} // chrono
|
} // chrono
|
||||||
|
|
||||||
template <class _Clock, class _Duration1, class _Duration2>
|
template <class _Clock, class _Duration1, class _Duration2>
|
||||||
struct _LIBCPP_VISIBLE common_type<chrono::time_point<_Clock, _Duration1>,
|
struct _LIBCPP_TYPE_VIS common_type<chrono::time_point<_Clock, _Duration1>,
|
||||||
chrono::time_point<_Clock, _Duration2> >
|
chrono::time_point<_Clock, _Duration2> >
|
||||||
{
|
{
|
||||||
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
|
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
|
||||||
@@ -863,7 +863,7 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
|
|||||||
/////////////////////// clocks ///////////////////////////
|
/////////////////////// clocks ///////////////////////////
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE system_clock
|
class _LIBCPP_TYPE_VIS system_clock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef microseconds duration;
|
typedef microseconds duration;
|
||||||
@@ -877,7 +877,7 @@ public:
|
|||||||
static time_point from_time_t(time_t __t) _NOEXCEPT;
|
static time_point from_time_t(time_t __t) _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE steady_clock
|
class _LIBCPP_TYPE_VIS steady_clock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef nanoseconds duration;
|
typedef nanoseconds duration;
|
||||||
|
@@ -137,21 +137,21 @@ long double tanhl(long double x);
|
|||||||
|
|
||||||
// C99
|
// C99
|
||||||
|
|
||||||
bool signbit(floating_point x);
|
bool signbit(arithmetic x);
|
||||||
|
|
||||||
int fpclassify(floating_point x);
|
int fpclassify(arithmetic x);
|
||||||
|
|
||||||
bool isfinite(floating_point x);
|
bool isfinite(arithmetic x);
|
||||||
bool isinf(floating_point x);
|
bool isinf(arithmetic x);
|
||||||
bool isnan(floating_point x);
|
bool isnan(arithmetic x);
|
||||||
bool isnormal(floating_point x);
|
bool isnormal(arithmetic x);
|
||||||
|
|
||||||
bool isgreater(floating_point x, floating_point y);
|
bool isgreater(arithmetic x, arithmetic y);
|
||||||
bool isgreaterequal(floating_point x, floating_point y);
|
bool isgreaterequal(arithmetic x, arithmetic y);
|
||||||
bool isless(floating_point x, floating_point y);
|
bool isless(arithmetic x, arithmetic y);
|
||||||
bool islessequal(floating_point x, floating_point y);
|
bool islessequal(arithmetic x, arithmetic y);
|
||||||
bool islessgreater(floating_point x, floating_point y);
|
bool islessgreater(arithmetic x, arithmetic y);
|
||||||
bool isunordered(floating_point x, floating_point y);
|
bool isunordered(arithmetic x, arithmetic y);
|
||||||
|
|
||||||
floating_point acosh (arithmetic x);
|
floating_point acosh (arithmetic x);
|
||||||
float acoshf(float x);
|
float acoshf(float x);
|
||||||
@@ -325,10 +325,10 @@ __libcpp_signbit(_A1 __x) _NOEXCEPT
|
|||||||
|
|
||||||
template <class _A1>
|
template <class _A1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
|
||||||
signbit(_A1 __x) _NOEXCEPT
|
signbit(_A1 __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_signbit(__x);
|
return __libcpp_signbit((typename std::__promote<_A1>::type)__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // signbit
|
#endif // signbit
|
||||||
@@ -349,10 +349,10 @@ __libcpp_fpclassify(_A1 __x) _NOEXCEPT
|
|||||||
|
|
||||||
template <class _A1>
|
template <class _A1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
|
typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
|
||||||
fpclassify(_A1 __x) _NOEXCEPT
|
fpclassify(_A1 __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_fpclassify(__x);
|
return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // fpclassify
|
#endif // fpclassify
|
||||||
@@ -373,10 +373,10 @@ __libcpp_isfinite(_A1 __x) _NOEXCEPT
|
|||||||
|
|
||||||
template <class _A1>
|
template <class _A1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
|
||||||
isfinite(_A1 __x) _NOEXCEPT
|
isfinite(_A1 __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isfinite(__x);
|
return __libcpp_isfinite((typename std::__promote<_A1>::type)__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isfinite
|
#endif // isfinite
|
||||||
@@ -397,10 +397,10 @@ __libcpp_isinf(_A1 __x) _NOEXCEPT
|
|||||||
|
|
||||||
template <class _A1>
|
template <class _A1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
|
||||||
isinf(_A1 __x) _NOEXCEPT
|
isinf(_A1 __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isinf(__x);
|
return __libcpp_isinf((typename std::__promote<_A1>::type)__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isinf
|
#endif // isinf
|
||||||
@@ -421,10 +421,10 @@ __libcpp_isnan(_A1 __x) _NOEXCEPT
|
|||||||
|
|
||||||
template <class _A1>
|
template <class _A1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
|
||||||
isnan(_A1 __x) _NOEXCEPT
|
isnan(_A1 __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isnan(__x);
|
return __libcpp_isnan((typename std::__promote<_A1>::type)__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isnan
|
#endif // isnan
|
||||||
@@ -445,10 +445,10 @@ __libcpp_isnormal(_A1 __x) _NOEXCEPT
|
|||||||
|
|
||||||
template <class _A1>
|
template <class _A1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
|
||||||
isnormal(_A1 __x) _NOEXCEPT
|
isnormal(_A1 __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isnormal(__x);
|
return __libcpp_isnormal((typename std::__promote<_A1>::type)__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isnormal
|
#endif // isnormal
|
||||||
@@ -471,13 +471,14 @@ template <class _A1, class _A2>
|
|||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if
|
typename std::enable_if
|
||||||
<
|
<
|
||||||
std::is_floating_point<_A1>::value &&
|
std::is_arithmetic<_A1>::value &&
|
||||||
std::is_floating_point<_A2>::value,
|
std::is_arithmetic<_A2>::value,
|
||||||
bool
|
bool
|
||||||
>::type
|
>::type
|
||||||
isgreater(_A1 __x, _A2 __y) _NOEXCEPT
|
isgreater(_A1 __x, _A2 __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isgreater(__x, __y);
|
typedef typename std::__promote<_A1, _A2>::type type;
|
||||||
|
return __libcpp_isgreater((type)__x, (type)__y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isgreater
|
#endif // isgreater
|
||||||
@@ -500,13 +501,14 @@ template <class _A1, class _A2>
|
|||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if
|
typename std::enable_if
|
||||||
<
|
<
|
||||||
std::is_floating_point<_A1>::value &&
|
std::is_arithmetic<_A1>::value &&
|
||||||
std::is_floating_point<_A2>::value,
|
std::is_arithmetic<_A2>::value,
|
||||||
bool
|
bool
|
||||||
>::type
|
>::type
|
||||||
isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT
|
isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isgreaterequal(__x, __y);
|
typedef typename std::__promote<_A1, _A2>::type type;
|
||||||
|
return __libcpp_isgreaterequal((type)__x, (type)__y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isgreaterequal
|
#endif // isgreaterequal
|
||||||
@@ -529,13 +531,14 @@ template <class _A1, class _A2>
|
|||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if
|
typename std::enable_if
|
||||||
<
|
<
|
||||||
std::is_floating_point<_A1>::value &&
|
std::is_arithmetic<_A1>::value &&
|
||||||
std::is_floating_point<_A2>::value,
|
std::is_arithmetic<_A2>::value,
|
||||||
bool
|
bool
|
||||||
>::type
|
>::type
|
||||||
isless(_A1 __x, _A2 __y) _NOEXCEPT
|
isless(_A1 __x, _A2 __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isless(__x, __y);
|
typedef typename std::__promote<_A1, _A2>::type type;
|
||||||
|
return __libcpp_isless((type)__x, (type)__y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isless
|
#endif // isless
|
||||||
@@ -558,13 +561,14 @@ template <class _A1, class _A2>
|
|||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if
|
typename std::enable_if
|
||||||
<
|
<
|
||||||
std::is_floating_point<_A1>::value &&
|
std::is_arithmetic<_A1>::value &&
|
||||||
std::is_floating_point<_A2>::value,
|
std::is_arithmetic<_A2>::value,
|
||||||
bool
|
bool
|
||||||
>::type
|
>::type
|
||||||
islessequal(_A1 __x, _A2 __y) _NOEXCEPT
|
islessequal(_A1 __x, _A2 __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_islessequal(__x, __y);
|
typedef typename std::__promote<_A1, _A2>::type type;
|
||||||
|
return __libcpp_islessequal((type)__x, (type)__y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // islessequal
|
#endif // islessequal
|
||||||
@@ -587,13 +591,14 @@ template <class _A1, class _A2>
|
|||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if
|
typename std::enable_if
|
||||||
<
|
<
|
||||||
std::is_floating_point<_A1>::value &&
|
std::is_arithmetic<_A1>::value &&
|
||||||
std::is_floating_point<_A2>::value,
|
std::is_arithmetic<_A2>::value,
|
||||||
bool
|
bool
|
||||||
>::type
|
>::type
|
||||||
islessgreater(_A1 __x, _A2 __y) _NOEXCEPT
|
islessgreater(_A1 __x, _A2 __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_islessgreater(__x, __y);
|
typedef typename std::__promote<_A1, _A2>::type type;
|
||||||
|
return __libcpp_islessgreater((type)__x, (type)__y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // islessgreater
|
#endif // islessgreater
|
||||||
@@ -616,13 +621,14 @@ template <class _A1, class _A2>
|
|||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename std::enable_if
|
typename std::enable_if
|
||||||
<
|
<
|
||||||
std::is_floating_point<_A1>::value &&
|
std::is_arithmetic<_A1>::value &&
|
||||||
std::is_floating_point<_A2>::value,
|
std::is_arithmetic<_A2>::value,
|
||||||
bool
|
bool
|
||||||
>::type
|
>::type
|
||||||
isunordered(_A1 __x, _A2 __y) _NOEXCEPT
|
isunordered(_A1 __x, _A2 __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __libcpp_isunordered(__x, __y);
|
typedef typename std::__promote<_A1, _A2>::type type;
|
||||||
|
return __libcpp_isunordered((type)__x, (type)__y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // isunordered
|
#endif // isunordered
|
||||||
|
@@ -179,7 +179,7 @@ protected:
|
|||||||
|
|
||||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||||
codecvt_mode _Mode = (codecvt_mode)0>
|
codecvt_mode _Mode = (codecvt_mode)0>
|
||||||
class _LIBCPP_VISIBLE codecvt_utf8
|
class _LIBCPP_TYPE_VIS codecvt_utf8
|
||||||
: public __codecvt_utf8<_Elem>
|
: public __codecvt_utf8<_Elem>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -407,7 +407,7 @@ protected:
|
|||||||
|
|
||||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||||
codecvt_mode _Mode = (codecvt_mode)0>
|
codecvt_mode _Mode = (codecvt_mode)0>
|
||||||
class _LIBCPP_VISIBLE codecvt_utf16
|
class _LIBCPP_TYPE_VIS codecvt_utf16
|
||||||
: public __codecvt_utf16<_Elem, _Mode & little_endian>
|
: public __codecvt_utf16<_Elem, _Mode & little_endian>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -530,7 +530,7 @@ protected:
|
|||||||
|
|
||||||
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
|
||||||
codecvt_mode _Mode = (codecvt_mode)0>
|
codecvt_mode _Mode = (codecvt_mode)0>
|
||||||
class _LIBCPP_VISIBLE codecvt_utf8_utf16
|
class _LIBCPP_TYPE_VIS codecvt_utf8_utf16
|
||||||
: public __codecvt_utf8_utf16<_Elem>
|
: public __codecvt_utf8_utf16<_Elem>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -255,13 +255,13 @@ template<class T, class charT, class traits>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template<class _Tp> class _LIBCPP_VISIBLE complex;
|
template<class _Tp> class _LIBCPP_TYPE_VIS complex;
|
||||||
|
|
||||||
template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
|
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> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE complex
|
class _LIBCPP_TYPE_VIS complex
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
@@ -319,11 +319,11 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<> class _LIBCPP_VISIBLE complex<double>;
|
template<> class _LIBCPP_TYPE_VIS complex<double>;
|
||||||
template<> class _LIBCPP_VISIBLE complex<long double>;
|
template<> class _LIBCPP_TYPE_VIS complex<long double>;
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
class _LIBCPP_VISIBLE complex<float>
|
class _LIBCPP_TYPE_VIS complex<float>
|
||||||
{
|
{
|
||||||
float __re_;
|
float __re_;
|
||||||
float __im_;
|
float __im_;
|
||||||
@@ -379,7 +379,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
class _LIBCPP_VISIBLE complex<double>
|
class _LIBCPP_TYPE_VIS complex<double>
|
||||||
{
|
{
|
||||||
double __re_;
|
double __re_;
|
||||||
double __im_;
|
double __im_;
|
||||||
@@ -435,7 +435,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
class _LIBCPP_VISIBLE complex<long double>
|
class _LIBCPP_TYPE_VIS complex<long double>
|
||||||
{
|
{
|
||||||
long double __re_;
|
long double __re_;
|
||||||
long double __im_;
|
long double __im_;
|
||||||
|
@@ -117,7 +117,7 @@ public:
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE condition_variable_any
|
class _LIBCPP_TYPE_VIS condition_variable_any
|
||||||
{
|
{
|
||||||
condition_variable __cv_;
|
condition_variable __cv_;
|
||||||
shared_ptr<mutex> __mut_;
|
shared_ptr<mutex> __mut_;
|
||||||
@@ -248,7 +248,7 @@ condition_variable_any::wait_for(_Lock& __lock,
|
|||||||
_VSTD::move(__pred));
|
_VSTD::move(__pred));
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_FUNC_VIS
|
||||||
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
@@ -56,7 +56,7 @@ typedef long double max_align_t;
|
|||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_NULLPTR
|
#ifdef _LIBCPP_HAS_NO_NULLPTR
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE nullptr_t
|
struct _LIBCPP_TYPE_VIS nullptr_t
|
||||||
{
|
{
|
||||||
void* __lx;
|
void* __lx;
|
||||||
|
|
||||||
|
@@ -97,18 +97,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
using ::size_t;
|
using ::size_t;
|
||||||
using ::div_t;
|
using ::div_t;
|
||||||
using ::ldiv_t;
|
using ::ldiv_t;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::lldiv_t;
|
using ::lldiv_t;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::atof;
|
using ::atof;
|
||||||
using ::atoi;
|
using ::atoi;
|
||||||
using ::atol;
|
using ::atol;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::atoll;
|
using ::atoll;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::strtod;
|
using ::strtod;
|
||||||
using ::strtof;
|
using ::strtof;
|
||||||
using ::strtold;
|
using ::strtold;
|
||||||
using ::strtol;
|
using ::strtol;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::strtoll;
|
using ::strtoll;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::strtoul;
|
using ::strtoul;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::strtoull;
|
using ::strtoull;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::rand;
|
using ::rand;
|
||||||
using ::srand;
|
using ::srand;
|
||||||
using ::calloc;
|
using ::calloc;
|
||||||
@@ -125,10 +133,14 @@ using ::bsearch;
|
|||||||
using ::qsort;
|
using ::qsort;
|
||||||
using ::abs;
|
using ::abs;
|
||||||
using ::labs;
|
using ::labs;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::llabs;
|
using ::llabs;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::div;
|
using ::div;
|
||||||
using ::ldiv;
|
using ::ldiv;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::lldiv;
|
using ::lldiv;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::mblen;
|
using ::mblen;
|
||||||
using ::mbtowc;
|
using ::mbtowc;
|
||||||
using ::wctomb;
|
using ::wctomb;
|
||||||
@@ -145,10 +157,14 @@ using ::aligned_alloc;
|
|||||||
// MSVC already has the correct prototype in <stdlib.h.h> #ifdef __cplusplus
|
// MSVC already has the correct prototype in <stdlib.h.h> #ifdef __cplusplus
|
||||||
#if !defined(_MSC_VER) && !defined(__sun__)
|
#if !defined(_MSC_VER) && !defined(__sun__)
|
||||||
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
|
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
|
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
|
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
|
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
@@ -94,7 +94,7 @@ using ::strspn;
|
|||||||
using ::strstr;
|
using ::strstr;
|
||||||
|
|
||||||
// MSVC, GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
|
// MSVC, GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
|
||||||
#if !defined(__GLIBC__) && !defined(_MSC_VER) && !defined(__sun__)
|
#if !defined(__GLIBC__) && !defined(_MSC_VER) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
|
||||||
inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
|
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* 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 char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);}
|
||||||
|
@@ -106,7 +106,7 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
|
|||||||
#include <__config>
|
#include <__config>
|
||||||
#include <cwctype>
|
#include <cwctype>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
#include <support/win32/support.h> // pull in *swprintf defines
|
#include <support/win32/support.h> // pull in *swprintf defines
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
@@ -151,9 +151,13 @@ using ::wcstof;
|
|||||||
using ::wcstold;
|
using ::wcstold;
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
using ::wcstol;
|
using ::wcstol;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::wcstoll;
|
using ::wcstoll;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::wcstoul;
|
using ::wcstoul;
|
||||||
|
#ifndef _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::wcstoull;
|
using ::wcstoull;
|
||||||
|
#endif // _LIBCPP_HAS_NO_LONG_LONG
|
||||||
using ::wcscpy;
|
using ::wcscpy;
|
||||||
using ::wcsncpy;
|
using ::wcsncpy;
|
||||||
using ::wcscat;
|
using ::wcscat;
|
||||||
@@ -163,28 +167,37 @@ using ::wcscoll;
|
|||||||
using ::wcsncmp;
|
using ::wcsncmp;
|
||||||
using ::wcsxfrm;
|
using ::wcsxfrm;
|
||||||
|
|
||||||
|
#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
|
||||||
|
|
||||||
|
using ::wcschr;
|
||||||
|
using ::wcspbrk;
|
||||||
|
using ::wcsrchr;
|
||||||
|
using ::wcsstr;
|
||||||
|
using ::wmemchr;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
|
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
|
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
|
||||||
|
|
||||||
using ::wcscspn;
|
|
||||||
using ::wcslen;
|
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
|
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
|
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
|
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
|
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
|
||||||
|
|
||||||
using ::wcsspn;
|
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
|
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
|
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
|
||||||
|
|
||||||
using ::wcstok;
|
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
|
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
|
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using ::wcscspn;
|
||||||
|
using ::wcslen;
|
||||||
|
using ::wcsspn;
|
||||||
|
using ::wcstok;
|
||||||
using ::wmemcmp;
|
using ::wmemcmp;
|
||||||
using ::wmemcpy;
|
using ::wmemcpy;
|
||||||
using ::wmemmove;
|
using ::wmemmove;
|
||||||
|
@@ -170,7 +170,7 @@ template <class _Tp, class _Allocator> class __deque_base;
|
|||||||
|
|
||||||
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
|
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
|
||||||
class _DiffType, _DiffType _BlockSize>
|
class _DiffType, _DiffType _BlockSize>
|
||||||
class _LIBCPP_VISIBLE __deque_iterator;
|
class _LIBCPP_TYPE_VIS __deque_iterator;
|
||||||
|
|
||||||
template <class _RAIter,
|
template <class _RAIter,
|
||||||
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
|
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
|
||||||
@@ -262,7 +262,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
|
|||||||
|
|
||||||
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
|
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
|
||||||
class _DiffType, _DiffType _BlockSize>
|
class _DiffType, _DiffType _BlockSize>
|
||||||
class _LIBCPP_VISIBLE __deque_iterator
|
class _LIBCPP_TYPE_VIS __deque_iterator
|
||||||
{
|
{
|
||||||
typedef _MapPointer __map_iterator;
|
typedef _MapPointer __map_iterator;
|
||||||
public:
|
public:
|
||||||
@@ -410,9 +410,9 @@ private:
|
|||||||
: __m_iter_(__m), __ptr_(__p) {}
|
: __m_iter_(__m), __ptr_(__p) {}
|
||||||
|
|
||||||
template <class _Tp, class _Ap> friend class __deque_base;
|
template <class _Tp, class _Ap> friend class __deque_base;
|
||||||
template <class _Tp, class _Ap> friend class _LIBCPP_VISIBLE deque;
|
template <class _Tp, class _Ap> friend class _LIBCPP_TYPE_VIS deque;
|
||||||
template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp>
|
template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp>
|
||||||
friend class _LIBCPP_VISIBLE __deque_iterator;
|
friend class _LIBCPP_TYPE_VIS __deque_iterator;
|
||||||
|
|
||||||
template <class _RAIter,
|
template <class _RAIter,
|
||||||
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
|
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
|
||||||
@@ -1167,7 +1167,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Allocator = allocator<_Tp> >
|
template <class _Tp, class _Allocator = allocator<_Tp> >
|
||||||
class _LIBCPP_VISIBLE deque
|
class _LIBCPP_TYPE_VIS deque
|
||||||
: private __deque_base<_Tp, _Allocator>
|
: private __deque_base<_Tp, _Allocator>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -105,23 +105,23 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*unexpected_handler)();
|
typedef void (*unexpected_handler)();
|
||||||
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
|
_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
|
||||||
_LIBCPP_NORETURN _LIBCPP_VISIBLE void unexpected();
|
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
|
||||||
|
|
||||||
typedef void (*terminate_handler)();
|
typedef void (*terminate_handler)();
|
||||||
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
|
_LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
|
||||||
_LIBCPP_NORETURN _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
|
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
|
_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE exception_ptr;
|
class _LIBCPP_TYPE_VIS exception_ptr;
|
||||||
|
|
||||||
exception_ptr current_exception() _NOEXCEPT;
|
exception_ptr current_exception() _NOEXCEPT;
|
||||||
_LIBCPP_NORETURN void rethrow_exception(exception_ptr);
|
_LIBCPP_NORETURN void rethrow_exception(exception_ptr);
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE exception_ptr
|
class _LIBCPP_TYPE_VIS exception_ptr
|
||||||
{
|
{
|
||||||
void* __ptr_;
|
void* __ptr_;
|
||||||
public:
|
public:
|
||||||
@@ -143,7 +143,7 @@ public:
|
|||||||
{return !(__x == __y);}
|
{return !(__x == __y);}
|
||||||
|
|
||||||
friend exception_ptr current_exception() _NOEXCEPT;
|
friend exception_ptr current_exception() _NOEXCEPT;
|
||||||
_LIBCPP_NORETURN friend void rethrow_exception(exception_ptr);
|
friend void rethrow_exception(exception_ptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Ep>
|
template<class _Ep>
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
namespace __gnu_cxx {
|
namespace __gnu_cxx {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
template <typename T> struct _LIBCPP_VISIBLE hash : public std::hash<T>
|
template <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T>
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
template <> struct _LIBCPP_VISIBLE hash<const char*>
|
template <> struct _LIBCPP_TYPE_VIS hash<const char*>
|
||||||
: public unary_function<const char*, size_t>
|
: public unary_function<const char*, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -32,7 +32,7 @@ template <> struct _LIBCPP_VISIBLE hash<const char*>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct _LIBCPP_VISIBLE hash<char *>
|
template <> struct _LIBCPP_TYPE_VIS hash<char *>
|
||||||
: public unary_function<char*, size_t>
|
: public unary_function<char*, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@@ -361,7 +361,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _HashIterator>
|
template <class _HashIterator>
|
||||||
class _LIBCPP_VISIBLE __hash_map_iterator
|
class _LIBCPP_TYPE_VIS __hash_map_iterator
|
||||||
{
|
{
|
||||||
_HashIterator __i_;
|
_HashIterator __i_;
|
||||||
|
|
||||||
@@ -404,15 +404,15 @@ public:
|
|||||||
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||||
{return __x.__i_ != __y.__i_;}
|
{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_TYPE_VIS hash_map;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_multimap;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _HashIterator>
|
template <class _HashIterator>
|
||||||
class _LIBCPP_VISIBLE __hash_map_const_iterator
|
class _LIBCPP_TYPE_VIS __hash_map_const_iterator
|
||||||
{
|
{
|
||||||
_HashIterator __i_;
|
_HashIterator __i_;
|
||||||
|
|
||||||
@@ -463,15 +463,15 @@ public:
|
|||||||
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||||
{return __x.__i_ != __y.__i_;}
|
{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_TYPE_VIS hash_map;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE hash_multimap;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_multimap;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||||
class _LIBCPP_VISIBLE hash_map
|
class _LIBCPP_TYPE_VIS hash_map
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -750,7 +750,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
|||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||||
class _LIBCPP_VISIBLE hash_multimap
|
class _LIBCPP_TYPE_VIS hash_multimap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
|
@@ -208,7 +208,7 @@ using namespace std;
|
|||||||
|
|
||||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||||
class _Alloc = allocator<_Value> >
|
class _Alloc = allocator<_Value> >
|
||||||
class _LIBCPP_VISIBLE hash_set
|
class _LIBCPP_TYPE_VIS hash_set
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -429,7 +429,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
|||||||
|
|
||||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||||
class _Alloc = allocator<_Value> >
|
class _Alloc = allocator<_Value> >
|
||||||
class _LIBCPP_VISIBLE hash_multiset
|
class _LIBCPP_TYPE_VIS hash_multiset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
|
@@ -212,11 +212,11 @@ struct __forward_list_node
|
|||||||
value_type __value_;
|
value_type __value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp, class _Alloc> class _LIBCPP_VISIBLE forward_list;
|
template<class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS forward_list;
|
||||||
template<class _NodeConstPtr> class _LIBCPP_VISIBLE __forward_list_const_iterator;
|
template<class _NodeConstPtr> class _LIBCPP_TYPE_VIS __forward_list_const_iterator;
|
||||||
|
|
||||||
template <class _NodePtr>
|
template <class _NodePtr>
|
||||||
class _LIBCPP_VISIBLE __forward_list_iterator
|
class _LIBCPP_TYPE_VIS __forward_list_iterator
|
||||||
{
|
{
|
||||||
typedef _NodePtr __node_pointer;
|
typedef _NodePtr __node_pointer;
|
||||||
|
|
||||||
@@ -225,8 +225,8 @@ class _LIBCPP_VISIBLE __forward_list_iterator
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||||
|
|
||||||
template<class, class> friend class _LIBCPP_VISIBLE forward_list;
|
template<class, class> friend class _LIBCPP_TYPE_VIS forward_list;
|
||||||
template<class> friend class _LIBCPP_VISIBLE __forward_list_const_iterator;
|
template<class> friend class _LIBCPP_TYPE_VIS __forward_list_const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef forward_iterator_tag iterator_category;
|
typedef forward_iterator_tag iterator_category;
|
||||||
@@ -276,7 +276,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _NodeConstPtr>
|
template <class _NodeConstPtr>
|
||||||
class _LIBCPP_VISIBLE __forward_list_const_iterator
|
class _LIBCPP_TYPE_VIS __forward_list_const_iterator
|
||||||
{
|
{
|
||||||
typedef _NodeConstPtr __node_const_pointer;
|
typedef _NodeConstPtr __node_const_pointer;
|
||||||
|
|
||||||
@@ -533,7 +533,7 @@ __forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Alloc = allocator<_Tp> >
|
template <class _Tp, class _Alloc = allocator<_Tp> >
|
||||||
class _LIBCPP_VISIBLE forward_list
|
class _LIBCPP_TYPE_VIS forward_list
|
||||||
: private __forward_list_base<_Tp, _Alloc>
|
: private __forward_list_base<_Tp, _Alloc>
|
||||||
{
|
{
|
||||||
typedef __forward_list_base<_Tp, _Alloc> base;
|
typedef __forward_list_base<_Tp, _Alloc> base;
|
||||||
|
@@ -180,7 +180,7 @@ typedef basic_fstream<wchar_t> wfstream;
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_filebuf
|
class _LIBCPP_TYPE_VIS basic_filebuf
|
||||||
: public basic_streambuf<_CharT, _Traits>
|
: public basic_streambuf<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -807,9 +807,15 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
|
|||||||
default:
|
default:
|
||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
}
|
}
|
||||||
|
#if _WIN32
|
||||||
|
if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
|
||||||
|
return pos_type(off_type(-1));
|
||||||
|
pos_type __r = ftell(__file_);
|
||||||
|
#else
|
||||||
if (fseeko(__file_, __width > 0 ? __width * __off : 0, __whence))
|
if (fseeko(__file_, __width > 0 ? __width * __off : 0, __whence))
|
||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
pos_type __r = ftello(__file_);
|
pos_type __r = ftello(__file_);
|
||||||
|
#endif
|
||||||
__r.state(__st_);
|
__r.state(__st_);
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
@@ -820,8 +826,13 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
|
|||||||
{
|
{
|
||||||
if (__file_ == 0 || sync())
|
if (__file_ == 0 || sync())
|
||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
|
#if _WIN32
|
||||||
|
if (fseek(__file_, __sp, SEEK_SET))
|
||||||
|
return pos_type(off_type(-1));
|
||||||
|
#else
|
||||||
if (fseeko(__file_, __sp, SEEK_SET))
|
if (fseeko(__file_, __sp, SEEK_SET))
|
||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
|
#endif
|
||||||
__st_ = __sp.state();
|
__st_ = __sp.state();
|
||||||
return __sp;
|
return __sp;
|
||||||
}
|
}
|
||||||
@@ -880,8 +891,13 @@ basic_filebuf<_CharT, _Traits>::sync()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if _WIN32
|
||||||
|
if (fseek(__file_, -__c, SEEK_CUR))
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
if (fseeko(__file_, -__c, SEEK_CUR))
|
if (fseeko(__file_, -__c, SEEK_CUR))
|
||||||
return -1;
|
return -1;
|
||||||
|
#endif
|
||||||
if (__update_st)
|
if (__update_st)
|
||||||
__st_ = __state;
|
__st_ = __state;
|
||||||
__extbufnext_ = __extbufend_ = __extbuf_;
|
__extbufnext_ = __extbufend_ = __extbuf_;
|
||||||
@@ -978,7 +994,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
|
|||||||
// basic_ifstream
|
// basic_ifstream
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_ifstream
|
class _LIBCPP_TYPE_VIS basic_ifstream
|
||||||
: public basic_istream<_CharT, _Traits>
|
: public basic_istream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1123,7 +1139,7 @@ basic_ifstream<_CharT, _Traits>::close()
|
|||||||
// basic_ofstream
|
// basic_ofstream
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_ofstream
|
class _LIBCPP_TYPE_VIS basic_ofstream
|
||||||
: public basic_ostream<_CharT, _Traits>
|
: public basic_ostream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1268,7 +1284,7 @@ basic_ofstream<_CharT, _Traits>::close()
|
|||||||
// basic_fstream
|
// basic_fstream
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_fstream
|
class _LIBCPP_TYPE_VIS basic_fstream
|
||||||
: public basic_iostream<_CharT, _Traits>
|
: public basic_iostream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -474,63 +474,63 @@ POLICY: For non-variadic implementations, the number of arguments is limited
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE plus : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS plus : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x + __y;}
|
{return __x + __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE minus : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS minus : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x - __y;}
|
{return __x - __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE multiplies : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS multiplies : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x * __y;}
|
{return __x * __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE divides : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS divides : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x / __y;}
|
{return __x / __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE modulus : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS modulus : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x % __y;}
|
{return __x % __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE negate : unary_function<_Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS negate : unary_function<_Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const
|
||||||
{return -__x;}
|
{return -__x;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE equal_to : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS equal_to : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x == __y;}
|
{return __x == __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE not_equal_to : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS not_equal_to : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x != __y;}
|
{return __x != __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE greater : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS greater : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x > __y;}
|
{return __x > __y;}
|
||||||
@@ -539,63 +539,63 @@ struct _LIBCPP_VISIBLE greater : binary_function<_Tp, _Tp, bool>
|
|||||||
// less in <__functional_base>
|
// less in <__functional_base>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE greater_equal : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x >= __y;}
|
{return __x >= __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE less_equal : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS less_equal : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x <= __y;}
|
{return __x <= __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE logical_and : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS logical_and : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x && __y;}
|
{return __x && __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE logical_or : binary_function<_Tp, _Tp, bool>
|
struct _LIBCPP_TYPE_VIS logical_or : binary_function<_Tp, _Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x || __y;}
|
{return __x || __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE logical_not : unary_function<_Tp, bool>
|
struct _LIBCPP_TYPE_VIS logical_not : unary_function<_Tp, bool>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x) const
|
_LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x) const
|
||||||
{return !__x;}
|
{return !__x;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE bit_and : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS bit_and : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x & __y;}
|
{return __x & __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE bit_or : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS bit_or : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x | __y;}
|
{return __x | __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE bit_xor : binary_function<_Tp, _Tp, _Tp>
|
struct _LIBCPP_TYPE_VIS bit_xor : binary_function<_Tp, _Tp, _Tp>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
_LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const
|
||||||
{return __x ^ __y;}
|
{return __x ^ __y;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Predicate>
|
template <class _Predicate>
|
||||||
class _LIBCPP_VISIBLE unary_negate
|
class _LIBCPP_TYPE_VIS unary_negate
|
||||||
: public unary_function<typename _Predicate::argument_type, bool>
|
: public unary_function<typename _Predicate::argument_type, bool>
|
||||||
{
|
{
|
||||||
_Predicate __pred_;
|
_Predicate __pred_;
|
||||||
@@ -612,7 +612,7 @@ unary_negate<_Predicate>
|
|||||||
not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
|
not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
|
||||||
|
|
||||||
template <class _Predicate>
|
template <class _Predicate>
|
||||||
class _LIBCPP_VISIBLE binary_negate
|
class _LIBCPP_TYPE_VIS binary_negate
|
||||||
: public binary_function<typename _Predicate::first_argument_type,
|
: public binary_function<typename _Predicate::first_argument_type,
|
||||||
typename _Predicate::second_argument_type,
|
typename _Predicate::second_argument_type,
|
||||||
bool>
|
bool>
|
||||||
@@ -632,7 +632,7 @@ binary_negate<_Predicate>
|
|||||||
not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
|
not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
|
||||||
|
|
||||||
template <class __Operation>
|
template <class __Operation>
|
||||||
class _LIBCPP_VISIBLE binder1st
|
class _LIBCPP_TYPE_VIS binder1st
|
||||||
: public unary_function<typename __Operation::second_argument_type,
|
: public unary_function<typename __Operation::second_argument_type,
|
||||||
typename __Operation::result_type>
|
typename __Operation::result_type>
|
||||||
{
|
{
|
||||||
@@ -658,7 +658,7 @@ bind1st(const __Operation& __op, const _Tp& __x)
|
|||||||
{return binder1st<__Operation>(__op, __x);}
|
{return binder1st<__Operation>(__op, __x);}
|
||||||
|
|
||||||
template <class __Operation>
|
template <class __Operation>
|
||||||
class _LIBCPP_VISIBLE binder2nd
|
class _LIBCPP_TYPE_VIS binder2nd
|
||||||
: public unary_function<typename __Operation::first_argument_type,
|
: public unary_function<typename __Operation::first_argument_type,
|
||||||
typename __Operation::result_type>
|
typename __Operation::result_type>
|
||||||
{
|
{
|
||||||
@@ -684,7 +684,7 @@ bind2nd(const __Operation& __op, const _Tp& __x)
|
|||||||
{return binder2nd<__Operation>(__op, __x);}
|
{return binder2nd<__Operation>(__op, __x);}
|
||||||
|
|
||||||
template <class _Arg, class _Result>
|
template <class _Arg, class _Result>
|
||||||
class _LIBCPP_VISIBLE pointer_to_unary_function
|
class _LIBCPP_TYPE_VIS pointer_to_unary_function
|
||||||
: public unary_function<_Arg, _Result>
|
: public unary_function<_Arg, _Result>
|
||||||
{
|
{
|
||||||
_Result (*__f_)(_Arg);
|
_Result (*__f_)(_Arg);
|
||||||
@@ -702,7 +702,7 @@ ptr_fun(_Result (*__f)(_Arg))
|
|||||||
{return pointer_to_unary_function<_Arg,_Result>(__f);}
|
{return pointer_to_unary_function<_Arg,_Result>(__f);}
|
||||||
|
|
||||||
template <class _Arg1, class _Arg2, class _Result>
|
template <class _Arg1, class _Arg2, class _Result>
|
||||||
class _LIBCPP_VISIBLE pointer_to_binary_function
|
class _LIBCPP_TYPE_VIS pointer_to_binary_function
|
||||||
: public binary_function<_Arg1, _Arg2, _Result>
|
: public binary_function<_Arg1, _Arg2, _Result>
|
||||||
{
|
{
|
||||||
_Result (*__f_)(_Arg1, _Arg2);
|
_Result (*__f_)(_Arg1, _Arg2);
|
||||||
@@ -720,7 +720,7 @@ ptr_fun(_Result (*__f)(_Arg1,_Arg2))
|
|||||||
{return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
|
{return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
|
||||||
|
|
||||||
template<class _Sp, class _Tp>
|
template<class _Sp, class _Tp>
|
||||||
class _LIBCPP_VISIBLE mem_fun_t : public unary_function<_Tp*, _Sp>
|
class _LIBCPP_TYPE_VIS mem_fun_t : public unary_function<_Tp*, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)();
|
_Sp (_Tp::*__p_)();
|
||||||
public:
|
public:
|
||||||
@@ -731,7 +731,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _Sp, class _Tp, class _Ap>
|
template<class _Sp, class _Tp, class _Ap>
|
||||||
class _LIBCPP_VISIBLE mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
|
class _LIBCPP_TYPE_VIS mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)(_Ap);
|
_Sp (_Tp::*__p_)(_Ap);
|
||||||
public:
|
public:
|
||||||
@@ -754,7 +754,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap))
|
|||||||
{return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
|
{return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
|
||||||
|
|
||||||
template<class _Sp, class _Tp>
|
template<class _Sp, class _Tp>
|
||||||
class _LIBCPP_VISIBLE mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
class _LIBCPP_TYPE_VIS mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)();
|
_Sp (_Tp::*__p_)();
|
||||||
public:
|
public:
|
||||||
@@ -765,7 +765,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _Sp, class _Tp, class _Ap>
|
template<class _Sp, class _Tp, class _Ap>
|
||||||
class _LIBCPP_VISIBLE mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
|
class _LIBCPP_TYPE_VIS mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)(_Ap);
|
_Sp (_Tp::*__p_)(_Ap);
|
||||||
public:
|
public:
|
||||||
@@ -788,7 +788,7 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
|
|||||||
{return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
|
{return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
|
||||||
|
|
||||||
template <class _Sp, class _Tp>
|
template <class _Sp, class _Tp>
|
||||||
class _LIBCPP_VISIBLE const_mem_fun_t : public unary_function<const _Tp*, _Sp>
|
class _LIBCPP_TYPE_VIS const_mem_fun_t : public unary_function<const _Tp*, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)() const;
|
_Sp (_Tp::*__p_)() const;
|
||||||
public:
|
public:
|
||||||
@@ -799,7 +799,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Sp, class _Tp, class _Ap>
|
template <class _Sp, class _Tp, class _Ap>
|
||||||
class _LIBCPP_VISIBLE const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
|
class _LIBCPP_TYPE_VIS const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)(_Ap) const;
|
_Sp (_Tp::*__p_)(_Ap) const;
|
||||||
public:
|
public:
|
||||||
@@ -822,7 +822,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap) const)
|
|||||||
{return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
|
{return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
|
||||||
|
|
||||||
template <class _Sp, class _Tp>
|
template <class _Sp, class _Tp>
|
||||||
class _LIBCPP_VISIBLE const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
class _LIBCPP_TYPE_VIS const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)() const;
|
_Sp (_Tp::*__p_)() const;
|
||||||
public:
|
public:
|
||||||
@@ -833,7 +833,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Sp, class _Tp, class _Ap>
|
template <class _Sp, class _Tp, class _Ap>
|
||||||
class _LIBCPP_VISIBLE const_mem_fun1_ref_t
|
class _LIBCPP_TYPE_VIS const_mem_fun1_ref_t
|
||||||
: public binary_function<_Tp, _Ap, _Sp>
|
: public binary_function<_Tp, _Ap, _Sp>
|
||||||
{
|
{
|
||||||
_Sp (_Tp::*__p_)(_Ap) const;
|
_Sp (_Tp::*__p_)(_Ap) const;
|
||||||
@@ -932,7 +932,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Fp> class _LIBCPP_VISIBLE function; // undefined
|
template<class _Fp> class _LIBCPP_TYPE_VIS function; // undefined
|
||||||
|
|
||||||
namespace __function
|
namespace __function
|
||||||
{
|
{
|
||||||
@@ -1083,12 +1083,12 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
|
|||||||
} // __function
|
} // __function
|
||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
class _LIBCPP_VISIBLE function<_Rp(_ArgTypes...)>
|
class _LIBCPP_TYPE_VIS function<_Rp(_ArgTypes...)>
|
||||||
: public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
|
: public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
|
||||||
public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
|
public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
|
||||||
{
|
{
|
||||||
typedef __function::__base<_Rp(_ArgTypes...)> __base;
|
typedef __function::__base<_Rp(_ArgTypes...)> __base;
|
||||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
typename aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||||
__base* __f_;
|
__base* __f_;
|
||||||
|
|
||||||
template <class _Fp>
|
template <class _Fp>
|
||||||
@@ -1496,11 +1496,11 @@ swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCE
|
|||||||
{return __x.swap(__y);}
|
{return __x.swap(__y);}
|
||||||
|
|
||||||
template<class _Tp> struct __is_bind_expression : public false_type {};
|
template<class _Tp> struct __is_bind_expression : public false_type {};
|
||||||
template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression
|
template<class _Tp> struct _LIBCPP_TYPE_VIS is_bind_expression
|
||||||
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
|
||||||
|
|
||||||
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
|
||||||
template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder
|
template<class _Tp> struct _LIBCPP_TYPE_VIS is_placeholder
|
||||||
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
|
||||||
|
|
||||||
namespace placeholders
|
namespace placeholders
|
||||||
@@ -1624,16 +1624,38 @@ struct __mu_return
|
|||||||
: public ____mu_return<_Ti,
|
: public ____mu_return<_Ti,
|
||||||
__is_reference_wrapper<_Ti>::value,
|
__is_reference_wrapper<_Ti>::value,
|
||||||
is_bind_expression<_Ti>::value,
|
is_bind_expression<_Ti>::value,
|
||||||
0 < is_placeholder<_Ti>::value,
|
0 < is_placeholder<_Ti>::value &&
|
||||||
|
is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
|
||||||
_TupleUj>
|
_TupleUj>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Fp, class _BoundArgs, class _TupleUj>
|
template <class _Fp, class _BoundArgs, class _TupleUj>
|
||||||
|
struct _is_valid_bind_return
|
||||||
|
{
|
||||||
|
static const bool value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class _Fp, class ..._BoundArgs, class _TupleUj>
|
||||||
|
struct _is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
|
||||||
|
{
|
||||||
|
static const bool value = __invokable<_Fp,
|
||||||
|
typename __mu_return<_BoundArgs, _TupleUj>::type...>::value;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class _Fp, class ..._BoundArgs, class _TupleUj>
|
||||||
|
struct _is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
|
||||||
|
{
|
||||||
|
static const bool value = __invokable<_Fp,
|
||||||
|
typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class _Fp, class _BoundArgs, class _TupleUj,
|
||||||
|
bool = _is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
|
||||||
struct __bind_return;
|
struct __bind_return;
|
||||||
|
|
||||||
template <class _Fp, class ..._BoundArgs, class _TupleUj>
|
template <class _Fp, class ..._BoundArgs, class _TupleUj>
|
||||||
struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
|
struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true>
|
||||||
{
|
{
|
||||||
typedef typename __invoke_of
|
typedef typename __invoke_of
|
||||||
<
|
<
|
||||||
@@ -1647,7 +1669,7 @@ struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Fp, class ..._BoundArgs, class _TupleUj>
|
template <class _Fp, class ..._BoundArgs, class _TupleUj>
|
||||||
struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
|
struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>
|
||||||
{
|
{
|
||||||
typedef typename __invoke_of
|
typedef typename __invoke_of
|
||||||
<
|
<
|
||||||
@@ -1673,8 +1695,10 @@ template<class _Fp, class ..._BoundArgs>
|
|||||||
class __bind
|
class __bind
|
||||||
: public __weak_result_type<typename decay<_Fp>::type>
|
: public __weak_result_type<typename decay<_Fp>::type>
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
typedef typename decay<_Fp>::type _Fd;
|
typedef typename decay<_Fp>::type _Fd;
|
||||||
typedef tuple<typename decay<_BoundArgs>::type...> _Td;
|
typedef tuple<typename decay<_BoundArgs>::type...> _Td;
|
||||||
|
private:
|
||||||
_Fd __f_;
|
_Fd __f_;
|
||||||
_Td __bound_args_;
|
_Td __bound_args_;
|
||||||
|
|
||||||
@@ -1731,7 +1755,7 @@ public:
|
|||||||
|
|
||||||
template <class ..._Args>
|
template <class ..._Args>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
|
typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
|
||||||
operator()(_Args&& ...__args) const
|
operator()(_Args&& ...__args) const
|
||||||
{
|
{
|
||||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||||
@@ -1747,6 +1771,8 @@ class __bind_r
|
|||||||
: public __bind<_Fp, _BoundArgs...>
|
: public __bind<_Fp, _BoundArgs...>
|
||||||
{
|
{
|
||||||
typedef __bind<_Fp, _BoundArgs...> base;
|
typedef __bind<_Fp, _BoundArgs...> base;
|
||||||
|
typedef typename base::_Fd _Fd;
|
||||||
|
typedef typename base::_Td _Td;
|
||||||
public:
|
public:
|
||||||
typedef _Rp result_type;
|
typedef _Rp result_type;
|
||||||
|
|
||||||
@@ -1784,7 +1810,12 @@ public:
|
|||||||
|
|
||||||
template <class ..._Args>
|
template <class ..._Args>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
result_type
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
|
||||||
|
result_type>::value,
|
||||||
|
result_type
|
||||||
|
>::type
|
||||||
operator()(_Args&& ...__args)
|
operator()(_Args&& ...__args)
|
||||||
{
|
{
|
||||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||||
@@ -1792,7 +1823,12 @@ public:
|
|||||||
|
|
||||||
template <class ..._Args>
|
template <class ..._Args>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
result_type
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
|
||||||
|
result_type>::value,
|
||||||
|
result_type
|
||||||
|
>::type
|
||||||
operator()(_Args&& ...__args) const
|
operator()(_Args&& ...__args) const
|
||||||
{
|
{
|
||||||
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
return base::operator()(_VSTD::forward<_Args>(__args)...);
|
||||||
@@ -1823,7 +1859,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
|
|||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<bool>
|
struct _LIBCPP_TYPE_VIS hash<bool>
|
||||||
: public unary_function<bool, size_t>
|
: public unary_function<bool, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1831,7 +1867,7 @@ struct _LIBCPP_VISIBLE hash<bool>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<char>
|
struct _LIBCPP_TYPE_VIS hash<char>
|
||||||
: public unary_function<char, size_t>
|
: public unary_function<char, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1839,7 +1875,7 @@ struct _LIBCPP_VISIBLE hash<char>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<signed char>
|
struct _LIBCPP_TYPE_VIS hash<signed char>
|
||||||
: public unary_function<signed char, size_t>
|
: public unary_function<signed char, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1847,7 +1883,7 @@ struct _LIBCPP_VISIBLE hash<signed char>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<unsigned char>
|
struct _LIBCPP_TYPE_VIS hash<unsigned char>
|
||||||
: public unary_function<unsigned char, size_t>
|
: public unary_function<unsigned char, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1857,7 +1893,7 @@ struct _LIBCPP_VISIBLE hash<unsigned char>
|
|||||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<char16_t>
|
struct _LIBCPP_TYPE_VIS hash<char16_t>
|
||||||
: public unary_function<char16_t, size_t>
|
: public unary_function<char16_t, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1865,7 +1901,7 @@ struct _LIBCPP_VISIBLE hash<char16_t>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<char32_t>
|
struct _LIBCPP_TYPE_VIS hash<char32_t>
|
||||||
: public unary_function<char32_t, size_t>
|
: public unary_function<char32_t, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1875,7 +1911,7 @@ struct _LIBCPP_VISIBLE hash<char32_t>
|
|||||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<wchar_t>
|
struct _LIBCPP_TYPE_VIS hash<wchar_t>
|
||||||
: public unary_function<wchar_t, size_t>
|
: public unary_function<wchar_t, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1883,7 +1919,7 @@ struct _LIBCPP_VISIBLE hash<wchar_t>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<short>
|
struct _LIBCPP_TYPE_VIS hash<short>
|
||||||
: public unary_function<short, size_t>
|
: public unary_function<short, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1891,7 +1927,7 @@ struct _LIBCPP_VISIBLE hash<short>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<unsigned short>
|
struct _LIBCPP_TYPE_VIS hash<unsigned short>
|
||||||
: public unary_function<unsigned short, size_t>
|
: public unary_function<unsigned short, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1899,7 +1935,7 @@ struct _LIBCPP_VISIBLE hash<unsigned short>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<int>
|
struct _LIBCPP_TYPE_VIS hash<int>
|
||||||
: public unary_function<int, size_t>
|
: public unary_function<int, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1907,7 +1943,7 @@ struct _LIBCPP_VISIBLE hash<int>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<unsigned int>
|
struct _LIBCPP_TYPE_VIS hash<unsigned int>
|
||||||
: public unary_function<unsigned int, size_t>
|
: public unary_function<unsigned int, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1915,7 +1951,7 @@ struct _LIBCPP_VISIBLE hash<unsigned int>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<long>
|
struct _LIBCPP_TYPE_VIS hash<long>
|
||||||
: public unary_function<long, size_t>
|
: public unary_function<long, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1923,7 +1959,7 @@ struct _LIBCPP_VISIBLE hash<long>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<unsigned long>
|
struct _LIBCPP_TYPE_VIS hash<unsigned long>
|
||||||
: public unary_function<unsigned long, size_t>
|
: public unary_function<unsigned long, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1931,19 +1967,19 @@ struct _LIBCPP_VISIBLE hash<unsigned long>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<long long>
|
struct _LIBCPP_TYPE_VIS hash<long long>
|
||||||
: public __scalar_hash<long long>
|
: public __scalar_hash<long long>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<unsigned long long>
|
struct _LIBCPP_TYPE_VIS hash<unsigned long long>
|
||||||
: public __scalar_hash<unsigned long long>
|
: public __scalar_hash<unsigned long long>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<float>
|
struct _LIBCPP_TYPE_VIS hash<float>
|
||||||
: public __scalar_hash<float>
|
: public __scalar_hash<float>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1957,7 +1993,7 @@ struct _LIBCPP_VISIBLE hash<float>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<double>
|
struct _LIBCPP_TYPE_VIS hash<double>
|
||||||
: public __scalar_hash<double>
|
: public __scalar_hash<double>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -1971,7 +2007,7 @@ struct _LIBCPP_VISIBLE hash<double>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<long double>
|
struct _LIBCPP_TYPE_VIS hash<long double>
|
||||||
: public __scalar_hash<long double>
|
: public __scalar_hash<long double>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@@ -387,11 +387,11 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_errc)
|
|||||||
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
|
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE is_error_code_enum<future_errc> : public true_type {};
|
struct _LIBCPP_TYPE_VIS is_error_code_enum<future_errc> : public true_type {};
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE is_error_code_enum<future_errc::__lx> : public true_type { };
|
struct _LIBCPP_TYPE_VIS is_error_code_enum<future_errc::__lx> : public true_type { };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//enum class launch
|
//enum class launch
|
||||||
@@ -412,7 +412,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_status)
|
|||||||
};
|
};
|
||||||
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
|
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_FUNC_VIS
|
||||||
const error_category& future_category() _NOEXCEPT;
|
const error_category& future_category() _NOEXCEPT;
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -470,7 +470,11 @@ public:
|
|||||||
{return (__state_ & __constructed) || (__exception_ != nullptr);}
|
{return (__state_ & __constructed) || (__exception_ != nullptr);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __set_future_attached() {__state_ |= __future_attached;}
|
void __set_future_attached()
|
||||||
|
{
|
||||||
|
lock_guard<mutex> __lk(__mut_);
|
||||||
|
__state_ |= __future_attached;
|
||||||
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool __has_future_attached() const {return __state_ & __future_attached;}
|
bool __has_future_attached() const {return __state_ & __future_attached;}
|
||||||
|
|
||||||
@@ -962,12 +966,12 @@ __async_assoc_state<void, _Fp>::__on_zero_shared() _NOEXCEPT
|
|||||||
base::__on_zero_shared();
|
base::__on_zero_shared();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rp> class _LIBCPP_VISIBLE promise;
|
template <class _Rp> class _LIBCPP_TYPE_VIS promise;
|
||||||
template <class _Rp> class _LIBCPP_VISIBLE shared_future;
|
template <class _Rp> class _LIBCPP_TYPE_VIS shared_future;
|
||||||
|
|
||||||
// future
|
// future
|
||||||
|
|
||||||
template <class _Rp> class _LIBCPP_VISIBLE future;
|
template <class _Rp> class _LIBCPP_TYPE_VIS future;
|
||||||
|
|
||||||
template <class _Rp, class _Fp>
|
template <class _Rp, class _Fp>
|
||||||
future<_Rp>
|
future<_Rp>
|
||||||
@@ -986,7 +990,7 @@ __make_async_assoc_state(_Fp __f);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
class _LIBCPP_VISIBLE future
|
class _LIBCPP_TYPE_VIS future
|
||||||
{
|
{
|
||||||
__assoc_state<_Rp>* __state_;
|
__assoc_state<_Rp>* __state_;
|
||||||
|
|
||||||
@@ -1090,7 +1094,7 @@ future<_Rp>::get()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
class _LIBCPP_VISIBLE future<_Rp&>
|
class _LIBCPP_TYPE_VIS future<_Rp&>
|
||||||
{
|
{
|
||||||
__assoc_state<_Rp&>* __state_;
|
__assoc_state<_Rp&>* __state_;
|
||||||
|
|
||||||
@@ -1189,7 +1193,7 @@ future<_Rp&>::get()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE future<void>
|
class _LIBCPP_TYPE_VIS future<void>
|
||||||
{
|
{
|
||||||
__assoc_sub_state* __state_;
|
__assoc_sub_state* __state_;
|
||||||
|
|
||||||
@@ -1271,7 +1275,7 @@ swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
|
|||||||
template <class _Callable> class packaged_task;
|
template <class _Callable> class packaged_task;
|
||||||
|
|
||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
class _LIBCPP_VISIBLE promise
|
class _LIBCPP_TYPE_VIS promise
|
||||||
{
|
{
|
||||||
__assoc_state<_Rp>* __state_;
|
__assoc_state<_Rp>* __state_;
|
||||||
|
|
||||||
@@ -1449,7 +1453,7 @@ promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
|
|||||||
// promise<R&>
|
// promise<R&>
|
||||||
|
|
||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
class _LIBCPP_VISIBLE promise<_Rp&>
|
class _LIBCPP_TYPE_VIS promise<_Rp&>
|
||||||
{
|
{
|
||||||
__assoc_state<_Rp&>* __state_;
|
__assoc_state<_Rp&>* __state_;
|
||||||
|
|
||||||
@@ -1592,7 +1596,7 @@ promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
|
|||||||
// promise<void>
|
// promise<void>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE promise<void>
|
class _LIBCPP_TYPE_VIS promise<void>
|
||||||
{
|
{
|
||||||
__assoc_sub_state* __state_;
|
__assoc_sub_state* __state_;
|
||||||
|
|
||||||
@@ -1666,7 +1670,7 @@ swap(promise<_Rp>& __x, promise<_Rp>& __y) _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rp, class _Alloc>
|
template <class _Rp, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator<promise<_Rp>, _Alloc>
|
struct _LIBCPP_TYPE_VIS uses_allocator<promise<_Rp>, _Alloc>
|
||||||
: public true_type {};
|
: public true_type {};
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
@@ -1753,7 +1757,7 @@ template<class _Rp, class ..._ArgTypes>
|
|||||||
class __packaged_task_function<_Rp(_ArgTypes...)>
|
class __packaged_task_function<_Rp(_ArgTypes...)>
|
||||||
{
|
{
|
||||||
typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
|
typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
|
||||||
aligned_storage<3*sizeof(void*)>::type __buf_;
|
typename aligned_storage<3*sizeof(void*)>::type __buf_;
|
||||||
__base* __f_;
|
__base* __f_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -1930,7 +1934,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
class _LIBCPP_VISIBLE packaged_task<_Rp(_ArgTypes...)>
|
class _LIBCPP_TYPE_VIS packaged_task<_Rp(_ArgTypes...)>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Rp result_type;
|
typedef _Rp result_type;
|
||||||
@@ -2045,7 +2049,7 @@ packaged_task<_Rp(_ArgTypes...)>::reset()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class ..._ArgTypes>
|
template<class ..._ArgTypes>
|
||||||
class _LIBCPP_VISIBLE packaged_task<void(_ArgTypes...)>
|
class _LIBCPP_TYPE_VIS packaged_task<void(_ArgTypes...)>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef void result_type;
|
typedef void result_type;
|
||||||
@@ -2170,7 +2174,7 @@ swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Callable, class _Alloc>
|
template <class _Callable, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator<packaged_task<_Callable>, _Alloc>
|
struct _LIBCPP_TYPE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
|
||||||
: public true_type {};
|
: public true_type {};
|
||||||
|
|
||||||
template <class _Rp, class _Fp>
|
template <class _Rp, class _Fp>
|
||||||
@@ -2259,7 +2263,7 @@ async(_Fp&& __f, _Args&&... __args)
|
|||||||
// shared_future
|
// shared_future
|
||||||
|
|
||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
class _LIBCPP_VISIBLE shared_future
|
class _LIBCPP_TYPE_VIS shared_future
|
||||||
{
|
{
|
||||||
__assoc_state<_Rp>* __state_;
|
__assoc_state<_Rp>* __state_;
|
||||||
|
|
||||||
@@ -2333,7 +2337,7 @@ shared_future<_Rp>::operator=(const shared_future& __rhs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
class _LIBCPP_VISIBLE shared_future<_Rp&>
|
class _LIBCPP_TYPE_VIS shared_future<_Rp&>
|
||||||
{
|
{
|
||||||
__assoc_state<_Rp&>* __state_;
|
__assoc_state<_Rp&>* __state_;
|
||||||
|
|
||||||
@@ -2407,7 +2411,7 @@ shared_future<_Rp&>::operator=(const shared_future& __rhs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE shared_future<void>
|
class _LIBCPP_TYPE_VIS shared_future<void>
|
||||||
{
|
{
|
||||||
__assoc_sub_state* __state_;
|
__assoc_sub_state* __state_;
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ namespace std // purposefully not versioned
|
|||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
|
|
||||||
template<class _Ep>
|
template<class _Ep>
|
||||||
class _LIBCPP_VISIBLE initializer_list
|
class _LIBCPP_TYPE_VIS initializer_list
|
||||||
{
|
{
|
||||||
const _Ep* __begin_;
|
const _Ep* __begin_;
|
||||||
size_t __size_;
|
size_t __size_;
|
||||||
|
16
include/ios
16
include/ios
@@ -224,10 +224,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
typedef ptrdiff_t streamsize;
|
typedef ptrdiff_t streamsize;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE ios_base
|
class _LIBCPP_TYPE_VIS ios_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class _LIBCPP_VISIBLE failure;
|
class _LIBCPP_TYPE_VIS failure;
|
||||||
|
|
||||||
typedef unsigned int fmtflags;
|
typedef unsigned int fmtflags;
|
||||||
static const fmtflags boolalpha = 0x0001;
|
static const fmtflags boolalpha = 0x0001;
|
||||||
@@ -271,7 +271,7 @@ public:
|
|||||||
typedef _VSTD::streamoff streamoff;
|
typedef _VSTD::streamoff streamoff;
|
||||||
typedef _VSTD::streampos streampos;
|
typedef _VSTD::streampos streampos;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE Init;
|
class _LIBCPP_TYPE_VIS Init;
|
||||||
|
|
||||||
// 27.5.2.2 fmtflags state:
|
// 27.5.2.2 fmtflags state:
|
||||||
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
|
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
|
||||||
@@ -380,14 +380,14 @@ _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
|
|||||||
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
|
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc> : public true_type { };
|
struct _LIBCPP_TYPE_VIS is_error_code_enum<io_errc> : public true_type { };
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc::__lx> : public true_type { };
|
struct _LIBCPP_TYPE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_FUNC_VIS
|
||||||
const error_category& iostream_category();
|
const error_category& iostream_category();
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -413,7 +413,7 @@ public:
|
|||||||
virtual ~failure() throw();
|
virtual ~failure() throw();
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE ios_base::Init
|
class _LIBCPP_TYPE_VIS ios_base::Init
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Init();
|
Init();
|
||||||
@@ -560,7 +560,7 @@ ios_base::exceptions(iostate __except)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_ios
|
class _LIBCPP_TYPE_VIS basic_ios
|
||||||
: public ios_base
|
: public ios_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -95,49 +95,49 @@ typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE ios_base;
|
class _LIBCPP_TYPE_VIS ios_base;
|
||||||
|
|
||||||
template<class _CharT> struct _LIBCPP_VISIBLE char_traits;
|
template<class _CharT> struct _LIBCPP_TYPE_VIS char_traits;
|
||||||
template<class _Tp> class _LIBCPP_VISIBLE allocator;
|
template<class _Tp> class _LIBCPP_TYPE_VIS allocator;
|
||||||
|
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_ios;
|
class _LIBCPP_TYPE_VIS basic_ios;
|
||||||
|
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_streambuf;
|
class _LIBCPP_TYPE_VIS basic_streambuf;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_istream;
|
class _LIBCPP_TYPE_VIS basic_istream;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_ostream;
|
class _LIBCPP_TYPE_VIS basic_ostream;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_iostream;
|
class _LIBCPP_TYPE_VIS basic_iostream;
|
||||||
|
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||||
class _Allocator = allocator<_CharT> >
|
class _Allocator = allocator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_stringbuf;
|
class _LIBCPP_TYPE_VIS basic_stringbuf;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||||
class _Allocator = allocator<_CharT> >
|
class _Allocator = allocator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_istringstream;
|
class _LIBCPP_TYPE_VIS basic_istringstream;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||||
class _Allocator = allocator<_CharT> >
|
class _Allocator = allocator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_ostringstream;
|
class _LIBCPP_TYPE_VIS basic_ostringstream;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT>,
|
template <class _CharT, class _Traits = char_traits<_CharT>,
|
||||||
class _Allocator = allocator<_CharT> >
|
class _Allocator = allocator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_stringstream;
|
class _LIBCPP_TYPE_VIS basic_stringstream;
|
||||||
|
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_filebuf;
|
class _LIBCPP_TYPE_VIS basic_filebuf;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_ifstream;
|
class _LIBCPP_TYPE_VIS basic_ifstream;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_ofstream;
|
class _LIBCPP_TYPE_VIS basic_ofstream;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_fstream;
|
class _LIBCPP_TYPE_VIS basic_fstream;
|
||||||
|
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE istreambuf_iterator;
|
class _LIBCPP_TYPE_VIS istreambuf_iterator;
|
||||||
template <class _CharT, class _Traits = char_traits<_CharT> >
|
template <class _CharT, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE ostreambuf_iterator;
|
class _LIBCPP_TYPE_VIS ostreambuf_iterator;
|
||||||
|
|
||||||
typedef basic_ios<char> ios;
|
typedef basic_ios<char> ios;
|
||||||
typedef basic_ios<wchar_t> wios;
|
typedef basic_ios<wchar_t> wios;
|
||||||
@@ -172,7 +172,7 @@ typedef basic_ifstream<wchar_t> wifstream;
|
|||||||
typedef basic_ofstream<wchar_t> wofstream;
|
typedef basic_ofstream<wchar_t> wofstream;
|
||||||
typedef basic_fstream<wchar_t> wfstream;
|
typedef basic_fstream<wchar_t> wfstream;
|
||||||
|
|
||||||
template <class _State> class _LIBCPP_VISIBLE fpos;
|
template <class _State> class _LIBCPP_TYPE_VIS fpos;
|
||||||
typedef fpos<mbstate_t> streampos;
|
typedef fpos<mbstate_t> streampos;
|
||||||
typedef fpos<mbstate_t> wstreampos;
|
typedef fpos<mbstate_t> wstreampos;
|
||||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||||
@@ -185,7 +185,7 @@ typedef long long streamoff; // for char_traits in <string>
|
|||||||
template <class _CharT, // for <stdexcept>
|
template <class _CharT, // for <stdexcept>
|
||||||
class _Traits = char_traits<_CharT>,
|
class _Traits = char_traits<_CharT>,
|
||||||
class _Allocator = allocator<_CharT> >
|
class _Allocator = allocator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_string;
|
class _LIBCPP_TYPE_VIS basic_string;
|
||||||
typedef basic_string<char, char_traits<char>, allocator<char> > string;
|
typedef basic_string<char, char_traits<char>, allocator<char> > string;
|
||||||
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
|
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
|
||||||
|
|
||||||
|
@@ -46,14 +46,14 @@ extern wostream wclog;
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
extern _LIBCPP_VISIBLE istream cin;
|
extern _LIBCPP_FUNC_VIS istream cin;
|
||||||
extern _LIBCPP_VISIBLE ostream cout;
|
extern _LIBCPP_FUNC_VIS ostream cout;
|
||||||
extern _LIBCPP_VISIBLE ostream cerr;
|
extern _LIBCPP_FUNC_VIS ostream cerr;
|
||||||
extern _LIBCPP_VISIBLE ostream clog;
|
extern _LIBCPP_FUNC_VIS ostream clog;
|
||||||
extern _LIBCPP_VISIBLE wistream wcin;
|
extern _LIBCPP_FUNC_VIS wistream wcin;
|
||||||
extern _LIBCPP_VISIBLE wostream wcout;
|
extern _LIBCPP_FUNC_VIS wostream wcout;
|
||||||
extern _LIBCPP_VISIBLE wostream wcerr;
|
extern _LIBCPP_FUNC_VIS wostream wcerr;
|
||||||
extern _LIBCPP_VISIBLE wostream wclog;
|
extern _LIBCPP_FUNC_VIS wostream wclog;
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
|
||||||
|
@@ -164,7 +164,7 @@ template <class charT, class traits, class T>
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_istream
|
class _LIBCPP_TYPE_VIS basic_istream
|
||||||
: virtual public basic_ios<_CharT, _Traits>
|
: virtual public basic_ios<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
streamsize __gc_;
|
streamsize __gc_;
|
||||||
@@ -194,7 +194,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// 27.7.1.1.3 Prefix/suffix:
|
// 27.7.1.1.3 Prefix/suffix:
|
||||||
class _LIBCPP_VISIBLE sentry;
|
class _LIBCPP_TYPE_VIS sentry;
|
||||||
|
|
||||||
// 27.7.1.2 Formatted input:
|
// 27.7.1.2 Formatted input:
|
||||||
basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
|
basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
|
||||||
@@ -244,7 +244,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_istream<_CharT, _Traits>::sentry
|
class _LIBCPP_TYPE_VIS basic_istream<_CharT, _Traits>::sentry
|
||||||
{
|
{
|
||||||
bool __ok_;
|
bool __ok_;
|
||||||
|
|
||||||
@@ -1216,16 +1216,9 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
|
|||||||
sentry __sen(*this, true);
|
sentry __sen(*this, true);
|
||||||
if (__sen)
|
if (__sen)
|
||||||
{
|
{
|
||||||
for (; __gc_ < __n; ++__gc_)
|
__gc_ = this->rdbuf()->sgetn(__s, __n);
|
||||||
{
|
if (__gc_ != __n)
|
||||||
typename traits_type::int_type __i = this->rdbuf()->sbumpc();
|
this->setstate(ios_base::failbit | ios_base::eofbit);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this->setstate(ios_base::failbit);
|
this->setstate(ios_base::failbit);
|
||||||
@@ -1243,6 +1236,7 @@ template<class _CharT, class _Traits>
|
|||||||
streamsize
|
streamsize
|
||||||
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
|
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
|
||||||
{
|
{
|
||||||
|
__gc_ = 0;
|
||||||
streamsize __c = this->rdbuf()->in_avail();
|
streamsize __c = this->rdbuf()->in_avail();
|
||||||
switch (__c)
|
switch (__c)
|
||||||
{
|
{
|
||||||
@@ -1459,7 +1453,7 @@ operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
|
|||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_iostream
|
class _LIBCPP_TYPE_VIS basic_iostream
|
||||||
: public basic_istream<_CharT, _Traits>,
|
: public basic_istream<_CharT, _Traits>,
|
||||||
public basic_ostream<_CharT, _Traits>
|
public basic_ostream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
|
@@ -317,6 +317,10 @@ template <class T, size_t N> T* end(T (&array)[N]);
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <Availability.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _LIBCPP_DEBUG
|
#ifdef _LIBCPP_DEBUG
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#endif
|
#endif
|
||||||
@@ -327,11 +331,11 @@ template <class T, size_t N> T* end(T (&array)[N]);
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE input_iterator_tag {};
|
struct _LIBCPP_TYPE_VIS input_iterator_tag {};
|
||||||
struct _LIBCPP_VISIBLE output_iterator_tag {};
|
struct _LIBCPP_TYPE_VIS output_iterator_tag {};
|
||||||
struct _LIBCPP_VISIBLE forward_iterator_tag : public input_iterator_tag {};
|
struct _LIBCPP_TYPE_VIS forward_iterator_tag : public input_iterator_tag {};
|
||||||
struct _LIBCPP_VISIBLE bidirectional_iterator_tag : public forward_iterator_tag {};
|
struct _LIBCPP_TYPE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||||
struct _LIBCPP_VISIBLE random_access_iterator_tag : public bidirectional_iterator_tag {};
|
struct _LIBCPP_TYPE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct __has_iterator_category
|
struct __has_iterator_category
|
||||||
@@ -374,11 +378,11 @@ struct __iterator_traits<_Iter, true>
|
|||||||
// the client expects instead of failing at compile time.
|
// the client expects instead of failing at compile time.
|
||||||
|
|
||||||
template <class _Iter>
|
template <class _Iter>
|
||||||
struct _LIBCPP_VISIBLE iterator_traits
|
struct _LIBCPP_TYPE_VIS iterator_traits
|
||||||
: __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};
|
: __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
struct _LIBCPP_VISIBLE iterator_traits<_Tp*>
|
struct _LIBCPP_TYPE_VIS iterator_traits<_Tp*>
|
||||||
{
|
{
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef typename remove_const<_Tp>::type value_type;
|
typedef typename remove_const<_Tp>::type value_type;
|
||||||
@@ -409,7 +413,7 @@ struct __is_random_access_iterator : public __has_iterator_category_convertible_
|
|||||||
|
|
||||||
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
|
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
|
||||||
class _Pointer = _Tp*, class _Reference = _Tp&>
|
class _Pointer = _Tp*, class _Reference = _Tp&>
|
||||||
struct _LIBCPP_VISIBLE iterator
|
struct _LIBCPP_TYPE_VIS iterator
|
||||||
{
|
{
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
typedef _Distance difference_type;
|
typedef _Distance difference_type;
|
||||||
@@ -506,7 +510,7 @@ prev(_BidiretionalIter __x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Iter>
|
template <class _Iter>
|
||||||
class _LIBCPP_VISIBLE reverse_iterator
|
class _LIBCPP_TYPE_VIS reverse_iterator
|
||||||
: public iterator<typename iterator_traits<_Iter>::iterator_category,
|
: public iterator<typename iterator_traits<_Iter>::iterator_category,
|
||||||
typename iterator_traits<_Iter>::value_type,
|
typename iterator_traits<_Iter>::value_type,
|
||||||
typename iterator_traits<_Iter>::difference_type,
|
typename iterator_traits<_Iter>::difference_type,
|
||||||
@@ -613,7 +617,7 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Container>
|
template <class _Container>
|
||||||
class _LIBCPP_VISIBLE back_insert_iterator
|
class _LIBCPP_TYPE_VIS back_insert_iterator
|
||||||
: public iterator<output_iterator_tag,
|
: public iterator<output_iterator_tag,
|
||||||
void,
|
void,
|
||||||
void,
|
void,
|
||||||
@@ -646,7 +650,7 @@ back_inserter(_Container& __x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Container>
|
template <class _Container>
|
||||||
class _LIBCPP_VISIBLE front_insert_iterator
|
class _LIBCPP_TYPE_VIS front_insert_iterator
|
||||||
: public iterator<output_iterator_tag,
|
: public iterator<output_iterator_tag,
|
||||||
void,
|
void,
|
||||||
void,
|
void,
|
||||||
@@ -679,7 +683,7 @@ front_inserter(_Container& __x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Container>
|
template <class _Container>
|
||||||
class _LIBCPP_VISIBLE insert_iterator
|
class _LIBCPP_TYPE_VIS insert_iterator
|
||||||
: public iterator<output_iterator_tag,
|
: public iterator<output_iterator_tag,
|
||||||
void,
|
void,
|
||||||
void,
|
void,
|
||||||
@@ -715,7 +719,7 @@ inserter(_Container& __x, typename _Container::iterator __i)
|
|||||||
|
|
||||||
template <class _Tp, class _CharT = char,
|
template <class _Tp, class _CharT = char,
|
||||||
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
|
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
|
||||||
class _LIBCPP_VISIBLE istream_iterator
|
class _LIBCPP_TYPE_VIS istream_iterator
|
||||||
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
|
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -754,7 +758,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
|
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE ostream_iterator
|
class _LIBCPP_TYPE_VIS ostream_iterator
|
||||||
: public iterator<output_iterator_tag, void, void, void, void>
|
: public iterator<output_iterator_tag, void, void, void, void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -783,7 +787,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _CharT, class _Traits>
|
template<class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE istreambuf_iterator
|
class _LIBCPP_TYPE_VIS istreambuf_iterator
|
||||||
: public iterator<input_iterator_tag, _CharT,
|
: public iterator<input_iterator_tag, _CharT,
|
||||||
typename _Traits::off_type, _CharT*,
|
typename _Traits::off_type, _CharT*,
|
||||||
_CharT>
|
_CharT>
|
||||||
@@ -795,7 +799,7 @@ public:
|
|||||||
typedef basic_streambuf<_CharT,_Traits> streambuf_type;
|
typedef basic_streambuf<_CharT,_Traits> streambuf_type;
|
||||||
typedef basic_istream<_CharT,_Traits> istream_type;
|
typedef basic_istream<_CharT,_Traits> istream_type;
|
||||||
private:
|
private:
|
||||||
streambuf_type* __sbuf_;
|
mutable streambuf_type* __sbuf_;
|
||||||
|
|
||||||
class __proxy
|
class __proxy
|
||||||
{
|
{
|
||||||
@@ -809,17 +813,18 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __test_for_eof()
|
bool __test_for_eof() const
|
||||||
{
|
{
|
||||||
if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
|
if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
|
||||||
__sbuf_ = 0;
|
__sbuf_ = 0;
|
||||||
|
return __sbuf_ == 0;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
|
||||||
: __sbuf_(__s.rdbuf()) {__test_for_eof();}
|
: __sbuf_(__s.rdbuf()) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
|
||||||
: __sbuf_(__s) {__test_for_eof();}
|
: __sbuf_(__s) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
|
||||||
: __sbuf_(__p.__sbuf_) {}
|
: __sbuf_(__p.__sbuf_) {}
|
||||||
|
|
||||||
@@ -828,19 +833,16 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}
|
_LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
|
||||||
{
|
{
|
||||||
if (traits_type::eq_int_type(__sbuf_->snextc(), traits_type::eof()))
|
__sbuf_->sbumpc();
|
||||||
__sbuf_ = 0;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY __proxy operator++(int)
|
_LIBCPP_INLINE_VISIBILITY __proxy operator++(int)
|
||||||
{
|
{
|
||||||
char_type __c = __sbuf_->sgetc();
|
return __proxy(__sbuf_->sbumpc(), __sbuf_);
|
||||||
++(*this);
|
|
||||||
return __proxy(__c, __sbuf_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
|
_LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
|
||||||
{return (__sbuf_ == 0) == (__b.__sbuf_ == 0);}
|
{return __test_for_eof() == __b.__test_for_eof();}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
@@ -856,7 +858,7 @@ bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
|
|||||||
{return !__a.equal(__b);}
|
{return !__a.equal(__b);}
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE ostreambuf_iterator
|
class _LIBCPP_TYPE_VIS ostreambuf_iterator
|
||||||
: public iterator<output_iterator_tag, void, void, void, void>
|
: public iterator<output_iterator_tag, void, void, void, void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -882,6 +884,10 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}
|
_LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}
|
||||||
|
|
||||||
|
#if !defined(__APPLE__) || \
|
||||||
|
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \
|
||||||
|
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)
|
||||||
|
|
||||||
template <class _Ch, class _Tr>
|
template <class _Ch, class _Tr>
|
||||||
friend
|
friend
|
||||||
_LIBCPP_HIDDEN
|
_LIBCPP_HIDDEN
|
||||||
@@ -889,10 +895,11 @@ public:
|
|||||||
__pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
|
__pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
|
||||||
const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
|
const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
|
||||||
ios_base& __iob, _Ch __fl);
|
ios_base& __iob, _Ch __fl);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Iter>
|
template <class _Iter>
|
||||||
class _LIBCPP_VISIBLE move_iterator
|
class _LIBCPP_TYPE_VIS move_iterator
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
_Iter __i;
|
_Iter __i;
|
||||||
|
196
include/limits
196
include/limits
@@ -433,7 +433,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE numeric_limits
|
class _LIBCPP_TYPE_VIS numeric_limits
|
||||||
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
|
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
|
||||||
{
|
{
|
||||||
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
|
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
|
||||||
@@ -479,7 +479,54 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE numeric_limits<const _Tp>
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style;
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
class _LIBCPP_TYPE_VIS numeric_limits<const _Tp>
|
||||||
: private numeric_limits<_Tp>
|
: private numeric_limits<_Tp>
|
||||||
{
|
{
|
||||||
typedef numeric_limits<_Tp> __base;
|
typedef numeric_limits<_Tp> __base;
|
||||||
@@ -525,7 +572,54 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE numeric_limits<volatile _Tp>
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_specialized;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_signed;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_integer;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_exact;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::radix;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_infinity;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_quiet_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_signaling_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const _Tp>::has_denorm;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_denorm_loss;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_iec559;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_bounded;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_modulo;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::traps;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::tinyness_before;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style;
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
class _LIBCPP_TYPE_VIS numeric_limits<volatile _Tp>
|
||||||
: private numeric_limits<_Tp>
|
: private numeric_limits<_Tp>
|
||||||
{
|
{
|
||||||
typedef numeric_limits<_Tp> __base;
|
typedef numeric_limits<_Tp> __base;
|
||||||
@@ -571,7 +665,54 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE numeric_limits<const volatile _Tp>
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_specialized;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_signed;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_integer;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_exact;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::radix;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_infinity;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_quiet_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_signaling_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<volatile _Tp>::has_denorm;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_denorm_loss;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_iec559;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_bounded;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_modulo;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::traps;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::tinyness_before;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style;
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
class _LIBCPP_TYPE_VIS numeric_limits<const volatile _Tp>
|
||||||
: private numeric_limits<_Tp>
|
: private numeric_limits<_Tp>
|
||||||
{
|
{
|
||||||
typedef numeric_limits<_Tp> __base;
|
typedef numeric_limits<_Tp> __base;
|
||||||
@@ -616,6 +757,53 @@ public:
|
|||||||
static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
|
static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_specialized;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
const int numeric_limits<const volatile _Tp>::max_digits10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_signed;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_integer;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_exact;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::radix;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent10;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_infinity;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_quiet_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_signaling_NaN;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const volatile _Tp>::has_denorm;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_denorm_loss;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_iec559;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_bounded;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_modulo;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::traps;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::tinyness_before;
|
||||||
|
template <class _Tp>
|
||||||
|
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<const volatile _Tp>::round_style;
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
|
||||||
#endif // _LIBCPP_LIMITS
|
#endif // _LIBCPP_LIMITS
|
||||||
|
23
include/list
23
include/list
@@ -213,12 +213,12 @@ struct __list_node
|
|||||||
_Tp __value_;
|
_Tp __value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Alloc> class _LIBCPP_VISIBLE list;
|
template <class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS list;
|
||||||
template <class _Tp, class _Alloc> class __list_imp;
|
template <class _Tp, class _Alloc> class __list_imp;
|
||||||
template <class _Tp, class _VoidPtr> class _LIBCPP_VISIBLE __list_const_iterator;
|
template <class _Tp, class _VoidPtr> class _LIBCPP_TYPE_VIS __list_const_iterator;
|
||||||
|
|
||||||
template <class _Tp, class _VoidPtr>
|
template <class _Tp, class _VoidPtr>
|
||||||
class _LIBCPP_VISIBLE __list_iterator
|
class _LIBCPP_TYPE_VIS __list_iterator
|
||||||
{
|
{
|
||||||
typedef typename pointer_traits<_VoidPtr>::template
|
typedef typename pointer_traits<_VoidPtr>::template
|
||||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
@@ -348,7 +348,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _VoidPtr>
|
template <class _Tp, class _VoidPtr>
|
||||||
class _LIBCPP_VISIBLE __list_const_iterator
|
class _LIBCPP_TYPE_VIS __list_const_iterator
|
||||||
{
|
{
|
||||||
typedef typename pointer_traits<_VoidPtr>::template
|
typedef typename pointer_traits<_VoidPtr>::template
|
||||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
@@ -394,7 +394,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__list_const_iterator(__list_iterator<_Tp, _VoidPtr> __p) _NOEXCEPT
|
__list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
|
||||||
: __ptr_(__p.__ptr_)
|
: __ptr_(__p.__ptr_)
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
@@ -767,7 +767,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Alloc = allocator<_Tp> >
|
template <class _Tp, class _Alloc = allocator<_Tp> >
|
||||||
class _LIBCPP_VISIBLE list
|
class _LIBCPP_TYPE_VIS list
|
||||||
: private __list_imp<_Tp, _Alloc>
|
: private __list_imp<_Tp, _Alloc>
|
||||||
{
|
{
|
||||||
typedef __list_imp<_Tp, _Alloc> base;
|
typedef __list_imp<_Tp, _Alloc> base;
|
||||||
@@ -1292,7 +1292,11 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
|
|||||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
||||||
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
|
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
|
||||||
++base::__sz();
|
++base::__sz();
|
||||||
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
|
return iterator(__hold.release(), this);
|
||||||
|
#else
|
||||||
return iterator(__hold.release());
|
return iterator(__hold.release());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
@@ -1518,6 +1522,11 @@ template <class... _Args>
|
|||||||
typename list<_Tp, _Alloc>::iterator
|
typename list<_Tp, _Alloc>::iterator
|
||||||
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
|
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
|
||||||
{
|
{
|
||||||
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
|
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
||||||
|
"list::emplace(iterator, args...) called with an iterator not"
|
||||||
|
" referring to this list");
|
||||||
|
#endif
|
||||||
__node_allocator& __na = base::__node_alloc();
|
__node_allocator& __na = base::__node_alloc();
|
||||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||||
@@ -1624,6 +1633,8 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
|
|||||||
"list::erase(iterator) called with an iterator not"
|
"list::erase(iterator) called with an iterator not"
|
||||||
" referring to this list");
|
" referring to this list");
|
||||||
#endif
|
#endif
|
||||||
|
_LIBCPP_ASSERT(__p != end(),
|
||||||
|
"list::erase(iterator) called with a non-dereferenceable iterator");
|
||||||
__node_allocator& __na = base::__node_alloc();
|
__node_allocator& __na = base::__node_alloc();
|
||||||
__node& __n = const_cast<__node&>(*__p.__ptr_);
|
__node& __n = const_cast<__node&>(*__p.__ptr_);
|
||||||
__node_pointer __r = __n.__next_;
|
__node_pointer __r = __n.__next_;
|
||||||
|
247
include/locale
247
include/locale
@@ -181,17 +181,21 @@ template <class charT> class messages_byname;
|
|||||||
#include <streambuf>
|
#include <streambuf>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#if !__APPLE__
|
#ifndef __APPLE__
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#endif
|
#endif
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
#include <support/win32/locale_win32.h>
|
#include <support/win32/locale_win32.h>
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
#include <nl_types.h>
|
#include <nl_types.h>
|
||||||
#endif // !_WIN32
|
#endif // !_WIN32
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <Availability.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <__undef_min_max>
|
#include <__undef_min_max>
|
||||||
|
|
||||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||||
@@ -200,7 +204,7 @@ template <class charT> class messages_byname;
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
#if __APPLE__ || __FreeBSD__
|
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||||
# define _LIBCPP_GET_C_LOCALE 0
|
# define _LIBCPP_GET_C_LOCALE 0
|
||||||
#else
|
#else
|
||||||
# define _LIBCPP_GET_C_LOCALE __cloc()
|
# define _LIBCPP_GET_C_LOCALE __cloc()
|
||||||
@@ -218,7 +222,7 @@ typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
|
|||||||
// OSX has nice foo_l() functions that let you turn off use of the global
|
// OSX has nice foo_l() functions that let you turn off use of the global
|
||||||
// locale. Linux, not so much. The following functions avoid the locale when
|
// locale. Linux, not so much. The following functions avoid the locale when
|
||||||
// that's possible and otherwise do the wrong thing. FIXME.
|
// that's possible and otherwise do the wrong thing. FIXME.
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(EMSCRIPTEN)
|
||||||
|
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
|
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
|
||||||
@@ -350,7 +354,7 @@ size_t __mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE inline
|
inline
|
||||||
int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
|
int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
|
||||||
va_list __va;
|
va_list __va;
|
||||||
va_start(__va, __format);
|
va_start(__va, __format);
|
||||||
@@ -364,7 +368,7 @@ int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
|
|||||||
return __res;
|
return __res;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE inline
|
inline
|
||||||
int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
|
int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
|
||||||
va_list __va;
|
va_list __va;
|
||||||
va_start(__va, __format);
|
va_start(__va, __format);
|
||||||
@@ -378,7 +382,7 @@ int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...)
|
|||||||
return __res;
|
return __res;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE inline
|
inline
|
||||||
int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
|
int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
|
||||||
va_list __va;
|
va_list __va;
|
||||||
va_start(__va, __format);
|
va_start(__va, __format);
|
||||||
@@ -392,7 +396,7 @@ int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
|
|||||||
return __res;
|
return __res;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE inline
|
inline
|
||||||
int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
|
int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
|
||||||
va_list __va;
|
va_list __va;
|
||||||
va_start(__va, __format);
|
va_start(__va, __format);
|
||||||
@@ -630,8 +634,7 @@ __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*&
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (__a_end-__a < __num_get_buf_sz - 1)
|
*__a_end++ = __src[__f];
|
||||||
*__a_end++ = __src[__f];
|
|
||||||
++__dc;
|
++__dc;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -669,23 +672,26 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
|
|||||||
char __x = __src[__f];
|
char __x = __src[__f];
|
||||||
if (__x == '-' || __x == '+')
|
if (__x == '-' || __x == '+')
|
||||||
{
|
{
|
||||||
if (__a_end == __a || (__a_end[-1] & 0xDF) == __exp)
|
if (__a_end == __a || (__a_end[-1] & 0x5F) == (__exp & 0x7F))
|
||||||
{
|
{
|
||||||
*__a_end++ = __x;
|
*__a_end++ = __x;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (__a_end-__a < __num_get_buf_sz - 1)
|
|
||||||
*__a_end++ = __x;
|
|
||||||
if (__x == 'x' || __x == 'X')
|
if (__x == 'x' || __x == 'X')
|
||||||
__exp = 'P';
|
__exp = 'P';
|
||||||
else if ((__x & 0xDF) == __exp)
|
else if ((__x & 0x5F) == __exp)
|
||||||
{
|
{
|
||||||
__in_units = false;
|
__exp |= 0x80;
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_buf_sz)
|
if (__in_units)
|
||||||
*__g_end++ = __dc;
|
{
|
||||||
|
__in_units = false;
|
||||||
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_buf_sz)
|
||||||
|
*__g_end++ = __dc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
*__a_end++ = __x;
|
||||||
if (__f >= 22)
|
if (__f >= 22)
|
||||||
return 0;
|
return 0;
|
||||||
++__dc;
|
++__dc;
|
||||||
@@ -696,7 +702,7 @@ _LIBCPP_EXTERN_TEMPLATE(struct __num_get<char>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(struct __num_get<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(struct __num_get<wchar_t>)
|
||||||
|
|
||||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE num_get
|
class _LIBCPP_TYPE_VIS num_get
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
private __num_get<_CharT>
|
private __num_get<_CharT>
|
||||||
{
|
{
|
||||||
@@ -826,11 +832,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
|
|||||||
{
|
{
|
||||||
if (__a != __a_end)
|
if (__a != __a_end)
|
||||||
{
|
{
|
||||||
int __save_errno = errno;
|
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
char *__p2;
|
char *__p2;
|
||||||
long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
||||||
int __current_errno = errno;
|
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
||||||
if (__current_errno == 0)
|
if (__current_errno == 0)
|
||||||
errno = __save_errno;
|
errno = __save_errno;
|
||||||
if (__p2 != __a_end)
|
if (__p2 != __a_end)
|
||||||
@@ -866,11 +872,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
|
|||||||
__err = ios_base::failbit;
|
__err = ios_base::failbit;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int __save_errno = errno;
|
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
char *__p2;
|
char *__p2;
|
||||||
unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
||||||
int __current_errno = errno;
|
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
||||||
if (__current_errno == 0)
|
if (__current_errno == 0)
|
||||||
errno = __save_errno;
|
errno = __save_errno;
|
||||||
if (__p2 != __a_end)
|
if (__p2 != __a_end)
|
||||||
@@ -896,13 +902,20 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
|
|||||||
{
|
{
|
||||||
if (__a != __a_end)
|
if (__a != __a_end)
|
||||||
{
|
{
|
||||||
|
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
||||||
|
errno = 0;
|
||||||
char *__p2;
|
char *__p2;
|
||||||
long double __ld = strtold_l(__a, &__p2, _LIBCPP_GET_C_LOCALE);
|
long double __ld = strtold_l(__a, &__p2, _LIBCPP_GET_C_LOCALE);
|
||||||
|
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
||||||
|
if (__current_errno == 0)
|
||||||
|
errno = __save_errno;
|
||||||
if (__p2 != __a_end)
|
if (__p2 != __a_end)
|
||||||
{
|
{
|
||||||
__err = ios_base::failbit;
|
__err = ios_base::failbit;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if (__current_errno == ERANGE)
|
||||||
|
__err = ios_base::failbit;
|
||||||
return static_cast<_Tp>(__ld);
|
return static_cast<_Tp>(__ld);
|
||||||
}
|
}
|
||||||
__err = ios_base::failbit;
|
__err = ios_base::failbit;
|
||||||
@@ -958,16 +971,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
char_type __atoms[26];
|
char_type __atoms[26];
|
||||||
char_type __thousands_sep;
|
char_type __thousands_sep;
|
||||||
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping, __g, __g_end,
|
__thousands_sep, __grouping, __g, __g_end,
|
||||||
__atoms))
|
__atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -993,16 +1018,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
char_type __atoms[26];
|
char_type __atoms[26];
|
||||||
char_type __thousands_sep;
|
char_type __thousands_sep;
|
||||||
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping, __g, __g_end,
|
__thousands_sep, __grouping, __g, __g_end,
|
||||||
__atoms))
|
__atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1028,16 +1065,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
char_type __atoms[26];
|
char_type __atoms[26];
|
||||||
char_type __thousands_sep;
|
char_type __thousands_sep;
|
||||||
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping, __g, __g_end,
|
__thousands_sep, __grouping, __g, __g_end,
|
||||||
__atoms))
|
__atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1063,16 +1112,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
char_type __atoms[26];
|
char_type __atoms[26];
|
||||||
char_type __thousands_sep;
|
char_type __thousands_sep;
|
||||||
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping, __g, __g_end,
|
__thousands_sep, __grouping, __g, __g_end,
|
||||||
__atoms))
|
__atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1098,16 +1159,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
char_type __atoms[26];
|
char_type __atoms[26];
|
||||||
char_type __thousands_sep;
|
char_type __thousands_sep;
|
||||||
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping, __g, __g_end,
|
__thousands_sep, __grouping, __g, __g_end,
|
||||||
__atoms))
|
__atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1133,16 +1206,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
char_type __atoms[26];
|
char_type __atoms[26];
|
||||||
char_type __thousands_sep;
|
char_type __thousands_sep;
|
||||||
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping, __g, __g_end,
|
__thousands_sep, __grouping, __g, __g_end,
|
||||||
__atoms))
|
__atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1170,7 +1255,9 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
string __grouping = this->__stage2_float_prep(__iob, __atoms,
|
string __grouping = this->__stage2_float_prep(__iob, __atoms,
|
||||||
__decimal_point,
|
__decimal_point,
|
||||||
__thousands_sep);
|
__thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
@@ -1178,11 +1265,21 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
bool __in_units = true;
|
bool __in_units = true;
|
||||||
char __exp = 'E';
|
char __exp = 'E';
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
|
if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
|
||||||
__decimal_point, __thousands_sep,
|
__decimal_point, __thousands_sep,
|
||||||
__grouping, __g, __g_end,
|
__grouping, __g, __g_end,
|
||||||
__dc, __atoms))
|
__dc, __atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1210,7 +1307,9 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
string __grouping = this->__stage2_float_prep(__iob, __atoms,
|
string __grouping = this->__stage2_float_prep(__iob, __atoms,
|
||||||
__decimal_point,
|
__decimal_point,
|
||||||
__thousands_sep);
|
__thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
@@ -1218,11 +1317,21 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
bool __in_units = true;
|
bool __in_units = true;
|
||||||
char __exp = 'E';
|
char __exp = 'E';
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
|
if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
|
||||||
__decimal_point, __thousands_sep,
|
__decimal_point, __thousands_sep,
|
||||||
__grouping, __g, __g_end,
|
__grouping, __g, __g_end,
|
||||||
__dc, __atoms))
|
__dc, __atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1250,7 +1359,9 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
string __grouping = this->__stage2_float_prep(__iob, __atoms,
|
string __grouping = this->__stage2_float_prep(__iob, __atoms,
|
||||||
__decimal_point,
|
__decimal_point,
|
||||||
__thousands_sep);
|
__thousands_sep);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
@@ -1258,11 +1369,21 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
bool __in_units = true;
|
bool __in_units = true;
|
||||||
char __exp = 'E';
|
char __exp = 'E';
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
|
if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
|
||||||
__decimal_point, __thousands_sep,
|
__decimal_point, __thousands_sep,
|
||||||
__grouping, __g, __g_end,
|
__grouping, __g, __g_end,
|
||||||
__dc, __atoms))
|
__dc, __atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
|
||||||
*__g_end++ = __dc;
|
*__g_end++ = __dc;
|
||||||
// Stage 3
|
// Stage 3
|
||||||
@@ -1290,16 +1411,28 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
string __grouping;
|
string __grouping;
|
||||||
use_facet<ctype<_CharT> >(__iob.getloc()).widen(__num_get_base::__src,
|
use_facet<ctype<_CharT> >(__iob.getloc()).widen(__num_get_base::__src,
|
||||||
__num_get_base::__src + 26, __atoms);
|
__num_get_base::__src + 26, __atoms);
|
||||||
char __a[__num_get_base::__num_get_buf_sz] = {0};
|
string __buf;
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
char* __a = &__buf[0];
|
||||||
char* __a_end = __a;
|
char* __a_end = __a;
|
||||||
unsigned __g[__num_get_base::__num_get_buf_sz];
|
unsigned __g[__num_get_base::__num_get_buf_sz];
|
||||||
unsigned* __g_end = __g;
|
unsigned* __g_end = __g;
|
||||||
unsigned __dc = 0;
|
unsigned __dc = 0;
|
||||||
for (; __b != __e; ++__b)
|
for (; __b != __e; ++__b)
|
||||||
|
{
|
||||||
|
if (__a_end - __a == __buf.size())
|
||||||
|
{
|
||||||
|
size_t __tmp = __buf.size();
|
||||||
|
__buf.resize(2*__buf.size());
|
||||||
|
__buf.resize(__buf.capacity());
|
||||||
|
__a = &__buf[0];
|
||||||
|
__a_end = __a + __tmp;
|
||||||
|
}
|
||||||
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
|
||||||
__thousands_sep, __grouping,
|
__thousands_sep, __grouping,
|
||||||
__g, __g_end, __atoms))
|
__g, __g_end, __atoms))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
// Stage 3
|
// Stage 3
|
||||||
__a[sizeof(__a)-1] = 0;
|
__a[sizeof(__a)-1] = 0;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
@@ -1468,7 +1601,7 @@ _LIBCPP_EXTERN_TEMPLATE(struct __num_put<char>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(struct __num_put<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(struct __num_put<wchar_t>)
|
||||||
|
|
||||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE num_put
|
class _LIBCPP_TYPE_VIS num_put
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
private __num_put<_CharT>
|
private __num_put<_CharT>
|
||||||
{
|
{
|
||||||
@@ -1587,6 +1720,10 @@ __pad_and_output(_OutputIterator __s,
|
|||||||
return __s;
|
return __s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__APPLE__) || \
|
||||||
|
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \
|
||||||
|
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
_LIBCPP_HIDDEN
|
_LIBCPP_HIDDEN
|
||||||
ostreambuf_iterator<_CharT, _Traits>
|
ostreambuf_iterator<_CharT, _Traits>
|
||||||
@@ -1633,6 +1770,8 @@ __pad_and_output(ostreambuf_iterator<_CharT, _Traits> __s,
|
|||||||
return __s;
|
return __s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template <class _CharT, class _OutputIterator>
|
template <class _CharT, class _OutputIterator>
|
||||||
_OutputIterator
|
_OutputIterator
|
||||||
num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||||
@@ -1974,7 +2113,7 @@ __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
|
|||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE time_base
|
class _LIBCPP_TYPE_VIS time_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum dateorder {no_order, dmy, mdy, ymd, ydm};
|
enum dateorder {no_order, dmy, mdy, ymd, ydm};
|
||||||
@@ -1996,7 +2135,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE time_get
|
class _LIBCPP_TYPE_VIS time_get
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public time_base,
|
public time_base,
|
||||||
private __time_get_c_storage<_CharT>
|
private __time_get_c_storage<_CharT>
|
||||||
@@ -2646,7 +2785,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE time_get_byname
|
class _LIBCPP_TYPE_VIS time_get_byname
|
||||||
: public time_get<_CharT, _InputIterator>,
|
: public time_get<_CharT, _InputIterator>,
|
||||||
private __time_get_storage<_CharT>
|
private __time_get_storage<_CharT>
|
||||||
{
|
{
|
||||||
@@ -2706,7 +2845,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE time_put
|
class _LIBCPP_TYPE_VIS time_put
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
private __time_put
|
private __time_put
|
||||||
{
|
{
|
||||||
@@ -2805,7 +2944,7 @@ _LIBCPP_EXTERN_TEMPLATE(class time_put<char>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(class time_put<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class time_put<wchar_t>)
|
||||||
|
|
||||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE time_put_byname
|
class _LIBCPP_TYPE_VIS time_put_byname
|
||||||
: public time_put<_CharT, _OutputIterator>
|
: public time_put<_CharT, _OutputIterator>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -2827,7 +2966,7 @@ _LIBCPP_EXTERN_TEMPLATE(class time_put_byname<wchar_t>)
|
|||||||
|
|
||||||
// money_base
|
// money_base
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE money_base
|
class _LIBCPP_TYPE_VIS money_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum part {none, space, symbol, sign, value};
|
enum part {none, space, symbol, sign, value};
|
||||||
@@ -2839,7 +2978,7 @@ public:
|
|||||||
// moneypunct
|
// moneypunct
|
||||||
|
|
||||||
template <class _CharT, bool _International = false>
|
template <class _CharT, bool _International = false>
|
||||||
class _LIBCPP_VISIBLE moneypunct
|
class _LIBCPP_TYPE_VIS moneypunct
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public money_base
|
public money_base
|
||||||
{
|
{
|
||||||
@@ -2885,6 +3024,10 @@ template <class _CharT, bool _International>
|
|||||||
locale::id
|
locale::id
|
||||||
moneypunct<_CharT, _International>::id;
|
moneypunct<_CharT, _International>::id;
|
||||||
|
|
||||||
|
template <class _CharT, bool _International>
|
||||||
|
const bool
|
||||||
|
moneypunct<_CharT, _International>::intl;
|
||||||
|
|
||||||
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, false>)
|
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, false>)
|
||||||
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, true>)
|
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, true>)
|
||||||
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, false>)
|
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, false>)
|
||||||
@@ -2893,7 +3036,7 @@ _LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, true>)
|
|||||||
// moneypunct_byname
|
// moneypunct_byname
|
||||||
|
|
||||||
template <class _CharT, bool _International = false>
|
template <class _CharT, bool _International = false>
|
||||||
class _LIBCPP_VISIBLE moneypunct_byname
|
class _LIBCPP_TYPE_VIS moneypunct_byname
|
||||||
: public moneypunct<_CharT, _International>
|
: public moneypunct<_CharT, _International>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -3005,7 +3148,7 @@ _LIBCPP_EXTERN_TEMPLATE(class __money_get<char>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(class __money_get<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class __money_get<wchar_t>)
|
||||||
|
|
||||||
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE money_get
|
class _LIBCPP_TYPE_VIS money_get
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
private __money_get<_CharT>
|
private __money_get<_CharT>
|
||||||
{
|
{
|
||||||
@@ -3339,7 +3482,7 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
|||||||
if (__neg)
|
if (__neg)
|
||||||
*__nc++ = '-';
|
*__nc++ = '-';
|
||||||
for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc)
|
for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc)
|
||||||
*__nc = __src[find(__atoms, __atoms+sizeof(__atoms), *__w) - __atoms];
|
*__nc = __src[find(__atoms, _VSTD::end(__atoms), *__w) - __atoms];
|
||||||
*__nc = char();
|
*__nc = char();
|
||||||
if (sscanf(__nbuf, "%Lf", &__v) != 1)
|
if (sscanf(__nbuf, "%Lf", &__v) != 1)
|
||||||
__throw_runtime_error("money_get error");
|
__throw_runtime_error("money_get error");
|
||||||
@@ -3561,7 +3704,7 @@ _LIBCPP_EXTERN_TEMPLATE(class __money_put<char>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(class __money_put<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class __money_put<wchar_t>)
|
||||||
|
|
||||||
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
|
||||||
class _LIBCPP_VISIBLE money_put
|
class _LIBCPP_TYPE_VIS money_put
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
private __money_put<_CharT>
|
private __money_put<_CharT>
|
||||||
{
|
{
|
||||||
@@ -3719,7 +3862,7 @@ _LIBCPP_EXTERN_TEMPLATE(class money_put<wchar_t>)
|
|||||||
|
|
||||||
// messages
|
// messages
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE messages_base
|
class _LIBCPP_TYPE_VIS messages_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef ptrdiff_t catalog;
|
typedef ptrdiff_t catalog;
|
||||||
@@ -3728,7 +3871,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
class _LIBCPP_VISIBLE messages
|
class _LIBCPP_TYPE_VIS messages
|
||||||
: public locale::facet,
|
: public locale::facet,
|
||||||
public messages_base
|
public messages_base
|
||||||
{
|
{
|
||||||
@@ -3779,7 +3922,7 @@ template <class _CharT>
|
|||||||
typename messages<_CharT>::catalog
|
typename messages<_CharT>::catalog
|
||||||
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
|
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
|
||||||
{
|
{
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
return -1;
|
return -1;
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
|
catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
|
||||||
@@ -3794,7 +3937,7 @@ typename messages<_CharT>::string_type
|
|||||||
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
|
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
|
||||||
const string_type& __dflt) const
|
const string_type& __dflt) const
|
||||||
{
|
{
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
return __dflt;
|
return __dflt;
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
string __ndflt;
|
string __ndflt;
|
||||||
@@ -3816,7 +3959,7 @@ template <class _CharT>
|
|||||||
void
|
void
|
||||||
messages<_CharT>::do_close(catalog __c) const
|
messages<_CharT>::do_close(catalog __c) const
|
||||||
{
|
{
|
||||||
#if !_WIN32
|
#if !defined(_WIN32)
|
||||||
if (__c != -1)
|
if (__c != -1)
|
||||||
__c <<= 1;
|
__c <<= 1;
|
||||||
nl_catd __cat = (nl_catd)__c;
|
nl_catd __cat = (nl_catd)__c;
|
||||||
@@ -3828,7 +3971,7 @@ _LIBCPP_EXTERN_TEMPLATE(class messages<char>)
|
|||||||
_LIBCPP_EXTERN_TEMPLATE(class messages<wchar_t>)
|
_LIBCPP_EXTERN_TEMPLATE(class messages<wchar_t>)
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
class _LIBCPP_VISIBLE messages_byname
|
class _LIBCPP_TYPE_VIS messages_byname
|
||||||
: public messages<_CharT>
|
: public messages<_CharT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -3854,7 +3997,7 @@ _LIBCPP_EXTERN_TEMPLATE(class messages_byname<wchar_t>)
|
|||||||
template<class _Codecvt, class _Elem = wchar_t,
|
template<class _Codecvt, class _Elem = wchar_t,
|
||||||
class _Wide_alloc = allocator<_Elem>,
|
class _Wide_alloc = allocator<_Elem>,
|
||||||
class _Byte_alloc = allocator<char> >
|
class _Byte_alloc = allocator<char> >
|
||||||
class _LIBCPP_VISIBLE wstring_convert
|
class _LIBCPP_TYPE_VIS wstring_convert
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
|
typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
|
||||||
@@ -4107,7 +4250,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
|
template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
|
||||||
class _LIBCPP_VISIBLE wbuffer_convert
|
class _LIBCPP_TYPE_VIS wbuffer_convert
|
||||||
: public basic_streambuf<_Elem, _Tr>
|
: public basic_streambuf<_Elem, _Tr>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
24
include/map
24
include/map
@@ -537,7 +537,7 @@ template <class _Key, class _Tp, class _Compare, class _Allocator>
|
|||||||
template <class _TreeIterator> class __map_const_iterator;
|
template <class _TreeIterator> class __map_const_iterator;
|
||||||
|
|
||||||
template <class _TreeIterator>
|
template <class _TreeIterator>
|
||||||
class _LIBCPP_VISIBLE __map_iterator
|
class _LIBCPP_TYPE_VIS __map_iterator
|
||||||
{
|
{
|
||||||
_TreeIterator __i_;
|
_TreeIterator __i_;
|
||||||
|
|
||||||
@@ -596,13 +596,13 @@ public:
|
|||||||
bool operator!=(const __map_iterator& __x, const __map_iterator& __y)
|
bool operator!=(const __map_iterator& __x, const __map_iterator& __y)
|
||||||
{return __x.__i_ != __y.__i_;}
|
{return __x.__i_ != __y.__i_;}
|
||||||
|
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __map_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __map_const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _TreeIterator>
|
template <class _TreeIterator>
|
||||||
class _LIBCPP_VISIBLE __map_const_iterator
|
class _LIBCPP_TYPE_VIS __map_const_iterator
|
||||||
{
|
{
|
||||||
_TreeIterator __i_;
|
_TreeIterator __i_;
|
||||||
|
|
||||||
@@ -665,14 +665,14 @@ public:
|
|||||||
bool operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y)
|
bool operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y)
|
||||||
{return __x.__i_ != __y.__i_;}
|
{return __x.__i_ != __y.__i_;}
|
||||||
|
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE map;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS map;
|
||||||
template <class, class, class, class> friend class _LIBCPP_VISIBLE multimap;
|
template <class, class, class, class> friend class _LIBCPP_TYPE_VIS multimap;
|
||||||
template <class, class, class> friend class _LIBCPP_VISIBLE __tree_const_iterator;
|
template <class, class, class> friend class _LIBCPP_TYPE_VIS __tree_const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare = less<_Key>,
|
template <class _Key, class _Tp, class _Compare = less<_Key>,
|
||||||
class _Allocator = allocator<pair<const _Key, _Tp> > >
|
class _Allocator = allocator<pair<const _Key, _Tp> > >
|
||||||
class _LIBCPP_VISIBLE map
|
class _LIBCPP_TYPE_VIS map
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
@@ -684,7 +684,7 @@ public:
|
|||||||
typedef value_type& reference;
|
typedef value_type& reference;
|
||||||
typedef const value_type& const_reference;
|
typedef const value_type& const_reference;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE value_compare
|
class _LIBCPP_TYPE_VIS value_compare
|
||||||
: public binary_function<value_type, value_type, bool>
|
: public binary_function<value_type, value_type, bool>
|
||||||
{
|
{
|
||||||
friend class map;
|
friend class map;
|
||||||
@@ -1422,7 +1422,7 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
|
|||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare = less<_Key>,
|
template <class _Key, class _Tp, class _Compare = less<_Key>,
|
||||||
class _Allocator = allocator<pair<const _Key, _Tp> > >
|
class _Allocator = allocator<pair<const _Key, _Tp> > >
|
||||||
class _LIBCPP_VISIBLE multimap
|
class _LIBCPP_TYPE_VIS multimap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
@@ -1434,7 +1434,7 @@ public:
|
|||||||
typedef value_type& reference;
|
typedef value_type& reference;
|
||||||
typedef const value_type& const_reference;
|
typedef const value_type& const_reference;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE value_compare
|
class _LIBCPP_TYPE_VIS value_compare
|
||||||
: public binary_function<value_type, value_type, bool>
|
: public binary_function<value_type, value_type, bool>
|
||||||
{
|
{
|
||||||
friend class multimap;
|
friend class multimap;
|
||||||
|
120
include/memory
120
include/memory
@@ -621,7 +621,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||||||
_Tp*
|
_Tp*
|
||||||
addressof(_Tp& __x) _NOEXCEPT
|
addressof(_Tp& __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return (_Tp*)&(char&)__x;
|
return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
|
#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
|
||||||
@@ -667,7 +667,7 @@ addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
|
|||||||
template <class _Tp> class allocator;
|
template <class _Tp> class allocator;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE allocator<void>
|
class _LIBCPP_TYPE_VIS allocator<void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef void* pointer;
|
typedef void* pointer;
|
||||||
@@ -678,7 +678,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE allocator<const void>
|
class _LIBCPP_TYPE_VIS allocator<const void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef const void* pointer;
|
typedef const void* pointer;
|
||||||
@@ -913,7 +913,7 @@ struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, false>
|
|||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _Ptr>
|
template <class _Ptr>
|
||||||
struct _LIBCPP_VISIBLE pointer_traits
|
struct _LIBCPP_TYPE_VIS pointer_traits
|
||||||
{
|
{
|
||||||
typedef _Ptr pointer;
|
typedef _Ptr pointer;
|
||||||
typedef typename __pointer_traits_element_type<pointer>::type element_type;
|
typedef typename __pointer_traits_element_type<pointer>::type element_type;
|
||||||
@@ -936,7 +936,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE pointer_traits<_Tp*>
|
struct _LIBCPP_TYPE_VIS pointer_traits<_Tp*>
|
||||||
{
|
{
|
||||||
typedef _Tp* pointer;
|
typedef _Tp* pointer;
|
||||||
typedef _Tp element_type;
|
typedef _Tp element_type;
|
||||||
@@ -1443,7 +1443,7 @@ struct __alloc_traits_difference_type<_Alloc, _Ptr, true>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE allocator_traits
|
struct _LIBCPP_TYPE_VIS allocator_traits
|
||||||
{
|
{
|
||||||
typedef _Alloc allocator_type;
|
typedef _Alloc allocator_type;
|
||||||
typedef typename allocator_type::value_type value_type;
|
typedef typename allocator_type::value_type value_type;
|
||||||
@@ -1571,7 +1571,10 @@ struct _LIBCPP_VISIBLE allocator_traits
|
|||||||
__construct_backward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2)
|
__construct_backward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2)
|
||||||
{
|
{
|
||||||
while (__end1 != __begin1)
|
while (__end1 != __begin1)
|
||||||
construct(__a, _VSTD::__to_raw_pointer(--__end2), _VSTD::move_if_noexcept(*--__end1));
|
{
|
||||||
|
construct(__a, _VSTD::__to_raw_pointer(__end2-1), _VSTD::move_if_noexcept(*--__end1));
|
||||||
|
--__end2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
@@ -1646,7 +1649,7 @@ private:
|
|||||||
// allocator
|
// allocator
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE allocator
|
class _LIBCPP_TYPE_VIS allocator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
@@ -1738,7 +1741,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE allocator<const _Tp>
|
class _LIBCPP_TYPE_VIS allocator<const _Tp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
@@ -1836,7 +1839,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||||||
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
|
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
|
||||||
|
|
||||||
template <class _OutputIterator, class _Tp>
|
template <class _OutputIterator, class _Tp>
|
||||||
class _LIBCPP_VISIBLE raw_storage_iterator
|
class _LIBCPP_TYPE_VIS raw_storage_iterator
|
||||||
: public iterator<output_iterator_tag,
|
: public iterator<output_iterator_tag,
|
||||||
_Tp, // purposefully not C++03
|
_Tp, // purposefully not C++03
|
||||||
ptrdiff_t, // purposefully not C++03
|
ptrdiff_t, // purposefully not C++03
|
||||||
@@ -1889,7 +1892,7 @@ struct auto_ptr_ref
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE auto_ptr
|
class _LIBCPP_TYPE_VIS auto_ptr
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
_Tp* __ptr_;
|
_Tp* __ptr_;
|
||||||
@@ -1933,7 +1936,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE auto_ptr<void>
|
class _LIBCPP_TYPE_VIS auto_ptr<void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef void element_type;
|
typedef void element_type;
|
||||||
@@ -2033,6 +2036,10 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
||||||
@@ -2048,10 +2055,6 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
|
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
|
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
|
||||||
|
|
||||||
@@ -2128,6 +2131,10 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
||||||
@@ -2143,10 +2150,6 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
|
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
|
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
|
||||||
|
|
||||||
@@ -2224,6 +2227,10 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
||||||
@@ -2240,10 +2247,6 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
|
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
|
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
|
||||||
|
|
||||||
@@ -2318,6 +2321,10 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
||||||
@@ -2333,10 +2340,6 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
|
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
|
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
|
||||||
|
|
||||||
@@ -2406,6 +2409,10 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class... _Args1, class... _Args2>
|
template <class... _Args1, class... _Args2>
|
||||||
@@ -2419,10 +2426,6 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return base::first();}
|
_LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return base::first();}
|
||||||
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return base::first();}
|
_LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return base::first();}
|
||||||
|
|
||||||
@@ -2469,7 +2472,7 @@ struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, true>
|
|||||||
// default_delete
|
// default_delete
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE default_delete
|
struct _LIBCPP_TYPE_VIS default_delete
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
|
||||||
@@ -2482,12 +2485,13 @@ struct _LIBCPP_VISIBLE default_delete
|
|||||||
_LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const _NOEXCEPT
|
||||||
{
|
{
|
||||||
static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
|
static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
|
||||||
|
static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
|
||||||
delete __ptr;
|
delete __ptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE default_delete<_Tp[]>
|
struct _LIBCPP_TYPE_VIS default_delete<_Tp[]>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
@@ -2504,12 +2508,13 @@ public:
|
|||||||
typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) const _NOEXCEPT
|
typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) const _NOEXCEPT
|
||||||
{
|
{
|
||||||
static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
|
static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
|
||||||
|
static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
|
||||||
delete [] __ptr;
|
delete [] __ptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Dp = default_delete<_Tp> >
|
template <class _Tp, class _Dp = default_delete<_Tp> >
|
||||||
class _LIBCPP_VISIBLE unique_ptr
|
class _LIBCPP_TYPE_VIS unique_ptr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp element_type;
|
typedef _Tp element_type;
|
||||||
@@ -2688,7 +2693,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Dp>
|
template <class _Tp, class _Dp>
|
||||||
class _LIBCPP_VISIBLE unique_ptr<_Tp[], _Dp>
|
class _LIBCPP_TYPE_VIS unique_ptr<_Tp[], _Dp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp element_type;
|
typedef _Tp element_type;
|
||||||
@@ -3390,7 +3395,7 @@ struct __scalar_hash<_Tp, 4>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
struct _LIBCPP_VISIBLE hash<_Tp*>
|
struct _LIBCPP_TYPE_VIS hash<_Tp*>
|
||||||
: public unary_function<_Tp*, size_t>
|
: public unary_function<_Tp*, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -3407,7 +3412,7 @@ struct _LIBCPP_VISIBLE hash<_Tp*>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Dp>
|
template <class _Tp, class _Dp>
|
||||||
struct _LIBCPP_VISIBLE hash<unique_ptr<_Tp, _Dp> >
|
struct _LIBCPP_TYPE_VIS hash<unique_ptr<_Tp, _Dp> >
|
||||||
{
|
{
|
||||||
typedef unique_ptr<_Tp, _Dp> argument_type;
|
typedef unique_ptr<_Tp, _Dp> argument_type;
|
||||||
typedef size_t result_type;
|
typedef size_t result_type;
|
||||||
@@ -3580,7 +3585,7 @@ public:
|
|||||||
virtual const char* what() const _NOEXCEPT;
|
virtual const char* what() const _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp> class _LIBCPP_VISIBLE weak_ptr;
|
template<class _Tp> class _LIBCPP_TYPE_VIS weak_ptr;
|
||||||
|
|
||||||
class __shared_count
|
class __shared_count
|
||||||
{
|
{
|
||||||
@@ -3626,10 +3631,13 @@ public:
|
|||||||
long use_count() const _NOEXCEPT {return __shared_count::use_count();}
|
long use_count() const _NOEXCEPT {return __shared_count::use_count();}
|
||||||
__shared_weak_count* lock() _NOEXCEPT;
|
__shared_weak_count* lock() _NOEXCEPT;
|
||||||
|
|
||||||
// purposefully not protected with #ifndef _LIBCPP_NO_RTTI because doing so
|
// Define the function out only if we build static libc++ without RTTI.
|
||||||
// breaks ABI for those clients who need to compile their projects with
|
// Otherwise we may break clients who need to compile their projects with
|
||||||
// -fno-rtti and yet link against a libc++.dylib compiled without -fno-rtti.
|
// -fno-rtti and yet link against a libc++.dylib compiled
|
||||||
|
// without -fno-rtti.
|
||||||
|
#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
|
||||||
virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
|
virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
|
||||||
|
#endif
|
||||||
private:
|
private:
|
||||||
virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
|
virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
|
||||||
};
|
};
|
||||||
@@ -3746,10 +3754,10 @@ __shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
|
|||||||
__a.deallocate(this, 1);
|
__a.deallocate(this, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _Tp> class _LIBCPP_VISIBLE enable_shared_from_this;
|
template<class _Tp> class _LIBCPP_TYPE_VIS enable_shared_from_this;
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE shared_ptr
|
class _LIBCPP_TYPE_VIS shared_ptr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp element_type;
|
typedef _Tp element_type;
|
||||||
@@ -4018,8 +4026,8 @@ private:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __enable_weak_this(const void*) _NOEXCEPT {}
|
void __enable_weak_this(const void*) _NOEXCEPT {}
|
||||||
|
|
||||||
template <class _Up> friend class _LIBCPP_VISIBLE shared_ptr;
|
template <class _Up> friend class _LIBCPP_TYPE_VIS shared_ptr;
|
||||||
template <class _Up> friend class _LIBCPP_VISIBLE weak_ptr;
|
template <class _Up> friend class _LIBCPP_TYPE_VIS weak_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
@@ -4915,7 +4923,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
|
|||||||
#endif // _LIBCPP_NO_RTTI
|
#endif // _LIBCPP_NO_RTTI
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE weak_ptr
|
class _LIBCPP_TYPE_VIS weak_ptr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp element_type;
|
typedef _Tp element_type;
|
||||||
@@ -4990,8 +4998,8 @@ public:
|
|||||||
bool owner_before(const weak_ptr<_Up>& __r) const
|
bool owner_before(const weak_ptr<_Up>& __r) const
|
||||||
{return __cntrl_ < __r.__cntrl_;}
|
{return __cntrl_ < __r.__cntrl_;}
|
||||||
|
|
||||||
template <class _Up> friend class _LIBCPP_VISIBLE weak_ptr;
|
template <class _Up> friend class _LIBCPP_TYPE_VIS weak_ptr;
|
||||||
template <class _Up> friend class _LIBCPP_VISIBLE shared_ptr;
|
template <class _Up> friend class _LIBCPP_TYPE_VIS shared_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
@@ -5191,7 +5199,7 @@ weak_ptr<_Tp>::lock() const _NOEXCEPT
|
|||||||
template <class _Tp> struct owner_less;
|
template <class _Tp> struct owner_less;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE owner_less<shared_ptr<_Tp> >
|
struct _LIBCPP_TYPE_VIS owner_less<shared_ptr<_Tp> >
|
||||||
: binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
|
: binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
|
||||||
{
|
{
|
||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
@@ -5207,7 +5215,7 @@ struct _LIBCPP_VISIBLE owner_less<shared_ptr<_Tp> >
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE owner_less<weak_ptr<_Tp> >
|
struct _LIBCPP_TYPE_VIS owner_less<weak_ptr<_Tp> >
|
||||||
: binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
|
: binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
|
||||||
{
|
{
|
||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
@@ -5223,7 +5231,7 @@ struct _LIBCPP_VISIBLE owner_less<weak_ptr<_Tp> >
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE enable_shared_from_this
|
class _LIBCPP_TYPE_VIS enable_shared_from_this
|
||||||
{
|
{
|
||||||
mutable weak_ptr<_Tp> __weak_this_;
|
mutable weak_ptr<_Tp> __weak_this_;
|
||||||
protected:
|
protected:
|
||||||
@@ -5248,7 +5256,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE hash<shared_ptr<_Tp> >
|
struct _LIBCPP_TYPE_VIS hash<shared_ptr<_Tp> >
|
||||||
{
|
{
|
||||||
typedef shared_ptr<_Tp> argument_type;
|
typedef shared_ptr<_Tp> argument_type;
|
||||||
typedef size_t result_type;
|
typedef size_t result_type;
|
||||||
@@ -5278,10 +5286,10 @@ private:
|
|||||||
__sp_mut(const __sp_mut&);
|
__sp_mut(const __sp_mut&);
|
||||||
__sp_mut& operator=(const __sp_mut&);
|
__sp_mut& operator=(const __sp_mut&);
|
||||||
|
|
||||||
friend _LIBCPP_VISIBLE __sp_mut& __get_sp_mut(const void*);
|
friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
|
||||||
};
|
};
|
||||||
|
|
||||||
_LIBCPP_VISIBLE __sp_mut& __get_sp_mut(const void*);
|
_LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -5393,7 +5401,7 @@ atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v
|
|||||||
#endif // __has_feature(cxx_atomic)
|
#endif // __has_feature(cxx_atomic)
|
||||||
|
|
||||||
//enum class
|
//enum class
|
||||||
struct _LIBCPP_VISIBLE pointer_safety
|
struct _LIBCPP_TYPE_VIS pointer_safety
|
||||||
{
|
{
|
||||||
enum __lx
|
enum __lx
|
||||||
{
|
{
|
||||||
|
@@ -187,7 +187,7 @@ template<class Callable, class ...Args>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE recursive_mutex
|
class _LIBCPP_TYPE_VIS recursive_mutex
|
||||||
{
|
{
|
||||||
pthread_mutex_t __m_;
|
pthread_mutex_t __m_;
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ public:
|
|||||||
native_handle_type native_handle() {return &__m_;}
|
native_handle_type native_handle() {return &__m_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE timed_mutex
|
class _LIBCPP_TYPE_VIS timed_mutex
|
||||||
{
|
{
|
||||||
mutex __m_;
|
mutex __m_;
|
||||||
condition_variable __cv_;
|
condition_variable __cv_;
|
||||||
@@ -251,7 +251,7 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE recursive_timed_mutex
|
class _LIBCPP_TYPE_VIS recursive_timed_mutex
|
||||||
{
|
{
|
||||||
mutex __m_;
|
mutex __m_;
|
||||||
condition_variable __cv_;
|
condition_variable __cv_;
|
||||||
@@ -425,7 +425,7 @@ lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE once_flag;
|
struct _LIBCPP_TYPE_VIS once_flag;
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ void call_once(once_flag&, _Callable);
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE once_flag
|
struct _LIBCPP_TYPE_VIS once_flag
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR
|
_LIBCPP_CONSTEXPR
|
||||||
|
24
include/new
24
include/new
@@ -83,31 +83,31 @@ public:
|
|||||||
|
|
||||||
void __throw_bad_alloc(); // not in C++ spec
|
void __throw_bad_alloc(); // not in C++ spec
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE nothrow_t {};
|
struct _LIBCPP_TYPE_VIS nothrow_t {};
|
||||||
extern _LIBCPP_VISIBLE const nothrow_t nothrow;
|
extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
|
||||||
typedef void (*new_handler)();
|
typedef void (*new_handler)();
|
||||||
_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE new_handler get_new_handler() _NOEXCEPT;
|
_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
|
||||||
|
|
||||||
} // std
|
} // std
|
||||||
|
|
||||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz)
|
_LIBCPP_FUNC_VIS void* operator new(std::size_t __sz)
|
||||||
#if !__has_feature(cxx_noexcept)
|
#if !__has_feature(cxx_noexcept)
|
||||||
throw(std::bad_alloc)
|
throw(std::bad_alloc)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
_LIBCPP_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||||
_LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz)
|
_LIBCPP_FUNC_VIS void* operator new[](std::size_t __sz)
|
||||||
#if !__has_feature(cxx_noexcept)
|
#if !__has_feature(cxx_noexcept)
|
||||||
throw(std::bad_alloc)
|
throw(std::bad_alloc)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
_LIBCPP_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||||
_LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
_LIBCPP_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||||
|
|
||||||
_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 new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
|
_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||||
|
@@ -140,7 +140,7 @@ template <class charT, class traits, class T>
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_ostream
|
class _LIBCPP_TYPE_VIS basic_ostream
|
||||||
: virtual public basic_ios<_CharT, _Traits>
|
: virtual public basic_ios<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -169,7 +169,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// 27.7.2.4 Prefix/suffix:
|
// 27.7.2.4 Prefix/suffix:
|
||||||
class _LIBCPP_VISIBLE sentry;
|
class _LIBCPP_TYPE_VIS sentry;
|
||||||
|
|
||||||
// 27.7.2.6 Formatted output:
|
// 27.7.2.6 Formatted output:
|
||||||
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
|
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
|
||||||
@@ -207,7 +207,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_ostream<_CharT, _Traits>::sentry
|
class _LIBCPP_TYPE_VIS basic_ostream<_CharT, _Traits>::sentry
|
||||||
{
|
{
|
||||||
bool __ok_;
|
bool __ok_;
|
||||||
basic_ostream<_CharT, _Traits>& __os_;
|
basic_ostream<_CharT, _Traits>& __os_;
|
||||||
@@ -1100,17 +1100,8 @@ basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
|
|||||||
sentry __sen(*this);
|
sentry __sen(*this);
|
||||||
if (__sen && __n)
|
if (__sen && __n)
|
||||||
{
|
{
|
||||||
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
|
if (this->rdbuf()->sputn(__s, __n) != __n)
|
||||||
_Op __o(*this);
|
this->setstate(ios_base::badbit);
|
||||||
for (; __n; --__n, ++__o, ++__s)
|
|
||||||
{
|
|
||||||
*__o = *__s;
|
|
||||||
if (__o.failed())
|
|
||||||
{
|
|
||||||
this->setstate(ios_base::badbit);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
}
|
||||||
|
@@ -177,7 +177,7 @@ template <class T, class Container, class Compare>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp, class _Container> class _LIBCPP_VISIBLE queue;
|
template <class _Tp, class _Container> class _LIBCPP_TYPE_VIS queue;
|
||||||
|
|
||||||
template <class _Tp, class _Container>
|
template <class _Tp, class _Container>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -190,7 +190,7 @@ bool
|
|||||||
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
||||||
|
|
||||||
template <class _Tp, class _Container = deque<_Tp> >
|
template <class _Tp, class _Container = deque<_Tp> >
|
||||||
class _LIBCPP_VISIBLE queue
|
class _LIBCPP_TYPE_VIS queue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Container container_type;
|
typedef _Container container_type;
|
||||||
@@ -376,14 +376,14 @@ swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Container, class _Alloc>
|
template <class _Tp, class _Container, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator<queue<_Tp, _Container>, _Alloc>
|
struct _LIBCPP_TYPE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc>
|
||||||
: public uses_allocator<_Container, _Alloc>
|
: public uses_allocator<_Container, _Alloc>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Container = vector<_Tp>,
|
template <class _Tp, class _Container = vector<_Tp>,
|
||||||
class _Compare = less<typename _Container::value_type> >
|
class _Compare = less<typename _Container::value_type> >
|
||||||
class _LIBCPP_VISIBLE priority_queue
|
class _LIBCPP_TYPE_VIS priority_queue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Container container_type;
|
typedef _Container container_type;
|
||||||
@@ -707,7 +707,7 @@ swap(priority_queue<_Tp, _Container, _Compare>& __x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Container, class _Compare, class _Alloc>
|
template <class _Tp, class _Container, class _Compare, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
|
struct _LIBCPP_TYPE_VIS uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
|
||||||
: public uses_allocator<_Container, _Alloc>
|
: public uses_allocator<_Container, _Alloc>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
220
include/random
220
include/random
@@ -1813,7 +1813,7 @@ struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
class _LIBCPP_VISIBLE linear_congruential_engine;
|
class _LIBCPP_TYPE_VIS linear_congruential_engine;
|
||||||
|
|
||||||
template <class _CharT, class _Traits,
|
template <class _CharT, class _Traits,
|
||||||
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
|
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
|
||||||
@@ -1829,7 +1829,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
|
linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
|
||||||
|
|
||||||
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
class _LIBCPP_VISIBLE linear_congruential_engine
|
class _LIBCPP_TYPE_VIS linear_congruential_engine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -1930,6 +1930,22 @@ private:
|
|||||||
linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
|
linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
|
_LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
|
||||||
|
linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier;
|
||||||
|
|
||||||
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
|
_LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
|
||||||
|
linear_congruential_engine<_UIntType, __a, __c, __m>::increment;
|
||||||
|
|
||||||
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
|
_LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
|
||||||
|
linear_congruential_engine<_UIntType, __a, __c, __m>::modulus;
|
||||||
|
|
||||||
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
|
_LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
|
||||||
|
linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed;
|
||||||
|
|
||||||
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
template<class _Sseq>
|
template<class _Sseq>
|
||||||
void
|
void
|
||||||
@@ -2022,7 +2038,7 @@ typedef minstd_rand default_random_engine;
|
|||||||
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
class _LIBCPP_VISIBLE mersenne_twister_engine;
|
class _LIBCPP_TYPE_VIS mersenne_twister_engine;
|
||||||
|
|
||||||
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
|
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
|
||||||
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
|
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
|
||||||
@@ -2064,7 +2080,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
class _LIBCPP_VISIBLE mersenne_twister_engine
|
class _LIBCPP_TYPE_VIS mersenne_twister_engine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -2227,6 +2243,90 @@ private:
|
|||||||
__rshift(result_type) {return result_type(0);}
|
__rshift(result_type) {return result_type(0);}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::initialization_multiplier;
|
||||||
|
|
||||||
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
|
_LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
|
||||||
|
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed;
|
||||||
|
|
||||||
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
@@ -2426,7 +2526,7 @@ typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
|
|||||||
// subtract_with_carry_engine
|
// subtract_with_carry_engine
|
||||||
|
|
||||||
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
class _LIBCPP_VISIBLE subtract_with_carry_engine;
|
class _LIBCPP_TYPE_VIS subtract_with_carry_engine;
|
||||||
|
|
||||||
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
|
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
|
||||||
bool
|
bool
|
||||||
@@ -2454,7 +2554,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
|
subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
|
||||||
|
|
||||||
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
class _LIBCPP_VISIBLE subtract_with_carry_engine
|
class _LIBCPP_TYPE_VIS subtract_with_carry_engine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -2551,6 +2651,19 @@ private:
|
|||||||
void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
|
void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size;
|
||||||
|
|
||||||
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag;
|
||||||
|
|
||||||
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag;
|
||||||
|
|
||||||
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
|
_LIBCPP_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type
|
||||||
|
subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed;
|
||||||
|
|
||||||
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
void
|
void
|
||||||
subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd,
|
subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd,
|
||||||
@@ -2724,7 +2837,7 @@ typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> ranlux48_base;
|
|||||||
// discard_block_engine
|
// discard_block_engine
|
||||||
|
|
||||||
template<class _Engine, size_t __p, size_t __r>
|
template<class _Engine, size_t __p, size_t __r>
|
||||||
class _LIBCPP_VISIBLE discard_block_engine
|
class _LIBCPP_TYPE_VIS discard_block_engine
|
||||||
{
|
{
|
||||||
_Engine __e_;
|
_Engine __e_;
|
||||||
int __n_;
|
int __n_;
|
||||||
@@ -2822,6 +2935,12 @@ public:
|
|||||||
discard_block_engine<_Eng, _Pp, _Rp>& __x);
|
discard_block_engine<_Eng, _Pp, _Rp>& __x);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class _Engine, size_t __p, size_t __r>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size;
|
||||||
|
|
||||||
|
template<class _Engine, size_t __p, size_t __r>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block;
|
||||||
|
|
||||||
template<class _Engine, size_t __p, size_t __r>
|
template<class _Engine, size_t __p, size_t __r>
|
||||||
typename discard_block_engine<_Engine, __p, __r>::result_type
|
typename discard_block_engine<_Engine, __p, __r>::result_type
|
||||||
discard_block_engine<_Engine, __p, __r>::operator()()
|
discard_block_engine<_Engine, __p, __r>::operator()()
|
||||||
@@ -2891,7 +3010,7 @@ typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48;
|
|||||||
// independent_bits_engine
|
// independent_bits_engine
|
||||||
|
|
||||||
template<class _Engine, size_t __w, class _UIntType>
|
template<class _Engine, size_t __w, class _UIntType>
|
||||||
class _LIBCPP_VISIBLE independent_bits_engine
|
class _LIBCPP_TYPE_VIS independent_bits_engine
|
||||||
{
|
{
|
||||||
template <class _UI, _UI _R0, size_t _Wp, size_t _Mp>
|
template <class _UI, _UI _R0, size_t _Wp, size_t _Mp>
|
||||||
class __get_n
|
class __get_n
|
||||||
@@ -3154,7 +3273,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<class _Engine, size_t __k>
|
template<class _Engine, size_t __k>
|
||||||
class _LIBCPP_VISIBLE shuffle_order_engine
|
class _LIBCPP_TYPE_VIS shuffle_order_engine
|
||||||
{
|
{
|
||||||
static_assert(0 < __k, "shuffle_order_engine invalid parameters");
|
static_assert(0 < __k, "shuffle_order_engine invalid parameters");
|
||||||
public:
|
public:
|
||||||
@@ -3314,6 +3433,9 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class _Engine, size_t __k>
|
||||||
|
_LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size;
|
||||||
|
|
||||||
template<class _Eng, size_t _Kp>
|
template<class _Eng, size_t _Kp>
|
||||||
bool
|
bool
|
||||||
operator==(
|
operator==(
|
||||||
@@ -3378,7 +3500,7 @@ typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;
|
|||||||
|
|
||||||
// random_device
|
// random_device
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE random_device
|
class _LIBCPP_TYPE_VIS random_device
|
||||||
{
|
{
|
||||||
int __f_;
|
int __f_;
|
||||||
public:
|
public:
|
||||||
@@ -3412,7 +3534,7 @@ private:
|
|||||||
|
|
||||||
// seed_seq
|
// seed_seq
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE seed_seq
|
class _LIBCPP_TYPE_VIS seed_seq
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -3589,13 +3711,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// uniform_real_distribution
|
// uniform_real_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE uniform_real_distribution
|
class _LIBCPP_TYPE_VIS uniform_real_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __a_;
|
result_type __a_;
|
||||||
result_type __b_;
|
result_type __b_;
|
||||||
@@ -3710,13 +3832,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
|
|
||||||
// bernoulli_distribution
|
// bernoulli_distribution
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE bernoulli_distribution
|
class _LIBCPP_TYPE_VIS bernoulli_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
double __p_;
|
double __p_;
|
||||||
public:
|
public:
|
||||||
@@ -3819,13 +3941,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)
|
|||||||
// binomial_distribution
|
// binomial_distribution
|
||||||
|
|
||||||
template<class _IntType = int>
|
template<class _IntType = int>
|
||||||
class _LIBCPP_VISIBLE binomial_distribution
|
class _LIBCPP_TYPE_VIS binomial_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _IntType result_type;
|
typedef _IntType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __t_;
|
result_type __t_;
|
||||||
double __p_;
|
double __p_;
|
||||||
@@ -3984,13 +4106,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// exponential_distribution
|
// exponential_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE exponential_distribution
|
class _LIBCPP_TYPE_VIS exponential_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __lambda_;
|
result_type __lambda_;
|
||||||
public:
|
public:
|
||||||
@@ -4099,13 +4221,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// normal_distribution
|
// normal_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE normal_distribution
|
class _LIBCPP_TYPE_VIS normal_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __mean_;
|
result_type __mean_;
|
||||||
result_type __stddev_;
|
result_type __stddev_;
|
||||||
@@ -4267,13 +4389,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// lognormal_distribution
|
// lognormal_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE lognormal_distribution
|
class _LIBCPP_TYPE_VIS lognormal_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
normal_distribution<result_type> __nd_;
|
normal_distribution<result_type> __nd_;
|
||||||
public:
|
public:
|
||||||
@@ -4392,13 +4514,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// poisson_distribution
|
// poisson_distribution
|
||||||
|
|
||||||
template<class _IntType = int>
|
template<class _IntType = int>
|
||||||
class _LIBCPP_VISIBLE poisson_distribution
|
class _LIBCPP_TYPE_VIS poisson_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _IntType result_type;
|
typedef _IntType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
double __mean_;
|
double __mean_;
|
||||||
double __s_;
|
double __s_;
|
||||||
@@ -4623,13 +4745,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// weibull_distribution
|
// weibull_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE weibull_distribution
|
class _LIBCPP_TYPE_VIS weibull_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __a_;
|
result_type __a_;
|
||||||
result_type __b_;
|
result_type __b_;
|
||||||
@@ -4737,13 +4859,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE extreme_value_distribution
|
class _LIBCPP_TYPE_VIS extreme_value_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __a_;
|
result_type __a_;
|
||||||
result_type __b_;
|
result_type __b_;
|
||||||
@@ -4858,13 +4980,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// gamma_distribution
|
// gamma_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE gamma_distribution
|
class _LIBCPP_TYPE_VIS gamma_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __alpha_;
|
result_type __alpha_;
|
||||||
result_type __beta_;
|
result_type __beta_;
|
||||||
@@ -5030,13 +5152,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// negative_binomial_distribution
|
// negative_binomial_distribution
|
||||||
|
|
||||||
template<class _IntType = int>
|
template<class _IntType = int>
|
||||||
class _LIBCPP_VISIBLE negative_binomial_distribution
|
class _LIBCPP_TYPE_VIS negative_binomial_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _IntType result_type;
|
typedef _IntType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __k_;
|
result_type __k_;
|
||||||
double __p_;
|
double __p_;
|
||||||
@@ -5165,13 +5287,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// geometric_distribution
|
// geometric_distribution
|
||||||
|
|
||||||
template<class _IntType = int>
|
template<class _IntType = int>
|
||||||
class _LIBCPP_VISIBLE geometric_distribution
|
class _LIBCPP_TYPE_VIS geometric_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _IntType result_type;
|
typedef _IntType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
double __p_;
|
double __p_;
|
||||||
public:
|
public:
|
||||||
@@ -5267,13 +5389,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// chi_squared_distribution
|
// chi_squared_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE chi_squared_distribution
|
class _LIBCPP_TYPE_VIS chi_squared_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __n_;
|
result_type __n_;
|
||||||
public:
|
public:
|
||||||
@@ -5373,13 +5495,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// cauchy_distribution
|
// cauchy_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE cauchy_distribution
|
class _LIBCPP_TYPE_VIS cauchy_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __a_;
|
result_type __a_;
|
||||||
result_type __b_;
|
result_type __b_;
|
||||||
@@ -5496,13 +5618,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// fisher_f_distribution
|
// fisher_f_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE fisher_f_distribution
|
class _LIBCPP_TYPE_VIS fisher_f_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __m_;
|
result_type __m_;
|
||||||
result_type __n_;
|
result_type __n_;
|
||||||
@@ -5618,13 +5740,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// student_t_distribution
|
// student_t_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE student_t_distribution
|
class _LIBCPP_TYPE_VIS student_t_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
result_type __n_;
|
result_type __n_;
|
||||||
public:
|
public:
|
||||||
@@ -5731,13 +5853,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// discrete_distribution
|
// discrete_distribution
|
||||||
|
|
||||||
template<class _IntType = int>
|
template<class _IntType = int>
|
||||||
class _LIBCPP_VISIBLE discrete_distribution
|
class _LIBCPP_TYPE_VIS discrete_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _IntType result_type;
|
typedef _IntType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
vector<double> __p_;
|
vector<double> __p_;
|
||||||
public:
|
public:
|
||||||
@@ -5962,13 +6084,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// piecewise_constant_distribution
|
// piecewise_constant_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE piecewise_constant_distribution
|
class _LIBCPP_TYPE_VIS piecewise_constant_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
vector<result_type> __b_;
|
vector<result_type> __b_;
|
||||||
vector<result_type> __densities_;
|
vector<result_type> __densities_;
|
||||||
@@ -6286,13 +6408,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||||||
// piecewise_linear_distribution
|
// piecewise_linear_distribution
|
||||||
|
|
||||||
template<class _RealType = double>
|
template<class _RealType = double>
|
||||||
class _LIBCPP_VISIBLE piecewise_linear_distribution
|
class _LIBCPP_TYPE_VIS piecewise_linear_distribution
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
typedef _RealType result_type;
|
typedef _RealType result_type;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE param_type
|
class _LIBCPP_TYPE_VIS param_type
|
||||||
{
|
{
|
||||||
vector<result_type> __b_;
|
vector<result_type> __b_;
|
||||||
vector<result_type> __densities_;
|
vector<result_type> __densities_;
|
||||||
|
@@ -231,7 +231,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <intmax_t _Num, intmax_t _Den = 1>
|
template <intmax_t _Num, intmax_t _Den = 1>
|
||||||
class _LIBCPP_VISIBLE ratio
|
class _LIBCPP_TYPE_VIS ratio
|
||||||
{
|
{
|
||||||
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
|
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
|
||||||
static_assert(_Den != 0, "ratio divide by 0");
|
static_assert(_Den != 0, "ratio divide by 0");
|
||||||
@@ -292,7 +292,7 @@ template <class _R1, class _R2> using ratio_multiply
|
|||||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_multiply
|
struct _LIBCPP_TYPE_VIS ratio_multiply
|
||||||
: public __ratio_multiply<_R1, _R2>::type {};
|
: public __ratio_multiply<_R1, _R2>::type {};
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
@@ -319,7 +319,7 @@ template <class _R1, class _R2> using ratio_divide
|
|||||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_divide
|
struct _LIBCPP_TYPE_VIS ratio_divide
|
||||||
: public __ratio_divide<_R1, _R2>::type {};
|
: public __ratio_divide<_R1, _R2>::type {};
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
@@ -354,7 +354,7 @@ template <class _R1, class _R2> using ratio_add
|
|||||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_add
|
struct _LIBCPP_TYPE_VIS ratio_add
|
||||||
: public __ratio_add<_R1, _R2>::type {};
|
: public __ratio_add<_R1, _R2>::type {};
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
@@ -389,7 +389,7 @@ template <class _R1, class _R2> using ratio_subtract
|
|||||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_subtract
|
struct _LIBCPP_TYPE_VIS ratio_subtract
|
||||||
: public __ratio_subtract<_R1, _R2>::type {};
|
: public __ratio_subtract<_R1, _R2>::type {};
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
@@ -397,11 +397,11 @@ struct _LIBCPP_VISIBLE ratio_subtract
|
|||||||
// ratio_equal
|
// ratio_equal
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_equal
|
struct _LIBCPP_TYPE_VIS ratio_equal
|
||||||
: public integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> {};
|
: public integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> {};
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_not_equal
|
struct _LIBCPP_TYPE_VIS ratio_not_equal
|
||||||
: public integral_constant<bool, !ratio_equal<_R1, _R2>::value> {};
|
: public integral_constant<bool, !ratio_equal<_R1, _R2>::value> {};
|
||||||
|
|
||||||
// ratio_less
|
// ratio_less
|
||||||
@@ -460,19 +460,19 @@ struct __ratio_less<_R1, _R2, -1LL, -1LL>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_less
|
struct _LIBCPP_TYPE_VIS ratio_less
|
||||||
: public integral_constant<bool, __ratio_less<_R1, _R2>::value> {};
|
: public integral_constant<bool, __ratio_less<_R1, _R2>::value> {};
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_less_equal
|
struct _LIBCPP_TYPE_VIS ratio_less_equal
|
||||||
: public integral_constant<bool, !ratio_less<_R2, _R1>::value> {};
|
: public integral_constant<bool, !ratio_less<_R2, _R1>::value> {};
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_greater
|
struct _LIBCPP_TYPE_VIS ratio_greater
|
||||||
: public integral_constant<bool, ratio_less<_R2, _R1>::value> {};
|
: public integral_constant<bool, ratio_less<_R2, _R1>::value> {};
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
struct _LIBCPP_VISIBLE ratio_greater_equal
|
struct _LIBCPP_TYPE_VIS ratio_greater_equal
|
||||||
: public integral_constant<bool, !ratio_less<_R1, _R2>::value> {};
|
: public integral_constant<bool, !ratio_less<_R1, _R2>::value> {};
|
||||||
|
|
||||||
template <class _R1, class _R2>
|
template <class _R1, class _R2>
|
||||||
|
@@ -764,7 +764,7 @@ _LIBCPP_CONSTEXPR
|
|||||||
syntax_option_type
|
syntax_option_type
|
||||||
operator~(syntax_option_type __x)
|
operator~(syntax_option_type __x)
|
||||||
{
|
{
|
||||||
return syntax_option_type(~int(__x));
|
return syntax_option_type(~int(__x) & 0x1FF);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -840,7 +840,7 @@ _LIBCPP_CONSTEXPR
|
|||||||
match_flag_type
|
match_flag_type
|
||||||
operator~(match_flag_type __x)
|
operator~(match_flag_type __x)
|
||||||
{
|
{
|
||||||
return match_flag_type(~int(__x));
|
return match_flag_type(~int(__x) & 0x0FFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -925,7 +925,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
struct _LIBCPP_VISIBLE regex_traits
|
struct _LIBCPP_TYPE_VIS regex_traits
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _CharT char_type;
|
typedef _CharT char_type;
|
||||||
@@ -1008,6 +1008,10 @@ private:
|
|||||||
int __value(wchar_t __ch, int __radix) const;
|
int __value(wchar_t __ch, int __radix) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _CharT>
|
||||||
|
const typename regex_traits<_CharT>::char_class_type
|
||||||
|
regex_traits<_CharT>::__regex_word;
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
regex_traits<_CharT>::regex_traits()
|
regex_traits<_CharT>::regex_traits()
|
||||||
{
|
{
|
||||||
@@ -1231,11 +1235,11 @@ regex_traits<_CharT>::__value(wchar_t __ch, int __radix) const
|
|||||||
|
|
||||||
template <class _CharT> class __node;
|
template <class _CharT> class __node;
|
||||||
|
|
||||||
template <class _BidirectionalIterator> class _LIBCPP_VISIBLE sub_match;
|
template <class _BidirectionalIterator> class _LIBCPP_TYPE_VIS sub_match;
|
||||||
|
|
||||||
template <class _BidirectionalIterator,
|
template <class _BidirectionalIterator,
|
||||||
class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
|
class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
|
||||||
class _LIBCPP_VISIBLE match_results;
|
class _LIBCPP_TYPE_VIS match_results;
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
struct __state
|
struct __state
|
||||||
@@ -2411,7 +2415,7 @@ __exit:
|
|||||||
template <class _CharT, class _Traits> class __lookahead;
|
template <class _CharT, class _Traits> class __lookahead;
|
||||||
|
|
||||||
template <class _CharT, class _Traits = regex_traits<_CharT> >
|
template <class _CharT, class _Traits = regex_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE basic_regex
|
class _LIBCPP_TYPE_VIS basic_regex
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
@@ -2842,6 +2846,27 @@ private:
|
|||||||
template <class, class> friend class __lookahead;
|
template <class, class> friend class __lookahead;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::icase;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::nosubs;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::optimize;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::collate;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::ECMAScript;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::basic;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::extended;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::awk;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::grep;
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::egrep;
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
void
|
void
|
||||||
basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
|
basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
|
||||||
@@ -4728,7 +4753,7 @@ typedef basic_regex<wchar_t> wregex;
|
|||||||
// sub_match
|
// sub_match
|
||||||
|
|
||||||
template <class _BidirectionalIterator>
|
template <class _BidirectionalIterator>
|
||||||
class _LIBCPP_VISIBLE sub_match
|
class _LIBCPP_TYPE_VIS sub_match
|
||||||
: public pair<_BidirectionalIterator, _BidirectionalIterator>
|
: public pair<_BidirectionalIterator, _BidirectionalIterator>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -5151,7 +5176,7 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _BidirectionalIterator, class _Allocator>
|
template <class _BidirectionalIterator, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE match_results
|
class _LIBCPP_TYPE_VIS match_results
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Allocator allocator_type;
|
typedef _Allocator allocator_type;
|
||||||
@@ -5937,7 +5962,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
|
|||||||
template <class _BidirectionalIterator,
|
template <class _BidirectionalIterator,
|
||||||
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
|
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
|
||||||
class _Traits = regex_traits<_CharT> >
|
class _Traits = regex_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE regex_iterator
|
class _LIBCPP_TYPE_VIS regex_iterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef basic_regex<_CharT, _Traits> regex_type;
|
typedef basic_regex<_CharT, _Traits> regex_type;
|
||||||
@@ -6049,7 +6074,7 @@ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
|
|||||||
template <class _BidirectionalIterator,
|
template <class _BidirectionalIterator,
|
||||||
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
|
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
|
||||||
class _Traits = regex_traits<_CharT> >
|
class _Traits = regex_traits<_CharT> >
|
||||||
class _LIBCPP_VISIBLE regex_token_iterator
|
class _LIBCPP_TYPE_VIS regex_token_iterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef basic_regex<_CharT, _Traits> regex_type;
|
typedef basic_regex<_CharT, _Traits> regex_type;
|
||||||
|
@@ -365,7 +365,7 @@ struct __outermost<_Alloc, true>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _OuterAlloc, class... _InnerAllocs>
|
template <class _OuterAlloc, class... _InnerAllocs>
|
||||||
class _LIBCPP_VISIBLE scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
|
class _LIBCPP_TYPE_VIS scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
|
||||||
: public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
|
: public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
|
||||||
{
|
{
|
||||||
typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
|
typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
|
||||||
|
@@ -346,7 +346,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
template <class _Key, class _Compare = less<_Key>,
|
template <class _Key, class _Compare = less<_Key>,
|
||||||
class _Allocator = allocator<_Key> >
|
class _Allocator = allocator<_Key> >
|
||||||
class _LIBCPP_VISIBLE set
|
class _LIBCPP_TYPE_VIS set
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
@@ -685,7 +685,7 @@ swap(set<_Key, _Compare, _Allocator>& __x,
|
|||||||
|
|
||||||
template <class _Key, class _Compare = less<_Key>,
|
template <class _Key, class _Compare = less<_Key>,
|
||||||
class _Allocator = allocator<_Key> >
|
class _Allocator = allocator<_Key> >
|
||||||
class _LIBCPP_VISIBLE multiset
|
class _LIBCPP_TYPE_VIS multiset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
|
172
include/sstream
172
include/sstream
@@ -186,7 +186,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
// basic_stringbuf
|
// basic_stringbuf
|
||||||
|
|
||||||
template <class _CharT, class _Traits, class _Allocator>
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE basic_stringbuf
|
class _LIBCPP_TYPE_VIS basic_stringbuf
|
||||||
: public basic_streambuf<_CharT, _Traits>
|
: public basic_streambuf<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -260,17 +260,36 @@ template <class _CharT, class _Traits, class _Allocator>
|
|||||||
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
|
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
|
||||||
: __mode_(__rhs.__mode_)
|
: __mode_(__rhs.__mode_)
|
||||||
{
|
{
|
||||||
ptrdiff_t __ninp = __rhs.gptr() - __rhs.eback();
|
char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
|
||||||
ptrdiff_t __einp = __rhs.egptr() - __rhs.eback();
|
ptrdiff_t __binp = -1;
|
||||||
ptrdiff_t __nout = __rhs.pptr() - __rhs.pbase();
|
ptrdiff_t __ninp = -1;
|
||||||
ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
|
ptrdiff_t __einp = -1;
|
||||||
ptrdiff_t __hm = __rhs.__hm_ - __rhs.pbase();
|
if (__rhs.eback() != nullptr)
|
||||||
|
{
|
||||||
|
__binp = __rhs.eback() - __p;
|
||||||
|
__ninp = __rhs.gptr() - __p;
|
||||||
|
__einp = __rhs.egptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __bout = -1;
|
||||||
|
ptrdiff_t __nout = -1;
|
||||||
|
ptrdiff_t __eout = -1;
|
||||||
|
if (__rhs.pbase() != nullptr)
|
||||||
|
{
|
||||||
|
__bout = __rhs.pbase() - __p;
|
||||||
|
__nout = __rhs.pptr() - __p;
|
||||||
|
__eout = __rhs.epptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p;
|
||||||
__str_ = _VSTD::move(__rhs.__str_);
|
__str_ = _VSTD::move(__rhs.__str_);
|
||||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
__p = const_cast<char_type*>(__str_.data());
|
||||||
this->setg(__p, __p + __ninp, __p + __einp);
|
if (__binp != -1)
|
||||||
this->setp(__p, __p + __eout);
|
this->setg(__p + __binp, __p + __ninp, __p + __einp);
|
||||||
this->pbump(__nout);
|
if (__bout != -1)
|
||||||
__hm_ = __p + __hm;
|
{
|
||||||
|
this->setp(__p + __bout, __p + __eout);
|
||||||
|
this->pbump(__nout);
|
||||||
|
}
|
||||||
|
__hm_ = __hm == -1 ? nullptr : __p + __hm;
|
||||||
__p = const_cast<char_type*>(__rhs.__str_.data());
|
__p = const_cast<char_type*>(__rhs.__str_.data());
|
||||||
__rhs.setg(__p, __p, __p);
|
__rhs.setg(__p, __p, __p);
|
||||||
__rhs.setp(__p, __p);
|
__rhs.setp(__p, __p);
|
||||||
@@ -282,18 +301,37 @@ template <class _CharT, class _Traits, class _Allocator>
|
|||||||
basic_stringbuf<_CharT, _Traits, _Allocator>&
|
basic_stringbuf<_CharT, _Traits, _Allocator>&
|
||||||
basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
||||||
{
|
{
|
||||||
ptrdiff_t __ninp = __rhs.gptr() - __rhs.eback();
|
char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
|
||||||
ptrdiff_t __einp = __rhs.egptr() - __rhs.eback();
|
ptrdiff_t __binp = -1;
|
||||||
ptrdiff_t __nout = __rhs.pptr() - __rhs.pbase();
|
ptrdiff_t __ninp = -1;
|
||||||
ptrdiff_t __eout = __rhs.epptr() - __rhs.pbase();
|
ptrdiff_t __einp = -1;
|
||||||
ptrdiff_t __hm = __rhs.__hm_ - __rhs.pbase();
|
if (__rhs.eback() != nullptr)
|
||||||
__mode_ = __rhs.__mode_;
|
{
|
||||||
|
__binp = __rhs.eback() - __p;
|
||||||
|
__ninp = __rhs.gptr() - __p;
|
||||||
|
__einp = __rhs.egptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __bout = -1;
|
||||||
|
ptrdiff_t __nout = -1;
|
||||||
|
ptrdiff_t __eout = -1;
|
||||||
|
if (__rhs.pbase() != nullptr)
|
||||||
|
{
|
||||||
|
__bout = __rhs.pbase() - __p;
|
||||||
|
__nout = __rhs.pptr() - __p;
|
||||||
|
__eout = __rhs.epptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p;
|
||||||
__str_ = _VSTD::move(__rhs.__str_);
|
__str_ = _VSTD::move(__rhs.__str_);
|
||||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
__p = const_cast<char_type*>(__str_.data());
|
||||||
this->setg(__p, __p + __ninp, __p + __einp);
|
if (__binp != -1)
|
||||||
this->setp(__p, __p + __eout);
|
this->setg(__p + __binp, __p + __ninp, __p + __einp);
|
||||||
this->pbump(__nout);
|
if (__bout != -1)
|
||||||
__hm_ = __p + __hm;
|
{
|
||||||
|
this->setp(__p + __bout, __p + __eout);
|
||||||
|
this->pbump(__nout);
|
||||||
|
}
|
||||||
|
__hm_ = __hm == -1 ? nullptr : __p + __hm;
|
||||||
|
__mode_ = __rhs.__mode_;
|
||||||
__p = const_cast<char_type*>(__rhs.__str_.data());
|
__p = const_cast<char_type*>(__rhs.__str_.data());
|
||||||
__rhs.setg(__p, __p, __p);
|
__rhs.setg(__p, __p, __p);
|
||||||
__rhs.setp(__p, __p);
|
__rhs.setp(__p, __p);
|
||||||
@@ -308,28 +346,74 @@ template <class _CharT, class _Traits, class _Allocator>
|
|||||||
void
|
void
|
||||||
basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
|
basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
|
||||||
{
|
{
|
||||||
ptrdiff_t __rninp = __rhs.gptr() - __rhs.eback();
|
char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
|
||||||
ptrdiff_t __reinp = __rhs.egptr() - __rhs.eback();
|
ptrdiff_t __rbinp = -1;
|
||||||
ptrdiff_t __rnout = __rhs.pptr() - __rhs.pbase();
|
ptrdiff_t __rninp = -1;
|
||||||
ptrdiff_t __reout = __rhs.epptr() - __rhs.pbase();
|
ptrdiff_t __reinp = -1;
|
||||||
ptrdiff_t __rhm = __rhs.__hm_ - __rhs.pbase();
|
if (__rhs.eback() != nullptr)
|
||||||
ptrdiff_t __lninp = this->gptr() - this->eback();
|
{
|
||||||
ptrdiff_t __leinp = this->egptr() - this->eback();
|
__rbinp = __rhs.eback() - __p;
|
||||||
ptrdiff_t __lnout = this->pptr() - this->pbase();
|
__rninp = __rhs.gptr() - __p;
|
||||||
ptrdiff_t __leout = this->epptr() - this->pbase();
|
__reinp = __rhs.egptr() - __p;
|
||||||
ptrdiff_t __lhm = this->__hm_ - this->pbase();
|
}
|
||||||
|
ptrdiff_t __rbout = -1;
|
||||||
|
ptrdiff_t __rnout = -1;
|
||||||
|
ptrdiff_t __reout = -1;
|
||||||
|
if (__rhs.pbase() != nullptr)
|
||||||
|
{
|
||||||
|
__rbout = __rhs.pbase() - __p;
|
||||||
|
__rnout = __rhs.pptr() - __p;
|
||||||
|
__reout = __rhs.epptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __rhm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p;
|
||||||
|
__p = const_cast<char_type*>(__str_.data());
|
||||||
|
ptrdiff_t __lbinp = -1;
|
||||||
|
ptrdiff_t __lninp = -1;
|
||||||
|
ptrdiff_t __leinp = -1;
|
||||||
|
if (this->eback() != nullptr)
|
||||||
|
{
|
||||||
|
__lbinp = this->eback() - __p;
|
||||||
|
__lninp = this->gptr() - __p;
|
||||||
|
__leinp = this->egptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __lbout = -1;
|
||||||
|
ptrdiff_t __lnout = -1;
|
||||||
|
ptrdiff_t __leout = -1;
|
||||||
|
if (this->pbase() != nullptr)
|
||||||
|
{
|
||||||
|
__lbout = this->pbase() - __p;
|
||||||
|
__lnout = this->pptr() - __p;
|
||||||
|
__leout = this->epptr() - __p;
|
||||||
|
}
|
||||||
|
ptrdiff_t __lhm = __hm_ == nullptr ? -1 : __hm_ - __p;
|
||||||
_VSTD::swap(__mode_, __rhs.__mode_);
|
_VSTD::swap(__mode_, __rhs.__mode_);
|
||||||
__str_.swap(__rhs.__str_);
|
__str_.swap(__rhs.__str_);
|
||||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
__p = const_cast<char_type*>(__str_.data());
|
||||||
this->setg(__p, __p + __rninp, __p + __reinp);
|
if (__rbinp != -1)
|
||||||
this->setp(__p, __p + __reout);
|
this->setg(__p + __rbinp, __p + __rninp, __p + __reinp);
|
||||||
this->pbump(__rnout);
|
else
|
||||||
__hm_ = __p + __rhm;
|
this->setg(nullptr, nullptr, nullptr);
|
||||||
|
if (__rbout != -1)
|
||||||
|
{
|
||||||
|
this->setp(__p + __rbout, __p + __reout);
|
||||||
|
this->pbump(__rnout);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
this->setp(nullptr, nullptr);
|
||||||
|
__hm_ = __rhm == -1 ? nullptr : __p + __rhm;
|
||||||
__p = const_cast<char_type*>(__rhs.__str_.data());
|
__p = const_cast<char_type*>(__rhs.__str_.data());
|
||||||
__rhs.setg(__p, __p + __lninp, __p + __leinp);
|
if (__lbinp != -1)
|
||||||
__rhs.setp(__p, __p + __leout);
|
__rhs.setg(__p + __lbinp, __p + __lninp, __p + __leinp);
|
||||||
__rhs.pbump(__lnout);
|
else
|
||||||
__rhs.__hm_ = __p + __lhm;
|
__rhs.setg(nullptr, nullptr, nullptr);
|
||||||
|
if (__lbout != -1)
|
||||||
|
{
|
||||||
|
__rhs.setp(__p + __lbout, __p + __leout);
|
||||||
|
__rhs.pbump(__lnout);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
__rhs.setp(nullptr, nullptr);
|
||||||
|
__rhs.__hm_ = __lhm == -1 ? nullptr : __p + __lhm;
|
||||||
locale __tl = __rhs.getloc();
|
locale __tl = __rhs.getloc();
|
||||||
__rhs.pubimbue(this->getloc());
|
__rhs.pubimbue(this->getloc());
|
||||||
this->pubimbue(__tl);
|
this->pubimbue(__tl);
|
||||||
@@ -529,7 +613,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
|
|||||||
// basic_istringstream
|
// basic_istringstream
|
||||||
|
|
||||||
template <class _CharT, class _Traits, class _Allocator>
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE basic_istringstream
|
class _LIBCPP_TYPE_VIS basic_istringstream
|
||||||
: public basic_istream<_CharT, _Traits>
|
: public basic_istream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -648,7 +732,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
|||||||
// basic_ostringstream
|
// basic_ostringstream
|
||||||
|
|
||||||
template <class _CharT, class _Traits, class _Allocator>
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE basic_ostringstream
|
class _LIBCPP_TYPE_VIS basic_ostringstream
|
||||||
: public basic_ostream<_CharT, _Traits>
|
: public basic_ostream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -767,7 +851,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
|||||||
// basic_stringstream
|
// basic_stringstream
|
||||||
|
|
||||||
template <class _CharT, class _Traits, class _Allocator>
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE basic_stringstream
|
class _LIBCPP_TYPE_VIS basic_stringstream
|
||||||
: public basic_iostream<_CharT, _Traits>
|
: public basic_iostream<_CharT, _Traits>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -91,7 +91,7 @@ template <class T, class Container>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp, class _Container> class _LIBCPP_VISIBLE stack;
|
template <class _Tp, class _Container> class _LIBCPP_TYPE_VIS stack;
|
||||||
|
|
||||||
template <class _Tp, class _Container>
|
template <class _Tp, class _Container>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -104,7 +104,7 @@ bool
|
|||||||
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
||||||
|
|
||||||
template <class _Tp, class _Container = deque<_Tp> >
|
template <class _Tp, class _Container = deque<_Tp> >
|
||||||
class _LIBCPP_VISIBLE stack
|
class _LIBCPP_TYPE_VIS stack
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Container container_type;
|
typedef _Container container_type;
|
||||||
@@ -282,7 +282,7 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Container, class _Alloc>
|
template <class _Tp, class _Container, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator<stack<_Tp, _Container>, _Alloc>
|
struct _LIBCPP_TYPE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
|
||||||
: public uses_allocator<_Container, _Alloc>
|
: public uses_allocator<_Container, _Alloc>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@@ -119,7 +119,7 @@ protected:
|
|||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
class _LIBCPP_VISIBLE basic_streambuf
|
class _LIBCPP_TYPE_VIS basic_streambuf
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
|
174
include/string
174
include/string
@@ -457,7 +457,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
// fpos
|
// fpos
|
||||||
|
|
||||||
template <class _StateT>
|
template <class _StateT>
|
||||||
class _LIBCPP_VISIBLE fpos
|
class _LIBCPP_TYPE_VIS fpos
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
_StateT __st_;
|
_StateT __st_;
|
||||||
@@ -494,7 +494,7 @@ bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)
|
|||||||
// char_traits
|
// char_traits
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
struct _LIBCPP_VISIBLE char_traits
|
struct _LIBCPP_TYPE_VIS char_traits
|
||||||
{
|
{
|
||||||
typedef _CharT char_type;
|
typedef _CharT char_type;
|
||||||
typedef int int_type;
|
typedef int int_type;
|
||||||
@@ -620,7 +620,7 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
|
|||||||
// char_traits<char>
|
// char_traits<char>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE char_traits<char>
|
struct _LIBCPP_TYPE_VIS char_traits<char>
|
||||||
{
|
{
|
||||||
typedef char char_type;
|
typedef char char_type;
|
||||||
typedef int int_type;
|
typedef int int_type;
|
||||||
@@ -676,7 +676,7 @@ struct _LIBCPP_VISIBLE char_traits<char>
|
|||||||
// char_traits<wchar_t>
|
// char_traits<wchar_t>
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE char_traits<wchar_t>
|
struct _LIBCPP_TYPE_VIS char_traits<wchar_t>
|
||||||
{
|
{
|
||||||
typedef wchar_t char_type;
|
typedef wchar_t char_type;
|
||||||
typedef wint_t int_type;
|
typedef wint_t int_type;
|
||||||
@@ -733,7 +733,7 @@ struct _LIBCPP_VISIBLE char_traits<wchar_t>
|
|||||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE char_traits<char16_t>
|
struct _LIBCPP_TYPE_VIS char_traits<char16_t>
|
||||||
{
|
{
|
||||||
typedef char16_t char_type;
|
typedef char16_t char_type;
|
||||||
typedef uint_least16_t int_type;
|
typedef uint_least16_t int_type;
|
||||||
@@ -853,7 +853,7 @@ char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE char_traits<char32_t>
|
struct _LIBCPP_TYPE_VIS char_traits<char32_t>
|
||||||
{
|
{
|
||||||
typedef char32_t char_type;
|
typedef char32_t char_type;
|
||||||
typedef uint_least32_t int_type;
|
typedef uint_least32_t int_type;
|
||||||
@@ -1036,8 +1036,23 @@ _LIBCPP_EXTERN_TEMPLATE(class __basic_string_common<true>)
|
|||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
|
#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
|
|
||||||
|
template <class _CharT, size_t = sizeof(_CharT)>
|
||||||
|
struct __padding
|
||||||
|
{
|
||||||
|
unsigned char __xx[sizeof(_CharT)-1];
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class _CharT>
|
||||||
|
struct __padding<_CharT, 1>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
|
|
||||||
template<class _CharT, class _Traits, class _Allocator>
|
template<class _CharT, class _Traits, class _Allocator>
|
||||||
class _LIBCPP_VISIBLE basic_string
|
class _LIBCPP_TYPE_VIS basic_string
|
||||||
: private __basic_string_common<true>
|
: private __basic_string_common<true>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1069,6 +1084,39 @@ public:
|
|||||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
|
|
||||||
|
struct __long
|
||||||
|
{
|
||||||
|
pointer __data_;
|
||||||
|
size_type __size_;
|
||||||
|
size_type __cap_;
|
||||||
|
};
|
||||||
|
|
||||||
|
#if _LIBCPP_BIG_ENDIAN
|
||||||
|
enum {__short_mask = 0x01};
|
||||||
|
enum {__long_mask = 0x1ul};
|
||||||
|
#else // _LIBCPP_BIG_ENDIAN
|
||||||
|
enum {__short_mask = 0x80};
|
||||||
|
enum {__long_mask = ~(size_type(~0) >> 1)};
|
||||||
|
#endif // _LIBCPP_BIG_ENDIAN
|
||||||
|
|
||||||
|
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
|
||||||
|
(sizeof(__long) - 1)/sizeof(value_type) : 2};
|
||||||
|
|
||||||
|
struct __short
|
||||||
|
{
|
||||||
|
value_type __data_[__min_cap];
|
||||||
|
struct
|
||||||
|
: __padding<value_type>
|
||||||
|
{
|
||||||
|
unsigned char __size_;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
struct __long
|
struct __long
|
||||||
{
|
{
|
||||||
size_type __cap_;
|
size_type __cap_;
|
||||||
@@ -1084,8 +1132,6 @@ private:
|
|||||||
enum {__long_mask = 0x1ul};
|
enum {__long_mask = 0x1ul};
|
||||||
#endif // _LIBCPP_BIG_ENDIAN
|
#endif // _LIBCPP_BIG_ENDIAN
|
||||||
|
|
||||||
enum {__mask = size_type(~0) >> 1};
|
|
||||||
|
|
||||||
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
|
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
|
||||||
(sizeof(__long) - 1)/sizeof(value_type) : 2};
|
(sizeof(__long) - 1)/sizeof(value_type) : 2};
|
||||||
|
|
||||||
@@ -1099,6 +1145,8 @@ private:
|
|||||||
value_type __data_[__min_cap];
|
value_type __data_[__min_cap];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
|
|
||||||
union __lx{__long __lx; __short __lxx;};
|
union __lx{__long __lx; __short __lxx;};
|
||||||
|
|
||||||
enum {__n_words = sizeof(__lx) / sizeof(size_type)};
|
enum {__n_words = sizeof(__lx) / sizeof(size_type)};
|
||||||
@@ -1462,6 +1510,11 @@ public:
|
|||||||
int compare(size_type __pos1, size_type __n1, const_pointer __s, size_type __n2) const;
|
int compare(size_type __pos1, size_type __n1, const_pointer __s, size_type __n2) const;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY bool __invariants() const;
|
_LIBCPP_INLINE_VISIBILITY bool __invariants() const;
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool __is_long() const _NOEXCEPT
|
||||||
|
{return bool(__r_.first().__s.__size_ & __short_mask);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
allocator_type& __alloc() _NOEXCEPT
|
allocator_type& __alloc() _NOEXCEPT
|
||||||
@@ -1470,24 +1523,44 @@ private:
|
|||||||
const allocator_type& __alloc() const _NOEXCEPT
|
const allocator_type& __alloc() const _NOEXCEPT
|
||||||
{return __r_.second();}
|
{return __r_.second();}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
bool __is_long() const _NOEXCEPT
|
|
||||||
{return bool(__r_.first().__s.__size_ & __short_mask);}
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __set_short_size(size_type __s) _NOEXCEPT
|
void __set_short_size(size_type __s) _NOEXCEPT
|
||||||
#if _LIBCPP_BIG_ENDIAN
|
# if _LIBCPP_BIG_ENDIAN
|
||||||
{__r_.first().__s.__size_ = (unsigned char)(__s);}
|
|
||||||
#else
|
|
||||||
{__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
|
{__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
|
||||||
#endif
|
# else
|
||||||
|
{__r_.first().__s.__size_ = (unsigned char)(__s);}
|
||||||
|
# endif
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
size_type __get_short_size() const _NOEXCEPT
|
size_type __get_short_size() const _NOEXCEPT
|
||||||
#if _LIBCPP_BIG_ENDIAN
|
# if _LIBCPP_BIG_ENDIAN
|
||||||
{return __r_.first().__s.__size_;}
|
|
||||||
#else
|
|
||||||
{return __r_.first().__s.__size_ >> 1;}
|
{return __r_.first().__s.__size_ >> 1;}
|
||||||
#endif
|
# else
|
||||||
|
{return __r_.first().__s.__size_;}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void __set_short_size(size_type __s) _NOEXCEPT
|
||||||
|
# if _LIBCPP_BIG_ENDIAN
|
||||||
|
{__r_.first().__s.__size_ = (unsigned char)(__s);}
|
||||||
|
# else
|
||||||
|
{__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
size_type __get_short_size() const _NOEXCEPT
|
||||||
|
# if _LIBCPP_BIG_ENDIAN
|
||||||
|
{return __r_.first().__s.__size_;}
|
||||||
|
# else
|
||||||
|
{return __r_.first().__s.__size_ >> 1;}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __set_long_size(size_type __s) _NOEXCEPT
|
void __set_long_size(size_type __s) _NOEXCEPT
|
||||||
{__r_.first().__l.__size_ = __s;}
|
{__r_.first().__l.__size_ = __s;}
|
||||||
@@ -2315,14 +2388,37 @@ template <class _CharT, class _Traits, class _Allocator>
|
|||||||
void
|
void
|
||||||
basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
|
basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
|
||||||
{
|
{
|
||||||
size_type __cap = capacity();
|
bool __is_short = !__is_long();
|
||||||
size_type __sz = size();
|
size_type __cap;
|
||||||
|
size_type __sz;
|
||||||
|
if (__is_short)
|
||||||
|
{
|
||||||
|
__cap = __min_cap - 1;
|
||||||
|
__sz = __get_short_size();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
__cap = __get_long_cap() - 1;
|
||||||
|
__sz = __get_long_size();
|
||||||
|
}
|
||||||
if (__sz == __cap)
|
if (__sz == __cap)
|
||||||
|
{
|
||||||
__grow_by(__cap, 1, __sz, __sz, 0);
|
__grow_by(__cap, 1, __sz, __sz, 0);
|
||||||
pointer __p = __get_pointer() + __sz;
|
__is_short = !__is_long();
|
||||||
|
}
|
||||||
|
pointer __p;
|
||||||
|
if (__is_short)
|
||||||
|
{
|
||||||
|
__p = __get_short_pointer() + __sz;
|
||||||
|
__set_short_size(__sz+1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
__p = __get_long_pointer() + __sz;
|
||||||
|
__set_long_size(__sz+1);
|
||||||
|
}
|
||||||
traits_type::assign(*__p, __c);
|
traits_type::assign(*__p, __c);
|
||||||
traits_type::assign(*++__p, value_type());
|
traits_type::assign(*++__p, value_type());
|
||||||
__set_size(__sz+1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _CharT, class _Traits, class _Allocator>
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
@@ -3374,7 +3470,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(value_type __c,
|
|||||||
{
|
{
|
||||||
const_pointer __p = data();
|
const_pointer __p = data();
|
||||||
const_pointer __pe = __p + __sz;
|
const_pointer __pe = __p + __sz;
|
||||||
for (const_pointer __ps = __p + __pos; __p != __pe; ++__ps)
|
for (const_pointer __ps = __p + __pos; __ps != __pe; ++__ps)
|
||||||
if (!traits_type::eq(*__ps, __c))
|
if (!traits_type::eq(*__ps, __c))
|
||||||
return static_cast<size_type>(__ps - __p);
|
return static_cast<size_type>(__ps - __p);
|
||||||
}
|
}
|
||||||
@@ -3561,9 +3657,29 @@ bool
|
|||||||
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
|
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
|
||||||
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
|
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return __lhs.size() == __rhs.size() && _Traits::compare(__lhs.data(),
|
size_t __lhs_sz = __lhs.size();
|
||||||
__rhs.data(),
|
return __lhs_sz == __rhs.size() && _Traits::compare(__lhs.data(),
|
||||||
__lhs.size()) == 0;
|
__rhs.data(),
|
||||||
|
__lhs_sz) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class _Allocator>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY inline
|
||||||
|
bool
|
||||||
|
operator==(const basic_string<char, char_traits<char>, _Allocator>& __lhs,
|
||||||
|
const basic_string<char, char_traits<char>, _Allocator>& __rhs) _NOEXCEPT
|
||||||
|
{
|
||||||
|
size_t __lhs_sz = __lhs.size();
|
||||||
|
if (__lhs_sz != __rhs.size())
|
||||||
|
return false;
|
||||||
|
const char* __lp = __lhs.data();
|
||||||
|
const char* __rp = __rhs.data();
|
||||||
|
if (__lhs.__is_long())
|
||||||
|
return char_traits<char>::compare(__lp, __rp, __lhs_sz) == 0;
|
||||||
|
for (; __lhs_sz != 0; --__lhs_sz, ++__lp, ++__rp)
|
||||||
|
if (*__lp != *__rp)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _CharT, class _Traits, class _Allocator>
|
template<class _CharT, class _Traits, class _Allocator>
|
||||||
@@ -3923,7 +4039,7 @@ size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class _CharT, class _Traits, class _Allocator>
|
template<class _CharT, class _Traits, class _Allocator>
|
||||||
struct _LIBCPP_VISIBLE hash<basic_string<_CharT, _Traits, _Allocator> >
|
struct _LIBCPP_TYPE_VIS hash<basic_string<_CharT, _Traits, _Allocator> >
|
||||||
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
|
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
|
||||||
{
|
{
|
||||||
size_t
|
size_t
|
||||||
|
@@ -137,7 +137,7 @@ private:
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE strstreambuf
|
class _LIBCPP_TYPE_VIS strstreambuf
|
||||||
: public streambuf
|
: public streambuf
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -228,7 +228,7 @@ strstreambuf::operator=(strstreambuf&& __rhs)
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE istrstream
|
class _LIBCPP_TYPE_VIS istrstream
|
||||||
: public istream
|
: public istream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -281,7 +281,7 @@ private:
|
|||||||
strstreambuf __sb_;
|
strstreambuf __sb_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE ostrstream
|
class _LIBCPP_TYPE_VIS ostrstream
|
||||||
: public ostream
|
: public ostream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -334,7 +334,7 @@ private:
|
|||||||
strstreambuf __sb_; // exposition only
|
strstreambuf __sb_; // exposition only
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE strstream
|
class _LIBCPP_TYPE_VIS strstream
|
||||||
: public iostream
|
: public iostream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -65,8 +65,21 @@ decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
|
|||||||
#define strtoull_l _strtoui64_l
|
#define strtoull_l _strtoui64_l
|
||||||
// FIXME: current msvcrt does not know about long double
|
// FIXME: current msvcrt does not know about long double
|
||||||
#define strtold_l _strtod_l
|
#define strtold_l _strtod_l
|
||||||
#define islower_l _islower_l
|
|
||||||
#define isupper_l _isupper_l
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
int
|
||||||
|
islower_l(int c, _locale_t loc)
|
||||||
|
{
|
||||||
|
return _islower_l((int)c, loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
int
|
||||||
|
isupper_l(int c, _locale_t loc)
|
||||||
|
{
|
||||||
|
return _isupper_l((int)c, loc);
|
||||||
|
}
|
||||||
|
|
||||||
#define isdigit_l _isdigit_l
|
#define isdigit_l _isdigit_l
|
||||||
#define isxdigit_l _isxdigit_l
|
#define isxdigit_l _isxdigit_l
|
||||||
#define strcoll_l _strcoll_l
|
#define strcoll_l _strcoll_l
|
||||||
|
@@ -232,13 +232,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
// is_error_code_enum
|
// is_error_code_enum
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE is_error_code_enum
|
struct _LIBCPP_TYPE_VIS is_error_code_enum
|
||||||
: public false_type {};
|
: public false_type {};
|
||||||
|
|
||||||
// is_error_condition_enum
|
// is_error_condition_enum
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE is_error_condition_enum
|
struct _LIBCPP_TYPE_VIS is_error_condition_enum
|
||||||
: public false_type {};
|
: public false_type {};
|
||||||
|
|
||||||
// Some error codes are not present on all platforms, so we provide equivalents
|
// Some error codes are not present on all platforms, so we provide equivalents
|
||||||
@@ -345,23 +345,23 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc)
|
|||||||
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
|
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE is_error_condition_enum<errc>
|
struct _LIBCPP_TYPE_VIS is_error_condition_enum<errc>
|
||||||
: true_type { };
|
: true_type { };
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE is_error_condition_enum<errc::__lx>
|
struct _LIBCPP_TYPE_VIS is_error_condition_enum<errc::__lx>
|
||||||
: true_type { };
|
: true_type { };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE error_condition;
|
class _LIBCPP_TYPE_VIS error_condition;
|
||||||
class _LIBCPP_VISIBLE error_code;
|
class _LIBCPP_TYPE_VIS error_code;
|
||||||
|
|
||||||
// class error_category
|
// class error_category
|
||||||
|
|
||||||
class _LIBCPP_HIDDEN __do_message;
|
class _LIBCPP_HIDDEN __do_message;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE error_category
|
class _LIBCPP_TYPE_VIS error_category
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~error_category() _NOEXCEPT;
|
virtual ~error_category() _NOEXCEPT;
|
||||||
@@ -400,7 +400,7 @@ public:
|
|||||||
const error_category& generic_category() _NOEXCEPT;
|
const error_category& generic_category() _NOEXCEPT;
|
||||||
const error_category& system_category() _NOEXCEPT;
|
const error_category& system_category() _NOEXCEPT;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE error_condition
|
class _LIBCPP_TYPE_VIS error_condition
|
||||||
{
|
{
|
||||||
int __val_;
|
int __val_;
|
||||||
const error_category* __cat_;
|
const error_category* __cat_;
|
||||||
@@ -472,7 +472,7 @@ operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
|||||||
|
|
||||||
// error_code
|
// error_code
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE error_code
|
class _LIBCPP_TYPE_VIS error_code
|
||||||
{
|
{
|
||||||
int __val_;
|
int __val_;
|
||||||
const error_category* __cat_;
|
const error_category* __cat_;
|
||||||
@@ -597,7 +597,7 @@ operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
|
|||||||
{return !(__x == __y);}
|
{return !(__x == __y);}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<error_code>
|
struct _LIBCPP_TYPE_VIS hash<error_code>
|
||||||
: public unary_function<error_code, size_t>
|
: public unary_function<error_code, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -609,7 +609,7 @@ struct _LIBCPP_VISIBLE hash<error_code>
|
|||||||
|
|
||||||
// system_error
|
// system_error
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE system_error
|
class _LIBCPP_TYPE_VIS system_error
|
||||||
: public runtime_error
|
: public runtime_error
|
||||||
{
|
{
|
||||||
error_code __ec_;
|
error_code __ec_;
|
||||||
|
@@ -144,9 +144,11 @@ template <class _Tp>
|
|||||||
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
|
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
|
||||||
{
|
{
|
||||||
int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
|
int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (__ec)
|
if (__ec)
|
||||||
throw system_error(error_code(__ec, system_category()),
|
throw system_error(error_code(__ec, system_category()),
|
||||||
"__thread_specific_ptr construction failed");
|
"__thread_specific_ptr construction failed");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
@@ -173,8 +175,8 @@ __thread_specific_ptr<_Tp>::reset(pointer __p)
|
|||||||
delete __p_old;
|
delete __p_old;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE thread;
|
class _LIBCPP_TYPE_VIS thread;
|
||||||
class _LIBCPP_VISIBLE __thread_id;
|
class _LIBCPP_TYPE_VIS __thread_id;
|
||||||
|
|
||||||
namespace this_thread
|
namespace this_thread
|
||||||
{
|
{
|
||||||
@@ -183,10 +185,10 @@ _LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
|
|||||||
|
|
||||||
} // this_thread
|
} // this_thread
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE __thread_id;
|
class _LIBCPP_TYPE_VIS __thread_id;
|
||||||
template<> struct _LIBCPP_VISIBLE hash<__thread_id>;
|
template<> struct _LIBCPP_TYPE_VIS hash<__thread_id>;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE __thread_id
|
class _LIBCPP_TYPE_VIS __thread_id
|
||||||
{
|
{
|
||||||
// FIXME: pthread_t is a pointer on Darwin but a long on Linux.
|
// 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
|
// NULL is the no-thread value on Darwin. Someone needs to check
|
||||||
@@ -228,12 +230,12 @@ private:
|
|||||||
__thread_id(pthread_t __id) : __id_(__id) {}
|
__thread_id(pthread_t __id) : __id_(__id) {}
|
||||||
|
|
||||||
friend __thread_id this_thread::get_id() _NOEXCEPT;
|
friend __thread_id this_thread::get_id() _NOEXCEPT;
|
||||||
friend class _LIBCPP_VISIBLE thread;
|
friend class _LIBCPP_TYPE_VIS thread;
|
||||||
friend struct _LIBCPP_VISIBLE hash<__thread_id>;
|
friend struct _LIBCPP_TYPE_VIS hash<__thread_id>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct _LIBCPP_VISIBLE hash<__thread_id>
|
struct _LIBCPP_TYPE_VIS hash<__thread_id>
|
||||||
: public unary_function<__thread_id, size_t>
|
: public unary_function<__thread_id, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -255,7 +257,7 @@ get_id() _NOEXCEPT
|
|||||||
|
|
||||||
} // this_thread
|
} // this_thread
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE thread
|
class _LIBCPP_TYPE_VIS thread
|
||||||
{
|
{
|
||||||
pthread_t __t_;
|
pthread_t __t_;
|
||||||
|
|
||||||
@@ -326,7 +328,7 @@ __thread_specific_ptr<__thread_struct>& __thread_local_data();
|
|||||||
template <class _Fp, class ..._Args, size_t ..._Indices>
|
template <class _Fp, class ..._Args, size_t ..._Indices>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
__threaad_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
|
__thread_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
|
||||||
{
|
{
|
||||||
__invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
|
__invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
|
||||||
}
|
}
|
||||||
@@ -338,7 +340,7 @@ __thread_proxy(void* __vp)
|
|||||||
__thread_local_data().reset(new __thread_struct);
|
__thread_local_data().reset(new __thread_struct);
|
||||||
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
|
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
|
||||||
typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
|
typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
|
||||||
__threaad_execute(*__p, _Index());
|
__thread_execute(*__p, _Index());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -128,7 +128,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
// allocator_arg_t
|
// allocator_arg_t
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE allocator_arg_t { };
|
struct _LIBCPP_TYPE_VIS allocator_arg_t { };
|
||||||
|
|
||||||
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
|
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
|
||||||
extern const allocator_arg_t allocator_arg;
|
extern const allocator_arg_t allocator_arg;
|
||||||
@@ -163,7 +163,7 @@ struct __uses_allocator<_Tp, _Alloc, false>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator
|
struct _LIBCPP_TYPE_VIS uses_allocator
|
||||||
: public __uses_allocator<_Tp, _Alloc>
|
: public __uses_allocator<_Tp, _Alloc>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@@ -193,7 +193,7 @@ struct __uses_alloc_ctor
|
|||||||
// tuple_size
|
// tuple_size
|
||||||
|
|
||||||
template <class ..._Tp>
|
template <class ..._Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...> >
|
class _LIBCPP_TYPE_VIS tuple_size<tuple<_Tp...> >
|
||||||
: public integral_constant<size_t, sizeof...(_Tp)>
|
: public integral_constant<size_t, sizeof...(_Tp)>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@@ -201,7 +201,7 @@ class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...> >
|
|||||||
// tuple_element
|
// tuple_element
|
||||||
|
|
||||||
template <size_t _Ip, class ..._Tp>
|
template <size_t _Ip, class ..._Tp>
|
||||||
class _LIBCPP_VISIBLE tuple_element<_Ip, tuple<_Tp...> >
|
class _LIBCPP_TYPE_VIS tuple_element<_Ip, tuple<_Tp...> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
|
typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
|
||||||
@@ -477,7 +477,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
template <class _Tuple,
|
template <class _Tuple,
|
||||||
class = typename enable_if
|
class = typename enable_if
|
||||||
<
|
<
|
||||||
__tuple_convertible<_Tuple, tuple<_Tp...> >::value
|
__tuple_constructible<_Tuple, tuple<_Tp...> >::value
|
||||||
>::type
|
>::type
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -533,7 +533,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class ..._Tp>
|
template <class ..._Tp>
|
||||||
class _LIBCPP_VISIBLE tuple
|
class _LIBCPP_TYPE_VIS tuple
|
||||||
{
|
{
|
||||||
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
|
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
|
||||||
|
|
||||||
@@ -721,7 +721,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class _LIBCPP_VISIBLE tuple<>
|
class _LIBCPP_TYPE_VIS tuple<>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -803,7 +803,7 @@ struct __ignore_t
|
|||||||
|
|
||||||
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
|
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
|
||||||
|
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE reference_wrapper;
|
template <class _Tp> class _LIBCPP_TYPE_VIS reference_wrapper;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct ___make_tuple_return
|
struct ___make_tuple_return
|
||||||
@@ -1071,7 +1071,7 @@ tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class ..._Tp, class _Alloc>
|
template <class ..._Tp, class _Alloc>
|
||||||
struct _LIBCPP_VISIBLE uses_allocator<tuple<_Tp...>, _Alloc>
|
struct _LIBCPP_TYPE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
|
||||||
: true_type {};
|
: true_type {};
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -55,7 +55,7 @@ struct hash<type_index>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE type_index
|
class _LIBCPP_TYPE_VIS type_index
|
||||||
{
|
{
|
||||||
const type_info* __t_;
|
const type_info* __t_;
|
||||||
public:
|
public:
|
||||||
@@ -87,10 +87,10 @@ public:
|
|||||||
const char* name() const _NOEXCEPT {return __t_->name();}
|
const char* name() const _NOEXCEPT {return __t_->name();}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp> struct _LIBCPP_VISIBLE hash;
|
template <class _Tp> struct _LIBCPP_TYPE_VIS hash;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_VISIBLE hash<type_index>
|
struct _LIBCPP_TYPE_VIS hash<type_index>
|
||||||
: public unary_function<type_index, size_t>
|
: public unary_function<type_index, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@@ -544,7 +544,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _HashIterator>
|
template <class _HashIterator>
|
||||||
class _LIBCPP_VISIBLE __hash_map_iterator
|
class _LIBCPP_TYPE_VIS __hash_map_iterator
|
||||||
{
|
{
|
||||||
_HashIterator __i_;
|
_HashIterator __i_;
|
||||||
|
|
||||||
@@ -592,15 +592,15 @@ public:
|
|||||||
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
|
||||||
{return __x.__i_ != __y.__i_;}
|
{return __x.__i_ != __y.__i_;}
|
||||||
|
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _HashIterator>
|
template <class _HashIterator>
|
||||||
class _LIBCPP_VISIBLE __hash_map_const_iterator
|
class _LIBCPP_TYPE_VIS __hash_map_const_iterator
|
||||||
{
|
{
|
||||||
_HashIterator __i_;
|
_HashIterator __i_;
|
||||||
|
|
||||||
@@ -653,15 +653,15 @@ public:
|
|||||||
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
|
||||||
{return __x.__i_ != __y.__i_;}
|
{return __x.__i_ != __y.__i_;}
|
||||||
|
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map;
|
||||||
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
|
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
|
||||||
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
|
template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||||
class _LIBCPP_VISIBLE unordered_map
|
class _LIBCPP_TYPE_VIS unordered_map
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -1294,7 +1294,7 @@ operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
|
|||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
|
||||||
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
class _Alloc = allocator<pair<const _Key, _Tp> > >
|
||||||
class _LIBCPP_VISIBLE unordered_multimap
|
class _LIBCPP_TYPE_VIS unordered_multimap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
|
@@ -313,7 +313,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||||
class _Alloc = allocator<_Value> >
|
class _Alloc = allocator<_Value> >
|
||||||
class _LIBCPP_VISIBLE unordered_set
|
class _LIBCPP_TYPE_VIS unordered_set
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
@@ -725,7 +725,7 @@ operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
|||||||
|
|
||||||
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
|
||||||
class _Alloc = allocator<_Value> >
|
class _Alloc = allocator<_Value> >
|
||||||
class _LIBCPP_VISIBLE unordered_multiset
|
class _LIBCPP_TYPE_VIS unordered_multiset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types
|
// types
|
||||||
|
@@ -205,7 +205,7 @@ move_if_noexcept(_Tp& __x) _NOEXCEPT
|
|||||||
return _VSTD::move(__x);
|
return _VSTD::move(__x);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE piecewise_construct_t { };
|
struct _LIBCPP_TYPE_VIS piecewise_construct_t { };
|
||||||
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
|
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
|
||||||
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
|
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
|
||||||
#else
|
#else
|
||||||
@@ -213,7 +213,7 @@ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
struct _LIBCPP_VISIBLE pair
|
struct _LIBCPP_TYPE_VIS pair
|
||||||
{
|
{
|
||||||
typedef _T1 first_type;
|
typedef _T1 first_type;
|
||||||
typedef _T2 second_type;
|
typedef _T2 second_type;
|
||||||
@@ -419,7 +419,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
|
|||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE reference_wrapper;
|
template <class _Tp> class _LIBCPP_TYPE_VIS reference_wrapper;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct ___make_pair_return
|
struct ___make_pair_return
|
||||||
@@ -461,36 +461,36 @@ make_pair(_T1 __x, _T2 __y)
|
|||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
class _LIBCPP_VISIBLE tuple_size<pair<_T1, _T2> >
|
class _LIBCPP_TYPE_VIS tuple_size<pair<_T1, _T2> >
|
||||||
: public integral_constant<size_t, 2> {};
|
: public integral_constant<size_t, 2> {};
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
class _LIBCPP_VISIBLE tuple_size<const pair<_T1, _T2> >
|
class _LIBCPP_TYPE_VIS tuple_size<const pair<_T1, _T2> >
|
||||||
: public integral_constant<size_t, 2> {};
|
: public integral_constant<size_t, 2> {};
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
class _LIBCPP_VISIBLE tuple_element<0, pair<_T1, _T2> >
|
class _LIBCPP_TYPE_VIS tuple_element<0, pair<_T1, _T2> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _T1 type;
|
typedef _T1 type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
class _LIBCPP_VISIBLE tuple_element<1, pair<_T1, _T2> >
|
class _LIBCPP_TYPE_VIS tuple_element<1, pair<_T1, _T2> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _T2 type;
|
typedef _T2 type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
class _LIBCPP_VISIBLE tuple_element<0, const pair<_T1, _T2> >
|
class _LIBCPP_TYPE_VIS tuple_element<0, const pair<_T1, _T2> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef const _T1 type;
|
typedef const _T1 type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
class _LIBCPP_VISIBLE tuple_element<1, const pair<_T1, _T2> >
|
class _LIBCPP_TYPE_VIS tuple_element<1, const pair<_T1, _T2> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef const _T2 type;
|
typedef const _T2 type;
|
||||||
|
@@ -354,9 +354,9 @@ template <class T> unspecified2 end(const valarray<T>& v);
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template<class _Tp> class _LIBCPP_VISIBLE valarray;
|
template<class _Tp> class _LIBCPP_TYPE_VIS valarray;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE slice
|
class _LIBCPP_TYPE_VIS slice
|
||||||
{
|
{
|
||||||
size_t __start_;
|
size_t __start_;
|
||||||
size_t __size_;
|
size_t __size_;
|
||||||
@@ -381,11 +381,11 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
|
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE slice_array;
|
template <class _Tp> class _LIBCPP_TYPE_VIS slice_array;
|
||||||
class _LIBCPP_VISIBLE gslice;
|
class _LIBCPP_TYPE_VIS gslice;
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE gslice_array;
|
template <class _Tp> class _LIBCPP_TYPE_VIS gslice_array;
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE mask_array;
|
template <class _Tp> class _LIBCPP_TYPE_VIS mask_array;
|
||||||
template <class _Tp> class _LIBCPP_VISIBLE indirect_array;
|
template <class _Tp> class _LIBCPP_TYPE_VIS indirect_array;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -671,7 +671,7 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
size_t size() const {return __size_;}
|
size_t size() const {return __size_;}
|
||||||
|
|
||||||
template <class> friend class _LIBCPP_VISIBLE valarray;
|
template <class> friend class _LIBCPP_TYPE_VIS valarray;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _ValExpr>
|
template <class _ValExpr>
|
||||||
@@ -786,7 +786,7 @@ template<class _Tp>
|
|||||||
struct __is_val_expr<valarray<_Tp> > : true_type {};
|
struct __is_val_expr<valarray<_Tp> > : true_type {};
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE valarray
|
class _LIBCPP_TYPE_VIS valarray
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
@@ -976,12 +976,12 @@ public:
|
|||||||
void resize(size_t __n, value_type __x = value_type());
|
void resize(size_t __n, value_type __x = value_type());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <class> friend class _LIBCPP_VISIBLE valarray;
|
template <class> friend class _LIBCPP_TYPE_VIS valarray;
|
||||||
template <class> friend class _LIBCPP_VISIBLE slice_array;
|
template <class> friend class _LIBCPP_TYPE_VIS slice_array;
|
||||||
template <class> friend class _LIBCPP_VISIBLE gslice_array;
|
template <class> friend class _LIBCPP_TYPE_VIS gslice_array;
|
||||||
template <class> friend class _LIBCPP_VISIBLE mask_array;
|
template <class> friend class _LIBCPP_TYPE_VIS mask_array;
|
||||||
template <class> friend class __mask_expr;
|
template <class> friend class __mask_expr;
|
||||||
template <class> friend class _LIBCPP_VISIBLE indirect_array;
|
template <class> friend class _LIBCPP_TYPE_VIS indirect_array;
|
||||||
template <class> friend class __indirect_expr;
|
template <class> friend class __indirect_expr;
|
||||||
template <class> friend class __val_expr;
|
template <class> friend class __val_expr;
|
||||||
|
|
||||||
@@ -1091,7 +1091,7 @@ struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
|
|||||||
// slice_array
|
// slice_array
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE slice_array
|
class _LIBCPP_TYPE_VIS slice_array
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
@@ -1394,7 +1394,7 @@ slice_array<_Tp>::operator=(const value_type& __x) const
|
|||||||
|
|
||||||
// gslice
|
// gslice
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE gslice
|
class _LIBCPP_TYPE_VIS gslice
|
||||||
{
|
{
|
||||||
valarray<size_t> __size_;
|
valarray<size_t> __size_;
|
||||||
valarray<size_t> __stride_;
|
valarray<size_t> __stride_;
|
||||||
@@ -1461,7 +1461,7 @@ private:
|
|||||||
// gslice_array
|
// gslice_array
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE gslice_array
|
class _LIBCPP_TYPE_VIS gslice_array
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
@@ -1790,7 +1790,7 @@ gslice_array<_Tp>::operator=(const value_type& __x) const
|
|||||||
// mask_array
|
// mask_array
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE mask_array
|
class _LIBCPP_TYPE_VIS mask_array
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
@@ -2134,7 +2134,7 @@ public:
|
|||||||
// indirect_array
|
// indirect_array
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
class _LIBCPP_VISIBLE indirect_array
|
class _LIBCPP_TYPE_VIS indirect_array
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef _Tp value_type;
|
typedef _Tp value_type;
|
||||||
@@ -2485,7 +2485,7 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
size_t size() const {return __1d_.size();}
|
size_t size() const {return __1d_.size();}
|
||||||
|
|
||||||
template <class> friend class _LIBCPP_VISIBLE valarray;
|
template <class> friend class _LIBCPP_TYPE_VIS valarray;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _ValExpr>
|
template<class _ValExpr>
|
||||||
|
102
include/vector
102
include/vector
@@ -481,7 +481,7 @@ __vector_base<_Tp, _Allocator>::~__vector_base()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Allocator = allocator<_Tp> >
|
template <class _Tp, class _Allocator = allocator<_Tp> >
|
||||||
class _LIBCPP_VISIBLE vector
|
class _LIBCPP_TYPE_VIS vector
|
||||||
: private __vector_base<_Tp, _Allocator>
|
: private __vector_base<_Tp, _Allocator>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -502,6 +502,9 @@ public:
|
|||||||
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
||||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||||
|
|
||||||
|
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
|
||||||
|
"Allocator::value_type must be same type as value_type");
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
vector()
|
vector()
|
||||||
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
|
||||||
@@ -523,17 +526,29 @@ public:
|
|||||||
template <class _InputIterator>
|
template <class _InputIterator>
|
||||||
vector(_InputIterator __first, _InputIterator __last,
|
vector(_InputIterator __first, _InputIterator __last,
|
||||||
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value>::type* = 0);
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value>::type* = 0);
|
||||||
template <class _InputIterator>
|
template <class _InputIterator>
|
||||||
vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
|
vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
|
||||||
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value>::type* = 0);
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value>::type* = 0);
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
vector(_ForwardIterator __first, _ForwardIterator __last,
|
vector(_ForwardIterator __first, _ForwardIterator __last,
|
||||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);
|
typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
||||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);
|
typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
vector(initializer_list<value_type> __il);
|
vector(initializer_list<value_type> __il);
|
||||||
@@ -574,14 +589,20 @@ public:
|
|||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_input_iterator <_InputIterator>::value &&
|
__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value,
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value,
|
||||||
void
|
void
|
||||||
>::type
|
>::type
|
||||||
assign(_InputIterator __first, _InputIterator __last);
|
assign(_InputIterator __first, _InputIterator __last);
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_forward_iterator<_ForwardIterator>::value,
|
__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value,
|
||||||
void
|
void
|
||||||
>::type
|
>::type
|
||||||
assign(_ForwardIterator __first, _ForwardIterator __last);
|
assign(_ForwardIterator __first, _ForwardIterator __last);
|
||||||
@@ -697,14 +718,20 @@ public:
|
|||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_input_iterator <_InputIterator>::value &&
|
__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value,
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value,
|
||||||
iterator
|
iterator
|
||||||
>::type
|
>::type
|
||||||
insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
|
insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_forward_iterator<_ForwardIterator>::value,
|
__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value,
|
||||||
iterator
|
iterator
|
||||||
>::type
|
>::type
|
||||||
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
|
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
|
||||||
@@ -1031,7 +1058,10 @@ template <class _Tp, class _Allocator>
|
|||||||
template <class _InputIterator>
|
template <class _InputIterator>
|
||||||
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
|
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
|
||||||
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value>::type*)
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value>::type*)
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
__get_db()->__insert_c(this);
|
__get_db()->__insert_c(this);
|
||||||
@@ -1044,7 +1074,10 @@ template <class _Tp, class _Allocator>
|
|||||||
template <class _InputIterator>
|
template <class _InputIterator>
|
||||||
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
|
vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
|
||||||
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
typename enable_if<__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value>::type*)
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value>::type*)
|
||||||
: __base(__a)
|
: __base(__a)
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
@@ -1057,7 +1090,10 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c
|
|||||||
template <class _Tp, class _Allocator>
|
template <class _Tp, class _Allocator>
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
|
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
|
||||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
|
typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
__get_db()->__insert_c(this);
|
__get_db()->__insert_c(this);
|
||||||
@@ -1073,7 +1109,10 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las
|
|||||||
template <class _Tp, class _Allocator>
|
template <class _Tp, class _Allocator>
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
||||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)
|
typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
value_type,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
|
||||||
: __base(__a)
|
: __base(__a)
|
||||||
{
|
{
|
||||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
@@ -1255,7 +1294,10 @@ template <class _InputIterator>
|
|||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_input_iterator <_InputIterator>::value &&
|
__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value,
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
_Tp,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value,
|
||||||
void
|
void
|
||||||
>::type
|
>::type
|
||||||
vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
|
vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
|
||||||
@@ -1269,7 +1311,10 @@ template <class _Tp, class _Allocator>
|
|||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_forward_iterator<_ForwardIterator>::value,
|
__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
_Tp,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value,
|
||||||
void
|
void
|
||||||
>::type
|
>::type
|
||||||
vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
|
vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
|
||||||
@@ -1458,7 +1503,8 @@ vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x)
|
|||||||
allocator_type& __a = this->__alloc();
|
allocator_type& __a = this->__alloc();
|
||||||
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
|
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
|
||||||
// __v.push_back(_VSTD::forward<_Up>(__x));
|
// __v.push_back(_VSTD::forward<_Up>(__x));
|
||||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_++), _VSTD::forward<_Up>(__x));
|
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Up>(__x));
|
||||||
|
__v.__end_++;
|
||||||
__swap_out_circular_buffer(__v);
|
__swap_out_circular_buffer(__v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1505,7 +1551,8 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)
|
|||||||
allocator_type& __a = this->__alloc();
|
allocator_type& __a = this->__alloc();
|
||||||
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
|
__split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
|
||||||
// __v.emplace_back(_VSTD::forward<_Args>(__args)...);
|
// __v.emplace_back(_VSTD::forward<_Args>(__args)...);
|
||||||
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_++), _VSTD::forward<_Args>(__args)...);
|
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Args>(__args)...);
|
||||||
|
__v.__end_++;
|
||||||
__swap_out_circular_buffer(__v);
|
__swap_out_circular_buffer(__v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1548,6 +1595,8 @@ vector<_Tp, _Allocator>::erase(const_iterator __position)
|
|||||||
"vector::erase(iterator) called with an iterator not"
|
"vector::erase(iterator) called with an iterator not"
|
||||||
" referring to this vector");
|
" referring to this vector");
|
||||||
#endif
|
#endif
|
||||||
|
_LIBCPP_ASSERT(__position != end(),
|
||||||
|
"vector::erase(iterator) called with a non-dereferenceable iterator");
|
||||||
pointer __p = const_cast<pointer>(&*__position);
|
pointer __p = const_cast<pointer>(&*__position);
|
||||||
iterator __r = __make_iter(__p);
|
iterator __r = __make_iter(__p);
|
||||||
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
|
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
|
||||||
@@ -1566,7 +1615,8 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
|
|||||||
_LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range");
|
_LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range");
|
||||||
pointer __p = this->__begin_ + (__first - begin());
|
pointer __p = this->__begin_ + (__first - begin());
|
||||||
iterator __r = __make_iter(__p);
|
iterator __r = __make_iter(__p);
|
||||||
this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));
|
if (__first != __last)
|
||||||
|
this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1746,7 +1796,10 @@ template <class _InputIterator>
|
|||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_input_iterator <_InputIterator>::value &&
|
__is_input_iterator <_InputIterator>::value &&
|
||||||
!__is_forward_iterator<_InputIterator>::value,
|
!__is_forward_iterator<_InputIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
_Tp,
|
||||||
|
typename iterator_traits<_InputIterator>::reference>::value,
|
||||||
typename vector<_Tp, _Allocator>::iterator
|
typename vector<_Tp, _Allocator>::iterator
|
||||||
>::type
|
>::type
|
||||||
vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
|
vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
|
||||||
@@ -1798,7 +1851,10 @@ template <class _Tp, class _Allocator>
|
|||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_forward_iterator<_ForwardIterator>::value,
|
__is_forward_iterator<_ForwardIterator>::value &&
|
||||||
|
is_constructible<
|
||||||
|
_Tp,
|
||||||
|
typename iterator_traits<_ForwardIterator>::reference>::value,
|
||||||
typename vector<_Tp, _Allocator>::iterator
|
typename vector<_Tp, _Allocator>::iterator
|
||||||
>::type
|
>::type
|
||||||
vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
|
vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
|
||||||
@@ -1961,7 +2017,7 @@ struct __has_storage_type<vector<bool, _Allocator> >
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Allocator>
|
template <class _Allocator>
|
||||||
class _LIBCPP_VISIBLE vector<bool, _Allocator>
|
class _LIBCPP_TYPE_VIS vector<bool, _Allocator>
|
||||||
: private __vector_base_common<true>
|
: private __vector_base_common<true>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -2319,7 +2375,7 @@ private:
|
|||||||
friend class __bit_iterator<vector, false>;
|
friend class __bit_iterator<vector, false>;
|
||||||
friend class __bit_iterator<vector, true>;
|
friend class __bit_iterator<vector, true>;
|
||||||
friend struct __bit_array<vector>;
|
friend struct __bit_array<vector>;
|
||||||
friend struct _LIBCPP_VISIBLE hash<vector>;
|
friend struct _LIBCPP_TYPE_VIS hash<vector>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Allocator>
|
template <class _Allocator>
|
||||||
@@ -3102,7 +3158,7 @@ vector<bool, _Allocator>::__hash_code() const _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Allocator>
|
template <class _Allocator>
|
||||||
struct _LIBCPP_VISIBLE hash<vector<bool, _Allocator> >
|
struct _LIBCPP_TYPE_VIS hash<vector<bool, _Allocator> >
|
||||||
: public unary_function<vector<bool, _Allocator>, size_t>
|
: public unary_function<vector<bool, _Allocator>, size_t>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
@@ -31,7 +31,12 @@ else()
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DEFINED LIBCXX_CXX_ABI_DEPS)
|
||||||
|
add_dependencies(cxx ${LIBCXX_CXX_ABI_DEPS})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Generate library list.
|
# Generate library list.
|
||||||
|
set(libraries ${LIBCXX_CXX_ABI_LIBRARIES})
|
||||||
append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
|
append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
|
||||||
append_if(libraries LIBCXX_HAS_C_LIB c)
|
append_if(libraries LIBCXX_HAS_C_LIB c)
|
||||||
append_if(libraries LIBCXX_HAS_M_LIB m)
|
append_if(libraries LIBCXX_HAS_M_LIB m)
|
||||||
|
113
lib/buildit
113
lib/buildit
@@ -8,13 +8,13 @@ set -e
|
|||||||
|
|
||||||
if [ `basename $(pwd)` != "lib" ]
|
if [ `basename $(pwd)` != "lib" ]
|
||||||
then
|
then
|
||||||
echo "current directory must be lib"
|
echo "current directory must be lib"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CXX" ]
|
if [ -z "$CXX" ]
|
||||||
then
|
then
|
||||||
CXX=clang++
|
CXX=clang++
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CC" ]
|
if [ -z "$CC" ]
|
||||||
@@ -24,10 +24,10 @@ fi
|
|||||||
|
|
||||||
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
||||||
then
|
then
|
||||||
if [ -z $IPHONEOS_DEPLOYMENT_TARGET ]
|
if [ -z $IPHONEOS_DEPLOYMENT_TARGET ]
|
||||||
then
|
then
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.7
|
MACOSX_DEPLOYMENT_TARGET=10.7
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $RC_ProjectSourceVersion ]
|
if [ -z $RC_ProjectSourceVersion ]
|
||||||
@@ -37,7 +37,7 @@ fi
|
|||||||
|
|
||||||
EXTRA_FLAGS="-std=c++0x -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
|
EXTRA_FLAGS="-std=c++0x -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
|
||||||
-Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 \
|
-Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 \
|
||||||
-Wstrict-overflow=4"
|
-Wstrict-overflow=4 "
|
||||||
|
|
||||||
case $TRIPLE in
|
case $TRIPLE in
|
||||||
*-apple-*)
|
*-apple-*)
|
||||||
@@ -46,41 +46,49 @@ case $TRIPLE in
|
|||||||
RC_CFLAGS="-arch i386 -arch x86_64"
|
RC_CFLAGS="-arch i386 -arch x86_64"
|
||||||
fi
|
fi
|
||||||
SOEXT=dylib
|
SOEXT=dylib
|
||||||
if [ "$MACOSX_DEPLOYMENT_TARGET" == "10.6" ]
|
if [ "$MACOSX_DEPLOYMENT_TARGET" == "10.6" ]
|
||||||
then
|
then
|
||||||
EXTRA_FLAGS="-std=c++0x -U__STRICT_ANSI__"
|
EXTRA_FLAGS="-std=c++0x -U__STRICT_ANSI__"
|
||||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||||
-dynamiclib -nodefaultlibs -current_version 1 \
|
-dynamiclib -nodefaultlibs -current_version 1 \
|
||||||
-compatibility_version 1 \
|
-compatibility_version 1 \
|
||||||
-install_name /usr/lib/libc++.1.dylib \
|
-install_name /usr/lib/libc++.1.dylib \
|
||||||
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
||||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||||
/usr/lib/libSystem.B.dylib"
|
/usr/lib/libSystem.B.dylib"
|
||||||
else
|
else
|
||||||
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi.exp"
|
if [ -n "$SDKROOT" ]
|
||||||
if [ -n "$SDKROOT" ]
|
then
|
||||||
then
|
EXTRA_FLAGS+="-isysroot ${SDKROOT}"
|
||||||
EXTRA_FLAGS+="-isysroot ${SDKROOT}"
|
if echo "${RC_ARCHS}" | grep -q "armv7"
|
||||||
if echo "${RC_ARCHS}" | grep -q "armv7"
|
then
|
||||||
then
|
RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"
|
||||||
RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"
|
else
|
||||||
else
|
RE_EXPORT_LINE="-Wl,-reexport_library,${SDKROOT}/usr/lib/libc++abi.dylib"
|
||||||
RE_EXPORT_LINE="-Wl,-reexport_library,${SDKROOT}/usr/lib/libc++abi.dylib"
|
fi
|
||||||
fi
|
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
|
||||||
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
|
CC=`xcrun -sdk "${SDKROOT}" -find clang`
|
||||||
CC=`xcrun -sdk "${SDKROOT}" -find clang`
|
else
|
||||||
fi
|
# Check if we have _LIBCPPABI_VERSION, to determine the reexport list to use.
|
||||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
if (echo "#include <cxxabi.h>" | $CXX -E -dM -x c++ - | \
|
||||||
-dynamiclib -nodefaultlibs \
|
grep _LIBCPPABI_VERSION > /dev/null)
|
||||||
-current_version ${RC_ProjectSourceVersion} \
|
then
|
||||||
-compatibility_version 1 \
|
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi2.exp"
|
||||||
-install_name /usr/lib/libc++.1.dylib \
|
else
|
||||||
-lSystem \
|
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi.exp"
|
||||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
fi
|
||||||
${RE_EXPORT_LINE} \
|
fi
|
||||||
-Wl,-force_symbols_not_weak_list,notweak.exp \
|
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||||
-Wl,-force_symbols_weak_list,weak.exp"
|
-dynamiclib -nodefaultlibs \
|
||||||
fi
|
-current_version ${RC_ProjectSourceVersion} \
|
||||||
|
-compatibility_version 1 \
|
||||||
|
-install_name /usr/lib/libc++.1.dylib \
|
||||||
|
-lSystem \
|
||||||
|
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||||
|
${RE_EXPORT_LINE} \
|
||||||
|
-Wl,-force_symbols_not_weak_list,notweak.exp \
|
||||||
|
-Wl,-force_symbols_weak_list,weak.exp"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*-*-mingw*)
|
*-*-mingw*)
|
||||||
# FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
|
# FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
|
||||||
@@ -88,7 +96,7 @@ case $TRIPLE in
|
|||||||
LDSHARED_FLAGS="-o libc++.dll \
|
LDSHARED_FLAGS="-o libc++.dll \
|
||||||
-shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++.dll.a \
|
-shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++.dll.a \
|
||||||
-lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
|
-lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
RC_CFLAGS="-fPIC"
|
RC_CFLAGS="-fPIC"
|
||||||
SOEXT=so
|
SOEXT=so
|
||||||
@@ -106,7 +114,7 @@ fi
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
for FILE in ../src/*.cpp; do
|
for FILE in ../src/*.cpp; do
|
||||||
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -nostdinc++ -I../include $FILE
|
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -nostdinc++ -I../include $FILE
|
||||||
done
|
done
|
||||||
case $TRIPLE in
|
case $TRIPLE in
|
||||||
*-*-mingw*)
|
*-*-mingw*)
|
||||||
@@ -119,6 +127,21 @@ $CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
|
|||||||
|
|
||||||
#libtool -static -o libc++.a *.o
|
#libtool -static -o libc++.a *.o
|
||||||
|
|
||||||
|
# Create the link for the final library name, so that we can use this directory
|
||||||
|
# as a link target for the tests.
|
||||||
|
case $TRIPLE in
|
||||||
|
*-apple-*)
|
||||||
|
rm -f libc++.dylib
|
||||||
|
ln -s libc++.1.dylib libc++.dylib
|
||||||
|
;;
|
||||||
|
*-*-mingw*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
rm -f libc++.so
|
||||||
|
ln -s libc++.so.1 libc++.so
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [ -z $RC_XBS ]
|
if [ -z $RC_XBS ]
|
||||||
then
|
then
|
||||||
rm *.o
|
rm *.o
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "chrono"
|
#include "chrono"
|
||||||
#include <sys/time.h> //for gettimeofday and timeval
|
#include <sys/time.h> //for gettimeofday and timeval
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
|
#include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
|
||||||
#else /* !__APPLE__ */
|
#else /* !__APPLE__ */
|
||||||
#include <cerrno> // errno
|
#include <cerrno> // errno
|
||||||
@@ -24,6 +24,8 @@ namespace chrono
|
|||||||
|
|
||||||
// system_clock
|
// system_clock
|
||||||
|
|
||||||
|
const bool system_clock::is_steady;
|
||||||
|
|
||||||
system_clock::time_point
|
system_clock::time_point
|
||||||
system_clock::now() _NOEXCEPT
|
system_clock::now() _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -46,7 +48,9 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
|
|||||||
|
|
||||||
// steady_clock
|
// steady_clock
|
||||||
|
|
||||||
#if __APPLE__
|
const bool steady_clock::is_steady;
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
|
// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
|
||||||
// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
|
// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
|
||||||
// are run time constants supplied by the OS. This clock has no relationship
|
// are run time constants supplied by the OS. This clock has no relationship
|
||||||
|
@@ -17,15 +17,15 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_FUNC_VIS
|
||||||
__libcpp_db*
|
__libcpp_db*
|
||||||
__get_db()
|
__get_db()
|
||||||
{
|
{
|
||||||
static __libcpp_db db;
|
static __libcpp_db db;
|
||||||
return &db;
|
return &db;
|
||||||
};
|
}
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_FUNC_VIS
|
||||||
const __libcpp_db*
|
const __libcpp_db*
|
||||||
__get_const_db()
|
__get_const_db()
|
||||||
{
|
{
|
||||||
@@ -110,8 +110,7 @@ __libcpp_db::__find_c_from_i(void* __i) const
|
|||||||
{
|
{
|
||||||
RLock _(mut());
|
RLock _(mut());
|
||||||
__i_node* i = __find_iterator(__i);
|
__i_node* i = __find_iterator(__i);
|
||||||
_LIBCPP_ASSERT(i != nullptr, "iterator constructed in translation unit with debug mode not enabled."
|
_LIBCPP_ASSERT(i != nullptr, "iterator not found in debug database.");
|
||||||
" #define _LIBCPP_DEBUG2 1 for that translation unit.");
|
|
||||||
return i->__c_ != nullptr ? i->__c_->__c_ : nullptr;
|
return i->__c_ != nullptr ? i->__c_->__c_ : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +143,7 @@ __libcpp_db::__insert_c(void* __c)
|
|||||||
if (__csz_ + 1 > static_cast<size_t>(__cend_ - __cbeg_))
|
if (__csz_ + 1 > static_cast<size_t>(__cend_ - __cbeg_))
|
||||||
{
|
{
|
||||||
size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
|
size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
|
||||||
__c_node** cbeg = (__c_node**)calloc(nc, sizeof(void*));
|
__c_node** cbeg = static_cast<__c_node**>(calloc(nc, sizeof(void*)));
|
||||||
if (cbeg == nullptr)
|
if (cbeg == nullptr)
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
@@ -169,7 +168,8 @@ __libcpp_db::__insert_c(void* __c)
|
|||||||
}
|
}
|
||||||
size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
|
size_t hc = hash<void*>()(__c) % static_cast<size_t>(__cend_ - __cbeg_);
|
||||||
__c_node* p = __cbeg_[hc];
|
__c_node* p = __cbeg_[hc];
|
||||||
__c_node* r = __cbeg_[hc] = (__c_node*)malloc(sizeof(__c_node));
|
__c_node* r = __cbeg_[hc] =
|
||||||
|
static_cast<__c_node*>(malloc(sizeof(__c_node)));
|
||||||
if (__cbeg_[hc] == nullptr)
|
if (__cbeg_[hc] == nullptr)
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
@@ -302,7 +302,7 @@ __libcpp_db::__iterator_copy(void* __i, const void* __i0)
|
|||||||
__i_node* i = __find_iterator(__i);
|
__i_node* i = __find_iterator(__i);
|
||||||
__i_node* i0 = __find_iterator(__i0);
|
__i_node* i0 = __find_iterator(__i0);
|
||||||
__c_node* c0 = i0 != nullptr ? i0->__c_ : nullptr;
|
__c_node* c0 = i0 != nullptr ? i0->__c_ : nullptr;
|
||||||
if (i == nullptr && c0 != nullptr)
|
if (i == nullptr && i0 != nullptr)
|
||||||
i = __insert_iterator(__i);
|
i = __insert_iterator(__i);
|
||||||
__c_node* c = i != nullptr ? i->__c_ : nullptr;
|
__c_node* c = i != nullptr ? i->__c_ : nullptr;
|
||||||
if (c != c0)
|
if (c != c0)
|
||||||
@@ -408,7 +408,8 @@ __c_node::__add(__i_node* i)
|
|||||||
size_t nc = 2*static_cast<size_t>(cap_ - beg_);
|
size_t nc = 2*static_cast<size_t>(cap_ - beg_);
|
||||||
if (nc == 0)
|
if (nc == 0)
|
||||||
nc = 1;
|
nc = 1;
|
||||||
__i_node** beg = (__i_node**)malloc(nc * sizeof(__i_node*));
|
__i_node** beg =
|
||||||
|
static_cast<__i_node**>(malloc(nc * sizeof(__i_node*)));
|
||||||
if (beg == nullptr)
|
if (beg == nullptr)
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
@@ -434,7 +435,7 @@ __libcpp_db::__insert_iterator(void* __i)
|
|||||||
if (__isz_ + 1 > static_cast<size_t>(__iend_ - __ibeg_))
|
if (__isz_ + 1 > static_cast<size_t>(__iend_ - __ibeg_))
|
||||||
{
|
{
|
||||||
size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
|
size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
|
||||||
__i_node** ibeg = (__i_node**)calloc(nc, sizeof(void*));
|
__i_node** ibeg = static_cast<__i_node**>(calloc(nc, sizeof(void*)));
|
||||||
if (ibeg == nullptr)
|
if (ibeg == nullptr)
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
@@ -459,7 +460,8 @@ __libcpp_db::__insert_iterator(void* __i)
|
|||||||
}
|
}
|
||||||
size_t hi = hash<void*>()(__i) % static_cast<size_t>(__iend_ - __ibeg_);
|
size_t hi = hash<void*>()(__i) % static_cast<size_t>(__iend_ - __ibeg_);
|
||||||
__i_node* p = __ibeg_[hi];
|
__i_node* p = __ibeg_[hi];
|
||||||
__i_node* r = __ibeg_[hi] = (__i_node*)malloc(sizeof(__i_node));
|
__i_node* r = __ibeg_[hi] =
|
||||||
|
static_cast<__i_node*>(malloc(sizeof(__i_node)));
|
||||||
if (r == nullptr)
|
if (r == nullptr)
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
#define __has_include(inc) 0
|
#define __has_include(inc) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
|
||||||
using namespace __cxxabiv1;
|
using namespace __cxxabiv1;
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION)
|
#if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION)
|
||||||
#define HAVE_DEPENDENT_EH_ABI 1
|
#define HAVE_DEPENDENT_EH_ABI 1
|
||||||
#endif
|
#endif
|
||||||
#else // __has_include(<cxxabi.h>)
|
#elif !defined(__GLIBCXX__) // __has_include(<cxxabi.h>)
|
||||||
static std::terminate_handler __terminate_handler;
|
static std::terminate_handler __terminate_handler;
|
||||||
static std::unexpected_handler __unexpected_handler;
|
static std::unexpected_handler __unexpected_handler;
|
||||||
#endif // __has_include(<cxxabi.h>)
|
#endif // __has_include(<cxxabi.h>)
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
|
|
||||||
#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
|
#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
|
||||||
|
|
||||||
// libcxxrt provides implementations of these functions itself.
|
// libcxxrt provides implementations of these functions itself.
|
||||||
unexpected_handler
|
unexpected_handler
|
||||||
@@ -77,6 +77,7 @@ get_terminate() _NOEXCEPT
|
|||||||
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef EMSCRIPTEN // We provide this in JS
|
||||||
_LIBCPP_NORETURN
|
_LIBCPP_NORETURN
|
||||||
void
|
void
|
||||||
terminate() _NOEXCEPT
|
terminate() _NOEXCEPT
|
||||||
@@ -97,12 +98,13 @@ terminate() _NOEXCEPT
|
|||||||
}
|
}
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
}
|
||||||
|
#endif // !EMSCRIPTEN
|
||||||
#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
|
#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
|
||||||
|
|
||||||
#ifndef LIBCXXRT
|
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(EMSCRIPTEN)
|
||||||
bool uncaught_exception() _NOEXCEPT
|
bool uncaught_exception() _NOEXCEPT
|
||||||
{
|
{
|
||||||
#if __APPLE__ || defined(_LIBCPPABI_VERSION)
|
#if defined(__APPLE__) || defined(_LIBCPPABI_VERSION)
|
||||||
// on Darwin, there is a helper function so __cxa_get_globals is private
|
// on Darwin, there is a helper function so __cxa_get_globals is private
|
||||||
return __cxa_uncaught_exception();
|
return __cxa_uncaught_exception();
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
@@ -124,7 +126,7 @@ const char* exception::what() const _NOEXCEPT
|
|||||||
|
|
||||||
#endif // _LIBCPPABI_VERSION
|
#endif // _LIBCPPABI_VERSION
|
||||||
#endif //LIBCXXRT
|
#endif //LIBCXXRT
|
||||||
#ifndef _LIBCPPABI_VERSION
|
#if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
|
||||||
|
|
||||||
bad_exception::~bad_exception() _NOEXCEPT
|
bad_exception::~bad_exception() _NOEXCEPT
|
||||||
{
|
{
|
||||||
|
@@ -78,8 +78,8 @@ __assoc_sub_state::set_value()
|
|||||||
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
throw future_error(make_error_code(future_errc::promise_already_satisfied));
|
||||||
#endif
|
#endif
|
||||||
__state_ |= __constructed | ready;
|
__state_ |= __constructed | ready;
|
||||||
__lk.unlock();
|
|
||||||
__cv_.notify_all();
|
__cv_.notify_all();
|
||||||
|
__lk.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
26
src/hash.cpp
26
src/hash.cpp
@@ -10,6 +10,11 @@
|
|||||||
#include "__hash_table"
|
#include "__hash_table"
|
||||||
#include "algorithm"
|
#include "algorithm"
|
||||||
#include "stdexcept"
|
#include "stdexcept"
|
||||||
|
#include "type_traits"
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
|
||||||
|
#endif
|
||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
@@ -144,23 +149,29 @@ const unsigned indices[] =
|
|||||||
// are fewer potential primes to search, and fewer potential primes to divide
|
// are fewer potential primes to search, and fewer potential primes to divide
|
||||||
// against.
|
// against.
|
||||||
|
|
||||||
|
template <size_t _Sz = sizeof(size_t)>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
typename enable_if<_Sz == 4, void>::type
|
||||||
__check_for_overflow(size_t N, integral_constant<size_t, 32>)
|
__check_for_overflow(size_t N)
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (N > 0xFFFFFFFB)
|
if (N > 0xFFFFFFFB)
|
||||||
throw overflow_error("__next_prime overflow");
|
throw overflow_error("__next_prime overflow");
|
||||||
|
#else
|
||||||
|
(void)N;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <size_t _Sz = sizeof(size_t)>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
typename enable_if<_Sz == 8, void>::type
|
||||||
__check_for_overflow(size_t N, integral_constant<size_t, 64>)
|
__check_for_overflow(size_t N)
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (N > 0xFFFFFFFFFFFFFFC5ull)
|
if (N > 0xFFFFFFFFFFFFFFC5ull)
|
||||||
throw overflow_error("__next_prime overflow");
|
throw overflow_error("__next_prime overflow");
|
||||||
|
#else
|
||||||
|
(void)N;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,8 +185,7 @@ __next_prime(size_t n)
|
|||||||
return *std::lower_bound(small_primes, small_primes + N, n);
|
return *std::lower_bound(small_primes, small_primes + N, n);
|
||||||
// Else n > largest small_primes
|
// Else n > largest small_primes
|
||||||
// Check for overflow
|
// Check for overflow
|
||||||
__check_for_overflow(n, integral_constant<size_t,
|
__check_for_overflow(n);
|
||||||
sizeof(n) * __CHAR_BIT__>());
|
|
||||||
// Start searching list of potential primes: L * k0 + indices[in]
|
// Start searching list of potential primes: L * k0 + indices[in]
|
||||||
const size_t M = sizeof(indices) / sizeof(indices[0]);
|
const size_t M = sizeof(indices) / sizeof(indices[0]);
|
||||||
// Select first potential prime >= n
|
// Select first potential prime >= n
|
||||||
|
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
|
static mbstate_t state_types[6] = {};
|
||||||
|
|
||||||
_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
|
_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
|
||||||
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
|
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
|
||||||
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
|
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
|
||||||
@@ -33,17 +35,17 @@ ios_base::Init __start_std_streams;
|
|||||||
|
|
||||||
ios_base::Init::Init()
|
ios_base::Init::Init()
|
||||||
{
|
{
|
||||||
istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin) );
|
istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin, state_types+0) );
|
||||||
ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout));
|
ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout, state_types+1));
|
||||||
ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr));
|
ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr, state_types+2));
|
||||||
::new(clog) ostream(cerr_ptr->rdbuf());
|
::new(clog) ostream(cerr_ptr->rdbuf());
|
||||||
cin_ptr->tie(cout_ptr);
|
cin_ptr->tie(cout_ptr);
|
||||||
_VSTD::unitbuf(*cerr_ptr);
|
_VSTD::unitbuf(*cerr_ptr);
|
||||||
cerr_ptr->tie(cout_ptr);
|
cerr_ptr->tie(cout_ptr);
|
||||||
|
|
||||||
wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin) );
|
wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin, state_types+3) );
|
||||||
wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout));
|
wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout, state_types+4));
|
||||||
wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr));
|
wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr, state_types+5));
|
||||||
::new(wclog) wostream(wcerr_ptr->rdbuf());
|
::new(wclog) wostream(wcerr_ptr->rdbuf());
|
||||||
wcin_ptr->tie(wcout_ptr);
|
wcin_ptr->tie(wcout_ptr);
|
||||||
_VSTD::unitbuf(*wcerr_ptr);
|
_VSTD::unitbuf(*wcerr_ptr);
|
||||||
@@ -52,13 +54,13 @@ ios_base::Init::Init()
|
|||||||
|
|
||||||
ios_base::Init::~Init()
|
ios_base::Init::~Init()
|
||||||
{
|
{
|
||||||
ostream* cout_ptr = (ostream*)cout;
|
ostream* cout_ptr = reinterpret_cast<ostream*>(cout);
|
||||||
ostream* clog_ptr = (ostream*)clog;
|
ostream* clog_ptr = reinterpret_cast<ostream*>(clog);
|
||||||
cout_ptr->flush();
|
cout_ptr->flush();
|
||||||
clog_ptr->flush();
|
clog_ptr->flush();
|
||||||
|
|
||||||
wostream* wcout_ptr = (wostream*)wcout;
|
wostream* wcout_ptr = reinterpret_cast<wostream*>(wcout);
|
||||||
wostream* wclog_ptr = (wostream*)wclog;
|
wostream* wclog_ptr = reinterpret_cast<wostream*>(wclog);
|
||||||
wcout_ptr->flush();
|
wcout_ptr->flush();
|
||||||
wclog_ptr->flush();
|
wclog_ptr->flush();
|
||||||
}
|
}
|
||||||
|
315
src/locale.cpp
315
src/locale.cpp
@@ -25,13 +25,17 @@
|
|||||||
#include "cstring"
|
#include "cstring"
|
||||||
#include "cwctype"
|
#include "cwctype"
|
||||||
#include "__sso_allocator"
|
#include "__sso_allocator"
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
#include <support/win32/locale_win32.h>
|
#include <support/win32/locale_win32.h>
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
#endif // _!WIN32
|
#endif // _!WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
|
||||||
|
// lots of noise in the build log, but no bugs that I know of.
|
||||||
|
#pragma clang diagnostic ignored "-Wsign-conversion"
|
||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
#ifdef __cloc_defined
|
#ifdef __cloc_defined
|
||||||
@@ -81,8 +85,35 @@ make(A0 a0, A1 a1, A2 a2)
|
|||||||
return *(T*)&buf;
|
return *(T*)&buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T, size_t N>
|
||||||
|
inline
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
|
size_t
|
||||||
|
countof(const T (&)[N])
|
||||||
|
{
|
||||||
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
|
size_t
|
||||||
|
countof(const T * const begin, const T * const end)
|
||||||
|
{
|
||||||
|
return static_cast<size_t>(end - begin);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const locale::category locale::none;
|
||||||
|
const locale::category locale::collate;
|
||||||
|
const locale::category locale::ctype;
|
||||||
|
const locale::category locale::monetary;
|
||||||
|
const locale::category locale::numeric;
|
||||||
|
const locale::category locale::time;
|
||||||
|
const locale::category locale::messages;
|
||||||
|
const locale::category locale::all;
|
||||||
|
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wpadded"
|
#pragma clang diagnostic ignored "-Wpadded"
|
||||||
|
|
||||||
@@ -197,6 +228,13 @@ locale::__imp::__imp(const string& name, size_t refs)
|
|||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE avoid the `base class should be explicitly initialized in the
|
||||||
|
// copy constructor` warning emitted by GCC
|
||||||
|
#if defined(__clang__) || _GNUC_VER >= 406
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wextra"
|
||||||
|
#endif
|
||||||
|
|
||||||
locale::__imp::__imp(const __imp& other)
|
locale::__imp::__imp(const __imp& other)
|
||||||
: facets_(max<size_t>(N, other.facets_.size())),
|
: facets_(max<size_t>(N, other.facets_.size())),
|
||||||
name_(other.name_)
|
name_(other.name_)
|
||||||
@@ -207,6 +245,10 @@ locale::__imp::__imp(const __imp& other)
|
|||||||
facets_[i]->__add_shared();
|
facets_[i]->__add_shared();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__clang__) || _GNUC_VER >= 406
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
|
locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
|
||||||
: facets_(N),
|
: facets_(N),
|
||||||
name_("*")
|
name_("*")
|
||||||
@@ -691,6 +733,19 @@ collate_byname<wchar_t>::do_transform(const char_type* lo, const char_type* hi)
|
|||||||
|
|
||||||
// template <> class ctype<wchar_t>;
|
// template <> class ctype<wchar_t>;
|
||||||
|
|
||||||
|
const ctype_base::mask ctype_base::space;
|
||||||
|
const ctype_base::mask ctype_base::print;
|
||||||
|
const ctype_base::mask ctype_base::cntrl;
|
||||||
|
const ctype_base::mask ctype_base::upper;
|
||||||
|
const ctype_base::mask ctype_base::lower;
|
||||||
|
const ctype_base::mask ctype_base::alpha;
|
||||||
|
const ctype_base::mask ctype_base::digit;
|
||||||
|
const ctype_base::mask ctype_base::punct;
|
||||||
|
const ctype_base::mask ctype_base::xdigit;
|
||||||
|
const ctype_base::mask ctype_base::blank;
|
||||||
|
const ctype_base::mask ctype_base::alnum;
|
||||||
|
const ctype_base::mask ctype_base::graph;
|
||||||
|
|
||||||
locale::id ctype<wchar_t>::id;
|
locale::id ctype<wchar_t>::id;
|
||||||
|
|
||||||
ctype<wchar_t>::~ctype()
|
ctype<wchar_t>::~ctype()
|
||||||
@@ -735,7 +790,7 @@ ctype<wchar_t>::do_toupper(char_type c) const
|
|||||||
{
|
{
|
||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
|
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
|
return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
|
||||||
#else
|
#else
|
||||||
return (isascii(c) && iswlower_l(c, __cloc())) ? c-L'a'+L'A' : c;
|
return (isascii(c) && iswlower_l(c, __cloc())) ? c-L'a'+L'A' : c;
|
||||||
@@ -748,7 +803,7 @@ ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
|||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low;
|
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
*low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
|
*low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
|
||||||
: *low;
|
: *low;
|
||||||
#else
|
#else
|
||||||
@@ -762,7 +817,7 @@ ctype<wchar_t>::do_tolower(char_type c) const
|
|||||||
{
|
{
|
||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
|
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
|
return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
|
||||||
#else
|
#else
|
||||||
return (isascii(c) && isupper_l(c, __cloc())) ? c-L'A'+'a' : c;
|
return (isascii(c) && isupper_l(c, __cloc())) ? c-L'A'+'a' : c;
|
||||||
@@ -775,7 +830,7 @@ ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const
|
|||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low;
|
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
*low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
|
*low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
|
||||||
: *low;
|
: *low;
|
||||||
#else
|
#else
|
||||||
@@ -842,8 +897,9 @@ ctype<char>::do_toupper(char_type c) const
|
|||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
return isascii(c) ?
|
return isascii(c) ?
|
||||||
static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(c)]) : c;
|
static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(c)]) : c;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
return isascii(c) ? __classic_upper_table()[c] : c;
|
return isascii(c) ?
|
||||||
|
static_cast<char>(__classic_upper_table()[static_cast<size_t>(c)]) : c;
|
||||||
#else
|
#else
|
||||||
return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c;
|
return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c;
|
||||||
#endif
|
#endif
|
||||||
@@ -856,8 +912,9 @@ ctype<char>::do_toupper(char_type* low, const char_type* high) const
|
|||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
*low = isascii(*low) ?
|
*low = isascii(*low) ?
|
||||||
static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(*low)]) : *low;
|
static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(*low)]) : *low;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
*low = isascii(*low) ? __classic_upper_table()[*low] : *low;
|
*low = isascii(*low) ?
|
||||||
|
static_cast<char>(__classic_upper_table()[static_cast<size_t>(*low)]) : *low;
|
||||||
#else
|
#else
|
||||||
*low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low;
|
*low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low;
|
||||||
#endif
|
#endif
|
||||||
@@ -870,8 +927,9 @@ ctype<char>::do_tolower(char_type c) const
|
|||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
return isascii(c) ?
|
return isascii(c) ?
|
||||||
static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c;
|
static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
return isascii(c) ? __classic_lower_table()[c] : c;
|
return isascii(c) ?
|
||||||
|
static_cast<char>(__classic_lower_table()[static_cast<size_t>(c)]) : c;
|
||||||
#else
|
#else
|
||||||
return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c;
|
return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c;
|
||||||
#endif
|
#endif
|
||||||
@@ -883,8 +941,8 @@ ctype<char>::do_tolower(char_type* low, const char_type* high) const
|
|||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
|
||||||
*low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low;
|
*low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low;
|
||||||
#elif defined(__GLIBC__)
|
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
|
||||||
*low = isascii(*low) ? __classic_lower_table()[*low] : *low;
|
*low = isascii(*low) ? static_cast<char>(__classic_lower_table()[static_cast<size_t>(*low)]) : *low;
|
||||||
#else
|
#else
|
||||||
*low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low;
|
*low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low;
|
||||||
#endif
|
#endif
|
||||||
@@ -924,6 +982,12 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
|
|||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EMSCRIPTEN
|
||||||
|
extern "C" const unsigned short ** __ctype_b_loc();
|
||||||
|
extern "C" const int ** __ctype_tolower_loc();
|
||||||
|
extern "C" const int ** __ctype_toupper_loc();
|
||||||
|
#endif
|
||||||
|
|
||||||
const ctype<char>::mask*
|
const ctype<char>::mask*
|
||||||
ctype<char>::classic_table() _NOEXCEPT
|
ctype<char>::classic_table() _NOEXCEPT
|
||||||
{
|
{
|
||||||
@@ -933,10 +997,12 @@ ctype<char>::classic_table() _NOEXCEPT
|
|||||||
return __cloc()->__ctype_b;
|
return __cloc()->__ctype_b;
|
||||||
#elif __sun__
|
#elif __sun__
|
||||||
return __ctype_mask;
|
return __ctype_mask;
|
||||||
#elif _WIN32
|
#elif defined(_WIN32)
|
||||||
return _ctype+1; // internal ctype mask table defined in msvcrt.dll
|
return _ctype+1; // internal ctype mask table defined in msvcrt.dll
|
||||||
// This is assumed to be safe, which is a nonsense assumption because we're
|
// This is assumed to be safe, which is a nonsense assumption because we're
|
||||||
// going to end up dereferencing it later...
|
// going to end up dereferencing it later...
|
||||||
|
#elif defined(EMSCRIPTEN)
|
||||||
|
return *__ctype_b_loc();
|
||||||
#else
|
#else
|
||||||
// Platform not supported: abort so the person doing the port knows what to
|
// Platform not supported: abort so the person doing the port knows what to
|
||||||
// fix
|
// fix
|
||||||
@@ -960,6 +1026,20 @@ ctype<char>::__classic_upper_table() _NOEXCEPT
|
|||||||
}
|
}
|
||||||
#endif // __GLIBC__
|
#endif // __GLIBC__
|
||||||
|
|
||||||
|
#if defined(EMSCRIPTEN)
|
||||||
|
const int*
|
||||||
|
ctype<char>::__classic_lower_table() _NOEXCEPT
|
||||||
|
{
|
||||||
|
return *__ctype_tolower_loc();
|
||||||
|
}
|
||||||
|
|
||||||
|
const int*
|
||||||
|
ctype<char>::__classic_upper_table() _NOEXCEPT
|
||||||
|
{
|
||||||
|
return *__ctype_toupper_loc();
|
||||||
|
}
|
||||||
|
#endif // EMSCRIPTEN
|
||||||
|
|
||||||
// template <> class ctype_byname<char>
|
// template <> class ctype_byname<char>
|
||||||
|
|
||||||
ctype_byname<char>::ctype_byname(const char* name, size_t refs)
|
ctype_byname<char>::ctype_byname(const char* name, size_t refs)
|
||||||
@@ -992,28 +1072,28 @@ ctype_byname<char>::~ctype_byname()
|
|||||||
char
|
char
|
||||||
ctype_byname<char>::do_toupper(char_type c) const
|
ctype_byname<char>::do_toupper(char_type c) const
|
||||||
{
|
{
|
||||||
return static_cast<char>(toupper_l(c, __l));
|
return static_cast<char>(toupper_l(static_cast<unsigned char>(c), __l));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
ctype_byname<char>::do_toupper(char_type* low, const char_type* high) const
|
ctype_byname<char>::do_toupper(char_type* low, const char_type* high) const
|
||||||
{
|
{
|
||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
*low = static_cast<char>(toupper_l(*low, __l));
|
*low = static_cast<char>(toupper_l(static_cast<unsigned char>(*low), __l));
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
char
|
char
|
||||||
ctype_byname<char>::do_tolower(char_type c) const
|
ctype_byname<char>::do_tolower(char_type c) const
|
||||||
{
|
{
|
||||||
return static_cast<char>(tolower_l(c, __l));
|
return static_cast<char>(tolower_l(static_cast<unsigned char>(c), __l));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
ctype_byname<char>::do_tolower(char_type* low, const char_type* high) const
|
ctype_byname<char>::do_tolower(char_type* low, const char_type* high) const
|
||||||
{
|
{
|
||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
*low = static_cast<char>(tolower_l(*low, __l));
|
*low = static_cast<char>(tolower_l(static_cast<unsigned char>(*low), __l));
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,16 +1133,17 @@ ctype_byname<wchar_t>::do_is(mask m, char_type c) const
|
|||||||
return static_cast<bool>(iswctype_l(c, m, __l));
|
return static_cast<bool>(iswctype_l(c, m, __l));
|
||||||
#else
|
#else
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (m & space) result |= (iswspace_l(c, __l) != 0);
|
wint_t ch = static_cast<wint_t>(c);
|
||||||
if (m & print) result |= (iswprint_l(c, __l) != 0);
|
if (m & space) result |= (iswspace_l(ch, __l) != 0);
|
||||||
if (m & cntrl) result |= (iswcntrl_l(c, __l) != 0);
|
if (m & print) result |= (iswprint_l(ch, __l) != 0);
|
||||||
if (m & upper) result |= (iswupper_l(c, __l) != 0);
|
if (m & cntrl) result |= (iswcntrl_l(ch, __l) != 0);
|
||||||
if (m & lower) result |= (iswlower_l(c, __l) != 0);
|
if (m & upper) result |= (iswupper_l(ch, __l) != 0);
|
||||||
if (m & alpha) result |= (iswalpha_l(c, __l) != 0);
|
if (m & lower) result |= (iswlower_l(ch, __l) != 0);
|
||||||
if (m & digit) result |= (iswdigit_l(c, __l) != 0);
|
if (m & alpha) result |= (iswalpha_l(ch, __l) != 0);
|
||||||
if (m & punct) result |= (iswpunct_l(c, __l) != 0);
|
if (m & digit) result |= (iswdigit_l(ch, __l) != 0);
|
||||||
if (m & xdigit) result |= (iswxdigit_l(c, __l) != 0);
|
if (m & punct) result |= (iswpunct_l(ch, __l) != 0);
|
||||||
if (m & blank) result |= (iswblank_l(c, __l) != 0);
|
if (m & xdigit) result |= (iswxdigit_l(ch, __l) != 0);
|
||||||
|
if (m & blank) result |= (iswblank_l(ch, __l) != 0);
|
||||||
return result;
|
return result;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1077,23 +1158,24 @@ ctype_byname<wchar_t>::do_is(const char_type* low, const char_type* high, mask*
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
*vec = 0;
|
*vec = 0;
|
||||||
if (iswspace_l(*low, __l))
|
wint_t ch = static_cast<wint_t>(*low);
|
||||||
|
if (iswspace_l(ch, __l))
|
||||||
*vec |= space;
|
*vec |= space;
|
||||||
if (iswprint_l(*low, __l))
|
if (iswprint_l(ch, __l))
|
||||||
*vec |= print;
|
*vec |= print;
|
||||||
if (iswcntrl_l(*low, __l))
|
if (iswcntrl_l(ch, __l))
|
||||||
*vec |= cntrl;
|
*vec |= cntrl;
|
||||||
if (iswupper_l(*low, __l))
|
if (iswupper_l(ch, __l))
|
||||||
*vec |= upper;
|
*vec |= upper;
|
||||||
if (iswlower_l(*low, __l))
|
if (iswlower_l(ch, __l))
|
||||||
*vec |= lower;
|
*vec |= lower;
|
||||||
if (iswalpha_l(*low, __l))
|
if (iswalpha_l(ch, __l))
|
||||||
*vec |= alpha;
|
*vec |= alpha;
|
||||||
if (iswdigit_l(*low, __l))
|
if (iswdigit_l(ch, __l))
|
||||||
*vec |= digit;
|
*vec |= digit;
|
||||||
if (iswpunct_l(*low, __l))
|
if (iswpunct_l(ch, __l))
|
||||||
*vec |= punct;
|
*vec |= punct;
|
||||||
if (iswxdigit_l(*low, __l))
|
if (iswxdigit_l(ch, __l))
|
||||||
*vec |= xdigit;
|
*vec |= xdigit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1109,16 +1191,17 @@ ctype_byname<wchar_t>::do_scan_is(mask m, const char_type* low, const char_type*
|
|||||||
if (iswctype_l(*low, m, __l))
|
if (iswctype_l(*low, m, __l))
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
if (m & space && iswspace_l(*low, __l)) break;
|
wint_t ch = static_cast<wint_t>(*low);
|
||||||
if (m & print && iswprint_l(*low, __l)) break;
|
if (m & space && iswspace_l(ch, __l)) break;
|
||||||
if (m & cntrl && iswcntrl_l(*low, __l)) break;
|
if (m & print && iswprint_l(ch, __l)) break;
|
||||||
if (m & upper && iswupper_l(*low, __l)) break;
|
if (m & cntrl && iswcntrl_l(ch, __l)) break;
|
||||||
if (m & lower && iswlower_l(*low, __l)) break;
|
if (m & upper && iswupper_l(ch, __l)) break;
|
||||||
if (m & alpha && iswalpha_l(*low, __l)) break;
|
if (m & lower && iswlower_l(ch, __l)) break;
|
||||||
if (m & digit && iswdigit_l(*low, __l)) break;
|
if (m & alpha && iswalpha_l(ch, __l)) break;
|
||||||
if (m & punct && iswpunct_l(*low, __l)) break;
|
if (m & digit && iswdigit_l(ch, __l)) break;
|
||||||
if (m & xdigit && iswxdigit_l(*low, __l)) break;
|
if (m & punct && iswpunct_l(ch, __l)) break;
|
||||||
if (m & blank && iswblank_l(*low, __l)) break;
|
if (m & xdigit && iswxdigit_l(ch, __l)) break;
|
||||||
|
if (m & blank && iswblank_l(ch, __l)) break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return low;
|
return low;
|
||||||
@@ -1133,16 +1216,17 @@ ctype_byname<wchar_t>::do_scan_not(mask m, const char_type* low, const char_type
|
|||||||
if (!iswctype_l(*low, m, __l))
|
if (!iswctype_l(*low, m, __l))
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
if (m & space && iswspace_l(*low, __l)) continue;
|
wint_t ch = static_cast<wint_t>(*low);
|
||||||
if (m & print && iswprint_l(*low, __l)) continue;
|
if (m & space && iswspace_l(ch, __l)) continue;
|
||||||
if (m & cntrl && iswcntrl_l(*low, __l)) continue;
|
if (m & print && iswprint_l(ch, __l)) continue;
|
||||||
if (m & upper && iswupper_l(*low, __l)) continue;
|
if (m & cntrl && iswcntrl_l(ch, __l)) continue;
|
||||||
if (m & lower && iswlower_l(*low, __l)) continue;
|
if (m & upper && iswupper_l(ch, __l)) continue;
|
||||||
if (m & alpha && iswalpha_l(*low, __l)) continue;
|
if (m & lower && iswlower_l(ch, __l)) continue;
|
||||||
if (m & digit && iswdigit_l(*low, __l)) continue;
|
if (m & alpha && iswalpha_l(ch, __l)) continue;
|
||||||
if (m & punct && iswpunct_l(*low, __l)) continue;
|
if (m & digit && iswdigit_l(ch, __l)) continue;
|
||||||
if (m & xdigit && iswxdigit_l(*low, __l)) continue;
|
if (m & punct && iswpunct_l(ch, __l)) continue;
|
||||||
if (m & blank && iswblank_l(*low, __l)) continue;
|
if (m & xdigit && iswxdigit_l(ch, __l)) continue;
|
||||||
|
if (m & blank && iswblank_l(ch, __l)) continue;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1207,7 +1291,7 @@ ctype_byname<wchar_t>::do_narrow(char_type c, char dfault) const
|
|||||||
#else
|
#else
|
||||||
int r = __wctob_l(c, __l);
|
int r = __wctob_l(c, __l);
|
||||||
#endif
|
#endif
|
||||||
return r != WEOF ? static_cast<char>(r) : dfault;
|
return r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wchar_t*
|
const wchar_t*
|
||||||
@@ -1220,7 +1304,7 @@ ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, ch
|
|||||||
#else
|
#else
|
||||||
int r = __wctob_l(*low, __l);
|
int r = __wctob_l(*low, __l);
|
||||||
#endif
|
#endif
|
||||||
*dest = r != WEOF ? static_cast<char>(r) : dfault;
|
*dest = r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
|
||||||
}
|
}
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
@@ -1327,7 +1411,7 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
|
|||||||
to_nxt = to;
|
to_nxt = to;
|
||||||
for (frm_nxt = frm; frm != frm_end && to != to_end; frm = frm_nxt, to = to_nxt)
|
for (frm_nxt = frm; frm != frm_end && to != to_end; frm = frm_nxt, to = to_nxt)
|
||||||
{
|
{
|
||||||
// save state in case needed to reover to_nxt on error
|
// save state in case it is needed to recover to_nxt on error
|
||||||
mbstate_t save_state = st;
|
mbstate_t save_state = st;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t n = wcsnrtombs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
|
size_t n = wcsnrtombs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
|
||||||
@@ -1396,7 +1480,7 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
|
|||||||
to_nxt = to;
|
to_nxt = to;
|
||||||
for (frm_nxt = frm; frm != frm_end && to != to_end; frm = frm_nxt, to = to_nxt)
|
for (frm_nxt = frm; frm != frm_end && to != to_end; frm = frm_nxt, to = to_nxt)
|
||||||
{
|
{
|
||||||
// save state in case needed to reover to_nxt on error
|
// save state in case it is needed to recover to_nxt on error
|
||||||
mbstate_t save_state = st;
|
mbstate_t save_state = st;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t n = mbsnrtowcs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
|
size_t n = mbsnrtowcs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
|
||||||
@@ -1542,9 +1626,9 @@ int
|
|||||||
codecvt<wchar_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
|
codecvt<wchar_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
|
||||||
{
|
{
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
return __l == 0 ? 1 : MB_CUR_MAX_L(__l);
|
return __l == 0 ? 1 : static_cast<int>( MB_CUR_MAX_L(__l));
|
||||||
#else
|
#else
|
||||||
return __l == 0 ? 1 : __mb_cur_max_l(__l);
|
return __l == 0 ? 1 : static_cast<int>(__mb_cur_max_l(__l));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2619,7 +2703,6 @@ utf16be_to_ucs4_length(const uint8_t* frm, const uint8_t* frm_end,
|
|||||||
codecvt_mode mode = codecvt_mode(0))
|
codecvt_mode mode = codecvt_mode(0))
|
||||||
{
|
{
|
||||||
const uint8_t* frm_nxt = frm;
|
const uint8_t* frm_nxt = frm;
|
||||||
frm_nxt = frm;
|
|
||||||
if (mode & consume_header)
|
if (mode & consume_header)
|
||||||
{
|
{
|
||||||
if (frm_end-frm_nxt >= 2 && frm_nxt[0] == 0xFE && frm_nxt[1] == 0xFF)
|
if (frm_end-frm_nxt >= 2 && frm_nxt[0] == 0xFE && frm_nxt[1] == 0xFF)
|
||||||
@@ -2752,7 +2835,6 @@ utf16le_to_ucs4_length(const uint8_t* frm, const uint8_t* frm_end,
|
|||||||
codecvt_mode mode = codecvt_mode(0))
|
codecvt_mode mode = codecvt_mode(0))
|
||||||
{
|
{
|
||||||
const uint8_t* frm_nxt = frm;
|
const uint8_t* frm_nxt = frm;
|
||||||
frm_nxt = frm;
|
|
||||||
if (mode & consume_header)
|
if (mode & consume_header)
|
||||||
{
|
{
|
||||||
if (frm_end-frm_nxt >= 2 && frm_nxt[0] == 0xFF && frm_nxt[1] == 0xFE)
|
if (frm_end-frm_nxt >= 2 && frm_nxt[0] == 0xFF && frm_nxt[1] == 0xFE)
|
||||||
@@ -2847,7 +2929,6 @@ utf16be_to_ucs2_length(const uint8_t* frm, const uint8_t* frm_end,
|
|||||||
codecvt_mode mode = codecvt_mode(0))
|
codecvt_mode mode = codecvt_mode(0))
|
||||||
{
|
{
|
||||||
const uint8_t* frm_nxt = frm;
|
const uint8_t* frm_nxt = frm;
|
||||||
frm_nxt = frm;
|
|
||||||
if (mode & consume_header)
|
if (mode & consume_header)
|
||||||
{
|
{
|
||||||
if (frm_end-frm_nxt >= 2 && frm_nxt[0] == 0xFE && frm_nxt[1] == 0xFF)
|
if (frm_end-frm_nxt >= 2 && frm_nxt[0] == 0xFE && frm_nxt[1] == 0xFF)
|
||||||
@@ -4559,6 +4640,7 @@ __time_get::~__time_get()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
||||||
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
string
|
string
|
||||||
@@ -4578,7 +4660,7 @@ __time_get_storage<char>::__analyze(char fmt, const ctype<char>& ct)
|
|||||||
char f[3] = {0};
|
char f[3] = {0};
|
||||||
f[0] = '%';
|
f[0] = '%';
|
||||||
f[1] = fmt;
|
f[1] = fmt;
|
||||||
size_t n = strftime_l(buf, 100, f, &t, __loc_);
|
size_t n = strftime_l(buf, countof(buf), f, &t, __loc_);
|
||||||
char* bb = buf;
|
char* bb = buf;
|
||||||
char* be = buf + n;
|
char* be = buf + n;
|
||||||
string result;
|
string result;
|
||||||
@@ -4724,15 +4806,15 @@ __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& ct)
|
|||||||
char f[3] = {0};
|
char f[3] = {0};
|
||||||
f[0] = '%';
|
f[0] = '%';
|
||||||
f[1] = fmt;
|
f[1] = fmt;
|
||||||
strftime_l(buf, 100, f, &t, __loc_);
|
strftime_l(buf, countof(buf), f, &t, __loc_);
|
||||||
wchar_t wbuf[100];
|
wchar_t wbuf[100];
|
||||||
wchar_t* wbb = wbuf;
|
wchar_t* wbb = wbuf;
|
||||||
mbstate_t mb = {0};
|
mbstate_t mb = {0};
|
||||||
const char* bb = buf;
|
const char* bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l( wbb, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = mbsrtowcs_l( wbb, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l( wbb, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = __mbsrtowcs_l( wbb, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -4870,26 +4952,26 @@ __time_get_storage<char>::init(const ctype<char>& ct)
|
|||||||
for (int i = 0; i < 7; ++i)
|
for (int i = 0; i < 7; ++i)
|
||||||
{
|
{
|
||||||
t.tm_wday = i;
|
t.tm_wday = i;
|
||||||
strftime_l(buf, 100, "%A", &t, __loc_);
|
strftime_l(buf, countof(buf), "%A", &t, __loc_);
|
||||||
__weeks_[i] = buf;
|
__weeks_[i] = buf;
|
||||||
strftime_l(buf, 100, "%a", &t, __loc_);
|
strftime_l(buf, countof(buf), "%a", &t, __loc_);
|
||||||
__weeks_[i+7] = buf;
|
__weeks_[i+7] = buf;
|
||||||
}
|
}
|
||||||
// __months_
|
// __months_
|
||||||
for (int i = 0; i < 12; ++i)
|
for (int i = 0; i < 12; ++i)
|
||||||
{
|
{
|
||||||
t.tm_mon = i;
|
t.tm_mon = i;
|
||||||
strftime_l(buf, 100, "%B", &t, __loc_);
|
strftime_l(buf, countof(buf), "%B", &t, __loc_);
|
||||||
__months_[i] = buf;
|
__months_[i] = buf;
|
||||||
strftime_l(buf, 100, "%b", &t, __loc_);
|
strftime_l(buf, countof(buf), "%b", &t, __loc_);
|
||||||
__months_[i+12] = buf;
|
__months_[i+12] = buf;
|
||||||
}
|
}
|
||||||
// __am_pm_
|
// __am_pm_
|
||||||
t.tm_hour = 1;
|
t.tm_hour = 1;
|
||||||
strftime_l(buf, 100, "%p", &t, __loc_);
|
strftime_l(buf, countof(buf), "%p", &t, __loc_);
|
||||||
__am_pm_[0] = buf;
|
__am_pm_[0] = buf;
|
||||||
t.tm_hour = 13;
|
t.tm_hour = 13;
|
||||||
strftime_l(buf, 100, "%p", &t, __loc_);
|
strftime_l(buf, countof(buf), "%p", &t, __loc_);
|
||||||
__am_pm_[1] = buf;
|
__am_pm_[1] = buf;
|
||||||
__c_ = __analyze('c', ct);
|
__c_ = __analyze('c', ct);
|
||||||
__r_ = __analyze('r', ct);
|
__r_ = __analyze('r', ct);
|
||||||
@@ -4903,7 +4985,6 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
|
|||||||
{
|
{
|
||||||
tm t = {0};
|
tm t = {0};
|
||||||
char buf[100];
|
char buf[100];
|
||||||
size_t be;
|
|
||||||
wchar_t wbuf[100];
|
wchar_t wbuf[100];
|
||||||
wchar_t* wbe;
|
wchar_t* wbe;
|
||||||
mbstate_t mb = {0};
|
mbstate_t mb = {0};
|
||||||
@@ -4911,25 +4992,25 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
|
|||||||
for (int i = 0; i < 7; ++i)
|
for (int i = 0; i < 7; ++i)
|
||||||
{
|
{
|
||||||
t.tm_wday = i;
|
t.tm_wday = i;
|
||||||
be = strftime_l(buf, 100, "%A", &t, __loc_);
|
strftime_l(buf, countof(buf), "%A", &t, __loc_);
|
||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
const char* bb = buf;
|
const char* bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
wbe = wbuf + j;
|
wbe = wbuf + j;
|
||||||
__weeks_[i].assign(wbuf, wbe);
|
__weeks_[i].assign(wbuf, wbe);
|
||||||
be = strftime_l(buf, 100, "%a", &t, __loc_);
|
strftime_l(buf, countof(buf), "%a", &t, __loc_);
|
||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = buf;
|
bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -4940,25 +5021,25 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
|
|||||||
for (int i = 0; i < 12; ++i)
|
for (int i = 0; i < 12; ++i)
|
||||||
{
|
{
|
||||||
t.tm_mon = i;
|
t.tm_mon = i;
|
||||||
be = strftime_l(buf, 100, "%B", &t, __loc_);
|
strftime_l(buf, countof(buf), "%B", &t, __loc_);
|
||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
const char* bb = buf;
|
const char* bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
wbe = wbuf + j;
|
wbe = wbuf + j;
|
||||||
__months_[i].assign(wbuf, wbe);
|
__months_[i].assign(wbuf, wbe);
|
||||||
be = strftime_l(buf, 100, "%b", &t, __loc_);
|
strftime_l(buf, countof(buf), "%b", &t, __loc_);
|
||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = buf;
|
bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -4967,26 +5048,26 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
|
|||||||
}
|
}
|
||||||
// __am_pm_
|
// __am_pm_
|
||||||
t.tm_hour = 1;
|
t.tm_hour = 1;
|
||||||
be = strftime_l(buf, 100, "%p", &t, __loc_);
|
strftime_l(buf, countof(buf), "%p", &t, __loc_);
|
||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
const char* bb = buf;
|
const char* bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
wbe = wbuf + j;
|
wbe = wbuf + j;
|
||||||
__am_pm_[0].assign(wbuf, wbe);
|
__am_pm_[0].assign(wbuf, wbe);
|
||||||
t.tm_hour = 13;
|
t.tm_hour = 13;
|
||||||
be = strftime_l(buf, 100, "%p", &t, __loc_);
|
strftime_l(buf, countof(buf), "%p", &t, __loc_);
|
||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = buf;
|
bb = buf;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, __loc_);
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5249,7 +5330,7 @@ __time_put::__do_put(char* __nb, char*& __ne, const tm* __tm,
|
|||||||
char fmt[] = {'%', __fmt, __mod, 0};
|
char fmt[] = {'%', __fmt, __mod, 0};
|
||||||
if (__mod != 0)
|
if (__mod != 0)
|
||||||
swap(fmt[1], fmt[2]);
|
swap(fmt[1], fmt[2]);
|
||||||
size_t n = strftime_l(__nb, static_cast<size_t>(__ne-__nb), fmt, __tm, __loc_);
|
size_t n = strftime_l(__nb, countof(__nb, __ne), fmt, __tm, __loc_);
|
||||||
__ne = __nb + n;
|
__ne = __nb + n;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5263,9 +5344,9 @@ __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm,
|
|||||||
mbstate_t mb = {0};
|
mbstate_t mb = {0};
|
||||||
const char* __nb = __nar;
|
const char* __nb = __nar;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l(__wb, &__nb, 100, &mb, __loc_);
|
size_t j = mbsrtowcs_l(__wb, &__nb, countof(__wb, __we), &mb, __loc_);
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l(__wb, &__nb, 100, &mb, __loc_);
|
size_t j = __mbsrtowcs_l(__wb, &__nb, countof(__wb, __we), &mb, __loc_);
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5724,7 +5805,7 @@ moneypunct_byname<char, true>::init(const char* nm)
|
|||||||
__frac_digits_ = lc->int_frac_digits;
|
__frac_digits_ = lc->int_frac_digits;
|
||||||
else
|
else
|
||||||
__frac_digits_ = base::do_frac_digits();
|
__frac_digits_ = base::do_frac_digits();
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
if (lc->p_sign_posn == 0)
|
if (lc->p_sign_posn == 0)
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
if (lc->int_p_sign_posn == 0)
|
if (lc->int_p_sign_posn == 0)
|
||||||
@@ -5732,7 +5813,7 @@ moneypunct_byname<char, true>::init(const char* nm)
|
|||||||
__positive_sign_ = "()";
|
__positive_sign_ = "()";
|
||||||
else
|
else
|
||||||
__positive_sign_ = lc->positive_sign;
|
__positive_sign_ = lc->positive_sign;
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
if(lc->n_sign_posn == 0)
|
if(lc->n_sign_posn == 0)
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
if (lc->int_n_sign_posn == 0)
|
if (lc->int_n_sign_posn == 0)
|
||||||
@@ -5744,7 +5825,7 @@ moneypunct_byname<char, true>::init(const char* nm)
|
|||||||
// the same places in curr_symbol since there's no way to
|
// the same places in curr_symbol since there's no way to
|
||||||
// represent anything else.
|
// represent anything else.
|
||||||
string_type __dummy_curr_symbol = __curr_symbol_;
|
string_type __dummy_curr_symbol = __curr_symbol_;
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
__init_pat(__pos_format_, __dummy_curr_symbol, true,
|
__init_pat(__pos_format_, __dummy_curr_symbol, true,
|
||||||
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, ' ');
|
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, ' ');
|
||||||
__init_pat(__neg_format_, __curr_symbol_, true,
|
__init_pat(__neg_format_, __curr_symbol_, true,
|
||||||
@@ -5788,9 +5869,9 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
|
|||||||
mbstate_t mb = {0};
|
mbstate_t mb = {0};
|
||||||
const char* bb = lc->currency_symbol;
|
const char* bb = lc->currency_symbol;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5807,9 +5888,9 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
|
|||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = lc->positive_sign;
|
bb = lc->positive_sign;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5823,9 +5904,9 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
|
|||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = lc->negative_sign;
|
bb = lc->negative_sign;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5871,9 +5952,9 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
|
|||||||
mbstate_t mb = {0};
|
mbstate_t mb = {0};
|
||||||
const char* bb = lc->int_curr_symbol;
|
const char* bb = lc->int_curr_symbol;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
size_t j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#else
|
#else
|
||||||
size_t j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5883,7 +5964,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
|
|||||||
__frac_digits_ = lc->int_frac_digits;
|
__frac_digits_ = lc->int_frac_digits;
|
||||||
else
|
else
|
||||||
__frac_digits_ = base::do_frac_digits();
|
__frac_digits_ = base::do_frac_digits();
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
if (lc->p_sign_posn == 0)
|
if (lc->p_sign_posn == 0)
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
if (lc->int_p_sign_posn == 0)
|
if (lc->int_p_sign_posn == 0)
|
||||||
@@ -5894,16 +5975,16 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
|
|||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = lc->positive_sign;
|
bb = lc->positive_sign;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
wbe = wbuf + j;
|
wbe = wbuf + j;
|
||||||
__positive_sign_.assign(wbuf, wbe);
|
__positive_sign_.assign(wbuf, wbe);
|
||||||
}
|
}
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
if (lc->n_sign_posn == 0)
|
if (lc->n_sign_posn == 0)
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
if (lc->int_n_sign_posn == 0)
|
if (lc->int_n_sign_posn == 0)
|
||||||
@@ -5914,9 +5995,9 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
|
|||||||
mb = mbstate_t();
|
mb = mbstate_t();
|
||||||
bb = lc->negative_sign;
|
bb = lc->negative_sign;
|
||||||
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
|
||||||
j = mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#else
|
#else
|
||||||
j = __mbsrtowcs_l(wbuf, &bb, sizeof(wbuf)/sizeof(wbuf[0]), &mb, loc.get());
|
j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
|
||||||
#endif
|
#endif
|
||||||
if (j == size_t(-1))
|
if (j == size_t(-1))
|
||||||
__throw_runtime_error("locale not supported");
|
__throw_runtime_error("locale not supported");
|
||||||
@@ -5927,7 +6008,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
|
|||||||
// the same places in curr_symbol since there's no way to
|
// the same places in curr_symbol since there's no way to
|
||||||
// represent anything else.
|
// represent anything else.
|
||||||
string_type __dummy_curr_symbol = __curr_symbol_;
|
string_type __dummy_curr_symbol = __curr_symbol_;
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
__init_pat(__pos_format_, __dummy_curr_symbol, true,
|
__init_pat(__pos_format_, __dummy_curr_symbol, true,
|
||||||
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, L' ');
|
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, L' ');
|
||||||
__init_pat(__neg_format_, __curr_symbol_, true,
|
__init_pat(__neg_format_, __curr_symbol_, true,
|
||||||
@@ -5948,6 +6029,8 @@ void __throw_runtime_error(const char* msg)
|
|||||||
{
|
{
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw runtime_error(msg);
|
throw runtime_error(msg);
|
||||||
|
#else
|
||||||
|
(void)msg;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,7 +122,15 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
|
|||||||
#if __has_feature(cxx_atomic)
|
#if __has_feature(cxx_atomic)
|
||||||
|
|
||||||
static const std::size_t __sp_mut_count = 16;
|
static const std::size_t __sp_mut_count = 16;
|
||||||
static mutex mut_back[__sp_mut_count];
|
static pthread_mutex_t mut_back_imp[__sp_mut_count] =
|
||||||
|
{
|
||||||
|
PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
|
||||||
|
PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
|
||||||
|
PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
|
||||||
|
PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER
|
||||||
|
};
|
||||||
|
|
||||||
|
static mutex* mut_back = reinterpret_cast<std::mutex*>(mut_back_imp);
|
||||||
|
|
||||||
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
|
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
|
||||||
: __lx(p)
|
: __lx(p)
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#define __has_include(inc) 0
|
#define __has_include(inc) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
|
||||||
#ifndef _LIBCPPABI_VERSION
|
#ifndef _LIBCPPABI_VERSION
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#define __has_include(inc) 0
|
#define __has_include(inc) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
138
src/string.cpp
138
src/string.cpp
@@ -11,7 +11,7 @@
|
|||||||
#include "cstdlib"
|
#include "cstdlib"
|
||||||
#include "cwchar"
|
#include "cwchar"
|
||||||
#include "cerrno"
|
#include "cerrno"
|
||||||
#if _WIN32
|
#ifdef _WIN32
|
||||||
#include "support/win32/support.h"
|
#include "support/win32/support.h"
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
@@ -31,17 +31,17 @@ stoi(const string& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
long r = strtol(p, &ptr, base);
|
long r = strtol(p, &ptr, base);
|
||||||
if (r < numeric_limits<int>::min() || numeric_limits<int>::max() < r)
|
swap(errno, errno_save);
|
||||||
ptr = const_cast<char*>(p);
|
|
||||||
if (ptr == p)
|
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE || r < numeric_limits<int>::min() ||
|
||||||
throw invalid_argument("stoi: no conversion");
|
numeric_limits<int>::max() < r)
|
||||||
throw out_of_range("stoi: out of range");
|
throw out_of_range("stoi: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoi: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return static_cast<int>(r);
|
return static_cast<int>(r);
|
||||||
@@ -52,17 +52,17 @@ stoi(const wstring& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
long r = wcstol(p, &ptr, base);
|
long r = wcstol(p, &ptr, base);
|
||||||
if (r < numeric_limits<int>::min() || numeric_limits<int>::max() < r)
|
swap(errno, errno_save);
|
||||||
ptr = const_cast<wchar_t*>(p);
|
|
||||||
if (ptr == p)
|
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE || r < numeric_limits<int>::min() ||
|
||||||
throw invalid_argument("stoi: no conversion");
|
numeric_limits<int>::max() < r)
|
||||||
throw out_of_range("stoi: out of range");
|
throw out_of_range("stoi: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoi: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return static_cast<int>(r);
|
return static_cast<int>(r);
|
||||||
@@ -73,15 +73,16 @@ stol(const string& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
long r = strtol(p, &ptr, base);
|
long r = strtol(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stol: no conversion");
|
|
||||||
throw out_of_range("stol: out of range");
|
throw out_of_range("stol: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stol: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -92,15 +93,16 @@ stol(const wstring& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
long r = wcstol(p, &ptr, base);
|
long r = wcstol(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stol: no conversion");
|
|
||||||
throw out_of_range("stol: out of range");
|
throw out_of_range("stol: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stol: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -111,15 +113,16 @@ stoul(const string& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
unsigned long r = strtoul(p, &ptr, base);
|
unsigned long r = strtoul(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stoul: no conversion");
|
|
||||||
throw out_of_range("stoul: out of range");
|
throw out_of_range("stoul: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoul: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -130,15 +133,16 @@ stoul(const wstring& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
unsigned long r = wcstoul(p, &ptr, base);
|
unsigned long r = wcstoul(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stoul: no conversion");
|
|
||||||
throw out_of_range("stoul: out of range");
|
throw out_of_range("stoul: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoul: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -149,15 +153,16 @@ stoll(const string& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
long long r = strtoll(p, &ptr, base);
|
long long r = strtoll(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stoll: no conversion");
|
|
||||||
throw out_of_range("stoll: out of range");
|
throw out_of_range("stoll: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoll: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -168,15 +173,16 @@ stoll(const wstring& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
long long r = wcstoll(p, &ptr, base);
|
long long r = wcstoll(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stoll: no conversion");
|
|
||||||
throw out_of_range("stoll: out of range");
|
throw out_of_range("stoll: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoll: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -187,15 +193,16 @@ stoull(const string& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
unsigned long long r = strtoull(p, &ptr, base);
|
unsigned long long r = strtoull(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stoull: no conversion");
|
|
||||||
throw out_of_range("stoull: out of range");
|
throw out_of_range("stoull: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoull: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -206,15 +213,16 @@ stoull(const wstring& str, size_t* idx, int base)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
|
errno = 0;
|
||||||
unsigned long long r = wcstoull(p, &ptr, base);
|
unsigned long long r = wcstoull(p, &ptr, base);
|
||||||
if (ptr == p)
|
swap(errno, errno_save);
|
||||||
{
|
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (r == 0)
|
if (errno_save == ERANGE)
|
||||||
throw invalid_argument("stoull: no conversion");
|
|
||||||
throw out_of_range("stoull: out of range");
|
throw out_of_range("stoull: out of range");
|
||||||
|
if (ptr == p)
|
||||||
|
throw invalid_argument("stoull: no conversion");
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return r;
|
return r;
|
||||||
@@ -225,9 +233,9 @@ stof(const string& str, size_t* idx)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
int errno_save = errno;
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
double r = strtod(p, &ptr);
|
float r = strtof(p, &ptr);
|
||||||
swap(errno, errno_save);
|
swap(errno, errno_save);
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (errno_save == ERANGE)
|
if (errno_save == ERANGE)
|
||||||
@@ -237,7 +245,7 @@ stof(const string& str, size_t* idx)
|
|||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return static_cast<float>(r);
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
@@ -245,9 +253,9 @@ stof(const wstring& str, size_t* idx)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
int errno_save = errno;
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
double r = wcstod(p, &ptr);
|
float r = wcstof(p, &ptr);
|
||||||
swap(errno, errno_save);
|
swap(errno, errno_save);
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (errno_save == ERANGE)
|
if (errno_save == ERANGE)
|
||||||
@@ -257,7 +265,7 @@ stof(const wstring& str, size_t* idx)
|
|||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
if (idx)
|
if (idx)
|
||||||
*idx = static_cast<size_t>(ptr - p);
|
*idx = static_cast<size_t>(ptr - p);
|
||||||
return static_cast<float>(r);
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
@@ -265,7 +273,7 @@ stod(const string& str, size_t* idx)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
int errno_save = errno;
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
double r = strtod(p, &ptr);
|
double r = strtod(p, &ptr);
|
||||||
swap(errno, errno_save);
|
swap(errno, errno_save);
|
||||||
@@ -285,7 +293,7 @@ stod(const wstring& str, size_t* idx)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
int errno_save = errno;
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
double r = wcstod(p, &ptr);
|
double r = wcstod(p, &ptr);
|
||||||
swap(errno, errno_save);
|
swap(errno, errno_save);
|
||||||
@@ -305,7 +313,7 @@ stold(const string& str, size_t* idx)
|
|||||||
{
|
{
|
||||||
char* ptr;
|
char* ptr;
|
||||||
const char* const p = str.c_str();
|
const char* const p = str.c_str();
|
||||||
int errno_save = errno;
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
long double r = strtold(p, &ptr);
|
long double r = strtold(p, &ptr);
|
||||||
swap(errno, errno_save);
|
swap(errno, errno_save);
|
||||||
@@ -325,7 +333,7 @@ stold(const wstring& str, size_t* idx)
|
|||||||
{
|
{
|
||||||
wchar_t* ptr;
|
wchar_t* ptr;
|
||||||
const wchar_t* const p = str.c_str();
|
const wchar_t* const p = str.c_str();
|
||||||
int errno_save = errno;
|
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
long double r = wcstold(p, &ptr);
|
long double r = wcstold(p, &ptr);
|
||||||
swap(errno, errno_save);
|
swap(errno, errno_save);
|
||||||
|
@@ -158,6 +158,8 @@ strstreambuf::overflow(int_type __c)
|
|||||||
return int_type(EOF);
|
return int_type(EOF);
|
||||||
streamsize old_size = (epptr() ? epptr() : egptr()) - eback();
|
streamsize old_size = (epptr() ? epptr() : egptr()) - eback();
|
||||||
streamsize new_size = max<streamsize>(__alsize_, 2*old_size);
|
streamsize new_size = max<streamsize>(__alsize_, 2*old_size);
|
||||||
|
if (new_size == 0)
|
||||||
|
new_size = __default_alsize;
|
||||||
char* buf = nullptr;
|
char* buf = nullptr;
|
||||||
if (__palloc_)
|
if (__palloc_)
|
||||||
buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size)));
|
buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size)));
|
||||||
|
@@ -20,6 +20,8 @@ locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
|
|||||||
locale_t uselocale( locale_t newloc )
|
locale_t uselocale( locale_t newloc )
|
||||||
{
|
{
|
||||||
locale_t old_locale = _get_current_locale();
|
locale_t old_locale = _get_current_locale();
|
||||||
|
if ( newloc == NULL )
|
||||||
|
return old_locale;
|
||||||
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
|
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
|
||||||
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
|
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
|
||||||
// uselocale sets all categories
|
// uselocale sets all categories
|
||||||
|
@@ -23,48 +23,130 @@ int asprintf(char **sptr, const char *__restrict fmt, ...)
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Like sprintf, but when return value >= 0 it returns a pointer to a malloc'd string in *sptr.
|
||||||
|
// If return >= 0, use free to delete *sptr.
|
||||||
int vasprintf( char **sptr, const char *__restrict fmt, va_list ap )
|
int vasprintf( char **sptr, const char *__restrict fmt, va_list ap )
|
||||||
{
|
{
|
||||||
*sptr = NULL;
|
*sptr = NULL;
|
||||||
int count = vsnprintf( *sptr, 0, fmt, ap );
|
int count = vsnprintf( NULL, 0, fmt, ap ); // Query the buffer size required.
|
||||||
if( (count >= 0) && ((*sptr = (char*)malloc(count+1)) != NULL) )
|
if( count >= 0 ) {
|
||||||
{
|
char* p = static_cast<char*>(malloc(count+1)); // Allocate memory for it and the terminator.
|
||||||
vsprintf( *sptr, fmt, ap );
|
if ( p == NULL )
|
||||||
sptr[count] = '\0';
|
return -1;
|
||||||
|
if ( vsnprintf( p, count+1, fmt, ap ) == count ) // We should have used exactly what was required.
|
||||||
|
*sptr = p;
|
||||||
|
else { // Otherwise something is wrong, likely a bug in vsnprintf. If so free the memory and report the error.
|
||||||
|
free(p);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: use wcrtomb and avoid copy
|
// Returns >= 0: the number of wide characters found in the multi byte sequence src (of src_size_bytes),
|
||||||
// use mbsrtowcs which is available, first copy first nwc elements of src
|
// that fit in the buffer dst (of max_dest_chars elements size). The count returned excludes the null terminator.
|
||||||
|
// When dst is NULL, no characters are copied and no "out" parameters are updated.
|
||||||
|
// Returns (size_t) -1: an incomplete sequence encountered.
|
||||||
|
// Leaves *src pointing the next character to convert or NULL if a null character was converted from *src.
|
||||||
size_t mbsnrtowcs( wchar_t *__restrict dst, const char **__restrict src,
|
size_t mbsnrtowcs( wchar_t *__restrict dst, const char **__restrict src,
|
||||||
size_t nmc, size_t len, mbstate_t *__restrict ps )
|
size_t src_size_bytes, size_t max_dest_chars, mbstate_t *__restrict ps )
|
||||||
{
|
{
|
||||||
char* local_src = new char[nmc+1];
|
const size_t terminated_sequence = static_cast<size_t>(0);
|
||||||
char* nmcsrc = local_src;
|
//const size_t invalid_sequence = static_cast<size_t>(-1);
|
||||||
strncpy( nmcsrc, *src, nmc );
|
const size_t incomplete_sequence = static_cast< size_t>(-2);
|
||||||
nmcsrc[nmc] = '\0';
|
|
||||||
const size_t result = mbsrtowcs( dst, const_cast<const char **>(&nmcsrc), len, ps );
|
size_t dest_converted = 0;
|
||||||
// propagate error
|
size_t source_converted = 0;
|
||||||
if( nmcsrc == NULL )
|
size_t source_remaining = src_size_bytes;
|
||||||
*src = NULL;
|
size_t result = 0;
|
||||||
delete[] local_src;
|
bool have_result = false;
|
||||||
return result;
|
|
||||||
|
while ( source_remaining ) {
|
||||||
|
if ( dst && dest_converted >= max_dest_chars )
|
||||||
|
break;
|
||||||
|
// Converts one multi byte character.
|
||||||
|
// if result > 0, it's the size in bytes of that character.
|
||||||
|
// othewise if result is zero it indicates the null character has been found.
|
||||||
|
// otherwise it's an error and errno may be set.
|
||||||
|
size_t char_size = mbrtowc( dst ? dst + dest_converted : NULL, *src + source_converted, source_remaining, ps );
|
||||||
|
// Don't do anything to change errno from here on.
|
||||||
|
if ( char_size > 0 ) {
|
||||||
|
source_remaining -= char_size;
|
||||||
|
source_converted += char_size;
|
||||||
|
++dest_converted;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
result = char_size;
|
||||||
|
have_result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ( dst ) {
|
||||||
|
if ( have_result && result == terminated_sequence )
|
||||||
|
*src = NULL;
|
||||||
|
else
|
||||||
|
*src += source_converted;
|
||||||
|
}
|
||||||
|
if ( have_result && result != terminated_sequence && result != incomplete_sequence )
|
||||||
|
return static_cast<size_t>(-1);
|
||||||
|
|
||||||
|
return dest_converted;
|
||||||
}
|
}
|
||||||
// FIXME: use wcrtomb and avoid copy
|
|
||||||
// use wcsrtombs which is available, first copy first nwc elements of src
|
// Converts max_source_chars from the wide character buffer pointer to by *src,
|
||||||
|
// into the multi byte character sequence buffer stored at dst which must be dst_size_bytes bytes in size.
|
||||||
|
// Returns >= 0: the number of bytes in the sequence sequence converted frome *src, excluding the null terminator.
|
||||||
|
// Returns size_t(-1) if an error occurs, also sets errno.
|
||||||
|
// If dst is NULL dst_size_bytes is ignored and no bytes are copied to dst and no "out" parameters are updated.
|
||||||
size_t wcsnrtombs( char *__restrict dst, const wchar_t **__restrict src,
|
size_t wcsnrtombs( char *__restrict dst, const wchar_t **__restrict src,
|
||||||
size_t nwc, size_t len, mbstate_t *__restrict ps )
|
size_t max_source_chars, size_t dst_size_bytes, mbstate_t *__restrict ps )
|
||||||
{
|
{
|
||||||
wchar_t* local_src = new wchar_t[nwc];
|
//const size_t invalid_sequence = static_cast<size_t>(-1);
|
||||||
wchar_t* nwcsrc = local_src;
|
|
||||||
wcsncpy(nwcsrc, *src, nwc);
|
size_t source_converted = 0;
|
||||||
nwcsrc[nwc] = '\0';
|
size_t dest_converted = 0;
|
||||||
const size_t result = wcsrtombs( dst, const_cast<const wchar_t **>(&nwcsrc), len, ps );
|
size_t dest_remaining = dst_size_bytes;
|
||||||
// propogate error
|
size_t char_size = 0;
|
||||||
if( nwcsrc == NULL )
|
const errno_t no_error = ( errno_t) 0;
|
||||||
*src = NULL;
|
errno_t result = ( errno_t ) 0;
|
||||||
delete[] nwcsrc;
|
bool have_result = false;
|
||||||
return result;
|
bool terminator_found = false;
|
||||||
|
|
||||||
|
while ( source_converted != max_source_chars ) {
|
||||||
|
if ( ! dest_remaining )
|
||||||
|
break;
|
||||||
|
wchar_t c = (*src)[source_converted];
|
||||||
|
if ( dst )
|
||||||
|
result = wcrtomb_s( &char_size, dst + dest_converted, dest_remaining, c, ps);
|
||||||
|
else
|
||||||
|
result = wcrtomb_s( &char_size, NULL, 0, c, ps);
|
||||||
|
// If result is zero there is no error and char_size contains the size of the multi-byte-sequence converted.
|
||||||
|
// Otherwise result indicates an errno type error.
|
||||||
|
if ( result == no_error ) {
|
||||||
|
if ( c == L'\0' ) {
|
||||||
|
terminator_found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++source_converted;
|
||||||
|
if ( dst )
|
||||||
|
dest_remaining -= char_size;
|
||||||
|
dest_converted += char_size;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
have_result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ( dst ) {
|
||||||
|
if ( terminator_found )
|
||||||
|
*src = NULL;
|
||||||
|
else
|
||||||
|
*src = *src + source_converted;
|
||||||
|
}
|
||||||
|
if ( have_result && result != no_error ) {
|
||||||
|
errno = result;
|
||||||
|
return static_cast<size_t>(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dest_converted;
|
||||||
}
|
}
|
||||||
|
@@ -195,6 +195,9 @@ __throw_system_error(int ev, const char* what_arg)
|
|||||||
{
|
{
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw system_error(error_code(ev, system_category()), what_arg);
|
throw system_error(error_code(ev, system_category()), what_arg);
|
||||||
|
#else
|
||||||
|
(void)ev;
|
||||||
|
(void)what_arg;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
#include "future"
|
#include "future"
|
||||||
#include "limits"
|
#include "limits"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if !_WIN32
|
#if !defined(_WIN32)
|
||||||
#if !__sun__ && !__linux__
|
#if !defined(__sun__) && !defined(__linux__)
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -36,6 +36,8 @@ thread::join()
|
|||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
if (ec)
|
if (ec)
|
||||||
throw system_error(error_code(ec, system_category()), "thread::join failed");
|
throw system_error(error_code(ec, system_category()), "thread::join failed");
|
||||||
|
#else
|
||||||
|
(void)ec;
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
__t_ = 0;
|
__t_ = 0;
|
||||||
}
|
}
|
||||||
@@ -65,11 +67,15 @@ thread::hardware_concurrency() _NOEXCEPT
|
|||||||
std::size_t s = sizeof(n);
|
std::size_t s = sizeof(n);
|
||||||
sysctl(mib, 2, &n, &s, 0, 0);
|
sysctl(mib, 2, &n, &s, 0, 0);
|
||||||
return n;
|
return n;
|
||||||
#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && defined(_SC_NPROCESSORS_ONLN)
|
#elif (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && defined(_SC_NPROCESSORS_ONLN)) || defined(EMSCRIPTEN)
|
||||||
long result = sysconf(_SC_NPROCESSORS_ONLN);
|
long result = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
if (result < 0 || result > UINT_MAX)
|
// sysconf returns -1 if the name is invalid, the option does not exist or
|
||||||
result = 0;
|
// does not have a definite limit.
|
||||||
return result;
|
// if sysconf returns some other negative number, we have no idea
|
||||||
|
// what is going on. Default to something safe.
|
||||||
|
if (result < 0)
|
||||||
|
return 0;
|
||||||
|
return static_cast<unsigned>(result);
|
||||||
#else // defined(CTL_HW) && defined(HW_NCPU)
|
#else // defined(CTL_HW) && defined(HW_NCPU)
|
||||||
// TODO: grovel through /proc or check cpuid on x86 and similar
|
// TODO: grovel through /proc or check cpuid on x86 and similar
|
||||||
// instructions on other architectures.
|
// instructions on other architectures.
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#define __has_include(inc) 0
|
#define __has_include(inc) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
@@ -50,11 +50,21 @@ std::bad_typeid::what() const _NOEXCEPT
|
|||||||
return "std::bad_typeid";
|
return "std::bad_typeid";
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __APPLE__
|
#ifdef __APPLE__
|
||||||
// On Darwin, the cxa_bad_* functions cannot be in the lower level library
|
// On Darwin, the cxa_bad_* functions cannot be in the lower level library
|
||||||
// because bad_cast and bad_typeid are defined in his higher level library
|
// because bad_cast and bad_typeid are defined in his higher level library
|
||||||
void __cxxabiv1::__cxa_bad_typeid() { throw std::bad_typeid(); }
|
void __cxxabiv1::__cxa_bad_typeid()
|
||||||
void __cxxabiv1::__cxa_bad_cast() { throw std::bad_cast(); }
|
{
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
|
throw std::bad_typeid();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
void __cxxabiv1::__cxa_bad_cast()
|
||||||
|
{
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
|
throw std::bad_cast();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // _LIBCPPABI_VERSION
|
#endif // _LIBCPPABI_VERSION
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class InIter, class OutIter>
|
template <class InIter, class OutIter>
|
||||||
void
|
void
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class InIter, class OutIter>
|
template <class InIter, class OutIter>
|
||||||
void
|
void
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
struct Pred
|
struct Pred
|
||||||
{
|
{
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class InIter, class OutIter>
|
template <class InIter, class OutIter>
|
||||||
void
|
void
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class Iter>
|
template <class Iter>
|
||||||
void
|
void
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user