Files
openmethod/doc/modules/ROOT/examples/rolex/3/roles.hpp
Jean-Louis Leroy 626c74960a doc
2025-10-13 20:45:23 -04:00

29 lines
657 B
C++

// Copyright (c) 2018-2025 Jean-Louis Leroy
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
// tag::content[]
// roles.hpp
#ifndef ROLES_HPP
#define ROLES_HPP
#include <boost/openmethod.hpp>
struct Employee { virtual ~Employee() = default; };
struct Salesman : Employee {
double sales = 0.0;
};
BOOST_OPENMETHOD(pay, (boost::openmethod::virtual_ptr<const Employee>), double);
BOOST_OPENMETHOD_INLINE_OVERRIDE(
pay, (boost::openmethod::virtual_ptr<const Employee>), double) {
return 5000.0;
}
#endif // ROLES_HPP
// end::content[]