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


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

Re: bedingte Ueberladung

Path csiph.com!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 Tue, 16 May 2017 18:59:46 +0200
Organization A noiseless patient Spider
Lines 26
Sender "Moderation de.comp.lang.iso-c++" <dclisocpp+mod@elaboris.de>
Approved White-List <dclisocpp+mod@elaboris.de>
Message-ID <offi73.42o.1@stefan.msgid.phost.de> (permalink)
References <ofcu9s.18s.1@stefan.msgid.phost.de> <ofeoha$dpk$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="b784d2b797ab49ab99ace6c1ce58c5f1"; logging-data="24500"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0bT66hqfDuyYzKyB9cGSJ"
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++:2044

Show key headers only | View raw


Am 16.05.2017 um 13:44 schrieb Markus Schaaf:
> Am 15.05.2017 um 19:07 schrieb Stefan Reuther:
>> aus verschiedenen Gründen möchte ich eine Funktion einmal für 'uint32_t'
>> überladen und einmal für 'size_t'. Dummerweise ist das auf gängigen
>> Systemen der gleiche zugrundeliegende Datentyp, und zweimal auf den
>> gleichen Typ überladen geht nicht.
> 
> Template-Foo ist ja nett, aber in diesem Fall ist der gute alte
> Präprozessor wohl die richtige Wahl:
> 
> #include <stdint.h>
> 
> void foo( uint32_t );
> 
> #if SIZE_MAX != UINT32_MAX
> 
>   void foo( size_t );
> 
> #endif

Hrmpf. Das ist ja viel zu einfach, um da drauf zu kommen. :-) Löst
diesen Fall aber recht elegand.

Danke,

  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