名前空間
変種
操作

std::unordered_map::empty

提供: cppreference.com

 
 
 
std::unordered_map
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::unordered_map
unordered_map::~unordered_map
unordered_map::operator=
unordered_map::get_allocator
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::begin
unordered_map::cbegin
unordered_map::end
unordered_map::cend
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::erase
unordered_map::size
unordered_map::max_size
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::clear
unordered_map::insert
unordered_map::emplace
unordered_map::emplace_hint
unordered_map::erase
unordered_map::swap
ルック
Original:
Lookup
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::count
unordered_map::find
unordered_map::equal_range
バケットインターフェイス
Original:
Bucket interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::begin2
unordered_map::end2
unordered_map::bucket_count
unordered_map::max_bucket_count
unordered_map::bucket_size
unordered_map::bucket
ハッシュポリシー
Original:
Hash policy
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::load_factor
unordered_map::max_load_factor
unordered_map::rehash
unordered_map::reserve
オブザーバー
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unordered_map::hash_function
unordered_map::key_eq
 
bool empty() const;
(C++11およびそれ以降)
小切手コンテナに要素がない場合、すなわちかどうかbegin() == end().
Original:
Checks if the container has no elements, i.e. whether begin() == end().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

true容器が空であれば、そうでなければfalse
Original:
true if the container is empty, false otherwise
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

noexcept specification:  
noexcept
  (C++11およびそれ以降)

[編集] 複雑

定数
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

次のコードは、emptyに要素が含まれているかどうかをチェックするためにstd::unordered_map<int>使用しています
Original:
The following code uses empty to check if a std::unordered_map<int> contains any elements:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <unordered_map>
#include <iostream>
 
int main()
{
    std::unordered_map<int> numbers;
    std::cout << "Initially, numbers.empty(): " << numbers.empty() << '\n';
 
    numbers.push_back(42);
    numbers.push_back(13317); 
    std::cout << "After adding elements, numbers.empty(): " << numbers.empty() << '\n';
}

Output:

Initially, numbers.empty(): 1
After adding elements, numbers.empty(): 0

See also

要素数を返します
Original:
returns the number of elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]