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


Groups > comp.lang.c++ > #11070

Re: Limiting function input only to __int64 but not int...

From Richard Damon <news.x.richarddamon@xoxy.net>
Newsgroups comp.lang.c++
Subject Re: Limiting function input only to __int64 but not int...
Date 2011-10-24 20:20 -0400
Organization A noiseless patient Spider
Message-ID <j84vd2$v0k$1@dont-email.me> (permalink)
References <j824fk$5bf$1@gregory.bnet.hr> <c59f1d33-57bf-47f9-b23a-90cfff62c8c3@f36g2000vbm.googlegroups.com> <j83v8f$g91$1@gregory.bnet.hr> <is6ba7hjetjr8g1iaj947qjkfmuu6a27lc@4ax.com> <j84nvl$t9f$1@gregory.bnet.hr>

Show all headers | View raw


On 10/24/11 6:12 PM, A wrote:
> "Robert Wessel"<robertwessel2@yahoo.com>  wrote in message
> news:is6ba7hjetjr8g1iaj947qjkfmuu6a27lc@4ax.com...
>> void f(__int64);  //supply actual definition
>> void f(int)=delete; //can't be called
>
> I actually like this solution but the compiler doesn't support it. I guess
> I'll be looking for alternate solutions.
>
>

if it doesn't support the =delete syntax, declaring (but not defining) 
void f(unsigned char); (choose an integer type that you are actually 
unlikely to mistakenly use) will make a call of f(1) ambiguous and thus 
an error. You want to make the undefined type an unlikely mistake as if 
you use it by mistake, you are just going to get a link error, and you 
will have to search to find where it is actually called.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Limiting function input only to __int64 but not int... "A" <a@a.a> - 2011-10-24 00:28 +0200
  Re: Limiting function input only to __int64 but not int... Ian Collins <ian-news@hotmail.com> - 2011-10-24 11:49 +1300
    Re: Limiting function input only to __int64 but not int... Juha Nieminen <nospam@thanks.invalid> - 2011-10-24 08:08 +0000
      Re: Limiting function input only to __int64 but not int... yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-10-24 14:24 +0000
  Re: Limiting function input only to __int64 but not int... Marc <marc.glisse@gmail.com> - 2011-10-23 22:52 +0000
    Re: Limiting function input only to __int64 but not int... "A" <a@a.a> - 2011-10-24 01:32 +0200
  Re: Limiting function input only to __int64 but not int... Goran <goran.pusic@gmail.com> - 2011-10-23 23:29 -0700
    Re: Limiting function input only to __int64 but not int... "A" <a@a.a> - 2011-10-24 17:11 +0200
      Re: Limiting function input only to __int64 but not int... Robert Wessel <robertwessel2@yahoo.com> - 2011-10-24 12:17 -0500
        Re: Limiting function input only to __int64 but not int... Richard Damon <news.x.richarddamon@xoxy.net> - 2011-10-24 13:49 -0400
        Re: Limiting function input only to __int64 but not int... "A" <a@a.a> - 2011-10-25 00:12 +0200
          Re: Limiting function input only to __int64 but not int... Richard Damon <news.x.richarddamon@xoxy.net> - 2011-10-24 20:20 -0400
          Re: Limiting function input only to __int64 but not int... Christian Gollwitzer <auriocus@gmx.de> - 2011-10-25 07:27 +0200
            Re: Limiting function input only to __int64 but not int... Arne Mertz <arnemertz@googlemail.com> - 2011-10-26 01:02 -0700
  Re: Limiting function input only to __int64 but not int... Marcel Müller <news.5.maazl@spamgourmet.com> - 2011-10-24 09:18 +0200
    Re: Limiting function input only to __int64 but not int... Ian Collins <ian-news@hotmail.com> - 2011-10-24 20:53 +1300
      Re: Limiting function input only to __int64 but not int... Ian Collins <ian-news@hotmail.com> - 2011-10-24 20:58 +1300

csiph-web