Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.iso-c++ > #2045
| From | Stefan Reuther <stefan.news@arcor.de> |
|---|---|
| Newsgroups | de.comp.lang.iso-c++ |
| Subject | Re: bedingte Ueberladung |
| Date | 2017-05-16 19:02 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <offic5.42o.1@stefan.msgid.phost.de> (permalink) |
| References | <ofcu9s.18s.1@stefan.msgid.phost.de> <bedingte-Ueberladung-20170516114531@ram.dialup.fu-berlin.de> |
Am 16.05.2017 um 12:47 schrieb Stefan Ram: > Stefan Reuther <stefan.news@arcor.de> writes: >> Als Workaround hab ich jetzt erstmal ein >> void foo(if_then_else<is_same_type<uint32_t,size_t>::value, >> uint64_t, size_t>::type); >> sprich, "wenn uint32_t gleich size_t, überlade das auch noch für >> uint64_t"; das geht in dem Fall zufällig und stört nicht. > > Etwas Besseres fällt mir derzeit auch nicht ein. > > Du könntest vielleicht noch »uint64_t« durch einen > Einmaltyp ersetzen, der von außen nicht erreichbar ist, > falls es später einmal Fälle geben sollte, in denen die > unerwünschte Überladung stören sollte. Der Einmaltyp scheitert daran, dass der Funktionsrumpf ja weiterhin gültig sein muss. Im Funktionsrumpf wird mit dem Parameter gerechnet, also müsste ich die Rechenoperatoren für den Einmaltyp auch noch wenigstens deklarieren. Davon geht die Welt nicht unter, macht's aber noch unübersichtlicher. Stefan
Back to de.comp.lang.iso-c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
bedingte Ueberladung Stefan Reuther <stefan.news@arcor.de> - 2017-05-15 19:07 +0200
Re: bedingte Ueberladung ram@zedat.fu-berlin.de (Stefan Ram) - 2017-05-16 10:47 +0000
Re: bedingte Ueberladung Stefan Reuther <stefan.news@arcor.de> - 2017-05-16 19:02 +0200
Re: bedingte Ueberladung Markus Schaaf <mschaaf@elaboris.de> - 2017-05-16 13:44 +0200
Re: bedingte Ueberladung Stefan Reuther <stefan.news@arcor.de> - 2017-05-16 18:59 +0200
Re: bedingte Ueberladung Florian Weimer <fw@deneb.enyo.de> - 2017-05-16 20:25 +0200
Re: bedingte Ueberladung Stefan Reuther <stefan.news@arcor.de> - 2017-05-17 18:50 +0200
Re: bedingte Ueberladung Florian Weimer <fw@deneb.enyo.de> - 2017-05-17 19:56 +0200
csiph-web