10 Temmuz 2018 Salı

Comparison Operators

Giriş
C++'ta kullanılabilen Comparison Operators toplam 6 tane.
1. Equal to
2. Not Equal To
3. Greater than
4. Less than
5. Greater than or equal to
6. Less then or equal to
7. Three-way comparison operator - C++20 ile geliyor

Tüm Comparison Operators için STL metodları Mevcut
Açıklaması şöyle
All the basic comparisons (<, <=, ==, !=, >=, >) have an associated function object (std::less, std::less_equal, std::equal_to, std::not_equal_to, std::greater_equal, std::greater).
En son eklenen spaceship için de açıklama şöyle
std::compare_three_way is the function object for three-way comparison (aka. spaceship operator).
Comparison Operators Virtual Olabilir
Bütün metodlar gibi bu operatörler istenirse virtual olabiliyorlar.

1. Equal to - ==
Comparison Operators - Equal to metodu yazısına taşıdım.

7. Three-way comparison operator - C++20 ile geliyor
Three-way comparison operator yazısına taşıdım

Hiç yorum yok:

Yorum Gönder