Re: Declaration of "const A &B::A() const" changes meaning of A from "class A"

Discussion in 'C++' started by Alexander Farber, Jun 21, 2005.

  1. Hi,

    Rolf Magnus wrote:
    > Alexander Farber wrote:
    > > In file included from r_dir.cpp:9:
    > > r_obey.h:262: declaration of
    > > `const AreaSet &CObeyFile::AreaSet () const'
    > > r_areaset.h:197: changes meaning of `AreaSet' from `class AreaSet'
    > >
    > > The afore-mentioned line in r_obey.h is:
    > >
    > > class CObeyFile
    > > {
    > > private:
    > > AreaSet iAreaSet;
    > >
    > > public:
    > > const AreaSet& AreaSet() const; // line 262

    >
    > Your function is called AreaSet, just the same as the class.


    but it is a member function (of the class CObeyFile) isn't it?
    I still don't understand, why their names clash

    Regards
    Alex
    Alexander Farber, Jun 21, 2005
    #1
    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. nick
    Replies:
    2
    Views:
    672
    Martin Ambuhl
    Oct 16, 2005
  2. krishna

    declaration meaning

    krishna, May 5, 2006, in forum: C Programming
    Replies:
    24
    Views:
    820
    Keith Thompson
    May 8, 2006
  3. Replies:
    5
    Views:
    1,238
    Dave Rahardja
    Sep 13, 2005
  4. Replies:
    4
    Views:
    742
  5. κÖлª
    Replies:
    2
    Views:
    116
    Thomas 'PointedEars' Lahn
    Jan 3, 2008
Loading...

Share This Page