Re: Detecting static or non-static member function?

Discussion in 'C++' started by Victor Bazarov, Jun 23, 2003.

  1. "A. Schroeder" <> wrote...
    > yes I know it is a very silly question, but can I have a mechanism that
    > uses implementation A if used in a static member function, and
    > implementation B if it is a non-static member function?
    >
    > Meaning if I have
    >
    > class Example
    > {
    > static void foo()
    > {
    > XXX;
    > }
    >
    > void bar()
    > {
    > XXX;
    > }
    > };
    >
    > is there some expression XXX that is same in both functions, legal,
    > but evaluates to something different?


    Can't think of anything at the moment, but have a question: why do
    you think you need that?

    Victor
     
    Victor Bazarov, Jun 23, 2003
    #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. slide_o_mix
    Replies:
    0
    Views:
    446
    slide_o_mix
    Oct 15, 2003
  2. Alex
    Replies:
    0
    Views:
    413
  3. 0to60
    Replies:
    4
    Views:
    545
    jeffc
    Nov 21, 2003
  4. dolphin
    Replies:
    3
    Views:
    1,407
    Pete Becker
    Dec 5, 2007
  5. ittium
    Replies:
    5
    Views:
    463
    88888 Dihedral
    Jan 12, 2012
Loading...

Share This Page