2024-06-08 21:30:58 +00:00
|
|
|
// -*-mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8-*-
|
|
|
|
// vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi
|
|
|
|
#ifndef COSMOPOLITAN_CTL_NEW_H_
|
|
|
|
#define COSMOPOLITAN_CTL_NEW_H_
|
|
|
|
|
2024-06-23 17:08:48 +00:00
|
|
|
#ifndef TINY
|
|
|
|
__static_yoink("__demangle");
|
|
|
|
#endif
|
|
|
|
|
2024-06-08 21:30:58 +00:00
|
|
|
namespace ctl {
|
|
|
|
|
2024-06-20 19:20:54 +00:00
|
|
|
enum class align_val_t : size_t
|
|
|
|
{
|
|
|
|
};
|
2024-06-08 21:30:58 +00:00
|
|
|
|
Introduce more CTL content
This change introduces accumulate, addressof, advance, all_of, distance,
array, enable_if, allocator_traits, back_inserter, bad_alloc, is_signed,
any_of, copy, exception, fill, fill_n, is_same, is_same_v, out_of_range,
lexicographical_compare, is_integral, uninitialized_fill_n, is_unsigned,
numeric_limits, uninitialized_fill, iterator_traits, move_backward, min,
max, iterator_tag, move_iterator, reverse_iterator, uninitialized_move_n
This change experiments with rewriting the ctl::vector class to make the
CTL design more similar to the STL. So far it has not slowed things down
to have 42 #include lines rather than 2, since it's still almost nothing
compared to LLVM's code. In fact the closer we can flirt with being just
like libcxx, the better chance we might have of discovering exactly what
makes it so slow to compile. It would be an enormous discovery if we can
find one simple trick to solving the issue there instead.
This also fixes a bug in `ctl::string(const string &s)` when `s` is big.
2024-06-28 05:18:55 +00:00
|
|
|
struct nothrow_t
|
|
|
|
{
|
|
|
|
explicit nothrow_t() = default;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline constexpr nothrow_t nothrow{};
|
|
|
|
|
2024-06-08 21:30:58 +00:00
|
|
|
} // namespace ctl
|
|
|
|
|
Introduce more CTL content
This change introduces accumulate, addressof, advance, all_of, distance,
array, enable_if, allocator_traits, back_inserter, bad_alloc, is_signed,
any_of, copy, exception, fill, fill_n, is_same, is_same_v, out_of_range,
lexicographical_compare, is_integral, uninitialized_fill_n, is_unsigned,
numeric_limits, uninitialized_fill, iterator_traits, move_backward, min,
max, iterator_tag, move_iterator, reverse_iterator, uninitialized_move_n
This change experiments with rewriting the ctl::vector class to make the
CTL design more similar to the STL. So far it has not slowed things down
to have 42 #include lines rather than 2, since it's still almost nothing
compared to LLVM's code. In fact the closer we can flirt with being just
like libcxx, the better chance we might have of discovering exactly what
makes it so slow to compile. It would be an enormous discovery if we can
find one simple trick to solving the issue there instead.
This also fixes a bug in `ctl::string(const string &s)` when `s` is big.
2024-06-28 05:18:55 +00:00
|
|
|
// XXX clang-format currently mutilates these for some reason.
|
|
|
|
// clang-format off
|
|
|
|
|
2024-06-08 21:30:58 +00:00
|
|
|
void* operator new(size_t);
|
Introduce more CTL content
This change introduces accumulate, addressof, advance, all_of, distance,
array, enable_if, allocator_traits, back_inserter, bad_alloc, is_signed,
any_of, copy, exception, fill, fill_n, is_same, is_same_v, out_of_range,
lexicographical_compare, is_integral, uninitialized_fill_n, is_unsigned,
numeric_limits, uninitialized_fill, iterator_traits, move_backward, min,
max, iterator_tag, move_iterator, reverse_iterator, uninitialized_move_n
This change experiments with rewriting the ctl::vector class to make the
CTL design more similar to the STL. So far it has not slowed things down
to have 42 #include lines rather than 2, since it's still almost nothing
compared to LLVM's code. In fact the closer we can flirt with being just
like libcxx, the better chance we might have of discovering exactly what
makes it so slow to compile. It would be an enormous discovery if we can
find one simple trick to solving the issue there instead.
This also fixes a bug in `ctl::string(const string &s)` when `s` is big.
2024-06-28 05:18:55 +00:00
|
|
|
void* operator new(size_t, const ctl::nothrow_t&) noexcept;
|
2024-06-08 21:30:58 +00:00
|
|
|
void* operator new(size_t, ctl::align_val_t);
|
Introduce more CTL content
This change introduces accumulate, addressof, advance, all_of, distance,
array, enable_if, allocator_traits, back_inserter, bad_alloc, is_signed,
any_of, copy, exception, fill, fill_n, is_same, is_same_v, out_of_range,
lexicographical_compare, is_integral, uninitialized_fill_n, is_unsigned,
numeric_limits, uninitialized_fill, iterator_traits, move_backward, min,
max, iterator_tag, move_iterator, reverse_iterator, uninitialized_move_n
This change experiments with rewriting the ctl::vector class to make the
CTL design more similar to the STL. So far it has not slowed things down
to have 42 #include lines rather than 2, since it's still almost nothing
compared to LLVM's code. In fact the closer we can flirt with being just
like libcxx, the better chance we might have of discovering exactly what
makes it so slow to compile. It would be an enormous discovery if we can
find one simple trick to solving the issue there instead.
This also fixes a bug in `ctl::string(const string &s)` when `s` is big.
2024-06-28 05:18:55 +00:00
|
|
|
void* operator new(size_t, ctl::align_val_t, const ctl::nothrow_t&) noexcept;
|
2024-06-20 19:20:54 +00:00
|
|
|
|
Introduce more CTL content
This change introduces accumulate, addressof, advance, all_of, distance,
array, enable_if, allocator_traits, back_inserter, bad_alloc, is_signed,
any_of, copy, exception, fill, fill_n, is_same, is_same_v, out_of_range,
lexicographical_compare, is_integral, uninitialized_fill_n, is_unsigned,
numeric_limits, uninitialized_fill, iterator_traits, move_backward, min,
max, iterator_tag, move_iterator, reverse_iterator, uninitialized_move_n
This change experiments with rewriting the ctl::vector class to make the
CTL design more similar to the STL. So far it has not slowed things down
to have 42 #include lines rather than 2, since it's still almost nothing
compared to LLVM's code. In fact the closer we can flirt with being just
like libcxx, the better chance we might have of discovering exactly what
makes it so slow to compile. It would be an enormous discovery if we can
find one simple trick to solving the issue there instead.
This also fixes a bug in `ctl::string(const string &s)` when `s` is big.
2024-06-28 05:18:55 +00:00
|
|
|
void* operator new[](size_t);
|
|
|
|
void* operator new[](size_t, const ctl::nothrow_t&) noexcept;
|
|
|
|
void* operator new[](size_t, ctl::align_val_t);
|
|
|
|
void* operator new[](size_t, ctl::align_val_t, const ctl::nothrow_t&) noexcept;
|
2024-06-20 19:20:54 +00:00
|
|
|
|
Introduce more CTL content
This change introduces accumulate, addressof, advance, all_of, distance,
array, enable_if, allocator_traits, back_inserter, bad_alloc, is_signed,
any_of, copy, exception, fill, fill_n, is_same, is_same_v, out_of_range,
lexicographical_compare, is_integral, uninitialized_fill_n, is_unsigned,
numeric_limits, uninitialized_fill, iterator_traits, move_backward, min,
max, iterator_tag, move_iterator, reverse_iterator, uninitialized_move_n
This change experiments with rewriting the ctl::vector class to make the
CTL design more similar to the STL. So far it has not slowed things down
to have 42 #include lines rather than 2, since it's still almost nothing
compared to LLVM's code. In fact the closer we can flirt with being just
like libcxx, the better chance we might have of discovering exactly what
makes it so slow to compile. It would be an enormous discovery if we can
find one simple trick to solving the issue there instead.
This also fixes a bug in `ctl::string(const string &s)` when `s` is big.
2024-06-28 05:18:55 +00:00
|
|
|
void* operator new(size_t, void*) noexcept;
|
|
|
|
void* operator new[](size_t, void*) noexcept;
|
2024-06-08 21:30:58 +00:00
|
|
|
|
|
|
|
void operator delete(void*) noexcept;
|
|
|
|
void operator delete[](void*) noexcept;
|
|
|
|
void operator delete(void*, ctl::align_val_t) noexcept;
|
|
|
|
void operator delete[](void*, ctl::align_val_t) noexcept;
|
|
|
|
void operator delete(void*, size_t) noexcept;
|
|
|
|
void operator delete[](void*, size_t) noexcept;
|
|
|
|
void operator delete(void*, size_t, ctl::align_val_t) noexcept;
|
|
|
|
void operator delete[](void*, size_t, ctl::align_val_t) noexcept;
|
|
|
|
|
|
|
|
#endif // COSMOPOLITAN_CTL_NEW_H_
|