Код: Выделить всё
#include
#include
using ConstInt = int const;
using ConstStr = std::string const;
static_assert(std::same_as); // true
static_assert(std::same_as); // false!!!
static_assert(std::same_as); // true
int main() {
}
< /code>
Обратите внимание, что: static_assert (std :: some_as ); // false !!! См. Также: https://godbolt.org/z/fpkhdbrj1образно>
Подробнее здесь: https://stackoverflow.com/questions/796 ... -not-const
Мобильная версия