最終更新日時(UTC):
が更新

履歴 編集

function
<forward_list>

std::forward_list::get_allocator(C++11)

allocator_type get_allocator() const noexcept;

概要

このコンテナで使用されているアロケータオブジェクトを取得する。

戻り値

このコンテナで使用されているアロケータオブジェクト

例外

投げない

#include <cassert>
#include <forward_list>

int main()
{
  std::allocator<int> alloc;
  std::forward_list<int> ls(alloc);

  std::allocator<int> result = ls.get_allocator();

  assert(result == alloc);
}

出力

バージョン

言語

  • C++11

処理系

  • Clang: ??
  • GCC: 4.7.0
  • ICC: ??
  • Visual C++: 2010, 2012, 2013, 2015, 2017
    • 2010は、noexceptが修飾されていない。
    • 2012, 2013は、noexceptが実装されていないため、throw()が修飾されている。

参照