Overloading a function with const input parameter?

Discussion in 'C++' started by Plissken.s@gmail.com, Feb 27, 2006.

  1. Guest

    Hi,

    Is it possible to over load a function of a class with const input
    parameter ?
    class A {
    public:
    void aFunc(const B& b);
    void aFunc(B& b);
    }

    and they have different implementation:
    A::aFunc(const B& b) {
    //....
    }
    A::aFunc(B& b) {
    //....
    }
    , Feb 27, 2006
    #1
    1. Advertising

  2. wrote:
    > Is it possible to over load a function of a class with const input
    > parameter ?
    > class A {
    > public:
    > void aFunc(const B& b);
    > void aFunc(B& b);
    > }
    >
    > and they have different implementation:
    > A::aFunc(const B& b) {
    > //....
    > }
    > A::aFunc(B& b) {
    > //....
    > }


    Why ask when you can simply try it?

    V
    --
    Please remove capital As from my address when replying by mail
    Victor Bazarov, Feb 27, 2006
    #2
    1. Advertising

  3. Guest

    yes its possible, and as vic said, try and c
    , Feb 27, 2006
    #3
    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. Polanski24
    Replies:
    1
    Views:
    547
    Rolf Magnus
    Apr 11, 2005
  2. Replies:
    11
    Views:
    1,099
  3. Javier
    Replies:
    2
    Views:
    558
    James Kanze
    Sep 4, 2007
  4. 0m
    Replies:
    26
    Views:
    1,110
    Tim Rentsch
    Nov 10, 2008
  5. fungus
    Replies:
    13
    Views:
    882
    fungus
    Oct 31, 2008
Loading...

Share This Page