codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#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() { }
Private
[
?
]
Run code
Submit