signature

Discussion in 'C++' started by Tony Johansson, May 24, 2005.

  1. Hello !!


    I do know that the name and the parameter are includet in a methode
    signature but what abot the return type are then also includet in the
    signature.

    //Tony
     
    Tony Johansson, May 24, 2005
    #1
    1. Advertising

  2. Tony Johansson wrote:

    > Hello !!
    >
    >
    > I do know that the name and the parameter are includet in a methode
    > signature but what abot the return type are then also includet in the
    > signature.



    When we are talking in general, we usually consider the return type to be part of the
    function signature.

    When we are talking about function overloading specifically, the return type does not
    matter on which function will be called.



    --
    Ioannis Vranos

    http://www23.brinkster.com/noicys
     
    Ioannis Vranos, May 24, 2005
    #2
    1. Advertising

  3. Tony Johansson wrote:
    >
    > Hello !!
    >
    > I do know that the name and the parameter are includet in a methode
    > signature but what abot the return type are then also includet in the
    > signature.
    >


    No.

    --
    Karl Heinz Buchegger
     
    Karl Heinz Buchegger, May 24, 2005
    #3
  4. Tony Johansson

    Jaspreet Guest

    Tony Johansson wrote:
    > Hello !!
    >
    >
    > I do know that the name and the parameter are includet in a methode
    > signature but what abot the return type are then also includet in the


    > signature.
    >
    > //Tony


    I guess you are talking in reference to function overloading. If that
    is so then the return type is ir-relevant. The number or type of
    arguments should be different for functions to be overloaded.

    There is something called function prototype which is of the form:
    return_type function_name (arguments);

    Not sure though what your context is..
     
    Jaspreet, May 24, 2005
    #4
  5. Tony Johansson

    MJ Guest

    Hi
    You can not overload the function based on the return type, even though
    the return type is included in the signature
    MJ
     
    MJ, May 24, 2005
    #5
  6. Rolf Magnus wrote:

    > From the C++ standard:
    >
    > 1.3.10 signature defns.signature]
    > the information about a function that participates in overload resolution
    > (13.3): the types of its parameters and, if the function is a class member,
    > the cv- qualifiers (if any) on the function itself and the class in which
    > the member function is declared.2) The signature of a template function
    > specialization includes the types of its template arguments (14.5.5.1).
    >
    > [...]
    >
    > 2) Function signatures do not include return type, because that does not
    > participate in overload resolution.



    However return types are taken under consideration when using pointers to functions.


    --
    Ioannis Vranos

    http://www23.brinkster.com/noicys
     
    Ioannis Vranos, May 24, 2005
    #6
  7. Tony Johansson

    Rolf Magnus Guest

    MJ wrote:

    > Hi
    > You can not overload the function based on the return type, even though
    > the return type is included in the signature


    From the C++ standard:

    1.3.10 signature defns.signature]
    the information about a function that participates in overload resolution
    (13.3): the types of its parameters and, if the function is a class member,
    the cv- qualifiers (if any) on the function itself and the class in which
    the member function is declared.2) The signature of a template function
    specialization includes the types of its template arguments (14.5.5.1).

    [...]

    2) Function signatures do not include return type, because that does not
    participate in overload resolution.
     
    Rolf Magnus, May 24, 2005
    #7
  8. Tony Johansson

    Ron Natalie Guest

    Ioannis Vranos wrote:

    > However return types are taken under consideration when using pointers
    > to functions.
    >

    That's because the return type is part of the function TYPE. When you
    declare a pointer to function, you're declaring a pointer to some
    function type.

    SIGNATURE is the stuff that applies to overloading (as posted earlier).
    The return type is not a factor in overloading.

    While people frequently intermix TYPE and SIGNATURE in conversation,
    they are not the same thing.
     
    Ron Natalie, May 24, 2005
    #8
  9. Ron Natalie wrote:

    > That's because the return type is part of the function TYPE. When you
    > declare a pointer to function, you're declaring a pointer to some
    > function type.
    >
    > SIGNATURE is the stuff that applies to overloading (as posted earlier).
    > The return type is not a factor in overloading.
    >
    > While people frequently intermix TYPE and SIGNATURE in conversation,
    > they are not the same thing.



    Interesting. Thanks for the clarification. :)


    --
    Ioannis Vranos

    http://www23.brinkster.com/noicys
     
    Ioannis Vranos, May 24, 2005
    #9
  10. Tony Johansson

    Ron Natalie Guest

    Ron Natalie wrote:
    > Ioannis Vranos wrote:
    >
    >> However return types are taken under consideration when using pointers
    >> to functions.
    >>

    > That's because the return type is part of the function TYPE. When you
    > declare a pointer to function, you're declaring a pointer to some
    > function type.
    >
    > SIGNATURE is the stuff that applies to overloading (as posted earlier).
    > The return type is not a factor in overloading.
    >
    > While people frequently intermix TYPE and SIGNATURE in conversation,
    > they are not the same thing.


    I should further point out that the SIGNATURE includes the name of
    the function (along with the types of the arguments) where as the
    type does not include the name.
     
    Ron Natalie, May 24, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Loupatty

    The check of the signature failed

    Richard Loupatty, Apr 15, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    1,289
    Richard Loupatty \(MIO\)
    Apr 20, 2004
  2. caldera

    digital signature usage in asp.net

    caldera, Apr 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    672
    caldera
    Apr 22, 2004
  3. JJBW
    Replies:
    1
    Views:
    10,331
    Joerg Jooss
    Apr 24, 2004
  4. Jake

    Error: Signature has zero size.

    Jake, Apr 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    591
  5. Gustavo Narea
    Replies:
    14
    Views:
    876
    Gustavo Narea
    Feb 16, 2009
Loading...

Share This Page