2008-02-18から1日間の記事一覧

Barton-Nackman trick

C++

friend関数をクラススコープ内で定義する手法が Barton-Nackmand trick(もしくはBarton and Nackman trick)と呼ばれている 以下がその例である template <class T> class equal_comparable { // Tクラスの==演算子を使って!=演算子を定義 friend bool operator!=(cons</class>…