array.zero-2は言う:ケースN == 0
、begin() == end()
==ユニークな値でbegin()== end()とは何ですか?
。 の戻り値は
data()
で、指定されていません。
このユニークな値は何を意味しますか?式begin() == end()
の結果が一意の値であることを意味しますか?ブールは真実でも虚偽でもなく、それはあまりユニークではないので、私はそれがどのように意味を成しているかはわかりません。私は次のテストを行った:
#include <array>
#include <iostream>
#include <iomanip>
#include <type_traits>
int main()
{
std::array<int, 0> test;
auto b = test.begin();
auto e = test.end();
std::cout << std::boolalpha
<< (test.begin() == test.end())
<< std::is_same<bool, decltype(test.begin() == test.end())>::value
<< std::is_same<bool, decltype(b == e)>::value;
}
すべての出力は、期待通りにtrue
です。次に、ゼロサイズでない配列では違うかもしれないと思った。
int main()
{
std::array<int, 0> test;
std::array<int, 1> test2;
std::cout << std::boolalpha
<< std::is_same<
decltype(test.begin() == test.end()),
decltype(test2.begin() == test2.end())
>::value
<< std::is_same<
decltype(test.begin()),
decltype(test2.begin())
>::value;
}
また、では、「ユニークな価値」とはどういう意味ですか?ユニークな価値は何ですか?