Skip to content

atl/base.hpp

Freestanding essentials: the small subset of <type_traits> and <utility> the SDK needs.

template <class E> class initializer_list
constexpr initializer_list() noexcept;
constexpr size_t size() const noexcept;

Returns size_t

constexpr const E *begin() const noexcept;

Returns const E *

constexpr const E *end() const noexcept;

Returns const E *

using size_t = ::size_t;
template <class T> using remove_reference_t = typename remove_reference<T>::type;

Removes a reference from T (std::remove_reference).

template <class T> using remove_cvref_t = typename remove_cv<remove_reference_t<T>>::type;

Removes references and const/volatile from T (std::remove_cvref).

template <class T> constexpr remove_reference_t<T> &&move(T &&v) noexcept;

Casts to an rvalue reference so the value can be moved from (std::move).

Parameters

  • v (sm::Container &)

Returns remove_reference_t<sm::Container &> &&

template <class T> constexpr T &&forward(remove_reference_t<T> &v) noexcept;

Passes an argument on with its original value category (std::forward).

Parameters

  • v (remove_reference_t<sm::Container> &)

Returns sm::Container &&

template <class T> constexpr T &&forward(remove_reference_t<T> &&v) noexcept;

Passes an argument on with its original value category (std::forward).

Parameters

  • v (remove_reference_t<T> &&)

Returns T &&

template <class T> void swap(T &a, T &b) noexcept;

Exchanges two values by moving (std::swap).

Parameters

  • a (atl::Function<void ()>::Base *&)
  • b (atl::Function<void ()>::Base *&)
template <bool B, class T = void> using enable_if_t = typename enable_if<B, T>::type;
template <size_t N> using make_index_sequence = typename make_index_sequence_impl<N>::type;
template <class T> constexpr T min(T a, T b);

The smaller of two values.

Parameters

  • a (unsigned long)
  • b (unsigned long)

Returns unsigned long

template <class T> constexpr T max(T a, T b);

The larger of two values.

Parameters

  • a (unsigned long)
  • b (unsigned long)

Returns unsigned long

template <class T> struct remove_reference
using type = T;
template <class T> struct remove_cv
using type = T;

Removes a template from overload resolution unless B is true (std::enable_if).

template <bool B, class T = void> struct enable_if

A compile-time list of indices, used to expand tuples and struct fields (std::index_sequence).

template <size_t... I> struct index_sequence
template <size_t N, size_t... I> struct make_index_sequence_impl : make_index_sequence_impl<N - 1, N - 1, I...>