[ create a new paste ] login | about

Link: http://codepad.org/LKGpFAUD    [ raw code | fork ]

uskz - C++, pasted on Feb 2:
#include <iostream>

struct base
{
    void f() const
    {
        // check preconditions here
        f_impl();
        // check postconditions here
    }
private:
    virtual void f_impl() const = 0;
};

struct derived :
    base
{
    void f() const
    {
        // check preconditions here
        f_impl();
        // check postconditions here
    }
private:
    virtual void f_impl() const
    {
        std::cout << "derived::f_impl()" << std::endl;
    }
};

int main()
{ }


Output:
No errors or program output.


Create a new paste based on this one


Comments: