GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::char_traits::lt - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. string
  3. char_traits
  4. lt

最終更新日時: 2026年09月16日 21時49分06秒 (JST)
rotarymars が更新

履歴 編集

function
<string>

std::char_traits::lt

static bool lt(const char_type& c1, const char_type& c2);      // C++98
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;
  }
}

出力

less

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.