42 std::unique_ptr<int>
ptr;
55 ptr = f.
ptr ? std::make_unique<int>(*f.
ptr) :
nullptr;
71 requires std::convertible_to<T, int>
77 for (
size_t i = 0; i < s.
size(); ++i)
87 requires std::constructible_from<T, int>
92 for (
int i = 0; i < n; ++i)
108 catch (
const std::invalid_argument &) { n = 1000; }
109 catch (
const std::out_of_range &) { n = 1000; }
113 for (
int i = 0; i < n; ++i)
122 catch (
const std::invalid_argument &) {
m = n / 4; }
123 catch (
const std::out_of_range &) {
m = n / 4; }
127 cout <<
"Extracting " <<
m <<
" items" <<
endl;
128 for (
int i = 0; i <
m; ++i)
129 cout << s.
get() <<
" ";
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
#define ah_invalid_argument_if(C)
Throws std::invalid_argument if condition holds.
Simple, scalable and fast dynamic array.
size_t size() const noexcept
Return the number of elements.
constexpr size_t capacity() const noexcept
The type of element of array.
T get(const size_t i=1)
Remove i elements from the end.
T & put(const T &item)
Put a copy of item at the end of sequence.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::decay_t< typename HeadC::Item_Type > T
std::unique_ptr< int > ptr
Foo(Foo &&f) noexcept=default
Foo & operator=(const Foo &f)
void print(const MemArray< T > &s)
MemArray< T > create_memarray(int n)
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
Simple, scalable, contiguous dynamic array.