Need of clarification - Thinking in C++ Vol 2 - Practical Programming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ManicQin

    #1

    Need of clarification - Thinking in C++ Vol 2 - Practical Programming

    The entire text is linked down...

    I came across the next remark:
    "The reason, albeit obscure, is that a library implementation is
    allowed to give C linkage (meaning that the function name does not
    contain all the auxiliary information[56] that normal C++ functions
    do) to functions inherited from the C language. If this is the case,
    the cast fails because transform is a C++ function template and
    expects its fourth argument to have C++ linkage and a cast is not
    allowed to change the linkage. What a predicament!"



    I'm guessing that it refers to the function signature can you direct
    me to resources about the differences?

    Thanks
  • Bo Persson

    #2
    Re: Need of clarification - Thinking in C++ Vol 2 - Practical Programming

    ManicQin wrote:
    The entire text is linked down...
    >
    I came across the next remark:
    "The reason, albeit obscure, is that a library implementation is
    allowed to give C linkage (meaning that the function name does not
    contain all the auxiliary information[56] that normal C++ functions
    do) to functions inherited from the C language. If this is the case,
    the cast fails because transform is a C++ function template and
    expects its fourth argument to have C++ linkage and a cast is not
    allowed to change the linkage. What a predicament!"
    >

    >
    I'm guessing that it refers to the function signature can you direct
    me to resources about the differences?
    >
    Thanks
    It just says that functions from the C library might actually be C
    functions, and not C++ functions. As C++ functions can be overloaded,
    they are allowed to be different. The standard doesn't say how.


    Bo Persson


    Comment

    Working...