mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 04:52:22 +00:00
started advanced topics section in the docs
This commit is contained in:
27
example/features/override_overload.cpp
Normal file
27
example/features/override_overload.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
//[override_overload
|
||||
class a
|
||||
#define BASES public b
|
||||
: BASES
|
||||
{
|
||||
public:
|
||||
typedef BOOST_CONTRACT_BASE_TYPES(BASES) base_types;
|
||||
#undef BASES
|
||||
|
||||
void f(int x, boost::contract::virtual_* v = 0) /* override */ {
|
||||
auto c = boost::contract::public_function<override_f>(
|
||||
v, &a::f, this, x);
|
||||
/* ... */
|
||||
}
|
||||
|
||||
void f(double x, boost::contract::virtual_* v = 0) /* override */ {
|
||||
auto c = boost::contract::public_function<override_f>(
|
||||
v, &a::f, this, x);
|
||||
/* ... */
|
||||
}
|
||||
|
||||
private:
|
||||
BOOST_CONTRACT_OVERRIDE(f)
|
||||
};
|
||||
//]
|
||||
|
||||
Reference in New Issue
Block a user