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


Groups > comp.lang.c > #22312

Re: Determining the 'type' of a variable, if only its name is given

Message-ID <4FDC380B.6060805@loria.fr> (permalink)
Date 2012-06-16 09:38 +0200
From Jens Gustedt <jens.gustedt@loria.fr>
Newsgroups comp.lang.c
Subject Re: Determining the 'type' of a variable, if only its name is given
References <caa6501b-646a-4ca3-85a2-a15bf7271d90@h41g2000yqm.googlegroups.com> <966f3de9-bf1f-418a-b3e0-fbeecfa241a5@j10g2000yqd.googlegroups.com> <4FDB48C6.6030802@loria.fr> <a41nlfFg0U1@mid.individual.net>
Organization Guest of ProXad - France

Show all headers | View raw


Am 15.06.2012 23:27, schrieb Ian Collins:
> On 06/16/12 02:37 AM, Jens Gustedt wrote:
>> Am 15.06.2012 10:51, schrieb John Reye:
>> with C11's _Generic you may do that, provided your implementation
>> hasn't extended integer types that are narrower than int,
>>
>> you can do something horrible like
>>
> <snip something horrible>

>
> This could go in a header somewhere:

sure it should, I think nobody ever considered using _Generic directly
in user code. The committee didn't even bother to provide a standard
"renaming" macro for it, like "bool" for "_Bool" or "alignas" for
"_Alignas".

> it's similar to C++'s use of the numeric_limits template.

generally speaken, _Generic in many places can be used where in C++
there would be a template, yes. And now that we have it in the
language effectively one could think of phasing out all these
individual MIN/MAX macros by just one for each purpose. I'll work on
that.

Jens

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


Thread

Determining the 'type' of a variable, if only its name is given John Reye <jononanon@googlemail.com> - 2012-06-15 01:47 -0700
  Re: Determining the 'type' of a variable, if only its name is given John Reye <jononanon@googlemail.com> - 2012-06-15 01:51 -0700
    Re: Determining the 'type' of a variable, if only its name is given James Kuyper <jameskuyper@verizon.net> - 2012-06-15 08:18 -0400
      Re: Determining the 'type' of a variable, if only its name is given "BartC" <bc@freeuk.com> - 2012-06-15 13:43 +0100
      Re: Determining the 'type' of a variable, if only its name is given Noob <root@127.0.0.1> - 2012-06-15 17:02 +0200
        Re: Determining the 'type' of a variable, if only its name is given Robert Miles <milesrf@Usenet-News.net> - 2012-07-23 23:20 -0500
    Re: Determining the 'type' of a variable, if only its name is given pete <pfiland@mindspring.com> - 2012-06-15 08:21 -0400
    Re: Determining the 'type' of a variable, if only its name is given Jens Gustedt <jens.gustedt@loria.fr> - 2012-06-15 16:37 +0200
      Re: Determining the 'type' of a variable, if only its name is given Ian Collins <ian-news@hotmail.com> - 2012-06-16 09:27 +1200
        Re: Determining the 'type' of a variable, if only its name is given Jens Gustedt <jens.gustedt@loria.fr> - 2012-06-16 09:38 +0200
      Re: Determining the 'type' of a variable, if only its name is given Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-22 20:42 -0700
        Re: Determining the 'type' of a variable, if only its name is given Jens Gustedt <jens.gustedt@loria.fr> - 2012-06-23 14:41 +0200
          Re: Determining the 'type' of a variable, if only its name is given Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-24 10:15 -0700
    Re: Determining the 'type' of a variable, if only its name is given Tim Rentsch <txr@alumni.caltech.edu> - 2012-06-22 20:31 -0700

csiph-web