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


Groups > de.comp.lang.iso-c++ > #2047

Re: bedingte Ueberladung

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Stefan Reuther <stefan.news@arcor.de>
Newsgroups de.comp.lang.iso-c++
Subject Re: bedingte Ueberladung
Date Wed, 17 May 2017 18:50:21 +0200
Organization A noiseless patient Spider
Lines 25
Sender "Moderation de.comp.lang.iso-c++" <dclisocpp+mod@elaboris.de>
Approved White-List <dclisocpp+mod@elaboris.de>
Message-ID <ofi61e.28c.1@stefan.msgid.phost.de> (permalink)
References <ofcu9s.18s.1@stefan.msgid.phost.de> <87r2zomzfn.fsf@mid.deneb.enyo.de>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="8d1475df3ccc594946cb2d7ba3f5fcbf"; logging-data="17068"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4f783soCuJFpvOeV0Ff1P"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 Hamster/2.1.0.1538
Xref csiph.com de.comp.lang.iso-c++:2047

Show key headers only | View raw


Am 16.05.2017 um 20:25 schrieb Florian Weimer:
> * Stefan Reuther:
>> 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.
> 
> Funktioniert das auf s390? Siehe zum Beispiel:

Keine Ahnung, hast du mal ein System zum Testen? :-) Auf x64 vs. x86
funktioniert's jedenfalls.

>   <https://bugzilla.redhat.com/show_bug.cgi?id=1163188>

Es gibt noch einen zweiten Overload mit uint32_t.

Die Idee ist: wenn size_t == uint32_t, dann nehmen sowohl die Aufrufe
'foo(size_t(1))' als auch 'foo(uint32_t(1))' diesen ersten Overload. Der
zweite muss dann nur einen anderen Datentyp haben, der in der
Overload-Auflösung schlechter dasteht. Das wäre hier 'uint64_t', könnte
aber sicher auch jeder andere Integer-Typ sein.


  Stefan

Back to de.comp.lang.iso-c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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