Boost logo

Boost :

From: Haruhiko Okumura (okumura_at_[hidden])
Date: 2000-01-09 03:43:36


From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
Subject: [boost] operator< for points (geometry classes)
Date: Sun, 9 Jan 2000 02:29:57 -0600

> template<class T1, class T2>
> bool operator <( const point<T1, T2>& p1, const point<T1, T2>& p2 ) {
> return p1.x() < p2.x() || ( p1.x() == p2.x() && p1.y() < p2.y() );
> }

This scan-line (or dictionary) ordering seems much more natural to me.
It can be used e.g. to merge two sets of geometrical events and locate
duplicate ones...

-- 
Haruhiko Okumura <okumura_at_[hidden]>
Matsusaka University, 1846 Kubo-cho, Matsusaka, 515-8511 Japan
Phone: +81-598-29-1122  Fax: +81-598-29-1014
http://www.matsusaka-u.ac.jp/~okumura/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk