Compare commits
1 Commits
svn-tags/l
...
svn-tags/l
Author | SHA1 | Date | |
---|---|---|---|
![]() |
613ebe935d |
159
CMakeLists.txt
159
CMakeLists.txt
@@ -1,159 +0,0 @@
|
||||
# See www/CMake.html for instructions on how to build libcxx with CMake.
|
||||
|
||||
#===============================================================================
|
||||
# Setup Project
|
||||
#===============================================================================
|
||||
|
||||
project(libcxx CXX C)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(PACKAGE_NAME libcxx)
|
||||
set(PACKAGE_VERSION trunk-svn)
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
|
||||
|
||||
# Add path for custom modules
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
|
||||
)
|
||||
|
||||
# Require out of source build.
|
||||
include(MacroEnsureOutOfSourceBuild)
|
||||
MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
|
||||
"${PROJECT_NAME} requires an out of source build. Please create a separate
|
||||
build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# Setup CMake Options
|
||||
#===============================================================================
|
||||
|
||||
# Define options.
|
||||
option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)
|
||||
option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)
|
||||
option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
|
||||
option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
|
||||
option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
|
||||
option(LIBCXX_ENABLE_CXX0X "Enable -std=c++0x and use of c++0x language features if the compiler supports it." ON)
|
||||
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
|
||||
|
||||
#===============================================================================
|
||||
# Configure System
|
||||
#===============================================================================
|
||||
|
||||
# Get triples.
|
||||
include(GetTriple)
|
||||
get_host_triple(LIBCXX_HOST_TRIPLE
|
||||
LIBCXX_HOST_ARCH
|
||||
LIBCXX_HOST_VENDOR
|
||||
LIBCXX_HOST_OS
|
||||
)
|
||||
set(LIBCXX_HOST_TRIPLE ${LIBCXX_HOST_TRIPLE} CACHE STRING "Host triple.")
|
||||
get_target_triple(LIBCXX_TARGET_TRIPLE
|
||||
LIBCXX_TARGET_ARCH
|
||||
LIBCXX_TARGET_VENDOR
|
||||
LIBCXX_TARGET_OS
|
||||
)
|
||||
set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.")
|
||||
|
||||
# Configure compiler.
|
||||
include(config-ix)
|
||||
|
||||
#===============================================================================
|
||||
# Setup Compiler Flags
|
||||
#===============================================================================
|
||||
|
||||
# Get required flags.
|
||||
# On all systems the system c++ standard library headers need to be excluded.
|
||||
if (MSVC)
|
||||
# MSVC only has -X, which disables all default includes; including the crt.
|
||||
# Thus, we do nothing and hope we don't accidentally include any of the C++
|
||||
# headers.
|
||||
else()
|
||||
if (LIBCXX_HAS_NOSTDINCXX_FLAG)
|
||||
set(LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++)
|
||||
endif()
|
||||
if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(append_if list condition var)
|
||||
if (${condition})
|
||||
list(APPEND ${list} ${var})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Get warning flags
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WALL_FLAG -Wall)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_W_FLAG -W)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WWRITE_STRINGS_FLAG -Wwrite-strings)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WNO_LONG_LONG_FLAG -Wno-long-long)
|
||||
if (LIBCXX_ENABLE_WERROR)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WERROR_FLAG -Werror)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_WX_FLAG -WX)
|
||||
endif()
|
||||
if (LIBCXX_ENABLE_PEDANTIC)
|
||||
append_if(LIBCXX_WARNING_FLAGS LIBCXX_HAS_PEDANTIC_FLAG -pedantic)
|
||||
endif()
|
||||
|
||||
# Get feature flags.
|
||||
# Exceptions
|
||||
if (LIBCXX_ENABLE_EXCEPTIONS)
|
||||
# Catches C++ exceptions only and tells the compiler to assume that extern C
|
||||
# functions never throw a C++ exception.
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_EHSC_FLAG -EHsc)
|
||||
else()
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_LIBCPP_NO_EXCEPTIONS)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_NO_EHS_FLAG -EHs-)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_NO_EHA_FLAG -EHa-)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions)
|
||||
endif()
|
||||
# RTTI
|
||||
if (NOT LIBCXX_ENABLE_RTTI)
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_LIBCPP_NO_RTTI)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_NO_GR_FLAG -GR-)
|
||||
append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_FNO_RTTI_FLAG -fno-rtti)
|
||||
endif()
|
||||
# Assert
|
||||
if (LLVM_ENABLE_ASSERTIONS)
|
||||
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
|
||||
if (NOT MSVC)
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_DEBUG)
|
||||
endif()
|
||||
# On Release builds cmake automatically defines NDEBUG, so we
|
||||
# explicitly undefine it:
|
||||
if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -UNDEBUG)
|
||||
endif()
|
||||
else()
|
||||
if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
|
||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS -DNDEBUG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This is the _ONLY_ place where add_definitions is called.
|
||||
add_definitions(
|
||||
${LIBCXX_CXX_REQUIRED_FLAGS}
|
||||
${LIBCXX_CXX_WARNING_FLAGS}
|
||||
${LIBCXX_CXX_FEATURE_FLAGS}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# Setup Source Code
|
||||
#===============================================================================
|
||||
|
||||
include_directories(include)
|
||||
|
||||
# Add source code. This also contains all of the logic for deciding linker flags
|
||||
# soname, etc...
|
||||
add_subdirectory(lib)
|
||||
|
||||
#===============================================================================
|
||||
# Setup Tests
|
||||
#===============================================================================
|
||||
|
||||
add_subdirectory(test)
|
@@ -1,53 +0,0 @@
|
||||
# Define functions to get the host and target triple.
|
||||
|
||||
function(get_host_triple out out_arch out_vendor out_os)
|
||||
# Get the architecture.
|
||||
set(arch ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
if (arch STREQUAL "x86")
|
||||
set(arch "i686")
|
||||
endif()
|
||||
# Get the vendor.
|
||||
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
set(vendor "apple")
|
||||
else()
|
||||
set(vendor "pc")
|
||||
endif()
|
||||
# Get os.
|
||||
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
|
||||
set(os "win32")
|
||||
else()
|
||||
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} os)
|
||||
endif()
|
||||
set(triple "${arch}-${vendor}-${os}")
|
||||
set(${out} ${triple} PARENT_SCOPE)
|
||||
set(${out_arch} ${arch} PARENT_SCOPE)
|
||||
set(${out_vendor} ${vendor} PARENT_SCOPE)
|
||||
set(${out_os} ${os} PARENT_SCOPE)
|
||||
message(STATUS "Host triple: ${triple}")
|
||||
endfunction()
|
||||
|
||||
function(get_target_triple out out_arch out_vendor out_os)
|
||||
# Get the architecture.
|
||||
set(arch ${CMAKE_SYSTEM_PROCESSOR})
|
||||
if (arch STREQUAL "x86")
|
||||
set(arch "i686")
|
||||
endif()
|
||||
# Get the vendor.
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
set(vendor "apple")
|
||||
else()
|
||||
set(vendor "pc")
|
||||
endif()
|
||||
# Get os.
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
set(os "win32")
|
||||
else()
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} os)
|
||||
endif()
|
||||
set(triple "${arch}-${vendor}-${os}")
|
||||
set(${out} ${triple} PARENT_SCOPE)
|
||||
set(${out_arch} ${arch} PARENT_SCOPE)
|
||||
set(${out_vendor} ${vendor} PARENT_SCOPE)
|
||||
set(${out_os} ${os} PARENT_SCOPE)
|
||||
message(STATUS "Target triple: ${triple}")
|
||||
endfunction()
|
@@ -1,18 +0,0 @@
|
||||
# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
|
||||
|
||||
macro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )
|
||||
|
||||
string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
|
||||
if( _insource )
|
||||
message( SEND_ERROR "${_errorMessage}" )
|
||||
message( FATAL_ERROR
|
||||
"In-source builds are not allowed.
|
||||
CMake would overwrite the makefiles distributed with Compiler-RT.
|
||||
Please create a directory and run cmake from there, passing the path
|
||||
to this source directory as the last argument.
|
||||
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
|
||||
Please delete them."
|
||||
)
|
||||
endif( _insource )
|
||||
|
||||
endmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )
|
@@ -1,37 +0,0 @@
|
||||
include(CheckLibraryExists)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# Check compiler flags
|
||||
check_cxx_compiler_flag(-std=c++0x LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
check_cxx_compiler_flag(-fPIC LIBCXX_HAS_FPIC_FLAG)
|
||||
check_cxx_compiler_flag(-nodefaultlibs LIBCXX_HAS_NODEFAULTLIBS_FLAG)
|
||||
check_cxx_compiler_flag(-nostdinc++ LIBCXX_HAS_NOSTDINCXX_FLAG)
|
||||
check_cxx_compiler_flag(-Wall LIBCXX_HAS_WALL_FLAG)
|
||||
check_cxx_compiler_flag(-W LIBCXX_HAS_W_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-unused-parameter LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG)
|
||||
check_cxx_compiler_flag(-Wwrite-strings LIBCXX_HAS_WWRITE_STRINGS_FLAG)
|
||||
check_cxx_compiler_flag(-Wno-long-long LIBCXX_HAS_WNO_LONG_LONG_FLAG)
|
||||
check_cxx_compiler_flag(-pedantic LIBCXX_HAS_PEDANTIC_FLAG)
|
||||
check_cxx_compiler_flag(-Werror LIBCXX_HAS_WERROR_FLAG)
|
||||
check_cxx_compiler_flag(-fno-exceptions LIBCXX_HAS_FNO_EXCEPTIONS_FLAG)
|
||||
check_cxx_compiler_flag(-fno-rtti LIBCXX_HAS_FNO_RTTI_FLAG)
|
||||
check_cxx_compiler_flag(/WX LIBCXX_HAS_WX_FLAG)
|
||||
check_cxx_compiler_flag(/EHsc LIBCXX_HAS_EHSC_FLAG)
|
||||
check_cxx_compiler_flag(/EHs- LIBCXX_HAS_NO_EHS_FLAG)
|
||||
check_cxx_compiler_flag(/EHa- LIBCXX_HAS_NO_EHA_FLAG)
|
||||
check_cxx_compiler_flag(/GR- LIBCXX_HAS_NO_GR_FLAG)
|
||||
|
||||
# Check libraries
|
||||
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
|
||||
check_library_exists(c printf "" LIBCXX_HAS_C_LIB)
|
||||
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
|
||||
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
|
||||
|
||||
# Check C++0x features
|
||||
if (LIBCXX_ENABLE_CXX0X)
|
||||
if (LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -std=c++0x)
|
||||
endif()
|
||||
else()
|
||||
set(LIBCXX_HAS_STDCXX0X_FLAG FALSE)
|
||||
endif()
|
@@ -82,7 +82,7 @@
|
||||
|
||||
#define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__))
|
||||
|
||||
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
|
||||
#define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__))
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
@@ -214,7 +214,6 @@ using namespace _LIBCPP_NAMESPACE;
|
||||
#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
|
||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_NULLPTR
|
||||
#endif
|
||||
|
||||
|
@@ -55,8 +55,7 @@ public:
|
||||
explicit locale(const string&);
|
||||
locale(const locale&, const char*, category);
|
||||
locale(const locale&, const string&, category);
|
||||
template <class _Facet>
|
||||
_LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*);
|
||||
template <class _Facet> locale(const locale&, _Facet*);
|
||||
locale(const locale&, const locale&, category);
|
||||
|
||||
~locale() throw();
|
||||
|
@@ -85,14 +85,12 @@ public:
|
||||
void shrink_to_fit();
|
||||
void push_front(const_reference __x);
|
||||
void push_back(const_reference __x);
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void push_front(value_type&& __x);
|
||||
void push_back(value_type&& __x);
|
||||
#if !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
template <class... _Args>
|
||||
void emplace_back(_Args&&... __args);
|
||||
#endif // !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
|
||||
_LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
|
||||
|
@@ -68,13 +68,12 @@ template <class _Tp, size_t _Size> struct _LIBCPP_VISIBLE array;
|
||||
|
||||
template <class _Tp> struct __tuple_like : false_type {};
|
||||
|
||||
template <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {};
|
||||
template <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {};
|
||||
template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {};
|
||||
|
||||
template <class... _Tp> struct __tuple_like<tuple<_Tp...>> : true_type {};
|
||||
template <class... _Tp> struct __tuple_like<const tuple<_Tp...>> : true_type {};
|
||||
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
|
||||
template <class _T1, class _T2> struct __tuple_like<const pair<_T1, _T2> > : true_type {};
|
||||
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
|
||||
template <class _Tp, size_t _Size> struct __tuple_like<const array<_Tp, _Size> > : true_type {};
|
||||
|
||||
template <size_t _Ip, class ..._Tp>
|
||||
typename tuple_element<_Ip, tuple<_Tp...>>::type&
|
||||
|
48
include/ios
48
include/ios
@@ -272,16 +272,16 @@ public:
|
||||
class Init;
|
||||
|
||||
// 27.5.2.2 fmtflags state:
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
|
||||
_LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
|
||||
_LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
|
||||
fmtflags flags() const;
|
||||
fmtflags flags(fmtflags __fmtfl);
|
||||
fmtflags setf(fmtflags __fmtfl);
|
||||
fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
|
||||
void unsetf(fmtflags __mask);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize precision() const;
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize width() const;
|
||||
_LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
|
||||
streamsize precision() const;
|
||||
streamsize precision(streamsize __prec);
|
||||
streamsize width() const;
|
||||
streamsize width(streamsize __wide);
|
||||
|
||||
// 27.5.2.3 locales:
|
||||
locale imbue(const locale& __loc);
|
||||
@@ -307,17 +307,17 @@ private:
|
||||
public:
|
||||
static bool sync_with_stdio(bool __sync = true);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
|
||||
iostate rdstate() const;
|
||||
void clear(iostate __state = goodbit);
|
||||
_LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
|
||||
void setstate(iostate __state);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool good() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool eof() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool fail() const;
|
||||
_LIBCPP_INLINE_VISIBILITY bool bad() const;
|
||||
bool good() const;
|
||||
bool eof() const;
|
||||
bool fail() const;
|
||||
bool bad() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
|
||||
_LIBCPP_INLINE_VISIBILITY void exceptions(iostate __except);
|
||||
iostate exceptions() const;
|
||||
void exceptions(iostate __except);
|
||||
|
||||
void __set_badbit_and_consider_rethrow();
|
||||
void __set_failbit_and_consider_rethrow();
|
||||
@@ -587,52 +587,38 @@ public:
|
||||
_LIBCPP_ALWAYS_INLINE void exceptions(iostate __except) {ios_base::exceptions(__except);}
|
||||
|
||||
// 27.5.4.1 Constructor/destructor:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
|
||||
virtual ~basic_ios();
|
||||
|
||||
// 27.5.4.2 Members:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<char_type, traits_type>* tie() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_streambuf<char_type, traits_type>* rdbuf() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
|
||||
|
||||
basic_ios& copyfmt(const basic_ios& __rhs);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type fill() const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type fill(char_type __ch);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
locale imbue(const locale& __loc);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char narrow(char_type __c, char __dfault) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
char_type widen(char __c) const;
|
||||
|
||||
protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
basic_ios() {// purposefully does no initialization
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void init(basic_streambuf<char_type, traits_type>* __sb);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void move(basic_ios& __rhs);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void move(basic_ios&& __rhs) {move(__rhs);}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(basic_ios& __rhs);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
|
||||
private:
|
||||
basic_ostream<char_type, traits_type>* __tie_;
|
||||
|
@@ -265,10 +265,7 @@ __nolocale_isdigit(int __c)
|
||||
}
|
||||
|
||||
#else // __APPLE__
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_sprintf(char* __restrict __str,
|
||||
const char* __restrict __format, ...)
|
||||
@@ -279,10 +276,7 @@ __nolocale_sprintf(char* __restrict __str,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
const char* __restrict __format, ...)
|
||||
@@ -293,10 +287,7 @@ __nolocale_snprintf(char* __restrict __str, size_t __size,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_asprintf(char** __ret,
|
||||
const char* __restrict __format, ...)
|
||||
@@ -307,10 +298,7 @@ __nolocale_asprintf(char** __ret,
|
||||
va_end(__ap);
|
||||
return __result;
|
||||
}
|
||||
inline
|
||||
#ifndef _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
#endif
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
int
|
||||
__nolocale_sscanf(const char* __restrict __str,
|
||||
const char* __restrict __format, ...)
|
||||
@@ -1768,7 +1756,7 @@ public:
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
class __time_get_c_storage // purposefully not decorated
|
||||
class __time_get_c_storage
|
||||
{
|
||||
protected:
|
||||
typedef basic_string<_CharT> string_type;
|
||||
@@ -2650,15 +2638,24 @@ protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~moneypunct() {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_decimal_point() const {return numeric_limits<char_type>::max();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_thousands_sep() const {return numeric_limits<char_type>::max();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string do_grouping() const {return string();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_curr_symbol() const {return string_type();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_positive_sign() const {return string_type();}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_negative_sign() const {return string_type(1, '-');}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual int do_frac_digits() const {return 0;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_pos_format() const
|
||||
{pattern __p = {symbol, sign, none, value}; return __p;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_neg_format() const
|
||||
{pattern __p = {symbol, sign, none, value}; return __p;}
|
||||
};
|
||||
@@ -2695,14 +2692,23 @@ protected:
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
~moneypunct_byname() {}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_decimal_point() const {return __decimal_point_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual char_type do_thousands_sep() const {return __thousands_sep_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string do_grouping() const {return __grouping_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_curr_symbol() const {return __curr_symbol_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_positive_sign() const {return __positive_sign_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual string_type do_negative_sign() const {return __negative_sign_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual int do_frac_digits() const {return __frac_digits_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_pos_format() const {return __pos_format_;}
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
virtual pattern do_neg_format() const {return __neg_format_;}
|
||||
|
||||
private:
|
||||
|
@@ -1487,7 +1487,7 @@ struct _LIBCPP_VISIBLE uses_allocator
|
||||
{
|
||||
};
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
|
||||
// uses-allocator construction
|
||||
|
||||
@@ -1505,7 +1505,7 @@ struct __uses_alloc_ctor
|
||||
: integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
|
||||
{};
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
|
||||
// allocator
|
||||
|
||||
@@ -1546,7 +1546,6 @@ public:
|
||||
{
|
||||
::new((void*)__p) _Tp();
|
||||
}
|
||||
# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
template <class _A0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
@@ -1580,7 +1579,6 @@ public:
|
||||
{
|
||||
::new((void*)__p) _Tp(_STD::move(__a0));
|
||||
}
|
||||
# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
|
||||
template <class _A0, class _A1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
|
@@ -1028,43 +1028,33 @@ private:
|
||||
public:
|
||||
static const size_type npos = -1;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string();
|
||||
_LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a);
|
||||
basic_string();
|
||||
explicit basic_string(const allocator_type& __a);
|
||||
basic_string(const basic_string& __str);
|
||||
basic_string(const basic_string& __str, const allocator_type& __a);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
basic_string(basic_string&& __str);
|
||||
basic_string(basic_string&& __str, const allocator_type& __a);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string(const_pointer __s);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(const_pointer __s);
|
||||
basic_string(const_pointer __s, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(const_pointer __s, size_type __n);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(const_pointer __s, size_type __n, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(size_type __n, value_type __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(size_type __n, value_type __c, const allocator_type& __a);
|
||||
basic_string(const basic_string& __str, size_type __pos, size_type __n = npos,
|
||||
const allocator_type& __a = allocator_type());
|
||||
template<class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(_InputIterator __first, _InputIterator __last);
|
||||
template<class _InputIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(initializer_list<value_type> __il);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
|
||||
~basic_string();
|
||||
|
||||
basic_string& operator=(const basic_string& __str);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& operator=(basic_string&& __str);
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const_pointer __s) {return assign(__s);}
|
||||
@@ -1096,7 +1086,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY size_type size() const
|
||||
{return __is_long() ? __get_long_size() : __get_short_size();}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type length() const {return size();}
|
||||
_LIBCPP_INLINE_VISIBILITY size_type max_size() const;
|
||||
size_type max_size() const;
|
||||
_LIBCPP_INLINE_VISIBILITY size_type capacity() const
|
||||
{return (__is_long() ? __get_long_cap() : __min_cap) - 1;}
|
||||
|
||||
@@ -1106,7 +1096,6 @@ public:
|
||||
void reserve(size_type res_arg = 0);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void shrink_to_fit() {reserve();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear();
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const {return size() == 0;}
|
||||
|
||||
@@ -1121,7 +1110,6 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& append(const basic_string& __str);
|
||||
basic_string& append(const basic_string& __str, size_type __pos, size_type __n);
|
||||
basic_string& append(const_pointer __s, size_type __n);
|
||||
@@ -1146,14 +1134,12 @@ public:
|
||||
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
|
||||
|
||||
void push_back(value_type __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void pop_back();
|
||||
_LIBCPP_INLINE_VISIBILITY reference front();
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference front() const;
|
||||
_LIBCPP_INLINE_VISIBILITY reference back();
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference back() const;
|
||||
reference front();
|
||||
const_reference front() const;
|
||||
reference back();
|
||||
const_reference back() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& assign(const basic_string& __str);
|
||||
basic_string& assign(const basic_string& __str, size_type __pos, size_type __n);
|
||||
basic_string& assign(const_pointer __s, size_type __n);
|
||||
@@ -1177,14 +1163,12 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& insert(size_type __pos1, const basic_string& __str);
|
||||
basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n);
|
||||
basic_string& insert(size_type __pos, const_pointer __s, size_type __n);
|
||||
basic_string& insert(size_type __pos, const_pointer __s);
|
||||
basic_string& insert(size_type __pos, size_type __n, value_type __c);
|
||||
iterator insert(const_iterator __pos, value_type __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator insert(const_iterator __pos, size_type __n, value_type __c);
|
||||
template<class _InputIterator>
|
||||
typename enable_if
|
||||
@@ -1206,24 +1190,17 @@ public:
|
||||
{return insert(__pos, __il.begin(), __il.end());}
|
||||
|
||||
basic_string& erase(size_type __pos = 0, size_type __n = npos);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __pos);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator erase(const_iterator __first, const_iterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);
|
||||
basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2);
|
||||
basic_string& replace(size_type __pos, size_type __n1, const_pointer __s, size_type __n2);
|
||||
basic_string& replace(size_type __pos, size_type __n1, const_pointer __s);
|
||||
basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(const_iterator __i1, const_iterator __i2, const_pointer __s, size_type __n);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(const_iterator __i1, const_iterator __i2, const_pointer __s);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c);
|
||||
template<class _InputIterator>
|
||||
typename enable_if
|
||||
@@ -1237,10 +1214,8 @@ public:
|
||||
{return replace(__i1, __i2, __il.begin(), __il.end());}
|
||||
|
||||
size_type copy(pointer __s, size_type __n, size_type __pos = 0) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string substr(size_type __pos = 0, size_type __n = npos) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(basic_string& __str);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY const_pointer c_str() const {return data();}
|
||||
@@ -1248,62 +1223,44 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const {return __alloc();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find(const basic_string& __str, size_type __pos = 0) const;
|
||||
size_type find(const_pointer __s, size_type __pos, size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find(const_pointer __s, size_type __pos = 0) const;
|
||||
size_type find(value_type __c, size_type __pos = 0) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type rfind(const basic_string& __str, size_type __pos = npos) const;
|
||||
size_type rfind(const_pointer __s, size_type __pos, size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type rfind(const_pointer __s, size_type __pos = npos) const;
|
||||
size_type rfind(value_type __c, size_type __pos = npos) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_first_of(const basic_string& __str, size_type __pos = 0) const;
|
||||
size_type find_first_of(const_pointer __s, size_type __pos, size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_first_of(const_pointer __s, size_type __pos = 0) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_first_of(value_type __c, size_type __pos = 0) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_last_of(const basic_string& __str, size_type __pos = npos) const;
|
||||
size_type find_last_of(const_pointer __s, size_type __pos, size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_last_of(const_pointer __s, size_type __pos = npos) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_last_of(value_type __c, size_type __pos = npos) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const;
|
||||
size_type find_first_not_of(const_pointer __s, size_type __pos, size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_first_not_of(const_pointer __s, size_type __pos = 0) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_first_not_of(value_type __c, size_type __pos = 0) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const;
|
||||
size_type find_last_not_of(const_pointer __s, size_type __pos, size_type __n) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_last_not_of(const_pointer __s, size_type __pos = npos) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type find_last_not_of(value_type __c, size_type __pos = npos) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(const basic_string& __str) const;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
|
||||
int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) const;
|
||||
int compare(const_pointer __s) const;
|
||||
int compare(size_type __pos1, size_type __n1, const_pointer __s) const;
|
||||
int compare(size_type __pos1, size_type __n1, const_pointer __s, size_type __n2) const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool __invariants() const;
|
||||
bool __invariants() const;
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type& __alloc() {return __r_.second();}
|
||||
_LIBCPP_INLINE_VISIBILITY const allocator_type& __alloc() const {return __r_.second();}
|
||||
@@ -1381,7 +1338,6 @@ private:
|
||||
size_type __n_copy, size_type __n_del,
|
||||
size_type __n_add, const_pointer __p_new_stuff);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __erase_to_end(size_type __pos);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1405,9 +1361,7 @@ private:
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign(basic_string& __str, false_type);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __move_assign(basic_string& __str, true_type);
|
||||
#endif
|
||||
|
||||
@@ -1426,8 +1380,8 @@ private:
|
||||
static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
|
||||
{}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
|
||||
_LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(size_type);
|
||||
void __invalidate_all_iterators();
|
||||
void __invalidate_iterators_past(size_type);
|
||||
|
||||
friend basic_string operator+<>(const basic_string&, const basic_string&);
|
||||
friend basic_string operator+<>(const value_type*, const basic_string&);
|
||||
@@ -1787,6 +1741,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_t
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
basic_string<_CharT, _Traits, _Allocator>::~basic_string()
|
||||
{
|
||||
__invalidate_all_iterators();
|
||||
@@ -3249,7 +3204,6 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type _
|
||||
// __invariants
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
bool
|
||||
basic_string<_CharT, _Traits, _Allocator>::__invariants() const
|
||||
{
|
||||
|
@@ -297,7 +297,7 @@ public:
|
||||
|
||||
class __assoc_sub_state;
|
||||
|
||||
class _LIBCPP_HIDDEN __thread_struct_imp;
|
||||
class __thread_struct_imp;
|
||||
|
||||
class __thread_struct
|
||||
{
|
||||
|
195
include/tuple
195
include/tuple
@@ -74,8 +74,11 @@ const unspecified ignore;
|
||||
template <class... T> tuple<V...> make_tuple(T&&...);
|
||||
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...);
|
||||
template <class... T> tuple<T&...> tie(T&...);
|
||||
template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls);
|
||||
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(const tuple<T...>&, const tuple<U...>&);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(tuple<T...>&&, const tuple<U...>&);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(const tuple<T...>&, tuple<U...>&&);
|
||||
template <class... T, class... U> tuple<T..., U...> tuple_cat(tuple<T...>&&, tuple<U...>&&);
|
||||
|
||||
// 20.4.1.4, tuple helper classes:
|
||||
template <class T> class tuple_size; // undefined
|
||||
template <class... T> class tuple_size<tuple<T...>>;
|
||||
@@ -748,140 +751,72 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
|
||||
// tuple_cat
|
||||
|
||||
template <class _Tp, class _Up> struct __tuple_cat_type;
|
||||
|
||||
template <class ..._Ttypes, class ..._Utypes>
|
||||
struct __tuple_cat_type<tuple<_Ttypes...>, __tuple_types<_Utypes...>>
|
||||
{
|
||||
typedef tuple<_Ttypes..., _Utypes...> type;
|
||||
};
|
||||
|
||||
template <class _ResultTuple, bool _Is_Tuple0TupleLike, class ..._Tuples>
|
||||
struct __tuple_cat_return_1
|
||||
{
|
||||
};
|
||||
|
||||
template <class ..._Types, class _Tuple0>
|
||||
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0>
|
||||
{
|
||||
typedef typename __tuple_cat_type<tuple<_Types...>,
|
||||
typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <class ..._Types, class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples...>
|
||||
: public __tuple_cat_return_1<
|
||||
typename __tuple_cat_type<
|
||||
tuple<_Types...>,
|
||||
typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type
|
||||
>::type,
|
||||
__tuple_like<typename remove_reference<_Tuple1>::type>::value,
|
||||
_Tuple1, _Tuples...>
|
||||
{
|
||||
};
|
||||
|
||||
template <class ..._Tuples> struct __tuple_cat_return;
|
||||
|
||||
template <class _Tuple0, class ..._Tuples>
|
||||
struct __tuple_cat_return<_Tuple0, _Tuples...>
|
||||
: public __tuple_cat_return_1<tuple<>,
|
||||
__tuple_like<typename remove_reference<_Tuple0>::type>::value, _Tuple0,
|
||||
_Tuples...>
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct __tuple_cat_return<>
|
||||
{
|
||||
typedef tuple<> type;
|
||||
};
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<>
|
||||
tuple_cat()
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
return tuple<>();
|
||||
return tuple<_Tp..., _Up...>(get<_I1>(__x)..., get<_I2>(__y)...);
|
||||
}
|
||||
|
||||
template <class _R, class _Indices, class _Tuple0, class ..._Tuples>
|
||||
struct __tuple_cat_return_ref_imp;
|
||||
|
||||
template <class ..._Types, size_t ..._I0, class _Tuple0>
|
||||
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0>
|
||||
{
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
typedef tuple<_Types..., typename __apply_cv<_Tuple0,
|
||||
typename tuple_element<_I0, _T0>::type>::type&&...> type;
|
||||
};
|
||||
|
||||
template <class ..._Types, size_t ..._I0, class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>,
|
||||
_Tuple0, _Tuple1, _Tuples...>
|
||||
: public __tuple_cat_return_ref_imp<
|
||||
tuple<_Types..., typename __apply_cv<_Tuple0,
|
||||
typename tuple_element<_I0,
|
||||
typename remove_reference<_Tuple0>::type>::type>::type&&...>,
|
||||
typename __make_tuple_indices<tuple_size<typename
|
||||
remove_reference<_Tuple1>::type>::value>::type,
|
||||
_Tuple1, _Tuples...>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Tuple0, class ..._Tuples>
|
||||
struct __tuple_cat_return_ref
|
||||
: public __tuple_cat_return_ref_imp<tuple<>,
|
||||
typename __make_tuple_indices<
|
||||
tuple_size<typename remove_reference<_Tuple0>::type>::value
|
||||
>::type, _Tuple0, _Tuples...>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Types, class _I0, class _J0>
|
||||
struct __tuple_cat;
|
||||
|
||||
template <class ..._Types, size_t ..._I0, size_t ..._J0>
|
||||
struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...>>
|
||||
{
|
||||
template <class _Tuple0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
|
||||
operator()(tuple<_Types...> __t, _Tuple0&& __t0)
|
||||
{
|
||||
return _STD::forward_as_tuple(_STD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_STD::forward<_Tuple0>(__t0))...);
|
||||
}
|
||||
|
||||
template <class _Tuple0, class _Tuple1, class ..._Tuples>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type
|
||||
operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls)
|
||||
{
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
typedef typename remove_reference<_Tuple1>::type _T1;
|
||||
return __tuple_cat<
|
||||
tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,
|
||||
typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,
|
||||
typename __make_tuple_indices<tuple_size<_T1>::value>::type>()
|
||||
(_STD::forward_as_tuple(
|
||||
_STD::forward<_Types>(get<_I0>(__t))...,
|
||||
get<_J0>(_STD::forward<_Tuple0>(__t0))...
|
||||
),
|
||||
_STD::forward<_Tuple1>(__t1),
|
||||
_STD::forward<_Tuples>(__tpls)...);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tuple0, class... _Tuples>
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __tuple_cat_return<_Tuple0, _Tuples...>::type
|
||||
tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
typedef typename remove_reference<_Tuple0>::type _T0;
|
||||
return __tuple_cat<tuple<>, __tuple_indices<>,
|
||||
typename __make_tuple_indices<tuple_size<_T0>::value>::type>()
|
||||
(tuple<>(), _STD::forward<_Tuple0>(__t0),
|
||||
_STD::forward<_Tuples>(__tpls)...);
|
||||
return __tuple_cat(__x, typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
__y, typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
return tuple<_Tp..., _Up...>(_STD::forward<_Tp>(get<_I1>(__x))..., get<_I2>(__y)...);
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(tuple<_Tp...>&& __x, const tuple<_Up...>& __y)
|
||||
{
|
||||
return __tuple_cat(_STD::move(__x), typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
__y, typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
return tuple<_Tp..., _Up...>(get<_I1>(__x)..., _STD::forward<_Up>(get<_I2>(__y))...);
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(const tuple<_Tp...>& __x, tuple<_Up...>&& __y)
|
||||
{
|
||||
return __tuple_cat(__x, typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
_STD::move(__y), typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp..., _Up...>
|
||||
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
|
||||
{
|
||||
return tuple<_Tp..., _Up...>(_STD::forward<_Tp>(get<_I1>(__x))..., _STD::forward<_Up>(get<_I2>(__y))...);
|
||||
}
|
||||
|
||||
template <class... _Tp, class... _Up>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
tuple<_Tp..., _Up...>
|
||||
tuple_cat(tuple<_Tp...>&& __x, tuple<_Up...>&& __y)
|
||||
{
|
||||
return __tuple_cat(_STD::move(__x), typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||
_STD::move(__y), typename __make_tuple_indices<sizeof...(_Up)>::type());
|
||||
}
|
||||
|
||||
template <class ..._Tp, class _Alloc>
|
||||
|
@@ -1394,31 +1394,31 @@ public:
|
||||
typedef decltype(declval<_Fn>()(declval<_ArgTypes>()...)) type;
|
||||
};
|
||||
|
||||
template <class _MP, class _Tp, bool _IsMemberFunctionPtr, class ..._Args>
|
||||
template <class _MP, class _Tp, class ..._Args>
|
||||
struct __result_of_mp {};
|
||||
|
||||
// member function pointer
|
||||
|
||||
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...), _Tp, true, _Args...>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...), _Tp, _Args...>
|
||||
{
|
||||
typedef _R type;
|
||||
};
|
||||
|
||||
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...) const, _Tp, true, _Args...>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...) const, _Tp, _Args...>
|
||||
{
|
||||
typedef _R type;
|
||||
};
|
||||
|
||||
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...) volatile, _Tp, true, _Args...>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...) volatile, _Tp, _Args...>
|
||||
{
|
||||
typedef _R type;
|
||||
};
|
||||
|
||||
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...) const volatile, _Tp, true, _Args...>
|
||||
struct __result_of_mp<_R (_Class::*)(_Params...) const volatile, _Tp, _Args...>
|
||||
{
|
||||
typedef _R type;
|
||||
};
|
||||
@@ -1441,7 +1441,7 @@ struct __result_of_mdp<_R _Class::*, _Tp, true>
|
||||
};
|
||||
|
||||
template <class _R, class _Class, class _Tp>
|
||||
struct __result_of_mp<_R _Class::*, _Tp, false>
|
||||
struct __result_of_mp<_R _Class::*, _Tp>
|
||||
: public __result_of_mdp<_R _Class::*, _Tp,
|
||||
is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
|
||||
{
|
||||
@@ -1449,8 +1449,7 @@ struct __result_of_mp<_R _Class::*, _Tp, false>
|
||||
|
||||
template <class _Fn, class _Tp, class ..._ArgTypes>
|
||||
class __result_of<_Fn(_Tp, _ArgTypes...), false> // _Fn must be member pointer
|
||||
: public __result_of_mp<_Fn, _Tp, is_member_function_pointer<_Fn>::value,
|
||||
_ArgTypes...>
|
||||
: public __result_of_mp<_Fn, _Tp, _ArgTypes...>
|
||||
{
|
||||
};
|
||||
|
||||
|
@@ -222,8 +222,6 @@ struct _LIBCPP_VISIBLE pair
|
||||
second(_STD::forward<_U2>(__u2))
|
||||
{}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template<class _Tuple,
|
||||
class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -234,7 +232,7 @@ struct _LIBCPP_VISIBLE pair
|
||||
typename __make_tuple_types<_Tuple>::type>::type>(get<1>(__p)))
|
||||
{}
|
||||
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -245,6 +243,8 @@ struct _LIBCPP_VISIBLE pair
|
||||
typename __make_tuple_indices<sizeof...(_Args2) >::type())
|
||||
{}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _Tuple,
|
||||
class = typename enable_if<__tuple_assignable<_Tuple, pair>::value>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -259,8 +259,6 @@ struct _LIBCPP_VISIBLE pair
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY pair(const pair<_U1, _U2>& __p)
|
||||
|
@@ -318,8 +318,8 @@ protected:
|
||||
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() {return __end_cap_.first();}
|
||||
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const {return __end_cap_.first();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __vector_base();
|
||||
_LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a);
|
||||
__vector_base();
|
||||
__vector_base(const allocator_type& __a);
|
||||
~__vector_base();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__destruct_at_end(__begin_);}
|
||||
@@ -327,8 +327,8 @@ protected:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last)
|
||||
{__destruct_at_end(__new_last, is_trivially_destructible<value_type>());}
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last, false_type);
|
||||
_LIBCPP_INLINE_VISIBILITY void __destruct_at_end(const_pointer __new_last, true_type);
|
||||
void __destruct_at_end(const_pointer __new_last, false_type);
|
||||
void __destruct_at_end(const_pointer __new_last, true_type);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __copy_assign_alloc(const __vector_base& __c)
|
||||
@@ -484,9 +484,7 @@ public:
|
||||
template <class _ForwardIterator>
|
||||
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
||||
typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(initializer_list<value_type> __il);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -495,14 +493,10 @@ public:
|
||||
|
||||
vector(const vector& __x);
|
||||
vector(const vector& __x, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(const vector& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(vector&& __x);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector(vector&& __x, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(vector&& __x);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -532,10 +526,10 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const {return this->__alloc();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator begin();
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const;
|
||||
_LIBCPP_INLINE_VISIBILITY iterator end();
|
||||
_LIBCPP_INLINE_VISIBILITY const_iterator end() const;
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator rbegin() {return reverse_iterator(end());}
|
||||
_LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const {return const_reverse_iterator(end());}
|
||||
@@ -569,7 +563,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY const value_type* data() const
|
||||
{return _STD::__to_raw_pointer(this->__begin_);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
|
||||
void push_back(const_reference __x);
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void push_back(value_type&& __x);
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
@@ -607,7 +601,7 @@ public:
|
||||
iterator insert(const_iterator __position, initializer_list<value_type> __il)
|
||||
{return insert(__position, __il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
|
||||
iterator erase(const_iterator __position);
|
||||
iterator erase(const_iterator __first, const_iterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__base::clear();}
|
||||
@@ -620,17 +614,15 @@ public:
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
|
||||
void __invalidate_all_iterators();
|
||||
void allocate(size_type __n);
|
||||
void deallocate();
|
||||
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
|
||||
_LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n);
|
||||
size_type __recommend(size_type __new_size) const;
|
||||
void __construct_at_end(size_type __n);
|
||||
void __construct_at_end(size_type __n, false_type);
|
||||
_LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, true_type);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct_at_end(size_type __n, true_type);
|
||||
void __construct_at_end(size_type __n, const_reference __x);
|
||||
void __construct_at_end(size_type __n, const_reference __x, false_type);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __construct_at_end(size_type __n, const_reference __x, false_type);
|
||||
void __construct_at_end(size_type __n, const_reference __x, true_type);
|
||||
template <class _ForwardIterator>
|
||||
typename enable_if
|
||||
@@ -642,9 +634,7 @@ private:
|
||||
void __move_construct_at_end(pointer __first, pointer __last);
|
||||
void __append(size_type __n);
|
||||
void __append(size_type __n, const_reference __x);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator __make_iter(pointer __p);
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator __make_iter(const_pointer __p) const;
|
||||
void __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v);
|
||||
pointer __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p);
|
||||
@@ -1767,8 +1757,8 @@ private:
|
||||
{return (__n - 1) / __bits_per_word + 1;}
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY vector();
|
||||
_LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a);
|
||||
vector();
|
||||
explicit vector(const allocator_type& __a);
|
||||
~vector();
|
||||
explicit vector(size_type __n);
|
||||
vector(size_type __n, const value_type& __v);
|
||||
@@ -1795,9 +1785,9 @@ public:
|
||||
vector(initializer_list<value_type> __il, const allocator_type& __a);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY vector(vector&& __v);
|
||||
vector(vector&& __v);
|
||||
vector(vector&& __v, const allocator_type& __a);
|
||||
_LIBCPP_INLINE_VISIBILITY vector& operator=(vector&& __v);
|
||||
vector& operator=(vector&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
vector& operator=(initializer_list<value_type> __il)
|
||||
@@ -1884,7 +1874,7 @@ public:
|
||||
iterator insert(const_iterator __position, initializer_list<value_type> __il)
|
||||
{return insert(__position, __il.begin(), __il.end());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
|
||||
iterator erase(const_iterator __position);
|
||||
iterator erase(const_iterator __first, const_iterator __last);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY void clear() {__size_ = 0;}
|
||||
@@ -1897,13 +1887,13 @@ public:
|
||||
bool __invariants() const;
|
||||
|
||||
private:
|
||||
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
|
||||
void __invalidate_all_iterators();
|
||||
void allocate(size_type __n);
|
||||
void deallocate();
|
||||
_LIBCPP_INLINE_VISIBILITY static size_type __align(size_type __new_size)
|
||||
{return __new_size + (__bits_per_word-1) & ~(__bits_per_word-1);};
|
||||
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
|
||||
_LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);
|
||||
size_type __recommend(size_type __new_size) const;
|
||||
void __construct_at_end(size_type __n, bool __x);
|
||||
template <class _ForwardIterator>
|
||||
typename enable_if
|
||||
<
|
||||
@@ -2260,6 +2250,7 @@ vector<bool, _Allocator>::vector(initializer_list<value_type> __il, const alloca
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
_LIBCPP_INLINE_VISIBILITY inline
|
||||
vector<bool, _Allocator>::~vector()
|
||||
{
|
||||
if (__begin_ != 0)
|
||||
|
@@ -1,56 +0,0 @@
|
||||
# Get sources
|
||||
file(GLOB_RECURSE sources ../src/*.cpp)
|
||||
|
||||
# Add all the headers to the project for IDEs.
|
||||
if (MSVC_IDE OR XCODE)
|
||||
file(GLOB_RECURSE headers ../include/*)
|
||||
# Force them all into the headers dir on MSVC, otherwise they end up at
|
||||
# project scope because they don't have extensions.
|
||||
if (MSVC_IDE)
|
||||
source_group("Header Files" FILES ${headers})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (LIBCXX_ENABLE_SHARED)
|
||||
add_library(cxx SHARED
|
||||
${sources}
|
||||
${headers}
|
||||
)
|
||||
else()
|
||||
add_library(cxx STATIC
|
||||
${sources}
|
||||
${headers}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Generate library list.
|
||||
append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
|
||||
append_if(libraries LIBCXX_HAS_C_LIB c)
|
||||
append_if(libraries LIBCXX_HAS_M_LIB m)
|
||||
append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)
|
||||
|
||||
target_link_libraries(cxx ${libraries})
|
||||
|
||||
# Setup flags.
|
||||
append_if(compile_flags LIBCXX_HAS_FPIC_FLAG -fPIC)
|
||||
append_if(link_flags LIBCXX_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
|
||||
|
||||
set_target_properties(cxx
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "${compile_flags}"
|
||||
LINK_FLAGS "${link_flags}"
|
||||
OUTPUT_NAME "c++"
|
||||
VERSION "1.0"
|
||||
SOVERSION "1"
|
||||
)
|
||||
|
||||
install(TARGETS cxx
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
install(DIRECTORY ../include/
|
||||
DESTINATION include/c++/v1
|
||||
FILES_MATCHING
|
||||
PATTERN "*"
|
||||
)
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Set the $TRIPLE environment variable to your system's triple before
|
||||
# running this script. If you set $CXX, that will be used to compile
|
||||
# the library. Otherwise we'll use clang++.
|
||||
# the library. Otherwise we'll use g++.
|
||||
|
||||
set -e
|
||||
|
||||
@@ -41,7 +41,6 @@ case $TRIPLE in
|
||||
-compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
/usr/lib/libSystem.B.dylib"
|
||||
else
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
@@ -50,7 +49,6 @@ case $TRIPLE in
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
${SDKROOT}/usr/lib/libc++abi.dylib \
|
||||
-lSystem \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
-Wl,-reexported_symbols_list,libc++abi.exp \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp"
|
||||
fi
|
||||
@@ -76,7 +74,7 @@ for FILE in ../src/*.cpp; do
|
||||
done
|
||||
|
||||
|
||||
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
|
||||
#libtool -static -o libc++.a *.o
|
||||
|
||||
|
@@ -1,19 +0,0 @@
|
||||
# all guard variables
|
||||
__ZGVNSt3__*
|
||||
# all vtables
|
||||
# __ZTV*
|
||||
# all VTT
|
||||
# __ZTT*
|
||||
# all non-virtual thunks
|
||||
# __ZTh*
|
||||
# all virtual thunks
|
||||
# __ZTv*
|
||||
# typeinfo for std::__1::__types
|
||||
# There are no std::__types
|
||||
# __ZTINSt3__1[0-9][0-9]*__*
|
||||
# typeinfo name for std::__1::__types
|
||||
__ZTSNSt3__1[0-9][0-9]*__*
|
||||
# anything using __hidden_allocator
|
||||
*__hidden_allocator*
|
||||
# anything using __sso_allocator
|
||||
*__sso_allocator*
|
121
src/locale.cpp
121
src/locale.cpp
@@ -21,6 +21,8 @@
|
||||
#include <langinfo.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// FIXME: Locales are hard.
|
||||
#if __APPLE__
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
namespace {
|
||||
@@ -674,93 +676,61 @@ ctype<wchar_t>::~ctype()
|
||||
bool
|
||||
ctype<wchar_t>::do_is(mask m, char_type c) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return isascii(c) ? _DefaultRuneLocale.__runetype[c] & m : false;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_is(const char_type* low, const char_type* high, mask* vec) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low, ++vec)
|
||||
*vec = static_cast<mask>(isascii(*low) ? _DefaultRuneLocale.__runetype[*low] : 0);
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_scan_is(mask m, const char_type* low, const char_type* high) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low)
|
||||
if (isascii(*low) && (_DefaultRuneLocale.__runetype[*low] & m))
|
||||
break;
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_scan_not(mask m, const char_type* low, const char_type* high) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low)
|
||||
if (!(isascii(*low) && (_DefaultRuneLocale.__runetype[*low] & m)))
|
||||
break;
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(char_type c) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low)
|
||||
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low;
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(char_type c) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low)
|
||||
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low;
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
wchar_t
|
||||
@@ -805,10 +775,8 @@ ctype<char>::ctype(const mask* tab, bool del, size_t refs)
|
||||
__tab_(tab),
|
||||
__del_(del)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (__tab_ == 0)
|
||||
__tab_ = _DefaultRuneLocale.__runetype;
|
||||
#endif
|
||||
}
|
||||
|
||||
ctype<char>::~ctype()
|
||||
@@ -820,45 +788,29 @@ ctype<char>::~ctype()
|
||||
char
|
||||
ctype<char>::do_toupper(char_type c) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<char>::do_toupper(char_type* low, const char_type* high) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low)
|
||||
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low;
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_tolower(char_type c) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<char>::do_tolower(char_type* low, const char_type* high) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low)
|
||||
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low;
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
char
|
||||
@@ -897,11 +849,7 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
|
||||
const ctype<char>::mask*
|
||||
ctype<char>::classic_table() throw()
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return _DefaultRuneLocale.__runetype;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// template <> class ctype_byname<char>
|
||||
@@ -999,7 +947,6 @@ ctype_byname<wchar_t>::do_is(mask m, char_type c) const
|
||||
const wchar_t*
|
||||
ctype_byname<wchar_t>::do_is(const char_type* low, const char_type* high, mask* vec) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low, ++vec)
|
||||
{
|
||||
if (isascii(*low))
|
||||
@@ -1028,9 +975,6 @@ ctype_byname<wchar_t>::do_is(const char_type* low, const char_type* high, mask*
|
||||
}
|
||||
}
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
@@ -1082,49 +1026,33 @@ ctype_byname<wchar_t>::do_tolower(char_type* low, const char_type* high) const
|
||||
wchar_t
|
||||
ctype_byname<wchar_t>::do_widen(char c) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return btowc_l(c, __l);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype_byname<wchar_t>::do_widen(const char* low, const char* high, char_type* dest) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low, ++dest)
|
||||
*dest = btowc_l(*low, __l);
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
char
|
||||
ctype_byname<wchar_t>::do_narrow(char_type c, char dfault) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
int r = wctob_l(c, __l);
|
||||
return r != WEOF ? static_cast<char>(r) : dfault;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, char dfault, char* dest) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
for (; low != high; ++low, ++dest)
|
||||
{
|
||||
int r = wctob_l(*low, __l);
|
||||
*dest = r != WEOF ? static_cast<char>(r) : dfault;
|
||||
}
|
||||
return low;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// template <> class codecvt<char, char, mbstate_t>
|
||||
@@ -1220,7 +1148,6 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
|
||||
const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
|
||||
extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
// look for first internal null in frm
|
||||
const intern_type* fend = frm;
|
||||
for (; fend != frm_end; ++fend)
|
||||
@@ -1270,9 +1197,6 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
|
||||
}
|
||||
}
|
||||
return frm_nxt == frm_end ? ok : partial;
|
||||
#else
|
||||
return error;
|
||||
#endif
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::result
|
||||
@@ -1280,7 +1204,6 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
|
||||
const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
|
||||
intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
// look for first internal null in frm
|
||||
const extern_type* fend = frm;
|
||||
for (; fend != frm_end; ++fend)
|
||||
@@ -1338,16 +1261,12 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
|
||||
}
|
||||
}
|
||||
return frm_nxt == frm_end ? ok : partial;
|
||||
#else
|
||||
return error;
|
||||
#endif
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::result
|
||||
codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
|
||||
extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
to_nxt = to;
|
||||
extern_type tmp[MB_LEN_MAX];
|
||||
size_t n = wcrtomb_l(tmp, intern_type(), &st, __l);
|
||||
@@ -1359,15 +1278,11 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
|
||||
for (extern_type* p = tmp; n; --n) // write it
|
||||
*to_nxt++ = *p++;
|
||||
return ok;
|
||||
#else
|
||||
return error;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_encoding() const throw()
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (mbtowc_l(0, 0, MB_LEN_MAX, __l) == 0)
|
||||
{
|
||||
// stateless encoding
|
||||
@@ -1376,9 +1291,6 @@ codecvt<wchar_t, char, mbstate_t>::do_encoding() const throw()
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -1391,7 +1303,6 @@ int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
|
||||
const extern_type* frm, const extern_type* frm_end, size_t mx) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
int nbytes = 0;
|
||||
for (size_t nwchar_t = 0; nwchar_t < mx && frm != frm_end; ++nwchar_t)
|
||||
{
|
||||
@@ -1412,19 +1323,12 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
|
||||
}
|
||||
}
|
||||
return nbytes;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_max_length() const throw()
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return __l == 0 ? 1 : MB_CUR_MAX_L(__l);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Valid UTF ranges
|
||||
@@ -3965,7 +3869,6 @@ numpunct_byname<char>::~numpunct_byname()
|
||||
void
|
||||
numpunct_byname<char>::__init(const char* nm)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (strcmp(nm, "C") != 0)
|
||||
{
|
||||
unique_ptr<_xlocale, int(*)(locale_t)> loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
|
||||
@@ -3982,7 +3885,6 @@ numpunct_byname<char>::__init(const char* nm)
|
||||
__grouping_ = lc->grouping;
|
||||
// locallization for truename and falsename is not available
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// numpunct_byname<wchar_t>
|
||||
@@ -4006,7 +3908,6 @@ numpunct_byname<wchar_t>::~numpunct_byname()
|
||||
void
|
||||
numpunct_byname<wchar_t>::__init(const char* nm)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (strcmp(nm, "C") != 0)
|
||||
{
|
||||
unique_ptr<_xlocale, int(*)(locale_t)> loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
|
||||
@@ -4023,7 +3924,6 @@ numpunct_byname<wchar_t>::__init(const char* nm)
|
||||
__grouping_ = lc->grouping;
|
||||
// locallization for truename and falsename is not available
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// num_get helpers
|
||||
@@ -4588,7 +4488,6 @@ template <>
|
||||
wstring
|
||||
__time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& ct)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
tm t;
|
||||
t.tm_sec = 59;
|
||||
t.tm_min = 55;
|
||||
@@ -4733,9 +4632,6 @@ __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& ct)
|
||||
++wbb;
|
||||
}
|
||||
return result;
|
||||
#else
|
||||
return wstring();
|
||||
#endif
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -4779,7 +4675,6 @@ template <>
|
||||
void
|
||||
__time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
tm t = {0};
|
||||
char buf[100];
|
||||
size_t be;
|
||||
@@ -4851,7 +4746,6 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
|
||||
__r_ = __analyze('r', ct);
|
||||
__x_ = __analyze('x', ct);
|
||||
__X_ = __analyze('X', ct);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class CharT>
|
||||
@@ -5113,7 +5007,6 @@ void
|
||||
__time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm,
|
||||
char __fmt, char __mod) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
char __nar[100];
|
||||
char* __ne = __nar + 100;
|
||||
__do_put(__nar, __ne, __tm, __fmt, __mod);
|
||||
@@ -5123,7 +5016,6 @@ __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm,
|
||||
if (j == -1)
|
||||
__throw_runtime_error("locale not supported");
|
||||
__we = __wb + j;
|
||||
#endif
|
||||
}
|
||||
|
||||
// moneypunct_byname
|
||||
@@ -5368,7 +5260,6 @@ template<>
|
||||
void
|
||||
moneypunct_byname<char, false>::init(const char* nm)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
typedef moneypunct<char, false> base;
|
||||
unique_ptr<_xlocale, int(*)(locale_t)> loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -5401,14 +5292,12 @@ moneypunct_byname<char, false>::init(const char* nm)
|
||||
__negative_sign_ = lc->negative_sign;
|
||||
__init_pat(__pos_format_, lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn);
|
||||
__init_pat(__neg_format_, lc->n_cs_precedes, lc->n_sep_by_space, lc->n_sign_posn);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<>
|
||||
void
|
||||
moneypunct_byname<char, true>::init(const char* nm)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
typedef moneypunct<char, true> base;
|
||||
unique_ptr<_xlocale, int(*)(locale_t)> loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -5441,14 +5330,12 @@ moneypunct_byname<char, true>::init(const char* nm)
|
||||
__negative_sign_ = lc->negative_sign;
|
||||
__init_pat(__pos_format_, lc->int_p_cs_precedes, lc->int_p_sep_by_space, lc->int_p_sign_posn);
|
||||
__init_pat(__neg_format_, lc->int_n_cs_precedes, lc->int_n_sep_by_space, lc->int_n_sign_posn);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<>
|
||||
void
|
||||
moneypunct_byname<wchar_t, false>::init(const char* nm)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
typedef moneypunct<wchar_t, false> base;
|
||||
unique_ptr<_xlocale, int(*)(locale_t)> loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -5504,14 +5391,12 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
|
||||
}
|
||||
__init_pat(__pos_format_, lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn);
|
||||
__init_pat(__neg_format_, lc->n_cs_precedes, lc->n_sep_by_space, lc->n_sign_posn);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<>
|
||||
void
|
||||
moneypunct_byname<wchar_t, true>::init(const char* nm)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
typedef moneypunct<wchar_t, true> base;
|
||||
unique_ptr<_xlocale, int(*)(locale_t)> loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
@@ -5567,7 +5452,6 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
|
||||
}
|
||||
__init_pat(__pos_format_, lc->int_p_cs_precedes, lc->int_p_sep_by_space, lc->int_p_sign_posn);
|
||||
__init_pat(__neg_format_, lc->int_n_cs_precedes, lc->int_n_sep_by_space, lc->int_n_sign_posn);
|
||||
#endif
|
||||
}
|
||||
|
||||
void __do_nothing(void*) {}
|
||||
@@ -5642,3 +5526,4 @@ template class codecvt_byname<char32_t, char, mbstate_t>;
|
||||
template class __vector_base_common<true>;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
#endif // __APPLE__
|
||||
|
@@ -92,25 +92,10 @@ __thread_local_data()
|
||||
|
||||
// __thread_struct_imp
|
||||
|
||||
template <class T>
|
||||
class _LIBCPP_HIDDEN __hidden_allocator
|
||||
class __thread_struct_imp
|
||||
{
|
||||
public:
|
||||
typedef T value_type;
|
||||
|
||||
T* allocate(size_t __n)
|
||||
{return static_cast<T*>(::operator new(__n * sizeof(T)));}
|
||||
void deallocate(T* __p, size_t) {::operator delete((void*)__p);}
|
||||
|
||||
size_t max_size() const {return size_t(~0) / sizeof(T);}
|
||||
};
|
||||
|
||||
class _LIBCPP_HIDDEN __thread_struct_imp
|
||||
{
|
||||
typedef vector<__assoc_sub_state*,
|
||||
__hidden_allocator<__assoc_sub_state*> > _AsyncStates;
|
||||
typedef vector<pair<condition_variable*, mutex*>,
|
||||
__hidden_allocator<pair<condition_variable*, mutex*> > > _Notify;
|
||||
typedef vector<__assoc_sub_state*> _AsyncStates;
|
||||
typedef vector<pair<condition_variable*, mutex*> > _Notify;
|
||||
|
||||
_AsyncStates async_states_;
|
||||
_Notify notify_;
|
||||
|
@@ -1,44 +0,0 @@
|
||||
macro(pythonize_bool var)
|
||||
if (${var})
|
||||
set(${var} True)
|
||||
else()
|
||||
set(${var} False)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
include(FindPythonInterp)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
|
||||
set(LIT_ARGS_DEFAULT "-sv")
|
||||
if (MSVC OR XCODE)
|
||||
set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
|
||||
endif()
|
||||
set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
|
||||
CACHE STRING "Default options for lit")
|
||||
set(LIT_ARGS "${LLVM_LIT_ARGS}")
|
||||
separate_arguments(LIT_ARGS)
|
||||
|
||||
set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
set(LIBCXX_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||
set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
pythonize_bool(LIBCXX_ENABLE_SHARED)
|
||||
pythonize_bool(LIBCXX_HAS_STDCXX0X_FLAG)
|
||||
|
||||
set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(check
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${LIT_EXECUTABLE}
|
||||
${LIT_ARGS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS
|
||||
COMMENT "Running libcxx tests")
|
||||
else()
|
||||
message(WARNING "Could not find Python, no check target will be available!")
|
||||
endif()
|
43
test/lit.cfg
43
test/lit.cfg
@@ -3,7 +3,6 @@
|
||||
# Configuration file for the 'lit' test runner.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import tempfile
|
||||
import signal
|
||||
@@ -67,9 +66,8 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
|
||||
exec_file.close()
|
||||
|
||||
try:
|
||||
compile_cmd = [self.cxx_under_test, '-o', exec_path,
|
||||
cmd = [self.cxx_under_test, '-o', exec_path,
|
||||
source_path] + self.cpp_flags + self.ld_flags
|
||||
cmd = compile_cmd
|
||||
out, err, exitCode = self.execute_command(cmd)
|
||||
if exitCode != 0:
|
||||
report = """Command: %s\n""" % ' '.join(["'%s'" % a
|
||||
@@ -85,9 +83,7 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
|
||||
cmd = [exec_path]
|
||||
out, err, exitCode = self.execute_command(cmd)
|
||||
if exitCode != 0:
|
||||
report = """Compiled With: %s\n""" % ' '.join(["'%s'" % a
|
||||
for a in compile_cmd])
|
||||
report += """Command: %s\n""" % ' '.join(["'%s'" % a
|
||||
report = """Command: %s\n""" % ' '.join(["'%s'" % a
|
||||
for a in cmd])
|
||||
report += """Exit Code: %d\n""" % exitCode
|
||||
if out:
|
||||
@@ -115,35 +111,12 @@ config.test_source_root = os.path.dirname(__file__)
|
||||
# FIXME: Would be nice to Use -stdlib=libc++ option with Clang's that accept it.
|
||||
cxx_under_test = lit.params.get('cxx_under_test', None)
|
||||
if cxx_under_test is None:
|
||||
cxx_under_test = getattr(config, 'cxx_under_test', None)
|
||||
if cxx_under_test is None:
|
||||
lit.fatal('must specify user parameter cxx_under_test '
|
||||
'(e.g., --param=cxx_under_test=clang++)')
|
||||
include_paths = []
|
||||
library_paths = []
|
||||
|
||||
libcxx_src_root = getattr(config, 'libcxx_src_root', None)
|
||||
if libcxx_src_root is not None:
|
||||
include_paths += ['-I' + libcxx_src_root + '/include']
|
||||
else:
|
||||
include_paths += ['-I/usr/include/c++/v1']
|
||||
|
||||
libcxx_obj_root = getattr(config, 'libcxx_obj_root', None)
|
||||
if libcxx_obj_root is not None:
|
||||
library_paths += ['-L' + libcxx_obj_root + '/lib']
|
||||
else:
|
||||
libcxx_obj_root = "/usr"
|
||||
|
||||
# Configure extra libraries.
|
||||
libraries = []
|
||||
if sys.platform == 'darwin':
|
||||
libraries += ['-lSystem']
|
||||
if sys.platform == 'linux2':
|
||||
libraries += ['-lgcc_eh', '-lsupc++', '-lc', '-lm', '-lgcc_s']
|
||||
libraries += ['-Wl,-R', libcxx_obj_root + '/lib']
|
||||
|
||||
lit.fatal('must specify user parameter cxx_under_test '
|
||||
'(e.g., --param=cxx_under_test=clang++)')
|
||||
config.test_format = LibcxxTestFormat(cxx_under_test,
|
||||
cpp_flags = ['-nostdinc++'] + include_paths,
|
||||
ld_flags = ['-nodefaultlibs'] + library_paths + ['-lc++'] + libraries)
|
||||
cpp_flags = ['-nostdinc++',
|
||||
'-I/usr/include/c++/v1'],
|
||||
ld_flags = ['-nodefaultlibs', '-lc++',
|
||||
'-lSystem'])
|
||||
|
||||
config.target_triple = None
|
||||
|
@@ -1,10 +0,0 @@
|
||||
@AUTO_GEN_COMMENT@
|
||||
config.cxx_under_test = "@LIBCXX_COMPILER@"
|
||||
config.cxx_has_stdcxx0x_flag = @LIBCXX_HAS_STDCXX0X_FLAG@
|
||||
config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@"
|
||||
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
|
||||
config.python_executable = "@PYTHON_EXECUTABLE@"
|
||||
config.enable_shared = @LIBCXX_ENABLE_SHARED@
|
||||
|
||||
# Let the main config do the real work.
|
||||
lit.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")
|
@@ -43,7 +43,7 @@ int main()
|
||||
|
||||
static_assert((std::is_same<
|
||||
std::scoped_allocator_adaptor<A1<int>>::size_type,
|
||||
std::make_unsigned<std::ptrdiff_t>::type>::value), "");
|
||||
std::size_t>::value), "");
|
||||
|
||||
static_assert((std::is_same<
|
||||
std::scoped_allocator_adaptor<A1<int>>::difference_type,
|
||||
|
@@ -1,20 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <functional>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#ifndef _LIBCPP_VERSION
|
||||
#error _LIBCPP_VERSION not defined
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
@@ -11,11 +11,23 @@
|
||||
|
||||
// template <class... Types> class tuple;
|
||||
|
||||
// template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls);
|
||||
// template <class... TTypes, class... UTypes>
|
||||
// tuple<TTypes..., UTypes...>
|
||||
// tuple_cat(const tuple<TTypes...>& t, const tuple<UTypes...>& u);
|
||||
//
|
||||
// template <class... TTypes, class... UTypes>
|
||||
// tuple<TTypes..., UTypes...>
|
||||
// tuple_cat(const tuple<TTypes...>&& t, const tuple<UTypes...>& u);
|
||||
//
|
||||
// template <class... TTypes, class... UTypes>
|
||||
// tuple<TTypes..., UTypes...>
|
||||
// tuple_cat(const tuple<TTypes...>& t, const tuple<UTypes...>&& u);
|
||||
//
|
||||
// template <class... TTypes, class... UTypes>
|
||||
// tuple<TTypes..., UTypes...>
|
||||
// tuple_cat(const tuple<TTypes...>&& t, const tuple<UTypes...>&& u);
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,43 +35,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::tuple<> t = std::tuple_cat();
|
||||
}
|
||||
{
|
||||
std::tuple<> t1;
|
||||
std::tuple<> t2 = std::tuple_cat(t1);
|
||||
}
|
||||
{
|
||||
std::tuple<> t = std::tuple_cat(std::tuple<>());
|
||||
}
|
||||
{
|
||||
std::tuple<> t = std::tuple_cat(std::array<int, 0>());
|
||||
}
|
||||
|
||||
{
|
||||
std::tuple<int> t1(1);
|
||||
std::tuple<int> t = std::tuple_cat(t1);
|
||||
assert(std::get<0>(t) == 1);
|
||||
}
|
||||
{
|
||||
std::tuple<int, MoveOnly> t =
|
||||
std::tuple_cat(std::tuple<int, MoveOnly>(1, 2));
|
||||
assert(std::get<0>(t) == 1);
|
||||
assert(std::get<1>(t) == 2);
|
||||
}
|
||||
{
|
||||
std::tuple<int, int, int> t = std::tuple_cat(std::array<int, 3>());
|
||||
assert(std::get<0>(t) == 0);
|
||||
assert(std::get<1>(t) == 0);
|
||||
assert(std::get<2>(t) == 0);
|
||||
}
|
||||
{
|
||||
std::tuple<int, MoveOnly> t = std::tuple_cat(std::pair<int, MoveOnly>(2, 1));
|
||||
assert(std::get<0>(t) == 2);
|
||||
assert(std::get<1>(t) == 1);
|
||||
}
|
||||
|
||||
{
|
||||
std::tuple<> t1;
|
||||
std::tuple<> t2;
|
||||
@@ -137,54 +112,4 @@ int main()
|
||||
assert(std::get<2>(t3) == nullptr);
|
||||
assert(std::get<3>(t3) == 4);
|
||||
}
|
||||
|
||||
{
|
||||
std::tuple<MoveOnly, MoveOnly> t1(1, 2);
|
||||
std::tuple<int*, MoveOnly> t2(nullptr, 4);
|
||||
std::tuple<MoveOnly, MoveOnly, int*, MoveOnly> t3 =
|
||||
std::tuple_cat(std::tuple<>(),
|
||||
std::move(t1),
|
||||
std::move(t2));
|
||||
assert(std::get<0>(t3) == 1);
|
||||
assert(std::get<1>(t3) == 2);
|
||||
assert(std::get<2>(t3) == nullptr);
|
||||
assert(std::get<3>(t3) == 4);
|
||||
}
|
||||
{
|
||||
std::tuple<MoveOnly, MoveOnly> t1(1, 2);
|
||||
std::tuple<int*, MoveOnly> t2(nullptr, 4);
|
||||
std::tuple<MoveOnly, MoveOnly, int*, MoveOnly> t3 =
|
||||
std::tuple_cat(std::move(t1),
|
||||
std::tuple<>(),
|
||||
std::move(t2));
|
||||
assert(std::get<0>(t3) == 1);
|
||||
assert(std::get<1>(t3) == 2);
|
||||
assert(std::get<2>(t3) == nullptr);
|
||||
assert(std::get<3>(t3) == 4);
|
||||
}
|
||||
{
|
||||
std::tuple<MoveOnly, MoveOnly> t1(1, 2);
|
||||
std::tuple<int*, MoveOnly> t2(nullptr, 4);
|
||||
std::tuple<MoveOnly, MoveOnly, int*, MoveOnly> t3 =
|
||||
std::tuple_cat(std::move(t1),
|
||||
std::move(t2),
|
||||
std::tuple<>());
|
||||
assert(std::get<0>(t3) == 1);
|
||||
assert(std::get<1>(t3) == 2);
|
||||
assert(std::get<2>(t3) == nullptr);
|
||||
assert(std::get<3>(t3) == 4);
|
||||
}
|
||||
{
|
||||
std::tuple<MoveOnly, MoveOnly> t1(1, 2);
|
||||
std::tuple<int*, MoveOnly> t2(nullptr, 4);
|
||||
std::tuple<MoveOnly, MoveOnly, int*, MoveOnly, int> t3 =
|
||||
std::tuple_cat(std::move(t1),
|
||||
std::move(t2),
|
||||
std::tuple<int>(5));
|
||||
assert(std::get<0>(t3) == 1);
|
||||
assert(std::get<1>(t3) == 2);
|
||||
assert(std::get<2>(t3) == nullptr);
|
||||
assert(std::get<3>(t3) == 4);
|
||||
assert(std::get<4>(t3) == 5);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user