How to separate interface and implementation when refering to a constant function

This is a discussion on How to separate interface and implementation when refering to a constant function within the C++ Programming forums, part of the General Programming Boards category; //----[some header file] class g_cSomeClass { public: g_cSomeClass(const g_cSomeClass & p_scSomeClass); ~g_cSomeClass(); void GetSomething(); }; //----[some cpp file]------------------ inline g_cSomeClass::g_cSomeClass(const ...

  1. #1
    Unregistered
    Guest

    How to separate interface and implementation when refering to a constant function

    //----[some header file]

    class g_cSomeClass
    {
    public:
    g_cSomeClass(const g_cSomeClass & p_scSomeClass);
    ~g_cSomeClass();

    void GetSomething();
    };

    //----[some cpp file]------------------

    inline g_cSomeClass::g_cSomeClass(const p_scSomeClass)
    {
    p_scSomeClass.GetSomething();
    }

    inline g_cSomeClass::~g_cSomeClass()
    {
    }
    inline void g_cSomeClass::getSomething()
    {
    }

    How to make the getSomething member function a constant member function without moving it to another file?

  2. #2
    Unregistered
    Guest
    have you tried:


    inline void g_cSomeClass::getSomething() const

  3. #3
    Unregistered
    Guest
    lol.

    I thought I had tried that, but obiously I hadn't. Thanks, if you wouldn't have told me I'd probably be stuck with it still.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 06-17-2009, 05:20 PM
  2. How to get RSSI value, send to sensor, sensor receive package, repackage it?
    By techissue2008 in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-04-2009, 10:13 AM
  3. interface implementation
    By George2 in forum C# Programming
    Replies: 2
    Last Post: 05-04-2008, 01:46 AM
  4. interface, implementation, & application files
    By trongsi in forum C++ Programming
    Replies: 4
    Last Post: 04-08-2006, 03:11 PM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21