2

Here - https://en.cppreference.com/w/cpp/container/vector/operator_at it says that operator[] has no noexcept specifier. But If I write:

cout << noexcept(declval<vector<float>>()[declval<size_t>()]) << endl;

I get:

true

Compiled with g++.exe (Rev2, Built by MSYS2 project) 11.2.0. Compilation flags: -std=c++20 -pedantic.

Aisec Nory
  • 385
  • 1
  • 8

0 Answers0