Document Number: | |
---|---|
Date: | |
Revises: | |
Author: | Bloomberg LP |
function
function
modifiersvoid swap(function& other);
this->get_memory_resource() == other->get_memory_resource()
.*this
and other
.*this
and other
are not interchanged.The Boyer-Moore searcher implements the Boyer-Moore search algorithm. The Boyer-Moore-Horspool searcher implements theBoyer-Moore-Horspool search algorithm. In general, the Boyer-Moore searcher will use more memory and give better run-time performance than Boyer-Moore-Horspool.
boyer_moore_searcher
boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
Hash hf = Hash(),
BinaryPredicate pred = BinaryPredicate());
BinaryPredicate
or RandomAccessIterator1
,
or by the default constructor, copy constructor, or the copy assignment operator of the value type of RandomAccessIterator1
,
or the copy constructor or operator()
of BinaryPredicate
or Hash
.
May throw bad_alloc
if cannot allocate additional memory for internal data structures needed.boyer_moore_horspool_searcher
template<class RandomAccessIterator1,
class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
class BinaryPredicate = equal_to<>>
class boyer_moore_horspool_searcher {
public:
boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
template<class RandomAccessIterator2>
RandomAccessIterator2
operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
private:
RandomAccessIterator1 pat_first_; // exposition only
RandomAccessIterator1 pat_last_; // exposition only
Hash hash_; // exposition only
BinaryPredicate pred_; // exposition only
};
boyer_moore_horspool_searcher(
RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
BinaryPredicate
or RandomAccessIterator1
,
or by the default constructor, copy constructor, or the copy assignment operator of the value type of RandomAccessIterator1
or the copy constructor or operator()
of BinaryPredicate
or Hash
.
May throw bad_alloc
if the system cannot allocate additional memory for internal data structures needed.
optional
for object typestemplate <class T>
class optional
{
// 5.3.5, Observers
constexpr T const* operator ->() const;
constexpr T* operator ->();
constexpr T const& operator *() const &;
constexpr T& operator *() &;
constexpr T&& operator *() &&;
constexpr const T&& operator *() const &&;
constexpr explicit operator bool() const noexcept;
constexpr T const& value() const &;
constexpr T& value() &;
constexpr T&& value() &&;
constexpr const T&& value() const &&;
template <class U> constexpr T value_or(U&&) const &;
template <class U> constexpr T value_or(U&&) &&;
};
constexpr T&& operator*() &&; constexpr const T&& operator*() const &&;
*this
contains a valuereturn std::move(*val);
is_move_constructible_v<T>
is false
, the program is ill-formed.constexpr explicit operator bool() const noexcept;
constexpr T&& value() &&; constexpr const T&& value() const &&;
return bool(*this) ? std::move(*val) : throw bad_optional_access();
is_move_constructible_v<T>
is false
, the program is ill-formed.any
namespace std {
namespace experimental {
inline namespace fundamentals_v1 {
class any
{
public:
// 6.3.1, any construct/destruct
template <class Allocator>
any(allocator_arg_t, const Allocator& a) noexcept;
template <class Allocator, class ValueType>
any(allocator_arg_t, const Allocator& a, ValueType&& value);
template <class Allocator>
any(allocator_arg_t, const Allocator& a, const any& other);
template <class Allocator>
any(allocator_arg_t, const Allocator& a, any&& other) noexcept;
};
} // namespace fundamentals_v1
} // namespace experimental
} // namespace std
any
Implementations should avoid the use of dynamically allocated memory for a small contained object.
nothrow copyable typestypes T
for which is_nothrow_move_constructible_v<T>
is true.
any
construct/destructany(const any& other);
template <class Allocator>
any(allocator_arg_t, const Allocator& a) noexcept; template <class Allocator, class ValueType>
any(allocator_arg_t, const Allocator& a, ValueType&& value); template <class Allocator>
any(allocator_arg_t, const Allocator& a, const any& other); template <class Allocator>
any(allocator_arg_t, const Allocator& a, any&& other) noexcept;
Allocator
shall meet the requirements for an Allocator (