const functions?

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

    const functions?

    Does the two below declarations mean the same?


    iterator find(const key_type &) const;

    iterator find(key_type const &) const;


    As can be seen they only differ by the const in the argument.
  • Victor Bazarov

    #2
    Re: const functions?

    saneman wrote:
    Does the two below declarations mean the same?
    >
    >
    iterator find(const key_type &) const;
    >
    iterator find(key_type const &) const;
    >
    >
    As can be seen they only differ by the const in the argument.
    They don't differ. The position of 'const' WRT the type it
    makes const does not matter.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask


    Comment

    Working...