Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #756

tertiary results of compiler-generated comparison operators

Message-ID <8f689b00-26f7-4ee8-8bc2-75d98834ec8e@googlegroups.com> (permalink)
Newsgroups comp.std.c++
From Arno Schoedl <arnoschoedl@googlemail.com>
Subject tertiary results of compiler-generated comparison operators
Organization unknown
Date 2015-05-19 01:59 -0600

Show all headers | View raw


Hello,

there as been some discussion recently about default compiler-generated
comparison operators, for example automatically generating operator< for
structs.

For total orders, often (hierarchical comparisons, strings, etc.) a
tertiary result (< or > or ==) can be generated for only a little more
runtime effort than a binary result (< or >=).

It would be a shame if any compiler generated comparisons would not expose
such tertiary result, because one would need to either manually implement
them or resort to the inefficiency of two calls to <.

For efficiency, any compiler-generated function should also be able to
internally use custom tertiary comparisons.

Arno


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextNext in thread | Find similar


Thread

tertiary results of compiler-generated comparison operators Arno Schoedl <arnoschoedl@googlemail.com> - 2015-05-19 01:59 -0600
  Re: tertiary results of compiler-generated comparison operators Öö Tiib <ootiib@hot.ee> - 2015-05-21 21:09 -0600

csiph-web