Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 760 Bytes

lt.md

File metadata and controls

47 lines (35 loc) · 760 Bytes

lt

  • string[meta header]
  • std[meta namespace]
  • char_traits[meta class]
  • function[meta id-type]
static bool lt(const char_type& c1, const char_type& c2);      // C++03
static constexpr bool lt(char_type c1, char_type c2) noexcept; // C++11

概要

2つの文字を比較し、左辺が右辺より小さいかを判定する。

戻り値

標準で定義されるchar_traitsの特殊化では、c1 < c2の結果を返す。

計算量

定数時間

#include <iostream>
#include <string>

int main()
{
  if (std::char_traits<char>::lt('a', 'b')) {
    std::cout << "less" << std::endl;
  }
  else {
    std::cout << "not less" << std::endl;
  }
}
  • lt[color ff0000]

出力

less

参照