Share via


CStringT::operator ==

2 番目の文字列が論理的に等しいかどうかを判定します。

friend bool operator==(
   const CStringT& str1,
   const CStringT& str2
) throw();
friend bool operator==(
   const CStringT& str1
   PCXSTR psz2
) throw();
friend bool operator==(
   const CStringT& str1,
   PCYSTR psz2
) throw();
friend bool operator==(
   const CStringT& str1,
   XCHAR ch2
) throw();
friend bool operator==(
   PCXSTR psz1
   const CStringT& str2
) throw();
friend bool operator==(
   PCYSTR psz1
   const CStringT& str2,
) throw();
friend bool operator==(
   XCHAR ch1
   const CStringT& str2,
) throw();

パラメーター

  • ch1
    比較の ANSI 形式または Unicode 文字。

  • ch2
    比較の ANSI 形式または Unicode 文字。

  • str1
    比較の CStringT

  • str2
    比較の CStringT

  • psz1
    比較の null で終わる文字列へのポインター。

  • psz2
    比較の null で終わる文字列へのポインター。

解説

左側の文字または文字列が右側の文字列または文字と等しいかどうかをテストし、true または false を適宜返します。

使用例

// typedef CStringT< TCHAR, StrTraitATL< TCHAR > > CAtlString;
CAtlString s1(_T("dog")), s2(_T("f")), s3(_T("dog"));

ASSERT(s1 == _T("dog"));
ASSERT(s2 == _T('f'));
ASSERT(s1 == s3);   

必要条件

ヘッダー: cstringt.h

参照

関連項目

CStringT クラス