Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
// -*- C++ -*-
|
2024-05-27 09:12:27 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef _LIBCPP_NUMERIC
|
|
|
|
#define _LIBCPP_NUMERIC
|
|
|
|
|
|
|
|
/*
|
|
|
|
numeric synopsis
|
|
|
|
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
|
|
|
|
template <class InputIterator, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
accumulate(InputIterator first, InputIterator last, T init);
|
|
|
|
|
|
|
|
template <class InputIterator, class T, class BinaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op);
|
|
|
|
|
|
|
|
template<class InputIterator>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr typename iterator_traits<InputIterator>::value_type // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
reduce(InputIterator first, InputIterator last); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
reduce(InputIterator first, InputIterator last, T init); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class T, class BinaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17
|
|
|
|
|
|
|
|
template <class InputIterator1, class InputIterator2, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init);
|
|
|
|
|
|
|
|
template <class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
|
|
|
|
T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
|
|
|
|
|
|
|
|
|
|
|
|
template<class InputIterator1, class InputIterator2, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
transform_reduce(InputIterator1 first1, InputIterator1 last1,
|
|
|
|
InputIterator2 first2, T init); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
transform_reduce(InputIterator1 first1, InputIterator1 last1,
|
|
|
|
InputIterator2 first2, T init,
|
|
|
|
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class T, class BinaryOperation, class UnaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr T // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
transform_reduce(InputIterator first, InputIterator last, T init,
|
|
|
|
BinaryOperation binary_op, UnaryOperation unary_op); // C++17
|
|
|
|
|
|
|
|
template <class InputIterator, class OutputIterator>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
partial_sum(InputIterator first, InputIterator last, OutputIterator result);
|
|
|
|
|
|
|
|
template <class InputIterator, class OutputIterator, class BinaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
exclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result, T init); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
exclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result, T init, BinaryOperation binary_op); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator, class BinaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
inclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result, BinaryOperation binary_op); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
inclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result, BinaryOperation binary_op, T init); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator, class T,
|
|
|
|
class BinaryOperation, class UnaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
transform_exclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result, T init,
|
|
|
|
BinaryOperation binary_op, UnaryOperation unary_op); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator,
|
|
|
|
class BinaryOperation, class UnaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
transform_inclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result,
|
|
|
|
BinaryOperation binary_op, UnaryOperation unary_op); // C++17
|
|
|
|
|
|
|
|
template<class InputIterator, class OutputIterator,
|
|
|
|
class BinaryOperation, class UnaryOperation, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
transform_inclusive_scan(InputIterator first, InputIterator last,
|
|
|
|
OutputIterator result,
|
|
|
|
BinaryOperation binary_op, UnaryOperation unary_op,
|
|
|
|
T init); // C++17
|
|
|
|
|
|
|
|
template <class InputIterator, class OutputIterator>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);
|
|
|
|
|
|
|
|
template <class InputIterator, class OutputIterator, class BinaryOperation>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr OutputIterator // constexpr since C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
|
|
|
|
|
|
|
|
template <class ForwardIterator, class T>
|
2024-05-27 09:12:27 +00:00
|
|
|
constexpr void // constexpr since C++20
|
|
|
|
iota(ForwardIterator first, ForwardIterator last, T value);
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
|
|
|
|
template <class M, class N>
|
|
|
|
constexpr common_type_t<M,N> gcd(M m, N n); // C++17
|
|
|
|
|
|
|
|
template <class M, class N>
|
|
|
|
constexpr common_type_t<M,N> lcm(M m, N n); // C++17
|
|
|
|
|
2024-05-27 09:12:27 +00:00
|
|
|
template<class T>
|
|
|
|
constexpr T midpoint(T a, T b) noexcept; // C++20
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
constexpr T* midpoint(T* a, T* b); // C++20
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
|
2024-07-23 10:16:17 +00:00
|
|
|
// [numeric.sat], saturation arithmetic
|
|
|
|
template<class T>
|
|
|
|
constexpr T add_sat(T x, T y) noexcept; // freestanding, Since C++26
|
|
|
|
template<class T>
|
|
|
|
constexpr T sub_sat(T x, T y) noexcept; // freestanding, Since C++26
|
|
|
|
template<class T>
|
|
|
|
constexpr T mul_sat(T x, T y) noexcept; // freestanding, Since C++26
|
|
|
|
template<class T>
|
|
|
|
constexpr T div_sat(T x, T y) noexcept; // freestanding, Since C++26
|
|
|
|
template<class T, class U>
|
|
|
|
constexpr T saturate_cast(U x) noexcept; // freestanding, Since C++26
|
|
|
|
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
} // std
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2024-05-27 09:12:27 +00:00
|
|
|
#include <__config>
|
|
|
|
|
|
|
|
#include <__numeric/accumulate.h>
|
|
|
|
#include <__numeric/adjacent_difference.h>
|
|
|
|
#include <__numeric/inner_product.h>
|
|
|
|
#include <__numeric/iota.h>
|
|
|
|
#include <__numeric/partial_sum.h>
|
2024-07-23 10:16:17 +00:00
|
|
|
|
|
|
|
#if _LIBCPP_STD_VER >= 17
|
|
|
|
# include <__numeric/exclusive_scan.h>
|
|
|
|
# include <__numeric/gcd_lcm.h>
|
|
|
|
# include <__numeric/inclusive_scan.h>
|
|
|
|
# include <__numeric/pstl.h>
|
|
|
|
# include <__numeric/reduce.h>
|
|
|
|
# include <__numeric/transform_exclusive_scan.h>
|
|
|
|
# include <__numeric/transform_inclusive_scan.h>
|
|
|
|
# include <__numeric/transform_reduce.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if _LIBCPP_STD_VER >= 20
|
|
|
|
# include <__numeric/midpoint.h>
|
|
|
|
# include <__numeric/saturation_arithmetic.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <version>
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
|
2024-05-27 09:12:27 +00:00
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
|
|
|
# pragma GCC system_header
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
#endif
|
|
|
|
|
2024-07-23 10:16:17 +00:00
|
|
|
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
|
|
|
|
# include <initializer_list>
|
|
|
|
# include <limits>
|
|
|
|
#endif
|
|
|
|
|
2024-05-27 09:12:27 +00:00
|
|
|
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
2024-07-23 10:16:17 +00:00
|
|
|
# include <climits>
|
|
|
|
# include <cmath>
|
2024-05-27 09:12:27 +00:00
|
|
|
# include <concepts>
|
2024-07-23 10:16:17 +00:00
|
|
|
# include <cstdint>
|
|
|
|
# include <execution>
|
2024-05-27 09:12:27 +00:00
|
|
|
# include <functional>
|
|
|
|
# include <iterator>
|
2024-07-23 10:16:17 +00:00
|
|
|
# include <new>
|
|
|
|
# include <optional>
|
2024-05-27 09:12:27 +00:00
|
|
|
# include <type_traits>
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
#endif
|
|
|
|
|
2024-05-27 09:12:27 +00:00
|
|
|
#endif // _LIBCPP_NUMERIC
|