// -*- C++ -*- //===------------------------ functional ----------------------------------===// // // 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 synopsis namespace std { template struct unary_function { typedef Arg argument_type; typedef Result result_type; }; template struct binary_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Result result_type; }; template class reference_wrapper : public unary_function // if wrapping a unary functor : public binary_function // if wraping a binary functor { public: // types typedef T type; typedef see below result_type; // Not always defined // construct/copy/destroy reference_wrapper(T&) noexcept; reference_wrapper(T&&) = delete; // do not bind to temps reference_wrapper(const reference_wrapper& x) noexcept; // assignment reference_wrapper& operator=(const reference_wrapper& x) noexcept; // access operator T& () const noexcept; T& get() const noexcept; // invoke template typename result_of::type operator() (ArgTypes&&...) const; }; template reference_wrapper ref(T& t) noexcept; template void ref(const T&& t) = delete; template reference_wrapper ref(reference_wrappert) noexcept; template reference_wrapper cref(const T& t) noexcept; template void cref(const T&& t) = delete; template reference_wrapper cref(reference_wrapper t) noexcept; template // in C++14 struct plus : binary_function { T operator()(const T& x, const T& y) const; }; template // in C++14 struct minus : binary_function { T operator()(const T& x, const T& y) const; }; template // in C++14 struct multiplies : binary_function { T operator()(const T& x, const T& y) const; }; template // in C++14 struct divides : binary_function { T operator()(const T& x, const T& y) const; }; template // in C++14 struct modulus : binary_function { T operator()(const T& x, const T& y) const; }; template // in C++14 struct negate : unary_function { T operator()(const T& x) const; }; template // in C++14 struct equal_to : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct not_equal_to : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct greater : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct less : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct greater_equal : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct less_equal : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct logical_and : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct logical_or : binary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct logical_not : unary_function { bool operator()(const T& x) const; }; template // in C++14 struct bit_and : unary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct bit_or : unary_function { bool operator()(const T& x, const T& y) const; }; template // in C++14 struct bit_xor : unary_function { bool operator()(const T& x, const T& y) const; }; template // C++14 struct bit_xor : unary_function { bool operator()(const T& x) const; }; template class unary_negate : public unary_function { public: explicit unary_negate(const Predicate& pred); bool operator()(const typename Predicate::argument_type& x) const; }; template unary_negate not1(const Predicate& pred); template class binary_negate : public binary_function { public: explicit binary_negate(const Predicate& pred); bool operator()(const typename Predicate::first_argument_type& x, const typename Predicate::second_argument_type& y) const; }; template binary_negate not2(const Predicate& pred); template unspecified not_fn(F&& f); // C++17 template struct is_bind_expression; template struct is_placeholder; // See C++14 20.9.9, Function object binders template constexpr bool is_bind_expression_v = is_bind_expression::value; // C++17 template constexpr int is_placeholder_v = is_placeholder::value; // C++17 template unspecified bind(Fn&&, BoundArgs&&...); template unspecified bind(Fn&&, BoundArgs&&...); namespace placeholders { // M is the implementation-defined number of placeholders extern unspecified _1; extern unspecified _2; . . . extern unspecified _Mp; } template class binder1st // deprecated in C++11, removed in C++17 : public unary_function { protected: Operation op; typename Operation::first_argument_type value; public: binder1st(const Operation& x, const typename Operation::first_argument_type y); typename Operation::result_type operator()( typename Operation::second_argument_type& x) const; typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const; }; template binder1st bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 template class binder2nd // deprecated in C++11, removed in C++17 : public unary_function { protected: Operation op; typename Operation::second_argument_type value; public: binder2nd(const Operation& x, const typename Operation::second_argument_type y); typename Operation::result_type operator()( typename Operation::first_argument_type& x) const; typename Operation::result_type operator()(const typename Operation::first_argument_type& x) const; }; template binder2nd bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 template // deprecated in C++11, removed in C++17 class pointer_to_unary_function : public unary_function { public: explicit pointer_to_unary_function(Result (*f)(Arg)); Result operator()(Arg x) const; }; template pointer_to_unary_function ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17 template // deprecated in C++11, removed in C++17 class pointer_to_binary_function : public binary_function { public: explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)); Result operator()(Arg1 x, Arg2 y) const; }; template pointer_to_binary_function ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17 template // deprecated in C++11, removed in C++17 class mem_fun_t : public unary_function { public: explicit mem_fun_t(S (T::*p)()); S operator()(T* p) const; }; template class mem_fun1_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit mem_fun1_t(S (T::*p)(A)); S operator()(T* p, A x) const; }; template mem_fun_t mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17 template mem_fun1_t mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17 template class mem_fun_ref_t : public unary_function // deprecated in C++11, removed in C++17 { public: explicit mem_fun_ref_t(S (T::*p)()); S operator()(T& p) const; }; template class mem_fun1_ref_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit mem_fun1_ref_t(S (T::*p)(A)); S operator()(T& p, A x) const; }; template mem_fun_ref_t mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17 template mem_fun1_ref_t mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17 template class const_mem_fun_t : public unary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun_t(S (T::*p)() const); S operator()(const T* p) const; }; template class const_mem_fun1_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun1_t(S (T::*p)(A) const); S operator()(const T* p, A x) const; }; template const_mem_fun_t mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17 template const_mem_fun1_t mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 template class const_mem_fun_ref_t : public unary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun_ref_t(S (T::*p)() const); S operator()(const T& p) const; }; template class const_mem_fun1_ref_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun1_ref_t(S (T::*p)(A) const); S operator()(const T& p, A x) const; }; template const_mem_fun_ref_t mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17 template const_mem_fun1_ref_t mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 template unspecified mem_fn(R T::*); class bad_function_call : public exception { }; template class function; // undefined template class function : public unary_function // iff sizeof...(ArgTypes) == 1 and // ArgTypes contains T1 : public binary_function // iff sizeof...(ArgTypes) == 2 and // ArgTypes contains T1 and T2 { public: typedef R result_type; // construct/copy/destroy: function() noexcept; function(nullptr_t) noexcept; function(const function&); function(function&&) noexcept; template function(F); template function(allocator_arg_t, const Alloc&) noexcept; // removed in C++17 template function(allocator_arg_t, const Alloc&, nullptr_t) noexcept; // removed in C++17 template function(allocator_arg_t, const Alloc&, const function&); // removed in C++17 template function(allocator_arg_t, const Alloc&, function&&); // removed in C++17 template function(allocator_arg_t, const Alloc&, F); // removed in C++17 function& operator=(const function&); function& operator=(function&&) noexcept; function& operator=(nullptr_t) noexcept; template function& operator=(F&&); template function& operator=(reference_wrapper) noexcept; ~function(); // function modifiers: void swap(function&) noexcept; template void assign(F&&, const Alloc&); // Removed in C++17 // function capacity: explicit operator bool() const noexcept; // function invocation: R operator()(ArgTypes...) const; // function target access: const std::type_info& target_type() const noexcept; template T* target() noexcept; template const T* target() const noexcept; }; // Null pointer comparisons: template bool operator==(const function&, nullptr_t) noexcept; template bool operator==(nullptr_t, const function&) noexcept; template bool operator!=(const function&, nullptr_t) noexcept; template bool operator!=(nullptr_t, const function&) noexcept; // specialized algorithms: template void swap(function&, function&) noexcept; template struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template <> struct hash; template struct hash; template <> struct hash; // C++17 } // std POLICY: For non-variadic implementations, the number of arguments is limited to 3. It is hoped that the need for non-variadic implementations will be minimal. */ /* -*- C++ -*- */ /*===--------------------------- complex.h --------------------------------===*/ /* */ /* The LLVM Compiler Infrastructure */ /* */ /* This file is dual licensed under the MIT and the University of Illinois Open ** Source Licenses. See LICENSE.TXT for details. */ /*===----------------------------------------------------------------------===*/ #pragma diag_push /* Avoid warning on C++ comments in this file */ #pragma diag_suppress 2581 #pragma CHECK_MISRA("-2.2") #pragma CHECK_MISRA("-19.4") #pragma CHECK_MISRA("-19.10") // The libc++ cmake build system expects to preinclude __config site during // library builds (_LIBCPP_BUILDING_LIBRARY defined). Then, as part of // installation, will prepend the contents of __config_site to __config and // install the result as __config. __config_site does not exist as part of the // cmake installation. // // The TI mkrts system follows the same behavior while bulding the library. // However, it does not support prepending as part of installation, and so must // have __config_site exist separately as a pre-generated file. // // To ensure that the cmake system still works, we only include __config_site // when it exists as part of an installation. That is: If a TI compiler is // being used, the library has been built/installed, and __config_site exists. //===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* #undef _LIBCPP_ABI_UNSTABLE */ /* #undef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE */ /* #undef _LIBCPP_HAS_NO_STDIN */ /* #undef _LIBCPP_HAS_NO_STDOUT */ /* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */ /* #undef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS */ /* #undef _LIBCPP_HAS_MUSL_LIBC */ /* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */ /* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */ /* #undef _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL */ /*****************************************************************************/ /* LIBCXX_EXTRA.H */ /* */ /* Copyright (c) 2017 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /* Changes made to this file affect how TI libc++ is BOTH built and used in production environments. */ /* The TI RTS has all source and header files flattened into a single directory. */ /* #pragma diag_suppress 1585,2866 */ #pragma GCC system_header // Change short string representation so that string data starts at offset 0, // improving its alignment in some cases. // Fix deque iterator type in order to support incomplete types. // Fix undefined behavior in how std::list stores its linked nodes. // Fix undefined behavior in how __tree stores its end and parent nodes. // Fix undefined behavior in how __hash_table stores its pointer types. // Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr // provided under the alternate keyword __nullptr, which changes the mangling // of nullptr_t. This option is ABI incompatible with GCC in C++03 mode. // Define the `pointer_safety` enum as a C++11 strongly typed enumeration // instead of as a class simulating an enum. If this option is enabled // `pointer_safety` and `get_pointer_safety()` will no longer be available // in C++03. // Define a key function for `bad_function_call` in the library, to centralize // its vtable and typeinfo to libc++ rather than having all other libraries // using that class define their own copies. // Enable optimized version of __do_get_(un)signed which avoids redundant copies. // '__is_identifier' returns '0' if '__x' is a reserved identifier provided by // the compiler and '1' otherwise. // FIXME: ABI detection should be done via compiler builtin macros. This // is just a placeholder until Clang implements such macros. For now assume // that Windows compilers pretending to be MSVC++ target the Microsoft ABI, // and allow the user to explicitly specify the ABI to handle cases where this // heuristic falls short. // Need to detect which libc we're using if we're on Linux. // __builtin_strlen can be trivially replaced, but with a hefty runtime cost // TI targets do not support aligned operator new() // Currently a dummy value. std::strerror will return "Unknown" for errors that // are out of the range of those we can print. // EDG supports __is_literal_type, which is analagous to __is_literal // TI compilers using libc++ always accept inline namespaces namespace std { inline namespace __2 { } } // Allow for build-time disabling of unsigned integer sanitization // The TI compiler is strict about the difference between extern "C" and // extern "C++" functions. One cannot be conflated with the other, even if // the types are otherwise the same. // FIXME: Remove all usages of this macro once compilers catch up. // Try to find out if RTTI is disabled. // g++ and cl.exe have RTTI on by default and define a macro when it is. // g++ only defines the macro in 4.3.2 and onwards. // Thread API // Systems that use capability-based security (FreeBSD with Capsicum, // Nuxi CloudABI) may only provide local filesystem access (using *at()). // Functions like open(), rename(), unlink() and stat() should not be // used, as they attempt to access the global filesystem namespace. // CloudABI is intended for running networked services. Processes do not // have standard input and output channels. // Thread-unsafe functions such as strtok() and localtime() // are not available. // Decide whether to use availability macros. // Define availability macros. // Define availability that depends on _LIBCPP_NO_EXCEPTIONS. // Availability of stream API in the dylib got dropped and re-added. The // extern template should effectively be available at: // availability(macosx,introduced=10.9) // availability(ios,introduced=7.0) // Don't warn about macro conflicts when we can restore them at the // end of the header. #pragma diag_pop // -*- C++ -*- //===------------------------ type_traits ---------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* type_traits synopsis namespace std { // helper class: template struct integral_constant; typedef integral_constant true_type; // C++11 typedef integral_constant false_type; // C++11 template // C++14 using bool_constant = integral_constant; // C++14 typedef bool_constant true_type; // C++14 typedef bool_constant false_type; // C++14 // helper traits template struct enable_if; template struct conditional; // Primary classification traits: template struct is_void; template struct is_null_pointer; // C++14 template struct is_integral; template struct is_floating_point; template struct is_array; template struct is_pointer; template struct is_lvalue_reference; template struct is_rvalue_reference; template struct is_member_object_pointer; template struct is_member_function_pointer; template struct is_enum; template struct is_union; template struct is_class; template struct is_function; // Secondary classification traits: template struct is_reference; template struct is_arithmetic; template struct is_fundamental; template struct is_member_pointer; template struct is_scalar; template struct is_object; template struct is_compound; // Const-volatile properties and transformations: template struct is_const; template struct is_volatile; template struct remove_const; template struct remove_volatile; template struct remove_cv; template struct add_const; template struct add_volatile; template struct add_cv; // Reference transformations: template struct remove_reference; template struct add_lvalue_reference; template struct add_rvalue_reference; // Pointer transformations: template struct remove_pointer; template struct add_pointer; // Integral properties: template struct is_signed; template struct is_unsigned; template struct make_signed; template struct make_unsigned; // Array properties and transformations: template struct rank; template struct extent; template struct remove_extent; template struct remove_all_extents; // Member introspection: template struct is_pod; template struct is_trivial; template struct is_trivially_copyable; template struct is_standard_layout; template struct is_literal_type; template struct is_empty; template struct is_polymorphic; template struct is_abstract; template struct is_final; // C++14 template struct is_aggregate; // C++17 template struct is_constructible; template struct is_default_constructible; template struct is_copy_constructible; template struct is_move_constructible; template struct is_assignable; template struct is_copy_assignable; template struct is_move_assignable; template struct is_swappable_with; // C++17 template struct is_swappable; // C++17 template struct is_destructible; template struct is_trivially_constructible; template struct is_trivially_default_constructible; template struct is_trivially_copy_constructible; template struct is_trivially_move_constructible; template struct is_trivially_assignable; template struct is_trivially_copy_assignable; template struct is_trivially_move_assignable; template struct is_trivially_destructible; template struct is_nothrow_constructible; template struct is_nothrow_default_constructible; template struct is_nothrow_copy_constructible; template struct is_nothrow_move_constructible; template struct is_nothrow_assignable; template struct is_nothrow_copy_assignable; template struct is_nothrow_move_assignable; template struct is_nothrow_swappable_with; // C++17 template struct is_nothrow_swappable; // C++17 template struct is_nothrow_destructible; template struct has_virtual_destructor; // Relationships between types: template struct is_same; template struct is_base_of; template struct is_convertible; template struct is_callable; // not defined template struct is_callable; template struct is_nothrow_callable; // not defined template struct is_nothrow_callable; // Alignment properties and transformations: template struct alignment_of; template struct aligned_storage; template struct aligned_union; template struct decay; template struct common_type; template struct underlying_type; template class result_of; // undefined template class result_of; // const-volatile modifications: template using remove_const_t = typename remove_const::type; // C++14 template using remove_volatile_t = typename remove_volatile::type; // C++14 template using remove_cv_t = typename remove_cv::type; // C++14 template using add_const_t = typename add_const::type; // C++14 template using add_volatile_t = typename add_volatile::type; // C++14 template using add_cv_t = typename add_cv::type; // C++14 // reference modifications: template using remove_reference_t = typename remove_reference::type; // C++14 template using add_lvalue_reference_t = typename add_lvalue_reference::type; // C++14 template using add_rvalue_reference_t = typename add_rvalue_reference::type; // C++14 // sign modifications: template using make_signed_t = typename make_signed::type; // C++14 template using make_unsigned_t = typename make_unsigned::type; // C++14 // array modifications: template using remove_extent_t = typename remove_extent::type; // C++14 template using remove_all_extents_t = typename remove_all_extents::type; // C++14 // pointer modifications: template using remove_pointer_t = typename remove_pointer::type; // C++14 template using add_pointer_t = typename add_pointer::type; // C++14 // other transformations: template using aligned_storage_t = typename aligned_storage::type; // C++14 template using aligned_union_t = typename aligned_union::type; // C++14 template using decay_t = typename decay::type; // C++14 template using enable_if_t = typename enable_if::type; // C++14 template using conditional_t = typename conditional::type; // C++14 template using common_type_t = typename common_type::type; // C++14 template using underlying_type_t = typename underlying_type::type; // C++14 template using result_of_t = typename result_of::type; // C++14 template using void_t = void; // C++17 // See C++14 20.10.4.1, primary type categories template constexpr bool is_void_v = is_void::value; // C++17 template constexpr bool is_null_pointer_v = is_null_pointer::value; // C++17 template constexpr bool is_integral_v = is_integral::value; // C++17 template constexpr bool is_floating_point_v = is_floating_point::value; // C++17 template constexpr bool is_array_v = is_array::value; // C++17 template constexpr bool is_pointer_v = is_pointer::value; // C++17 template constexpr bool is_lvalue_reference_v = is_lvalue_reference::value; // C++17 template constexpr bool is_rvalue_reference_v = is_rvalue_reference::value; // C++17 template constexpr bool is_member_object_pointer_v = is_member_object_pointer::value; // C++17 template constexpr bool is_member_function_pointer_v = is_member_function_pointer::value; // C++17 template constexpr bool is_enum_v = is_enum::value; // C++17 template constexpr bool is_union_v = is_union::value; // C++17 template constexpr bool is_class_v = is_class::value; // C++17 template constexpr bool is_function_v = is_function::value; // C++17 // See C++14 20.10.4.2, composite type categories template constexpr bool is_reference_v = is_reference::value; // C++17 template constexpr bool is_arithmetic_v = is_arithmetic::value; // C++17 template constexpr bool is_fundamental_v = is_fundamental::value; // C++17 template constexpr bool is_object_v = is_object::value; // C++17 template constexpr bool is_scalar_v = is_scalar::value; // C++17 template constexpr bool is_compound_v = is_compound::value; // C++17 template constexpr bool is_member_pointer_v = is_member_pointer::value; // C++17 // See C++14 20.10.4.3, type properties template constexpr bool is_const_v = is_const::value; // C++17 template constexpr bool is_volatile_v = is_volatile::value; // C++17 template constexpr bool is_trivial_v = is_trivial::value; // C++17 template constexpr bool is_trivially_copyable_v = is_trivially_copyable::value; // C++17 template constexpr bool is_standard_layout_v = is_standard_layout::value; // C++17 template constexpr bool is_pod_v = is_pod::value; // C++17 template constexpr bool is_literal_type_v = is_literal_type::value; // C++17 template constexpr bool is_empty_v = is_empty::value; // C++17 template constexpr bool is_polymorphic_v = is_polymorphic::value; // C++17 template constexpr bool is_abstract_v = is_abstract::value; // C++17 template constexpr bool is_final_v = is_final::value; // C++17 template constexpr bool is_aggregate_v = is_aggregate::value; // C++17 template constexpr bool is_signed_v = is_signed::value; // C++17 template constexpr bool is_unsigned_v = is_unsigned::value; // C++17 template constexpr bool is_constructible_v = is_constructible::value; // C++17 template constexpr bool is_default_constructible_v = is_default_constructible::value; // C++17 template constexpr bool is_copy_constructible_v = is_copy_constructible::value; // C++17 template constexpr bool is_move_constructible_v = is_move_constructible::value; // C++17 template constexpr bool is_assignable_v = is_assignable::value; // C++17 template constexpr bool is_copy_assignable_v = is_copy_assignable::value; // C++17 template constexpr bool is_move_assignable_v = is_move_assignable::value; // C++17 template constexpr bool is_swappable_with_v = is_swappable_with::value; // C++17 template constexpr bool is_swappable_v = is_swappable::value; // C++17 template constexpr bool is_destructible_v = is_destructible::value; // C++17 template constexpr bool is_trivially_constructible_v = is_trivially_constructible::value; // C++17 template constexpr bool is_trivially_default_constructible_v = is_trivially_default_constructible::value; // C++17 template constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible::value; // C++17 template constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible::value; // C++17 template constexpr bool is_trivially_assignable_v = is_trivially_assignable::value; // C++17 template constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable::value; // C++17 template constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable::value; // C++17 template constexpr bool is_trivially_destructible_v = is_trivially_destructible::value; // C++17 template constexpr bool is_nothrow_constructible_v = is_nothrow_constructible::value; // C++17 template constexpr bool is_nothrow_default_constructible_v = is_nothrow_default_constructible::value; // C++17 template constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible::value; // C++17 template constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible::value; // C++17 template constexpr bool is_nothrow_assignable_v = is_nothrow_assignable::value; // C++17 template constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable::value; // C++17 template constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable::value; // C++17 template constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with::value; // C++17 template constexpr bool is_nothrow_swappable_v = is_nothrow_swappable::value; // C++17 template constexpr bool is_nothrow_destructible_v = is_nothrow_destructible::value; // C++17 template constexpr bool has_virtual_destructor_v = has_virtual_destructor::value; // C++17 // See C++14 20.10.5, type property queries template constexpr size_t alignment_of_v = alignment_of::value; // C++17 template constexpr size_t rank_v = rank::value; // C++17 template constexpr size_t extent_v = extent::value; // C++17 // See C++14 20.10.6, type relations template constexpr bool is_same_v = is_same::value; // C++17 template constexpr bool is_base_of_v = is_base_of::value; // C++17 template constexpr bool is_convertible_v = is_convertible::value; // C++17 template constexpr bool is_callable_v = is_callable::value; // C++17 template constexpr bool is_nothrow_callable_v = is_nothrow_callable::value; // C++17 // [meta.logical], logical operator traits: template struct conjunction; // C++17 template constexpr bool conjunction_v = conjunction::value; // C++17 template struct disjunction; // C++17 template constexpr bool disjunction_v = disjunction::value; // C++17 template struct negation; // C++17 template constexpr bool negation_v = negation::value; // C++17 } */ // -*- C++ -*- //===--------------------------- cstddef ----------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* cstddef synopsis Macros: offsetof(type,member-designator) NULL namespace std { Types: ptrdiff_t size_t max_align_t nullptr_t byte // C++17 } // std */ #pragma GCC system_header // Don't include our own ; we don't want to declare ::nullptr_t. /*****************************************************************************/ /* stddef.h */ /* */ /* Copyright (c) 1993 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ extern "C" { typedef int ptrdiff_t; typedef unsigned size_t; /*----------------------------------------------------------------------------*/ /* C++11 and C11 required max_align_t to be defined. The libc++ cstddef */ /* header expects the macro __DEFINED_max_align_t to be defined if it is to */ /* use the definintion of max_align_t from stddef.h. Only define it if */ /* compiling for C11 or we're in non strict ansi mode. */ /*----------------------------------------------------------------------------*/ typedef long double max_align_t; #pragma diag_push #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ #pragma diag_pop } /* extern "C" */ #pragma diag_pop // -*- C++ -*- //===--------------------------- __nullptr --------------------------------===// // // 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. // //===----------------------------------------------------------------------===// #pragma GCC system_header namespace std { typedef decltype(nullptr) nullptr_t; } namespace std { inline namespace __2 { using ::ptrdiff_t; using ::size_t; // Re-use the compiler's max_align_t where possible. using ::max_align_t; } } #pragma GCC system_header namespace std { inline namespace __2 { template struct pair; template class reference_wrapper; template struct hash; template struct __void_t { typedef void type; }; template struct __identity { typedef _Tp type; }; template struct __dependent_type : public _Tp {}; template struct conditional {typedef _If type;}; template struct conditional {typedef _Then type;}; template using conditional_t = typename conditional<_Bp, _If, _Then>::type; template struct __lazy_enable_if {}; template struct __lazy_enable_if {typedef typename _Tp::type type;}; template struct enable_if {}; template struct enable_if {typedef _Tp type;}; template using enable_if_t = typename enable_if<_Bp, _Tp>::type; // addressof template inline __attribute__ ((__always_inline__)) _Tp* addressof(_Tp& __x) noexcept { return __builtin_addressof(__x); } template _Tp* addressof(const _Tp&&) noexcept = delete; struct __two {char __lx[2];}; // helper class: template struct integral_constant { static constexpr const _Tp value = __v; typedef _Tp value_type; typedef integral_constant type; __attribute__ ((__always_inline__)) constexpr operator value_type() const noexcept {return value;} __attribute__ ((__always_inline__)) constexpr value_type operator ()() const noexcept {return value;} }; template constexpr const _Tp integral_constant<_Tp, __v>::value; typedef integral_constant true_type; typedef integral_constant false_type; // __lazy_and template struct __lazy_and_impl; template struct __lazy_and_impl : false_type {}; template <> struct __lazy_and_impl : true_type {}; template struct __lazy_and_impl : integral_constant {}; template struct __lazy_and_impl : __lazy_and_impl<_Hp::type::value, _Tp...> {}; template struct __lazy_and : __lazy_and_impl<_P1::type::value, _Pr...> {}; // __lazy_or template struct __lazy_or_impl; template struct __lazy_or_impl : true_type {}; template <> struct __lazy_or_impl : false_type {}; template struct __lazy_or_impl : __lazy_or_impl<_Hp::type::value, _Tp...> {}; template struct __lazy_or : __lazy_or_impl<_P1::type::value, _Pr...> {}; // __lazy_not template struct __lazy_not : integral_constant {}; // __and_ template struct __and_; template<> struct __and_<> : true_type {}; template struct __and_<_B0> : _B0 {}; template struct __and_<_B0, _B1> : conditional<_B0::value, _B1, _B0>::type {}; template struct __and_<_B0, _B1, _B2, _Bn...> : conditional<_B0::value, __and_<_B1, _B2, _Bn...>, _B0>::type {}; // __or_ template struct __or_; template<> struct __or_<> : false_type {}; template struct __or_<_B0> : _B0 {}; template struct __or_<_B0, _B1> : conditional<_B0::value, _B0, _B1>::type {}; template struct __or_<_B0, _B1, _B2, _Bn...> : conditional<_B0::value, _B0, __or_<_B1, _B2, _Bn...> >::type {}; // __not_ template struct __not_ : conditional<_Tp::value, false_type, true_type>::type {}; // is_const template struct is_const : public false_type {}; template struct is_const<_Tp const> : public true_type {}; // is_volatile template struct is_volatile : public false_type {}; template struct is_volatile<_Tp volatile> : public true_type {}; // remove_const template struct remove_const {typedef _Tp type;}; template struct remove_const {typedef _Tp type;}; template using remove_const_t = typename remove_const<_Tp>::type; // remove_volatile template struct remove_volatile {typedef _Tp type;}; template struct remove_volatile {typedef _Tp type;}; template using remove_volatile_t = typename remove_volatile<_Tp>::type; // remove_cv template struct remove_cv {typedef typename remove_volatile::type>::type type;}; template using remove_cv_t = typename remove_cv<_Tp>::type; // is_void template struct __libcpp_is_void : public false_type {}; template <> struct __libcpp_is_void : public true_type {}; template struct is_void : public __libcpp_is_void::type> {}; // __is_nullptr_t template struct __is_nullptr_t_impl : public false_type {}; template <> struct __is_nullptr_t_impl : public true_type {}; template struct __is_nullptr_t : public __is_nullptr_t_impl::type> {}; template struct is_null_pointer : public __is_nullptr_t_impl::type> {}; // is_integral template struct __libcpp_is_integral : public false_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template <> struct __libcpp_is_integral : public true_type {}; template struct is_integral : public __libcpp_is_integral::type> {}; // is_floating_point template struct __libcpp_is_floating_point : public false_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template struct is_floating_point : public __libcpp_is_floating_point::type> {}; // is_array template struct is_array : public false_type {}; template struct is_array<_Tp[]> : public true_type {}; template struct is_array<_Tp[_Np]> : public true_type {}; // is_pointer template struct __libcpp_is_pointer : public false_type {}; template struct __libcpp_is_pointer<_Tp*> : public true_type {}; template struct is_pointer : public __libcpp_is_pointer::type> {}; // is_reference template struct is_lvalue_reference : public false_type {}; template struct is_lvalue_reference<_Tp&> : public true_type {}; template struct is_rvalue_reference : public false_type {}; template struct is_rvalue_reference<_Tp&&> : public true_type {}; template struct is_reference : public false_type {}; template struct is_reference<_Tp&> : public true_type {}; template struct is_reference<_Tp&&> : public true_type {}; // is_union template struct is_union : public integral_constant {}; // is_class template struct is_class : public integral_constant {}; // is_same template struct is_same : public false_type {}; template struct is_same<_Tp, _Tp> : public true_type {}; // is_function namespace __libcpp_is_function_imp { struct __dummy_type {}; template char __test(_Tp*); template char __test(__dummy_type); template __two __test(...); template _Tp& __source(int); template __dummy_type __source(...); } template ::value || is_union<_Tp>::value || is_void<_Tp>::value || is_reference<_Tp>::value || __is_nullptr_t<_Tp>::value > struct __libcpp_is_function : public integral_constant(__libcpp_is_function_imp::__source<_Tp>(0))) == 1> {}; template struct __libcpp_is_function<_Tp, true> : public false_type {}; template struct is_function : public __libcpp_is_function<_Tp> {}; // is_member_function_pointer // template struct __libcpp_is_member_function_pointer : public false_type {}; // template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; // template struct __member_pointer_traits_imp { // forward declaration; specializations later }; template struct __libcpp_is_member_function_pointer : public false_type {}; template struct __libcpp_is_member_function_pointer<_Ret _Class::*> : public is_function<_Ret> {}; template struct is_member_function_pointer : public __libcpp_is_member_function_pointer::type>::type {}; // is_member_pointer template struct __libcpp_is_member_pointer : public false_type {}; template struct __libcpp_is_member_pointer<_Tp _Up::*> : public true_type {}; template struct is_member_pointer : public __libcpp_is_member_pointer::type> {}; // is_member_object_pointer template struct is_member_object_pointer : public integral_constant::value && !is_member_function_pointer<_Tp>::value> {}; // is_enum template struct is_enum : public integral_constant {}; // is_arithmetic template struct is_arithmetic : public integral_constant::value || is_floating_point<_Tp>::value> {}; // is_fundamental template struct is_fundamental : public integral_constant::value || __is_nullptr_t<_Tp>::value || is_arithmetic<_Tp>::value> {}; // is_scalar template struct is_scalar : public integral_constant::value || is_member_pointer<_Tp>::value || is_pointer<_Tp>::value || __is_nullptr_t<_Tp>::value || is_enum<_Tp>::value > {}; template <> struct is_scalar : public true_type {}; // is_object template struct is_object : public integral_constant::value || is_array<_Tp>::value || is_union<_Tp>::value || is_class<_Tp>::value > {}; // is_compound template struct is_compound : public integral_constant::value> {}; // __is_referenceable [defns.referenceable] struct __is_referenceable_impl { template static _Tp& __test(int); template static __two __test(...); }; template struct __is_referenceable : integral_constant(0)), __two>::value> {}; // add_const template ::value || is_function<_Tp>::value || is_const<_Tp>::value > struct __add_const {typedef _Tp type;}; template struct __add_const<_Tp, false> {typedef const _Tp type;}; template struct add_const {typedef typename __add_const<_Tp>::type type;}; template using add_const_t = typename add_const<_Tp>::type; // add_volatile template ::value || is_function<_Tp>::value || is_volatile<_Tp>::value > struct __add_volatile {typedef _Tp type;}; template struct __add_volatile<_Tp, false> {typedef volatile _Tp type;}; template struct add_volatile {typedef typename __add_volatile<_Tp>::type type;}; template using add_volatile_t = typename add_volatile<_Tp>::type; // add_cv template struct add_cv {typedef typename add_const::type>::type type;}; template using add_cv_t = typename add_cv<_Tp>::type; // remove_reference template struct remove_reference {typedef _Tp type;}; template struct remove_reference<_Tp&> {typedef _Tp type;}; template struct remove_reference<_Tp&&> {typedef _Tp type;}; template using remove_reference_t = typename remove_reference<_Tp>::type; // add_lvalue_reference template ::value> struct __add_lvalue_reference_impl { typedef _Tp type; }; template struct __add_lvalue_reference_impl<_Tp, true> { typedef _Tp& type; }; template struct add_lvalue_reference {typedef typename __add_lvalue_reference_impl<_Tp>::type type;}; template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; template ::value> struct __add_rvalue_reference_impl { typedef _Tp type; }; template struct __add_rvalue_reference_impl<_Tp, true> { typedef _Tp&& type; }; template struct add_rvalue_reference {typedef typename __add_rvalue_reference_impl<_Tp>::type type;}; template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; template _Tp&& __declval(int); template _Tp __declval(long); template decltype(std::__2::__declval<_Tp>(0)) declval() noexcept; // __uncvref template struct __uncvref { typedef typename remove_cv::type>::type type; }; template struct __unconstref { typedef typename remove_const::type>::type type; }; template using __uncvref_t = typename __uncvref<_Tp>::type; // __is_same_uncvref template struct __is_same_uncvref : is_same::type, typename __uncvref<_Up>::type> {}; struct __any { __any(...); }; // remove_pointer template struct remove_pointer {typedef _Tp type;}; template struct remove_pointer<_Tp*> {typedef _Tp type;}; template struct remove_pointer<_Tp* const> {typedef _Tp type;}; template struct remove_pointer<_Tp* volatile> {typedef _Tp type;}; template struct remove_pointer<_Tp* const volatile> {typedef _Tp type;}; template using remove_pointer_t = typename remove_pointer<_Tp>::type; // add_pointer template ::value || is_same::type, void>::value> struct __add_pointer_impl {typedef typename remove_reference<_Tp>::type* type;}; template struct __add_pointer_impl<_Tp, false> {typedef _Tp type;}; template struct add_pointer {typedef typename __add_pointer_impl<_Tp>::type type;}; template using add_pointer_t = typename add_pointer<_Tp>::type; // is_signed template ::value> struct __libcpp_is_signed_impl : public integral_constant {}; template struct __libcpp_is_signed_impl<_Tp, false> : public true_type {}; // floating point template ::value> struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {}; template struct __libcpp_is_signed<_Tp, false> : public false_type {}; template struct is_signed : public __libcpp_is_signed<_Tp> {}; // is_unsigned template ::value> struct __libcpp_is_unsigned_impl : public integral_constant {}; template struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {}; // floating point template ::value> struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {}; template struct __libcpp_is_unsigned<_Tp, false> : public false_type {}; template struct is_unsigned : public __libcpp_is_unsigned<_Tp> {}; // rank template struct rank : public integral_constant {}; template struct rank<_Tp[]> : public integral_constant::value + 1> {}; template struct rank<_Tp[_Np]> : public integral_constant::value + 1> {}; // extent template struct extent : public integral_constant {}; template struct extent<_Tp[], 0> : public integral_constant {}; template struct extent<_Tp[], _Ip> : public integral_constant::value> {}; template struct extent<_Tp[_Np], 0> : public integral_constant {}; template struct extent<_Tp[_Np], _Ip> : public integral_constant::value> {}; // remove_extent template struct remove_extent {typedef _Tp type;}; template struct remove_extent<_Tp[]> {typedef _Tp type;}; template struct remove_extent<_Tp[_Np]> {typedef _Tp type;}; template using remove_extent_t = typename remove_extent<_Tp>::type; // remove_all_extents template struct remove_all_extents {typedef _Tp type;}; template struct remove_all_extents<_Tp[]> {typedef typename remove_all_extents<_Tp>::type type;}; template struct remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;}; template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; // decay template struct __decay { typedef typename remove_cv<_Up>::type type; }; template struct __decay<_Up, true> { public: typedef typename conditional < is_array<_Up>::value, typename remove_extent<_Up>::type*, typename conditional < is_function<_Up>::value, typename add_pointer<_Up>::type, typename remove_cv<_Up>::type >::type >::type type; }; template struct decay { private: typedef typename remove_reference<_Tp>::type _Up; public: typedef typename __decay<_Up, __is_referenceable<_Up>::value>::type type; }; template using decay_t = typename decay<_Tp>::type; // is_abstract template struct is_abstract : public integral_constant {}; // is_final template struct __libcpp_is_final : public integral_constant {}; template struct is_final : public integral_constant {}; // is_aggregate // is_base_of template struct is_base_of : public integral_constant {}; // is_convertible template struct is_convertible : public integral_constant::value> {}; // is_empty template struct is_empty : public integral_constant {}; // is_polymorphic template struct is_polymorphic : public integral_constant {}; // has_virtual_destructor template struct has_virtual_destructor : public integral_constant {}; // alignment_of template struct alignment_of : public integral_constant {}; // aligned_storage template struct __type_list { typedef _Hp _Head; typedef _Tp _Tail; }; struct __nat { __nat() = delete; __nat(const __nat&) = delete; __nat& operator=(const __nat&) = delete; ~__nat() = delete; }; template struct __align_type { static const size_t value = alignment_of<_Tp>::value; typedef _Tp type; }; struct __struct_double {long double __lx;}; struct __struct_double4 {double __lx[4];}; typedef __type_list<__align_type, __type_list<__align_type, __type_list<__align_type, __type_list<__align_type, __type_list<__align_type, __type_list<__align_type, __type_list<__align_type, __type_list<__align_type<__struct_double>, __type_list<__align_type<__struct_double4>, __type_list<__align_type, __nat > > > > > > > > > > __all_types; template struct __find_pod; template struct __find_pod<__type_list<_Hp, __nat>, _Align> { typedef typename conditional< _Align == _Hp::value, typename _Hp::type, void >::type type; }; template struct __find_pod<__type_list<_Hp, _Tp>, _Align> { typedef typename conditional< _Align == _Hp::value, typename _Hp::type, typename __find_pod<_Tp, _Align>::type >::type type; }; template struct __find_max_align; template struct __find_max_align<__type_list<_Hp, __nat>, _Len> : public integral_constant {}; template struct __select_align { private: static const size_t __min = _A2 < _A1 ? _A2 : _A1; static const size_t __max = _A1 < _A2 ? _A2 : _A1; public: static const size_t value = _Len < __max ? __min : __max; }; template struct __find_max_align<__type_list<_Hp, _Tp>, _Len> : public integral_constant::value>::value> {}; template ::value> struct aligned_storage { typedef typename __find_pod<__all_types, _Align>::type _Aligner; static_assert(!is_void<_Aligner>::value, ""); union type { _Aligner __align; unsigned char __data[(_Len + _Align - 1)/_Align * _Align]; }; }; template ::value> using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; template struct aligned_storage<_Len, 0x1>{ struct alignas(0x1) type { unsigned char __lx[(_Len + 0x1 - 1)/0x1 * 0x1]; };}; template struct aligned_storage<_Len, 0x2>{ struct alignas(0x2) type { unsigned char __lx[(_Len + 0x2 - 1)/0x2 * 0x2]; };}; template struct aligned_storage<_Len, 0x4>{ struct alignas(0x4) type { unsigned char __lx[(_Len + 0x4 - 1)/0x4 * 0x4]; };}; template struct aligned_storage<_Len, 0x8>{ struct alignas(0x8) type { unsigned char __lx[(_Len + 0x8 - 1)/0x8 * 0x8]; };}; template struct aligned_storage<_Len, 0x10>{ struct alignas(0x10) type { unsigned char __lx[(_Len + 0x10 - 1)/0x10 * 0x10]; };}; template struct aligned_storage<_Len, 0x20>{ struct alignas(0x20) type { unsigned char __lx[(_Len + 0x20 - 1)/0x20 * 0x20]; };}; template struct aligned_storage<_Len, 0x40>{ struct alignas(0x40) type { unsigned char __lx[(_Len + 0x40 - 1)/0x40 * 0x40]; };}; template struct aligned_storage<_Len, 0x80>{ struct alignas(0x80) type { unsigned char __lx[(_Len + 0x80 - 1)/0x80 * 0x80]; };}; template struct aligned_storage<_Len, 0x100>{ struct alignas(0x100) type { unsigned char __lx[(_Len + 0x100 - 1)/0x100 * 0x100]; };}; template struct aligned_storage<_Len, 0x200>{ struct alignas(0x200) type { unsigned char __lx[(_Len + 0x200 - 1)/0x200 * 0x200]; };}; template struct aligned_storage<_Len, 0x400>{ struct alignas(0x400) type { unsigned char __lx[(_Len + 0x400 - 1)/0x400 * 0x400]; };}; template struct aligned_storage<_Len, 0x800>{ struct alignas(0x800) type { unsigned char __lx[(_Len + 0x800 - 1)/0x800 * 0x800]; };}; template struct aligned_storage<_Len, 0x1000>{ struct alignas(0x1000) type { unsigned char __lx[(_Len + 0x1000 - 1)/0x1000 * 0x1000]; };}; template struct aligned_storage<_Len, 0x2000>{ struct alignas(0x2000) type { unsigned char __lx[(_Len + 0x2000 - 1)/0x2000 * 0x2000]; };}; // PE/COFF does not support alignment beyond 8192 (=0x2000) template struct aligned_storage<_Len, 0x4000>{ struct alignas(0x4000) type { unsigned char __lx[(_Len + 0x4000 - 1)/0x4000 * 0x4000]; };}; // aligned_union template struct __static_max; template struct __static_max<_I0> { static const size_t value = _I0; }; template struct __static_max<_I0, _I1, _In...> { static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value : __static_max<_I1, _In...>::value; }; template struct aligned_union { static const size_t alignment_value = __static_max<__alignof__(_Type0), __alignof__(_Types)...>::value; static const size_t __len = __static_max<_Len, sizeof(_Type0), sizeof(_Types)...>::value; typedef typename aligned_storage<__len, alignment_value>::type type; }; template using aligned_union_t = typename aligned_union<_Len, _Types...>::type; template struct __numeric_type { static void __test(...); static float __test(float); static double __test(char); static double __test(int); static double __test(unsigned); static double __test(long); static double __test(unsigned long); static double __test(long long); static double __test(unsigned long long); static double __test(double); static long double __test(long double); typedef decltype(__test(declval<_Tp>())) type; static const bool value = !is_same::value; }; template <> struct __numeric_type { static const bool value = true; }; // __promote template ::value && __numeric_type<_A2>::value && __numeric_type<_A3>::value> class __promote_imp { public: static const bool value = false; }; template class __promote_imp<_A1, _A2, _A3, true> { private: typedef typename __promote_imp<_A1>::type __type1; typedef typename __promote_imp<_A2>::type __type2; typedef typename __promote_imp<_A3>::type __type3; public: typedef decltype(__type1() + __type2() + __type3()) type; static const bool value = true; }; template class __promote_imp<_A1, _A2, void, true> { private: typedef typename __promote_imp<_A1>::type __type1; typedef typename __promote_imp<_A2>::type __type2; public: typedef decltype(__type1() + __type2()) type; static const bool value = true; }; template class __promote_imp<_A1, void, void, true> { public: typedef typename __numeric_type<_A1>::type type; static const bool value = true; }; template class __promote : public __promote_imp<_A1, _A2, _A3> {}; // make_signed / make_unsigned typedef __type_list > > > > __signed_types; typedef __type_list > > > > __unsigned_types; template struct __find_first; template struct __find_first<__type_list<_Hp, _Tp>, _Size, true> { typedef _Hp type; }; template struct __find_first<__type_list<_Hp, _Tp>, _Size, false> { typedef typename __find_first<_Tp, _Size>::type type; }; template ::type>::value, bool = is_volatile::type>::value> struct __apply_cv { typedef _Up type; }; template struct __apply_cv<_Tp, _Up, true, false> { typedef const _Up type; }; template struct __apply_cv<_Tp, _Up, false, true> { typedef volatile _Up type; }; template struct __apply_cv<_Tp, _Up, true, true> { typedef const volatile _Up type; }; template struct __apply_cv<_Tp&, _Up, false, false> { typedef _Up& type; }; template struct __apply_cv<_Tp&, _Up, true, false> { typedef const _Up& type; }; template struct __apply_cv<_Tp&, _Up, false, true> { typedef volatile _Up& type; }; template struct __apply_cv<_Tp&, _Up, true, true> { typedef const volatile _Up& type; }; template ::value || is_enum<_Tp>::value> struct __make_signed {}; template struct __make_signed<_Tp, true> { typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type; }; template <> struct __make_signed {}; template <> struct __make_signed< signed short, true> {typedef short type;}; template <> struct __make_signed {typedef short type;}; template <> struct __make_signed< signed int, true> {typedef int type;}; template <> struct __make_signed {typedef int type;}; template <> struct __make_signed< signed long, true> {typedef long type;}; template <> struct __make_signed {typedef long type;}; template <> struct __make_signed< signed long long, true> {typedef long long type;}; template <> struct __make_signed {typedef long long type;}; template struct make_signed { typedef typename __apply_cv<_Tp, typename __make_signed::type>::type>::type type; }; template using make_signed_t = typename make_signed<_Tp>::type; template ::value || is_enum<_Tp>::value> struct __make_unsigned {}; template struct __make_unsigned<_Tp, true> { typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type; }; template <> struct __make_unsigned {}; template <> struct __make_unsigned< signed short, true> {typedef unsigned short type;}; template <> struct __make_unsigned {typedef unsigned short type;}; template <> struct __make_unsigned< signed int, true> {typedef unsigned int type;}; template <> struct __make_unsigned {typedef unsigned int type;}; template <> struct __make_unsigned< signed long, true> {typedef unsigned long type;}; template <> struct __make_unsigned {typedef unsigned long type;}; template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;}; template <> struct __make_unsigned {typedef unsigned long long type;}; template struct make_unsigned { typedef typename __apply_cv<_Tp, typename __make_unsigned::type>::type>::type type; }; template using make_unsigned_t = typename make_unsigned<_Tp>::type; // bullet 1 - sizeof...(Tp) == 0 template struct common_type {}; // bullet 2 - sizeof...(Tp) == 1 template struct common_type<_Tp> : public common_type<_Tp, _Tp> {}; // bullet 3 - sizeof...(Tp) == 2 template struct __common_type2_imp {}; template struct __common_type2_imp<_Tp, _Up, typename __void_t() : std::__2::declval<_Up>() )>::type> { typedef typename decay() : std::__2::declval<_Up>() )>::type type; }; template ::type, class _DUp = typename decay<_Up>::type> using __common_type2 = typename conditional< is_same<_Tp, _DTp>::value && is_same<_Up, _DUp>::value, __common_type2_imp<_Tp, _Up>, common_type<_DTp, _DUp> >::type; template struct common_type<_Tp, _Up> : __common_type2<_Tp, _Up> {}; // bullet 4 - sizeof...(Tp) > 2 template struct __common_types; template struct __common_type_impl {}; template struct __common_type_impl< __common_types<_Tp, _Up>, typename __void_t::type>::type> { typedef typename common_type<_Tp, _Up>::type type; }; template struct __common_type_impl<__common_types<_Tp, _Up, _Vp...>, typename __void_t::type>::type> : __common_type_impl< __common_types::type, _Vp...> > { }; template struct common_type<_Tp, _Up, _Vp...> : __common_type_impl<__common_types<_Tp, _Up, _Vp...> > {}; template using common_type_t = typename common_type<_Tp...>::type; // is_assignable template struct __select_2nd { typedef _Tp type; }; template typename __select_2nd() = std::__2::declval<_Arg>())), true_type>::type __is_assignable_test(int); template false_type __is_assignable_test(...); template ::value || is_void<_Arg>::value> struct __is_assignable_imp : public decltype((std::__2::__is_assignable_test<_Tp, _Arg>(0))) {}; template struct __is_assignable_imp<_Tp, _Arg, true> : public false_type { }; template struct is_assignable : public __is_assignable_imp<_Tp, _Arg> {}; // is_copy_assignable template struct is_copy_assignable : public is_assignable::type, typename add_lvalue_reference::type>::type> {}; // is_move_assignable template struct is_move_assignable : public is_assignable::type, typename add_rvalue_reference<_Tp>::type> {}; // is_destructible // if it's a reference, return true // if it's a function, return false // if it's void, return false // if it's an array of unknown bound, return false // Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed // where _Up is remove_all_extents<_Tp>::type template struct __is_destructible_apply { typedef int type; }; template struct __is_destructor_wellformed { template static char __test ( typename __is_destructible_apply().~_Tp1())>::type ); template static __two __test (...); static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char); }; template struct __destructible_imp; template struct __destructible_imp<_Tp, false> : public std::__2::integral_constant::type>::value> {}; template struct __destructible_imp<_Tp, true> : public std::__2::true_type {}; template struct __destructible_false; template struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, std::__2::is_reference<_Tp>::value> {}; template struct __destructible_false<_Tp, true> : public std::__2::false_type {}; template struct is_destructible : public __destructible_false<_Tp, std::__2::is_function<_Tp>::value> {}; template struct is_destructible<_Tp[]> : public std::__2::false_type {}; template <> struct is_destructible : public std::__2::false_type {}; // move template inline __attribute__ ((__always_inline__)) constexpr typename remove_reference<_Tp>::type&& move(_Tp&& __t) noexcept { typedef typename remove_reference<_Tp>::type _Up; return static_cast<_Up&&>(__t); } template inline __attribute__ ((__always_inline__)) constexpr _Tp&& forward(typename remove_reference<_Tp>::type& __t) noexcept { return static_cast<_Tp&&>(__t); } template inline __attribute__ ((__always_inline__)) constexpr _Tp&& forward(typename remove_reference<_Tp>::type&& __t) noexcept { static_assert(!is_lvalue_reference<_Tp>::value, "can not forward an rvalue as an lvalue"); return static_cast<_Tp&&>(__t); } template inline __attribute__ ((__always_inline__)) typename decay<_Tp>::type __decay_copy(_Tp&& __t) { return std::__2::forward<_Tp>(__t); } template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false> { typedef _Class _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false> { typedef _Class const _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const, true, false> { typedef _Class const _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false> { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile, true, false> { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false> { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile, true, false> { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> { typedef _Class& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &, true, false> { typedef _Class& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false> { typedef _Class const& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&, true, false> { typedef _Class const& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false> { typedef _Class volatile& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&, true, false> { typedef _Class volatile& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false> { typedef _Class const volatile& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&, true, false> { typedef _Class const volatile& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false> { typedef _Class&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &&, true, false> { typedef _Class&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false> { typedef _Class const&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&&, true, false> { typedef _Class const&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false> { typedef _Class volatile&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&&, true, false> { typedef _Class volatile&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false> { typedef _Class const volatile&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param...); }; template struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&&, true, false> { typedef _Class const volatile&& _ClassType; typedef _Rp _ReturnType; typedef _Rp (_FnType) (_Param..., ...); }; template struct __member_pointer_traits_imp<_Rp _Class::*, false, true> { typedef _Class _ClassType; typedef _Rp _ReturnType; }; template struct __member_pointer_traits : public __member_pointer_traits_imp::type, is_member_function_pointer<_MP>::value, is_member_object_pointer<_MP>::value> { // typedef ... _ClassType; // typedef ... _ReturnType; // typedef ... _FnType; }; template struct __member_pointer_class_type {}; template struct __member_pointer_class_type<_Ret _ClassType::*> { typedef _ClassType type; }; // result_of template class result_of; // template struct is_constructible; namespace __is_construct { struct __nat {}; } template struct __libcpp_is_constructible; template struct __is_invalid_base_to_derived_cast { static_assert(is_reference<_To>::value, "Wrong specialization"); using _RawFrom = __uncvref_t<_From>; using _RawTo = __uncvref_t<_To>; static const bool value = __lazy_and< __lazy_not>, is_base_of<_RawFrom, _RawTo>, __lazy_not<__libcpp_is_constructible<_RawTo, _From>> >::value; }; template struct __is_invalid_lvalue_to_rvalue_cast : false_type { static_assert(is_reference<_To>::value, "Wrong specialization"); }; template struct __is_invalid_lvalue_to_rvalue_cast<_ToRef&&, _FromRef&> { using _RawFrom = __uncvref_t<_FromRef>; using _RawTo = __uncvref_t<_ToRef>; static const bool value = __lazy_and< __lazy_not>, __lazy_or< is_same<_RawFrom, _RawTo>, is_base_of<_RawTo, _RawFrom>> >::value; }; struct __is_constructible_helper { template static void __eat(_To); // This overload is needed to work around a Clang bug that disallows // static_cast(e) for non-reference-compatible types. // Example: static_cast(declval()); // NOTE: The static_cast implementation below is required to support // classes with explicit conversion operators. template (std::__2::declval<_From>()))> static true_type __test_cast(int); template (std::__2::declval<_From>()))> static integral_constant::value && !__is_invalid_lvalue_to_rvalue_cast<_To, _From>::value > __test_cast(long); template static false_type __test_cast(...); template ()...))> static true_type __test_nary(int); template static false_type __test_nary(...); template ()))> static is_destructible<_Tp> __test_unary(int); template static false_type __test_unary(...); }; template ::value> struct __is_default_constructible : decltype(__is_constructible_helper::__test_nary<_Tp>(0)) {}; template struct __is_default_constructible<_Tp, true> : false_type {}; template struct __is_default_constructible<_Tp[], false> : false_type {}; template struct __is_default_constructible<_Tp[_Nx], false> : __is_default_constructible::type> {}; template struct __libcpp_is_constructible { static_assert(sizeof...(_Args) > 1, "Wrong specialization"); typedef decltype(__is_constructible_helper::__test_nary<_Tp, _Args...>(0)) type; }; template struct __libcpp_is_constructible<_Tp> : __is_default_constructible<_Tp> {}; template struct __libcpp_is_constructible<_Tp, _A0> : public decltype(__is_constructible_helper::__test_unary<_Tp, _A0>(0)) {}; template struct __libcpp_is_constructible<_Tp&, _A0> : public decltype(__is_constructible_helper:: __test_cast<_Tp&, _A0>(0)) {}; template struct __libcpp_is_constructible<_Tp&&, _A0> : public decltype(__is_constructible_helper:: __test_cast<_Tp&&, _A0>(0)) {}; template struct is_constructible : public __libcpp_is_constructible<_Tp, _Args...>::type {}; // is_default_constructible template struct is_default_constructible : public is_constructible<_Tp> {}; // is_copy_constructible template struct is_copy_constructible : public is_constructible<_Tp, typename add_lvalue_reference::type>::type> {}; // is_move_constructible template struct is_move_constructible : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> {}; // is_trivially_constructible template struct is_trivially_constructible : integral_constant { }; // is_trivially_default_constructible template struct is_trivially_default_constructible : public is_trivially_constructible<_Tp> {}; // is_trivially_copy_constructible template struct is_trivially_copy_constructible : public is_trivially_constructible<_Tp, typename add_lvalue_reference::type> {}; // is_trivially_move_constructible template struct is_trivially_move_constructible : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> {}; // is_trivially_assignable template struct is_trivially_assignable : integral_constant { }; // is_trivially_copy_assignable template struct is_trivially_copy_assignable : public is_trivially_assignable::type, typename add_lvalue_reference::type>::type> {}; // is_trivially_move_assignable template struct is_trivially_move_assignable : public is_trivially_assignable::type, typename add_rvalue_reference<_Tp>::type> {}; // is_trivially_destructible template struct is_trivially_destructible : public integral_constant::value && __has_trivial_destructor(_Tp)> {}; // is_nothrow_constructible template struct __libcpp_is_nothrow_constructible; template struct __libcpp_is_nothrow_constructible : public integral_constant()...))> { }; template void __implicit_conversion_to(_Tp) noexcept { } template struct __libcpp_is_nothrow_constructible : public integral_constant(declval<_Arg>()))> { }; template struct __libcpp_is_nothrow_constructible : public false_type { }; template struct is_nothrow_constructible : __libcpp_is_nothrow_constructible::value, is_reference<_Tp>::value, _Tp, _Args...> { }; template struct is_nothrow_constructible<_Tp[_Ns]> : __libcpp_is_nothrow_constructible::value, is_reference<_Tp>::value, _Tp> { }; // is_nothrow_default_constructible template struct is_nothrow_default_constructible : public is_nothrow_constructible<_Tp> {}; // is_nothrow_copy_constructible template struct is_nothrow_copy_constructible : public is_nothrow_constructible<_Tp, typename add_lvalue_reference::type>::type> {}; // is_nothrow_move_constructible template struct is_nothrow_move_constructible : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> {}; // is_nothrow_assignable template struct __libcpp_is_nothrow_assignable; template struct __libcpp_is_nothrow_assignable : public false_type { }; template struct __libcpp_is_nothrow_assignable : public integral_constant() = std::__2::declval<_Arg>()) > { }; template struct is_nothrow_assignable : public __libcpp_is_nothrow_assignable::value, _Tp, _Arg> { }; // is_nothrow_copy_assignable template struct is_nothrow_copy_assignable : public is_nothrow_assignable::type, typename add_lvalue_reference::type>::type> {}; // is_nothrow_move_assignable template struct is_nothrow_move_assignable : public is_nothrow_assignable::type, typename add_rvalue_reference<_Tp>::type> {}; // is_nothrow_destructible template struct __libcpp_is_nothrow_destructible; template struct __libcpp_is_nothrow_destructible : public false_type { }; template struct __libcpp_is_nothrow_destructible : public integral_constant().~_Tp()) > { }; template struct is_nothrow_destructible : public __libcpp_is_nothrow_destructible::value, _Tp> { }; template struct is_nothrow_destructible<_Tp[_Ns]> : public is_nothrow_destructible<_Tp> { }; template struct is_nothrow_destructible<_Tp&> : public true_type { }; template struct is_nothrow_destructible<_Tp&&> : public true_type { }; // is_pod template struct is_pod : public integral_constant {}; // is_literal_type; template struct is_literal_type : public integral_constant {}; // is_standard_layout; template struct is_standard_layout : public integral_constant {}; // is_trivially_copyable; template struct is_trivially_copyable : public integral_constant {}; // is_trivial; template struct is_trivial : public integral_constant {}; template struct __is_reference_wrapper_impl : public false_type {}; template struct __is_reference_wrapper_impl > : public true_type {}; template struct __is_reference_wrapper : public __is_reference_wrapper_impl::type> {}; // Check for complete types template struct __check_complete; template <> struct __check_complete<> { }; template struct __check_complete<_Hp, _T0, _Tp...> : private __check_complete<_Hp>, private __check_complete<_T0, _Tp...> { }; template struct __check_complete<_Hp, _Hp> : private __check_complete<_Hp> { }; template struct __check_complete<_Tp> { static_assert(sizeof(_Tp) > 0, "Type must be complete."); }; template struct __check_complete<_Tp&> : private __check_complete<_Tp> { }; template struct __check_complete<_Tp&&> : private __check_complete<_Tp> { }; template struct __check_complete<_Rp (*)(_Param...)> : private __check_complete<_Rp> { }; template struct __check_complete { }; template struct __check_complete<_Rp (_Param...)> : private __check_complete<_Rp> { }; template struct __check_complete { }; template struct __check_complete<_Rp (_Class::*)(_Param...)> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) const> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) volatile> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) const volatile> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) &> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) const&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) volatile&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) &&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) const&&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&> : private __check_complete<_Class> { }; template struct __check_complete<_Rp _Class::*> : private __check_complete<_Class> { }; template ::type, class _DecayA0 = typename decay<_A0>::type, class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> using __enable_if_bullet1 = typename enable_if < is_member_function_pointer<_DecayFp>::value && is_base_of<_ClassT, _DecayA0>::value >::type; template ::type, class _DecayA0 = typename decay<_A0>::type> using __enable_if_bullet2 = typename enable_if < is_member_function_pointer<_DecayFp>::value && __is_reference_wrapper<_DecayA0>::value >::type; template ::type, class _DecayA0 = typename decay<_A0>::type, class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> using __enable_if_bullet3 = typename enable_if < is_member_function_pointer<_DecayFp>::value && !is_base_of<_ClassT, _DecayA0>::value && !__is_reference_wrapper<_DecayA0>::value >::type; template ::type, class _DecayA0 = typename decay<_A0>::type, class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> using __enable_if_bullet4 = typename enable_if < is_member_object_pointer<_DecayFp>::value && is_base_of<_ClassT, _DecayA0>::value >::type; template ::type, class _DecayA0 = typename decay<_A0>::type> using __enable_if_bullet5 = typename enable_if < is_member_object_pointer<_DecayFp>::value && __is_reference_wrapper<_DecayA0>::value >::type; template ::type, class _DecayA0 = typename decay<_A0>::type, class _ClassT = typename __member_pointer_class_type<_DecayFp>::type> using __enable_if_bullet6 = typename enable_if < is_member_object_pointer<_DecayFp>::value && !is_base_of<_ClassT, _DecayA0>::value && !__is_reference_wrapper<_DecayA0>::value >::type; // __invoke forward declarations // fall back - none of the bullets template auto __invoke(__any, _Args&& ...__args) -> __nat; template auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat; // bullets 1, 2 and 3 template > inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) noexcept(noexcept((std::__2::forward<_A0>(__a0).*__f)(std::__2::forward<_Args>(__args)...))) -> decltype((std::__2::forward<_A0>(__a0).*__f)(std::__2::forward<_Args>(__args)...)) { return (std::__2::forward<_A0>(__a0).*__f)(std::__2::forward<_Args>(__args)...); } template > inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args) noexcept(noexcept((std::__2::forward<_A0>(__a0).*__f)(std::__2::forward<_Args>(__args)...))) -> decltype((std::__2::forward<_A0>(__a0).*__f)(std::__2::forward<_Args>(__args)...)) { return (std::__2::forward<_A0>(__a0).*__f)(std::__2::forward<_Args>(__args)...); } template > inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) noexcept(noexcept((__a0 . get().*__f)(std::__2::forward<_Args>(__args)...))) -> decltype((__a0 . get().*__f)(std::__2::forward<_Args>(__args)...)) { return (__a0 . get().*__f)(std::__2::forward<_Args>(__args)...); } template > inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args) noexcept(noexcept((__a0 . get().*__f)(std::__2::forward<_Args>(__args)...))) -> decltype((__a0 . get().*__f)(std::__2::forward<_Args>(__args)...)) { return (__a0 . get().*__f)(std::__2::forward<_Args>(__args)...); } template > inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) noexcept(noexcept(((*std::__2::forward<_A0>(__a0)).*__f)(std::__2::forward<_Args>(__args)...))) -> decltype(((*std::__2::forward<_A0>(__a0)).*__f)(std::__2::forward<_Args>(__args)...)) { return ((*std::__2::forward<_A0>(__a0)).*__f)(std::__2::forward<_Args>(__args)...); } template > inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args) noexcept(noexcept(((*std::__2::forward<_A0>(__a0)).*__f)(std::__2::forward<_Args>(__args)...))) -> decltype(((*std::__2::forward<_A0>(__a0)).*__f)(std::__2::forward<_Args>(__args)...)) { return ((*std::__2::forward<_A0>(__a0)).*__f)(std::__2::forward<_Args>(__args)...); } // bullets 4, 5 and 6 template > inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _A0&& __a0) noexcept(noexcept(std::__2::forward<_A0>(__a0).*__f)) -> decltype(std::__2::forward<_A0>(__a0).*__f) { return std::__2::forward<_A0>(__a0).*__f; } template > inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _A0&& __a0) noexcept(noexcept(std::__2::forward<_A0>(__a0).*__f)) -> decltype(std::__2::forward<_A0>(__a0).*__f) { return std::__2::forward<_A0>(__a0).*__f; } template > inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _A0&& __a0) noexcept(noexcept(__a0 . get().*__f)) -> decltype(__a0 . get().*__f) { return __a0 . get().*__f; } template > inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _A0&& __a0) noexcept(noexcept(__a0 . get().*__f)) -> decltype(__a0 . get().*__f) { return __a0 . get().*__f; } template > inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _A0&& __a0) noexcept(noexcept((*std::__2::forward<_A0>(__a0)).*__f)) -> decltype((*std::__2::forward<_A0>(__a0)).*__f) { return (*std::__2::forward<_A0>(__a0)).*__f; } template > inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _A0&& __a0) noexcept(noexcept((*std::__2::forward<_A0>(__a0)).*__f)) -> decltype((*std::__2::forward<_A0>(__a0)).*__f) { return (*std::__2::forward<_A0>(__a0)).*__f; } // bullet 7 template inline __attribute__ ((__always_inline__)) auto __invoke(_Fp&& __f, _Args&& ...__args) noexcept(noexcept(std::__2::forward<_Fp>(__f)(std::__2::forward<_Args>(__args)...))) -> decltype(std::__2::forward<_Fp>(__f)(std::__2::forward<_Args>(__args)...)) { return std::__2::forward<_Fp>(__f)(std::__2::forward<_Args>(__args)...); } template inline __attribute__ ((__always_inline__)) constexpr auto __invoke_constexpr(_Fp&& __f, _Args&& ...__args) noexcept(noexcept(std::__2::forward<_Fp>(__f)(std::__2::forward<_Args>(__args)...))) -> decltype(std::__2::forward<_Fp>(__f)(std::__2::forward<_Args>(__args)...)) { return std::__2::forward<_Fp>(__f)(std::__2::forward<_Args>(__args)...); } // __invokable template struct __invokable_r : private __check_complete<_Fp> { using _Result = decltype( std::__2::__invoke(std::__2::declval<_Fp>(), std::__2::declval<_Args>()...)); using type = typename conditional< !is_same<_Result, __nat>::value, typename conditional< is_void<_Ret>::value, true_type, is_convertible<_Result, _Ret> >::type, false_type >::type; static const bool value = type::value; }; template using __invokable = __invokable_r; template struct __nothrow_invokable_r_imp { static const bool value = false; }; template struct __nothrow_invokable_r_imp { typedef __nothrow_invokable_r_imp _ThisT; template static void __test_noexcept(_Tp) noexcept; static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>( std::__2::__invoke(std::__2::declval<_Fp>(), std::__2::declval<_Args>()...))); }; template struct __nothrow_invokable_r_imp { static const bool value = noexcept( std::__2::__invoke(std::__2::declval<_Fp>(), std::__2::declval<_Args>()...)); }; template using __nothrow_invokable_r = __nothrow_invokable_r_imp< __invokable_r<_Ret, _Fp, _Args...>::value, is_void<_Ret>::value, _Ret, _Fp, _Args... >; template struct __invoke_of : public enable_if< __invokable<_Fp, _Args...>::value, typename __invokable_r::_Result> { }; // result_of template class result_of<_Fp(_Args...)> : public __invoke_of<_Fp, _Args...> { }; template using result_of_t = typename result_of<_Tp>::type; template struct __is_swappable; template struct __is_nothrow_swappable; template inline __attribute__ ((__always_inline__)) typename enable_if < is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value >::type swap(_Tp& __x, _Tp& __y) noexcept(is_nothrow_move_constructible<_Tp> ::value && is_nothrow_move_assignable<_Tp> ::value) { _Tp __t(std::__2::move(__x)); __x = std::__2::move(__y); __y = std::__2::move(__t); } template inline __attribute__ ((__always_inline__)) typename enable_if< __is_swappable<_Tp>::value >::type swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) noexcept(__is_nothrow_swappable<_Tp> ::value); template inline __attribute__ ((__always_inline__)) void iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) // _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b))) noexcept(noexcept(swap(*std::__2::declval<_ForwardIterator1>(), *std::__2::declval<_ForwardIterator2>()))) { swap(*__a, *__b); } // __swappable namespace __detail { // ALL generic swap overloads MUST already have a declaration available at this point. template ::value && !is_void<_Up>::value> struct __swappable_with { template static decltype(swap(std::__2::declval<_LHS>(), std::__2::declval<_RHS>())) __test_swap(int); template static __nat __test_swap(long); // Extra parens are needed for the C++03 definition of decltype. typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1; typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2; static const bool value = !is_same<__swap1, __nat>::value && !is_same<__swap2, __nat>::value; }; template struct __swappable_with<_Tp, _Up, false> : false_type {}; template ::value> struct __nothrow_swappable_with { static const bool value = noexcept(swap(std::__2::declval<_Tp>(), std::__2::declval<_Up>())) && noexcept(swap(std::__2::declval<_Up>(), std::__2::declval<_Tp>())); }; template struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {}; } // __detail template struct __is_swappable : public integral_constant::value> { }; template struct __is_nothrow_swappable : public integral_constant::value> { }; template struct underlying_type { typedef __underlying_type(_Tp) type; }; template using underlying_type_t = typename underlying_type<_Tp>::type; template ::value> struct __sfinae_underlying_type { typedef typename underlying_type<_Tp>::type type; typedef decltype(((type)1) + 0) __promoted_type; }; template struct __sfinae_underlying_type<_Tp, false> {}; inline __attribute__ ((__always_inline__)) int __convert_to_integral(int __val) { return __val; } inline __attribute__ ((__always_inline__)) unsigned __convert_to_integral(unsigned __val) { return __val; } inline __attribute__ ((__always_inline__)) long __convert_to_integral(long __val) { return __val; } inline __attribute__ ((__always_inline__)) unsigned long __convert_to_integral(unsigned long __val) { return __val; } inline __attribute__ ((__always_inline__)) long long __convert_to_integral(long long __val) { return __val; } inline __attribute__ ((__always_inline__)) unsigned long long __convert_to_integral(unsigned long long __val) {return __val; } template inline __attribute__ ((__always_inline__)) typename __sfinae_underlying_type<_Tp>::__promoted_type __convert_to_integral(_Tp __val) { return __val; } template struct __has_operator_addressof_member_imp { template static auto __test(int) -> typename __select_2nd().operator&()), true_type>::type; template static auto __test(long) -> false_type; static const bool value = decltype(__test<_Tp>(0))::value; }; template struct __has_operator_addressof_free_imp { template static auto __test(int) -> typename __select_2nd())), true_type>::type; template static auto __test(long) -> false_type; static const bool value = decltype(__test<_Tp>(0))::value; }; template struct __has_operator_addressof : public integral_constant::value || __has_operator_addressof_free_imp<_Tp>::value> {}; // These traits are used in __tree and __hash_table struct __extract_key_fail_tag {}; struct __extract_key_self_tag {}; struct __extract_key_first_tag {}; template ::type> struct __can_extract_key : conditional::value, __extract_key_self_tag, __extract_key_fail_tag>::type {}; template struct __can_extract_key<_Pair, _Key, pair<_First, _Second>> : conditional::type, _Key>::value, __extract_key_first_tag, __extract_key_fail_tag>::type {}; // __can_extract_map_key uses true_type/false_type instead of the tags. // It returns true if _Key != _ContainerValueTy (the container is a map not a set) // and _ValTy == _Key. template ::type> struct __can_extract_map_key : integral_constant::value> {}; // This specialization returns __extract_key_fail_tag for non-map containers // because _Key == _ContainerValueTy template struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy> : false_type {}; } } // -*- C++ -*- //===-------------------------- typeinfo ----------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* typeinfo synopsis namespace std { class type_info { public: virtual ~type_info(); bool operator==(const type_info& rhs) const noexcept; bool operator!=(const type_info& rhs) const noexcept; bool before(const type_info& rhs) const noexcept; size_t hash_code() const noexcept; const char* name() const noexcept; type_info(const type_info& rhs) = delete; type_info& operator=(const type_info& rhs) = delete; }; class bad_cast : public exception { public: bad_cast() noexcept; bad_cast(const bad_cast&) noexcept; bad_cast& operator=(const bad_cast&) noexcept; virtual const char* what() const noexcept; }; class bad_typeid : public exception { public: bad_typeid() noexcept; bad_typeid(const bad_typeid&) noexcept; bad_typeid& operator=(const bad_typeid&) noexcept; virtual const char* what() const noexcept; }; } // std */ // -*- C++ -*- //===-------------------------- exception ---------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* exception synopsis namespace std { class exception { public: exception() noexcept; exception(const exception&) noexcept; exception& operator=(const exception&) noexcept; virtual ~exception() noexcept; virtual const char* what() const noexcept; }; class bad_exception : public exception { public: bad_exception() noexcept; bad_exception(const bad_exception&) noexcept; bad_exception& operator=(const bad_exception&) noexcept; virtual ~bad_exception() noexcept; virtual const char* what() const noexcept; }; typedef void (*unexpected_handler)(); unexpected_handler set_unexpected(unexpected_handler f ) noexcept; unexpected_handler get_unexpected() noexcept; [[noreturn]] void unexpected(); typedef void (*terminate_handler)(); terminate_handler set_terminate(terminate_handler f ) noexcept; terminate_handler get_terminate() noexcept; [[noreturn]] void terminate() noexcept; bool uncaught_exception() noexcept; int uncaught_exceptions() noexcept; // C++17 typedef unspecified exception_ptr; exception_ptr current_exception() noexcept; void rethrow_exception [[noreturn]] (exception_ptr p); template exception_ptr make_exception_ptr(E e) noexcept; class nested_exception { public: nested_exception() noexcept; nested_exception(const nested_exception&) noexcept = default; nested_exception& operator=(const nested_exception&) noexcept = default; virtual ~nested_exception() = default; // access functions [[noreturn]] void rethrow_nested() const; exception_ptr nested_ptr() const noexcept; }; template [[noreturn]] void throw_with_nested(T&& t); template void rethrow_if_nested(const E& e); } // std */ // -*- C++ -*- //===--------------------------- cstdlib ----------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* cstdlib synopsis Macros: EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX namespace std { Types: size_t div_t ldiv_t lldiv_t // C99 double atof (const char* nptr); int atoi (const char* nptr); long atol (const char* nptr); long long atoll(const char* nptr); // C99 double strtod (const char* restrict nptr, char** restrict endptr); float strtof (const char* restrict nptr, char** restrict endptr); // C99 long double strtold (const char* restrict nptr, char** restrict endptr); // C99 long strtol (const char* restrict nptr, char** restrict endptr, int base); long long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99 unsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base); unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99 int rand(void); void srand(unsigned int seed); void* calloc(size_t nmemb, size_t size); void free(void* ptr); void* malloc(size_t size); void* realloc(void* ptr, size_t size); void abort(void); int atexit(void (*func)(void)); void exit(int status); void _Exit(int status); char* getenv(const char* name); int system(const char* string); void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); void qsort(void* base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); int abs( int j); long abs( long j); long long abs(long long j); // C++0X long labs( long j); long long llabs(long long j); // C99 div_t div( int numer, int denom); ldiv_t div( long numer, long denom); lldiv_t div(long long numer, long long denom); // C++0X ldiv_t ldiv( long numer, long denom); lldiv_t lldiv(long long numer, long long denom); // C99 int mblen(const char* s, size_t n); int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n); int wctomb(char* s, wchar_t wchar); size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n); size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); int at_quick_exit(void (*func)(void)) // C++11 void quick_exit(int status); // C++11 void *aligned_alloc(size_t alignment, size_t size); // C11 } // std */ /* -*- C++ -*- */ /*===--------------------------- complex.h --------------------------------===*/ /* */ /* The LLVM Compiler Infrastructure */ /* */ /* This file is dual licensed under the MIT and the University of Illinois Open ** Source Licenses. See LICENSE.TXT for details. */ /*===----------------------------------------------------------------------===*/ /* stdlib.h synopsis Macros: EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX Types: size_t div_t ldiv_t lldiv_t // C99 double atof (const char* nptr); int atoi (const char* nptr); long atol (const char* nptr); long long atoll(const char* nptr); // C99 double strtod (const char* restrict nptr, char** restrict endptr); float strtof (const char* restrict nptr, char** restrict endptr); // C99 long double strtold (const char* restrict nptr, char** restrict endptr); // C99 long strtol (const char* restrict nptr, char** restrict endptr, int base); long long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99 unsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base); unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99 int rand(void); void srand(unsigned int seed); void* calloc(size_t nmemb, size_t size); void free(void* ptr); void* malloc(size_t size); void* realloc(void* ptr, size_t size); void abort(void); int atexit(void (*func)(void)); void exit(int status); void _Exit(int status); char* getenv(const char* name); int system(const char* string); void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); void qsort(void* base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); int abs( int j); long abs( long j); long long abs(long long j); // C++0X long labs( long j); long long llabs(long long j); // C99 div_t div( int numer, int denom); ldiv_t div( long numer, long denom); lldiv_t div(long long numer, long long denom); // C++0X ldiv_t ldiv( long numer, long denom); lldiv_t lldiv(long long numer, long long denom); // C99 int mblen(const char* s, size_t n); int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n); int wctomb(char* s, wchar_t wchar); size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n); size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); int at_quick_exit(void (*func)(void)) // C++11 void quick_exit(int status); // C++11 void *aligned_alloc(size_t alignment, size_t size); // C11 */ #pragma GCC system_header /*****************************************************************************/ /* stdlib.h */ /* */ /* Copyright (c) 1993 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-8.5") /* need to define inline function */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.7") /* need function-like macros */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ /*---------------------------------------------------------------------------*/ /* Attributes are only available in relaxed ANSI mode. */ /*---------------------------------------------------------------------------*/ extern "C" { #pragma diag_push #pragma CHECK_MISRA("-5.7") /* keep names intact */ typedef struct { int quot, rem; } div_t; typedef struct { int quot, rem; } ldiv_t; typedef struct { long long quot, rem; } lldiv_t; #pragma diag_pop /*****************************************************************************/ /* _ti_config.h */ /* */ /* Copyright (c) 2017 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma CHECK_MISRA("-19.1") /* Common definitions */ /* C++ */ /* C++11 */ /* _TI_NOEXCEPT_CPP14 is defined to noexcept only when compiling for C++14. It is intended to be used for functions like abort and atexit that are supposed to be declared noexcept only in C++14 mode. */ /* Target-specific definitions */ /*****************************************************************************/ /* linkage.h */ /* */ /* Copyright (c) 1998 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ /* No modifiers are needed to access code or data */ /*--------------------------------------------------------------------------*/ /* Define _IDECL ==> how inline functions are declared */ /*--------------------------------------------------------------------------*/ #pragma diag_pop #pragma diag_pop /*---------------------------------------------------------------*/ /* NOTE - Normally, abs, labs, and fabs are expanded inline, so */ /* no formal definition is really required. However, ANSI */ /* requires that they exist as separate functions, so */ /* they are supplied in the library. The prototype is */ /* here mainly for documentation. */ /*---------------------------------------------------------------*/ #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ int abs(int _val); long labs(long _val); long long llabs(long long _val); #pragma diag_pop int atoi(const char *_st); long atol(const char *_st); long long atoll(const char *_st); int ltoa(long val, char *buffer); static __inline double atof(const char *_st); long strtol(const char * __restrict _st, char ** __restrict _endptr, int _base); unsigned long strtoul(const char * __restrict _st, char ** __restrict _endptr, int _base); long long strtoll(const char * __restrict _st, char ** __restrict _endptr, int _base); unsigned long long strtoull(const char * __restrict _st, char ** __restrict _endptr, int _base); float strtof(const char * __restrict _st, char ** __restrict _endptr); double strtod(const char * __restrict _st, char ** __restrict _endptr); long double strtold(const char * __restrict _st, char ** __restrict _endptr); int rand(void); void srand(unsigned _seed); void *calloc(size_t _num, size_t _size) __attribute__((malloc)); void *malloc(size_t _size) __attribute__((malloc)); void *realloc(void *_ptr, size_t _size) __attribute__((malloc)); void free(void *_ptr); void *memalign(size_t _aln, size_t _size) __attribute__((malloc)); [[noreturn]] void abort(void) noexcept; typedef void (*__TI_atexit_fn)(void); int atexit(__TI_atexit_fn _func) noexcept; typedef int (*__TI_compar_fn)(const void *_a,const void *_b); void *bsearch(const void *_key, const void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); void qsort(void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); [[noreturn]] void exit(int _status); [[noreturn]] void _Exit(int _status); div_t div(int _numer, int _denom); ldiv_t ldiv(long _numer, long _denom); lldiv_t lldiv(long long _numer, long long _denom); char *getenv(const char *_string); int system(const char *_name); int mblen(const char *_s, size_t _n); size_t mbstowcs(wchar_t * __restrict _dest, const char * __restrict _src, size_t _n); int mbtowc(wchar_t * __restrict _dest, const char * __restrict _src, size_t _n); size_t wcstombs(char * __restrict _dest, const wchar_t * __restrict _src, size_t _n); int wctomb(char *_s, wchar_t _wc); } /* extern "C" */ static __inline double atof(const char *_st) { return strtod(_st, (char **)0); } /*****************************************************************************/ /* If we leave these active when in relaxed ANSI mode, we get infinite */ /* recursion due to changes in type matching. See comment in */ /* ansi/sys_predef.c line 4377 on why we specifically check the */ /* __TI_STRICT_ANSI_MODE__ macro here and its relation to strict ANSI and */ /* relaxed ANSI parser modes. */ /*****************************************************************************/ #pragma diag_pop #pragma diag_push /* C2000-specific additions to header implemented with #include */ #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.15") /*----------------------------------------------------------------------------*/ /* If sys/cdefs.h is available, go ahead and include it. xlocale.h assumes */ /* this file will have already included sys/cdefs.h. */ /*----------------------------------------------------------------------------*/ /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Berkeley Software Design, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 * $FreeBSD$ */ #pragma diag_push #pragma CHECK_MISRA("none") /* * Testing against Clang-specific extensions. */ /* * This code has been put in place to help reduce the addition of * compiler specific defines in FreeBSD code. It helps to aid in * having a compiler-agnostic source tree. */ /* * Macro to test if we're using a specific version of gcc or later. */ /* * The __CONCAT macro is used to concatenate parts of symbol names, e.g. * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI * mode -- there must be no spaces between its arguments, and for nested * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also * concatenate double-quoted strings produced by the __STRING macro, but * this only works with ANSI C. * * __XSTRING is like __STRING, but it expands any macros in its argument * first. It is only available with ANSI C. */ /* * Compiler-dependent macros to help declare dead (non-returning) and * pure (no side effects) functions, and unused variables. They are * null except for versions of gcc that are known to support the features * properly (old versions of gcc-2 supported the dead and pure features * in a different (wrong) way). If we do not provide an implementation * for a given compiler, let the compile fail if it is told to use * a feature that we cannot live without. */ /* * TI ADD - check that __GNUC__ is defined before referencing it to avoid * generating an error when __GNUC__ treated as zero warning is * promoted to an error via -pdse195 option. */ /* * Keywords added in C11. */ /* * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode * without actually supporting the thread_local keyword. Don't check for * the presence of C++11 when defining _Thread_local. */ /* * Emulation of C11 _Generic(). Unlike the previously defined C11 * keywords, it is not possible to implement this using exactly the same * syntax. Therefore implement something similar under the name * __generic(). Unlike _Generic(), this macro can only distinguish * between a single type, so it requires nested invocations to * distinguish multiple cases. */ /* * C99 Static array indices in function parameter declarations. Syntax such as: * void bar(int myArray[static 10]); * is allowed in C99 but not in C++. Define __min_size appropriately so * headers using it can be compiled in either language. Use like this: * void bar(int myArray[__min_size(10)]); */ /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ /* C++11 exposes a load of C99 stuff */ /* * GCC 2.95 provides `__restrict' as an extension to C90 to support the * C99-specific `restrict' type qualifier. We happen to use `__restrict' as * a way to define the `restrict' type qualifier without disturbing older * software that is unaware of C99 keywords. * The TI compiler supports __restrict in all compilation modes. */ /* * GNU C version 2.96 adds explicit branch prediction so that * the CPU back-end can hint the processor and also so that * code blocks can be reordered such that the predicted path * sees a more linear flow, thus improving cache behavior, etc. * * The following two macros provide us with a way to utilize this * compiler feature. Use __predict_true() if you expect the expression * to evaluate to true, and __predict_false() if you expect the * expression to evaluate to false. * * A few notes about usage: * * * Generally, __predict_false() error condition checks (unless * you have some _strong_ reason to do otherwise, in which case * document it), and/or __predict_true() `no-error' condition * checks, assuming you want to optimize for the no-error case. * * * Other than that, if you don't know the likelihood of a test * succeeding from empirical or other `hard' evidence, don't * make predictions. * * * These are meant to be used in places that are run `a lot'. * It is wasteful to make predictions in code that is run * seldomly (e.g. at subsystem initialization time) as the * basic block reordering that this affects can often generate * larger code. */ /* * We define this here since , , and * require it. */ /* * Given the pointer x to the member m of the struct s, return * a pointer to the containing structure. When using GCC, we first * assign pointer x to a local variable, to check that its type is * compatible with member m. */ /* * Compiler-dependent macros to declare that functions take printf-like * or scanf-like arguments. They are null except for versions of gcc * that are known to support the features properly (old versions of gcc-2 * didn't permit keeping the keywords out of the application namespace). */ /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ /* * The following definition might not work well if used in header files, * but it should be better than nothing. If you want a "do nothing" * version, then it should generate some harmless declaration, such as: * #define __IDSTRING(name,string) struct __hack */ /* * Embed the rcs id of a source file in the resulting library. Note that in * more recent ELF binutils, we use .ident allowing the ID to be stripped. * Usage: * __FBSDID("$FreeBSD$"); */ /*- * The following definitions are an extension of the behavior originally * implemented in , but with a different level of granularity. * POSIX.1 requires that the macros we test be defined before any standard * header file is included. * * Here's a quick run-down of the versions: * defined(_POSIX_SOURCE) 1003.1-1988 * _POSIX_C_SOURCE == 1 1003.1-1990 * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option * _POSIX_C_SOURCE == 199309 1003.1b-1993 * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, * and the omnibus ISO/IEC 9945-1: 1996 * _POSIX_C_SOURCE == 200112 1003.1-2001 * _POSIX_C_SOURCE == 200809 1003.1-2008 * * In addition, the X/Open Portability Guide, which is now the Single UNIX * Specification, defines a feature-test macro which indicates the version of * that specification, and which subsumes _POSIX_C_SOURCE. * * Our macros begin with two underscores to avoid namespace screwage. */ /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ /* Deal with various X/Open Portability Guides and Single UNIX Spec. */ /* * Deal with all versions of POSIX. The ordering relative to the tests above is * important. */ /*- * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly * requested, then define our internal feature-test macros to zero. This * makes no difference to the preprocessor (undefined symbols in preprocessing * expressions are defined to have value zero), but makes it more convenient for * a test program to print out the values. * * If a program mistakenly defines _ANSI_SOURCE and some other macro such as * _POSIX_C_SOURCE, we will assume that it wants the broader compilation * environment (and in fact we will never get here). */ /* User override __EXT1_VISIBLE */ /* * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. */ /* * Nullability qualifiers: currently only supported by Clang. */ /* * Type Safety Checking * * Clang provides additional attributes to enable checking type safety * properties that cannot be enforced by the C type system. */ /* * Lock annotations. * * Clang provides support for doing basic thread-safety tests at * compile-time, by marking which locks will/should be held when * entering/leaving a functions. * * Furthermore, it is also possible to annotate variables and structure * members to enforce that they are only accessed when certain locks are * held. */ /* Structure implements a lock. */ /* Function acquires an exclusive or shared lock. */ /* Function attempts to acquire an exclusive or shared lock. */ /* Function releases a lock. */ /* Function asserts that an exclusive or shared lock is held. */ /* Function requires that an exclusive or shared lock is or is not held. */ /* Function should not be analyzed. */ /* Guard variables and structure members by lock. */ #pragma diag_pop /*----------------------------------------------------------------------------*/ /* Include xlocale/_stdlib.h if xlocale.h has already been included. This */ /* comes from FreeBSD's stdlib.h. */ /*----------------------------------------------------------------------------*/ #pragma diag_pop extern "C++" { /* MSVCRT already has the correct prototype in if __cplusplus is defined */ inline __attribute__ ((__always_inline__)) long abs( long __x) noexcept {return labs(__x);} inline __attribute__ ((__always_inline__)) long long abs(long long __x) noexcept {return llabs(__x);} inline __attribute__ ((__always_inline__)) ldiv_t div( long __x, long __y) noexcept {return ldiv(__x, __y);} inline __attribute__ ((__always_inline__)) lldiv_t div(long long __x, long long __y) noexcept {return lldiv(__x, __y);} } /* extern "C++" */ #pragma GCC system_header namespace std { inline namespace __2 { using ::size_t; using ::div_t; using ::ldiv_t; using ::lldiv_t; using ::atof; using ::atoi; using ::atol; using ::atoll; using ::strtod; using ::strtof; using ::strtold; using ::strtol; using ::strtoll; using ::strtoul; using ::strtoull; using ::rand; using ::srand; using ::calloc; using ::free; using ::malloc; using ::realloc; using ::abort; using ::atexit; using ::exit; using ::_Exit; using ::getenv; using ::system; using ::bsearch; using ::qsort; using ::abs; using ::labs; using ::llabs; using ::div; using ::ldiv; using ::lldiv; using ::mblen; using ::mbtowc; using ::wctomb; using ::mbstowcs; using ::wcstombs; } } #pragma GCC system_header namespace std // purposefully not using versioning namespace { class exception { public: __attribute__ ((__always_inline__)) exception() noexcept {} virtual ~exception() noexcept; virtual const char* what() const noexcept; }; class bad_exception : public exception { public: __attribute__ ((__always_inline__)) bad_exception() noexcept {} virtual ~bad_exception() noexcept; virtual const char* what() const noexcept; }; typedef void (*unexpected_handler)(); unexpected_handler set_unexpected(unexpected_handler) noexcept; unexpected_handler get_unexpected() noexcept; [[noreturn]] void unexpected(); typedef void (*terminate_handler)(); terminate_handler set_terminate(terminate_handler) noexcept; terminate_handler get_terminate() noexcept; [[noreturn]] void terminate() noexcept; bool uncaught_exception() noexcept; int uncaught_exceptions() noexcept; class exception_ptr; exception_ptr current_exception() noexcept; [[noreturn]] void rethrow_exception(exception_ptr); class exception_ptr { void* __ptr_; public: __attribute__ ((__always_inline__)) exception_ptr() noexcept : __ptr_() {} __attribute__ ((__always_inline__)) exception_ptr(nullptr_t) noexcept : __ptr_() {} exception_ptr(const exception_ptr&) noexcept; exception_ptr& operator=(const exception_ptr&) noexcept; ~exception_ptr() noexcept; __attribute__ ((__always_inline__)) explicit operator bool() const noexcept {return __ptr_ != nullptr;} friend __attribute__ ((__always_inline__)) bool operator==(const exception_ptr& __x, const exception_ptr& __y) noexcept {return __x.__ptr_ == __y.__ptr_;} friend __attribute__ ((__always_inline__)) bool operator!=(const exception_ptr& __x, const exception_ptr& __y) noexcept {return !(__x == __y);} friend exception_ptr current_exception() noexcept; friend void rethrow_exception(exception_ptr); }; template exception_ptr make_exception_ptr(_Ep __e) noexcept { ((void)__e); std::__2::abort(); } // nested_exception class nested_exception { exception_ptr __ptr_; public: nested_exception() noexcept; // nested_exception(const nested_exception&) noexcept = default; // nested_exception& operator=(const nested_exception&) noexcept = default; virtual ~nested_exception() noexcept; // access functions [[noreturn]] void rethrow_nested() const; __attribute__ ((__always_inline__)) exception_ptr nested_ptr() const noexcept {return __ptr_;} }; template struct __nested : public _Tp, public nested_exception { __attribute__ ((__always_inline__)) explicit __nested(const _Tp& __t) : _Tp(__t) {} }; template [[noreturn]] void throw_with_nested(_Tp&& __t) { ((void)__t); // FIXME: Make this abort } template struct __can_dynamic_cast : public integral_constant ::value && (!is_base_of<_To, _From> ::value || is_convertible ::value))> {}; template inline __attribute__ ((__always_inline__)) void rethrow_if_nested(const _Ep& __e, typename enable_if< __can_dynamic_cast<_Ep, nested_exception>::value>::type* = 0) { const nested_exception* __nep = dynamic_cast(std::__2::addressof(__e)); if (__nep) __nep->rethrow_nested(); } template inline __attribute__ ((__always_inline__)) void rethrow_if_nested(const _Ep&, typename enable_if::value>::type* = 0) { } } // std // -*- C++ -*- //===--------------------------- cstdint ----------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* cstdint synopsis Macros: INT8_MIN INT16_MIN INT32_MIN INT64_MIN INT8_MAX INT16_MAX INT32_MAX INT64_MAX UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX INTPTR_MIN INTPTR_MAX UINTPTR_MAX INTMAX_MIN INTMAX_MAX UINTMAX_MAX PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX INT8_C(value) INT16_C(value) INT32_C(value) INT64_C(value) UINT8_C(value) UINT16_C(value) UINT32_C(value) UINT64_C(value) INTMAX_C(value) UINTMAX_C(value) namespace std { Types: int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t int_least8_t int_least16_t int_least32_t int_least64_t uint_least8_t uint_least16_t uint_least32_t uint_least64_t int_fast8_t int_fast16_t int_fast32_t int_fast64_t uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t intptr_t uintptr_t intmax_t uintmax_t } // std */ /* -*- C++ -*- */ /*===--------------------------- complex.h --------------------------------===*/ /* */ /* The LLVM Compiler Infrastructure */ /* */ /* This file is dual licensed under the MIT and the University of Illinois Open ** Source Licenses. See LICENSE.TXT for details. */ /*===----------------------------------------------------------------------===*/ /* stdint.h synopsis Macros: INT8_MIN INT16_MIN INT32_MIN INT64_MIN INT8_MAX INT16_MAX INT32_MAX INT64_MAX UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX INTPTR_MIN INTPTR_MAX UINTPTR_MAX INTMAX_MIN INTMAX_MAX UINTMAX_MAX PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX INT8_C(value) INT16_C(value) INT32_C(value) INT64_C(value) UINT8_C(value) UINT16_C(value) UINT32_C(value) UINT64_C(value) INTMAX_C(value) UINTMAX_C(value) */ #pragma GCC system_header /* C99 stdlib (e.g. glibc < 2.18) does not provide macros needed for C++11 unless __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined */ /*****************************************************************************/ /* STDINT.H */ /* */ /* Copyright (c) 2002 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2001 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2002 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 2002 Mike Barcroft * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 * $FreeBSD$ */ #pragma diag_push /* This file is required to use base types */ #pragma CHECK_MISRA("-6.3") /* * Basic types upon which most other types are built. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; /* LONGLONG */ typedef long long __int64_t; /* LONGLONG */ typedef unsigned long long __uint64_t; /* * Standard type definitions. */ typedef __uint32_t __clock_t; /* clock()... */ typedef __int32_t __critical_t; typedef double __double_t; typedef float __float_t; typedef __int32_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int32_t __intptr_t; typedef __int32_t __int_fast8_t; typedef __int32_t __int_fast16_t; typedef __int32_t __int_fast32_t; typedef __int64_t __int_fast64_t; typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ typedef __int32_t __register_t; typedef __int32_t __segsz_t; /* segment size (in pages) */ typedef __uint32_t __size_t; /* sizeof() */ typedef __int32_t __ssize_t; /* byte count or error */ typedef __uint32_t __time_t; typedef __uint32_t __uintfptr_t; typedef __uint64_t __uintmax_t; typedef __uint32_t __uintptr_t; typedef __uint32_t __uint_fast8_t; typedef __uint32_t __uint_fast16_t; typedef __uint32_t __uint_fast32_t; typedef __uint64_t __uint_fast64_t; typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __uint32_t __vm_paddr_t; typedef __uint32_t __vm_size_t; typedef unsigned short ___wchar_t; /* * Unusual type definitions. */ typedef struct __va_list_t { void * __ap; } __va_list; #pragma diag_pop #pragma diag_push /* This file is required to use types without size and signedness */ #pragma CHECK_MISRA("-6.3") /* * Standard type definitions. */ typedef __int32_t __blksize_t; /* file block size */ typedef __int64_t __blkcnt_t; /* file block count */ typedef __int32_t __clockid_t; /* clock_gettime()... */ typedef __uint32_t __fflags_t; /* file flags */ typedef __uint64_t __fsblkcnt_t; typedef __uint64_t __fsfilcnt_t; typedef __uint32_t __gid_t; typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */ typedef __uint64_t __ino_t; /* inode number */ typedef long __key_t; /* IPC key (for Sys V IPC) */ typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ typedef __uint16_t __mode_t; /* permissions */ typedef int __accmode_t; /* access permissions */ typedef int __nl_item; typedef __uint64_t __nlink_t; /* link count */ typedef __int64_t __off_t; /* file offset */ typedef __int64_t __off64_t; /* file offset (alias) */ typedef __int32_t __pid_t; /* process [group] */ typedef __int64_t __rlim_t; /* resource limit - intentionally */ /* signed, because of legacy code */ /* that uses -1 for RLIM_INFINITY */ typedef __uint8_t __sa_family_t; typedef __uint32_t __socklen_t; typedef long __suseconds_t; /* microseconds (signed) */ typedef struct __timer *__timer_t; /* timer_gettime()... */ typedef struct __mq *__mqd_t; /* mq_open()... */ typedef __uint32_t __uid_t; typedef unsigned int __useconds_t; /* microseconds (unsigned) */ typedef int __cpuwhich_t; /* which parameter for cpuset. */ typedef int __cpulevel_t; /* level parameter for cpuset. */ typedef int __cpusetid_t; /* cpuset identifier. */ /* * Unusual type definitions. */ /* * rune_t is declared to be an ``int'' instead of the more natural * ``unsigned long'' or ``long''. Two things are happening here. It is not * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, * it looks like 10646 will be a 31 bit standard. This means that if your * ints cannot hold 32 bits, you will be in trouble. The reason an int was * chosen over a long is that the is*() and to*() routines take ints (says * ANSI C), but they use __ct_rune_t instead of int. * * NOTE: rune_t is not covered by ANSI nor other standards, and should not * be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and * rune_t must be the same type. Also, wint_t should be able to hold all * members of the largest character set plus one extra value (WEOF), and * must be at least 16 bits. */ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ /* Clang already provides these types as built-ins, but only in C++ mode. */ typedef __uint_least16_t __char16_t; typedef __uint_least32_t __char32_t; /* In C++11, char16_t and char32_t are built-in types. */ typedef struct { long long __max_align1 __attribute__((__aligned__(alignof(long long)))); long double __max_align2 __attribute__((__aligned__(alignof(long double)))); } __max_align_t; typedef __uint64_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ /* * mbstate_t is an opaque object to keep conversion state during multibyte * stream conversions. */ typedef int _Mbstatet; typedef _Mbstatet __mbstate_t; typedef __uintmax_t __rman_res_t; /* * When the following macro is defined, the system uses 64-bit inode numbers. * Programs can use this to avoid including , with its associated * namespace pollution. */ #pragma diag_pop /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2001, 2002 Mike Barcroft * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Klaus Klein. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ #pragma diag_push /* 19.4 is issued for macros that are defined in terms of other macros. */ #pragma CHECK_MISRA("-19.4") /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types */ /* Minimum values of exact-width signed integer types. */ /* Maximum values of exact-width signed integer types. */ /* Maximum values of exact-width unsigned integer types. */ /* * ISO/IEC 9899:1999 * 7.18.2.2 Limits of minimum-width integer types */ /* Minimum values of minimum-width signed integer types. */ /* Maximum values of minimum-width signed integer types. */ /* Maximum values of minimum-width unsigned integer types. */ /* * ISO/IEC 9899:1999 * 7.18.2.3 Limits of fastest minimum-width integer types */ /* Minimum values of fastest minimum-width signed integer types. */ /* Maximum values of fastest minimum-width signed integer types. */ /* Maximum values of fastest minimum-width unsigned integer types. */ /* * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ /* * ISO/IEC 9899:1999 * 7.18.2.5 Limits of greatest-width integer types */ /* * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ /* Limits of ptrdiff_t. */ /* Limits of sig_atomic_t. */ /* Limit of size_t. */ /* Limits of wint_t. */ #pragma diag_pop /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 David E. O'Brien * Copyright (c) 2001 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; typedef __intptr_t intptr_t; typedef __uintptr_t uintptr_t; typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; typedef __int_least8_t int_least8_t; typedef __int_least16_t int_least16_t; typedef __int_least32_t int_least32_t; typedef __int_least64_t int_least64_t; typedef __uint_least8_t uint_least8_t; typedef __uint_least16_t uint_least16_t; typedef __uint_least32_t uint_least32_t; typedef __uint_least64_t uint_least64_t; typedef __int_fast8_t int_fast8_t; typedef __int_fast16_t int_fast16_t; typedef __int_fast32_t int_fast32_t; typedef __int_fast64_t int_fast64_t; typedef __uint_fast8_t uint_fast8_t; typedef __uint_fast16_t uint_fast16_t; typedef __uint_fast32_t uint_fast32_t; typedef __uint_fast64_t uint_fast64_t; /* GNU and Darwin define this and people seem to think it's portable */ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* Limits of wchar_t. */ #pragma diag_pop /* ISO/IEC 9899:2011 K.3.4.4 */ #pragma GCC system_header namespace std { inline namespace __2 { using::int8_t; using::int16_t; using::int32_t; using::int64_t; using::uint8_t; using::uint16_t; using::uint32_t; using::uint64_t; using::int_least8_t; using::int_least16_t; using::int_least32_t; using::int_least64_t; using::uint_least8_t; using::uint_least16_t; using::uint_least32_t; using::uint_least64_t; using::int_fast8_t; using::int_fast16_t; using::int_fast32_t; using::int_fast64_t; using::uint_fast8_t; using::uint_fast16_t; using::uint_fast32_t; using::uint_fast64_t; using::intptr_t; using::uintptr_t; using::intmax_t; using::uintmax_t; } } #pragma GCC system_header namespace std // purposefully not using versioning namespace { #pragma define_type_info class type_info { type_info& operator=(const type_info&); type_info(const type_info&); protected: const char *__type_name; __attribute__ ((__always_inline__)) explicit type_info(const char* __n) : __type_name(__n) {} public: virtual ~type_info(); __attribute__ ((__always_inline__)) const char* name() const noexcept { return __type_name; } __attribute__ ((__always_inline__)) bool before(const type_info& __arg) const noexcept { return __type_name < __arg.__type_name; } __attribute__ ((__always_inline__)) size_t hash_code() const noexcept { return reinterpret_cast(__type_name); } __attribute__ ((__always_inline__)) bool operator==(const type_info& __arg) const noexcept { return __type_name == __arg.__type_name; } __attribute__ ((__always_inline__)) bool operator!=(const type_info& __arg) const noexcept { return !operator==(__arg); } }; class bad_cast : public exception { public: bad_cast() noexcept; virtual ~bad_cast() noexcept; virtual const char* what() const noexcept; }; class bad_typeid : public exception { public: bad_typeid() noexcept; virtual ~bad_typeid() noexcept; virtual const char* what() const noexcept; }; } // std namespace std { inline namespace __2 { [[noreturn]] inline __attribute__ ((__always_inline__)) void __throw_bad_cast() { std::__2::abort(); } } } // -*- C++ -*- //===-------------------------- memory ------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* memory synopsis namespace std { struct allocator_arg_t { }; constexpr allocator_arg_t allocator_arg = allocator_arg_t(); template struct uses_allocator; template struct pointer_traits { typedef Ptr pointer; typedef
element_type; typedef
difference_type; template using rebind =
; static pointer pointer_to(
); }; template struct pointer_traits { typedef T* pointer; typedef T element_type; typedef ptrdiff_t difference_type; template using rebind = U*; static pointer pointer_to(
) noexcept; }; template struct allocator_traits { typedef Alloc allocator_type; typedef typename allocator_type::value_type value_type; typedef Alloc::pointer | value_type* pointer; typedef Alloc::const_pointer | pointer_traits::rebind const_pointer; typedef Alloc::void_pointer | pointer_traits::rebind void_pointer; typedef Alloc::const_void_pointer | pointer_traits::rebind const_void_pointer; typedef Alloc::difference_type | pointer_traits::difference_type difference_type; typedef Alloc::size_type | make_unsigned::type size_type; typedef Alloc::propagate_on_container_copy_assignment | false_type propagate_on_container_copy_assignment; typedef Alloc::propagate_on_container_move_assignment | false_type propagate_on_container_move_assignment; typedef Alloc::propagate_on_container_swap | false_type propagate_on_container_swap; typedef Alloc::is_always_equal | is_empty is_always_equal; template using rebind_alloc = Alloc::rebind::other | Alloc; template using rebind_traits = allocator_traits>; static pointer allocate(allocator_type& a, size_type n); static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); static void deallocate(allocator_type& a, pointer p, size_type n) noexcept; template static void construct(allocator_type& a, T* p, Args&&... args); template static void destroy(allocator_type& a, T* p); static size_type max_size(const allocator_type& a); // noexcept in C++14 static allocator_type select_on_container_copy_construction(const allocator_type& a); }; template <> class allocator { public: typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind {typedef allocator<_Up> other;}; }; template class allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T* pointer; typedef const T* const_pointer; typedef typename add_lvalue_reference::type reference; typedef typename add_lvalue_reference::type const_reference; typedef T value_type; template struct rebind {typedef allocator other;}; allocator() noexcept; allocator(const allocator&) noexcept; template allocator(const allocator&) noexcept; ~allocator(); pointer address(reference x) const noexcept; const_pointer address(const_reference x) const noexcept; pointer allocate(size_type, allocator::const_pointer hint = 0); void deallocate(pointer p, size_type n) noexcept; size_type max_size() const noexcept; template void construct(U* p, Args&&... args); template void destroy(U* p); }; template bool operator==(const allocator&, const allocator&) noexcept; template bool operator!=(const allocator&, const allocator&) noexcept; template class raw_storage_iterator : public iterator // purposefully not C++03 { public: explicit raw_storage_iterator(OutputIterator x); raw_storage_iterator& operator*(); raw_storage_iterator& operator=(const T& element); raw_storage_iterator& operator++(); raw_storage_iterator operator++(int); }; template pair get_temporary_buffer(ptrdiff_t n) noexcept; template void return_temporary_buffer(T* p) noexcept; template T* addressof(T& r) noexcept; template T* addressof(const T&& r) noexcept = delete; template ForwardIterator uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result); template ForwardIterator uninitialized_copy_n(InputIterator first, Size n, ForwardIterator result); template void uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x); template ForwardIterator uninitialized_fill_n(ForwardIterator first, Size n, const T& x); template void destroy_at(T* location); template void destroy(ForwardIterator first, ForwardIterator last); template ForwardIterator destroy_n(ForwardIterator first, Size n); template ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result); template pair uninitialized_move_n(InputIterator first, Size n, ForwardIterator result); template void uninitialized_value_construct(ForwardIterator first, ForwardIterator last); template ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n); template void uninitialized_default_construct(ForwardIterator first, ForwardIterator last); template ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n); template struct auto_ptr_ref {}; // removed in C++17 template class auto_ptr // removed in C++17 { public: typedef X element_type; explicit auto_ptr(X* p =0) throw(); auto_ptr(auto_ptr&) throw(); template auto_ptr(auto_ptr&) throw(); auto_ptr& operator=(auto_ptr&) throw(); template auto_ptr& operator=(auto_ptr&) throw(); auto_ptr& operator=(auto_ptr_ref r) throw(); ~auto_ptr() throw(); typename add_lvalue_reference::type operator*() const throw(); X* operator->() const throw(); X* get() const throw(); X* release() throw(); void reset(X* p =0) throw(); auto_ptr(auto_ptr_ref) throw(); template operator auto_ptr_ref() throw(); template operator auto_ptr() throw(); }; template struct default_delete { constexpr default_delete() noexcept = default; template default_delete(const default_delete&) noexcept; void operator()(T*) const noexcept; }; template struct default_delete { constexpr default_delete() noexcept = default; void operator()(T*) const noexcept; template void operator()(U*) const = delete; }; template > class unique_ptr { public: typedef see below pointer; typedef T element_type; typedef D deleter_type; // constructors constexpr unique_ptr() noexcept; explicit unique_ptr(pointer p) noexcept; unique_ptr(pointer p, see below d1) noexcept; unique_ptr(pointer p, see below d2) noexcept; unique_ptr(unique_ptr&& u) noexcept; unique_ptr(nullptr_t) noexcept : unique_ptr() { } template unique_ptr(unique_ptr&& u) noexcept; template unique_ptr(auto_ptr&& u) noexcept; // removed in C++17 // destructor ~unique_ptr(); // assignment unique_ptr& operator=(unique_ptr&& u) noexcept; template unique_ptr& operator=(unique_ptr&& u) noexcept; unique_ptr& operator=(nullptr_t) noexcept; // observers typename add_lvalue_reference::type operator*() const; pointer operator->() const noexcept; pointer get() const noexcept; deleter_type& get_deleter() noexcept; const deleter_type& get_deleter() const noexcept; explicit operator bool() const noexcept; // modifiers pointer release() noexcept; void reset(pointer p = pointer()) noexcept; void swap(unique_ptr& u) noexcept; }; template class unique_ptr { public: typedef implementation-defined pointer; typedef T element_type; typedef D deleter_type; // constructors constexpr unique_ptr() noexcept; explicit unique_ptr(pointer p) noexcept; unique_ptr(pointer p, see below d) noexcept; unique_ptr(pointer p, see below d) noexcept; unique_ptr(unique_ptr&& u) noexcept; unique_ptr(nullptr_t) noexcept : unique_ptr() { } // destructor ~unique_ptr(); // assignment unique_ptr& operator=(unique_ptr&& u) noexcept; unique_ptr& operator=(nullptr_t) noexcept; // observers T& operator[](size_t i) const; pointer get() const noexcept; deleter_type& get_deleter() noexcept; const deleter_type& get_deleter() const noexcept; explicit operator bool() const noexcept; // modifiers pointer release() noexcept; void reset(pointer p = pointer()) noexcept; void reset(nullptr_t) noexcept; template void reset(U) = delete; void swap(unique_ptr& u) noexcept; }; template void swap(unique_ptr& x, unique_ptr& y) noexcept; template bool operator==(const unique_ptr& x, const unique_ptr& y); template bool operator!=(const unique_ptr& x, const unique_ptr& y); template bool operator<(const unique_ptr& x, const unique_ptr& y); template bool operator<=(const unique_ptr& x, const unique_ptr& y); template bool operator>(const unique_ptr& x, const unique_ptr& y); template bool operator>=(const unique_ptr& x, const unique_ptr& y); template bool operator==(const unique_ptr& x, nullptr_t) noexcept; template bool operator==(nullptr_t, const unique_ptr& y) noexcept; template bool operator!=(const unique_ptr& x, nullptr_t) noexcept; template bool operator!=(nullptr_t, const unique_ptr& y) noexcept; template bool operator<(const unique_ptr& x, nullptr_t); template bool operator<(nullptr_t, const unique_ptr& y); template bool operator<=(const unique_ptr& x, nullptr_t); template bool operator<=(nullptr_t, const unique_ptr& y); template bool operator>(const unique_ptr& x, nullptr_t); template bool operator>(nullptr_t, const unique_ptr& y); template bool operator>=(const unique_ptr& x, nullptr_t); template bool operator>=(nullptr_t, const unique_ptr& y); class bad_weak_ptr : public std::exception { bad_weak_ptr() noexcept; }; template unique_ptr make_unique(Args&&... args); // C++14 template unique_ptr make_unique(size_t n); // C++14 template unspecified make_unique(Args&&...) = delete; // C++14, T == U[N] template class shared_ptr { public: typedef T element_type; typedef weak_ptr weak_type; // C++17 // constructors: constexpr shared_ptr() noexcept; template explicit shared_ptr(Y* p); template shared_ptr(Y* p, D d); template shared_ptr(Y* p, D d, A a); template shared_ptr(nullptr_t p, D d); template shared_ptr(nullptr_t p, D d, A a); template shared_ptr(const shared_ptr& r, T *p) noexcept; shared_ptr(const shared_ptr& r) noexcept; template shared_ptr(const shared_ptr& r) noexcept; shared_ptr(shared_ptr&& r) noexcept; template shared_ptr(shared_ptr&& r) noexcept; template explicit shared_ptr(const weak_ptr& r); template shared_ptr(auto_ptr&& r); // removed in C++17 template shared_ptr(unique_ptr&& r); shared_ptr(nullptr_t) : shared_ptr() { } // destructor: ~shared_ptr(); // assignment: shared_ptr& operator=(const shared_ptr& r) noexcept; template shared_ptr& operator=(const shared_ptr& r) noexcept; shared_ptr& operator=(shared_ptr&& r) noexcept; template shared_ptr& operator=(shared_ptr&& r); template shared_ptr& operator=(auto_ptr&& r); // removed in C++17 template shared_ptr& operator=(unique_ptr&& r); // modifiers: void swap(shared_ptr& r) noexcept; void reset() noexcept; template void reset(Y* p); template void reset(Y* p, D d); template void reset(Y* p, D d, A a); // observers: T* get() const noexcept; T& operator*() const noexcept; T* operator->() const noexcept; long use_count() const noexcept; bool unique() const noexcept; explicit operator bool() const noexcept; template bool owner_before(shared_ptr const& b) const noexcept; template bool owner_before(weak_ptr const& b) const noexcept; }; // shared_ptr comparisons: template bool operator==(shared_ptr const& a, shared_ptr const& b) noexcept; template bool operator!=(shared_ptr const& a, shared_ptr const& b) noexcept; template bool operator<(shared_ptr const& a, shared_ptr const& b) noexcept; template bool operator>(shared_ptr const& a, shared_ptr const& b) noexcept; template bool operator<=(shared_ptr const& a, shared_ptr const& b) noexcept; template bool operator>=(shared_ptr const& a, shared_ptr const& b) noexcept; template bool operator==(const shared_ptr& x, nullptr_t) noexcept; template bool operator==(nullptr_t, const shared_ptr& y) noexcept; template bool operator!=(const shared_ptr& x, nullptr_t) noexcept; template bool operator!=(nullptr_t, const shared_ptr& y) noexcept; template bool operator<(const shared_ptr& x, nullptr_t) noexcept; template bool operator<(nullptr_t, const shared_ptr& y) noexcept; template bool operator<=(const shared_ptr& x, nullptr_t) noexcept; template bool operator<=(nullptr_t, const shared_ptr& y) noexcept; template bool operator>(const shared_ptr& x, nullptr_t) noexcept; template bool operator>(nullptr_t, const shared_ptr& y) noexcept; template bool operator>=(const shared_ptr& x, nullptr_t) noexcept; template bool operator>=(nullptr_t, const shared_ptr& y) noexcept; // shared_ptr specialized algorithms: template void swap(shared_ptr& a, shared_ptr& b) noexcept; // shared_ptr casts: template shared_ptr static_pointer_cast(shared_ptr const& r) noexcept; template shared_ptr dynamic_pointer_cast(shared_ptr const& r) noexcept; template shared_ptr const_pointer_cast(shared_ptr const& r) noexcept; // shared_ptr I/O: template basic_ostream& operator<< (basic_ostream& os, shared_ptr const& p); // shared_ptr get_deleter: template D* get_deleter(shared_ptr const& p) noexcept; template shared_ptr make_shared(Args&&... args); template shared_ptr allocate_shared(const A& a, Args&&... args); template class weak_ptr { public: typedef T element_type; // constructors constexpr weak_ptr() noexcept; template weak_ptr(shared_ptr const& r) noexcept; weak_ptr(weak_ptr const& r) noexcept; template weak_ptr(weak_ptr const& r) noexcept; weak_ptr(weak_ptr&& r) noexcept; // C++14 template weak_ptr(weak_ptr&& r) noexcept; // C++14 // destructor ~weak_ptr(); // assignment weak_ptr& operator=(weak_ptr const& r) noexcept; template weak_ptr& operator=(weak_ptr const& r) noexcept; template weak_ptr& operator=(shared_ptr const& r) noexcept; weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14 template weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14 // modifiers void swap(weak_ptr& r) noexcept; void reset() noexcept; // observers long use_count() const noexcept; bool expired() const noexcept; shared_ptr lock() const noexcept; template bool owner_before(shared_ptr const& b) const noexcept; template bool owner_before(weak_ptr const& b) const noexcept; }; // weak_ptr specialized algorithms: template void swap(weak_ptr& a, weak_ptr& b) noexcept; // class owner_less: template struct owner_less; template struct owner_less> : binary_function, shared_ptr, bool> { typedef bool result_type; bool operator()(shared_ptr const&, shared_ptr const&) const noexcept; bool operator()(shared_ptr const&, weak_ptr const&) const noexcept; bool operator()(weak_ptr const&, shared_ptr const&) const noexcept; }; template struct owner_less> : binary_function, weak_ptr, bool> { typedef bool result_type; bool operator()(weak_ptr const&, weak_ptr const&) const noexcept; bool operator()(shared_ptr const&, weak_ptr const&) const noexcept; bool operator()(weak_ptr const&, shared_ptr const&) const noexcept; }; template <> // Added in C++14 struct owner_less { template bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept; template bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept; template bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept; template bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept; typedef void is_transparent; }; template class enable_shared_from_this { protected: constexpr enable_shared_from_this() noexcept; enable_shared_from_this(enable_shared_from_this const&) noexcept; enable_shared_from_this& operator=(enable_shared_from_this const&) noexcept; ~enable_shared_from_this(); public: shared_ptr shared_from_this(); shared_ptr shared_from_this() const; }; template bool atomic_is_lock_free(const shared_ptr* p); template shared_ptr atomic_load(const shared_ptr* p); template shared_ptr atomic_load_explicit(const shared_ptr* p, memory_order mo); template void atomic_store(shared_ptr* p, shared_ptr r); template void atomic_store_explicit(shared_ptr* p, shared_ptr r, memory_order mo); template shared_ptr atomic_exchange(shared_ptr* p, shared_ptr r); template shared_ptr atomic_exchange_explicit(shared_ptr* p, shared_ptr r, memory_order mo); template bool atomic_compare_exchange_weak(shared_ptr* p, shared_ptr* v, shared_ptr w); template bool atomic_compare_exchange_strong( shared_ptr* p, shared_ptr* v, shared_ptr w); template bool atomic_compare_exchange_weak_explicit(shared_ptr* p, shared_ptr* v, shared_ptr w, memory_order success, memory_order failure); template bool atomic_compare_exchange_strong_explicit(shared_ptr* p, shared_ptr* v, shared_ptr w, memory_order success, memory_order failure); // Hash support template struct hash; template struct hash >; template struct hash >; // Pointer safety enum class pointer_safety { relaxed, preferred, strict }; void declare_reachable(void *p); template T *undeclare_reachable(T *p); void declare_no_pointers(char *p, size_t n); void undeclare_no_pointers(char *p, size_t n); pointer_safety get_pointer_safety() noexcept; void* align(size_t alignment, size_t size, void*& ptr, size_t& space); } // std */ // -*- C++ -*- //===----------------------------- new ------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* new synopsis namespace std { class bad_alloc : public exception { public: bad_alloc() noexcept; bad_alloc(const bad_alloc&) noexcept; bad_alloc& operator=(const bad_alloc&) noexcept; virtual const char* what() const noexcept; }; class bad_array_length : public bad_alloc // FIXME: Not part of C++ { public: bad_array_length() noexcept; }; class bad_array_new_length : public bad_alloc // C++14 { public: bad_array_new_length() noexcept; }; enum class align_val_t : size_t {}; // C++17 struct nothrow_t {}; extern const nothrow_t nothrow; typedef void (*new_handler)(); new_handler set_new_handler(new_handler new_p) noexcept; new_handler get_new_handler() noexcept; } // std void* operator new(std::size_t size); // replaceable void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17 void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable void* operator new(std::size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept; // replaceable, C++17 void operator delete(void* ptr) noexcept; // replaceable void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14 void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17 void operator delete(void* ptr, std::size_t size, std::align_val_t alignment) noexcept; // replaceable, C++17 void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable void operator delete(void* ptr, std:align_val_t alignment, const std::nothrow_t&) noexcept; // replaceable, C++17 void* operator new[](std::size_t size); // replaceable void* operator new[](std::size_t size, std::align_val_t alignment) noexcept; // replaceable, C++17 void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable void* operator new[](std::size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept; // replaceable, C++17 void operator delete[](void* ptr) noexcept; // replaceable void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14 void operator delete[](void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17 void operator delete[](void* ptr, std::size_t size, std::align_val_t alignment) noexcept; // replaceable, C++17 void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept; // replaceable, C++17 void* operator new (std::size_t size, void* ptr) noexcept; void* operator new[](std::size_t size, void* ptr) noexcept; void operator delete (void* ptr, void*) noexcept; void operator delete[](void* ptr, void*) noexcept; */ #pragma GCC system_header namespace std // purposefully not using versioning namespace { struct nothrow_t {}; extern const nothrow_t nothrow; class bad_alloc : public exception { public: bad_alloc() noexcept; virtual ~bad_alloc() noexcept; virtual const char* what() const noexcept; }; class bad_array_new_length : public bad_alloc { public: bad_array_new_length() noexcept; virtual ~bad_array_new_length() noexcept; virtual const char* what() const noexcept; }; typedef void (*new_handler)(); new_handler set_new_handler(new_handler) noexcept; new_handler get_new_handler() noexcept; [[noreturn]] void __throw_bad_alloc(); // not in C++ spec class bad_array_length : public bad_alloc { public: bad_array_length() noexcept; virtual ~bad_array_length() noexcept; virtual const char* what() const noexcept; }; } // std void* operator new(std::size_t __sz) ; void* operator new(std::size_t __sz, const std::nothrow_t&) noexcept ; void operator delete(void* __p) noexcept; void operator delete(void* __p, const std::nothrow_t&) noexcept; void operator delete(void* __p, std::size_t __sz) noexcept; void* operator new[](std::size_t __sz) ; void* operator new[](std::size_t __sz, const std::nothrow_t&) noexcept ; void operator delete[](void* __p) noexcept; void operator delete[](void* __p, const std::nothrow_t&) noexcept; void operator delete[](void* __p, std::size_t __sz) noexcept; inline __attribute__ ((__always_inline__)) void* operator new (std::size_t, void* __p) noexcept {return __p;} inline __attribute__ ((__always_inline__)) void* operator new[](std::size_t, void* __p) noexcept {return __p;} inline __attribute__ ((__always_inline__)) void operator delete (void*, void*) noexcept {} inline __attribute__ ((__always_inline__)) void operator delete[](void*, void*) noexcept {} namespace std { inline namespace __2 { inline __attribute__ ((__always_inline__)) void *__allocate(size_t __size) { return ::operator new(__size); } inline __attribute__ ((__always_inline__)) void __libcpp_deallocate(void *__ptr) { ::operator delete(__ptr); } [[noreturn]] inline __attribute__ ((__always_inline__)) void __throw_bad_array_length() { std::__2::abort(); } } } // -*- C++ -*- //===-------------------------- utility -----------------------------------===// // // 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. // //===----------------------------------------------------------------------===// /* utility synopsis namespace std { template void swap(T& a, T& b); namespace rel_ops { template bool operator!=(const T&, const T&); template bool operator> (const T&, const T&); template bool operator<=(const T&, const T&); template bool operator>=(const T&, const T&); } template void swap(T& a, T& b) noexcept(is_nothrow_move_constructible::value && is_nothrow_move_assignable::value); template void swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b))); template T&& forward(typename remove_reference::type& t) noexcept; // constexpr in C++14 template T&& forward(typename remove_reference::type&& t) noexcept; // constexpr in C++14 template typename remove_reference::type&& move(T&&) noexcept; // constexpr in C++14 template typename conditional < !is_nothrow_move_constructible::value && is_copy_constructible::value, const T&, T&& >::type move_if_noexcept(T& x) noexcept; // constexpr in C++14 template constexpr add_const_t& as_const(T& t) noexcept; // C++17 template void as_const(const T&&) = delete; // C++17 template typename add_rvalue_reference::type declval() noexcept; template struct pair { typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair(const pair&) = default; pair(pair&&) = default; constexpr pair(); pair(const T1& x, const T2& y); // constexpr in C++14 template pair(U&& x, V&& y); // constexpr in C++14 template pair(const pair& p); // constexpr in C++14 template pair(pair&& p); // constexpr in C++14 template pair(piecewise_construct_t, tuple first_args, tuple second_args); template pair& operator=(const pair& p); pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable::value && is_nothrow_move_assignable::value); template pair& operator=(pair&& p); void swap(pair& p) noexcept(is_nothrow_swappable_v && is_nothrow_swappable_v); }; template bool operator==(const pair&, const pair&); // constexpr in C++14 template bool operator!=(const pair&, const pair&); // constexpr in C++14 template bool operator< (const pair&, const pair&); // constexpr in C++14 template bool operator> (const pair&, const pair&); // constexpr in C++14 template bool operator>=(const pair&, const pair&); // constexpr in C++14 template bool operator<=(const pair&, const pair&); // constexpr in C++14 template pair make_pair(T1&&, T2&&); // constexpr in C++14 template void swap(pair& x, pair& y) noexcept(noexcept(x.swap(y))); struct piecewise_construct_t { }; constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); template class tuple_size; template class tuple_element; template struct tuple_size >; template struct tuple_element<0, pair >; template struct tuple_element<1, pair >; template typename tuple_element >::type& get(pair&) noexcept; // constexpr in C++14 template const typename tuple_element >::type& get(const pair&) noexcept; // constexpr in C++14 template typename tuple_element >::type&& get(pair&&) noexcept; // constexpr in C++14 template const typename tuple_element >::type&& get(const pair&&) noexcept; // constexpr in C++14 template constexpr T1& get(pair&) noexcept; // C++14 template constexpr const T1& get(const pair&) noexcept; // C++14 template constexpr T1&& get(pair&&) noexcept; // C++14 template constexpr const T1&& get(const pair&&) noexcept; // C++14 template constexpr T1& get(pair&) noexcept; // C++14 template constexpr const T1& get(const pair&) noexcept; // C++14 template constexpr T1&& get(pair&&) noexcept; // C++14 template constexpr const T1&& get(const pair&&) noexcept; // C++14 // C++14 template struct integer_sequence { typedef T value_type; static constexpr size_t size() noexcept; }; template using index_sequence = integer_sequence; template using make_integer_sequence = integer_sequence; template using make_index_sequence = make_integer_sequence; template using index_sequence_for = make_index_sequence; template T exchange(T& obj, U&& new_value); // 20.2.7, in-place construction // C++17 struct in_place_t { explicit in_place_t() = default; }; inline constexpr in_place_t in_place{}; template struct in_place_type_t { explicit in_place_type_t() = default; }; template inline constexpr in_place_type_t in_place_type{}; template struct in_place_index_t { explicit in_place_index_t() = default; }; template inline constexpr in_place_index_t in_place_index{}; } // std */ // -*- C++ -*- //===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// #pragma GCC system_header namespace std { inline namespace __2 { template class tuple_size; template using __enable_if_tuple_size_imp = _Tp; template class tuple_size<__enable_if_tuple_size_imp< const _Tp, typename enable_if::value>::type, integral_constant)>>> : public integral_constant::value> {}; template class tuple_size<__enable_if_tuple_size_imp< volatile _Tp, typename enable_if::value>::type, integral_constant)>>> : public integral_constant::value> {}; template class tuple_size<__enable_if_tuple_size_imp< const volatile _Tp, integral_constant)>>> : public integral_constant::value> {}; template class tuple_element; template class tuple_element<_Ip, const _Tp> { public: typedef typename add_const::type>::type type; }; template class tuple_element<_Ip, volatile _Tp> { public: typedef typename add_volatile::type>::type type; }; template class tuple_element<_Ip, const volatile _Tp> { public: typedef typename add_cv::type>::type type; }; template struct __tuple_like : false_type {}; template struct __tuple_like : public __tuple_like<_Tp> {}; template struct __tuple_like : public __tuple_like<_Tp> {}; template struct __tuple_like : public __tuple_like<_Tp> {}; // tuple specializations template struct __tuple_indices {}; template struct __integer_sequence { template